1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-23 07:18:53 +00:00

babel: new function `org-babel-switch-to-session-with-code'

* ob.el (org-babel-switch-to-session-with-code): new function
    to generate split frame displaying edit buffer and session.

    * ob-keys.el (org-babel-key-bindings): binding for
    `org-babel-switch-to-session-with-code'
This commit is contained in:
Dan Davison 2010-08-17 17:01:37 -04:00
parent cbe5089e0f
commit b05f8c91fe
2 changed files with 18 additions and 1 deletions

View File

@ -74,7 +74,7 @@ functions which are assigned key bindings, and see
("\C-i" . org-babel-lob-ingest)
("i" . org-babel-lob-ingest)
("\C-z" . org-babel-switch-to-session)
("z" . org-babel-switch-to-session)
("z" . org-babel-switch-to-session-with-code)
("\C-a" . org-babel-sha1-hash)
("a" . org-babel-sha1-hash)
("h" . org-babel-describe-bindings))

View File

@ -465,6 +465,23 @@ of the source block to the kill ring."
(defalias 'org-babel-pop-to-session 'org-babel-switch-to-session)
;;;###autoload
(defun org-babel-switch-to-session-with-code (&optional arg info)
"Switch to code buffer and display session."
(interactive "P")
(flet ((swap-windows
()
(let ((other-window-buffer (window-buffer (next-window))))
(set-window-buffer (next-window) (current-buffer))
(set-window-buffer (selected-window) other-window-buffer))
(other-window 1)))
(let ((info (org-babel-get-src-block-info))
(org-src-window-setup 'reorganize-frame))
(save-excursion
(org-babel-switch-to-session arg info))
(org-edit-src-code))
(swap-windows)))
(defvar org-bracket-link-regexp)
;;;###autoload
(defun org-babel-open-src-block-result (&optional re-run)