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:
parent
cbe5089e0f
commit
b05f8c91fe
@ -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))
|
||||
|
17
lisp/ob.el
17
lisp/ob.el
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user