Browse Source

org-src: Add call to quit-restore-window in org-src-switch-to-buffer

* lisp/org-src.el (org-src-switch-to-buffer): Add call to
quit-restore-window in org-src-switch-to-buffer when
org-src-window-setup is other-window so that the popped up window is
closed on exit.
Jack Kamm 5 years ago
parent
commit
cd1014a75a
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lisp/org-src.el

+ 3 - 1
lisp/org-src.el

@@ -809,7 +809,9 @@ Raise an error when current buffer is not a source editing buffer."
      (pop-to-buffer buffer))
     (`current-window (pop-to-buffer-same-window buffer))
     (`other-window
-     (switch-to-buffer-other-window buffer))
+     (let ((cur-win (selected-window)))
+       (switch-to-buffer-other-window buffer)
+       (when (eq context 'exit) (quit-restore-window cur-win))))
     (`split-window-below
      (if (eq context 'exit)
 	 (delete-window)