diff options
| author | Stefan Monnier | 2015-01-21 23:16:45 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2015-01-21 23:16:45 -0500 |
| commit | 938bca8e4141f5f96497f9be26b0ea0bb90f40cd (patch) | |
| tree | cfa26e5839a34c2b8e7aa896bf7b5bfda731a1bb | |
| parent | 74244d239e9093035c369721b469529a5fdaf1c6 (diff) | |
| download | emacs-938bca8e4141f5f96497f9be26b0ea0bb90f40cd.tar.gz 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.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cl-generic.el | 5 | ||||
| -rw-r--r-- | lisp/help.el | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 39ae463b043..c000d6bb9a6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2015-01-22 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * help.el (help-make-usage): Don't turn a "_" arg into an empty-string | ||
| 4 | arg (bug#19645). | ||
| 5 | * emacs-lisp/cl-generic.el (cl--generic-lambda): Don't confuse a string | ||
| 6 | body with a docstring. | ||
| 7 | |||
| 1 | 2015-01-22 Dmitry Gutov <dgutov@yandex.ru> | 8 | 2015-01-22 Dmitry Gutov <dgutov@yandex.ru> |
| 2 | 9 | ||
| 3 | * progmodes/xref.el (xref-location-marker, xref-location-group): | 10 | * progmodes/xref.el (xref-location-marker, xref-location-group): |
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." | |||
| 228 | "Make the lambda expression for a method with ARGS and BODY." | 228 | "Make the lambda expression for a method with ARGS and BODY." |
| 229 | (let ((plain-args ()) | 229 | (let ((plain-args ()) |
| 230 | (specializers nil) | 230 | (specializers nil) |
| 231 | (doc-string (if (stringp (car-safe body)) (pop body))) | 231 | (doc-string (if (and (stringp (car-safe body)) (cdr body)) |
| 232 | (pop body))) | ||
| 232 | (mandatory t)) | 233 | (mandatory t)) |
| 233 | (dolist (arg args) | 234 | (dolist (arg args) |
| 234 | (push (pcase arg | 235 | (push (pcase arg |
| @@ -252,7 +253,7 @@ This macro can only be used within the lexical scope of a cl-generic method." | |||
| 252 | ;; destructuring args, `declare' and whatnot). | 253 | ;; destructuring args, `declare' and whatnot). |
| 253 | (pcase (macroexpand fun macroenv) | 254 | (pcase (macroexpand fun macroenv) |
| 254 | (`#'(lambda ,args . ,body) | 255 | (`#'(lambda ,args . ,body) |
| 255 | (let* ((doc-string (and doc-string (stringp (car body)) | 256 | (let* ((doc-string (and doc-string (stringp (car body)) (cdr body) |
| 256 | (pop body))) | 257 | (pop body))) |
| 257 | (cnm (make-symbol "cl--cnm")) | 258 | (cnm (make-symbol "cl--cnm")) |
| 258 | (nmp (make-symbol "cl--nmp")) | 259 | (nmp (make-symbol "cl--nmp")) |
diff --git a/lisp/help.el b/lisp/help.el index 39ec6be1fde..bf724252d5a 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -1445,7 +1445,7 @@ the same names as used in the original source code, when possible." | |||
| 1445 | (let ((name (symbol-name arg))) | 1445 | (let ((name (symbol-name arg))) |
| 1446 | (cond | 1446 | (cond |
| 1447 | ((string-match "\\`&" name) arg) | 1447 | ((string-match "\\`&" name) arg) |
| 1448 | ((string-match "\\`_" name) | 1448 | ((string-match "\\`_." name) |
| 1449 | (intern (upcase (substring name 1)))) | 1449 | (intern (upcase (substring name 1)))) |
| 1450 | (t (intern (upcase name))))))) | 1450 | (t (intern (upcase name))))))) |
| 1451 | arglist))) | 1451 | arglist))) |