From 0db0adc4f20d8c664976b89cbe033f5579e1fdc5 Mon Sep 17 00:00:00 2001 From: Jack Kamm Date: Tue, 21 Jan 2020 20:39:14 -0800 Subject: [PATCH] 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 --- lisp/org-src.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/org-src.el b/lisp/org-src.el index 52e99cf04..bb1c57c65 100644 --- a/lisp/org-src.el +++ b/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) -- 2.25.0