Browse Source

Add split-window-right option for editing source 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.
Eric S Fraga 5 years ago
parent
commit
cfe4598aa1
1 changed files with 8 additions and 0 deletions
  1. 8 0
      lisp/org-src.el

+ 8 - 0
lisp/org-src.el

@@ -152,6 +152,8 @@ current-window     Show edit buffer in the current window, keeping all other
                    windows.
                    windows.
 split-window-below Show edit buffer below the current window, keeping all
 split-window-below Show edit buffer below the current window, keeping all
                    other windows.
                    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.
 other-window       Use `switch-to-buffer-other-window' to display edit buffer.
 reorganize-frame   Show only two windows on the current frame, the current
 reorganize-frame   Show only two windows on the current frame, the current
                    window and the edit buffer.  When exiting the edit buffer,
                    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
   :type '(choice
 	  (const current-window)
 	  (const current-window)
 	  (const split-window-below)
 	  (const split-window-below)
+	  (const split-window-right)
 	  (const other-frame)
 	  (const other-frame)
 	  (const other-window)
 	  (const other-window)
 	  (const reorganize-frame)))
 	  (const reorganize-frame)))
@@ -793,6 +796,11 @@ Raise an error when current buffer is not a source editing buffer."
 	 (delete-window)
 	 (delete-window)
        (select-window (split-window-vertically)))
        (select-window (split-window-vertically)))
      (pop-to-buffer-same-window buffer))
      (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
     (`other-frame
      (pcase context
      (pcase context
        (`exit
        (`exit