在Emacs的org-mode中,如何使org-capture在全屏窗口中打开,而不是首先分割窗口?
(add-hook 'org-capture-mode-hook 'delete-other-windows)
或者 (add-hook 'org-capture-mode-hook 'make-frame)
添加到你的 .emacs
文件中。(测试时,你可以使用 M-:
来评估这些内容)。第一个命令会删除其他窗口,第二个命令会在新框架中打开窗口。但是这些操作都是在你选择捕获模板之后才生效。对我来说,已接受的答案在emacs 24中似乎无法正常工作。我找到的唯一解决方案涉及使用emacs-noflet和(感谢Alex Vorobiev)在您的emacs文件中:
(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
到一个快捷键。
maximize-frame
框架。)它对你无效吗? - incandescentmanmaximize-frame
框架。)它对你无效吗? - incandescentmanorg-capture
上面的草稿缓冲区。这是我在24.3.1版本中使它工作的唯一方法。 - cazgp对我来说,我需要确保 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)))
(defun stag-misanthropic-capture (&rest r)
(delete-other-windows))
(advice-add #'org-capture-place-template :after 'stag-misanthropic-capture)
emacsclient -e '(org-capture nil "t")' --create-frame
(add-hook 'org-capture-mode-hook 'sticky-window-delete-other-windows)
,现在它完美地运行了。谢谢! - incandescentman