GNU bug report logs - #70833
29.2.50; project-current: allow control of the prompt string

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Wed, 8 May 2024 14:07:01 UTC

Severity: normal

Found in version 29.2.50

To reply to this bug, email your comments to 70833 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#70833; Package emacs. (Wed, 08 May 2024 14:07:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Spencer Baugh <sbaugh <at> janestreet.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 08 May 2024 14:07:01 GMT) Full text and rfc822 format available.

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

From: Spencer Baugh <sbaugh <at> janestreet.com>
To: bug-gnu-emacs <at> gnu.org
Cc: dmitry <at> gutov.dev
Subject: 29.2.50; project-current: allow control of the prompt string
Date: Wed, 08 May 2024 10:05:51 -0400

It would be nice to be able to control the prompt string that
project-current uses when prompting for a project.  Ideally, by passing
a string for the MAYBE-PROMPT argument.

This is useful when using project-current in functions which should
operate on the current project normally, but which might be run outside
any project and in that case will prompt for a project.  The user might
be uncertain about what the project they'll input will be used for,
exactly.  It's useful for the prompt to remind them.

The prompt could be passed down as an argument to project-prompter, or
bound in a defvar for compatibility - either seems fine to me.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70833; Package emacs. (Fri, 10 May 2024 01:58:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Spencer Baugh <sbaugh <at> janestreet.com>, 70833 <at> debbugs.gnu.org
Subject: Re: bug#70833: 29.2.50; project-current: allow control of the prompt
 string
Date: Fri, 10 May 2024 04:57:23 +0300
[Message part 1 (text/plain, inline)]
Hi Spencer,

On 08/05/2024 17:05, Spencer Baugh wrote:
> 
> It would be nice to be able to control the prompt string that
> project-current uses when prompting for a project.  Ideally, by passing
> a string for the MAYBE-PROMPT argument.
> 
> This is useful when using project-current in functions which should
> operate on the current project normally, but which might be run outside
> any project and in that case will prompt for a project.  The user might
> be uncertain about what the project they'll input will be used for,
> exactly.  It's useful for the prompt to remind them.
> 
> The prompt could be passed down as an argument to project-prompter, or
> bound in a defvar for compatibility - either seems fine to me.

Aside from documentation changes, and the backward incompatibility 
pains, this looks easy enough to do.

Why do you say that that the lexical argument is better than a dynamic 
one in this case? Just wondering if you see a particular reason.

Also, I wonder if we perhaps should pass not the entire prompt but some 
"purpose hint". For example, the argument could look like "find-file", 
and then the prompt would be rendered as

  Select project [find-file]:

or however else the prompter implementation decides (perhaps it uses 
some other different UI where another text arrangement would be better). 
Just a thought -- I'm probably over-complicating things.

[maybe-prompt-prompt.diff (text/x-patch, attachment)]

This bug report was last modified 22 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.