I am new to org mode, so it might be a very simple matter, but I couldn't find/figure out it myself.
Say, I have created a few horizontal and vertical windows. Opened an org file which has some source code blocks. Then I wanted to edit one of the blocks by going into Org-Src
mode using C-c '
and exiting from it using C-c '
. First time I enter C-c '
, all other windows in my frame closes, only the org file window stays and a new window which holds the source blocks opens. This is fine although I would prefer it to utilize some opened window. The 2nd time I use C-c '
to exit from Org-Src
mode, the org src window closes, the org file window goes maximized/takes up the full frame. This is what I don't want. When I used C-c '
the 2nd time, I wanted to exit from Org-Src
mode and restore my previously opened windows. I looked at manual page of Org-Src
mode but the only thing I found useful was the hook function, but I don't know how I can utilize that to restore the windows after exiting from org src edit mode.
Emacs version - 27.1
Org Mode version - 9.3 (release that comes with emacs itself)
OS - Windows 10 and Linux
Question: How to restore previous window layout after quitting org-edit-src-code
(C-c '
) ?
emacs-version
andorg-version
? I can't reproduce it withemacs-version = 28.0.50
(2020-10-06
) andorg-version = 9.4
. – Firmin Martin Nov 11 '20 at 5:15org-src-window-setup
. And if you check the documentation (C-h v
), it says thatValues that modify the window layout (reorganize-frame, split-window-below, split-window-right) will restore the layout after exiting the edit buffer.
So maybe there is some oddity occurred in your side. Try withemacs -Q
and loadorg-mode
to see if this issue still remains. – Firmin Martin Nov 11 '20 at 21:27(setq org-src-window-setup 'current-window)
seems most reasonable to me. Thanks everyone, consider this as solved from my side. – shimon Nov 11 '20 at 23:00