diff options
| author | Po Lu | 2023-03-12 19:37:00 +0800 |
|---|---|---|
| committer | Po Lu | 2023-03-12 19:37:00 +0800 |
| commit | 90c22cb94965efff001968b9e84239c08cf14869 (patch) | |
| tree | fc695e7c73d41e1211a3a49b8a9cbd6aa8e094cc /doc | |
| parent | 776f1ca3e3551b98569ab7daa58cd6921048881e (diff) | |
| parent | 9191fd50d242cde5256b876dd756ffbc6f46db90 (diff) | |
| download | emacs-90c22cb94965efff001968b9e84239c08cf14869.tar.gz emacs-90c22cb94965efff001968b9e84239c08cf14869.zip | |
Merge remote-tracking branch 'origin/master' into feature/android
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/help.texi | 10 | ||||
| -rw-r--r-- | doc/lispref/help.texi | 26 |
2 files changed, 36 insertions, 0 deletions
diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi index 2513e6be271..945e12a05d2 100644 --- a/doc/emacs/help.texi +++ b/doc/emacs/help.texi | |||
| @@ -317,6 +317,16 @@ 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 | 319 | ||
| 320 | You can also request that documentation of functions and commands | ||
| 321 | shown in @file{*Help*} buffers popped by @kbd{C-h f} includes examples | ||
| 322 | of their use. To that end, add the following to your initialization | ||
| 323 | file (@pxref{Init File}): | ||
| 324 | |||
| 325 | @example | ||
| 326 | (add-hook 'help-fns-describe-function-functions | ||
| 327 | #'shortdoc-help-fns-examples-function) | ||
| 328 | @end example | ||
| 329 | |||
| 320 | @kindex C-h v | 330 | @kindex C-h v |
| 321 | @findex describe-variable | 331 | @findex describe-variable |
| 322 | @kbd{C-h v} (@code{describe-variable}) is like @kbd{C-h f} but | 332 | @kbd{C-h v} (@code{describe-variable}) is like @kbd{C-h f} but |
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index 59b6b6dab1d..d5e4e1c31d3 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 | return value is an alist with items of the form | ||
| 999 | @w{@code{(@var{group} . @var{examples})}}, where @var{group} is a | ||
| 1000 | documentation group where @var{function} appears, and @var{examples} | ||
| 1001 | is a string with the examples of @var{function}s use as defined in | ||
| 1002 | @var{group}. | ||
| 1003 | |||
| 1004 | @code{shortdoc-function-examples} returns @code{nil} if @var{function} | ||
| 1005 | is not a function or if it doesn't have any shortdoc examples. | ||
| 1006 | @end defun | ||
| 1007 | |||
| 1008 | @vindex help-fns-describe-function-functions | ||
| 1009 | @defun shortdoc-help-fns-examples-function function | ||
| 1010 | This function queries the registered shortdoc groups and inserts | ||
| 1011 | examples of use of a given Emacs Lisp @var{function} into the current | ||
| 1012 | buffer. It is suitable for addition to the | ||
| 1013 | @code{help-fns-describe-function-functions} hook, in which case | ||
| 1014 | examples from shortdoc of using a function will be displayed in the | ||
| 1015 | @file{*Help*} buffer when the documentation of the function is | ||
| 1016 | requested. | ||
| 1017 | @end defun | ||