unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: Drew Adams <drew.adams@oracle.com>
Cc: Eli Zaretskii <eliz@gnu.org>,
	"59559@debbugs.gnu.org" <59559@debbugs.gnu.org>
Subject: bug#59559: 28.1; `minibuffer-with-setup-hook' with :append
Date: Mon, 23 Jan 2023 01:15:37 +0100	[thread overview]
Message-ID: <87h6wip0ly.fsf@web.de> (raw)
In-Reply-To: <SJ0PR10MB548855A7F32DC675E45E8C3CF3CB9@SJ0PR10MB5488.namprd10.prod.outlook.com> (Drew Adams's message of "Sun, 22 Jan 2023 22:10:49 +0000")

Drew Adams <drew.adams@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.





  parent reply	other threads:[~2023-01-23  0:15 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25  2:55 bug#59559: 28.1; `minibuffer-with-setup-hook' with :append Drew Adams
2022-11-25  3:07 ` Drew Adams
2023-01-10 17:37   ` Michael Heerdegen
2023-01-10 18:37     ` Drew Adams
2023-01-10 19:34       ` Michael Heerdegen
2023-01-10 19:53         ` Michael Heerdegen
2023-01-10 20:56           ` Drew Adams
2023-01-10 20:45         ` Drew Adams
2023-01-21 14:36           ` Michael Heerdegen
2023-01-21 15:35             ` Eli Zaretskii
2023-01-21 16:07               ` Michael Heerdegen
2023-01-21 18:43                 ` Eli Zaretskii
2023-01-21 18:57                   ` Drew Adams
2023-01-21 19:26                     ` Eli Zaretskii
2023-01-21 18:51               ` Drew Adams
2023-01-21 19:23                 ` Eli Zaretskii
2023-01-21 20:57                   ` Drew Adams
2023-01-21 18:41             ` Drew Adams
2023-01-21 19:29               ` Eli Zaretskii
2023-01-21 20:27                 ` Michael Heerdegen
2023-01-22  5:58                   ` Eli Zaretskii
2023-01-22 22:10                     ` Drew Adams
2023-01-22 22:19                       ` Drew Adams
2023-01-23  0:15                       ` Michael Heerdegen [this message]
2023-01-23  3:14                         ` Drew Adams
2023-01-23  3:21                           ` Drew Adams
2023-01-23 14:11                           ` Michael Heerdegen
2023-01-23 16:38                             ` Drew Adams
2023-01-23 12:15                       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h6wip0ly.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=59559@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).