I use ido-mode
under Emacs 24 with the following settings:
(ido-mode 1)
(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
(setq ido-use-filename-at-point 'guess)
(setq ido-use-url-at-point t)
(setq ffap-require-prefix t)
Assume you have several files with the same name but different endings in the current directory. If you change buffers via C-x b
, you receive several suggestions. Can the order of these suggestions be somehow influenced?
As an example, assume you have multiple Sweave (.Rnw) files in the current directory. They are always more important than the corresponding (.tex) files which are created from them. So in most of the cases, you want to change the buffer to the .Rnw file, not the .tex file. It would therefore be nice if the .Rnw files were suggested first (in all directories where both .Rnw and .tex files with the same base name exist).
"If you'd like to tweak the default file sorting, like making Sweave-files appear first, tell ido which files to give a higher sort priority:"
(setq ido-file-extensions-order '(".Rnw" ".tex"))
But it works only for ido-find-file
not for ido-switch-buffer
. Buffers are sorted by most recent
property. I don't know about functionality, which adds another sorting property over most recent
. Function ido-file-extension-lessp
could be used for sorting list of buffers this way. But two kind of sorting may conflict with each other.