summaryrefslogtreecommitdiff
path: root/lisp/progmodes/elisp-mode.el
diff options
context:
space:
mode:
authorStephen Leake <stephen_leake@stephe-leake.org>2015-09-15 14:40:49 -0500
committerStephen Leake <stephen_leake@stephe-leake.org>2015-09-15 14:44:46 -0500
commit711a8eecd5f8abb46dbe6bafe10071ec0e58d85f (patch)
tree7b9c40b950be3fc6b03476f39dd201b12a1cd906 /lisp/progmodes/elisp-mode.el
parentb6a792bc623afacea9702f7ec3a35a56013f6c71 (diff)
downloademacs-711a8eecd5f8abb46dbe6bafe10071ec0e58d85f.tar.gz
Fix a bug in elisp--xref-find-definitions related to cl-generic defaults
* lisp/progmodes/elisp-mode.el (elisp--xref-find-definitions): Fix bug with cl-generic defaults. (elisp--xref-find-references): Add doc string. * test/automated/elisp-mode-tests.el (xref-elisp-generic-*): Improve tests to find bug.
Diffstat (limited to 'lisp/progmodes/elisp-mode.el')
-rw-r--r--lisp/progmodes/elisp-mode.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 8afae150a1d..7614bacf1bb 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -720,10 +720,15 @@ non-nil result supercedes the xrefs produced by
(dolist (method (cl--generic-method-table generic))
(let* ((info (cl--generic-method-info method));; qual-string combined-args doconly
(specializers (cl--generic-method-specializers method))
+ (non-default nil)
(met-name (cons symbol specializers))
(file (find-lisp-object-file-name met-name 'cl-defmethod)))
+ (dolist (item specializers)
+ ;; default method has all 't' in specializers
+ (setq non-default (or non-default (not (equal t item)))))
+
(when (and file
- (or specializers ;; default method has null specializers
+ (or non-default
(nth 2 info))) ;; assuming only co-located default has null doc string
(if specializers
(let ((summary (format elisp--xref-format-extra 'cl-defmethod symbol (nth 1 info))))
@@ -800,6 +805,7 @@ non-nil result supercedes the xrefs produced by
(declare-function project-current "project")
(defun elisp--xref-find-references (symbol)
+ "Find all references to SYMBOL (a string) in the current project."
(cl-mapcan
(lambda (dir)
(xref-collect-references symbol dir))