Commit e6e267fc authored by Chong Yidong's avatar Chong Yidong

* cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.

* files.el (auto-mode-alist): Add .srt and Project.ede.

* cedet/semantic.el (semantic-mode): Handle
srecode-template-mode-hook as well.

* cedet/srecode/template.el: Remove hook variable.

* cedet/ede/proj-comp.el: Require ede/pmake when compiling.

* cedet/ede.el (ede-target-forms-menu): Don't enable if no
projects exist.

* cedet/srecode/map.el (srecode-map-base-template-dir): Look for
templates in data-directory.

* cedet/ede/srecode.el (ede-srecode-setup): Use default templates
directory.

* cedet/semantic/util-modes.el (semantic-highlight-func-mode): Doc
fix.

* cedet/ede/proj-comp.el (ede-proj-makefile-insert-variables):
Only insert each variable once.

* cedet/ede/pmake.el (ede-pmake-insert-variable-once): New macro.
(ede-pmake-insert-variable-shared): Use it.

* cedet/ede/cpp-root.el (ede-preprocessor-map): Do not deref table
for lexical table iff table is nil.
parent ed6b0195
2009-10-03 Chong Yidong <cyd@stupidchicken.com>
* cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.
* files.el (auto-mode-alist): Add .srt and Project.ede.
* cedet/semantic.el (semantic-mode): Handle
srecode-template-mode-hook as well.
* cedet/srecode/template.el: Remove hook variable.
* cedet/ede/proj-comp.el: Require ede/pmake when compiling.
* cedet/ede.el (ede-target-forms-menu): Don't enable if no
projects exist.
* cedet/srecode/map.el (srecode-map-base-template-dir): Look for
templates in data-directory.
* cedet/ede/srecode.el (ede-srecode-setup): Use default templates
directory.
2009-09-30 Eric Ludlam <zappo@gnu.org>
* cedet/semantic/util-modes.el (semantic-highlight-func-mode): Doc
fix.
* cedet/ede/proj-comp.el (ede-proj-makefile-insert-variables):
Only insert each variable once.
* cedet/ede/pmake.el (ede-pmake-insert-variable-once): New macro.
(ede-pmake-insert-variable-shared): Use it.
* cedet/ede/cpp-root.el (ede-preprocessor-map): Do not deref table
for lexical table iff table is nil.
2009-10-03 Dan Nicolaescu <dann@ics.uci.edu>
* vc.el: Remove commented out code.
......
......@@ -659,7 +659,9 @@ Argument MENU-DEF is the menu definition to use."
"Target Forms"
(let ((obj (or ede-selected-object ede-object)))
(append
'([ "Add File" ede-add-file (ede-current-project) ]
'([ "Add File" ede-add-file
(and (ede-current-project)
(oref (ede-current-project) targets)) ]
[ "Remove File" ede-remove-file
(and ede-object
(or (listp ede-object)
......
......@@ -491,8 +491,8 @@ Also set up the lexical preprocessor map."
(when (not table)
(message "Cannot find file %s in project." F))
(when (and table (semanticdb-needs-refresh-p table))
(semanticdb-refresh-table table))
(setq spp (append spp (oref table lexical-table)))))
(semanticdb-refresh-table table)
(setq spp (append spp (oref table lexical-table))))))
(oref this spp-files))
spp))
......
......@@ -240,20 +240,32 @@ MFILENAME is the makefile to generate."
"Add VARNAME into the current Makefile.
Execute BODY in a location where a value can be placed."
`(let ((addcr t) (v ,varname))
(if (re-search-backward (concat "^" v "\\s-*=") nil t)
(progn
(ede-pmake-end-of-variable)
(if (< (current-column) 40)
(if (and (/= (preceding-char) ?=)
(/= (preceding-char) ? ))
(insert " "))
(insert "\\\n "))
(setq addcr nil))
(insert v "="))
(if (re-search-backward (concat "^" v "\\s-*=") nil t)
(progn
(ede-pmake-end-of-variable)
(if (< (current-column) 40)
(if (and (/= (preceding-char) ?=)
(/= (preceding-char) ? ))
(insert " "))
(insert "\\\n "))
(setq addcr nil))
(insert v "="))
,@body
(if addcr (insert "\n"))
(goto-char (point-max))))
(put 'ede-pmake-insert-variable-shared 'lisp-indent-function 1)
(defmacro ede-pmake-insert-variable-once (varname &rest body)
"Add VARNAME into the current Makefile if it doesn't exist.
Execute BODY in a location where a value can be placed."
`(let ((addcr t) (v ,varname))
(unless (re-search-backward (concat "^" v "\\s-*=") nil t)
(insert v "=")
,@body
(if addcr (insert "\n"))
(goto-char (point-max))))
(put 'ede-pmake-insert-variable-shared 'lisp-indent-function 1)
(goto-char (point-max)))
))
(put 'ede-pmake-insert-variable-once 'lisp-indent-function 1)
;;; SOURCE VARIABLE NAME CONSTRUCTION
......
......@@ -46,6 +46,7 @@
(require 'ede) ;source object
(require 'ede/autoconf-edit)
(eval-when-compile (require 'ede/pmake))
;;; Types:
(defclass ede-compilation-program (eieio-instance-inheritor)
......@@ -256,12 +257,11 @@ This will prevent rules from creating duplicate variables or rules."
(with-slots (variables) this
(mapcar
(lambda (var)
(insert (car var) "=")
(let ((cd (cdr var)))
(if (listp cd)
(mapc (lambda (c) (insert " " c)) cd)
(insert cd)))
(insert "\n"))
(ede-pmake-insert-variable-once (car var)
(let ((cd (cdr var)))
(if (listp cd)
(mapc (lambda (c) (insert " " c)) cd)
(insert cd)))))
variables))))
(defmethod ede-compiler-intermediate-objects-p ((this ede-compiler))
......
......@@ -37,27 +37,13 @@
;;; Code:
(defun ede-srecode-setup ()
"Update various paths to get SRecode to identify our macros."
(let* ((lib (locate-library "ede.el" t))
(ededir (file-name-directory lib))
(tmpdir (file-name-as-directory
(expand-file-name "templates" ededir))))
(when (not tmpdir)
(error "Unable to location EDE Templates directory"))
;; Rig up the map.
(require 'srecode/map)
(require 'srecode/find)
(add-to-list 'srecode-map-load-path tmpdir)
(srecode-map-update-map t)
;; We don't call this unless we need it. Load in the templates.
(srecode-load-tables-for-mode 'makefile-mode)
(srecode-load-tables-for-mode 'makefile-mode 'ede)
;; @todo - autoconf files.
))
"Initialize Srecode for EDE."
(require 'srecode/map)
(require 'srecode/find)
(srecode-map-update-map t)
;; We don't call this unless we need it. Load in the templates.
(srecode-load-tables-for-mode 'makefile-mode)
(srecode-load-tables-for-mode 'makefile-mode 'ede))
(defmacro ede-srecode-insert-with-dictionary (template &rest forms)
"Insert TEMPLATE after executing FORMS with a dictionary.
......
......@@ -176,7 +176,7 @@ For language specific hooks, make sure you define this as a local hook.
This hook should not be used any more.
Use `semantic-after-toplevel-cache-change-hook' instead.")
(make-obsolete-variable 'semantic-after-toplevel-bovinate-hook nil)
(make-obsolete-variable 'semantic-after-toplevel-bovinate-hook nil "23.2")
(defvar semantic-after-toplevel-cache-change-hook nil
"Hooks run after the buffer tag list has changed.
......@@ -661,7 +661,7 @@ Does nothing if the current buffer doesn't need reparsing."
(defun semantic-bovinate-toplevel (&optional ignored)
"Backward Compatibility Function."
(semantic-fetch-tags))
(make-obsolete 'semantic-bovinate-toplevel 'semantic-fetch-tags)
(make-obsolete 'semantic-bovinate-toplevel 'semantic-fetch-tags "23.2")
;; Another approach is to let Emacs call the parser on idle time, when
;; needed, use `semantic-fetch-available-tags' to only retrieve
......@@ -793,7 +793,7 @@ code blocks in methods. If `bovine-inner-scope' can also support
commands, use `semantic-bovinate-from-nonterminal-full'."
(semantic-parse-region start end nonterm depth t))
(make-obsolete 'semantic-bovinate-region-until-error
'semantic-parse-region)
'semantic-parse-region "23.2")
(defsubst semantic-bovinate-from-nonterminal
(start end nonterm &optional depth length)
......@@ -821,7 +821,7 @@ When used in a `lambda' of a MATCH-LIST, there is no need to include
a START and END part."
(semantic-parse-region start end nonterm (or depth 1)))
(make-obsolete 'semantic-bovinate-from-nonterminal-full
'semantic-parse-region)
'semantic-parse-region "23.2")
;;; User interface
......@@ -1055,7 +1055,9 @@ Semantic mode.
(add-hook 'makefile-mode-hook 'semantic-default-make-setup)
(add-hook 'c-mode-hook 'semantic-default-c-setup)
(add-hook 'c++-mode-hook 'semantic-default-c-setup)
(add-hook 'html-mode-hook 'semantic-default-html-setup))
(add-hook 'html-mode-hook 'semantic-default-html-setup)
(add-hook 'html-mode-hook 'semantic-default-html-setup)
(add-hook 'srecode-template-mode-hook 'srecode-template-setup-parser))
;; Disable all Semantic features.
(remove-hook 'mode-local-init-hook 'semantic-new-buffer-fcn)
(remove-hook 'javascript-mode-hook 'wisent-javascript-setup-parser)
......@@ -1066,6 +1068,7 @@ Semantic mode.
(remove-hook 'c-mode-hook 'semantic-default-c-setup)
(remove-hook 'c++-mode-hook 'semantic-default-c-setup)
(remove-hook 'html-mode-hook 'semantic-default-html-setup)
(remove-hook 'srecode-template-mode-hook 'srecode-template-setup-parser)
;; FIXME: handle semanticdb-load-ebrowse-caches
(dolist (mode semantic-submode-list)
......@@ -1104,6 +1107,9 @@ minor mode can be turned on only if semantic feature is available and
the current buffer was set up for parsing. Return non-nil if the
minor mode is enabled." t nil)
(autoload 'srecode-template-setup-parser "srecode/srecode-template"
"Set up buffer for parsing SRecode template files." t nil)
(provide 'semantic)
;; Semantic-util is a part of the semantic API. Include it last
......
......@@ -874,7 +874,7 @@ when it lands in the sticky line."
"Setup option `semantic-stickyfunc-mode'.
For semantic enabled buffers, make the function declaration for the top most
function \"sticky\". This is accomplished by putting the first line of
text for that function in Emacs 21's header line."
text for that function in the header line."
(if semantic-stickyfunc-mode
(progn
(unless (and (featurep 'semantic) (semantic-active-p))
......@@ -911,7 +911,7 @@ Enables/disables making the header line of functions sticky.
A function (or other tag class specified by
`semantic-stickyfunc-sticky-classes') has a header line, meaning the
first line which describes the rest of the construct. This first
line is what is displayed in the Emacs 21 header line.
line is what is displayed in the header line.
With prefix argument ARG, turn on if positive, otherwise off. The
minor mode can be turned on only if semantic feature is available and
......@@ -1149,7 +1149,7 @@ current tag declaration."
;;;###autoload
(defun semantic-highlight-func-mode (&optional arg)
"Minor mode to highlight the first line of the current tag.
Enables/disables making the header line of functions sticky.
Enables/disables making the current function's first line light up.
A function (or other tag class specified by
`semantic-stickyfunc-sticky-classes') is highlighted, meaning the
first line which describes the rest of the construct.
......
......@@ -36,10 +36,7 @@
(defun srecode-map-base-template-dir ()
"Find the base template directory for SRecode."
(let* ((lib (locate-library "srecode.el"))
(dir (file-name-directory lib)))
(expand-file-name "templates/" dir)
))
(expand-file-name "srecode" data-directory))
;;; Current MAP
;;
......@@ -399,7 +396,7 @@ Return non-nil if the map changed."
(list (srecode-map-base-template-dir)
(expand-file-name "~/.srecode/")
)
"*Global load path for SRecode template files."
"Global load path for SRecode template files."
:group 'srecode
:type '(repeat file)
:set 'srecode-map-load-path-set)
......
......@@ -184,7 +184,7 @@ we can tell font lock about them.")
;;;###autoload
(defun srecode-template-mode ()
"Major-mode for writing srecode macros."
"Major-mode for writing SRecode macros."
(interactive)
(kill-all-local-variables)
(setq major-mode 'srecode-template-mode
......
......@@ -39,6 +39,7 @@
ans)
))
;;;###autoload
(defun srecode-template-setup-parser ()
"Setup buffer for parse."
(srecode-template-wy--install-parser)
......@@ -61,10 +62,13 @@
senator-step-at-tag-classes '(function variable)
))
;;;;###autoload
(add-hook 'srecode-template-mode-hook 'srecode-template-setup-parser)
(provide 'srecode/template)
;; Local variables:
;; generated-autoload-file: "loaddefs.el"
;; generated-autoload-feature: srecode/loaddefs
;; generated-autoload-load-name: "srecode/template"
;; End:
;; arch-tag: 037fbca7-e846-4521-b801-3463f50c3080
;;; srecode/template.el ends here
......@@ -2178,6 +2178,7 @@ since only a single case-insensitive search through the alist is made."
("\\.dtx\\'" . doctex-mode)
("\\.org\\'" . org-mode)
("\\.el\\'" . emacs-lisp-mode)
("Project\\.ede\\'" . emacs-lisp-mode)
("\\.\\(scm\\|stk\\|ss\\|sch\\)\\'" . scheme-mode)
("\\.l\\'" . lisp-mode)
("\\.li?sp\\'" . lisp-mode)
......@@ -2237,6 +2238,7 @@ since only a single case-insensitive search through the alist is made."
("\\.f9[05]\\'" . f90-mode)
("\\.indent\\.pro\\'" . fundamental-mode) ; to avoid idlwave-mode
("\\.\\(pro\\|PRO\\)\\'" . idlwave-mode)
("\\.srt\\'" . srecode-template-mode)
("\\.prolog\\'" . prolog-mode)
("\\.tar\\'" . tar-mode)
;; The list of archive file extensions should be in sync with
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment