From: Dmitry Gutov <dmitry@gutov.dev>
To: Eshel Yaron <me@eshelyaron.com>, Eli Zaretskii <eliz@gnu.org>
Cc: rpluim@gmail.com, "Stefan Monnier" <monnier@iro.umontreal.ca>,
visuweshm@gmail.com, 72176@debbugs.gnu.org, aqua0210@foxmail.com,
"João Távora" <joaotavora@gmail.com>
Subject: bug#72176: 30.0.60; icomplete-vertical-mode failed to work with Error
Date: Sun, 21 Jul 2024 05:27:43 +0300 [thread overview]
Message-ID: <384a9697-275c-4d0b-96a5-3741b3883696@gutov.dev> (raw)
In-Reply-To: <m1frs4ko15.fsf@dazzs-mbp.home>
Hi Eshel,
On 20/07/2024 19:48, Eshel Yaron wrote:
> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> From: João Távora <joaotavora@gmail.com>
>>> Date: Sat, 20 Jul 2024 10:09:38 +0100
>>> Cc: Robert Pluim <rpluim@gmail.com>, 72176@debbugs.gnu.org, aqua0210@foxmail.com,
>>> visuweshm@gmail.com
>>>
>>> On Sat, Jul 20, 2024 at 7:05 AM Eli Zaretskii <eliz@gnu.org> wrote:
>>>
>>>> Adding João, who I think wrote this code.
>>>
>>> Don't understand root cause, but it's in the whereabouts of
>>> the current analysis, yes. I recall regexp is supposed to always
>>> match, because it has (presumably) been used for a previous
>>> filtering. This breakage would seem to be a consequence of
>>> 3b07d33059150 by Eshel Yaron which in turn seems to be fixing
>>> something stemming from some feature Dmitry added in
>>> 6b7ff60a5e71c in June. I went one commit before that one and
>>> the recipe didn't break.
>>
>> Thanks, I'm adding the guilty parties to this discussion.
>
> I'm afraid you missed your mark, because AFAICT it is Stefan Monnier
> that's behind the root cause of this issue, which goes back way before
> Dmitry's change or mine :)
Thanks for investigating! It might or might not be considered a bug (the
behavior had been working out okay before our changes), but your
proposal does make it more consistent, so I hope we can use it.
vc-annotate for lines in question points to commit 86957a0cd which
references bug#11714. I _haven't_ been able to reproduce it with them
commented out now - my guess it's because of the file-name-quote
operation that had been added much later (the last comment in the bug
mentions that functionality as a hypothetical).
So maybe they really are unnecessary now. Though the
quoting-unquoting-requoting stuff is pretty gnarly, so it'd be great to
get a go-ahead from Stefan as well.
> It is a bug in completion--sifn-requote, that leads to incorrect
> completion strings to be passed to completion-lazy-hilit. It is not
> related to icomplete per se. To see the issue, try the following:
>
> 1. emacs -Q
> 2. say C-x C-f, clear the minibuffer, and insert ~/.config/~/f
> 3. hit ? to pop the completions list
> 4. see something like:
>
> --8<---------------cut here---------------start------------->8---
> Click or type M-RET on a completion to select it.
> Type M-<down> or M-<up> to move point between completions.
>
> 6 possible completions:
> .config/~/foo.json .config/~/foo.org .config/~/foo.php
> .config/~/foo.py .config/~/foo.py~ .config/~/foo.rs
> --8<---------------cut here---------------end--------------->8---
>
> Note the incorrect prefix ".config/~/", completions should appear as
> "foo.json", "foo.org", etc.
>
> The following diff fixes this for me (including the icomplete symptom),
> although I can't claim to fully understand completion--sifn-requote yet:
>
> diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
> index 31c365bf850..d0eb6b43c80 100644
> --- a/lisp/minibuffer.el
> +++ b/lisp/minibuffer.el
> @@ -3855,13 +3855,13 @@ completion--sifn-requote
> ;; Second assumptions: If qpos is far from the end this can be a bit slow,
> ;; so we speed it up by doing a first loop that skips a word at a time.
> ;; This word-sized loop is careful not to cut in the middle of env-vars.
> - (while (let ((boundary (string-match "\\(\\$+{?\\)?\\w+\\W*\\'" qstr)))
> - (and boundary
> - (progn
> - (setq qprefix (substring qstr 0 boundary))
> - (string-prefix-p uprefix
> - (substitute-in-file-name qprefix)))))
> - (setq qstr qprefix))
> + ;; (while (let ((boundary (string-match "\\(\\$+{?\\)?\\w+\\W*\\'" qstr)))
> + ;; (and boundary
> + ;; (progn
> + ;; (setq qprefix (substring qstr 0 boundary))
> + ;; (string-prefix-p uprefix
> + ;; (substitute-in-file-name qprefix)))))
> + ;; (setq qstr qprefix))
> (let ((qpos (length qstr)))
> (while (and (> qpos 0)
> (string-prefix-p uprefix
next prev parent reply other threads:[~2024-07-21 2:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-18 12:13 bug#72176: 30.0.60; icomplete-vertical-mode failed to work with Error Eason Huang
2024-07-18 12:41 ` Eli Zaretskii
2024-07-18 12:49 ` Visuwesh
2024-07-18 14:34 ` Robert Pluim
2024-07-18 15:34 ` Eli Zaretskii
2024-07-19 7:15 ` Robert Pluim
2024-07-20 6:05 ` Eli Zaretskii
2024-07-20 9:09 ` João Távora
2024-07-20 10:15 ` Eli Zaretskii
2024-07-20 16:48 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-21 2:27 ` Dmitry Gutov [this message]
2024-07-21 21:42 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-25 7:31 ` Eli Zaretskii
2024-07-25 12:40 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-20 10:07 ` Eason Huang
2024-07-20 10:43 ` Eli Zaretskii
2024-07-18 13:11 ` Arash Esbati
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=384a9697-275c-4d0b-96a5-3741b3883696@gutov.dev \
--to=dmitry@gutov.dev \
--cc=72176@debbugs.gnu.org \
--cc=aqua0210@foxmail.com \
--cc=eliz@gnu.org \
--cc=joaotavora@gmail.com \
--cc=me@eshelyaron.com \
--cc=monnier@iro.umontreal.ca \
--cc=rpluim@gmail.com \
--cc=visuweshm@gmail.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).