aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/help.texi9
-rw-r--r--doc/lispref/help.texi26
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.
316by using the @kbd{M-x shortdoc} command. This will prompt you for an 316by 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.
319Here's an example you can include in your initialization file
320(@pxref{Init File}) that uses @code{shortdoc} to insert Emacs Lisp
321function 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.
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
998result is an alist with items of the form
999
1000@example
1001(@var{group} . @var{examples})
1002@end example
1003
1004@noindent
1005where @var{group} is a documentation group where @var{function}
1006appears 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}
1010is not a function or if it doesn’t contain shortdoc information.
1011@end defun
1012
1013@defun shortdoc-help-fns-examples-function function
1014This function queries the registered documentation groups and inserts
1015examples of use of a given Emacs Lisp function into the current
1016buffer.
1017@end defun