* cedet/semantic/bovine/c.el (semantic-c-describe-environment):
authorChong Yidong <cyd@stupidchicken.com>
Sat, 5 Dec 2009 19:10:42 +0000 (19:10 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Sat, 5 Dec 2009 19:10:42 +0000 (19:10 +0000)
Describe project macro symbols.

* cedet/semantic/complete.el (semantic-complete-do-completion):
Don't call semantic-collector-current-exact-match.

* cedet/ede.el (ede-apply-preprocessor-map): Accept lists of
ede-objects as targets.

* cedet/ede/pmake.el (ede-proj-makefile-insert-variables): Output
a target's object list even if compiler vars are already in the
Makefile.

* cedet/ede/emacs.el (ede-preprocessor-map): Add config.h to the
list of headers producing necessary macros.

lisp/ChangeLog
lisp/cedet/ede.el
lisp/cedet/ede/emacs.el
lisp/cedet/ede/pmake.el
lisp/cedet/semantic/bovine/c.el
lisp/cedet/semantic/complete.el

index d0651d2..47b361a 100644 (file)
@@ -1,3 +1,21 @@
+2009-12-05  Eric Ludlam  <zappo@gnu.org>
+
+       * cedet/semantic/bovine/c.el (semantic-c-describe-environment):
+       Describe project macro symbols.
+
+       * cedet/semantic/complete.el (semantic-complete-do-completion):
+       Don't call semantic-collector-current-exact-match.
+
+       * cedet/ede.el (ede-apply-preprocessor-map): Accept lists of
+       ede-objects as targets.
+
+       * cedet/ede/pmake.el (ede-proj-makefile-insert-variables): Output
+       a target's object list even if compiler vars are already in the
+       Makefile.
+
+       * cedet/ede/emacs.el (ede-preprocessor-map): Add config.h to the
+       list of headers producing necessary macros.
+
 2009-12-05  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
 
        * textmodes/bibtex.el (bibtex-map-entries): Use marker to keep
index 0db1d80..35066c5 100644 (file)
@@ -1865,12 +1865,17 @@ Return the first non-nil value returned by PROC."
 (defun ede-apply-preprocessor-map ()
   "Apply preprocessor tables onto the current buffer."
   (when (and ede-object (boundp 'semantic-lex-spp-macro-symbol-obarray))
-    (let ((map (ede-preprocessor-map ede-object)))
+    (let* ((objs ede-object)
+          (map (ede-preprocessor-map (if (consp objs)
+                                         (car objs)
+                                       objs))))
       (when map
        ;; We can't do a require for the below symbol.
        (setq semantic-lex-spp-macro-symbol-obarray
-             (semantic-lex-make-spp-table map))
-       ))))
+             (semantic-lex-make-spp-table map)))
+      (when (consp objs)
+       (message "Choosing preprocessor syms for project %s"
+                (object-name (car objs)))))))
 
 (defmethod ede-system-include-path ((this ede-project))
   "Get the system include path used by project THIS."
index f6eb57b..902621e 100644 (file)
@@ -219,6 +219,8 @@ All files need the macros from lisp.h!"
         (root (ede-project-root proj))
         (table (semanticdb-file-table-object
                 (ede-expand-filename root "lisp.h")))
+        (config (semanticdb-file-table-object
+                 (ede-expand-filename root "config.h")))
         filemap
         )
     (when table
@@ -226,6 +228,11 @@ All files need the macros from lisp.h!"
        (semanticdb-refresh-table table))
       (setq filemap (append filemap (oref table lexical-table)))
       )
+    (when config
+      (when (semanticdb-needs-refresh-p config)
+       (semanticdb-refresh-table config))
+      (setq filemap (append filemap (oref config lexical-table)))
+      )
     filemap
     ))
 
index 6ded4be..4a5f1ed 100644 (file)
@@ -427,9 +427,9 @@ sources variable."
        (src (oref this source)))
     (while comp
       (ede-compiler-only-once (car comp)
-       (ede-proj-makefile-insert-object-variables (car comp) name src)
        (ede-proj-makefile-insert-variables (car comp)))
       (setq comp (cdr comp)))
+    (ede-proj-makefile-insert-object-variables (car comp) name src)
     (while link
       (ede-linker-only-once (car link)
        (ede-proj-makefile-insert-variables (car link)))
index b775bbf..d4b8baf 100644 (file)
@@ -1759,6 +1759,24 @@ DO NOT return the list of tags encompassing point."
          (princ "\n")
          ))
 
+      (when (arrayp semantic-lex-spp-project-macro-symbol-obarray)
+       (princ "\n  Project symbol map:\n")
+       (princ "      Your project symbol map is derived from the EDE object:\n      ")
+       (princ (object-print ede-object))
+       (princ "\n\n")
+       (let ((macros nil))
+         (mapatoms
+          #'(lambda (symbol)
+              (setq macros (cons symbol macros)))
+          semantic-lex-spp-project-macro-symbol-obarray)
+         (dolist (S macros)
+           (princ "    ")
+           (princ (symbol-name S))
+           (princ " = ")
+           (princ (symbol-value S))
+           (princ "\n")
+           )))
+
       (princ "\n\n  Use: M-x semantic-lex-spp-describe RET\n")
       (princ "\n  to see the complete macro table.\n")
 
index c379b05..73875c5 100644 (file)
@@ -515,8 +515,13 @@ if INLINE, then completion is happening inline in a buffer."
        (semantic-displayor-set-completions
         displayor
         (or
-         (and (not (eq na 'displayend))
-              (semantic-collector-current-exact-match collector))
+         ;; For the below - This caused problems for Chong Yidong
+         ;; when experimenting with the completion engine.  I don't
+         ;; remember what the problem was though, and I wasn't sure why
+         ;; the below two lines were there since they obviously added
+         ;; some odd behavior.  -EML
+         ;; (and (not (eq na 'displayend))
+         ;;      (semantic-collector-current-exact-match collector))
          (semantic-collector-all-completions collector contents))
         contents)
        ;; Ask the displayor to display them.