Browse Source

org-src: Do not restore window config when exiting an edit buffer

org-src.el (org-src--saved-temp-window-config): Remove variable.
* lisp/org-src.el (org-src--edit-element): Apply removal.
Matt Price 6 years ago
parent
commit
819e98afd0
2 changed files with 7 additions and 10 deletions
  1. 6 2
      etc/ORG-NEWS
  2. 1 8
      lisp/org-src.el

+ 6 - 2
etc/ORG-NEWS

@@ -12,8 +12,12 @@ Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
 
 * Version 9.3
 
-** Incompatible change
-
+** Incompatible changes
+*** Change in behavior on exit from an Org edit 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.
 *** Change default value for ~org-email-link-description-format~
 
 When linking from a mail buffer, Org used to truncate the subject of

+ 1 - 8
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,7 +472,6 @@ 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))
 	 (beg (copy-marker (nth 0 area)))
 	 (end (copy-marker (nth 1 area) t))
@@ -1172,10 +1168,7 @@ 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)
-    (when org-src--saved-temp-window-config
-      (set-window-configuration org-src--saved-temp-window-config)
-      (setq org-src--saved-temp-window-config nil))))
+    (set-marker end nil)))
 
 
 (provide 'org-src)