emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Daniel Kraus <daniel@kraus.my>
To: emacs-orgmode@gnu.org
Subject: [PATCH] org-src.el: Fix org-edit-src-exit with split-window-below
Date: Tue, 22 Jan 2019 17:03:04 +0000	[thread overview]
Message-ID: <877eewfwvr.fsf@kraus.my> (raw)

[-- Attachment #1: Type: text/plain, Size: 193 bytes --]

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`.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] org-src.el: Fix org-edit-src-exit with split-window-below --]
[-- Type: text/x-patch, Size: 966 bytes --]

From 7b3df7891d7c8ecdb489edda0e908a306090ebfc Mon Sep 17 00:00:00 2001
From: Daniel Kraus <daniel@kraus.my>
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	other threads:[~2019-01-22 19:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22 17:03 Daniel Kraus [this message]
2019-01-23 14:32 ` [PATCH] org-src.el: Fix org-edit-src-exit with split-window-below Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877eewfwvr.fsf@kraus.my \
    --to=daniel@kraus.my \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).