diff options
author | Alexander Gramiak <agrambot@gmail.com> | 2020-08-11 15:26:24 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2020-08-11 15:26:24 +0200 |
commit | e7819074013ac3c2b84abbc05a6f4f6c413d981e (patch) | |
tree | dd9c6f41282a74b9108ff817a2dceff9a80a808d /test/lisp/help-fns-tests.el | |
parent | 9b01badf7cf7bb6cd64bc8d39564b46ae74b889f (diff) | |
download | emacs-e7819074013ac3c2b84abbc05a6f4f6c413d981e.tar.gz |
Only search for a variable when instructed
* lisp/help-fns.el (find-lisp-object-file-name): Check for 'defvar
argument before searching for an internal variable (Bug#24697).
* test/lisp/help-fns-tests.el: New tests.
Diffstat (limited to 'test/lisp/help-fns-tests.el')
-rw-r--r-- | test/lisp/help-fns-tests.el | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/lisp/help-fns-tests.el b/test/lisp/help-fns-tests.el index d2dc3d24aec..da2b49e6b84 100644 --- a/test/lisp/help-fns-tests.el +++ b/test/lisp/help-fns-tests.el @@ -160,4 +160,15 @@ Return first line of the output of (describe-function-1 FUNC)." (with-current-buffer "*Help*" (should (looking-at "^help-fns-test--describe-keymap-foo is")))) +;;; Tests for find-lisp-object-file-name +(ert-deftest help-fns-test-bug24697-function-search () + (should-not (find-lisp-object-file-name 'tab-width 1))) + +(ert-deftest help-fns-test-bug24697-non-internal-variable () + (let ((help-fns--test-var (make-symbol "help-fns--test-var"))) + ;; simulate an internal variable + (put help-fns--test-var 'variable-documentation 1) + (should-not (find-lisp-object-file-name help-fns--test-var 'defface)) + (should-not (find-lisp-object-file-name help-fns--test-var 1)))) + ;;; help-fns-tests.el ends here |