3

如何在 emacs 中指定一个用于打开新文件/缓冲区的窗口?

当我打开一个文件时,比如说使用o命令,它会在一个新窗口中打开。但我希望这个文件在我指定的窗口中打开。

4

1 回答 1

5
(defun dired-window () (window-at (frame-width) 1))

(eval-after-load 'dired
  '(define-key dired-mode-map (kbd "o")
     (lambda ()
       (interactive)
       (let ((dired-window (dired-window)))
         (set-window-buffer dired-window
                            (find-file-noselect 
                             (dired-get-file-for-visit)))
         (select-window dired-window)))))
于 2012-04-09T18:39:01.993 回答