GNU bug report logs -
#59559
28.1; `minibuffer-with-setup-hook' with :append
Previous Next
Full log
View this message in rfc822 format
Drew Adams <drew.adams <at> oracle.com> writes:
> Whether FUN is or is not of that :append form, per
> your presumption - "the terminology used in the rest
> of Emacs", the UNevaluated sexp is meant. But that's
> not the case here.
>
> Try it:
>
> (defun toto () (message "@@@@@@@@@@@@@@"))
> (minibuffer-with-setup-hook toto (message "************"))
>
> Debugger entered--Lisp error: (void-variable toto)
> (let ((fun toto)
> (setup-hook (make-symbol "minibuffer-setup")))
> (fset setup-hook
> #'(lambda nil
> (remove-hook 'minibuffer-setup-hook setup-hook)
> (funcall fun)))
> (unwind-protect (progn (add-hook 'minibuffer-setup-hook setup-hook)
> (message "************"))
> (remove-hook 'minibuffer-setup-hook setup-hook)))
>
> Not to mention that the unevaluated form (:append toto)
> also exhibits the same problem - it too doesn't fit
> "the terminology used in the rest of Emacs".
Well yes, I know, I expected that behavior after reading the docstring.
You obviously don't.
Nowhere is said that FUN should be a function _name_ or a symbol.
Unless stated otherwise, what you specify as an argument is an
expression. Here only with the exception that two syntaxes are
possible, the alternative one is a list, like we e.g. know from cl
arglists.
My patch tried to make that part clearer: the argument is of the form
FUN or (:append FUN) (an macro _argument_ described as of a certain form
always speaks about the unevaluated s-exp), and FUN is an expression
evaluating to the function that will be added to the hook.
Michael.
This bug report was last modified 2 years and 143 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.