]> git.eshelyaron.com Git - emacs.git/commitdiff
* cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.
authorChong Yidong <cyd@stupidchicken.com>
Sat, 3 Oct 2009 19:28:05 +0000 (19:28 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Sat, 3 Oct 2009 19:28:05 +0000 (19:28 +0000)
* 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.

12 files changed:
lisp/ChangeLog
lisp/cedet/ede.el
lisp/cedet/ede/cpp-root.el
lisp/cedet/ede/pmake.el
lisp/cedet/ede/proj-comp.el
lisp/cedet/ede/srecode.el
lisp/cedet/semantic.el
lisp/cedet/semantic/util-modes.el
lisp/cedet/srecode/map.el
lisp/cedet/srecode/srt-mode.el
lisp/cedet/srecode/template.el
lisp/files.el

index 424d9860ac79baf806bf3194d15a0f977cd9d11d..7ab1f0931b283e50bf01274bd72568394562f960 100644 (file)
@@ -1,3 +1,39 @@
+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.
index 42c4508e52d0f01e8c112c151c4bc4d1932e62d9..53087e12658a23b3d42a7ccc2d90dd021bcc294b 100644 (file)
@@ -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)
index e1e348ac94703612ac02c6fec9816ede84dd22ee..c30df8dbb0d3672e1436f24db0b125cc395d9eb2 100644 (file)
@@ -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))
 
index 4d3f8484ddd4acce97f539b4728a458267205177..7977542913089b6daa4f3336d4649011a02ca990 100644 (file)
@@ -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
 
index 2bda2dd106e7a21618509e4f520caed0afeb02ce..be91c25d5f082287c40e929f5fce7b3eb0b1a3c0 100644 (file)
@@ -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))
index 5f64ed3c7d057d9ec712c1064743ddf51726ad52..0870517a46e9d1befa16ae15259e3cf994e5caf7 100644 (file)
 
 ;;; 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.
index a0c7db7b47d398412aeb0b6505173213debc84bb..03b04f1d5a5ec8ab63d463006fa4838df6b2e4b1 100644 (file)
@@ -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
index b740b128941fb6c61efd1a5ded341b827b0d852d..592394465aeb1f140d566f599fe225066740eb8d 100644 (file)
@@ -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.
index 3272312832576cafa943fa120af0cb037dec9c49..dfe031c41aee54b62dcd6746e2d46a2f35596143 100644 (file)
 
 (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))
 \f
 ;;; 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)
index 7b5322aa1fa7091da740ad0120106c1ee9cdb805..e10c163b8db80b296472ebf47213a4fef317e5d4 100644 (file)
@@ -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
index e20afd0c1c40bedb2354918d66bc5c46e080b832..b4f372c13702c78108f8cd335eb3da0ea4529cb5 100644 (file)
@@ -39,6 +39,7 @@
       ans)
     ))
 
+;;;###autoload
 (defun srecode-template-setup-parser ()
   "Setup buffer for parse."
   (srecode-template-wy--install-parser)
    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
index ac058efde084a116938b5c53eda6fee508a38cd6..4e8ae6cedcdbcf03191dfc52404ec18d88403a0b 100644 (file)
@@ -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