emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] with-parsed-tramp-file-name
@ 2010-09-29 23:08 Austin F. Frank
  2010-09-30  6:52 ` with-parsed-tramp-file-name Noorul Islam K M
  0 siblings, 1 reply; 5+ messages in thread
From: Austin F. Frank @ 2010-09-29 23:08 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 3998 bytes --]

Hello!

Recently I discovered that I can no longer evaluate R source code blocks
on a file opened using TRAMP.  I've recreated the bug using a minimal
config.  The process to reproduce this bug is described below.


Using Org-mode version 7.01trans (release_7.01h.746.g72c5) with the
following minimal configuration:

--8<---------------cut here---------------start------------->8---
;; specific to my setup
(add-to-list 'load-path (expand-file-name "~/src.remote/org-mode/lisp/"))
(add-to-list 'load-path (expand-file-name "/usr/local/share/emacs/site-lisp/"))

;; general instructions
(require 'tramp)
(require 'tramp-sh) 		; have to do this to set tramp-remote-path?
(require 'ess-site)
(require 'org-install)

(setq debug-on-error t)

;; active Babel languages
(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)))

;; required for R to work correctly on my remote server
(add-to-list 'tramp-remote-path 'tramp-own-remote-path)
--8<---------------cut here---------------end--------------->8---

I evaluate the following code block from a file accessed using TRAMP:

--8<---------------cut here---------------start------------->8---
#+source:  R-options
#+BEGIN_SRC R :cache no :results silent :exports none
options(digits = 4)
theme_set(theme_bw(18))
theme_thesis <- theme_update(panel.margin = unit(1.5, "lines"))
theme_set(theme_thesis)
lattice.options(default.args = list(as.table = TRUE))
dev.new()
#+END_SRC
--8<---------------cut here---------------end--------------->8---

And get the following backtrace:

#v+
Debugger entered--Lisp error: (invalid-function with-parsed-tramp-file-name)
  with-parsed-tramp-file-name("/scpc:bcs:/tmp/R-22126Grk" nil nil)
  org-babel-local-file-name("/scpc:bcs:/tmp/R-22126Grk")
  org-babel-process-file-name("/scpc:bcs:/tmp/R-22126Grk" noquote)
  org-babel-R-evaluate-session("*R*" "options(digits = 4)\ntheme_set(theme_bw(18))\ntheme_thesis <- theme_update(panel.margin = unit(1.5, \"lines\"))\ntheme_set(theme_thesis)\nlattice.options(default.args = list(as.table = TRUE))\ndev.new()" value nil nil)
  org-babel-R-evaluate("*R*" "options(digits = 4)\ntheme_set(theme_bw(18))\ntheme_thesis <- theme_update(panel.margin = unit(1.5, \"lines\"))\ntheme_set(theme_thesis)\nlattice.options(default.args = list(as.table = TRUE))\ndev.new()" value nil nil)
  org-babel-execute:R("options(digits = 4)\ntheme_set(theme_bw(18))\ntheme_thesis <- theme_update(panel.margin = unit(1.5, \"lines\"))\ntheme_set(theme_thesis)\nlattice.options(default.args = list(as.table = TRUE))\ndev.new()\n" ((:cache . "no") (:comments . "") (:exports . "none") (:height . "600") (:hlines . "no") (:noweb . "no") (:results . "silent") (:session) (:shebang . "") (:tangle . "no") (:width . "1000")))
  org-babel-execute-src-block(nil ("R" "options(digits = 4)\ntheme_set(theme_bw(18))\ntheme_thesis <- theme_update(panel.margin = unit(1.5, \"lines\"))\ntheme_set(theme_thesis)\nlattice.options(default.args = list(as.table = TRUE))\ndev.new()\n" ((:cache . "no") (:comments . "") (:exports . "none") (:height . "600") (:hlines . "no") (:noweb . "no") (:results . "silent") (:session) (:shebang . "") (:tangle . "no") (:width . "1000")) "" "R-options" nil 0))
  org-babel-execute-src-block-maybe()
  org-babel-execute-maybe()
  org-babel-execute-safely-maybe()
  run-hook-with-args-until-success(org-babel-execute-safely-maybe)
  org-ctrl-c-ctrl-c(nil)
  call-interactively(org-ctrl-c-ctrl-c nil nil)
#v-

But I can see that `with-parsed-tramp-file-name' is a defined function
by using C-h f, which reports:

#v+
with-parsed-tramp-file-name is a Lisp macro in `tramp.el'.

(with-parsed-tramp-file-name FILENAME VAR &rest BODY)
#v-

Can anyone help me understand why I can't evaluate R source blocks on a
remote machine?  Is there further debugging information I can provide?

Thanks,
/au

-- 
Austin Frank
http://aufrank.net
GPG Public Key (D7398C2F): http://aufrank.net/personal.asc

[-- Attachment #1.2: Type: application/pgp-signature, Size: 194 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: with-parsed-tramp-file-name
  2010-09-29 23:08 [babel] with-parsed-tramp-file-name Austin F. Frank
@ 2010-09-30  6:52 ` Noorul Islam K M
  2010-09-30  8:44   ` with-parsed-tramp-file-name Dan Davison
  0 siblings, 1 reply; 5+ messages in thread
From: Noorul Islam K M @ 2010-09-30  6:52 UTC (permalink / raw)
  To: Austin F. Frank; +Cc: emacs-orgmode

"Austin F. Frank" <austin.frank@gmail.com> writes:

> Hello!
>
> Recently I discovered that I can no longer evaluate R source code blocks
> on a file opened using TRAMP.  I've recreated the bug using a minimal
> config.  The process to reproduce this bug is described below.
>
>
> Using Org-mode version 7.01trans (release_7.01h.746.g72c5) with the
> following minimal configuration:
>
> ;; specific to my setup
> (add-to-list 'load-path (expand-file-name "~/src.remote/org-mode/lisp/"))
> (add-to-list 'load-path (expand-file-name "/usr/local/share/emacs/site-lisp/"))
>
> ;; general instructions
> (require 'tramp)
> (require 'tramp-sh) 		; have to do this to set tramp-remote-path?
> (require 'ess-site)
> (require 'org-install)
>
> (setq debug-on-error t)
>
> ;; active Babel languages
> (org-babel-do-load-languages
>  'org-babel-load-languages
>  '((R . t)))
>
> ;; required for R to work correctly on my remote server
> (add-to-list 'tramp-remote-path 'tramp-own-remote-path)
>
> I evaluate the following code block from a file accessed using TRAMP:
>
> #+source:  R-options
> #+BEGIN_SRC R :cache no :results silent :exports none
> options(digits = 4)
> theme_set(theme_bw(18))
> theme_thesis <- theme_update(panel.margin = unit(1.5, "lines"))
> theme_set(theme_thesis)
> lattice.options(default.args = list(as.table = TRUE))
> dev.new()
> #+END_SRC
>
> And get the following backtrace:
>
> #v+
> Debugger entered--Lisp error: (invalid-function with-parsed-tramp-file-name)
>   with-parsed-tramp-file-name("/scpc:bcs:/tmp/R-22126Grk" nil nil)
>   org-babel-local-file-name("/scpc:bcs:/tmp/R-22126Grk")
>   org-babel-process-file-name("/scpc:bcs:/tmp/R-22126Grk" noquote)
>   org-babel-R-evaluate-session("*R*" "options(digits = 4)\ntheme_set(theme_bw(18))\ntheme_thesis <- theme_update(panel.margin = unit(1.5, \"lines\"))\ntheme_set(theme_thesis)\nlattice.options(default.args = list(as.table = TRUE))\ndev.new()" value nil nil)
>   org-babel-R-evaluate("*R*" "options(digits = 4)\ntheme_set(theme_bw(18))\ntheme_thesis <- theme_update(panel.margin = unit(1.5, \"lines\"))\ntheme_set(theme_thesis)\nlattice.options(default.args = list(as.table = TRUE))\ndev.new()" value nil nil)
>   org-babel-execute:R("options(digits = 4)\ntheme_set(theme_bw(18))\ntheme_thesis <- theme_update(panel.margin = unit(1.5, \"lines\"))\ntheme_set(theme_thesis)\nlattice.options(default.args = list(as.table = TRUE))\ndev.new()\n" ((:cache . "no") (:comments . "") (:exports . "none") (:height . "600") (:hlines . "no") (:noweb . "no") (:results . "silent") (:session) (:shebang . "") (:tangle . "no") (:width . "1000")))
>   org-babel-execute-src-block(nil ("R" "options(digits = 4)\ntheme_set(theme_bw(18))\ntheme_thesis <- theme_update(panel.margin = unit(1.5, \"lines\"))\ntheme_set(theme_thesis)\nlattice.options(default.args = list(as.table = TRUE))\ndev.new()\n" ((:cache . "no") (:comments . "") (:exports . "none") (:height . "600") (:hlines . "no") (:noweb . "no") (:results . "silent") (:session) (:shebang . "") (:tangle . "no") (:width . "1000")) "" "R-options" nil 0))
>   org-babel-execute-src-block-maybe()
>   org-babel-execute-maybe()
>   org-babel-execute-safely-maybe()
>   run-hook-with-args-until-success(org-babel-execute-safely-maybe)
>   org-ctrl-c-ctrl-c(nil)
>   call-interactively(org-ctrl-c-ctrl-c nil nil)
> #v-
>
> But I can see that `with-parsed-tramp-file-name' is a defined function
> by using C-h f, which reports:
>
> #v+
> with-parsed-tramp-file-name is a Lisp macro in `tramp.el'.
>
> (with-parsed-tramp-file-name FILENAME VAR &rest BODY)
> #v-
>
> Can anyone help me understand why I can't evaluate R source blocks on a
> remote machine?  Is there further debugging information I can provide?
>
> Thanks,
> /au

I tried to replicate this and I get the same error. If I manually load
ob.el by M-x load-file with Location as /path/to/ob.el then C-c C-c
works. But (require 'ob) is not working. Am I missing something?

Thanks and Regards
Noorul

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: with-parsed-tramp-file-name
  2010-09-30  6:52 ` with-parsed-tramp-file-name Noorul Islam K M
@ 2010-09-30  8:44   ` Dan Davison
  2010-09-30 13:28     ` with-parsed-tramp-file-name Austin F. Frank
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Davison @ 2010-09-30  8:44 UTC (permalink / raw)
  To: Austin F. Frank; +Cc: emacs-orgmode, Noorul Islam K M

Hi Austin,

Noorul Islam K M <noorul@noorul.com> writes:

> "Austin F. Frank" <austin.frank@gmail.com> writes:

>> Recently I discovered that I can no longer evaluate R source code blocks
>> on a file opened using TRAMP.

Just btw, I use Org every day at the moment (with emacs24) to execute
code (mostly R) on remote machines. The method I use is to store all Org
files locally, and use the :dir header argument to specify the machine
on which to run R, e.g.

--8<---------------cut here---------------start------------->8---
#+babel:   :dir /davison@oak.well.ox.ac.uk:~/bench
[...]
#+begin_src R
system("hostname", intern=TRUE)
#+end_src

#+results:
: oak
--8<---------------cut here---------------end--------------->8---

Do you get the same error evaluating R remotely using this method?

>> Using Org-mode version 7.01trans (release_7.01h.746.g72c5) with the

What's your emacs version?

>> following minimal configuration:
>>
>> ;; specific to my setup
>> (add-to-list 'load-path (expand-file-name "~/src.remote/org-mode/lisp/"))
>> (add-to-list 'load-path (expand-file-name "/usr/local/share/emacs/site-lisp/"))
>>
>> ;; general instructions
>> (require 'tramp)
>> (require 'tramp-sh) 		; have to do this to set tramp-remote-path?

I don't see tramp-sh in emacs23; I do see it in emacs24.

>> (require 'ess-site)
>> (require 'org-install)
>>
>> (setq debug-on-error t)
>>
>> ;; active Babel languages
>> (org-babel-do-load-languages
>>  'org-babel-load-languages
>>  '((R . t)))
>>
>> ;; required for R to work correctly on my remote server
>> (add-to-list 'tramp-remote-path 'tramp-own-remote-path)

>>
>> I evaluate the following code block from a file accessed using TRAMP:
[...]
How about we test this simple source block:

#+begin_src R
system("hostname", intern=TRUE)
#+end_src

in a file on the remote machine opened using C-x C-f with the
/user@machine:path/to/file syntax, with this minimal config:

--8<---------------cut here---------------start------------->8---
(add-to-list 'load-path "/PATH/TO/ess/lisp")
(require 'ess-site)
(add-to-list 'load-path "/PATH/TO/org-mode/lisp")
(require 'org-install)
(setq debug-on-error t)
(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)))
--8<---------------cut here---------------end--------------->8---

>> And get the following backtrace:

>> Debugger entered--Lisp error: (invalid-function with-parsed-tramp-file-name)
>>   with-parsed-tramp-file-name("/scpc:bcs:/tmp/R-22126Grk" nil nil)
>>   org-babel-local-file-name("/scpc:bcs:/tmp/R-22126Grk")

[...]

With emacs 23.1.1, I get a different error, also involving tramp
functions (backtrace below). With emacs 24.0.50.1 I get no error.

However, if I add in your two tramp (require) lines:
(require 'tramp)
(require 'tramp-sh)

Then I do get an error with emacs24, again different.

I suspect part of the problem is to do with those (require tramp...)
lines in your config. Could you try without those lines, and without

(add-to-list 'tramp-remote-path 'tramp-own-remote-path)

Instead, could you try

(setq org-babel-R-command "/PATH/TO/R/EXECUTABLE --slave --no-save")

> I tried to replicate this and I get the same error.

> If I manually load ob.el by M-x load-file with Location as
> /path/to/ob.el then C-c C-c works. But (require 'ob) is not
> working. Am I missing something?

Noruul, what does (featurep 'ob) evaluate to before you manually attempt
the (require 'ob) ? And what goes wrong when you do the require?

If (part of) this is an issue of tramp differences between emacs23 and
24 then the tramp author Michael Albinus has already been extremely
helpful on several occasions with tramp issues and I am confident he
will be able to advise.

Dan

Error from emacs24 with tramp require lines in emacs config:
--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (void-function tramp-compat-octal-to-decimal)
  signal(void-function (tramp-compat-octal-to-decimal))
  byte-code("\b\203\x13\0\305	G!\203\x13\0\n\306>\203\x13\0\307\207\b\203&\0\305	G!\203&\0\n\310>\203&\0\v\207\311\f@\fA\"\207" [completion localname operation filename err zerop (file-exists-p file-directory-p) t (expand-file-name file-name-as-directory) signal] 3)
  tramp-file-name-handler(insert-file-contents "/scpc:davison@oak.well.ox.ac.uk:/tmp/austin.org" t nil nil nil)
  insert-file-contents("/scpc:davison@oak.well.ox.ac.uk:/tmp/austin.org" t)
  byte-code("\302\x18\303	\302\"\210)\302\207" [inhibit-read-only filename t insert-file-contents] 3)
  find-file-noselect-1(#<buffer austin.org> "/scpc:davison@oak.well.ox.ac.uk:/tmp/austin.org" nil nil "/scpc:davison@oak.well.ox.ac.uk:/tmp/austin.org" ((149 . 8410) (-1 . 0)))
  find-file-noselect("/scpc:davison@oak.well.ox.ac.uk:/tmp/austin.org" nil nil t)
  find-file("/scpc:davison@oak.well.ox.ac.uk:/tmp/austin.org" t)
  call-interactively(find-file nil nil)
--8<---------------cut here---------------end--------------->8---

Error with emacs23:
--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p "")
  tramp-handle-write-region("" nil "/scp:davison@oak.well.ox.ac.uk:/tmp/R-32069vws" nil silent)
  apply(tramp-handle-write-region ("" nil "/scp:davison@oak.well.ox.ac.uk:/tmp/R-32069vws" nil silent))
  tramp-sh-file-name-handler(write-region "" nil "/scp:davison@oak.well.ox.ac.uk:/tmp/R-32069vws" nil silent)
  apply(tramp-sh-file-name-handler write-region ("" nil "/scp:davison@oak.well.ox.ac.uk:/tmp/R-32069vws" nil silent))
  tramp-file-name-handler(write-region "" nil "/scp:davison@oak.well.ox.ac.uk:/tmp/R-32069vws" nil silent)
  write-region("" nil "/scp:davison@oak.well.ox.ac.uk:/tmp/R-32069vws" nil silent nil excl)
  byte-code("ÅÆ\bG!ƒ\x0e\0Ç	!‚\x12\0È\b	\"!\x12\vƒ\x1c\0\n\vP\x12\fƒ'\0É\n!ˆ‚2\0ÊËÌ\nÌÍÌÎ&\aˆÌ‡" [prefix temporary-file-directory file suffix dir-flag make-temp-name zerop file-name-as-directory expand-file-name make-directory write-region "" nil silent excl] 8)
  make-temp-file("/scp:davison@oak.well.ox.ac.uk:/tmp/R-")
  (if (file-remote-p default-directory) (make-temp-file (concat ... ... nil suffix)) (make-temp-file prefix nil suffix))
  org-babel-temp-file("R-")
  (let ((tmp-file ...)) (org-babel-eval org-babel-R-command (format org-babel-R-write-object-command ... ... ... ...)) (org-babel-R-process-value-result (org-babel-import-elisp-from-file tmp-file ...) column-names-p))
  (cond ((eql result-type ...) (let ... ... ...)) ((eql result-type ...) (org-babel-eval org-babel-R-command body)))
  (case result-type (value (let ... ... ...)) (output (org-babel-eval org-babel-R-command body)))
  org-babel-R-evaluate-external-process("system(\"hostname\", intern=TRUE)" value nil nil)
  (if session (org-babel-R-evaluate-session session body result-type column-names-p row-names-p) (org-babel-R-evaluate-external-process body result-type column-names-p row-names-p))
  org-babel-R-evaluate(nil "system(\"hostname\", intern=TRUE)" value nil nil)
  (let* ((processed-params ...) (result-type ...) (session ...) (colnames-p ...) (rownames-p ...) (out-file ...) (full-body ...) (result ...)) (message "result is %S" result) (or out-file result))
  (save-excursion (let* (... ... ... ... ... ... ... ...) (message "result is %S" result) (or out-file result)))
  org-babel-execute:R("system(\"hostname\", intern=TRUE)\n" ((:cache . "no") (:comments . "") (:exports . "code") (:hlines . "no") (:noweb . "no") (:results . "replace") (:session . "none") (:shebang . "") (:tangle . "no")))
  funcall(org-babel-execute:R "system(\"hostname\", intern=TRUE)\n" ((:cache . "no") (:comments . "") (:exports . "code") (:hlines . "no") (:noweb . "no") (:results . "replace") (:session . "none") (:shebang . "") (:tangle . "no")))
  (setq result (funcall cmd body params))
  (if (and (not arg) new-hash (equal new-hash old-hash)) (save-excursion (goto-char ...) (end-of-line 1) (forward-char 1) (setq result ...) (message ...) result) (message "executing %s code block%s..." (capitalize lang) (if ... ... "")) (setq result (funcall cmd body params)) (if (eq result-type ...) (setq result ...)) (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks (quote org-babel-after-execute-hook)) result)
  (progn (fset (quote call-process-region) (function* ...)) (unless (fboundp cmd) (error "No org-babel-execute function for %s!" lang)) (if (and ... new-hash ...) (save-excursion ... ... ... ... ... result) (message "executing %s code block%s..." ... ...) (setq result ...) (if ... ...) (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks ...) result))
  (unwind-protect (progn (fset ... ...) (unless ... ...) (if ... ... ... ... ... ... ... result)) (if --cl-letf-bound-- (fset ... --cl-letf-save--) (fmakunbound ...)))
  (let* ((--cl-letf-bound-- ...) (--cl-letf-save-- ...)) (unwind-protect (progn ... ... ...) (if --cl-letf-bound-- ... ...)))
  (letf ((... ...)) (unless (fboundp cmd) (error "No org-babel-execute function for %s!" lang)) (if (and ... new-hash ...) (save-excursion ... ... ... ... ... result) (message "executing %s code block%s..." ... ...) (setq result ...) (if ... ...) (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks ...) result))
  (letf* ((... ...)) (unless (fboundp cmd) (error "No org-babel-execute function for %s!" lang)) (if (and ... new-hash ...) (save-excursion ... ... ... ... ... result) (message "executing %s code block%s..." ... ...) (setq result ...) (if ... ...) (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks ...) result))
  (flet ((call-process-region ... ...)) (unless (fboundp cmd) (error "No org-babel-execute function for %s!" lang)) (if (and ... new-hash ...) (save-excursion ... ... ... ... ... result) (message "executing %s code block%s..." ... ...) (setq result ...) (if ... ...) (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks ...) result))
  (unwind-protect (flet (...) (unless ... ...) (if ... ... ... ... ... ... ... result)) (setq call-process-region (quote org-babel-call-process-region-original)))
  (let* ((lang ...) (params ...) (new-hash ...) (old-hash ...) (body ...) (result-params ...) (result-type ...) (cmd ...) (dir ...) (default-directory ...) (org-babel-call-process-region-original ...) (indent ...) result) (unwind-protect (flet ... ... ...) (setq call-process-region ...)))
  (progn (let* (... ... ... ... ... ... ... ... ... ... ... ... result) (unwind-protect ... ...)))
  (if (org-babel-confirm-evaluate info) (progn (let* ... ...)))
  (when (org-babel-confirm-evaluate info) (let* (... ... ... ... ... ... ... ... ... ... ... ... result) (unwind-protect ... ...)))
  (let ((info ...)) (when (org-babel-confirm-evaluate info) (let* ... ...)))
  org-babel-execute-src-block(nil ("R" "system(\"hostname\", intern=TRUE)\n" ((:cache . "no") (:comments . "") (:exports . "code") (:hlines . "no") (:noweb . "no") (:results . "replace") (:session . "none") (:shebang . "") (:tangle . "no")) "" nil nil 0))
  (progn (org-babel-execute-src-block current-prefix-arg info) t)
  (if info (progn (org-babel-execute-src-block current-prefix-arg info) t) nil)
  (let ((info ...)) (if info (progn ... t) nil))
  org-babel-execute-src-block-maybe()
  (or (org-babel-execute-src-block-maybe) (org-babel-lob-execute-maybe))
  org-babel-execute-maybe()
  (if org-babel-no-eval-on-ctrl-c-ctrl-c nil (org-babel-execute-maybe))
  (unless org-babel-no-eval-on-ctrl-c-ctrl-c (org-babel-execute-maybe))
  org-babel-execute-safely-maybe()
  run-hook-with-args-until-success(org-babel-execute-safely-maybe)
  (cond ((or ... org-occur-highlights org-latex-fragment-image-overlays) (and ... ...) (org-remove-occur-highlights) (org-remove-latex-fragment-image-overlays) (message "Temporary highlights/overlays removed from current buffer")) ((and ... ...) (funcall org-finish-function)) ((run-hook-with-args-until-success ...)) ((or ... ...) (call-interactively ...)) ((org-on-target-p) (call-interactively ...)) ((and ... ...) (call-interactively ...)) ((org-on-heading-p) (call-interactively ...)) ((org-at-table\.el-p) (message "Use C-c ' to edit table.el tables")) ((org-at-table-p) (org-table-maybe-eval-formula) (if arg ... ...) (call-interactively ...)) ((or ... ...) (call-interactively ...)) ((org-at-item-checkbox-p) (call-interactively ...) (call-interactively ...) (org-list-send-list ...)) ((org-at-item-p) (call-interactively ...) (when arg ...) (org-list-send-list ...)) ((save-excursion ... ...) (beginning-of-line 1) (save-excursion ...)) ((save-excursion ... ...) (cond ... ...)) ((org-clock-update-time-maybe)) (t (error "C-c C-c can do nothing useful at this location")))
  (let ((org-enable-table-editor t)) (cond (... ... ... ... ...) (... ...) (...) (... ...) (... ...) (... ...) (... ...) (... ...) (... ... ... ...) (... ...) (... ... ... ...) (... ... ... ...) (... ... ...) (... ...) (...) (t ...)))
  org-ctrl-c-ctrl-c(nil)
  call-interactively(org-ctrl-c-ctrl-c nil nil)
  recursive-edit()
  byte-code("Æ\x10	@Ç=ƒ!\0ÈÉÊ\"ˆËÉ!‰\x1aA@)¢Ì=ƒ!\0ÈÍÊ\"ˆÎ\v!ˆÏ ˆÐ	!ˆ\fƒd\0Ñed\"\rVƒW\0ebˆÒ\r¥yˆ`\x1e^[dbˆÒ\r¥\rZyˆ\x0e^[`|ˆ)ÓcˆebˆÔÕÖ \"ˆ×Æ!ˆÔØ!ˆÙÊ\x1e\x1c\x1e\x1dÔØ!ˆŠÚ ˆ+Ù‡" [unread-command-char debugger-args x debugger-buffer noninteractive debugger-batch-max-lines -1 debug backtrace-debug 4 t backtrace-frame lambda 5 pop-to-buffer debugger-mode debugger-setup-buffer count-lines 2 "...\n" message "%s" buffer-string kill-emacs "" nil recursive-edit middlestart buffer-read-only standard-output] 4)
  debug(error (wrong-type-argument number-or-marker-p ""))
  tramp-handle-write-region("" nil "/scp:davison@oak.well.ox.ac.uk:/tmp/R-32069u9N" nil silent)
  apply(tramp-handle-write-region ("" nil "/scp:davison@oak.well.ox.ac.uk:/tmp/R-32069u9N" nil silent))
  tramp-sh-file-name-handler(write-region "" nil "/scp:davison@oak.well.ox.ac.uk:/tmp/R-32069u9N" nil silent)
  apply(tramp-sh-file-name-handler write-region ("" nil "/scp:davison@oak.well.ox.ac.uk:/tmp/R-32069u9N" nil silent))
  tramp-file-name-handler(write-region "" nil "/scp:davison@oak.well.ox.ac.uk:/tmp/R-32069u9N" nil silent)
  write-region("" nil "/scp:davison@oak.well.ox.ac.uk:/tmp/R-32069u9N" nil silent nil excl)
  byte-code("ÅÆ\bG!ƒ\x0e\0Ç	!‚\x12\0È\b	\"!\x12\vƒ\x1c\0\n\vP\x12\fƒ'\0É\n!ˆ‚2\0ÊËÌ\nÌÍÌÎ&\aˆÌ‡" [prefix temporary-file-directory file suffix dir-flag make-temp-name zerop file-name-as-directory expand-file-name make-directory write-region "" nil silent excl] 8)
  make-temp-file("/scp:davison@oak.well.ox.ac.uk:/tmp/R-")
  (if (file-remote-p default-directory) (make-temp-file (concat ... ... nil suffix)) (make-temp-file prefix nil suffix))
  org-babel-temp-file("R-")
  (let ((tmp-file ...)) (org-babel-eval org-babel-R-command (format org-babel-R-write-object-command ... ... ... ...)) (org-babel-R-process-value-result (org-babel-import-elisp-from-file tmp-file ...) column-names-p))
  (cond ((eql result-type ...) (let ... ... ...)) ((eql result-type ...) (org-babel-eval org-babel-R-command body)))
  (case result-type (value (let ... ... ...)) (output (org-babel-eval org-babel-R-command body)))
  org-babel-R-evaluate-external-process("system(\"hostname\", intern=TRUE)" value nil nil)
  (if session (org-babel-R-evaluate-session session body result-type column-names-p row-names-p) (org-babel-R-evaluate-external-process body result-type column-names-p row-names-p))
  org-babel-R-evaluate(nil "system(\"hostname\", intern=TRUE)" value nil nil)
  (let* ((processed-params ...) (result-type ...) (session ...) (colnames-p ...) (rownames-p ...) (out-file ...) (full-body ...) (result ...)) (message "result is %S" result) (or out-file result))
  (save-excursion (let* (... ... ... ... ... ... ... ...) (message "result is %S" result) (or out-file result)))
  org-babel-execute:R("system(\"hostname\", intern=TRUE)\n" ((:cache . "no") (:comments . "") (:exports . "code") (:hlines . "no") (:noweb . "no") (:results . "replace") (:session . "none") (:shebang . "") (:tangle . "no")))
  funcall(org-babel-execute:R "system(\"hostname\", intern=TRUE)\n" ((:cache . "no") (:comments . "") (:exports . "code") (:hlines . "no") (:noweb . "no") (:results . "replace") (:session . "none") (:shebang . "") (:tangle . "no")))
  (setq result (funcall cmd body params))
  (if (and (not arg) new-hash (equal new-hash old-hash)) (save-excursion (goto-char ...) (end-of-line 1) (forward-char 1) (setq result ...) (message ...) result) (message "executing %s code block%s..." (capitalize lang) (if ... ... "")) (setq result (funcall cmd body params)) (if (eq result-type ...) (setq result ...)) (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks (quote org-babel-after-execute-hook)) result)
  (progn (fset (quote call-process-region) (function* ...)) (unless (fboundp cmd) (error "No org-babel-execute function for %s!" lang)) (if (and ... new-hash ...) (save-excursion ... ... ... ... ... result) (message "executing %s code block%s..." ... ...) (setq result ...) (if ... ...) (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks ...) result))
  (unwind-protect (progn (fset ... ...) (unless ... ...) (if ... ... ... ... ... ... ... result)) (if --cl-letf-bound-- (fset ... --cl-letf-save--) (fmakunbound ...)))
  (let* ((--cl-letf-bound-- ...) (--cl-letf-save-- ...)) (unwind-protect (progn ... ... ...) (if --cl-letf-bound-- ... ...)))
  (letf ((... ...)) (unless (fboundp cmd) (error "No org-babel-execute function for %s!" lang)) (if (and ... new-hash ...) (save-excursion ... ... ... ... ... result) (message "executing %s code block%s..." ... ...) (setq result ...) (if ... ...) (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks ...) result))
  (letf* ((... ...)) (unless (fboundp cmd) (error "No org-babel-execute function for %s!" lang)) (if (and ... new-hash ...) (save-excursion ... ... ... ... ... result) (message "executing %s code block%s..." ... ...) (setq result ...) (if ... ...) (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks ...) result))
  (flet ((call-process-region ... ...)) (unless (fboundp cmd) (error "No org-babel-execute function for %s!" lang)) (if (and ... new-hash ...) (save-excursion ... ... ... ... ... result) (message "executing %s code block%s..." ... ...) (setq result ...) (if ... ...) (org-babel-insert-result result result-params info new-hash indent lang) (run-hooks ...) result))
  (unwind-protect (flet (...) (unless ... ...) (if ... ... ... ... ... ... ... result)) (setq call-process-region (quote org-babel-call-process-region-original)))
  (let* ((lang ...) (params ...) (new-hash ...) (old-hash ...) (body ...) (result-params ...) (result-type ...) (cmd ...) (dir ...) (default-directory ...) (org-babel-call-process-region-original ...) (indent ...) result) (unwind-protect (flet ... ... ...) (setq call-process-region ...)))
  (progn (let* (... ... ... ... ... ... ... ... ... ... ... ... result) (unwind-protect ... ...)))
  (if (org-babel-confirm-evaluate info) (progn (let* ... ...)))
  (when (org-babel-confirm-evaluate info) (let* (... ... ... ... ... ... ... ... ... ... ... ... result) (unwind-protect ... ...)))
  (let ((info ...)) (when (org-babel-confirm-evaluate info) (let* ... ...)))
  org-babel-execute-src-block(nil ("R" "system(\"hostname\", intern=TRUE)\n" ((:cache . "no") (:comments . "") (:exports . "code") (:hlines . "no") (:noweb . "no") (:results . "replace") (:session . "none") (:shebang . "") (:tangle . "no")) "" nil nil 0))
  (progn (org-babel-execute-src-block current-prefix-arg info) t)
  (if info (progn (org-babel-execute-src-block current-prefix-arg info) t) nil)
  (let ((info ...)) (if info (progn ... t) nil))
  org-babel-execute-src-block-maybe()
  (or (org-babel-execute-src-block-maybe) (org-babel-lob-execute-maybe))
  org-babel-execute-maybe()
  (if org-babel-no-eval-on-ctrl-c-ctrl-c nil (org-babel-execute-maybe))
  (unless org-babel-no-eval-on-ctrl-c-ctrl-c (org-babel-execute-maybe))
  org-babel-execute-safely-maybe()
  run-hook-with-args-until-success(org-babel-execute-safely-maybe)
  (cond ((or ... org-occur-highlights org-latex-fragment-image-overlays) (and ... ...) (org-remove-occur-highlights) (org-remove-latex-fragment-image-overlays) (message "Temporary highlights/overlays removed from current buffer")) ((and ... ...) (funcall org-finish-function)) ((run-hook-with-args-until-success ...)) ((or ... ...) (call-interactively ...)) ((org-on-target-p) (call-interactively ...)) ((and ... ...) (call-interactively ...)) ((org-on-heading-p) (call-interactively ...)) ((org-at-table\.el-p) (message "Use C-c ' to edit table.el tables")) ((org-at-table-p) (org-table-maybe-eval-formula) (if arg ... ...) (call-interactively ...)) ((or ... ...) (call-interactively ...)) ((org-at-item-checkbox-p) (call-interactively ...) (call-interactively ...) (org-list-send-list ...)) ((org-at-item-p) (call-interactively ...) (when arg ...) (org-list-send-list ...)) ((save-excursion ... ...) (beginning-of-line 1) (save-excursion ...)) ((save-excursion ... ...) (cond ... ...)) ((org-clock-update-time-maybe)) (t (error "C-c C-c can do nothing useful at this location")))
  (let ((org-enable-table-editor t)) (cond (... ... ... ... ...) (... ...) (...) (... ...) (... ...) (... ...) (... ...) (... ...) (... ... ... ...) (... ...) (... ... ... ...) (... ... ... ...) (... ... ...) (... ...) (...) (t ...)))
  org-ctrl-c-ctrl-c(nil)
  call-interactively(org-ctrl-c-ctrl-c nil nil)
--8<---------------cut here---------------end--------------->8---



>
> Thanks and Regards
> Noorul
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: with-parsed-tramp-file-name
  2010-09-30  8:44   ` with-parsed-tramp-file-name Dan Davison
@ 2010-09-30 13:28     ` Austin F. Frank
  2010-10-14 12:21       ` with-parsed-tramp-file-name Dan Davison
  0 siblings, 1 reply; 5+ messages in thread
From: Austin F. Frank @ 2010-09-30 13:28 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 6635 bytes --]

On Thu, Sep 30 2010, Dan Davison wrote:

> Just btw, I use Org every day at the moment (with emacs24) to execute
> code (mostly R) on remote machines. The method I use is to store all
> Org files locally, and use the :dir header argument to specify the
> machine on which to run R, e.g.

At some point I was (naively?) worried about the portability of this
kind of path.  Additionally, I do sometimes want to run things locally,
like if I'm offline.  Because a file that is opened over TRAMP usually
transparently starts processes over TRAMP, and because it's less typing,
and because of my untested portability concern, I have stuck to using
the edit-and-execute over TRAMP method, with all paths defined relative
to the edited file.

> #+babel:   :dir /davison@oak.well.ox.ac.uk:~/bench
> [...]
> #+begin_src R
> system("hostname", intern=TRUE)
> #+end_src
>
> #+results:
> : oak
>
> Do you get the same error evaluating R remotely using this method?

I do, when using the previously-reported config file.

> What's your emacs version?

GNU Emacs 24.0.50.7 (powerpc-apple-darwin8.11.0, NS apple-appkit-824.48)
of 2010-09-30

> I don't see tramp-sh in emacs23; I do see it in emacs24.

Yup, I use emacs24 built from a checkout from the git mirror of the bzr
sources.

> How about we test this simple source block:
>
> #+begin_src R
> system("hostname", intern=TRUE)
> #+end_src
>
> in a file on the remote machine opened using C-x C-f with the
> /user@machine:path/to/file syntax, with this minimal config:
>
> (add-to-list 'load-path "/PATH/TO/ess/lisp")
> (require 'ess-site)
> (add-to-list 'load-path "/PATH/TO/org-mode/lisp")
> (require 'org-install)
> (setq debug-on-error t)
> (org-babel-do-load-languages
>  'org-babel-load-languages
>  '((R . t)))
>
> I suspect part of the problem is to do with those (require tramp...)
> lines in your config. Could you try without those lines, and without
>
> (add-to-list 'tramp-remote-path 'tramp-own-remote-path)

I can try this for debugging, but I do need that configuration option
eventually.  I build R and install R packages within my home directory
on the server in question.  Without 'tramp-own-remote-path my R packages
aren't found by the R process.  Also, this

> Instead, could you try
>
> (setq org-babel-R-command "/PATH/TO/R/EXECUTABLE --slave --no-save")

is not a portable solution, as on my local machine I use
/usr/local/bin/R and on the remote machine I use ~/bin/R.  I suppose I
could setup a conditional assignment based on host name, but since I
already know 'tramp-own-remote-path works, that's my preferred option.
Also, all of the results below are unchanged when I explicitly set the
org-babel-R-command.

Results:

1.  This file, opened locally:
--8<---------------cut here---------------start------------->8---
#+begin_src emacs-lisp
(add-to-list 'load-path "/usr/local/share/emacs/site-lisp")
(require 'ess-site)
(add-to-list 'load-path (expand-file-name "~/src.remote/org-mode/lisp"))
(require 'org-install)
(setq debug-on-error t)
(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)))
#+end_src

#+results:
| (R . t) |

#+begin_src R :dir /bcs:~/
system("hostname", intern=TRUE)
#+end_src
--8<---------------cut here---------------end--------------->8---
    
Gives this backtrace:
#v+
Debugger entered--Lisp error: (void-function org-babel-temp-file)
  org-babel-temp-file("R-")
  org-babel-R-evaluate-external-process("system(\"hostname\", intern=TRUE)" value nil nil)
  org-babel-R-evaluate(nil "system(\"hostname\", intern=TRUE)" value nil nil)
  org-babel-execute:R("system(\"hostname\", intern=TRUE)\n" ((:cache . "no") (:comments . "") (:dir . "/bcs:~/") (:exports . "code") (:hlines . "no") (:noweb . "no") (:results . "replace") (:session . "none") (:shebang . "") (:tangle . "no")))
  org-babel-execute-src-block(nil ("R" "system(\"hostname\", intern=TRUE)\n" ((:cache . "no") (:comments . "") (:dir . "/bcs:~/") (:exports . "code") (:hlines . "no") (:noweb . "no") (:results . "replace") (:session . "none") (:shebang . "") (:tangle . "no")) "" nil nil 0))
  org-babel-execute-src-block-maybe()
  run-hook-with-args-until-success(org-babel-execute-src-block-maybe)
  org-ctrl-c-ctrl-c(nil)
  call-interactively(org-ctrl-c-ctrl-c nil nil)
#v-
This is also true if I explicitly set `org-babel-R-command' in the
emacs-lisp source block, as well as if I explicitly (require 'ob).  This
feels to me like it isn't even getting to the point where the TRAMP
errors could arise.

>> If I manually load ob.el by M-x load-file with Location as
>> /path/to/ob.el then C-c C-c works. But (require 'ob) is not
>> working. Am I missing something?

With the above minimal config file edited locally with a remote
execution directory, I get the same as Noruul.  The above error
disappears if I (load-file "~/src.remote/org-mode/lisp/ob.el").  I also
no longer get the TRAMP error I originally reported.

> Noruul, what does (featurep 'ob) evaluate to before you manually attempt
> the (require 'ob) ? And what goes wrong when you do the require?

(featurep 'ob) reports `t' for me, before a (require 'ob).
(fboundp #'org-babel-temp-file) and
(fboundp #'with-parsed-tramp-file-name) both return nil.  After I
explicitly load, org-babel-tempfile is defined (but this does NOT work
with just (require 'ob), as reported by Noruul).  After I (require
'tramp), (fboundp #'with-parsed-tramp-file-name) is `t'.  After I
(require 'tramp-sh), (boundp 'tramp-remote-path) is `t'.

It looks to me like there are two issues affecting my original report.

The first is that with (require 'org-install) and even with (require
'ob), certain babel-related functions aren't being exported (don't know
if that's the right term).

The second is that I _need_ to be able to add 'tramp-own-remote-path to
'tramp-remote-path, which at least on my system requires doing (require
'tramp) and (require 'tramp-sh).  That is, presumably, a TRAMP bug.

Some interaction with explicitly requiring the tramp packages and then
trying to use org-babel's remote functions seems to be messing things
up.

> If (part of) this is an issue of tramp differences between emacs23 and
> 24 then the tramp author Michael Albinus has already been extremely
> helpful on several occasions with tramp issues and I am confident he
> will be able to advise.

Thanks for all of your help already.  I'm sure we'll chase this down.

/au

-- 
Austin Frank
http://aufrank.net
GPG Public Key (D7398C2F): http://aufrank.net/personal.asc

[-- Attachment #1.2: Type: application/pgp-signature, Size: 194 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: with-parsed-tramp-file-name
  2010-09-30 13:28     ` with-parsed-tramp-file-name Austin F. Frank
@ 2010-10-14 12:21       ` Dan Davison
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Davison @ 2010-10-14 12:21 UTC (permalink / raw)
  To: Austin F. Frank; +Cc: emacs-orgmode

Hi Austin,

"Austin F. Frank" <austin.frank@gmail.com> writes:

> On Thu, Sep 30 2010, Dan Davison wrote:
>
>> Just btw, I use Org every day at the moment (with emacs24) to execute
>> code (mostly R) on remote machines. The method I use is to store all
>> Org files locally, and use the :dir header argument to specify the
>> machine on which to run R, e.g.
>
> At some point I was (naively?) worried about the portability of this
> kind of path.

What portability concerns did/do you have?

>  Additionally, I do sometimes want to run things locally,
> like if I'm offline.

With :dir that is easy: either alter the :dir header arg so that it
explicitly points to a local path, or remove it entirely and allow it to
default to default-directory. Like other babel parameters, :dir can be
set at various levels: as a header arg, in an Org property, in
a #+babel: line, in org-babel-default-header-args:LANG, or in
org-babel-default-header-args.

In fact, since babel header args can be lisp forms which are eval'd,
then a good solution may be to use an elisp variable as a flag with
which we can switch between local and remote execution (please pull, as
there was a bug preventing lisp forms being used like this in
properties):

--8<---------------cut here---------------start------------->8---
* local/remote switching
  :PROPERTIES:
  :dir: (if dan/local-p "." "/davison@oak:")
  :results: output
  :END:

src_emacs-lisp{(setq dan/local-p t)}

#+begin_src sh
hostname
pwd
#+end_src

#+results:
: Luscinia
: /home/dan

src_emacs-lisp{(setq dan/local-p nil)}

#+begin_src sh
hostname
pwd
#+end_src

#+results:
: oak
: /home/davison
--8<---------------cut here---------------end--------------->8---


Otoh aIui your workflow involves maintaining Org source files on a
remote machine, therefore it is only possible to work offline if you
have a local copy. I find it works well to keep the Org source files
locally, and only use the remote machine when necessary for execution
and access to remote data files.

>  Because a file that is opened over TRAMP usually
> transparently starts processes over TRAMP, and because it's less typing,
> and because of my untested portability concern, I have stuck to using
> the edit-and-execute over TRAMP method, with all paths defined relative
> to the edited file.

The two methods are very closely related however, and I certainly want
Babel to work correctly using both methods. The :dir method basically
does

(let ((default-directory <dir-header-arg-value>))
   ... evaluate org babel code as normal ...)

which is very similar to the effect of working with an Org file opened
via tramp on a remote machine.

>
>> #+babel:   :dir /davison@oak.well.ox.ac.uk:~/bench
>> [...]
>> #+begin_src R
>> system("hostname", intern=TRUE)
>> #+end_src
>>
>> #+results:
>> : oak
>>
>> Do you get the same error evaluating R remotely using this method?
>
> I do, when using the previously-reported config file.

Have you made any progress understanding what was going on with the
error below? I just found myself suffering from a similar error (invalid
function `with-parsed-tramp-file-name') and it turned out to be because
I had compiled the Org files yesterday. After running `make clean' it
went away. Not that that is a satisfactory solution of course.

Question: we have

(declare-function with-parsed-tramp-file-name "tramp" (filename var &rest body))

but is it correct to use declare-function on a macro? That might be the
problem?

>
>> What's your emacs version?
>
> GNU Emacs 24.0.50.7 (powerpc-apple-darwin8.11.0, NS apple-appkit-824.48)
> of 2010-09-30

I'm also using emacs24 but my git HEAD is at 55590b86 (May 18 2010)
because I find the X clipboard interaction to be broken under
ubuntu/gnome in recent emacs24 (haven't tested for a few weeks though).

Dan

>
>> I don't see tramp-sh in emacs23; I do see it in emacs24.
>
> Yup, I use emacs24 built from a checkout from the git mirror of the bzr
> sources.
>
>> How about we test this simple source block:
>>
>> #+begin_src R
>> system("hostname", intern=TRUE)
>> #+end_src
>>
>> in a file on the remote machine opened using C-x C-f with the
>> /user@machine:path/to/file syntax, with this minimal config:
>>
>> (add-to-list 'load-path "/PATH/TO/ess/lisp")
>> (require 'ess-site)
>> (add-to-list 'load-path "/PATH/TO/org-mode/lisp")
>> (require 'org-install)
>> (setq debug-on-error t)
>> (org-babel-do-load-languages
>>  'org-babel-load-languages
>>  '((R . t)))
>>
>> I suspect part of the problem is to do with those (require tramp...)
>> lines in your config. Could you try without those lines, and without
>>
>> (add-to-list 'tramp-remote-path 'tramp-own-remote-path)
>
> I can try this for debugging, but I do need that configuration option
> eventually.  I build R and install R packages within my home directory
> on the server in question.  Without 'tramp-own-remote-path my R packages
> aren't found by the R process.  Also, this
>
>> Instead, could you try
>>
>> (setq org-babel-R-command "/PATH/TO/R/EXECUTABLE --slave --no-save")
>
> is not a portable solution, as on my local machine I use
> /usr/local/bin/R and on the remote machine I use ~/bin/R.  I suppose I
> could setup a conditional assignment based on host name, but since I
> already know 'tramp-own-remote-path works, that's my preferred option.
> Also, all of the results below are unchanged when I explicitly set the
> org-babel-R-command.
>
> Results:
>
> 1.  This file, opened locally:
> #+begin_src emacs-lisp
> (add-to-list 'load-path "/usr/local/share/emacs/site-lisp")
> (require 'ess-site)
> (add-to-list 'load-path (expand-file-name "~/src.remote/org-mode/lisp"))
> (require 'org-install)
> (setq debug-on-error t)
> (org-babel-do-load-languages
>  'org-babel-load-languages
>  '((R . t)))
> #+end_src
>
> #+results:
> | (R . t) |
>
> #+begin_src R :dir /bcs:~/
> system("hostname", intern=TRUE)
> #+end_src
>     
> Gives this backtrace:
> #v+
> Debugger entered--Lisp error: (void-function org-babel-temp-file)
>   org-babel-temp-file("R-")
>   org-babel-R-evaluate-external-process("system(\"hostname\", intern=TRUE)" value nil nil)
>   org-babel-R-evaluate(nil "system(\"hostname\", intern=TRUE)" value nil nil)
>   org-babel-execute:R("system(\"hostname\", intern=TRUE)\n" ((:cache . "no") (:comments . "") (:dir . "/bcs:~/") (:exports . "code") (:hlines . "no") (:noweb . "no") (:results . "replace") (:session . "none") (:shebang . "") (:tangle . "no")))
>   org-babel-execute-src-block(nil ("R" "system(\"hostname\", intern=TRUE)\n" ((:cache . "no") (:comments . "") (:dir . "/bcs:~/") (:exports . "code") (:hlines . "no") (:noweb . "no") (:results . "replace") (:session . "none") (:shebang . "") (:tangle . "no")) "" nil nil 0))
>   org-babel-execute-src-block-maybe()
>   run-hook-with-args-until-success(org-babel-execute-src-block-maybe)
>   org-ctrl-c-ctrl-c(nil)
>   call-interactively(org-ctrl-c-ctrl-c nil nil)
> #v-
> This is also true if I explicitly set `org-babel-R-command' in the
> emacs-lisp source block, as well as if I explicitly (require 'ob).  This
> feels to me like it isn't even getting to the point where the TRAMP
> errors could arise.
>
>>> If I manually load ob.el by M-x load-file with Location as
>>> /path/to/ob.el then C-c C-c works. But (require 'ob) is not
>>> working. Am I missing something?
>
> With the above minimal config file edited locally with a remote
> execution directory, I get the same as Noruul.  The above error
> disappears if I (load-file "~/src.remote/org-mode/lisp/ob.el").  I also
> no longer get the TRAMP error I originally reported.
>
>> Noruul, what does (featurep 'ob) evaluate to before you manually attempt
>> the (require 'ob) ? And what goes wrong when you do the require?
>
> (featurep 'ob) reports `t' for me, before a (require 'ob).
> (fboundp #'org-babel-temp-file) and
> (fboundp #'with-parsed-tramp-file-name) both return nil.  After I
> explicitly load, org-babel-tempfile is defined (but this does NOT work
> with just (require 'ob), as reported by Noruul).  After I (require
> 'tramp), (fboundp #'with-parsed-tramp-file-name) is `t'.  After I
> (require 'tramp-sh), (boundp 'tramp-remote-path) is `t'.
>
> It looks to me like there are two issues affecting my original report.
>
> The first is that with (require 'org-install) and even with (require
> 'ob), certain babel-related functions aren't being exported (don't know
> if that's the right term).
>
> The second is that I _need_ to be able to add 'tramp-own-remote-path to
> 'tramp-remote-path, which at least on my system requires doing (require
> 'tramp) and (require 'tramp-sh).  That is, presumably, a TRAMP bug.
>
> Some interaction with explicitly requiring the tramp packages and then
> trying to use org-babel's remote functions seems to be messing things
> up.
>
>> If (part of) this is an issue of tramp differences between emacs23 and
>> 24 then the tramp author Michael Albinus has already been extremely
>> helpful on several occasions with tramp issues and I am confident he
>> will be able to advise.
>
> Thanks for all of your help already.  I'm sure we'll chase this down.
>
> /au

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-10-14 12:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-29 23:08 [babel] with-parsed-tramp-file-name Austin F. Frank
2010-09-30  6:52 ` with-parsed-tramp-file-name Noorul Islam K M
2010-09-30  8:44   ` with-parsed-tramp-file-name Dan Davison
2010-09-30 13:28     ` with-parsed-tramp-file-name Austin F. Frank
2010-10-14 12:21       ` with-parsed-tramp-file-name 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).