summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2023-04-17 18:15:45 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2023-04-17 18:15:45 -0400
commitb0b968d9af3bfbb7e145e936997901595a843c24 (patch)
tree3caf29fd36b68922d9f9f203217fcef3aeef0a16 /lisp/emacs-lisp
parentdb2d6aac306371501b74f4c0031e1b630a083910 (diff)
downloademacs-b0b968d9af3bfbb7e145e936997901595a843c24.tar.gz
* lisp/emacs-lisp/gv.el (error): Add gv-expander
This fixes incorrect expansion of (setf (case-exhaustive ..) ..), as found for example in `elpa-admin.el`.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/gv.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el
index ac001af06bd..6c3036da2f2 100644
--- a/lisp/emacs-lisp/gv.el
+++ b/lisp/emacs-lisp/gv.el
@@ -639,6 +639,13 @@ REF must have been previously obtained with `gv-ref'."
;;; Generalized variables.
+;; You'd think noone would write `(setf (error ...) ..)' but it
+;; appears naturally as the result of macroexpansion of things like
+;; (setf (case-exhaustive ...)).
+;; We could generalize this to `throw' and `signal', but it seems
+;; preferable to wait until there's a concrete need.
+(gv-define-expander error (lambda (_do &rest args) `(error . ,args)))
+
;; Some Emacs-related place types.
(gv-define-simple-setter buffer-file-name set-visited-file-name t)
(make-obsolete-generalized-variable