bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUI


From: Heime
Subject: bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH
Date: Sun, 27 Aug 2023 21:11:27 +0000





Sent with Proton Mail secure email.

------- Original Message -------
On Monday, August 28th, 2023 at 6:01 AM, Stefan Monnier 
<monnier@iro.umontreal.ca> wrote:


> > > Whether the default only shows up when instructed is a UI issue, which
> > > can/should be under control of a UI customization. - Stefan

> > > I would need an example. Suppose one changes the UI customization, would 
> > > that
> > > apply to all calls of that function ? I would want prefilling 
> > > occasionally.
> > > Would that be possible ?
 
> There are some cases, such as `read-file-name` where we do want some
> prefilling, so of course it's possible, but it has to be linked to some
> specific property of the thing we're requesting from the user and how it
> relates to the string with which we want to prefill the buffer.

I am proposing a broader use.  I meant an example of how a programmer can
include minibuffer prefilling.   It seems that the functionality exists
but not well known or understood.  If minibuffer prefilling has been possible
for us in `read-file-name`, then the possibility should also be provided to 
programmers and users devising their own functionality.   
 
 
> So it goes back to the question of why you want this specific call to
> `completing-read` to be prefilled. The answer shouldn't be "because
> I prefer it this way" (that answer should be satisfied instead by
> a customization setting since it may not apply to other users of that
> code).
> 
> E.g. in the case of `read-file-name` it's because in 99% of the cases
> the end result wants to include all or most of that prefilled string.
> 
> > All these UI accept any entries by the user.

Customarily all minibuffer input from the user is allowed to be entered.
I claim automatic prefilling can be considered a form of user input, if 
they code their own function with prefilling in mind.
 
> I don't know what you mean by that.
> 
> > I am of the school of thought that doing so automatically is also
> > a valid operation.

> And I didn't understand this part either. > Stefan

There are two audiences in all this.  Programmers who write libraries
and users who write functions for their own use.  The thought is that
if `read-file-name` has capability of minibuffer prefilling, then minibuffer
prefilling capability should be available for them to use without having
them convince anybody why they want it to happen.  

I consider the statement "I prefer it this way" legitimate, because in emacs 
users have the capability to add functionality for their personal use, and their
decisions would not affect other users of that code.

Did some more thinking about all this and can see the possibility of INITIAL
to become much broader.  For maintainers of libraries for public use, the code 
could need some elaboration, but not much for personal use cases.
be







reply via email to

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