org-mode/contrib/babel/lisp
Dan Davison 2056d7d419 babel: Allow shell-command-on-region to execute remotely
These changes solve two problems: both are discussed in the following thread

http://lists.gnu.org/archive/html/tramp-devel/2010-02/msg00025.html

of which a summary follows.

Firstly, shell-command-on-region does not work with tramp in the same
way that shell-command does. I.e. whereas

(let ((default-directory "/user@remote-host:"))
  (shell-command "hostname" t))

gives the remote hostname,

(let ((default-directory "/user@remote-host:"))
  (shell-command-on-region (point) (mark) "hostname" t))

does not.

The reason is that shell-command-on-region calls call-process-region,
which does not use a tramp handler for remote files. However, such a
file handler does exist (unused) in the tramp sources:
tramp-handle-call-process-region. There is a slight problem in that
there is a bug in that function definition in current tramp (which has
persisted because the function is not normally used).

Therefore, we define an org-babel version of
tramp-handle-call-process-region which fixes the bug, and we bind
call-process-region to org-babel-tramp-handle-call-process-region for
the duration of org-babel-execute-src-block.
2010-02-27 14:14:08 -05:00
..
langs babel: working directories and remote execution 2010-02-27 14:14:08 -05:00
org-babel-comint.el babel: allow point to move to end of comint buffer 2010-02-27 14:14:07 -05:00
org-babel-exp.el babel: Fix export bug. 2010-02-25 15:12:47 -05:00
org-babel-keys.el babel: fixed type in org-babel-keys 2010-01-01 15:55:11 -07:00
org-babel-lob.el babel: now including source code block arguments w/source name on export 2010-02-10 13:34:00 -07:00
org-babel-ref.el babel: smarter `org-babel-ref-split-args' -- fixes bug parsing indexed function-style args 2010-02-14 11:48:28 -07:00
org-babel-table.el org-babel: cleaner passing of parameter to language specific files 2009-11-10 15:23:00 -07:00
org-babel-tangle.el babel: org-babel-load-file no longer fails when `file-truename' returns nil 2010-02-08 13:17:06 -07:00
org-babel.el babel: Allow shell-command-on-region to execute remotely 2010-02-27 14:14:08 -05:00