emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* patch: adding split-window-right option for src block editing
@ 2019-07-11  9:27 Fraga, Eric
  2019-07-15 10:02 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Fraga, Eric @ 2019-07-11  9:27 UTC (permalink / raw)
  To: Emacs Org mode mailing list

[-- 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-08-17 13:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-11  9:27 patch: adding split-window-right option for src block editing Fraga, Eric
2019-07-15 10:02 ` Nicolas Goaziou
2019-07-16  7:00   ` Fraga, Eric
2019-07-24 11:22   ` Fraga, Eric
2019-08-17 13:27     ` Nicolas Goaziou

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