From 3ec1047b57ccea0f62a2de8095d1bbc07bd43576 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sat, 18 Apr 2015 02:35:59 +0300 Subject: [PATCH] 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. --- lisp/progmodes/elisp-mode.el | 10 +++++++--- 1 file 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 -- 2.11.4.GIT