summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2015-01-21 23:16:45 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2015-01-21 23:16:45 -0500
commit938bca8e4141f5f96497f9be26b0ea0bb90f40cd (patch)
treecfa26e5839a34c2b8e7aa896bf7b5bfda731a1bb /lisp/emacs-lisp
parent74244d239e9093035c369721b469529a5fdaf1c6 (diff)
downloademacs-938bca8e4141f5f96497f9be26b0ea0bb90f40cd.tar.gz
emacs-938bca8e4141f5f96497f9be26b0ea0bb90f40cd.tar.bz2
emacs-938bca8e4141f5f96497f9be26b0ea0bb90f40cd.zip
Avoid generating invalid usage info for pathological function
Fixes: debbugs:19645 * lisp/help.el (help-make-usage): Don't turn a "_" arg into an empty-string. * lisp/emacs-lisp/cl-generic.el (cl--generic-lambda): Don't confuse a string body with a docstring.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/cl-generic.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el
index 8dee9a38ab0..f214faff237 100644
--- a/lisp/emacs-lisp/cl-generic.el
+++ b/lisp/emacs-lisp/cl-generic.el
@@ -228,7 +228,8 @@ This macro can only be used within the lexical scope of a cl-generic method."
"Make the lambda expression for a method with ARGS and BODY."
(let ((plain-args ())
(specializers nil)
- (doc-string (if (stringp (car-safe body)) (pop body)))
+ (doc-string (if (and (stringp (car-safe body)) (cdr body))
+ (pop body)))
(mandatory t))
(dolist (arg args)
(push (pcase arg
@@ -252,7 +253,7 @@ This macro can only be used within the lexical scope of a cl-generic method."
;; destructuring args, `declare' and whatnot).
(pcase (macroexpand fun macroenv)
(`#'(lambda ,args . ,body)
- (let* ((doc-string (and doc-string (stringp (car body))
+ (let* ((doc-string (and doc-string (stringp (car body)) (cdr body)
(pop body)))
(cnm (make-symbol "cl--cnm"))
(nmp (make-symbol "cl--nmp"))