From: Dan Davison <davison@stats.ox.ac.uk>
To: emacs org-mode mailing list <emacs-orgmode@gnu.org>
Subject: [ANN] New babel features: sessions, ESS & remote commands
Date: Tue, 17 Aug 2010 18:10:14 -0400 [thread overview]
Message-ID: <878w44vqk9.fsf@stats.ox.ac.uk> (raw)
I've just pushed the additions below to the master branch. The first two
are intended to improve working with sessions in general and ESS (R) in
particular. The second two allow 'remote commands': babel commands in
code buffers, and language major mode commands from Org buffers.
1 New command to split frame between code and session
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New function `org-babel-switch-to-session-with-code' splits the
frame between the code buffer and the session, leaving point in the
code buffer. This is bound to C-c C-v z
(Note that the related command `org-babel-switch-to-session' has a
similar binding: C-c C-v C-z.)
ESS (R) users, for example, can use this command and then proceed to
send code to the session with `ess-eval-function-or-paragraph-and-step'
(C-c C-c) or other ess-eval-* functions.
2 Better integration between code buffer and ESS (R) sessions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If :session is in effect[1] and the session is running, C-c ' now
explicitly tries to associate the code buffer with the session
(currently implemented for R). This means that when language
major-mode commands are used to send code to the session for
evaluation, they should always know which session to send the code
to.
3 Org-babel commands are available in code buffers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
`org-src-do-key-sequence-at-code-block' in the *code buffer* can be
used to execute a babel command (e.g. tangle or execute) without
having to return to the Org buffer.
In order to avoid stealing major mode bindings, this is not bound by
default. It makes sense to set the key binding in the
`org-src-mode-hook'. For example, to use C-c @ for this command in
all language mode buffers, you could use
(add-hook 'org-src-mode-hook
(lambda () (define-key org-src-mode-map "\C-c@"
'org-src-do-key-sequence-at-code-block)))
4 Language major mode commands are available at Org code blocks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
`org-babel-do-key-sequence-in-edit-buffer' in the *Org buffer* will
prompt for a key sequence, which is executed in the language major
mode edit buffer. This is bound to C-c C-v C-x and C-c C-v x.
Possible uses include
C-c C-v C-x TAB: Perform language-specific TAB behaviour
For ESS (R) users:
C-c C-v C-x C-c C-c: `ess-eval-function-or-paragraph-and-step'
without manually visiting the ess-mode buffer.
[1] ':session in effect' means :session is turned on for current
block. This may be as a result of a header arg, a subtree property,
a #+babel: buffer option or configuration of
`org-babel-default-header-args' or
`org-babel-default-header-args:LANG'.
Dan
reply other threads:[~2010-08-17 22:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878w44vqk9.fsf@stats.ox.ac.uk \
--to=davison@stats.ox.ac.uk \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).