2011-12-21 58 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))) 

相关问题