emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master e33c2bf 2/2: Fix cl-progv binding order


From: Lars Ingebrigtsen
Subject: master e33c2bf 2/2: Fix cl-progv binding order
Date: Sat, 20 Mar 2021 05:01:25 -0400 (EDT)

branch: master
commit e33c2bfbf3f62449a9b62de423a1bbe3a39a3dca
Author: Toby Cubitt <toby@dr-qubit.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix cl-progv binding order
    
    * lisp/emacs-lisp/cl-macs.el (cl-progv): Bind variables in the
    correct order (bug#47272).
---
 lisp/emacs-lisp/cl-macs.el            | 3 ++-
 test/lisp/emacs-lisp/cl-macs-tests.el | 5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 9eabfc6..27ed07b 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -1976,7 +1976,8 @@ a `let' form, except that the list of symbols can be 
computed at run-time."
               (,binds ()))
          (while ,syms
            (push (list (pop ,syms) (list 'quote (pop ,vals))) ,binds))
-         (eval (list 'let ,binds (list 'funcall (list 'quote ,bodyfun))))))))
+         (eval (list 'let (nreverse ,binds)
+                     (list 'funcall (list 'quote ,bodyfun))))))))
 
 (defconst cl--labels-magic (make-symbol "cl--labels-magic"))
 
diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el 
b/test/lisp/emacs-lisp/cl-macs-tests.el
index df1d26a..dd64876 100644
--- a/test/lisp/emacs-lisp/cl-macs-tests.el
+++ b/test/lisp/emacs-lisp/cl-macs-tests.el
@@ -648,4 +648,9 @@ collection clause."
                      #'len))
             (`(function (lambda (,_ ,_) . ,_)) t))))
 
+(ert-deftest cl-macs--progv ()
+  (should (= (cl-progv '(test test) '(1 2) test) 2))
+  (should (equal (cl-progv '(test1 test2) '(1 2) (list test1 test2))
+                 '(1 2))))
+
 ;;; cl-macs-tests.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]