unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tim Landscheidt <tim@tim-landscheidt.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Michael Heerdegen <michael_heerdegen@web.de>, emacs-devel@gnu.org
Subject: Re: Doc of deprecated INITIAL-INPUT arg of completing-read
Date: Tue, 13 Feb 2024 14:43:48 +0000	[thread overview]
Message-ID: <87h6ic1l23.fsf@vagabond.tim-landscheidt.de> (raw)
In-Reply-To: <jwvr138338y.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue, 28 Jun 2022 17:10:47 -0400")

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



  parent reply	other threads:[~2024-02-13 14:43 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27 15:22 Doc of deprecated INITIAL-INPUT arg of completing-read Michael Heerdegen
2022-06-27 16:33 ` [External] : " Drew Adams
2022-06-27 17:22   ` Christopher Dimech
2022-06-28 16:19   ` Michael Heerdegen
2022-06-28 16:40     ` Drew Adams
2022-06-29 13:42       ` Michael Heerdegen
2022-06-29 14:24         ` Drew Adams
2022-06-28 21:46     ` Christopher Dimech
2022-06-29  9:15     ` Arash Esbati
2022-06-29 13:46       ` Michael Heerdegen
2022-06-30  9:10         ` Arash Esbati
2022-07-04 12:25           ` Michael Heerdegen
2022-06-28 19:17   ` [External] : " Jean Louis
2022-06-28 19:15 ` Jean Louis
2022-06-28 21:10   ` Stefan Monnier
2022-06-28 22:00     ` Jean Louis
2022-06-29  2:58       ` Stefan Monnier
2022-06-30  3:08     ` Richard Stallman
2022-06-30 14:28       ` Stefan Monnier
2024-02-13 14:43     ` Tim Landscheidt [this message]
2024-02-13 14:59       ` Stefan Monnier
2024-02-13 17:07         ` Tim Landscheidt
2024-02-13 20:09           ` Stefan Monnier
2024-02-15  8:21             ` Tim Landscheidt
2024-02-15 16:09               ` [External] : " Drew Adams
2024-02-15 18:39               ` Stefan Monnier
2024-02-17 17:12                 ` Tim Landscheidt
2024-02-17 17:41                   ` Stefan Monnier
2022-06-30  3:08   ` Richard Stallman
2022-07-01  5:54     ` Jean Louis

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=87h6ic1l23.fsf@vagabond.tim-landscheidt.de \
    --to=tim@tim-landscheidt.de \
    --cc=emacs-devel@gnu.org \
    --cc=michael_heerdegen@web.de \
    --cc=monnier@iro.umontreal.ca \
    /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).