5

ido-mode次の設定でEmacs 24の下で使用します:

(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)

現在のディレクトリに、名前が同じで末尾が異なる複数のファイルがあるとします。経由でバッファを変更するC-x bと、いくつかの提案が表示されます。これらの提案の順序に何らかの影響を与えることはできますか?

例として、現在のディレクトリに複数の Sweave (.Rnw) ファイルがあるとします。それらは、それらから作成された対応する (.tex) ファイルよりも常に重要です。したがって、ほとんどの場合、バッファーを .tex ファイルではなく .Rnw ファイルに変更します。したがって、最初に .Rnw ファイルが提案されるとよいでしょう (同じ基本名を持つ .Rnw ファイルと .tex ファイルの両方が存在するすべてのディレクトリ内)。

4

1 に答える 1

8

"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.

于 2013-01-16T16:05:27.740 に答える