代码之家  ›  专栏  ›  技术社区  ›  incandescentman

在Emacs组织模式下,如何在全尺寸窗口中打开组织捕获?

  •  10
  • incandescentman  · 技术社区  · 13 年前

    在Emacs组织模式下,如何在全尺寸窗口中打开组织捕获,而不是首先拆分窗口?

    3 回复  |  直到 13 年前
        1
  •  10
  •   Emre Sahin    13 年前

    您可以添加 (add-hook 'org-capture-mode-hook 'delete-other-windows) 或 (add-hook 'org-capture-mode-hook 'make-frame) 给你 .emacs 。(要进行测试,您可以使用 M-: ). 第一个应该删除其他窗口,第二个应该在新的框架中打开窗口。然而,这些工作 之后 您可以选择捕获模板。

        2
  •  2
  •   cazgp    12 年前

    在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 到快捷方式。

        3
  •  0
  •   Mark    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)))