From 4a65d6df3539b6f23f94f3584b9e7fa46133fed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= Date: Sat, 29 May 2021 13:26:59 +0200 Subject: [PATCH 1/2] Improve the documentation of documentation groups * doc/lispref/help.texi (Documentation Groups): Fix typos and improve some of the explanations. * lisp/emacs-lisp/shortdoc.el (define-short-documentation-group): Add :no-eval* and :result-string keywords to the docstring. --- doc/lispref/help.texi | 20 ++++++++++++++------ lisp/emacs-lisp/shortdoc.el | 2 ++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index 298bec5230..104d4f1756 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi @@ -866,14 +866,14 @@ Documentation Groups @end example @item :no-eval* -Like @code{:no-eval}, but alaways inserts @samp{[it depends]} as the -result. +Like @code{:no-eval}, but always inserts @samp{[it depends]} as the +result. For instance: @example :no-eval* (buffer-string) @end example -will result in: +will be printed as: @example (buffer-string) @@ -894,12 +894,20 @@ Documentation Groups @item :eg-result Used to output an example result from non-evaluating example forms. +For instance: @example :no-eval (looking-at "f[0-9]") :eg-result t @end example +will be printed as: + +@example +(looking-at "f[0-9]") +eg. @click{} t +@end example + @item :result-string @itemx :eg-result-string These two are the same as @code{:result} and @code{:eg-result}, @@ -917,8 +925,8 @@ Documentation Groups Indicates that this function is not documented in the manual. @item :args -By default, the function's actual argument list is shown. If -@code{:args} is present, they are used instead. +By default, the function's actual argument list is shown. If the +@code{:args} keyword is present, its value is shown instead. @example :args (regexp string) @@ -951,7 +959,7 @@ Documentation Groups @defun shortdoc-add-function shortdoc-add-function group section elem Lisp packages can add functions to groups with this command. Each -@var{elem} should be a function descriptions, as described above. +@var{elem} should be a function description, as described above. @var{group} is the function group, and @var{section} is what section in the function group to insert the function into. diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index 38d8ad6cc1..c9484dcb68 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -60,8 +60,10 @@ define-short-documentation-group :args ARGS :eval EXAMPLE-FORM :no-eval EXAMPLE-FORM + :no-eval* EXAMPLE-FORM :no-value EXAMPLE-FORM :result RESULT-FORM + :result-string RESULT-FORM :eg-result RESULT-FORM :eg-result-string RESULT-FORM) -- 2.31.0