我使用以下一段常见的elisp代码,让Emacs基本上按照我的意愿运作:
(defun toggle-current-window-dedication ()
(interactive)
(let* ((window (selected-window))
(dedicated (window-dedicated-p window)))
(set-window-dedicated-p window (not dedicated))
(message "Window %sdedicated to %s"
(if dedicated "no longer " "")
(buffer-name))))
(global-set-key [pause] 'toggle-current-window-dedication)
不幸的是,dired使用目录作为缓冲区名称,因此专用dired窗口仅专用于该目录。一旦您向上或向下导航,它就会在单独的窗口中打开新缓冲区。我想要做的是将一个窗口专用于一个主模式(在这种情况下是dired),并且所有默认为该模式的新缓冲区都优先选择该窗口。这可能吗?
dired-single
将文件与*dired*
缓冲区在同一个窗口中打开。虽然这对于目录来说很完美,但如果能像使用dired-find-file-other-window
一样处理文件就更好了... - hupf