GNU bug report logs - #38476
27.0.50; substring completion feature request

Previous Next

Package: emacs;

Reported by: Stephen Berman <stephen.berman <at> gmx.net>

Date: Tue, 3 Dec 2019 19:34:02 UTC

Severity: wishlist

Found in version 27.0.50

To reply to this bug, email your comments to 38476 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org:
bug#38476; Package emacs. (Tue, 03 Dec 2019 19:34:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stephen Berman <stephen.berman <at> gmx.net>:
New bug report received and forwarded. Copy sent to monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org. (Tue, 03 Dec 2019 19:34:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; substring completion feature request
Date: Tue, 03 Dec 2019 20:32:55 +0100
The placement of point in substring completion is sometimes suboptimal.
E.g. if there two files (or buffers) file1test and file2test and you
enter `fi TAB' then it completes to `file' with point after the `e',
which is fine for further input; but if you enter `te TAB' then it
completes to `test' with point after the second `t', so you have to move
point to complete the name.  It would be nice if in such cases point
were placed at the start rather than the end of the partial match.

Steve Berman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38476; Package emacs. (Fri, 20 May 2022 11:41:01 GMT) Full text and rfc822 format available.

Message #8 received at 38476 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 38476 <at> debbugs.gnu.org
Subject: Re: bug#38476: 27.0.50; substring completion feature request
Date: Fri, 20 May 2022 13:39:58 +0200
Stephen Berman <stephen.berman <at> gmx.net> writes:

> The placement of point in substring completion is sometimes suboptimal.
> E.g. if there two files (or buffers) file1test and file2test and you
> enter `fi TAB' then it completes to `file' with point after the `e',
> which is fine for further input; but if you enter `te TAB' then it
> completes to `test' with point after the second `t', so you have to move
> point to complete the name.  It would be nice if in such cases point
> were placed at the start rather than the end of the partial match.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I'm not able to reproduce this in Emacs 29 -- it just says "no match"
with "te TAB".

With "*te TAB" it completes to file*test with point after *, which seems
correct, too.

Perhaps you're using a different completion system than the default?  If
not, do you have a recipe to reproduce the problem, starting from "emacs -Q"?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 20 May 2022 11:41:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38476; Package emacs. (Fri, 20 May 2022 12:29:01 GMT) Full text and rfc822 format available.

Message #13 received at 38476 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 38476 <at> debbugs.gnu.org
Subject: Re: bug#38476: 27.0.50; substring completion feature request
Date: Fri, 20 May 2022 14:28:23 +0200
On Fri, 20 May 2022 13:39:58 +0200 Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> Stephen Berman <stephen.berman <at> gmx.net> writes:
>
>> The placement of point in substring completion is sometimes suboptimal.
>> E.g. if there two files (or buffers) file1test and file2test and you
>> enter `fi TAB' then it completes to `file' with point after the `e',
>> which is fine for further input; but if you enter `te TAB' then it
>> completes to `test' with point after the second `t', so you have to move
>> point to complete the name.  It would be nice if in such cases point
>> were placed at the start rather than the end of the partial match.
>
> (I'm going through old bug reports that unfortunately weren't resolved
> at the time.)
>
> I'm not able to reproduce this in Emacs 29 -- it just says "no match"
> with "te TAB".

Sorry, my bug report was woefully incomplete.  It was filed as a
followup to bug bug#38458 at the request of Stefan Monnier, but I should
have made it self-contained.  Here's the recipe:

0. $ mkdir /tmp/test; touch /tmp/test/{file1test,file2test}
1. $ emacs-master -Q --eval "(setq completion-category-overrides
     '((buffer (styles substring)) (file (styles substring))))"
2. Type `C-x C-f /tmp/test/te TAB'
=> The minibuffer displays the following, with point at the end of the line:

Find file: /tmp/test/test

Typing TAB a second time pops up a the *Completions* buffer showing
file1test and file2test as the two possible completions.  But to
complete either of these in the minibuffer you have to move point.
That's the bug (or feature request).

> With "*te TAB" it completes to file*test with point after *, which seems
> correct, too.

Yes, that input didn't occur to me when I filed the report.  I just now
scrolled through the Completion node of the Emacs manual and didn't see
a reference to it; is it documented?  If not, perhaps it should be.
Anyway, using * comes close to satisfying the feature request, so if
it's too hard to make it work without the *, I can live with having to
use *.

Steve Berman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38476; Package emacs. (Fri, 20 May 2022 12:35:03 GMT) Full text and rfc822 format available.

Message #16 received at 38476 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 38476 <at> debbugs.gnu.org
Subject: Re: bug#38476: 27.0.50; substring completion feature request
Date: Fri, 20 May 2022 14:34:16 +0200
Stephen Berman <stephen.berman <at> gmx.net> writes:

> 0. $ mkdir /tmp/test; touch /tmp/test/{file1test,file2test}
> 1. $ emacs-master -Q --eval "(setq completion-category-overrides
>      '((buffer (styles substring)) (file (styles substring))))"
> 2. Type `C-x C-f /tmp/test/te TAB'
> => The minibuffer displays the following, with point at the end of the line:
>
> Find file: /tmp/test/test

Thanks.  With that recipe, I can reproduce the behaviour.

> Typing TAB a second time pops up a the *Completions* buffer showing
> file1test and file2test as the two possible completions.  But to
> complete either of these in the minibuffer you have to move point.
> That's the bug (or feature request).

Yeah, that doesn't seem like the best place to put point.

>> With "*te TAB" it completes to file*test with point after *, which seems
>> correct, too.
>
> Yes, that input didn't occur to me when I filed the report.  I just now
> scrolled through the Completion node of the Emacs manual and didn't see
> a reference to it; is it documented?  If not, perhaps it should be.

I think I've learned about * through osmosis -- perhaps it isn't
documented?  But it definitely should be.

> Anyway, using * comes close to satisfying the feature request, so if
> it's too hard to make it work without the *, I can live with having to
> use *.

It'd be nice if `substring' placed point where the * thing does, but
perhaps there are reasons for the current behaviour...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Removed tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 17 Jun 2022 18:35:02 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 86 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.