]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/help.el: Fix bug with incorrect arglist string
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 28 Oct 2015 00:18:45 +0000 (20:18 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 28 Oct 2015 00:18:45 +0000 (20:18 -0400)
(help-add-fundoc-usage): Don't mistake a mis-formatted string for a list.

lisp/help.el

index 3387628fb8a326f6f34933f290846c8aaf9ca89b..c558b652b7ecf980cd9b24052ba9d7ab72a4db5d 100644 (file)
@@ -1394,9 +1394,10 @@ ARGLIST can also be t or a string of the form \"(FUN ARG1 ARG2 ...)\"."
            (if (string-match "\n?\n\\'" docstring)
                (if (< (- (match-end 0) (match-beginning 0)) 2) "\n" "")
              "\n\n")
-           (if (and (stringp arglist)
-                    (string-match "\\`([^ ]+\\(.*\\))\\'" arglist))
-               (concat "(fn" (match-string 1 arglist) ")")
+           (if (stringp arglist)
+                (if (string-match "\\`[^ ]+\\(.*\\))\\'" arglist)
+                    (concat "(fn" (match-string 1 arglist) ")")
+                  (error "Unrecognized usage format"))
              (help--make-usage-docstring 'fn arglist)))))
 
 (defun help-function-arglist (def &optional preserve-names)