From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Kraus Subject: [PATCH] org-src.el: Fix org-edit-src-exit with split-window-below Date: Tue, 22 Jan 2019 17:03:04 +0000 Message-ID: <877eewfwvr.fsf@kraus.my> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:45388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gm1nK-0007pp-H3 for emacs-orgmode@gnu.org; Tue, 22 Jan 2019 14:33:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gm1js-0002HA-7C for emacs-orgmode@gnu.org; Tue, 22 Jan 2019 14:29:39 -0500 Received: from mx2a.mailbox.org ([2001:67c:2050:104:0:2:25:2]:25498 helo=mx2.mailbox.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gm1jn-0001wm-7g for emacs-orgmode@gnu.org; Tue, 22 Jan 2019 14:29:33 -0500 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id B62F5A138E for ; Tue, 22 Jan 2019 18:03:14 +0100 (CET) Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id ktIaOpCzqCBF for ; Tue, 22 Jan 2019 18:03:13 +0100 (CET) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain 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`. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-src.el-Fix-org-edit-src-exit-with-split-window-b.patch Content-Description: [PATCH] org-src.el: Fix org-edit-src-exit with split-window-below >From 7b3df7891d7c8ecdb489edda0e908a306090ebfc Mon Sep 17 00:00:00 2001 From: Daniel Kraus 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 --=-=-=--