summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/find-func-tests.el
diff options
context:
space:
mode:
authorDaniel Martín <mardani29@yahoo.es>2020-12-27 09:04:56 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2020-12-27 09:04:56 +0100
commit80420faf4921ffe5e9d4c4f9595941acf3156e50 (patch)
tree3893cf5919ac80cfb6abdfebba8544a15c0316eb /test/lisp/emacs-lisp/find-func-tests.el
parent0f790464d547dd57a857d88dab309b286067ac45 (diff)
downloademacs-80420faf4921ffe5e9d4c4f9595941acf3156e50.tar.gz
emacs-80420faf4921ffe5e9d4c4f9595941acf3156e50.tar.bz2
emacs-80420faf4921ffe5e9d4c4f9595941acf3156e50.zip
Improve "find definition" in *Help* buffers
* lisp/emacs-lisp/find-func.el (find-function-search-for-symbol): If our regexp algorithm could not find a location for the symbol definition, resort to find-function--search-by-expanding-macros. * test/lisp/emacs-lisp/find-func-tests.el: Add a automatic test for a function and variable generated by a macro. * etc/NEWS: Advertise the improved functionality (bug#45443).
Diffstat (limited to 'test/lisp/emacs-lisp/find-func-tests.el')
-rw-r--r--test/lisp/emacs-lisp/find-func-tests.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/find-func-tests.el b/test/lisp/emacs-lisp/find-func-tests.el
index d77eb6757ff..03df4bb9ff4 100644
--- a/test/lisp/emacs-lisp/find-func-tests.el
+++ b/test/lisp/emacs-lisp/find-func-tests.el
@@ -43,5 +43,15 @@
(concat data-directory (kbd "n x / TAB RET"))
(read-library-name)))))
+;; Avoid a byte-compilation warning that may confuse people reading
+;; the result of the following test.
+(declare-function compilation--message->loc nil "compile")
+
+(ert-deftest find-func-tests--locate-macro-generated-symbols () ;bug#45443
+ (should (cdr (find-function-search-for-symbol
+ #'compilation--message->loc nil "compile")))
+ (should (cdr (find-function-search-for-symbol
+ 'c-mode-hook 'defvar "cc-mode"))))
+
(provide 'find-func-tests)
;;; find-func-tests.el ends here