summaryrefslogtreecommitdiff
path: root/lisp/help.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2019-10-09 09:06:33 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2019-10-09 09:06:33 +0200
commit2497a31646db4d255135c16f7b5b318421c5d845 (patch)
treed6727f8c8138e352f3b8c89ea79d52eee8b057af /lisp/help.el
parent4fef6e68f779b12f4f639ca51896f7a950f49237 (diff)
downloademacs-2497a31646db4d255135c16f7b5b318421c5d845.tar.gz
Upcase parameters in things like "&optional (arg 3)"
* lisp/help.el (help--make-usage): Upcase cl-defgeneric (etc) parameter names (bug#23517).
Diffstat (limited to 'lisp/help.el')
-rw-r--r--lisp/help.el13
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/help.el b/lisp/help.el
index 1ae4b2c38d9..3b3d1f977e1 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1469,13 +1469,22 @@ the same names as used in the original source code, when possible."
(defun help--make-usage (function arglist)
(cons (if (symbolp function) function 'anonymous)
(mapcar (lambda (arg)
- (if (not (symbolp arg)) arg
+ (cond
+ ;; Parameter name.
+ ((symbolp arg)
(let ((name (symbol-name arg)))
(cond
((string-match "\\`&" name) arg)
((string-match "\\`_." name)
(intern (upcase (substring name 1))))
- (t (intern (upcase name)))))))
+ (t (intern (upcase name))))))
+ ;; Parameter with a default value (from
+ ;; cl-defgeneric etc).
+ ((and (consp arg)
+ (symbolp (car arg)))
+ (cons (intern (upcase (symbol-name (car arg)))) (cdr arg)))
+ ;; Something else.
+ (t arg)))
arglist)))
(define-obsolete-function-alias 'help-make-usage 'help--make-usage "25.1")