]> git.eshelyaron.com Git - emacs.git/commitdiff
Upcase parameters in things like "&optional (arg 3)"
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 9 Oct 2019 07:06:33 +0000 (09:06 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 9 Oct 2019 07:06:33 +0000 (09:06 +0200)
* lisp/help.el (help--make-usage): Upcase cl-defgeneric (etc)
parameter names (bug#23517).

lisp/help.el

index 1ae4b2c38d98e97d9e6fd044418016f17113b83c..3b3d1f977e1482b8333b18e4c0853c686fe2cb38 100644 (file)
@@ -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")