Re: [Orgmode] Re: [babel] exports, caching, remote execution

2010-09-19 Thread Eric Schulte
Hi Tom,

This turned out to be a fairly complicated issue.

During export of a narrowed region the narrowed region will be coppied
to a temporary buffer, when exporting from the buffer all buffer-wide,
and headline-wide parameters which are not included in the region are
ignored.  This results in a different set of header arguments being used
for interactive evaluation than were used for export evaluation.  These
differences in header arguments then invalidate the cache saved during
the interactive evaluation.

I've just put together and pushed a fix which involves jumping back to
the original org file to collect header arguments in context during
export.  This appears to resolve the issue (at least for me).  Please
let me know if it works for you.

Best -- Eric

Tom Short tsh...@epri.com writes:

 Eric Schulte schulte.eric at gmail.com writes:

 
 Hi Austin,
 
 Austin Frank austin.frank at gmail.com writes:
 
  Hey all--
 
  Two (hopefully quick) questions:
 
  1) Does the exporter respect the :cache argument?  When I evaluate a
 buffer, I can tell that cached blocks are not re-run, as expected.
 When I export to \LaTeX or PDF, it seems that all blocks in the file
 are re-run.  Is there a way to force the exporter to respect caching?
 
 
 I believe the exporter does respect caching, the following minimal
 example worked (i.e. was not re-run) for me on export to html.  Could
 you provide an example that demonstrates the problem?

 Eric, here's an example where the exporter does not respect caching. - Tom

 #+BABEL: :session *R* :results output :exports both :cache yes

 * A test of caching

 #+begin_src R 
   cat(random result:, runif(1), \n)
   Sys.sleep(2)
   alarm()
 #+end_src 

 #+results[b2549fac8a1ec2923ae289d47ce55fb2853dd1de]:
 : random result: 0.2799064

 #+begin_src R 
   cat(random result:, runif(1), \n)
   Sys.sleep(2)
   alarm()
 #+end_src 

 #+results[b2549fac8a1ec2923ae289d47ce55fb2853dd1de]:
 : random result: 0.1625634

 ** cache on export
 do we export cached blocks

 #+begin_src emacs-lisp :cache yes :exports results
   (random)
 #+end_src

 #+results[46632b4fe2e3a23e847953c95adcba58c270b381]:
 : 490528137




 ___
 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

___
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


Re: [Orgmode] Re: [babel] exports, caching, remote execution

2010-08-25 Thread Eric Schulte
Hi Tom,

Thanks for pointing this out.  It appears that during export the code
block is evaluated in an altered version of the original buffer in which
(for some reason) Babel is sometimes not able to find properties which
are tucked away in either a #+Babel: line at the top of the file, or as
properties of an enclosing headline level.

This certainly merits a closer investigation, and has been recorded as a
bug.  Most likely it will require picking apart the subtleties of the
actions taken by the exporter.

Thanks -- Eric

Tom Short tsh...@epri.com writes:

 Eric Schulte schulte.eric at gmail.com writes:

 
 Hi Austin,
 
 Austin Frank austin.frank at gmail.com writes:
 
  Hey all--
 
  Two (hopefully quick) questions:
 
  1) Does the exporter respect the :cache argument?  When I evaluate a
 buffer, I can tell that cached blocks are not re-run, as expected.
 When I export to \LaTeX or PDF, it seems that all blocks in the file
 are re-run.  Is there a way to force the exporter to respect caching?
 
 
 I believe the exporter does respect caching, the following minimal
 example worked (i.e. was not re-run) for me on export to html.  Could
 you provide an example that demonstrates the problem?

 Eric, here's an example where the exporter does not respect caching. - Tom

 #+BABEL: :session *R* :results output :exports both :cache yes

 * A test of caching

 #+begin_src R 
   cat(random result:, runif(1), \n)
   Sys.sleep(2)
   alarm()
 #+end_src 

 #+results[b2549fac8a1ec2923ae289d47ce55fb2853dd1de]:
 : random result: 0.2799064

 #+begin_src R 
   cat(random result:, runif(1), \n)
   Sys.sleep(2)
   alarm()
 #+end_src 

 #+results[b2549fac8a1ec2923ae289d47ce55fb2853dd1de]:
 : random result: 0.1625634

 ** cache on export
 do we export cached blocks

 #+begin_src emacs-lisp :cache yes :exports results
   (random)
 #+end_src

 #+results[46632b4fe2e3a23e847953c95adcba58c270b381]:
 : 490528137




 ___
 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

___
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


[Orgmode] Re: [babel] exports, caching, remote execution

2010-08-19 Thread Tom Short
Eric Schulte schulte.eric at gmail.com writes:

 
 Hi Austin,
 
 Austin Frank austin.frank at gmail.com writes:
 
  Hey all--
 
  Two (hopefully quick) questions:
 
  1) Does the exporter respect the :cache argument?  When I evaluate a
 buffer, I can tell that cached blocks are not re-run, as expected.
 When I export to \LaTeX or PDF, it seems that all blocks in the file
 are re-run.  Is there a way to force the exporter to respect caching?
 
 
 I believe the exporter does respect caching, the following minimal
 example worked (i.e. was not re-run) for me on export to html.  Could
 you provide an example that demonstrates the problem?

Eric, here's an example where the exporter does not respect caching. - Tom

#+BABEL: :session *R* :results output :exports both :cache yes

* A test of caching

#+begin_src R 
  cat(random result:, runif(1), \n)
  Sys.sleep(2)
  alarm()
#+end_src 

#+results[b2549fac8a1ec2923ae289d47ce55fb2853dd1de]:
: random result: 0.2799064

#+begin_src R 
  cat(random result:, runif(1), \n)
  Sys.sleep(2)
  alarm()
#+end_src 

#+results[b2549fac8a1ec2923ae289d47ce55fb2853dd1de]:
: random result: 0.1625634

** cache on export
do we export cached blocks

#+begin_src emacs-lisp :cache yes :exports results
  (random)
#+end_src

#+results[46632b4fe2e3a23e847953c95adcba58c270b381]:
: 490528137




___
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


[Orgmode] Re: [babel] exports, caching, remote execution

2010-06-17 Thread Austin Frank
Eric--

Thanks for the reply.

On Thu, Jun 17 2010, Eric Schulte wrote:

 I believe the exporter does respect caching, the following minimal
 example worked (i.e. was not re-run) for me on export to html.  Could
 you provide an example that demonstrates the problem?

Yes, I'll keep an eye on this and try to narrow it down to an example if
I can.

 Not that I'm currently aware of.  Dan has handled most of the remote
 execution work so he may know more than me in this regard.

And thanks to him for that!  I tipped him off to using TRAMP with ESS,
and he took it and ran further than I ever hoped!

 Is scpc in the line above a transport protocol?

Yes, it is scp over an existing ssh connection.  The following org-style
link goes to the relevant info page.

[[info:tramp:External%20methods][info:tramp:External methods]]

 Maybe this should be an org-mode wide features, i.e. the ability to
 resolve remote file references with C-c C-o and on export.  Does that
 sound reasonable, and would it take care of the need in this
 particular case?

C-c C-o actually works!  I was extremely encouraged to see this, and it
got my hopes up for export =)

If remote file references could be resolved during export, that would be
ideal.

 A block like the following may be an acceptable workaround in the near
 term (notice I named your block above).

 #+begin_src sh :file test.png :var remote=rplot :exports results
   scp $remote ./test.png
 #+end_src

Nice suggestions, I'll try it later today.

Thanks,
/au

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


pgpUhoMm4Ichl.pgp
Description: PGP signature
___
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