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: Re: patch: adding split-window-right option for src block editing
Date: Wed, 24 Jul 2019 11:22:53 +0000	[thread overview]
Message-ID: <87r26f65ir.fsf@ucl.ac.uk> (raw)
In-Reply-To: <875zo3obtv.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Mon, 15 Jul 2019 12:02:04 +0200")

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

On Monday, 15 Jul 2019 at 12:02, Nicolas Goaziou wrote:
> Hello,
>
> "Fraga, Eric" <e.fraga@ucl.ac.uk> writes:
>
>> 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.
>
> Thank you. Could you provide an entry in ORG-NEWS, too?

Please find attached two patch files, both the one I have already sent
and now one with a change to the NEWS file.

Thanks and sorry for the delay.

eric

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.4-399-g4e6222

[-- 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: 1972 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 1/2] 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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-Add-NEWS-item-for-split-window-right-option-for-edit.patch --]
[-- Type: text/x-diff; name="0002-Add-NEWS-item-for-split-window-right-option-for-edit.patch", Size: 1153 bytes --]

From fabd6d84b0f6fd3ac2331a5e7b3b2dc2b54b6e51 Mon Sep 17 00:00:00 2001
From: Eric S Fraga <e.fraga@ucl.ac.uk>
Date: Wed, 24 Jul 2019 12:18:35 +0100
Subject: [PATCH 2/2] Add NEWS item for split-window-right option for editing
 src blocks

* ORG-NEWS: added news item for new split-window-right option
---
 etc/ORG-NEWS | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index bbd9dc975..f0163a77b 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -123,6 +123,11 @@ auto-commit attachments to git:
   one need to require the =org-attach-git= module in the startup.
 
 ** New features
+*** Add split-window-right option for src block edit window placement
+Given the increasing popularity of wide screen monitors, splitting
+horizontally may make more sense than splitting vertically.  An
+option, ~split-window-right~, to request horizontal splitting has been
+added to ~org-src-window-setup~.
 *** Org-Attach has been refactored and extended
 Org attach has been refactored and the functionality extended.  It
 should now be easier to understand how it works.  A few improvements
-- 
2.20.1


  parent reply	other threads:[~2019-07-24 11:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=87r26f65ir.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).