diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-09-03 22:38:28 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-09-03 22:38:28 -0400 |
commit | 2dd1c2ab19f7fb99ecee60e27e63b2fb045f6970 (patch) | |
tree | 07ef5fd76165ec05f4ec43c2a99fec424476779c /lisp/emacs-lisp/gv.el | |
parent | 1d1158397bce41466078e384eed2d1e214e206de (diff) | |
download | emacs-2dd1c2ab19f7fb99ecee60e27e63b2fb045f6970.tar.gz |
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.
Diffstat (limited to 'lisp/emacs-lisp/gv.el')
-rw-r--r-- | lisp/emacs-lisp/gv.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index eaab6439adb..1db9d96d999 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -87,7 +87,11 @@ with a (not necessarily copyable) Elisp expression that returns the value to set it to. DO must return an Elisp expression." (cond - ((symbolp place) (funcall do place (lambda (v) `(setq ,place ,v)))) + ((symbolp place) + (let ((me (macroexpand-1 place macroexpand-all-environment))) + (if (eq me place) + (funcall do place (lambda (v) `(setq ,place ,v))) + (gv-get me do)))) ((not (consp place)) (signal 'gv-invalid-place (list place))) (t (let* ((head (car place)) |