unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#46368: Completion vs. "*" buffer names
@ 2021-02-07 16:52 積丹尼 Dan Jacobson
  2021-02-08  9:59 ` Gregory Heytings
  0 siblings, 1 reply; 9+ messages in thread
From: 積丹尼 Dan Jacobson @ 2021-02-07 16:52 UTC (permalink / raw)
  To: 46368

[-- Attachment #1: Type: text/plain, Size: 135 bytes --]

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.

[-- Attachment #2: 20210208T004619.jpg --]
[-- Type: image/jpeg, Size: 30213 bytes --]

[-- Attachment #3: Type: text/plain, Size: 137 bytes --]

(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"

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46368: Completion vs. "*" buffer names
  2021-02-07 16:52 bug#46368: Completion vs. "*" buffer names 積丹尼 Dan Jacobson
@ 2021-02-08  9:59 ` Gregory Heytings
  2021-02-09 15:58   ` 積丹尼 Dan Jacobson
  0 siblings, 1 reply; 9+ messages in thread
From: Gregory Heytings @ 2021-02-08  9:59 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 46368


>
> 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?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46368: Completion vs. "*" buffer names
  2021-02-08  9:59 ` Gregory Heytings
@ 2021-02-09 15:58   ` 積丹尼 Dan Jacobson
  2021-02-09 21:54     ` Gregory Heytings
  0 siblings, 1 reply; 9+ messages in thread
From: 積丹尼 Dan Jacobson @ 2021-02-09 15:58 UTC (permalink / raw)
  To: Gregory Heytings; +Cc: 46368

>>>>> "GH" == Gregory Heytings <gregory@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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46368: Completion vs. "*" buffer names
  2021-02-09 15:58   ` 積丹尼 Dan Jacobson
@ 2021-02-09 21:54     ` Gregory Heytings
  2021-02-10  0:31       ` 積丹尼 Dan Jacobson
  0 siblings, 1 reply; 9+ messages in thread
From: Gregory Heytings @ 2021-02-09 21:54 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 46368


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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46368: Completion vs. "*" buffer names
  2021-02-09 21:54     ` Gregory Heytings
@ 2021-02-10  0:31       ` 積丹尼 Dan Jacobson
  2021-02-10  9:59         ` Gregory Heytings
  0 siblings, 1 reply; 9+ messages in thread
From: 積丹尼 Dan Jacobson @ 2021-02-10  0:31 UTC (permalink / raw)
  To: Gregory Heytings; +Cc: 46368

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@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.






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46368: Completion vs. "*" buffer names
  2021-02-10  0:31       ` 積丹尼 Dan Jacobson
@ 2021-02-10  9:59         ` Gregory Heytings
  2021-02-10 11:55           ` 積丹尼 Dan Jacobson
  0 siblings, 1 reply; 9+ messages in thread
From: Gregory Heytings @ 2021-02-10  9:59 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 46368


>
> 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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46368: Completion vs. "*" buffer names
  2021-02-10  9:59         ` Gregory Heytings
@ 2021-02-10 11:55           ` 積丹尼 Dan Jacobson
  2021-02-10 12:16             ` Gregory Heytings
  0 siblings, 1 reply; 9+ messages in thread
From: 積丹尼 Dan Jacobson @ 2021-02-10 11:55 UTC (permalink / raw)
  To: Gregory Heytings; +Cc: 46368

$ 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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46368: Completion vs. "*" buffer names
  2021-02-10 11:55           ` 積丹尼 Dan Jacobson
@ 2021-02-10 12:16             ` Gregory Heytings
  2021-02-10 12:36               ` 積丹尼 Dan Jacobson
  0 siblings, 1 reply; 9+ messages in thread
From: Gregory Heytings @ 2021-02-10 12:16 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 46368


>
> $ 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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#46368: Completion vs. "*" buffer names
  2021-02-10 12:16             ` Gregory Heytings
@ 2021-02-10 12:36               ` 積丹尼 Dan Jacobson
  0 siblings, 0 replies; 9+ messages in thread
From: 積丹尼 Dan Jacobson @ 2021-02-10 12:36 UTC (permalink / raw)
  To: Gregory Heytings; +Cc: 46368

>>>>> "GH" == Gregory Heytings <gregory@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!





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-02-10 12:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-07 16:52 bug#46368: Completion vs. "*" buffer names 積丹尼 Dan Jacobson
2021-02-08  9:59 ` Gregory Heytings
2021-02-09 15:58   ` 積丹尼 Dan Jacobson
2021-02-09 21:54     ` Gregory Heytings
2021-02-10  0:31       ` 積丹尼 Dan Jacobson
2021-02-10  9:59         ` Gregory Heytings
2021-02-10 11:55           ` 積丹尼 Dan Jacobson
2021-02-10 12:16             ` Gregory Heytings
2021-02-10 12:36               ` 積丹尼 Dan Jacobson

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).