emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Fraga, Eric" <e.fraga@ucl.ac.uk>
To: Emacs Org mode mailing list <emacs-orgmode@gnu.org>
Subject: patch: adding split-window-right option for src block editing
Date: Thu, 11 Jul 2019 09:27:56 +0000	[thread overview]
Message-ID: <87wogosyxw.fsf@ucl.ac.uk> (raw)

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

Hello all,

most of my work now involves using quite large wide monitors and having
the editing of src blocks open windows below is less convenient than
splitting horizontally.  I have added the option to split
horizontally.  See attached patch.

However, ideally, I would like the option to specify a function as
context matters: sometimes a vertical split is better, sometimes
not.  But implementing this was beyond my emacs-fu.

Thanks,
eric

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.4-379-g1b74ae

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-split-window-right-option-for-editing-src-blocks.patch --]
[-- Type: text/x-diff; name="0001-Add-split-window-right-option-for-editing-src-blocks.patch", Size: 1968 bytes --]

From 550a7b3f95232295240852156d5e455b803992a9 Mon Sep 17 00:00:00 2001
From: Eric S Fraga <e.fraga@ucl.ac.uk>
Date: Thu, 11 Jul 2019 10:24:15 +0100
Subject: [PATCH] Add split-window-right option for editing src blocks

* org-src.el (org-src-window-setup, org-src-switch-to-buffer): added
  new split-window-right option which splits horizontally.

This has been motivated by the increasing use of wide monitors.
---
 lisp/org-src.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lisp/org-src.el b/lisp/org-src.el
index a83942fc5..3b0923c20 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -152,6 +152,8 @@ current-window     Show edit buffer in the current window, keeping all other
                    windows.
 split-window-below Show edit buffer below the current window, keeping all
                    other windows.
+split-window-right Show edit buffer to the right of the current window, 
+                   keeping all other windows.
 other-window       Use `switch-to-buffer-other-window' to display edit buffer.
 reorganize-frame   Show only two windows on the current frame, the current
                    window and the edit buffer.  When exiting the edit buffer,
@@ -162,6 +164,7 @@ other-frame        Use `switch-to-buffer-other-frame' to display edit buffer.
   :type '(choice
 	  (const current-window)
 	  (const split-window-below)
+	  (const split-window-right)
 	  (const other-frame)
 	  (const other-window)
 	  (const reorganize-frame)))
@@ -793,6 +796,11 @@ Raise an error when current buffer is not a source editing buffer."
 	 (delete-window)
        (select-window (split-window-vertically)))
      (pop-to-buffer-same-window buffer))
+    (`split-window-right
+     (if (eq context 'exit)
+	 (delete-window)
+       (select-window (split-window-horizontally)))
+     (pop-to-buffer-same-window buffer))
     (`other-frame
      (pcase context
        (`exit
-- 
2.20.1


             reply	other threads:[~2019-07-11  9:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-11  9:27 Fraga, Eric [this message]
2019-07-15 10:02 ` patch: adding split-window-right option for src block editing Nicolas Goaziou
2019-07-16  7:00   ` Fraga, Eric
2019-07-24 11:22   ` Fraga, Eric
2019-08-17 13:27     ` 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=87wogosyxw.fsf@ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --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).