GNU bug report logs -
#30241
Emacs 26.0.91: "Generalized variables" are not defined.
Previous Next
Reported by: Alan Mackenzie <acm <at> muc.de>
Date: Wed, 24 Jan 2018 20:15:02 UTC
Severity: wishlist
Done: Alan Mackenzie <acm <at> muc.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On Wed, Jan 24, 2018 at 3:06 PM, Alan Mackenzie <acm <at> muc.de> wrote:
> (add-function :before sit-for (lambda () (acm-backtrace 5)))
> (add-function :before 'sit-for (....))
> (add-function :before #'sit-for (.....))
> (add-function :before (symbol-function 'sit-for) (....))
>
> , and got nothing but unhelpful error messages back, such as
>
> Symbol's value as variable is void: sit-for
Your last form works for me, but the lambda has to accept the same
arguments as sit-for.
(add-function :before (symbol-function 'sit-for)
(lambda (&rest _) (acm-backtrace 5)))
I think advice-add would make more sense for that use case though.
(advice-add 'sit-for :before (lambda (&rest _) (acm-backtrace 5)))
This bug report was last modified 7 years and 146 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.