GNU bug report logs - #12916
24.2; Completion for "C-x b" does not include current buffer

Previous Next

Package: emacs;

Reported by: Richard Copley <rcopley <at> gmail.com>

Date: Sat, 17 Nov 2012 15:46:02 UTC

Severity: normal

Merged with 9598

Found in versions 23.0, 24.0.50, 24.2

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 12916 in the body.
You can then email your comments to 12916 AT debbugs.gnu.org in the normal way.

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#12916; Package emacs. (Sat, 17 Nov 2012 15:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Richard Copley <rcopley <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 17 Nov 2012 15:46:02 GMT) Full text and rfc822 format available.

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

From: Richard Copley <rcopley <at> gmail.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 24.2; Completion for "C-x b" does not include current buffer
Date: Sat, 17 Nov 2012 15:44:13 +0000
In older Emacs versions (*), to switch buffer, I could type "C-x b",
followed by a unique prefix of the desired buffer's name, then "TAB
RET". This routine no longer works. Specifically, the completion fails
when the desired buffer is already the current buffer. So before I can
switch, I first have to work out which window is selected and whether
its buffer is the one I want.

In my opinion this was a bad decision, and I think we should go back
to using "B" as the interactive spec for switch-to-buffer. Others
might disagree, so would it be possible to add a custom variable to
control whether the current buffer is included in the list of completions?

(*) (I think the behaviour changed on the trunk in
revisions 86915 and 86916, in April 2008.)

In GNU Emacs 24.2.1 (i386-mingw-nt6.1.7601)
 of 2012-08-29 on MARVIN

Major mode: Lisp Interaction

Recent input:
C-x b * s c r a t c h <tab> <tab> <tab> <tab> C-g
M-x r e p o r t - e m a c s - b u g <return>




Merged 9598 12916. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 17 Nov 2012 18:56:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12916; Package emacs. (Mon, 19 Nov 2012 14:24:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Richard Copley <rcopley <at> gmail.com>
Cc: 12916 <at> debbugs.gnu.org
Subject: Re: bug#12916: 24.2; Completion for "C-x b" does not include current
	buffer
Date: Mon, 19 Nov 2012 09:22:21 -0500
> In older Emacs versions (*), to switch buffer, I could type "C-x b",
> followed by a unique prefix of the desired buffer's name, then "TAB
> RET".  This routine no longer works.  Specifically, the completion fails
> when the desired buffer is already the current buffer.  So before I can
> switch, I first have to work out which window is selected and whether
> its buffer is the one I want.

Hmm... I'd expect the user to know in which buffer she is when she hits
C-x b.  Can you give us a few more hints about your use-case to try and
help me understand why you don't know in which buffer you are when you
hit C-x b?

> In my opinion this was a bad decision, and I think we should go back
> to using "B" as the interactive spec for switch-to-buffer.  Others
> might disagree, so would it be possible to add a custom variable to
> control whether the current buffer is included in the list of completions?

I'm not sure this deserves such a customization variable.  But in any
case, in the mean time, you can get back the previous behavior with the
following hack:

   (defadvice internal-complete-buffer-except (around rc-all-buffers activate)
     (setq ad-return-value #'internal-complete-buffer))

Maybe a cleaner workaround might be:

   (put 'switch-to-buffer 'interactive-form
        '(interactive "BSwitch to buffer: "))


-- Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12916; Package emacs. (Mon, 19 Nov 2012 20:13:02 GMT) Full text and rfc822 format available.

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

From: Richard Copley <rcopley <at> gmail.com>
To: 12916 <at> debbugs.gnu.org
Subject: Fwd: bug#12916: 24.2;
	Completion for "C-x b" does not include current buffer
Date: Mon, 19 Nov 2012 20:10:56 +0000
Stefan, sorry I replied to you personally without replying to the tracker.

On 19 November 2012 14:22, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:
>> In older Emacs versions (*), to switch buffer, I could type "C-x b",
>> followed by a unique prefix of the desired buffer's name, then "TAB
>> RET".  This routine no longer works.  Specifically, the completion fails
>> when the desired buffer is already the current buffer.  So before I can
>> switch, I first have to work out which window is selected and whether
>> its buffer is the one I want.
>
> Hmm... I'd expect the user to know in which buffer she is when she hits
> C-x b.  Can you give us a few more hints about your use-case to try and
> help me understand why you don't know in which buffer you are when you
> hit C-x b?

The short answer is, when I've just killed a buffer (and I'm reading
Wikipedia, talking to a co-worker and watching TV).

The longer answer is: when there are two windows visible, I've just
killed a buffer, the two windows are now showing the same buffer (and
by the way, who ordered that?!), I want both windows to show the same
buffer, and there's a family of ducklings walking past the window and
they're really cute.

My mental map of recently-used buffers is not per-window, so to me it
is now unpredictable what other buffer will be shown after I kill a
buffer. Now that I come to think about it, perhaps this is really my
problem.

>> In my opinion this was a bad decision, and I think we should go back
>> to using "B" as the interactive spec for switch-to-buffer.  Others
>> might disagree, so would it be possible to add a custom variable to
>> control whether the current buffer is included in the list of completions?
>
> I'm not sure this deserves such a customization variable. But in any
> case, in the mean time, you can get back the previous behavior with the
> following hack:
>
>    (defadvice internal-complete-buffer-except (around rc-all-buffers activate)
>      (setq ad-return-value #'internal-complete-buffer))
>
> Maybe a cleaner workaround might be:
>
>    (put 'switch-to-buffer 'interactive-form
>         '(interactive "BSwitch to buffer: "))

Thank you! That seems to behave just as I want.

> -- Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12916; Package emacs. (Mon, 19 Nov 2012 21:34:01 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: rcopley <at> gmail.com, 12916 <at> debbugs.gnu.org
Subject: Re: bug#12916: 24.2;
	Completion for "C-x b" does not include current buffer
Date: Mon, 19 Nov 2012 16:32:10 -0500
    Hmm... I'd expect the user to know in which buffer she is when she hits
    C-x b.

I often switch to a buffer without noticing I am already in it.
I have not made a note of the specific circumstances.  If you really
want to know, I will start noting that down.

I think one case is after some other command that switched buffers,
such as C-x k, or C-c C-c in a mail buffer.  In that situation I start
typing C-x b R TAB RET before my mind recognizes which buffer it left
me in.

-- 
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use Ekiga or an ordinary phone call





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12916; Package emacs. (Wed, 21 Nov 2012 08:17:01 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: rcopley <at> gmail.com, 12916 <at> debbugs.gnu.org
Subject: Re: bug#12916: 24.2;
	Completion for "C-x b" does not include current buffer
Date: Wed, 21 Nov 2012 03:14:55 -0500
    I'm not sure this deserves such a customization variable.  But in any
    case, in the mean time, you can get back the previous behavior with the
    following hack:

       (defadvice internal-complete-buffer-except (around rc-all-buffers activate)
	 (setq ad-return-value #'internal-complete-buffer))

Thanks.  Must better!

-- 
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use Ekiga or an ordinary phone call





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12916; Package emacs. (Sun, 31 Jan 2016 14:31:02 GMT) Full text and rfc822 format available.

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

From: Marcin Borkowski <mbork <at> mbork.pl>
To: bug#9598 <9598 <at> debbugs.gnu.org>
Cc: 12916 <at> debbugs.gnu.org
Subject: Re: Status: C-x b completion should also display current buffer.
Date: Sun, 31 Jan 2016 15:30:19 +0100
Hi all,

again the same question: what to do with this bug report?  The behavior
is still what a few people (including RMS) dislike, it is easy to
override it (although there is no mention of that in the manual, which
is very bad IMHO!), it also seems to be solved in Ivy (I don't know
about other completion frameworks - I would bet Icicles have a knob for
that, because Icicles have a knob for everything; Helm anybody?).

My personal suggestion would be either add a user option or (as a last
resort) write about the hack mentioned here in the manual, in the node
(info "(emacs)Select buffer").

Regards,

-- 
Marcin Borkowski
http://mbork.pl/en




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12916; Package emacs. (Sun, 31 Jan 2016 16:19:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Marcin Borkowski <mbork <at> mbork.pl>, bug#9598 <9598 <at> debbugs.gnu.org>
Cc: 12916 <at> debbugs.gnu.org
Subject: RE: bug#9598: Status: C-x b completion should also display current
 buffer.
Date: Sun, 31 Jan 2016 08:18:14 -0800 (PST)
> what to do with this bug report?  The behavior is still what

at least

> a few people (including RMS) dislike, it is easy to
> override it (although there is no mention of that in the manual, which
> is very bad IMHO!), it also seems to be solved in Ivy (I don't know
> about other completion frameworks - I would bet Icicles have a knob for
> that, because Icicles have a knob for everything; Helm anybody?).
> 
> My personal suggestion would be either add a user option or (as a last
> resort) write about the hack mentioned here in the manual, in the node
> (info "(emacs)Select buffer").

Yes, the bug should be addressed properly.  The behavior should
be controlled by users - at least by option and preferably also
on the fly, during completion (by a toggle or other means).

At a minimum, whatever means are currently provided to give users
some control over this, however arcane, rudimentary, or hackish,
should be well documented.

(And yes, Icicles buffer-name completion has already been described
in this bug thread.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12916; Package emacs. (Sun, 31 Jan 2016 16:57:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Marcin Borkowski <mbork <at> mbork.pl>
Cc: 12916 <at> debbugs.gnu.org, 9598 <at> debbugs.gnu.org
Subject: Re: bug#9598: Status: C-x b completion should also display current
 buffer.
Date: Sun, 31 Jan 2016 18:56:11 +0200
> From: Marcin Borkowski <mbork <at> mbork.pl>
> Date: Sun, 31 Jan 2016 15:30:19 +0100
> Cc: 12916 <at> debbugs.gnu.org
> 
> again the same question: what to do with this bug report?  The behavior
> is still what a few people (including RMS) dislike, it is easy to
> override it (although there is no mention of that in the manual, which
> is very bad IMHO!), it also seems to be solved in Ivy (I don't know
> about other completion frameworks - I would bet Icicles have a knob for
> that, because Icicles have a knob for everything; Helm anybody?).
> 
> My personal suggestion would be either add a user option or (as a last
> resort) write about the hack mentioned here in the manual, in the node
> (info "(emacs)Select buffer").

If someone wants to work on adding such an option, please do.  We can
add that on master.

One caveat: updating the documentation is part of the job.

TIA




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12916; Package emacs. (Sun, 06 Feb 2022 00:06:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Richard Stallman <rms <at> gnu.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 12916 <at> debbugs.gnu.org, drew.adams <at> ORACLE.COM,
 9598 <at> debbugs.gnu.org
Subject: Re: bug#12916: 24.2; Completion for "C-x b" does not include
 current buffer
Date: Sun, 06 Feb 2022 01:05:20 +0100
Richard Stallman <rms <at> gnu.org> writes:

>     > Defaults are very important issues, because they affect how good Emacs
>     > is for new users.
>
>     I didn't say they were not important, just that arguing about them is
>     a waste of time.  Nothing good ever comes out of these arguments.
>
> Rather than just argue about good defaults, I plan to poll the users.

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

I think the conclusion here was that the buffer completion defaults are
fine, so I'm closing this bug report.

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




bug closed, send any further explanations to 12916 <at> debbugs.gnu.org and Richard Copley <rcopley <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 06 Feb 2022 00:06:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 06 Mar 2022 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 49 days ago.

Previous Next


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