emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Babel Export - Getting asked for coding system


From: David A. Gershman
Subject: Re: [O] Babel Export - Getting asked for coding system
Date: Thu, 22 Sep 2016 10:14:50 -0700

Thank you for the explanation.  It turns out I did find a work-around which is 
exactly what you mentioned.  The only difference is instead of specifying the 
file name twice, I was able to get it only once and use the 'file' option to 
:results:

#+BEGIN_SRC perl :results output file :exports results :var fname=image.png
  use GD;
  my $image = build_pic();
  open( F, ">$fname" );
  binmode F
  print F $image;
  close( F );
  print $fname;
#+END_SRC

As you say, this uses Perl to output the file but with the 'file' option to 
":results", Org expects a filename as the output result, I only need specify 
the filename once, and Org will still create a link for the results section:

#+RESULTS:
[[file:image.png]]

Thanks again for your help and info!

--dag

On September 22, 2016 9:02:45 AM PDT, Aaron Ecay <address@hidden> wrote:
>Hi David,
>
>The way you have this code set up, perl will print a string to its
>stdout.  Emacs will read that string into a buffer, then write it to a
>file.
>
>It would be simpler to write the file directly from perl.  Note that
>this will require specifying the file name twice (in the :file header
>and in the perl code).  This is because ob-perl does not support the
>:results graphics syntax (which could be classed as a wishlist-type
>bug).

-- 
David A. Gershman, CISSP
address@hidden



reply via email to

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