From 2dd1c2ab19f7fb99ecee60e27e63b2fb045f6970 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 3 Sep 2022 22:38:28 -0400 Subject: gv.el and cl-macs.el: Fix bug#57397 * lisp/emacs-lisp/gv.el (gv-get): Obey symbol macros. * lisp/emacs-lisp/cl-macs.el (cl--letf): Remove workaround placed to try and handle symbol macros. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-test--symbol-macrolet): Add new testcase. --- test/lisp/emacs-lisp/cl-macs-tests.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'test/lisp/emacs-lisp') diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el b/test/lisp/emacs-lisp/cl-macs-tests.el index 19ede627a13..2a647e08305 100644 --- a/test/lisp/emacs-lisp/cl-macs-tests.el +++ b/test/lisp/emacs-lisp/cl-macs-tests.el @@ -539,7 +539,20 @@ collection clause." ((p (gv-synthetic-place cl (lambda (v) `(setcar l ,v))))) (cl-incf p))) l) - '(1)))) + '(1))) + ;; Make sure `gv-synthetic-place' isn't macro-expanded before + ;; `cl-letf' gets to see its `gv-expander'. + (should (equal + (condition-case err + (let ((x 1)) + (list x + (cl-letf (((gv-synthetic-place (+ 1 2) + (lambda (v) `(setq x ,v))) + 7)) + x) + x)) + (error err)) + '(1 7 3)))) (ert-deftest cl-macs-loop-conditional-step-clauses () "These tests failed under the initial fixes in #bug#29799." -- cgit v1.2.3