emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [ANN] New babel features: sessions, ESS & remote commands
@ 2010-08-17 22:10 Dan Davison
  0 siblings, 0 replies; only message in thread
From: Dan Davison @ 2010-08-17 22:10 UTC (permalink / raw)
  To: emacs org-mode mailing list

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-08-17 22:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-17 22:10 [ANN] New babel features: sessions, ESS & remote commands Dan Davison

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).