简体   繁体   中英

In Emacs org-mode, how do I get org-capture to open in a full-sized window?

在 Emacs 组织模式中,如何让 org-capture 在全尺寸窗口中打开,而不是先拆分窗口?

You can add (add-hook 'org-capture-mode-hook 'delete-other-windows) or (add-hook 'org-capture-mode-hook 'make-frame) to your .emacs . (To test, you can eval these with M-: ). The first should delete the other windows, the second opens the window in a new frame. However these work after you select the capture template.

The accepted answer doesn't seem to work for me in emacs 24. The only solution I was able to find involves usingemacs-noflet and (thanks Alex Vorobiev ) in your emacs file:

 (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)))

and bind make-capture-frame to a shortcut.

For me, I needed to ensure that org-capture opened in a new frame, and that the frame was closed when finished. The following worked well for this:

    ; 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)))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM