emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Doc of deprecated INITIAL-INPUT arg of completing-read


From: Tim Landscheidt
Subject: Re: Doc of deprecated INITIAL-INPUT arg of completing-read
Date: Tue, 13 Feb 2024 14:43:48 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> wrote some time ago:

>> For anything there must be reason. What is reason to "strongly warn"
>> programmer not to use it?

> Because there's a lot of past experience where people want to have the
> Windows-style behavior where prompts get prefilled with the (selected)
> default, and they don't understand that in order to get that they need
> to change `completing-read`.  So instead they abuse `initial-content` in
> their code (even though it doesn't give quite the same behavior either
> but gets the closer).

I have not found a clear answer for my use case, so I post
it here:

In Gnus, I want to set a group parameter ("to-list") when I
encounter an article in a Gmane group if that article has an
"List-Post" header.  In most cases, I want to set the para-
meter to the header's value.  Sometimes the header's value
is "encrypted" in which case I want to set it to another
value (which I researched out-of-prompt).

So I want to display the value, if it is "correct", one
should have to press (just) RET, otherwise one should be
able to amend the input.

For me (with list-post-in-article being the header's value):

| (read-string "to-list value: " list-post-in-article)

works just perfectly then.

So what is the proposed Emacs way to get this behaviour if
INITIAL-INPUT is not to be used?

Tim



reply via email to

[Prev in Thread] Current Thread [Next in Thread]