GNU bug report logs - #46368
Completion vs. "*" buffer names

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Sun, 7 Feb 2021 16:53:02 UTC

Severity: wishlist

Merged with 43440

To reply to this bug, email your comments to 46368 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 bug-gnu-emacs <at> gnu.org:
bug#46368; Package emacs. (Sun, 07 Feb 2021 16:53:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 07 Feb 2021 16:53:02 GMT) Full text and rfc822 format available.

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

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-gnu-emacs <at> gnu.org
Subject: Completion vs. "*" buffer names
Date: Mon, 08 Feb 2021 00:52:04 +0800
[Message part 1 (text/plain, inline)]
Look at the bottom line of the image.
Here we see completion will never work,
because the "*" is missing from the start of the string.
[20210208T004619.jpg (image/jpeg, inline)]
[Message part 3 (text/plain, inline)]
(Our cursor is at the end of the line there at the bottom.)
How did we end up this way?
Well we just hit "un<TAB>".
emacs-version "27.1"

Forcibly Merged 43440 46368. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 07 Feb 2021 18:30:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#46368; Package emacs. (Mon, 08 Feb 2021 11:15:02 GMT) Full text and rfc822 format available.

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

From: Gregory Heytings <gregory <at> heytings.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 46368 <at> debbugs.gnu.org
Subject: Re: bug#46368: Completion vs. "*" buffer names
Date: Mon, 08 Feb 2021 09:59:06 +0000
>
> Look at the bottom line of the image.
> Here we see completion will never work,
> because the "*" is missing from the start of the string.
>
> (Our cursor is at the end of the line there at the bottom.)
> How did we end up this way?
> Well we just hit "un<TAB>".
> emacs-version "27.1"
>

Does (setq read-buffer-completion-ignore-case t) solve your problem?

If not, could you provide a recipe, starting with emacs -Q, to reproduce 
the problem?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#46368; Package emacs. (Tue, 09 Feb 2021 17:26:02 GMT) Full text and rfc822 format available.

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

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Gregory Heytings <gregory <at> heytings.org>
Cc: 46368 <at> debbugs.gnu.org
Subject: Re: bug#46368: Completion vs. "*" buffer names
Date: Tue, 09 Feb 2021 23:58:22 +0800
>>>>> "GH" == Gregory Heytings <gregory <at> heytings.org> writes:

GH> Does (setq read-buffer-completion-ignore-case t) solve your problem?

I see I already have

    read-buffer-completion-ignore-case is a variable defined in ‘C source code’.
    Its value is t
    Original value was nil

GH> If not, could you provide a recipe, starting with emacs -Q, to
GH> reproduce the problem?

$ emacs -Q
 C-x m            	;; compose-mail
 C-x m			;; compose-mail
 C-x b			;; switch-to-buffer
 b			;; self-insert-command
 <return>		;; minibuffer-complete-and-exit
 C-x b			;; switch-to-buffer
 u			;; self-insert-command
 <tab>			;; minibuffer-complete
 <tab>			;; minibuffer-complete
 <tab>			;; minibuffer-complete
 <tab>			;; minibuffer-complete
 <return>		;; minibuffer-complete-and-exit
 <return>		;; minibuffer-complete-and-exit
 C-x C-b		;; list-buffers
 C-h l			;; view-lossage




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#46368; Package emacs. (Wed, 10 Feb 2021 00:33:02 GMT) Full text and rfc822 format available.

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

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Gregory Heytings <gregory <at> heytings.org>
Cc: 46368 <at> debbugs.gnu.org
Subject: Re: bug#46368: Completion vs. "*" buffer names
Date: Wed, 10 Feb 2021 08:31:54 +0800
The problem is emacs prompts with A when it should prompt with B:

[A] Switch to buffer (default *scratch*): scratch*
[B] Switch to buffer (default *scratch*): *scratch*

There is no basis for emacs to produce A.
The line is not too long so need to be truncated at the front.
The asterisk at the front is not more boring than the asterisk at the end.
Emacs simply makes a mistake, dropping the asterisk at the front.
If it kept the asterisk on the front, matching would work properly.

Your tests are biased, in that you are still executing from one of the
buffers involved. My tests move to a third neutral buffer.

$ emacs -Q --eval '(progn(clone-buffer)(switch-to-buffer "x"))'
Then typs
 C-x b			;; switch-to-buffer
 s			;; self-insert-command
 c			;; self-insert-command
 <tab>			;; minibuffer-complete
 <tab>			;; minibuffer-complete
 C-h l			;; view-lossage

And, even if matching, say, still works super duper, etc. By forgetting
the asterisk at front, emacs looks like it forgot something.

>>>>> "GH" == Gregory Heytings <gregory <at> heytings.org> writes:

GH> Thank you.  Here's a shorter recipe:

GH> emacs -Q
GH> M-x clone-buffer
GH> C-x b RET
GH> C-x b s TAB

GH> At that point it is possible to select "*scratch*<2>" by typing < TAB,
GH> but it is not possible to select "*scratch*".  With

GH> C-x b *s TAB

GH> there is no problem however, there is no problem, so I'm not sure it's
GH> a bug.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#46368; Package emacs. (Wed, 10 Feb 2021 01:48:02 GMT) Full text and rfc822 format available.

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

From: Gregory Heytings <gregory <at> heytings.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 46368 <at> debbugs.gnu.org
Subject: Re: bug#46368: Completion vs. "*" buffer names
Date: Tue, 09 Feb 2021 21:54:37 +0000
Thank you.  Here's a shorter recipe:

emacs -Q
M-x clone-buffer
C-x b RET
C-x b s TAB

At that point it is possible to select "*scratch*<2>" by typing < TAB, but 
it is not possible to select "*scratch*".  With

C-x b *s TAB

there is no problem however, there is no problem, so I'm not sure it's a 
bug.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#46368; Package emacs. (Wed, 10 Feb 2021 10:00:01 GMT) Full text and rfc822 format available.

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

From: Gregory Heytings <gregory <at> heytings.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 46368 <at> debbugs.gnu.org
Subject: Re: bug#46368: Completion vs. "*" buffer names
Date: Wed, 10 Feb 2021 09:59:51 +0000
>
> The problem is emacs prompts with A when it should prompt with B:
>
> [A] Switch to buffer (default *scratch*): scratch*
> [B] Switch to buffer (default *scratch*): *scratch*
>
> There is no basis for emacs to produce A.
>

The basis is that you typed "s" instead of "*s".

>
> Emacs simply makes a mistake, dropping the asterisk at the front.
>

Emacs did not "drop" the asterisk at the front, it did not add the 
asterisk at the front.  I don't know whether not adding the asterisk at 
the front at that point is a bug.

>
> Your tests are biased, in that you are still executing from one of the 
> buffers involved.
>

No, the C-x b RET (third line) moves to the *Messages* buffer.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#46368; Package emacs. (Wed, 10 Feb 2021 11:56:02 GMT) Full text and rfc822 format available.

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

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Gregory Heytings <gregory <at> heytings.org>
Cc: 46368 <at> debbugs.gnu.org
Subject: Re: bug#46368: Completion vs. "*" buffer names
Date: Wed, 10 Feb 2021 19:55:45 +0800
$ emacs -nw -Q --eval '(progn(switch-to-buffer "xbp")(switch-to-buffer "xbq")(switch-to-buffer "m"))'
 b                                     ;; self-insert-command
 TAB                                   ;; minibuffer-complete

gives:

-UUU:----F1  m              All L1     (Fundamental) -------------
In this buffer, type RET to select the completion near point.

Possible completions are:
xbp
xbq
-UUU:%*--F1  *Completions*   All L1     (Completion List) --------
Switch to buffer (default xbq): b

What is bugging me is that in the *completions* buffer, the x is added
to the front, properly. But in the minibuffer it is missing.
Yes I didn't type "x", but still, emacs should put it in the minibuffer
for me. Emacs will eventually, but it would be better sooner than later.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#46368; Package emacs. (Wed, 10 Feb 2021 12:17:01 GMT) Full text and rfc822 format available.

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

From: Gregory Heytings <gregory <at> heytings.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 46368 <at> debbugs.gnu.org
Subject: Re: bug#46368: Completion vs. "*" buffer names
Date: Wed, 10 Feb 2021 12:16:25 +0000
>
> $ emacs -nw -Q --eval '(progn(switch-to-buffer "xbp")(switch-to-buffer "xbq")(switch-to-buffer "m"))'
> b                                     ;; self-insert-command
> TAB                                   ;; minibuffer-complete
>
> What is bugging me is that in the *completions* buffer, the x is added 
> to the front, properly. But in the minibuffer it is missing. Yes I 
> didn't type "x", but still, emacs should put it in the minibuffer for 
> me. Emacs will eventually, but it would be better sooner than later.
>

Yes, that's because "partial-completion" is a member of 
"completion-styles".  Try

$ emacs -nw -Q --eval '(progn(switch-to-buffer "xbp")(switch-to-buffer "ybq")(switch-to-buffer "m"))'
b
TAB

and you'll see that the two completion candidates are displayed in the 
*Completions* buffer, even though they have a different prefix ("x" and 
"y").

Perhaps that would be an enhancement request: when all completion 
candidates start with the same prefix, add it to the input string when 
minibuffer-complete is called.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#46368; Package emacs. (Wed, 10 Feb 2021 12:37:01 GMT) Full text and rfc822 format available.

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

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Gregory Heytings <gregory <at> heytings.org>
Cc: 46368 <at> debbugs.gnu.org
Subject: Re: bug#46368: Completion vs. "*" buffer names
Date: Wed, 10 Feb 2021 20:36:15 +0800
>>>>> "GH" == Gregory Heytings <gregory <at> heytings.org> writes:

GH> Perhaps that would be an enhancement request: when all completion
GH> candidates start with the same prefix, add it to the input string when
GH> minibuffer-complete is called.

Yes, that sounds great!




Severity set to 'wishlist' from 'minor' Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 14 Sep 2023 20:10:02 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 330 days ago.

Previous Next


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