diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2018-01-22 22:00:55 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2018-01-22 22:00:55 -0500 |
commit | 0a75af915653bd8927f92be420603725a7e3c744 (patch) | |
tree | bfedf0fb314c5fa622f15ccede2567291bef39f9 /lisp/emacs-lisp/ert.el | |
parent | 2df391c202eeee0d575980555443a5e81b8f6b1f (diff) | |
download | emacs-0a75af915653bd8927f92be420603725a7e3c744.tar.gz emacs-0a75af915653bd8927f92be420603725a7e3c744.tar.bz2 emacs-0a75af915653bd8927f92be420603725a7e3c744.zip |
* lisp/emacs-lisp/ert.el (describe-symbol-backends): Add ourselves
(ert-describe-test): Return the description text as well.
Remove left over version check.
* lisp/help-mode.el (describe-symbol-backends): Add docstring.
Diffstat (limited to 'lisp/emacs-lisp/ert.el')
-rw-r--r-- | lisp/emacs-lisp/ert.el | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 029a2939a0b..a47108545d1 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -2549,8 +2549,6 @@ To be used in the ERT results buffer." (defun ert-describe-test (test-or-test-name) "Display the documentation for TEST-OR-TEST-NAME (a symbol or ert-test)." (interactive (list (ert-read-test-name-at-point "Describe test"))) - (when (< emacs-major-version 24) - (user-error "Requires Emacs 24 or later")) (let (test-name test-definition) (cl-etypecase test-or-test-name @@ -2587,7 +2585,9 @@ To be used in the ERT results buffer." (insert (substitute-command-keys (or (ert-test-documentation test-definition) "It is not documented.")) - "\n"))))))) + "\n") + ;; For describe-symbol-backends. + (buffer-string))))))) (defun ert-results-describe-test-at-point () "Display the documentation of the test at point. @@ -2599,6 +2599,11 @@ To be used in the ERT results buffer." ;;; Actions on load/unload. +(require 'help-mode) +(add-to-list 'describe-symbol-backends + `("ERT test" ,#'ert-test-boundp + ,(lambda (s _b _f) (ert-describe-test s)))) + (add-to-list 'find-function-regexp-alist '(ert--test . ert--find-test-regexp)) (add-to-list 'minor-mode-alist '(ert--current-run-stats (:eval @@ -2613,7 +2618,7 @@ To be used in the ERT results buffer." 'ert--activate-font-lock-keywords) nil) -(defvar ert-unload-hook '()) +(defvar ert-unload-hook ()) (add-hook 'ert-unload-hook #'ert--unload-function) |