views:

354

answers:

4

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.

+1  A: 

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.

gaizka
Right. That only works for switch-to-buffer (builtin C-x b). ido-switch-buffer (ido-mode's C-x b) seems to ignore this ordering, and often puts it first. I want to have ido-switch-buffer's completion, with switch-to-buffer's knowledge of burying.
Ken
A: 

Use 'next-buffer or 'previous-buffer

A: 

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.

Ryan Thompson
A: 

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.

halloleo