summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Kamm <jackkamm@gmail.com>2020-01-21 20:39:14 -0800
committerKyle Meyer <kyle@kyleam.com>2020-01-24 23:12:22 -0500
commitcd1014a75a1ad63fdc44d6cd2722d529f1f5b7f7 (patch)
treeeba3137dacb2f8c6c5f3701eff795c889cecc78c
parent7d5e931f79ef4445fe5e67c840e56fd224d262ad (diff)
downloadorg-mode-cd1014a75a1ad63fdc44d6cd2722d529f1f5b7f7.tar.gz
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.
-rw-r--r--lisp/org-src.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/org-src.el b/lisp/org-src.el
index 52e99cf..bb1c57c 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)