momeara
momeara

Reputation: 1381

Emacs ido start with open buffers first in cycle list

When switching buffers with emacs ido mode enabled, a list of completions are displayed in the minibuffer. It appears there is a "feature" that buffers that are already open are put to the end of the list. I, however, often open the same buffer in multiple panes.

Is there a way to either turn this "feature" off, or alternatively do the opposite: have the buffers that are already open be at the front of the completion list?

Upvotes: 1

Views: 340

Answers (2)

Michael Markert
Michael Markert

Reputation: 4026

This is not possible unless you want to wade deep in ido's intestines.

As eGlyph already said: You're likely using ido wrongly (and there's also C-s for <right> and C-r for <left>; no need for arrow keys).

But you can define command for choosing among the already shown buffers (here only from the current frame, if you want all shown buffers you have to collect the windows first via `frame-list):

(defun choose-from-shown-buffers ()
  (interactive)
  (let ((buffers (mapcar (lambda (window)
                            (buffer-name (window-buffer window)))
                         (window-list))))
      (pop-to-buffer (ido-completing-read "Buffer: " buffers))))

Upvotes: 0

eGlyph
eGlyph

Reputation: 1137

The main point of ido mode is that you don't use arrows to navigate between buffers in the minibuffer. Instead you type the part of the buffer's name. In this case it doesn't matter where the buffer is in the list.

Upvotes: 1

Related Questions