简体   繁体   中英

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?

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.

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 Cs for <right> and Cr 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))))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM