|
From: | Dmitry Gutov |
Subject: | bug#70833: 29.2.50; project-current: allow control of the prompt string |
Date: | Fri, 10 May 2024 04:57:23 +0300 |
User-agent: | Mozilla Thunderbird |
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
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |