]> code.delx.au - gnu-emacs/commitdiff
Don't show both feature and function with the same name
authorDmitry Gutov <dgutov@yandex.ru>
Fri, 17 Apr 2015 23:35:59 +0000 (02:35 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Fri, 17 Apr 2015 23:35:59 +0000 (02:35 +0300)
* lisp/progmodes/elisp-mode.el (elisp--xref-identifier-location):
Don't show both feature and function with the same name.

lisp/progmodes/elisp-mode.el

index ff427fd51da72ac5946265603a69eead49cb9d86..ad35c48a101015ccf7d0da7b93edb7de2a60d251 100644 (file)
@@ -606,9 +606,13 @@ It can be quoted, or be inside a quoted form."
                          (not (fboundp sym))
                          (or (symbol-file sym 'defvar)
                              (help-C-file-name sym 'var))))
-           (`feature (when (featurep sym)
-                       (ignore-errors
-                         (find-library-name (symbol-name sym)))))
+           (`feature (and (featurep sym)
+                          ;; Skip when a function with the same name
+                          ;; is defined, because it's probably in the
+                          ;; same file.
+                          (not (fboundp sym))
+                          (ignore-errors
+                            (find-library-name (symbol-name sym)))))
            (`defface (when (facep sym)
                        (symbol-file sym 'defface))))))
     (when file