From mboxrd@z Thu Jan 1 00:00:00 1970 From: "David A. Gershman" Subject: Re: Babel Export - Getting asked for coding system Date: Thu, 22 Sep 2016 10:14:50 -0700 Message-ID: <8E534C8D-EE51-4246-9A11-771732C9CC47@dagertech.net> References: <9F1773D8-071F-46E8-B2A5-15AF83E89A95@dagertech.net> <87wpi3q5wa.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn7cW-0008V8-NQ for emacs-orgmode@gnu.org; Thu, 22 Sep 2016 13:17:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn7cS-0000BK-FU for emacs-orgmode@gnu.org; Thu, 22 Sep 2016 13:17:11 -0400 Received: from dagertech.net ([64.183.98.170]:49006 helo=mail.dagertech.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn7cS-0000B2-9Y for emacs-orgmode@gnu.org; Thu, 22 Sep 2016 13:17:08 -0400 Received: from [100.108.177.57] (61.sub-70-197-97.myvzw.com [70.197.97.61]) (using TLSv1.2 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.dagertech.net (Postfix) with ESMTPSA id 15A99A0461 for ; Thu, 22 Sep 2016 10:17:07 -0700 (PDT) In-Reply-To: <87wpi3q5wa.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Thank you for the explanation. It turns out I did find a work-around whi= ch is exactly what you mentioned. The only difference is instead of spec= ifying the file name twice, I was able to get it only once and use the 'f= ile' option to :results: #+BEGIN_SRC perl :results output file :exports results :var fname=3Dimage= .png use GD; my $image =3D 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 s= pecify the filename once, and Org will still create a link for the result= s section: #+RESULTS: [[file:image.png]] Thanks again for your help and info! --dag On September 22, 2016 9:02:45 AM PDT, Aaron Ecay wr= ote: >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). --=20 David A. Gershman, CISSP dagershman@dagertech.net