我通过使用这个常见的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)
Run Code Online (Sandbox Code Playgroud)
不幸的是,dired使用目录作为缓冲区名称,因此专用dired窗口只将它专用于该目录.向上或向下导航后,它会在单独的窗口中打开一个新缓冲区.我想要做的是将一个窗口专用于主要模式(在这种情况下为dired),并且默认为该模式的所有新缓冲区都更喜欢该窗口.这可能吗?