]> git.eshelyaron.com Git - emacs.git/commitdiff
Add new hook to augment help buffers.
authorDavid Engster <dengste@eml.cc>
Tue, 7 Jan 2014 20:40:44 +0000 (21:40 +0100)
committerDavid Engster <dengste@eml.cc>
Tue, 7 Jan 2014 20:40:44 +0000 (21:40 +0100)
* 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'.

lisp/ChangeLog
lisp/help-fns.el

index add146fd2b1662f6309e9e69e3ebd13e43459d12..9f5e87f5e1ef07f9f8bc583bf28ecdb1698beb95 100644 (file)
@@ -1,3 +1,12 @@
+2014-01-07  David Engster  <deng@randomsample.de>
+
+       * 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'.
+
 2014-01-07  Martin Rudalics  <rudalics@gmx.at>
 
        * window.el (balance-windows-2): While rounding don't give a
index 7b9e1783bada2ce0aee6b172ac768959afc7db34..2252c700feadc5beccb7cecb9b05051927de7de5 100644 (file)
 
 ;;; 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)
+
 \f
 ;; Variables