是否可以在某种树表示中查看按inbuffers
分组的开放?directories
emacs ido-buffer mode
问问题
312 次
1 回答
1
“emacs ido 缓冲模式” ??
你的意思是ibuffer
?如果是这样的话...
它不是分组1,但按文件名排序是一个相当有用的近似值,默认情况下可用。
sf
不幸的是(在我看来)dired 缓冲区不包括在内。您可以通过定义包含它们的排序器的变体来解决此问题,然后重新映射绑定:
(eval-after-load 'ibuffer
'(progn
(define-ibuffer-sorter filename/directory/process
"Sort the buffers by their file name/process name."
(:description "file name")
(string-lessp
(or (buffer-file-name (car a))
(let ((dir (buffer-local-value 'dired-directory (car a))))
(if (consp dir) (car dir) dir))
(let ((pr-a (get-buffer-process (car a))))
(and (processp pr-a) (process-name pr-a))))
(or (buffer-file-name (car b))
(let ((dir (buffer-local-value 'dired-directory (car b))))
(if (consp dir) (car dir) dir))
(let ((pr-b (get-buffer-process (car b))))
(and (processp pr-b) (process-name pr-b))))))
(define-key ibuffer-mode-map
[remap ibuffer-do-sort-by-filename/process]
'ibuffer-do-sort-by-filename/directory/process)))
1按目录动态分组的功能会很漂亮。
于 2014-05-28T05:27:53.297 回答