unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Gregory Heytings <gregory@heytings.org>
Cc: Dario Gjorgjevski <dario.gjorgjevski@gmail.com>,
	45474@debbugs.gnu.org, Juri Linkov <juri@linkov.net>
Subject: bug#45474: Icomplete exhibiting in recursive minibuffer when it shouldn’t
Date: Fri, 23 Apr 2021 16:24:34 -0400	[thread overview]
Message-ID: <jwvh7jw6a6m.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <f2b9666c4af154b8671e@heytings.org> (Gregory Heytings's message of "Fri, 23 Apr 2021 18:13:21 +0000")

>>> Well, the fact that there were a few other pieces of code which do that
>>> was (at least as I understood it) part of the initial problem.  And the
>>> purpose of the discussion (at least as I understood it) was to solve the
>>> current problem without breaking these few other pieces of code.
>> Indeed, and I think my patch should by and large leave them unaffected (it
>> neither magically fixes them nor breaks them).
> Indeed, but... it doesn't help/incite them to move forward in the "right"
> direction, to finally have what has been on wishlist for quite a long time:
> to have buffer-local minibuffer-completion-* elements...

It helps by showing how to do it.  I haven't seen any proposal here
which helps further than that (except maybe for some proposals which
might break such code, thus inciting them to use a better approach ;-).

>>> I admit that you lost me here.  What are these [SOMETHINGn]'s, and why
>>> are they happening?
>> Because inevitably code can run in there, e.g. because the debugger gets
>> triggered in there or because the caller of `read-from-minibuffer` was not
>> careful to place the let-bindings of `minibuffer-completion-*` as close as
>> possible to `read-from-minibuffer`.
> I see.  But when the let-bindings are in a macro the caller doesn't have to
> care with them, and they are indeed happening as close as possible to
> internal-read-from-minibuffer.

AFAICT you're talking about the let-bindings of `minibuffer-local-*`
whereas the problematic let-bindings are those of
`minibuffer-completion-*` and those are outside of
`read-from-minibuffer`.

> I didn't know that ELC files had to be backward-compatible between major
> releases.

We don't guarantee such compatibility 100%, but we do our best, and it's
pretty easy to avoid the problem here, so turning `read-from-minibuffer`
into a macro would not qualify as "do our best", I think.

> That being said, my preference would be to have the whole dancing
> happening at the C level (inside read_from_minibuffer and/or read_minibuf),
> which would solve that problem/these problems.

The [SOMETHINGn] are still outside of `read-from-minibuffer` so the
implementation of `read-from-minibuffer` doesn't affect the
problem, really.

> No worries ;-)  Now I see what you mean, and I do not see where you see
> a potential problem there: whether the minibuffer-completion-* elements
> become buffer-local depends on the minibuffer-local-completion
> variable. When it is nil (the default), they do not become buffer-local, and
> the behavior of read-from-minibuffer is the same as earlier.  This gives
> external package plenty of time to adapt their code to the future
> minibuffer-local-completion = t situation.

No, I'm talking about external packages for example those working like
`icomplete-mode`: they don't change the code which sets
`minibuffer-completion-table`, they just look for the completion table
in `minibuffer-completion-table`.  Currently such packages can access
`minibuffer-completion-table` from any buffer.
With our patches this is not the case any more: they can only access it
from the minibuffer.

So far I haven't found such code, tho, so maybe the risk of breakage is
actually much less severe than I imagined.  In any case, this is risk is
the same for both patches.


        Stefan






  reply	other threads:[~2021-04-23 20:24 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-27 17:44 bug#45474: Icomplete exhibiting in recursive minibuffer when it shouldn’t Dario Gjorgjevski
2021-04-15 17:40 ` Gregory Heytings
2021-04-15 21:11   ` Juri Linkov
2021-04-15 22:34     ` Gregory Heytings
2021-04-16  0:03       ` Gregory Heytings
2021-04-16 16:34         ` Juri Linkov
2021-04-16 16:55           ` Gregory Heytings
2021-04-17 20:49             ` Juri Linkov
2021-04-17 21:35               ` Gregory Heytings
2021-04-17 21:58                 ` Stefan Monnier
2021-04-17 22:16                   ` Gregory Heytings
2021-04-18 14:44                     ` Stefan Monnier
2021-04-18 22:23                       ` Gregory Heytings
2021-04-19  1:26                         ` Stefan Monnier
2021-04-19 12:14                           ` Gregory Heytings
2021-04-19 15:57                             ` Stefan Monnier
2021-04-19 20:20                               ` Gregory Heytings
2021-04-17 23:21                   ` bug#45474: [External] : " Drew Adams
2021-04-18  3:59                     ` Stefan Monnier
2021-04-18  4:04                       ` Drew Adams
2021-04-18  5:08                         ` Stefan Monnier
2021-04-18 15:42                           ` Drew Adams
2021-04-18 18:35                             ` Stefan Monnier
2021-04-18 20:11                               ` Drew Adams
2021-04-18 20:53                                 ` Stefan Monnier
2021-04-18 23:46                                   ` Drew Adams
2021-04-22 15:03                                     ` Stefan Monnier
2021-04-19 18:16                   ` Juri Linkov
2021-04-19 21:42                     ` Stefan Monnier
2021-04-20 19:00                       ` Gregory Heytings
2021-04-22 13:56                         ` Stefan Monnier
2021-04-22 14:08                           ` Gregory Heytings
2021-04-20 19:01                       ` Juri Linkov
2021-04-22 13:54                         ` Stefan Monnier
2021-04-22 14:13                           ` Stefan Monnier
2021-04-22 14:18                             ` Gregory Heytings
2021-04-22 15:18                               ` Gregory Heytings
2021-04-22 18:36                                 ` Stefan Monnier
2021-04-22 19:04                                   ` Gregory Heytings
2021-04-22 19:59                                     ` Gregory Heytings
2021-04-22 20:57                                       ` Gregory Heytings
2021-04-22 23:24                                     ` Stefan Monnier
2021-04-23  6:06                                       ` Eli Zaretskii
2021-04-23 13:12                                         ` Stefan Monnier
2021-04-23 13:19                                           ` Eli Zaretskii
2021-04-23 15:18                                             ` Stefan Monnier
2021-04-23 17:37                                               ` Eli Zaretskii
2021-04-23  6:59                                       ` Gregory Heytings
2021-04-23 13:21                                         ` Stefan Monnier
2021-04-23 13:45                                           ` Gregory Heytings
2021-04-23 15:35                                             ` Stefan Monnier
2021-04-23 15:58                                               ` Gregory Heytings
2021-04-23 16:36                                                 ` Juri Linkov
2021-04-23 16:55                                                 ` Stefan Monnier
2021-04-23 18:13                                                   ` Gregory Heytings
2021-04-23 20:24                                                     ` Stefan Monnier [this message]
2021-04-23 21:36                                                       ` Gregory Heytings
2021-04-23 21:54                                                         ` Stefan Monnier
2021-04-24  8:44                                                           ` Gregory Heytings
2021-05-01 19:34                                                             ` Stefan Monnier
2021-05-03  8:40                                                               ` Gregory Heytings
2022-06-07 12:04                                                                 ` Lars Ingebrigtsen
2021-04-22 21:57                             ` Juri Linkov
2021-04-23 15:53                               ` Stefan Monnier

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=jwvh7jw6a6m.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=45474@debbugs.gnu.org \
    --cc=dario.gjorgjevski@gmail.com \
    --cc=gregory@heytings.org \
    --cc=juri@linkov.net \
    /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).