Ken
Ken

Reputation: 5224

ido-switch-buffer and bury-buffer

I've recently started using ido-mode, which, overall, is pretty nice. But one thing seems especially broken, and I'm wondering if there's a setting (ha) buried in there to fix it.

ido-switch-buffer doesn't seem to care about buried buffers. That is, if I use bury-buffer, and then ido-switch-buffer, the first choice is often the one I just buried.

Is there an easy way around this? The whole point of burying a buffer is that I don't want to see it again any time soon.

Upvotes: 2

Views: 1645

Answers (5)

Stefan
Stefan

Reputation: 28601

FWIW, the default completion behavior of switch-to-buffer (C-x b) in Emacs-24 has been changed to use substring-match completion, so its behavior is similar to IDO while obeying the principle that "the default buffer shouldn't be the one I just buried". You can make it even more similar by turning on icomplete-mode (which does not change the completion behavior itself, but displays the completion candidates at the end of the minibuffer).

Upvotes: 0

Reputation:

Use next-buffer or previous-buffer

Upvotes: 0

halloleo
halloleo

Reputation: 10464

can't reproduce this either: when i bury a buffer and call ido-switch-buffer afterwards, the buried buffer is NOT at the front of the switch list.

i have done quite a bit of ido customization (to get it working well with dired, etc), but my main ido settings are:

(setq ido-show-dot-for-dired t)
(setq ido-default-file-method 'samewindow)
(setq ido-default-buffer-method 'samewindow)
(setq ido-confirm-unique-completion t)
(setq ido-max-dir-file-cache 20)

my ido.el version is "1.57 released on gnu.emacs.sources adapted for emacs 22.1".

hth.

Upvotes: 0

Ryan C. Thompson
Ryan C. Thompson

Reputation: 42090

I can't reproduce this. On Emacs 23, as far as I can tell, ido-switch-buffer lists the buffers in the correct order.

In any case, you might try out iswitchb instead. It's kind of like ido, only older and more specific to buffer switching. If you like it, you can use iswitchb for buffer switching and ido for everything else.

Upvotes: 0

gaizka
gaizka

Reputation: 574

Acording to the documentation (C-h f bury-buffer)

Put BUFFER-OR-NAME at the end of the list of all buffers.
There it is the least likely candidate for 'other-buffer' to return;
thus, the least likely buffer for C-x b to select by
default.

So, if you use bury-buffer the buffer will be still available (at the end of the list), so it's normal that ido-switch-buffer find it.

If you don't want to see that buffer ever, you should think of closing it.

Upvotes: 2

Related Questions