# HG changeset patch # User Chong Yidong # Date 1254598085 0 # Node ID 5b8c8cd215264acbc70cded988d00c5d2f46d345 # Parent 6d5195c8d57ad6bf5c83e2c36250feeeb0fcef57 * 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. diff -r 6d5195c8d57a -r 5b8c8cd21526 lisp/ChangeLog --- a/lisp/ChangeLog Sat Oct 03 18:29:22 2009 +0000 +++ b/lisp/ChangeLog Sat Oct 03 19:28:05 2009 +0000 @@ -1,3 +1,39 @@ +2009-10-03 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. + +2009-09-30 Eric Ludlam + + * 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 * vc.el: Remove commented out code. diff -r 6d5195c8d57a -r 5b8c8cd21526 lisp/cedet/ede.el --- a/lisp/cedet/ede.el Sat Oct 03 18:29:22 2009 +0000 +++ b/lisp/cedet/ede.el Sat Oct 03 19:28:05 2009 +0000 @@ -659,7 +659,9 @@ "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) diff -r 6d5195c8d57a -r 5b8c8cd21526 lisp/cedet/ede/cpp-root.el --- a/lisp/cedet/ede/cpp-root.el Sat Oct 03 18:29:22 2009 +0000 +++ b/lisp/cedet/ede/cpp-root.el Sat Oct 03 19:28:05 2009 +0000 @@ -491,8 +491,8 @@ (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)) diff -r 6d5195c8d57a -r 5b8c8cd21526 lisp/cedet/ede/pmake.el --- a/lisp/cedet/ede/pmake.el Sat Oct 03 18:29:22 2009 +0000 +++ b/lisp/cedet/ede/pmake.el Sat Oct 03 19:28:05 2009 +0000 @@ -240,20 +240,32 @@ "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 diff -r 6d5195c8d57a -r 5b8c8cd21526 lisp/cedet/ede/proj-comp.el --- a/lisp/cedet/ede/proj-comp.el Sat Oct 03 18:29:22 2009 +0000 +++ b/lisp/cedet/ede/proj-comp.el Sat Oct 03 19:28:05 2009 +0000 @@ -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 @@ (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)) diff -r 6d5195c8d57a -r 5b8c8cd21526 lisp/cedet/ede/srecode.el --- a/lisp/cedet/ede/srecode.el Sat Oct 03 18:29:22 2009 +0000 +++ b/lisp/cedet/ede/srecode.el Sat Oct 03 19:28:05 2009 +0000 @@ -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. diff -r 6d5195c8d57a -r 5b8c8cd21526 lisp/cedet/semantic.el --- a/lisp/cedet/semantic.el Sat Oct 03 18:29:22 2009 +0000 +++ b/lisp/cedet/semantic.el Sat Oct 03 19:28:05 2009 +0000 @@ -176,7 +176,7 @@ 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 @@ (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 @@ 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 @@ 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 @@ (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 @@ (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 @@ 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 diff -r 6d5195c8d57a -r 5b8c8cd21526 lisp/cedet/semantic/util-modes.el --- a/lisp/cedet/semantic/util-modes.el Sat Oct 03 18:29:22 2009 +0000 +++ b/lisp/cedet/semantic/util-modes.el Sat Oct 03 19:28:05 2009 +0000 @@ -874,7 +874,7 @@ "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 @@ 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 @@ ;;;###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. diff -r 6d5195c8d57a -r 5b8c8cd21526 lisp/cedet/srecode/map.el --- a/lisp/cedet/srecode/map.el Sat Oct 03 18:29:22 2009 +0000 +++ b/lisp/cedet/srecode/map.el Sat Oct 03 19:28:05 2009 +0000 @@ -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 @@ (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) diff -r 6d5195c8d57a -r 5b8c8cd21526 lisp/cedet/srecode/srt-mode.el --- a/lisp/cedet/srecode/srt-mode.el Sat Oct 03 18:29:22 2009 +0000 +++ b/lisp/cedet/srecode/srt-mode.el Sat Oct 03 19:28:05 2009 +0000 @@ -184,7 +184,7 @@ ;;;###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 diff -r 6d5195c8d57a -r 5b8c8cd21526 lisp/cedet/srecode/template.el --- a/lisp/cedet/srecode/template.el Sat Oct 03 18:29:22 2009 +0000 +++ b/lisp/cedet/srecode/template.el Sat Oct 03 19:28:05 2009 +0000 @@ -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) -(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 diff -r 6d5195c8d57a -r 5b8c8cd21526 lisp/files.el --- a/lisp/files.el Sat Oct 03 18:29:22 2009 +0000 +++ b/lisp/files.el Sat Oct 03 19:28:05 2009 +0000 @@ -2178,6 +2178,7 @@ ("\\.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 @@ ("\\.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