unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: emacs-devel@gnu.org,  Daniel Mendler <mail@daniel-mendler.de>
Subject: Re: master 49e06183f5 1/3: Allow REQUIRE-MATCH to be a function
Date: Sat, 11 Jun 2022 11:03:24 -0400	[thread overview]
Message-ID: <jwvh74rdz76.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87pmjfsc1v.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 11 Jun 2022 12:57:00 +0200")

>> 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	other threads:[~2022-06-11 15:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <165484935985.12525.14065631018362412932@vcs2.savannah.gnu.org>
     [not found] ` <20220610082240.A7222C01683@vcs2.savannah.gnu.org>
2022-06-10 14:15   ` master 49e06183f5 1/3: Allow REQUIRE-MATCH to be a function Stefan Monnier
2022-06-11 10:57     ` Lars Ingebrigtsen
2022-06-11 15:03       ` Stefan Monnier [this message]
2022-06-11 16:11         ` Lars Ingebrigtsen
2022-06-11 16:29           ` Stefan Monnier
2022-06-12  9:59             ` Lars Ingebrigtsen
2022-06-12 13:18               ` Stefan Monnier
2022-06-13 12:12                 ` Lars Ingebrigtsen
2022-06-13 16:37                   ` Stefan Monnier
2022-06-14 12:02                     ` Lars Ingebrigtsen
2022-06-14 12:44                       ` Stefan Monnier
2022-06-16 12:50                         ` Lars Ingebrigtsen

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=jwvh74rdz76.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=mail@daniel-mendler.de \
    /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).