[英]In Emacs org-mode, how do I get org-capture to open in a full-sized window?
在 Emacs 组织模式中,如何让 org-capture 在全尺寸窗口中打开,而不是先拆分窗口?
您可以将(add-hook 'org-capture-mode-hook 'delete-other-windows)
或(add-hook 'org-capture-mode-hook 'make-frame)
到您的.emacs
。 (要测试,您可以使用M-:
评估它们)。 第一个应该删除其他窗口,第二个在新框架中打开窗口。 但是,这些在您选择捕获模板后起作用。
接受的答案在 emacs 24 中似乎对我不起作用。我能找到的唯一解决方案是在您的 emacs 文件中使用emacs-noflet和(感谢Alex Vorobiev ):
(defun make-capture-frame ()
"Create a new frame and run org-capture."
(interactive)
(make-frame '((name . "capture")))
(select-frame-by-name "capture")
(delete-other-windows)
(noflet ((switch-to-buffer-other-window (buf) (switch-to-buffer buf)))
(org-capture)))
并将make-capture-frame
绑定到快捷方式。
对我来说,我需要确保 org-capture 在新框架中打开,并且框架在完成时关闭。 以下方法对此很有效:
; close capture frames when finished capturing
(add-hook 'org-capture-after-finalize-hook (lambda () (delete-frame)))
; make org-capture open up as sole window in a new frame
(defadvice org-capture (around my-org-capture activate)
(progn
(select-frame (make-frame))
(delete-other-windows)
(noflet
((switch-to-buffer-other-window (buf) (switch-to-buffer buf)))
ad-do-it)))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.