From 6976d9fc791b952a566dafd09d52845ec42ddaac Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Tue, 16 Mar 2010 12:55:36 -0400 Subject: [PATCH] babel: org-babel-switch-to-session [C-c M-b z] org-babel-pop-to-session is an alias of this --- contrib/babel/lisp/org-babel-keys.el | 3 ++- contrib/babel/lisp/org-babel.el | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/contrib/babel/lisp/org-babel-keys.el b/contrib/babel/lisp/org-babel-keys.el index 006e81576..14083e1eb 100644 --- a/contrib/babel/lisp/org-babel-keys.el +++ b/contrib/babel/lisp/org-babel-keys.el @@ -47,7 +47,8 @@ interactive babel functions which are assigned key bindings.") ("b" . org-babel-execute-buffer) ("h" . org-babel-sha1-hash) ("g" . org-babel-goto-named-source-block) - ("l" . org-babel-lob-ingest)) + ("l" . org-babel-lob-ingest) + ("z" . org-babel-switch-to-session)) "Org-babel keybindings. This list associates interactive org-babel functions with keys. Each element of this list will add an entry to the `org-mode-map' using the letter key which is diff --git a/contrib/babel/lisp/org-babel.el b/contrib/babel/lisp/org-babel.el index 3792ec757..d01e6d6f7 100644 --- a/contrib/babel/lisp/org-babel.el +++ b/contrib/babel/lisp/org-babel.el @@ -261,10 +261,10 @@ session. After loading the body this pops open the session." (pop-to-buffer (funcall (intern (concat "org-babel-load-session:" lang)) session body params)) (move-end-of-line 1))) -(defun org-babel-pop-to-session (&optional arg info) - "Pop to the session of the current source-code block. If -called with a prefix argument then evaluate the header arguments -for the source block before entering the session. Copy the body +(defun org-babel-switch-to-session (&optional arg info) + "Switch to the session of the current source-code block. +If called with a prefix argument then evaluate the header arguments +for the source block before entering the session. Copy the body of the source block to the kill ring." (interactive) (let* ((info (or info (org-babel-get-src-block-info))) @@ -285,6 +285,8 @@ of the source block to the kill ring." (pop-to-buffer (funcall (intern (format "org-babel-%s-initiate-session" lang)) session params)) (move-end-of-line 1))) +(defalias 'org-babel-pop-to-session 'org-babel-switch-to-session) + (defun org-babel-open-src-block-result (&optional re-run) "If `point' is on a src block then open the results of the source code block, otherwise return nil. With optional prefix -- 2.11.4.GIT