]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/bytecomp.el: Don't warn for repeated _ args
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 19 Feb 2021 17:51:36 +0000 (12:51 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 19 Feb 2021 17:51:36 +0000 (12:51 -0500)
(byte-compile-check-lambda-list): Skip warnings of repeated arg for
those that are declared as unused anyway.

lisp/emacs-lisp/bytecomp.el

index 9d80afd774fd83fd4895e8adfc4b86eef800eb6c..1b0906b50bb9272ec2eed7bd35e032cd15d584b1 100644 (file)
@@ -2859,7 +2859,9 @@ If FORM is a lambda or a macro, byte-compile it as a function."
              ((eq arg '&optional)
                (when (memq '&optional (cdr list))
                  (error "Duplicate &optional")))
-             ((memq arg vars)
+             ((and (memq arg vars)
+                   ;; Allow repetitions for unused args.
+                   (not (string-match "\\`_" (symbol-name arg))))
               (byte-compile-warn "repeated variable %s in lambda-list" arg))
              (t
               (push arg vars))))