在Emacs组织模式中,如何在全尺寸窗口中打开组织捕获,而不是首先拆分窗口?
您可以将(add-hook 'org-capture-mode-hook 'delete-other-windows)
或(add-hook 'org-capture-mode-hook 'make-frame)
添加到.emacs
中。(要进行测试,您可以使用M-:
对其进行评估(。第一个应该删除其他窗口,第二个应该在新的框架中打开窗口。然而,在您选择捕获模板后,这些工作就可以了。
在emacs24中,接受的答案似乎对我不起作用。我能找到的唯一解决方案是在你的emacs文件中使用emacs nolet和(感谢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)))
并将CCD_ 5绑定到快捷方式。
对我来说,我需要确保组织捕获在一个新的框架中打开,并且框架在完成时关闭。以下方法对此效果良好:
; 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)))
在doom emacs 28.2(2023年6月(上,似乎没有一个答案对我有效,所以org-gtd.el和sqlup.el的作者昨天在reddit上友好地解决了这个问题。下面是他的摘录:
*如果你使用的是末日emacs,请确保将其添加到(after! org ...) block
中。
(defun stag-misanthropic-capture (&rest r)
(delete-other-windows))
(advice-add #'org-capture-place-template :after 'stag-misanthropic-capture)
以及如何从命令行调用它(对于"todo template"(:
emacsclient -e '(org-capture nil "t")' --create-frame