diff options
| author | David Engster | 2014-01-07 21:40:44 +0100 |
|---|---|---|
| committer | David Engster | 2014-01-07 21:40:44 +0100 |
| commit | abb82152dcd743c284bcd7b4ecb31d20543ec735 (patch) | |
| tree | ab11625be345077c0c7ed94d9649cc007c31fd88 | |
| parent | 160006268a4fa72cda6a5f75b6595eb5757c46e9 (diff) | |
| download | emacs-abb82152dcd743c284bcd7b4ecb31d20543ec735.tar.gz emacs-abb82152dcd743c284bcd7b4ecb31d20543ec735.zip | |
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'.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/help-fns.el | 17 |
2 files changed, 21 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index add146fd2b1..9f5e87f5e1e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2014-01-07 David Engster <deng@randomsample.de> | ||
| 2 | |||
| 3 | * help-fns.el (help-fns-describe-function-functions): New | ||
| 4 | variable to call functions for augmenting help buffers. | ||
| 5 | (describe-function-1): Remove explicit calls to | ||
| 6 | `help-fns--compiler-macro', `help-fns--parent-mode' and | ||
| 7 | `help-fns--obsolete'. Put them in above new variable instead. | ||
| 8 | Call all of them through `run-hook-with-args'. | ||
| 9 | |||
| 1 | 2014-01-07 Martin Rudalics <rudalics@gmx.at> | 10 | 2014-01-07 Martin Rudalics <rudalics@gmx.at> |
| 2 | 11 | ||
| 3 | * window.el (balance-windows-2): While rounding don't give a | 12 | * window.el (balance-windows-2): While rounding don't give a |
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 @@ | |||
| 32 | 32 | ||
| 33 | ;;; Code: | 33 | ;;; Code: |
| 34 | 34 | ||
| 35 | (defvar help-fns-describe-function-functions nil | ||
| 36 | "List of functions to run in help buffer in `describe-function'. | ||
| 37 | Those functions will be run after the header line and argument | ||
| 38 | list was inserted, and before the documentation will be inserted. | ||
| 39 | The functions will receive the function name as argument.") | ||
| 40 | |||
| 35 | ;; Functions | 41 | ;; Functions |
| 36 | 42 | ||
| 37 | ;;;###autoload | 43 | ;;;###autoload |
| @@ -649,14 +655,15 @@ FILE is the file where FUNCTION was probably defined." | |||
| 649 | (help-fns--key-bindings function) | 655 | (help-fns--key-bindings function) |
| 650 | (with-current-buffer standard-output | 656 | (with-current-buffer standard-output |
| 651 | (setq doc (help-fns--signature function doc real-def real-function)) | 657 | (setq doc (help-fns--signature function doc real-def real-function)) |
| 652 | 658 | (run-hook-with-args 'help-fns-describe-function-functions function) | |
| 653 | (help-fns--compiler-macro function) | ||
| 654 | (help-fns--parent-mode function) | ||
| 655 | (help-fns--obsolete function) | ||
| 656 | |||
| 657 | (insert "\n" | 659 | (insert "\n" |
| 658 | (or doc "Not documented."))))))) | 660 | (or doc "Not documented."))))))) |
| 659 | 661 | ||
| 662 | ;; Add defaults to `help-fns-describe-function-functions'. | ||
| 663 | (add-hook 'help-fns-describe-function-functions 'help-fns--obsolete) | ||
| 664 | (add-hook 'help-fns-describe-function-functions 'help-fns--parent-mode) | ||
| 665 | (add-hook 'help-fns-describe-function-functions 'help-fns--compiler-macro) | ||
| 666 | |||
| 660 | 667 | ||
| 661 | ;; Variables | 668 | ;; Variables |
| 662 | 669 | ||