aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorPo Lu2023-03-12 19:37:00 +0800
committerPo Lu2023-03-12 19:37:00 +0800
commit90c22cb94965efff001968b9e84239c08cf14869 (patch)
treefc695e7c73d41e1211a3a49b8a9cbd6aa8e094cc /doc
parent776f1ca3e3551b98569ab7daa58cd6921048881e (diff)
parent9191fd50d242cde5256b876dd756ffbc6f46db90 (diff)
downloademacs-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.texi10
-rw-r--r--doc/lispref/help.texi26
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
317area of interest, e.g., @code{string}, and pop you to a buffer where 317area of interest, e.g., @code{string}, and pop you to a buffer where
318many of the functions relevant for handling strings are listed. 318many of the functions relevant for handling strings are listed.
319 319
320You can also request that documentation of functions and commands
321shown in @file{*Help*} buffers popped by @kbd{C-h f} includes examples
322of their use. To that end, add the following to your initialization
323file (@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.
989If @var{group} doesn't exist, it will be created. If @var{section} 989If @var{group} doesn't exist, it will be created. If @var{section}
990doesn't exist, it will be added to the end of the function group. 990doesn't exist, it will be added to the end of the function group.
991@end defun 991@end defun
992
993You can also query the examples of use of functions defined in
994shortdoc groups.
995
996@defun shortdoc-function-examples function
997This function returns all shortdoc examples for @var{function}. The
998return value is an alist with items of the form
999@w{@code{(@var{group} . @var{examples})}}, where @var{group} is a
1000documentation group where @var{function} appears, and @var{examples}
1001is 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}
1005is 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
1010This function queries the registered shortdoc groups and inserts
1011examples of use of a given Emacs Lisp @var{function} into the current
1012buffer. It is suitable for addition to the
1013@code{help-fns-describe-function-functions} hook, in which case
1014examples from shortdoc of using a function will be displayed in the
1015@file{*Help*} buffer when the documentation of the function is
1016requested.
1017@end defun