]> git.eshelyaron.com Git - emacs.git/commitdiff
Check shortdoc keywords and fix one mistake
authorMattias EngdegÄrd <mattiase@acm.org>
Mon, 19 Feb 2024 09:27:02 +0000 (10:27 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 28 Feb 2024 17:36:18 +0000 (18:36 +0100)
* lisp/emacs-lisp/shortdoc.el (shortdoc--check)
(define-short-documentation-group): Check that used keywords exist.
* lisp/emacs-lisp/shortdoc.el (list): Fix a typo.

(cherry picked from commit ddfba511c190e5bb44e44a50aef5ab8c08e3d798)

lisp/emacs-lisp/shortdoc.el

index a6a49c72f74ebb303fecce018bbca0e8909ec3b9..cde28985cd02c9038024e0f823ca0e731e7fe99f 100644 (file)
   '((t :inherit variable-pitch))
   "Face used for a section.")
 
+;;;###autoload
+(defun shortdoc--check (group functions)
+  (let ((keywords '( :no-manual :args :eval :no-eval :no-value :no-eval*
+                     :result :result-string :eg-result :eg-result-string :doc)))
+    (dolist (f functions)
+      (when (consp f)
+        (dolist (x f)
+          (when (and (keywordp x) (not (memq x keywords)))
+            (error "Shortdoc %s function `%s': bad keyword `%s'"
+                   group (car f) x)))))))
+
 ;;;###autoload
 (progn
   (defvar shortdoc--groups nil)
@@ -118,6 +129,7 @@ A FUNC form can have any number of `:no-eval' (or `:no-value'),
 `:no-eval*', `:result', `:result-string', `:eg-result' and
 `:eg-result-string' properties."
     (declare (indent defun))
+    (shortdoc--check group functions)
     `(progn
        (setq shortdoc--groups (delq (assq ',group shortdoc--groups)
                                     shortdoc--groups))
@@ -715,7 +727,7 @@ A FUNC form can have any number of `:no-eval' (or `:no-value'),
    :eval (plist-get '(a 1 b 2 c 3) 'b))
   (plist-put
    :no-eval (setq plist (plist-put plist 'd 4))
-   :eq-result (a 1 b 2 c 3 d 4))
+   :eg-result (a 1 b 2 c 3 d 4))
   (plist-member
    :eval (plist-member '(a 1 b 2 c 3) 'b))
   "Data About Lists"