aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToby Cubitt2021-03-20 10:01:13 +0100
committerLars Ingebrigtsen2021-03-20 10:01:19 +0100
commite33c2bfbf3f62449a9b62de423a1bbe3a39a3dca (patch)
tree9e64c9d7d6005d8fa3530b7f2da02919269290c3
parentf85b66d9b02ed440fc08e5c4dc987bbff9be97d6 (diff)
downloademacs-e33c2bfbf3f62449a9b62de423a1bbe3a39a3dca.tar.gz
emacs-e33c2bfbf3f62449a9b62de423a1bbe3a39a3dca.zip
Fix cl-progv binding order
* lisp/emacs-lisp/cl-macs.el (cl-progv): Bind variables in the correct order (bug#47272).
-rw-r--r--lisp/emacs-lisp/cl-macs.el3
-rw-r--r--test/lisp/emacs-lisp/cl-macs-tests.el5
2 files changed, 7 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 9eabfc63b4a..27ed07b6673 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."
1976 (,binds ())) 1976 (,binds ()))
1977 (while ,syms 1977 (while ,syms
1978 (push (list (pop ,syms) (list 'quote (pop ,vals))) ,binds)) 1978 (push (list (pop ,syms) (list 'quote (pop ,vals))) ,binds))
1979 (eval (list 'let ,binds (list 'funcall (list 'quote ,bodyfun)))))))) 1979 (eval (list 'let (nreverse ,binds)
1980 (list 'funcall (list 'quote ,bodyfun))))))))
1980 1981
1981(defconst cl--labels-magic (make-symbol "cl--labels-magic")) 1982(defconst cl--labels-magic (make-symbol "cl--labels-magic"))
1982 1983
diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el b/test/lisp/emacs-lisp/cl-macs-tests.el
index df1d26a074e..dd6487603d3 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."
648 #'len)) 648 #'len))
649 (`(function (lambda (,_ ,_) . ,_)) t)))) 649 (`(function (lambda (,_ ,_) . ,_)) t))))
650 650
651(ert-deftest cl-macs--progv ()
652 (should (= (cl-progv '(test test) '(1 2) test) 2))
653 (should (equal (cl-progv '(test1 test2) '(1 2) (list test1 test2))
654 '(1 2))))
655
651;;; cl-macs-tests.el ends here 656;;; cl-macs-tests.el ends here