From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Kim Subject: restore window configuration after org-edit-src-exit Date: Sat, 14 Dec 2019 11:06:44 -0800 Message-ID: Reply-To: Richard.Kim1@synopsys.com Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:45654) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igF3A-0001Og-Uk for emacs-orgmode@gnu.org; Sat, 14 Dec 2019 16:34:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igF37-0002DD-TH for emacs-orgmode@gnu.org; Sat, 14 Dec 2019 16:34:07 -0500 Received: from smtprelay-out1.synopsys.com ([149.117.73.133]:44538) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1igF37-00026W-9F for emacs-orgmode@gnu.org; Sat, 14 Dec 2019 16:34:05 -0500 Received: from mailhost.synopsys.com (sv2-mailhost2.synopsys.com [10.205.2.134]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id B342242394 for ; Sat, 14 Dec 2019 19:06:45 +0000 (UTC) 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: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain About a year ago change 819e98afd018cad3c13fd58bfcbd979ab36dfbc7 was checked in to remove code that restored window configuration when =org-edit-src-exit= finished. The net result is af if =C-x 1= is called to remove all windows except the org buffer just edited. This is very inconvenient. Why not call =winner-undo= to restore window configuration as shown here? #+begin_src diff >From bd0a2abaa8097338d7f33c7ca9a1d45f5da67e7a Mon Sep 17 00:00:00 2001 From: kimr Date: Sat, 14 Dec 2019 10:59:00 -0800 Subject: [PATCH] restore window config by calling winner-undo --- lisp/org-src.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org-src.el b/lisp/org-src.el index 5e50a1b4..c8c30889 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -1182,7 +1182,8 @@ Throw an error if there is no such buffer." (write-back (org-src--goto-coordinates coordinates beg end)))) ;; Clean up left-over markers and restore window configuration. (set-marker beg nil) - (set-marker end nil))) + (set-marker end nil) + (winner-undo))) (provide 'org-src) -- 2.22.1 #+end_src For now I'm using the following advice do the same thing. #+begin_src elisp (defadvice org-edit-src-exit (after restore-window-config activate) (winner-undo)) #+end_src --=-=-= Content-Type: text/html Content-Transfer-Encoding: quoted-printable

About a year ago change 819e98afd018cad3c13fd58bfcbd979ab36dfbc7 was checke= d in to remove code that restored window configuration when org-edit-src-e= xit finished. The net result is af if C-x 1 is called to remove al= l windows except the org buffer just edited. This is very inconvenient.

Why not call winner-undo to restore window configuration as sh= own here?

From bd0a2ab=
aa8097338d7f33c7ca9a1d45f5da67e7a Mon Sep 17 00:00:00 2001
From: kimr <kimr@synopsys.com>
Date: Sat, 14 Dec 2019 10:59=
:00 -0800
Subject: [PATCH] restore window config by calling winner-undo

---
 lis=
p/org-src.el | 3 ++-
 1  changed, 2 insertions(+), 1 deletion(-)

diff=
 --git a/lisp/org-src.el b/lis=
p/org-src.el
index 5e50a1b4..c8c30889 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -1182,7 +1182,8 @@ Throw an error if there is nosuch buffer."
        (write-back (org-src--goto-coordinates coordinates beg en=
d))))
     ;; Clean up left-over markers and restore window c=
onfiguration.
     (set-marker beg nil)
-   =
 (set-marker end nil)))
+   =
 (set-marker end nil)
+   =
 (winner-undo)))
 
 
 (pr=
ovide 'org-src)
-- 
2.22.1

For now I'm using the following advice do the same thing.

(defadvice org-edit-src-exit (after restore-window-config activate)
  (winner-undo))
--=-=-=--