]> code.delx.au - gnu-emacs/commitdiff
(elisp--xref-identifier-location): Skip variable, if it's also a functiong
authorDmitry Gutov <dgutov@yandex.ru>
Fri, 17 Apr 2015 22:47:31 +0000 (01:47 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Fri, 17 Apr 2015 22:47:31 +0000 (01:47 +0300)
* lisp/progmodes/elisp-mode.el (elisp--xref-identifier-location):
Avoid returning both the variable and the function for the same
minor mode.

lisp/progmodes/elisp-mode.el

index 29f1c9aeb6b58a9944d487995d781433b101ce7d..ff427fd51da72ac5946265603a69eead49cb9d86 100644 (file)
@@ -599,9 +599,13 @@ It can be quoted, or be inside a quoted form."
                             (find-function-library sym)))
                        (setq sym (car fun-lib))
                        (cdr fun-lib))))
-           (`defvar (when (boundp sym)
-                      (or (symbol-file sym 'defvar)
-                          (help-C-file-name sym 'var))))
+           (`defvar (and (boundp sym)
+                         ;; Don't show minor modes twice.
+                         ;; TODO: If TYPE ever becomes dependent on the
+                         ;; context, move this check outside.
+                         (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)))))