在Emacs组织模式下,如何在全尺寸窗口中打开org-capture?

时间:2013-03-06 16:38:40

标签: emacs org-mode

在Emacs组织模式下,如何在一个完整大小的窗口中打开org-capture,而不是先拆分窗口?

3 个答案:

答案 0 :(得分:6)

您可以将(add-hook 'org-capture-mode-hook 'delete-other-windows)(add-hook 'org-capture-mode-hook 'make-frame)添加到.emacs。 (要进行测试,您可以使用M-:来评估这些内容。第一个应删除其他窗口,第二个在新框架中打开窗口。但是,这些工作之后选择了捕获模板。

答案 1 :(得分:2)

接受的答案在emacs 24中似乎对我没有用。我能找到的唯一解决方案是在您的emacs文件中使用emacs-noflet和(感谢Alex Vorobiev):< / p>

 (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绑定到快捷方式。

答案 2 :(得分:0)

对我来说,我需要确保 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)))
相关问题