diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/help.texi | 9 | ||||
| -rw-r--r-- | doc/lispref/help.texi | 26 |
2 files changed, 35 insertions, 0 deletions
diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi index 2513e6be271..10c007eb635 100644 --- a/doc/emacs/help.texi +++ b/doc/emacs/help.texi | |||
| @@ -316,6 +316,15 @@ there's a doc string there. | |||
| 316 | by using the @kbd{M-x shortdoc} command. This will prompt you for an | 316 | by using the @kbd{M-x shortdoc} command. This will prompt you for an |
| 317 | area of interest, e.g., @code{string}, and pop you to a buffer where | 317 | area of interest, e.g., @code{string}, and pop you to a buffer where |
| 318 | many of the functions relevant for handling strings are listed. | 318 | many of the functions relevant for handling strings are listed. |
| 319 | Here's an example you can include in your initialization file | ||
| 320 | (@pxref{Init File}) that uses @code{shortdoc} to insert Emacs Lisp | ||
| 321 | function examples into regular @file{*Help*} buffers when you use | ||
| 322 | @kbd{C-h f}: | ||
| 323 | |||
| 324 | @example | ||
| 325 | (add-hook 'help-fns-describe-function-functions | ||
| 326 | #'shortdoc-help-fns-examples-function) | ||
| 327 | @end example | ||
| 319 | 328 | ||
| 320 | @kindex C-h v | 329 | @kindex C-h v |
| 321 | @findex describe-variable | 330 | @findex describe-variable |
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index 59b6b6dab1d..3175f66122e 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi | |||
| @@ -989,3 +989,29 @@ in the function group to insert the function into. | |||
| 989 | If @var{group} doesn't exist, it will be created. If @var{section} | 989 | If @var{group} doesn't exist, it will be created. If @var{section} |
| 990 | doesn't exist, it will be added to the end of the function group. | 990 | doesn't exist, it will be added to the end of the function group. |
| 991 | @end defun | 991 | @end defun |
| 992 | |||
| 993 | You can also query the examples of use of functions defined in | ||
| 994 | shortdoc groups. | ||
| 995 | |||
| 996 | @defun shortdoc-function-examples function | ||
| 997 | This function returns all shortdoc examples for @var{function}. The | ||
| 998 | result is an alist with items of the form | ||
| 999 | |||
| 1000 | @example | ||
| 1001 | (@var{group} . @var{examples}) | ||
| 1002 | @end example | ||
| 1003 | |||
| 1004 | @noindent | ||
| 1005 | where @var{group} is a documentation group where @var{function} | ||
| 1006 | appears in and @var{examples} is a string with the examples of use of | ||
| 1007 | @var{function} defined in @var{group}. | ||
| 1008 | |||
| 1009 | @code{shortdoc-function-examples} returns @code{nil} if @var{function} | ||
| 1010 | is not a function or if it doesn’t contain shortdoc information. | ||
| 1011 | @end defun | ||
| 1012 | |||
| 1013 | @defun shortdoc-help-fns-examples-function function | ||
| 1014 | This function queries the registered documentation groups and inserts | ||
| 1015 | examples of use of a given Emacs Lisp function into the current | ||
| 1016 | buffer. | ||
| 1017 | @end defun | ||