From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: Generate BEGIN_EXAMPLE block dynamically during export Date: Tue, 16 Feb 2016 18:10:11 -0500 Message-ID: References: <87mvr0nvc8.fsf@alphaville.usersys.redhat.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113dc57e98f425052beb3eca Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVolg-0008LO-Eb for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 18:10:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVolf-00036q-Ke for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 18:10:52 -0500 Received: from mail-io0-x22d.google.com ([2607:f8b0:4001:c06::22d]:35962) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVolf-00036m-FN for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 18:10:51 -0500 Received: by mail-io0-x22d.google.com with SMTP id l127so5909991iof.3 for ; Tue, 16 Feb 2016 15:10:51 -0800 (PST) In-Reply-To: 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nick Dokos Cc: emacs-org list --001a113dc57e98f425052beb3eca Content-Type: text/plain; charset=UTF-8 This seems to work from my brief testing: #+AUTHOR: #+OPTIONS: toc:nil #+PROPERTY: header-args:emacs-lisp :var tar-file="bar.tar.gz" :exports none #+NAME: tar-eg #+BEGIN_SRC emacs-lisp (let ((contents (format "> tar xzvf %s" tar-file))) (with-temp-buffer (insert contents) (write-file "results.txt")) contents) #+END_SRC #+CALL: tar-eg() :wrap example :exports results --001a113dc57e98f425052beb3eca Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
This seems to work from my brie= f testing:

#+AUTHOR:
<= div class=3D"gmail_extra">#+OPTIONS: toc:nil
#+PROPERTY: header-args:emacs-lisp :var tar-file=3D"bar.tar.gz"= :exports none

#+NAME: tar-eg
#+BEGIN_SRC emacs-l= isp
=C2=A0 (let ((contents (format "&g= t; tar xzvf %s" tar-file)))
=C2=A0 =C2= =A0 (with-temp-buffer
=C2=A0 =C2=A0 =C2=A0 = (insert contents)
=C2=A0 =C2=A0 =C2=A0 (wri= te-file "results.txt"))
=C2=A0 = =C2=A0 contents)
#+END_SRC

#+CALL: tar-eg() :wra= p example :exports results

=
--001a113dc57e98f425052beb3eca--