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: Stefan Monnier
Subject: bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH
Date: Wed, 23 Aug 2023 17:27:56 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

>> The normal/recommended call looks like:
>> 
>> (let ((cseq '("alpha" "beta" "gamma" "delta" "epsilon" "zeta" "eta")))
>> (completing-read (format-prompt "Grapheme" "alpha")
>> cseq nil t nil nil "alpha"))
>> 
>> [ Yes, it's a bit cumbersome: hysterical raisins :-( ] - Stefan
>
> Correct.  The solution involves an unwieldy parameter configurations, and 
> possibly
> using convoluted workarounds to achieve the desired behavior.  This scenario 
> implies
> that using the function as intended requires a level of effort, 
> understanding, and
> manipulation that goes beyond direct usage.

Agreed.  That argues in favor of introducing a new function.  But that
new function would be so similar to `completing-read` that it will lead
to users wondering when to use which or why there are two unless we mark
`completing-read` as obsolete, which would in turn cause a lot of
warnings in a lot of packages and code churn.

So, we've been hesitating to make this change for a while, not sure
which choice is least bad.

But at this point do you consider the behavior of

    (let ((cseq '("alpha" "beta" "gamma" "delta" "epsilon" "zeta" "eta")))
      (completing-read (format-prompt "Grapheme" "alpha")
                       cseq nil t nil nil "alpha"))

to be a good solution for your original problem?

[ BTW, to me the main benefit of a new function is that we could try
  and make it so that the user can choose between a UI where the default
  is not inserted in the initial minibuffer (as in the above code), or
  one where it is (presumably pre-selected so you can delete it with
  a simple DEL), as is common in many other applications.  ]


        Stefan






reply via email to

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