开发者

ido-mode distinguish dired-mode buffer names

开发者 https://www.devze.com 2022-12-28 06:43 出处:网络
does anyone know of a good way to distinguish dired-mode buffer names from other types of buffers in the minibuffer while using ido-mode? For instance... s开发者_StackOverflowhowing a forward-slash at

does anyone know of a good way to distinguish dired-mode buffer names from other types of buffers in the minibuffer while using ido-mode? For instance... s开发者_StackOverflowhowing a forward-slash at end of a dired-mode buffer name?


You could simply change the dired-mode buffers to always have /s at the end of their names. This code does that.

(add-hook 'dired-mode-hook 'ensure-buffer-name-ends-in-slash)
(defun ensure-buffer-name-ends-in-slash ()
  "change buffer name to end with slash"
  (let ((name (buffer-name)))
    (if (not (string-match "/$" name))
        (rename-buffer (concat name "/") t))))
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号