GNU bug report logs -
#49651
28.0.50; setf bug
Previous Next
Full log
Message #8 received at 49651 <at> debbugs.gnu.org (full text, mbox):
Devon Sean McCullough <Emacs-Hacker2020 <at> jovi.net> writes:
> $ /Applications/Emacs-28.0.50.app/Contents/MacOS/Emacs -Q --batch --eval '(setf (getenv "FOO") "BAR")'
> Debugger entered--Lisp error: (void-function \(setf\ getenv\))
> (\(setf\ getenv\) "BAR" "FOO")
> (setf (getenv "FOO") "BAR")
> P.S. The fix is obvious:
>
> lisp/emacs-lisp/cl-lib.el
> ⋮
> ;; These used to be in cl-macs.el since all macros that use them (like setf)
> ;; were autoloaded from cl-macs.el. But now that setf, push, and pop are in
> ;; core Elisp, they need to either be right here or be autoloaded via
> ;; cl-loaddefs.el, which is more trouble than it is worth.
> ⋮
> (gv-define-simple-setter getenv setenv t)
So the error does only occur before you require cl-lib, and your
suggestion is to do what the comment describes as trouble - correct?
I'm not sure of what kind that trouble is, moving such definitions can
have effects on bootstrapping or startup, that's beyond my knowledge.
Any opinions?
> P.P.S. Perhaps describe-function, M-. and the like should mention
> setters?
I would like it when C-h f would tell about gv expanders. Not trivial
though since most gv expanders are anonymous functions (like that of
`getenv').
Michael.
This bug report was last modified 3 years and 299 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.