From 3b1d69efc32c8929281f38d55cef773e4680f2ad Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Mon, 21 Jun 2021 16:00:39 +0100 Subject: [PATCH] Fix shortdoc-add-function section creation * lisp/emacs-lisp/shortdoc.el (shortdoc-add-function): Use nconc to actually append a new section to the list of groups while avoiding a previous OBOE. Push a new group to the front of shortdoc--groups without copying it, just like define-short-documentation-group does. (buffer): Fix copypasta in unlock-buffer example. * test/lisp/emacs-lisp/shortdoc-tests.el (shortdoc-examples): Also check that :no-value forms demonstrate the right function. * doc/lispref/help.texi (Documentation Groups): Clarify that @dots in the define-short-documentation-group arglist refer to whole key-value pairs. Fix typo in :eg-result-string description. --- doc/lispref/help.texi | 4 ++-- lisp/emacs-lisp/shortdoc.el | 6 +++--- test/lisp/emacs-lisp/shortdoc-tests.el | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index dbbc34fb3a5..a788852de75 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi @@ -818,7 +818,7 @@ summaries of using those functions. The optional argument @var{functions} is a list whose elements are of the form: @lisp -(@var{func} @var{keyword} @var{val} @dots{}) +(@var{func} [@var{keyword} @var{val}]@dots{}) @end lisp The following keywords are recognized: @@ -914,7 +914,7 @@ eg. @click{} t @itemx :eg-result-string These two are the same as @code{:result} and @code{:eg-result}, respectively, but are inserted as is. This is useful when the result -is unreadable or should be on a particular form: +is unreadable or should be of a particular form: @example :no-eval (find-file "/tmp/foo") diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index 16e83074764..4ff7cee623c 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -887,7 +887,7 @@ There can be any number of :example/:result elements." (lock-buffer :no-value (lock-buffer "/tmp/foo")) (unlock-buffer - :no-value (lock-buffer))) + :no-value (unlock-buffer))) (define-short-documentation-group overlay "Predicates" @@ -1283,11 +1283,11 @@ Example: (let ((glist (assq group shortdoc--groups))) (unless glist (setq glist (list group)) - (setq shortdoc--groups (append shortdoc--groups (list glist)))) + (push glist shortdoc--groups)) (let ((slist (member section glist))) (unless slist (setq slist (list section)) - (setq slist (append glist slist))) + (nconc glist slist)) (while (and (cdr slist) (not (stringp (cadr slist)))) (setq slist (cdr slist))) diff --git a/test/lisp/emacs-lisp/shortdoc-tests.el b/test/lisp/emacs-lisp/shortdoc-tests.el index 050aac31659..3bb3185649b 100644 --- a/test/lisp/emacs-lisp/shortdoc-tests.el +++ b/test/lisp/emacs-lisp/shortdoc-tests.el @@ -34,7 +34,7 @@ (let ((fun (car item)) (props (cdr item))) (while props - (when (memq (car props) '(:eval :no-eval :no-eval*)) + (when (memq (car props) '(:eval :no-eval :no-eval* :no-value)) (let* ((example (cadr props)) (expr (cond ((consp example) example) -- 2.39.2