emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] [ANN] New babel features: sessions, ESS & remote commands


From: Dan Davison
Subject: [Orgmode] [ANN] New babel features: sessions, ESS & remote commands
Date: Tue, 17 Aug 2010 18:10:14 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]