summaryrefslogtreecommitdiff
path: root/lisp/help.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2015-10-27 20:18:45 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2015-10-27 20:18:45 -0400
commit4eb1e7f96b6c3758c321aed7523502089a8ede74 (patch)
tree5287dc93bf973ac7079309adab0e5fac1ccfb3fd /lisp/help.el
parent1ec995ced2712e7e8df5ed7ac08cf63f3b89c78f (diff)
downloademacs-4eb1e7f96b6c3758c321aed7523502089a8ede74.tar.gz
* lisp/help.el: Fix bug with incorrect arglist string
(help-add-fundoc-usage): Don't mistake a mis-formatted string for a list.
Diffstat (limited to 'lisp/help.el')
-rw-r--r--lisp/help.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/help.el b/lisp/help.el
index 3387628fb8a..c558b652b7e 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -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)