]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix using disabled command without a docstring
authorStefan Kangas <stefankangas@gmail.com>
Sat, 16 Dec 2023 19:33:04 +0000 (20:33 +0100)
committerStefan Kangas <stefankangas@gmail.com>
Sat, 16 Dec 2023 19:37:37 +0000 (20:37 +0100)
* lisp/novice.el (disabled-command-function): Fix error when the
disable command has no docstring.  (Bug#67835)

lisp/novice.el

index 05e4bfc91c97d495047ce3fde2b53945e250b7be..907126ab49b385280ef3f4cd8d14a6fdd70dd014 100644 (file)
@@ -67,9 +67,10 @@ If nil, the feature is disabled, i.e., all commands work normally.")
                "Here's the first part of its description:\n\n")
               ;; Keep only the first paragraph of the documentation.
               (with-temp-buffer
-                (insert (condition-case ()
-                            (documentation cmd)
-                          (error "<< not documented >>")))
+                (insert (or (condition-case ()
+                               (documentation cmd)
+                             (error nil))
+                           "<< not documented >>"))
                 (goto-char (point-min))
                 (when (search-forward "\n\n" nil t)
                   (delete-region (match-beginning 0) (point-max)))