From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] restore window configuration after org-edit-src-exit Date: Tue, 07 Jan 2020 09:49:21 +0100 Message-ID: <8736crslbi.fsf@nicolasgoaziou.fr> References: <87lfrc9qs6.fsf@nicolasgoaziou.fr> <87woavd8j4.fsf@kyleam.com> <87sgljf3e1.fsf@gmail.com> <87mubrf2mm.fsf@gmail.com> <87lfr45shp.fsf@nicolasgoaziou.fr> <87a77jddbb.fsf@gmail.com> <874kxr5ubv.fsf@nicolasgoaziou.fr> <8736dbc6a2.fsf@gmail.com> <87blrz3qn1.fsf@nicolasgoaziou.fr> <87woamc3d2.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:36569) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iokYJ-0006fK-Ln for emacs-orgmode@gnu.org; Tue, 07 Jan 2020 03:49:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iokYI-0001vO-Ar for emacs-orgmode@gnu.org; Tue, 07 Jan 2020 03:49:27 -0500 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:54777) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iokYI-0001tx-4s for emacs-orgmode@gnu.org; Tue, 07 Jan 2020 03:49:26 -0500 In-Reply-To: <87woamc3d2.fsf@gmail.com> (Jack Kamm's message of "Mon, 23 Dec 2019 10:18:33 -0800") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Jack Kamm Cc: emacs-orgmode@gnu.org, Richard Kim Hello, Jack Kamm 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