]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't warn about _ not left unused in if-let and alike
authorMichael Heerdegen <michael_heerdegen@web.de>
Fri, 16 Feb 2024 21:07:18 +0000 (22:07 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 28 Feb 2024 17:52:35 +0000 (18:52 +0100)
The macro expansions did not leave a variable _ unused; this triggered
an irritating compiler warning (bug#69108).

* lisp/subr.el (internal--build-binding): Handle bindings of the form
(_ EXPR) separately.

(cherry picked from commit e680827e814e155cf79175d87ff7c6ee3a08b69a)

lisp/subr.el

index 705f53219d7214ce90f3d6f3b8d8b1a1a06102b5..6656d4c083da1d1dc54e2a73702667acc9a6aac0 100644 (file)
@@ -2581,6 +2581,8 @@ Affects only hooks run in the current buffer."
           (list binding binding))
          ((null (cdr binding))
           (list (make-symbol "s") (car binding)))
+         ((eq '_ (car binding))
+          (list (make-symbol "s") (cadr binding)))
          (t binding)))
   (when (> (length binding) 2)
     (signal 'error