GNU bug report logs - #59559
28.1; `minibuffer-with-setup-hook' with :append

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Fri, 25 Nov 2022 02:57:01 UTC

Severity: normal

Found in version 28.1

Full log


Message #29 received at 59559 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: "59559 <at> debbugs.gnu.org" <59559 <at> debbugs.gnu.org>
Subject: Re: [External] : Re: bug#59559: 28.1; `minibuffer-with-setup-hook'
 with :append
Date: Sat, 21 Jan 2023 15:36:04 +0100
[Message part 1 (text/plain, inline)]
Drew Adams <drew.adams <at> oracle.com> writes:

> > I think clarifying that a bit would make sense.
>
> Yes.

I tried to do that:

[0001-lisp-files.el-minibuffer-with-setup-hook-Clarify-doc.patch (text/x-diff, inline)]
From 18a09740e4ee354954803011a7e7ded003987f77 Mon Sep 17 00:00:00 2001
From: Michael Heerdegen <michael_heerdegen <at> web.de>
Date: Sat, 21 Jan 2023 14:45:39 +0100
Subject: [PATCH] * lisp/files.el (minibuffer-with-setup-hook): Clarify
 docstring

This fixes Bug#59559: Try to make clearer what kinds of s-exps are
expected as FUN argument and how they are interpreted.
---
 lisp/files.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/files.el b/lisp/files.el
index d308e99804d..1da77159217 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1746,9 +1746,11 @@ confirm-nonexistent-file-or-buffer
 (defmacro minibuffer-with-setup-hook (fun &rest body)
   "Temporarily add FUN to `minibuffer-setup-hook' while executing BODY.

-By default, FUN is prepended to `minibuffer-setup-hook'.  But if FUN is of
-the form `(:append FUN1)', FUN1 will be appended to `minibuffer-setup-hook'
-instead of prepending it.
+In the default case, FUN is an expression that should evaluate to
+a function, and the result will be prepended to
+`minibuffer-setup-hook'.  If FUN is an unquoted list of the
+form `(:append FUN1)', the result of evaluating FUN1 will be
+appended to `minibuffer-setup-hook' instead of prepending it.

 BODY should use the minibuffer at most once.
 Recursive uses of the minibuffer are unaffected (FUN is not
--
2.30.2

[Message part 3 (text/plain, inline)]
I think this could go to emacs-29.

Thanks,

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.