summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Kamm <jackkamm@gmail.com>2020-01-19 08:28:36 -0800
committerKyle Meyer <kyle@kyleam.com>2020-01-24 23:06:40 -0500
commit7d5e931f79ef4445fe5e67c840e56fd224d262ad (patch)
tree03e345512c0c20988f60f556b99e12973dd807e9
parentebf8b39ae6c4a676221bc4920e164f8c06147ea6 (diff)
downloadorg-mode-7d5e931f79ef4445fe5e67c840e56fd224d262ad.tar.gz
org-src: Add option `plain' to org-src-window-setup
* lisp/org-src.el (org-src-window-setup): Add option `plain' for org-src-window-setup, that uses vanilla display-buffer to show the source window.
-rw-r--r--etc/ORG-NEWS7
-rw-r--r--lisp/org-src.el6
2 files changed, 13 insertions, 0 deletions
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 90e6125..5b06db9 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -35,6 +35,13 @@ value in call to =java=.
After editing a source block, Org will restore the window layout when
~org-src-window-setup~ is set to a value that modifies the layout.
+*** New option to show source buffers using "plain" display-buffer
+
+Added option ~plain~ to ~org-src-window-setup~ to show source buffers
+using ~display-buffer~. This allows users to control how source
+buffers are displayed by modifying ~display-buffer-alist~ or
+~display-buffer-base-action~.
+
** New functions
*** ~org-columns-toggle-or-columns-quit~
=<C-c C-c>= bound to ~org-columns-toggle-or-columns-quit~ replaces the
diff --git a/lisp/org-src.el b/lisp/org-src.el
index 878821b..52e99cf 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -148,6 +148,9 @@ the existing edit buffer."
"How the source code edit buffer should be displayed.
Possible values for this option are:
+plain Show edit buffer using `display-buffer'. Users can
+ further control the display behavior by modifying
+ `display-buffer-alist' and its relatives.
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
@@ -801,6 +804,9 @@ Raise an error when current buffer is not a source editing buffer."
(defun org-src-switch-to-buffer (buffer context)
(pcase org-src-window-setup
+ (`plain
+ (when (eq context 'exit) (quit-restore-window))
+ (pop-to-buffer buffer))
(`current-window (pop-to-buffer-same-window buffer))
(`other-window
(switch-to-buffer-other-window buffer))