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.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Richard Copley <rcopley <at> gmail.com>
Cc: 12916 <at> debbugs.gnu.org
Subject: 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




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

Previous Next


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