summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Engster <dengste@eml.cc>2013-07-27 23:09:43 +0200
committerDavid Engster <dengste@eml.cc>2013-07-27 23:09:43 +0200
commit25ac1ded77db0e0a839841872dbd514c4c14956b (patch)
treeee6756b5233c98406ac9c69f2cce4150339e42a8
parentf5950f7afe5c62af0ba7dd834419a533c7215b3d (diff)
downloademacs-25ac1ded77db0e0a839841872dbd514c4c14956b.tar.gz
Merge from CEDET upstream (8569).
* lisp/cedet/semantic/edit.el (semantic-edits-splice-remove): Wrap debug message removing middle tag in semantic-edits-verbose-flag check. * semantic/bovine/el.el (semantic/db-el): New require. * semantic/db-el.el (semanticdb-normalize-one-tag): It might be that a symbol comes from a file but cannot be found in its table. This happens for instance when a symbol was dynamically created through a macro like `defstruct'. In this case, return the original tag. (semanticdb-elisp-sym->tag): Deal with autoloaded functions, where the argument list is not available until the file is loaded.
-rw-r--r--lisp/cedet/ChangeLog18
-rw-r--r--lisp/cedet/semantic/bovine/el.el1
-rw-r--r--lisp/cedet/semantic/db-el.el39
-rw-r--r--lisp/cedet/semantic/edit.el5
4 files changed, 45 insertions, 18 deletions
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog
index 705277c97a0..1b8e4725dc1 100644
--- a/lisp/cedet/ChangeLog
+++ b/lisp/cedet/ChangeLog
@@ -1,3 +1,21 @@
+2013-07-27 Eric Ludlam <zappo@gnu.org>
+
+ * lisp/cedet/semantic/edit.el (semantic-edits-splice-remove): Wrap
+ debug message removing middle tag in semantic-edits-verbose-flag
+ check.
+
+2013-07-27 David Engster <deng@randomsample.de>
+
+ * semantic/bovine/el.el (semantic/db-el): New require.
+
+ * semantic/db-el.el (semanticdb-normalize-one-tag): It might be
+ that a symbol comes from a file but cannot be found in its table.
+ This happens for instance when a symbol was dynamically created
+ through a macro like `defstruct'. In this case, return the
+ original tag.
+ (semanticdb-elisp-sym->tag): Deal with autoloaded functions, where
+ the argument list is not available until the file is loaded.
+
2013-06-25 Stefan Monnier <monnier@iro.umontreal.ca>
* data-debug.el, cedet-idutils.el: Neuter the "Version:" header.
diff --git a/lisp/cedet/semantic/bovine/el.el b/lisp/cedet/semantic/bovine/el.el
index 0bbe3c61d76..c6f1ceb0f94 100644
--- a/lisp/cedet/semantic/bovine/el.el
+++ b/lisp/cedet/semantic/bovine/el.el
@@ -25,6 +25,7 @@
(require 'semantic)
(require 'semantic/bovine)
+(require 'semantic/db-el)
(require 'find-func)
(require 'semantic/ctxt)
diff --git a/lisp/cedet/semantic/db-el.el b/lisp/cedet/semantic/db-el.el
index 1b0f3292ad3..3376389c7d5 100644
--- a/lisp/cedet/semantic/db-el.el
+++ b/lisp/cedet/semantic/db-el.el
@@ -173,13 +173,17 @@ If Emacs cannot resolve this symbol to a particular file, then return nil."
(newtags (when tab (semanticdb-find-tags-by-name-method
tab (semantic-tag-name tag))))
(match nil))
- ;; Find the best match.
- (dolist (T newtags)
- (when (semantic-tag-similar-p T tag)
- (setq match T)))
- ;; Backup system.
- (when (not match)
- (setq match (car newtags)))
+ ;; We might not have a parsed tag in this file, because it
+ ;; might be generated through a macro like defstruct.
+ (if (null newtags)
+ (setq match tag)
+ ;; Find the best match.
+ (dolist (T newtags)
+ (when (semantic-tag-similar-p T tag)
+ (setq match T)))
+ ;; Backup system.
+ (when (not match)
+ (setq match (car newtags))))
;; Return it.
(when tab (cons tab match))))))
@@ -196,15 +200,18 @@ TOKTYPE is a hint to the type of tag desired."
(when sym
(cond ((and (eq toktype 'function) (fboundp sym))
(require 'semantic/bovine/el)
- (semantic-tag-new-function
- (symbol-name sym)
- nil ;; return type
- (semantic-elisp-desymbolify
- (help-function-arglist sym)) ;; arg-list
- :user-visible-flag (condition-case nil
- (interactive-form sym)
- (error nil))
- ))
+ (let ((arglist (help-function-arglist sym)))
+ (when (not (listp arglist))
+ ;; Function might be autoloaded, in which case
+ ;; the arglist is not available yet.
+ (setq arglist nil))
+ (semantic-tag-new-function
+ (symbol-name sym)
+ nil ;; return type
+ (semantic-elisp-desymbolify arglist)
+ :user-visible-flag (condition-case nil
+ (interactive-form sym)
+ (error nil)))))
((and (eq toktype 'variable) (boundp sym))
(semantic-tag-new-variable
(symbol-name sym)
diff --git a/lisp/cedet/semantic/edit.el b/lisp/cedet/semantic/edit.el
index a27eab5404c..91455cdb741 100644
--- a/lisp/cedet/semantic/edit.el
+++ b/lisp/cedet/semantic/edit.el
@@ -882,8 +882,9 @@ pre-positioned to a convenient location."
;; reparse
(semantic-parse-changes-failed "Splice-remove failed. Empty buffer?")
))
- (message "To Remove Middle Tag: (%s)"
- (semantic-format-tag-name first)))
+ (when semantic-edits-verbose-flag
+ (message "To Remove Middle Tag: (%s)"
+ (semantic-format-tag-name first))))
;; Find in the cache the preceding tag
(while (and cachestart (not (eq first (car (cdr cachestart)))))
(setq cachestart (cdr cachestart)))