diff options
| author | Stephen Leake | 2015-09-15 14:40:49 -0500 |
|---|---|---|
| committer | Stephen Leake | 2015-09-15 14:44:46 -0500 |
| commit | 711a8eecd5f8abb46dbe6bafe10071ec0e58d85f (patch) | |
| tree | 7b9c40b950be3fc6b03476f39dd201b12a1cd906 /lisp | |
| parent | b6a792bc623afacea9702f7ec3a35a56013f6c71 (diff) | |
| download | emacs-711a8eecd5f8abb46dbe6bafe10071ec0e58d85f.tar.gz emacs-711a8eecd5f8abb46dbe6bafe10071ec0e58d85f.zip | |
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')
| -rw-r--r-- | lisp/progmodes/elisp-mode.el | 8 |
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 | |||
| 720 | (dolist (method (cl--generic-method-table generic)) | 720 | (dolist (method (cl--generic-method-table generic)) |
| 721 | (let* ((info (cl--generic-method-info method));; qual-string combined-args doconly | 721 | (let* ((info (cl--generic-method-info method));; qual-string combined-args doconly |
| 722 | (specializers (cl--generic-method-specializers method)) | 722 | (specializers (cl--generic-method-specializers method)) |
| 723 | (non-default nil) | ||
| 723 | (met-name (cons symbol specializers)) | 724 | (met-name (cons symbol specializers)) |
| 724 | (file (find-lisp-object-file-name met-name 'cl-defmethod))) | 725 | (file (find-lisp-object-file-name met-name 'cl-defmethod))) |
| 726 | (dolist (item specializers) | ||
| 727 | ;; default method has all 't' in specializers | ||
| 728 | (setq non-default (or non-default (not (equal t item))))) | ||
| 729 | |||
| 725 | (when (and file | 730 | (when (and file |
| 726 | (or specializers ;; default method has null specializers | 731 | (or non-default |
| 727 | (nth 2 info))) ;; assuming only co-located default has null doc string | 732 | (nth 2 info))) ;; assuming only co-located default has null doc string |
| 728 | (if specializers | 733 | (if specializers |
| 729 | (let ((summary (format elisp--xref-format-extra 'cl-defmethod symbol (nth 1 info)))) | 734 | (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 | |||
| 800 | (declare-function project-current "project") | 805 | (declare-function project-current "project") |
| 801 | 806 | ||
| 802 | (defun elisp--xref-find-references (symbol) | 807 | (defun elisp--xref-find-references (symbol) |
| 808 | "Find all references to SYMBOL (a string) in the current project." | ||
| 803 | (cl-mapcan | 809 | (cl-mapcan |
| 804 | (lambda (dir) | 810 | (lambda (dir) |
| 805 | (xref-collect-references symbol dir)) | 811 | (xref-collect-references symbol dir)) |