Imagine I have a frame containing some number of windows—sometimes only one, sometimes split in various ways.
Now imagine that one of the displayed windows contains an org-mode
buffer. What I want is:
- When I invoke
org-edit-src-code
, I want to- save the current configuration of the window,
- delete all the other windows on that frame, and
- display only the source-editing window in that frame.
- When I invoke
org-edit-src-exit
to return to theorg-mode
buffer, I want to restore that frame's original window configuration. (Obviously, if some of the other buffers have been killed in the interim, those windows will have to display something else.)
The display-buffer
and window-quit
don't seem to offer such a capability, but maybe I'm missing it.
I'm imagining implementing it using a custom "display action function" that would stash the window configuration (from current-window-configuration
) in a window parameter and with a custom quit-window-hook
that would check for that window parameter.
- Does something like this already exist?
- Does this seem like a stupid thing to even want?
- Does such a sketch of a plan seem like a reasonable approach?
org-edit-src-exit
already tries to restore a window configuration. Maybe you should look into why that's not already the config you want, and see if you can arrange that it is.