As per our earlier thread, here is a patch to remove
org-src--saved-temp-window-config from org-src.el.
From ad2d8d26eee6c2bcfa517e0f7352406c9980bfd4 Mon Sep 17 00:00:00 2001
From: Matt Price <matt.pr...@utoronto.ca>
Date: Tue, 27 Nov 2018 08:19:03 -0500
Subject: [PATCH] Org-sr.el: On exiting src buffer, do not restore prior config

org-src.el (org-src--saved-temp-window-config): remove all references
to org-src--saved-temp-window-config.  Org will no longer attempt to
restore the previous window configuration on exit from a src buffer.
---
 etc/ORG-NEWS    |  5 ++++-
 lisp/org-src.el | 10 ++--------
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 811e98147..6ec90bfc2 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -9,7 +9,10 @@ Copyright (C) 2012-2018 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
-
+* Version 9.3
+** Incompatible changes
+*** Change in behavior on exit from an Org Src buffer
+Org will no longer attempt to restore the window configuration in the frame to which the user returns after editing a source block with ~org-edit-src-code~. Instead, the window configuration will remain as it is. 
 * Version 9.2
 ** Incompatible changes
 *** Removal of OrgStruct mode mode and radio lists
diff --git a/lisp/org-src.el b/lisp/org-src.el
index 12163156f..f024b31a9 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -270,9 +270,6 @@ issued in the language major mode buffer."
 (defvar-local org-src--remote nil)
 (put 'org-src--remote 'permanent-local t)
 
-(defvar-local org-src--saved-temp-window-config nil)
-(put 'org-src--saved-temp-window-config 'permanent-local t)
-
 (defvar-local org-src--source-type nil
   "Type of element being edited, as a symbol.")
 (put 'org-src--source-type 'permanent-local t)
@@ -475,8 +472,7 @@ When REMOTE is non-nil, do not try to preserve point or mark when
 moving from the edit area to the source.
 
 Leave point in edit buffer."
-  (setq org-src--saved-temp-window-config (current-window-configuration))
-  (let* ((area (org-src--contents-area datum))
+    (let* ((area (org-src--contents-area datum))
 	 (beg (copy-marker (nth 0 area)))
 	 (end (copy-marker (nth 1 area) t))
 	 (old-edit-buffer (org-src--edit-buffer beg end))
@@ -1173,9 +1169,7 @@ Throw an error if there is no such buffer."
     ;; Clean up left-over markers and restore window configuration.
     (set-marker beg nil)
     (set-marker end nil)
-    (when org-src--saved-temp-window-config
-      (set-window-configuration org-src--saved-temp-window-config)
-      (setq org-src--saved-temp-window-config nil))))
+    ))
 
 
 (provide 'org-src)
-- 
2.19.1

Reply via email to