emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] restore window configuration after org-edit-src-exit


From: Nicolas Goaziou
Subject: Re: [PATCH] restore window configuration after org-edit-src-exit
Date: Tue, 07 Jan 2020 09:49:21 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Hello,

Jack Kamm <address@hidden> writes:

> Attached is a patch to restore the window configuration after exiting an
> org source buffer, when org-src-window-setup is one of reorganize-frame,
> split-window-below, or split-window-right.

Thank you for the patch! Some comments follow.

> @@ -156,8 +156,7 @@ split-window-right Show edit buffer to the right of the 
> current window,
>                     keeping all other windows.
>  other-window       Use `switch-to-buffer-other-window' to display edit 
> buffer.
>  reorganize-frame   Show only two windows on the current frame, the current
> -                   window and the edit buffer.  When exiting the edit buffer,
> -                   return to one window.
> +                   window and the edit buffer.
>  other-frame        Use `switch-to-buffer-other-frame' to display edit buffer.
>                     Also, when exiting the edit buffer, kill that
>                     frame."

It would be useful to also explain what happens when the value is
`reorganize-frame', `split-window-right', or `split-window-right', e.g.,
that previous window configuration is restored.

> +    (when org-src--saved-temp-window-config
> +      (set-window-configuration org-src--saved-temp-window-config)
> +      (setq org-src--saved-temp-window-config nil))))

It may be useful to wrap `set-window-configuration' within
`unwind-protect' so we can still reset the
`org-src--saved-temp-window-config' variable even though something went
wrong.

WDYT?

Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]