unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: one.last.kiss@outlook.com, 64351@debbugs.gnu.org
Subject: bug#64351: probabe bug associated with “completion-regexp-list”
Date: Sat, 01 Jul 2023 10:19:50 -0400	[thread overview]
Message-ID: <jwvmt0fafnf.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83h6qosr82.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 30 Jun 2023 22:08:29 +0300")

>> Bad idea.
>> Admittedly, `completion-regexp-list` is documented poorly enough that
>> it's not clear what usage is valid and what isn't, but a lot of
>> completion code will be broken if you set it globally to anything else
>> than nil.
>
> Would you mind telling more about valid uses of this?
> I'd like to improve the documentation.

Here's what I know: `completion-regexp-list` used to be virtually unused
in Emacs's code base, so I don't know what was its intended use.

But when completion UIs started to offer other styles than just
prefix-based completion, they also started to use
`try/all/test-completion` more "internally" (i.e. for intermediate
computations rather than to compute the final list of completions
displayed to the user) and they did it without paying attention to
`completion-regexp-list`, i.e. in ways which tended to just misbehave
when `completion-regexp-list` wasn't nil.

So, in practice nowadays, the only reliable way to use
`completion-regexp-list` is to think of it as an optional argument to
`try/all/test-completion`, but one that has to be provided via a nearby
let-binding rather than by listing it explicitly at the call site.

> You are saying that you don't like my proposed patch for the emacs-29
> branch, and would even prefer to leave it unfixed?

Your patch is harmless, IMO, so it's OK to install it.

> The binding you propose might be appropriate for master, but not for
> the release branch.

Agreed.

> > Or alternatively to say "if it hurts, don't do that".
> That could be okay, if we also say how to use this variable so it
> doesn't hurt.

My opinion is that we should document that variable as something that's
not meant to be used/set by users, but only one that should be set by
the code that calls `try/all/test-completion`.


        Stefan






  reply	other threads:[~2023-07-01 14:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-29 18:53 bug#64351: probabe bug associated with “completion-regexp-list” Shynur Xie
2023-06-30  6:21 ` Eli Zaretskii
2023-06-30 12:51   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-30 13:15     ` Eli Zaretskii
2023-06-30 14:17       ` Shynur Xie
2023-06-30 14:27         ` Andreas Schwab
2023-06-30 15:23           ` Shynur Xie
2023-06-30 18:33   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-30 18:45     ` Shynur Xie
2023-06-30 19:02       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-30 19:36         ` Shynur Xie
2023-06-30 23:24           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-30 19:52         ` Shynur Xie
2023-06-30 19:08     ` Eli Zaretskii
2023-07-01 14:19       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-07-02  6:18         ` Eli Zaretskii
2023-07-01  8:21     ` Eli Zaretskii

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=jwvmt0fafnf.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=64351@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=one.last.kiss@outlook.com \
    /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).