summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstardiviner <numbchild@gmail.com>2018-03-13 01:23:52 +0800
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2018-03-17 08:11:24 +0100
commit00938bc98bb3ce7d14bdc400ad9f4e0ac9d04d8b (patch)
tree3836c43924a84ea5294e1c32828d3c0005cf44c9
parentbd0b691716a6ba38d038d6194bb5fc8a30f20f4b (diff)
downloadorg-mode-00938bc98bb3ce7d14bdc400ad9f4e0ac9d04d8b.tar.gz
org-src: New option for `org-src-window-setup'.
org-src.el: (org-src-window-setup) support open edit src window below. TINYCHANGE
-rw-r--r--etc/ORG-NEWS4
-rw-r--r--lisp/org-src.el22
2 files changed, 18 insertions, 8 deletions
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 01a9361..bd9d2a8 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -277,6 +277,10 @@ of these exporters will properly export to =irc:= links, which will
open properly in irc clients from web browsers.
*** ~org-comment-dwim~ (bound to =M-;=) now comments headings, if point is on a heading
+*** Add support for open source block in window below
+
+Set option ~org-src-window-setup~ to ~split-window-below~.
+
*** Alphabetic sorting in headings and tags now uses the locale’s sorting rules
When sorting alphabetically, ~org-sort-entries~ and
diff --git a/lisp/org-src.el b/lisp/org-src.el
index dfa2ae3..ec32d7b 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -153,17 +153,20 @@ the existing edit buffer."
"How the source code edit buffer should be displayed.
Possible values for this option are:
-current-window Show edit buffer in 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,
- return to one window.
-other-frame Use `switch-to-buffer-other-frame' to display edit buffer.
- Also, when exiting the edit buffer, kill that frame."
+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.
+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,
+ return to one window.
+other-frame Use `switch-to-buffer-other-frame' to display edit buffer.
+ Also, when exiting the edit buffer, kill that frame."
:group 'org-edit-structure
:type '(choice
(const current-window)
+ (const split-window-below)
(const other-frame)
(const other-window)
(const reorganize-frame)))
@@ -746,6 +749,9 @@ If BUFFER is non-nil, test it instead."
(`current-window (pop-to-buffer-same-window buffer))
(`other-window
(switch-to-buffer-other-window buffer))
+ (`split-window-below
+ (select-window (split-window-vertically))
+ (pop-to-buffer-same-window buffer))
(`other-frame
(pcase context
(`exit