emacs-devel
[Top][All Lists]
Advanced

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

Re: master 49e06183f5 1/3: Allow REQUIRE-MATCH to be a function


From: Stefan Monnier
Subject: Re: master 49e06183f5 1/3: Allow REQUIRE-MATCH to be a function
Date: Sat, 11 Jun 2022 11:03:24 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

>> I see that the `minibuffer-completion-confirm` function completely
>> replaces the usual handling of require-match (i.e. the attempt to fix
>> the case and the prompting for confirmation).
> (You probably noticed it, but in case not -- I didn't change that code,
> I just changed the indentation.)

What I meant was that the branch you added to the `cond` overrides the
rest of the `cond` (the part you reindented).

>> Maybe this should be better documented, and also AFAICT currently
>> a `minibuffer-completion-confirm` function cannot reliably reproduce this
>> behavior by hand because it doesn't have access to `beg` and `end`.
>> I think we should make this "default behavior" more easily accessible
>> (e.g. put it into its own function and document it as something that can
>> be called from `minibuffer-completion-confirm`?).
>
> I'm pretty sure I don't understand the subtleties here, but er sure?  🧐

Understanding the subtleties can be difficult, but a good general rule
I try to follow in such cases is to provide a function that the new
function-hook can use to get back the old behavior.

IOW, arrange your code such that the user can provide a function
`mimic-t` where the resulting behavior is identical to providing `t`
(and same thing for the other supported values).
AFAICT it's currently virtually impossible (at least not without inside
knowledge of how the minibuffer.el code is written).


        Stefan




reply via email to

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