2011-12-21 60 views

回答

2

開箱即可做到這一點。

find-buffer-other-frame之類的但他們打開新的框架。

你可以做的是寫自己的功能是這樣的:

(defun find-file-in-frame() 
    (interactive) 
    (call-interactively 'select-frame-by-name) 
    (call-interactively 'find-file)) 

此開關框架和然後要求的文件,如果你想,否則你必須做更多的工作去做。

編輯:在這裏,要求在當前幀,並打開另一個窗口中的文件版本:

(defun find-file-in-frame (noselect) 
    (interactive "P") 
    (let ((current-frame (selected-frame)) 
     (frame (completing-read "Frame: " (make-frame-names-alist))) 
     (buffer (save-window-excursion 
        (call-interactively 'find-file)))) 
    (select-frame-set-input-focus (assoc-default frame 
               (make-frame-names-alist) 
               nil current-frame)) 
    (switch-to-buffer buffer) 
    (when noselect 
     (select-frame-set-input-focus current-frame)))) 
0

如果你只是指find-file,那麼我建議,隨着windmove相結合, framemove,切換到您希望打開文件的框架如此簡單快速,以至於您可能不需要任何更新。

OTOH如果您希望能夠通過任何方式打開文件時選擇一個幀,這顯然不適用。

0

不知道你真的在問什麼。但是對於在另一個幀中從Dired打開文件,只需使用C-oM-mouse-2 in Dired+。那些綁定到這些命令,如果你不想加載Dired +出於某種原因:

 
    (defun diredp-find-file-other-frame() ; Bound to `C-o' 
     "In Dired, visit this file or directory in another frame." 
     (interactive) 
     (find-file-other-frame (file-name-sans-versions (dired-get-filename nil t) t))) 

    (defun diredp-mouse-find-file-other-frame (event) ; Bound to `M-mouse-2' 
     "In Dired, visit file or directory clicked on in another frame." 
     (interactive "e") 
     (let ((pop-up-frames t)) (dired-mouse-find-file-other-window event))) 

相關問題