summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2015-04-18 02:35:59 +0300
committerDmitry Gutov <dgutov@yandex.ru>2015-04-18 02:35:59 +0300
commit3ec1047b57ccea0f62a2de8095d1bbc07bd43576 (patch)
treef7d3af037a433bcd7bbf065adf5af5ef9c0dfe00
parent35be45bbc9ac525bb2bc3e20b0fa27c1ceee0c15 (diff)
downloademacs-3ec1047b57ccea0f62a2de8095d1bbc07bd43576.tar.gz
Don't show both feature and function with the same name
* lisp/progmodes/elisp-mode.el (elisp--xref-identifier-location): Don't show both feature and function with the same name.
-rw-r--r--lisp/progmodes/elisp-mode.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index ff427fd51da..ad35c48a101 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -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