bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#38458: 27.0.50; case-insensitive substring completion


From: Stephen Berman
Subject: bug#38458: 27.0.50; case-insensitive substring completion
Date: Mon, 02 Dec 2019 22:37:19 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

On Mon, 02 Dec 2019 22:45:11 +0200 Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Stephen Berman <stephen.berman@gmx.net>
>> Date: Mon, 02 Dec 2019 19:56:26 +0100
>>
>> Typing TAB for case-insensitive substring completion of file and buffer
>> names can put the cursor in the wrong position in the minibuffer.  To
>> reproduce:
>>
>> 0. $ mkdir /tmp/test; touch /tmp/test/{testing,Testing}
>> 1. $ emacs-master -Q --eval "(setq read-buffer-completion-ignore-case t
>>      read-file-name-completion-ignore-case t completion-category-overrides
>>      '((buffer (styles substring)) (file (styles substring))))"
>> 2. Type `C-x C-f /tmp/test/tes TAB'
>> => The minibuffer displays this, with point (^) after `s' in `testing':
>> Find file: /tmp/test/testing
>>                         ^
>> 3. Visit /tmp/test/testing and /tmp/test/Testing, then from a buffer
>> other than these, e.g. /temp/test, type `C-x b tes TAB'
>>
>> => The minibuffer displays this, with point (^) after `s' in `testing':
>> Switch to buffer (default *scratch*): testing
>>                                          ^
>>
>> I think these are unintended side effects of these two changes:
>
> If those changes caused this issue, then I think there was already a
> bug in the substring completion style, which was just exposed by those
> changes.
>
> CC'ing Stefan in the hope that he could show us the light.

FWIW, when I step through completion--do-completion at step 2 in the
above recipe, the return value of completion-try-completion is
("/tmp/test/testing" . 17) in builds before commit 0b21ecdb5e and
("/tmp/test/testing" . 13) in builds after that commit.  Consequently,
on executing (forward-char (- comp-pos (length completion))) later in
completion--do-completion, point moves back 4 characters in later builds
and stays put in earlier builds.

Steve Berman





reply via email to

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