In Emacs org-mode, how do I get org-capture to open in a full-sized window, rather than first splitting the window ?
4 Answers
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.
-
2I modified your code to
(add-hook 'org-capture-mode-hook 'sticky-window-delete-other-windows)
and it works perfectly. Thanks! Mar 6, 2013 at 17:44
The accepted answer doesn't seem to work for me in emacs 24. The only solution I was able to find involves using emacs-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.
-
It works for me and I'm on Emacs 24.3.1. I am referring to a full window, rather than a split window. (Not a
maximize-frame
frame.) It doesn't work for you? Jul 9, 2014 at 1:46 -
It works for me and I'm on Emacs 24.3.1. I am referring to a full Emacs window, rather than splitting the frame into two windows. (I am not referring to a full-screen
maximize-frame
frame.) It doesn't work for you? Jul 9, 2014 at 1:47 -
Interesting. It was opening in a split window, with the scratch buffer above
org-capture
. That's the only way I could get it to work in 24.3.1.– cazgpJul 9, 2014 at 2:16
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)))
-
1doesn't work for me in spacemacs "switch-to-buffer-other-window" gives me "invalid function".– RotkivApr 19, 2021 at 1:55
None of the answers seemed to work for me on doom emacs 28.2 (June 2023), so author of org-gtd.el and sqlup.el kindly solved it on reddit yesterday. Copied below is his snippet:
*If you are on doom emacs make sure to add it to the (after! org ...) block
.
(defun stag-misanthropic-capture (&rest r)
(delete-other-windows))
(advice-add #'org-capture-place-template :after 'stag-misanthropic-capture)
and how it can be invoked from command line (for "todo template"):
emacsclient -e '(org-capture nil "t")' --create-frame