From 711a8eecd5f8abb46dbe6bafe10071ec0e58d85f Mon Sep 17 00:00:00 2001 From: Stephen Leake Date: Tue, 15 Sep 2015 14:40:49 -0500 Subject: 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. --- lisp/progmodes/elisp-mode.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lisp/progmodes/elisp-mode.el') 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)) -- cgit v1.2.1