emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH] org-src.el: Fix org-edit-src-exit with split-window-below


From: Daniel Kraus
Subject: [O] [PATCH] org-src.el: Fix org-edit-src-exit with split-window-below
Date: Tue, 22 Jan 2019 17:03:04 +0000

This fixes a bug that got introduced in 819e98afd where you end up with
3 split windows if you exit an org source buffer with your
`org-src-window-setup` function set to `split-window-below`.

>From 7b3df7891d7c8ecdb489edda0e908a306090ebfc Mon Sep 17 00:00:00 2001
From: Daniel Kraus <address@hidden>
Date: Tue, 22 Jan 2019 16:46:34 +0000
Subject: [PATCH] org-src.el: Fix org-edit-src-exit with split-window-below

* lisp/org-src.el: (org-src-switch-to-buffer): Delete window when
exiting source buffer instead of splitting it again.
---
 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 c27a99114..d261a2369 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -789,7 +789,9 @@ Raise an error when current buffer is not a source editing 
buffer."
     (`other-window
      (switch-to-buffer-other-window buffer))
     (`split-window-below
-     (select-window (split-window-vertically))
+     (if (eq context 'exit)
+        (delete-window)
+       (select-window (split-window-vertically)))
      (pop-to-buffer-same-window buffer))
     (`other-frame
      (pcase context
-- 
2.20.1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]