当我使用多个帧时,我想确定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允许在不同的框架中打开一个缓冲区?
- 2. 我在一个框架中有两个emacs缓冲区:A.cc | B.cc
- 3. 如何打开一个始终在emacs中显示其父框架的活动缓冲区的新框架?
- 4. 在Emacs的缓冲区打开一个文件,而在Emacs终端
- 5. Emacs Lisp:打开一个新框架,启动IPython,运行以前的缓冲区
- 6. Emacs协作缓冲区以错误模式打开
- 7. 如何在右侧窗口中打开emacs-nav缓冲区?
- 8. 如何使用Emacs中的一个命令打开当前正在打开文件的缓冲区的目录?
- 9. 当一个命令尝试以shell模式打开一个编辑器时打开一个Emacs缓冲区
- 10. 打开文件时打开没有暂存缓冲区的emacs
- 11. Vim Ack在当前缓冲区中打开第一个文件
- 12. 在Emacs缓冲区中居中文本
- 13. Emacs搜索并打开多个文件并在所有缓冲区中搜索
- 14. Emacs:打印一个UTF-8缓冲区
- 15. 在pyqt中打开另一个框架
- 16. Emacs在不同的框架中切换到缓冲区
- 17. 告诉Emacs在特定窗口中打开新的缓冲区
- 18. Emacs ido在循环列表中首先打开缓冲区
- 19. 如何计算Emacs中打开的缓冲区/文件的数量?
- 20. 如何在另一个框架中打开一个页面
- 21. 在Emacs中打开文件后自动进入缓冲区结束?
- 22. 如何停止emacs dired模式打开如此多的缓冲区?
- 23. 命令T在以前打开的缓冲区中打开文件
- 24. Cocoa Emacs打印缓冲区
- 25. 如何强制组织模式在另一个框架中打开链接?
- 26. 禁止emacs在新框架中打开组织模式菜单
- 27. 如何使链接emacs按钮在另一个缓冲区中点击鼠标?
- 28. Emacs:如何在另一个窗口中继续缓冲区内容?
- 29. 在emacs中我怎么能杀死多个缓冲区而不打开每个缓冲区
- 30. 如何在Emacs中将Dired-mode缓冲区粘贴到单独的框架?