From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: Re: [PATCH] restore window configuration after org-edit-src-exit Date: Thu, 9 Jan 2020 10:03:18 -0500 Message-ID: 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> <8736crslbi.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000e6c85e059bb64fe1" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:37297) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipZLS-0004mQ-11 for emacs-orgmode@gnu.org; Thu, 09 Jan 2020 10:03:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipZLP-0002DP-O6 for emacs-orgmode@gnu.org; Thu, 09 Jan 2020 10:03:33 -0500 Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]:46939) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipZLP-00028f-HC for emacs-orgmode@gnu.org; Thu, 09 Jan 2020 10:03:31 -0500 Received: by mail-oi1-x242.google.com with SMTP id 13so4206045oij.13 for ; Thu, 09 Jan 2020 07:03:31 -0800 (PST) In-Reply-To: <8736crslbi.fsf@nicolasgoaziou.fr> 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-mx.org@gnu.org Sender: "Emacs-orgmode" To: Jack Kamm , Org Mode , Richard Kim --000000000000e6c85e059bb64fe1 Content-Type: text/plain; charset="UTF-8" Hi, sorry I missed this thread in the peri-holiday rush, just want to say thank you all for ironing out the difficulties arsing from that change earlier. On Tue, Jan 7, 2020 at 4:06 AM Nicolas Goaziou wrote: > 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 > > --000000000000e6c85e059bb64fe1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi, sorry I missed this thread in the peri-holiday rush, j= ust want to say thank you all for ironing out the difficulties arsing from = that change earlier.

On Tue, Jan 7, 2020 at 4:06 AM Nicolas Goaziou <= ;mail@nicolasgoaziou.fr> w= rote:
Hello,

Jack Kamm <jackk= amm@gmail.com> 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-fram= e,
> 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 o= f the current window,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0keeping all other windows.
>=C2=A0 other-window=C2=A0 =C2=A0 =C2=A0 =C2=A0Use `switch-to-buffer-oth= er-window' to display edit buffer.
>=C2=A0 reorganize-frame=C2=A0 =C2=A0Show only two windows on the curren= t frame, the current
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= window and the edit buffer.=C2=A0 When exiting the edit buffer,
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= return to one window.
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= window and the edit buffer.
>=C2=A0 other-frame=C2=A0 =C2=A0 =C2=A0 =C2=A0 Use `switch-to-buffer-oth= er-frame' to display edit buffer.
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0Also, when exiting the edit buffer, kill that
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0frame."

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

> +=C2=A0 =C2=A0 (when org-src--saved-temp-window-config
> +=C2=A0 =C2=A0 =C2=A0 (set-window-configuration org-src--saved-temp-wi= ndow-config)
> +=C2=A0 =C2=A0 =C2=A0 (setq org-src--saved-temp-window-config nil))))<= br>
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

--000000000000e6c85e059bb64fe1--