当我使用多个帧时,我想确定Emacs应该在哪个帧中打开文件/缓冲区。在Emacs中,如何在另一个框架中以“ibuffer/dired模式”打开缓冲区/文件?
3
A
回答
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-o或M-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)))
相关问题
- 1. 我在一个框架中有两个emacs缓冲区:A.cc | B.cc
- 2. Emacs协作缓冲区以错误模式打开
- 3. 如何在右侧窗口中打开emacs-nav缓冲区?
- 4. 当一个命令尝试以shell模式打开一个编辑器时打开一个Emacs缓冲区
- 5. 打开文件时打开没有暂存缓冲区的emacs
- 6. 在Emacs缓冲区中居中文本
- 7. Emacs搜索并打开多个文件并在所有缓冲区中搜索
- 8. 在pyqt中打开另一个框架
- 9. Emacs ido在循环列表中首先打开缓冲区
- 10. 如何计算Emacs中打开的缓冲区/文件的数量?
- 11. 在Emacs中打开文件后自动进入缓冲区结束?
- 12. 命令T在以前打开的缓冲区中打开文件
- 13. Cocoa Emacs打印缓冲区
- 14. 如何强制组织模式在另一个框架中打开链接?
- 15. Emacs:如何在另一个窗口中继续缓冲区内容?
- 16. 如何恢复emacs缓冲区列表中的缓冲区?
- 17. 如何在info模式下打开emacs中的* .info文件?
- 18. 在Emacs中使用js2模式缓冲区的正确缩进
- 19. 如何在HTML中打开链接到另一个框架?
- 20. Emacs/Python:在线缓冲区与块缓冲区模式下运行python-shell
- 21. Dired - 在另一个Emacs窗口中打开文件
- 22. 如何从另一个框架中打开一个框架中的特定html?
- 23. 在Emacs小缓冲区
- 24. 在vim中打开文件到空缓冲区
- 25. 如果在其他窗口中打开缓冲区,Emacs切换到缓冲区(Cx b)将更改窗口
- 26. 在现有emacs框架中打开文件(Windows)
- 27. 在Emacs缓冲区中渲染Markdown
- 28. 如何用包含输入的缓冲区打开emacs?
- 29. 使emacs在新缓冲区(非帧)中打开一个文件的别名并被激活/到达前面?
- 30. 打开窗口并加载emacs lisp中的特定缓冲区