diff options
author | David Engster <dengste@eml.cc> | 2014-01-07 21:40:44 +0100 |
---|---|---|
committer | David Engster <dengste@eml.cc> | 2014-01-07 21:40:44 +0100 |
commit | abb82152dcd743c284bcd7b4ecb31d20543ec735 (patch) | |
tree | ab11625be345077c0c7ed94d9649cc007c31fd88 /lisp/help-fns.el | |
parent | 160006268a4fa72cda6a5f75b6595eb5757c46e9 (diff) | |
download | emacs-abb82152dcd743c284bcd7b4ecb31d20543ec735.tar.gz |
Add new hook to augment help buffers.
* help-fns.el (help-fns-describe-function-functions): New variable to
call functions for augmenting help buffers.
(describe-function-1): Remove explicit calls to
`help-fns--compiler-macro', `help-fns--parent-mode' and
`help-fns--obsolete'. Put them in above new variable instead. Call
all of them through `run-hook-with-args'.
Diffstat (limited to 'lisp/help-fns.el')
-rw-r--r-- | lisp/help-fns.el | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 7b9e1783bad..2252c700fea 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -32,6 +32,12 @@ ;;; Code: +(defvar help-fns-describe-function-functions nil + "List of functions to run in help buffer in `describe-function'. +Those functions will be run after the header line and argument +list was inserted, and before the documentation will be inserted. +The functions will receive the function name as argument.") + ;; Functions ;;;###autoload @@ -649,14 +655,15 @@ FILE is the file where FUNCTION was probably defined." (help-fns--key-bindings function) (with-current-buffer standard-output (setq doc (help-fns--signature function doc real-def real-function)) - - (help-fns--compiler-macro function) - (help-fns--parent-mode function) - (help-fns--obsolete function) - + (run-hook-with-args 'help-fns-describe-function-functions function) (insert "\n" (or doc "Not documented."))))))) +;; Add defaults to `help-fns-describe-function-functions'. +(add-hook 'help-fns-describe-function-functions 'help-fns--obsolete) +(add-hook 'help-fns-describe-function-functions 'help-fns--parent-mode) +(add-hook 'help-fns-describe-function-functions 'help-fns--compiler-macro) + ;; Variables |