From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Baum Subject: How to pass a block of text to a code block as data? Date: Fri, 8 Feb 2013 12:06:32 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d0444ea7dc1ec6504d5399441 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:47514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3rPG-0005J0-WE for emacs-orgmode@gnu.org; Fri, 08 Feb 2013 12:06:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U3rPF-0004kv-Ki for emacs-orgmode@gnu.org; Fri, 08 Feb 2013 12:06:34 -0500 Received: from mail-oa0-f51.google.com ([209.85.219.51]:63697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3rPF-0004kk-FC for emacs-orgmode@gnu.org; Fri, 08 Feb 2013 12:06:33 -0500 Received: by mail-oa0-f51.google.com with SMTP id h2so4285322oag.10 for ; Fri, 08 Feb 2013 09:06:32 -0800 (PST) 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: emacs-orgmode@gnu.org --f46d0444ea7dc1ec6504d5399441 Content-Type: text/plain; charset=ISO-8859-1 I haven't been able to figure this out from the org-mode documents yet. What I would like to do is have a source code block in python or perl or something similar. to which I can pass a reference to several lines of text that the source code block, when evaluated, would then act on. Which would involve iterating through the data text one line at a time and writing the output to a buffer. The text data could be indicated by a specific headline or a named block of some sort or maybe an internal link, I'm not particularly fussy just so there's a mechanism to do this. Would appreciate any guidance. -- ==================================== Michael Baum --f46d0444ea7dc1ec6504d5399441 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I haven't been able to figure this out from the org-mode documents yet.= What I would like to do is have a source code block in python or perl or s= omething similar. to which I can pass a reference to several lines of text = that the source code block, when evaluated, would then act on. Which would = involve iterating through the data text one line at a time and writing the = output to a buffer.

The text data could be indicated by a specific headline or a named bloc= k of some sort or maybe an internal link, I'm not particularly fussy ju= st so there's a mechanism to do this.

Would appreciate any guida= nce.

--
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Michael Baum <maabaum@gmail.com>

--f46d0444ea7dc1ec6504d5399441-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: How to pass a block of text to a code block as data? Date: Fri, 08 Feb 2013 21:17:32 +0100 Message-ID: <8638x6y2zn.fsf@somewhere.org> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: 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-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Michael, Michael Baum wrote: > I haven't been able to figure this out from the org-mode documents yet. > What I would like to do is have a source code block in python or perl or > something similar. to which I can pass a reference to several lines of text > that the source code block, when evaluated, would then act on. Which would > involve iterating through the data text one line at a time and writing the > output to a buffer. > > The text data could be indicated by a specific headline or a named block of > some sort or maybe an internal link, I'm not particularly fussy just so > there's a mechanism to do this. > > Would appreciate any guidance. #+name: lines-of-text : I haven't been able to figure this out from the org-mode documents yet. : What I would like to do is have a source code block in python or perl or : something similar. to which I can pass a reference to several lines of text : that the source code block, when evaluated, would then act on. Which would : involve iterating through the data text one line at a time and writing the : output to a buffer. #+begin_src sh :stdin lines-of-text :results output grep would #+end_src #+results: #+begin_example What I would like to do is have a source code block in python or perl or that the source code block, when evaluated, would then act on. Which would #+end_example Best regards, Seb -- Sebastien Vauban From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Baum Subject: Re: How to pass a block of text to a code block as data? Date: Fri, 8 Feb 2013 21:59:20 -0500 Message-ID: References: <8638x6y2zn.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d044519d9c821bb04d541dcbe Return-path: Received: from eggs.gnu.org ([208.118.235.92]:49582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U40ew-0005sq-VZ for emacs-orgmode@gnu.org; Fri, 08 Feb 2013 21:59:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U40ev-0002kw-Gn for emacs-orgmode@gnu.org; Fri, 08 Feb 2013 21:59:22 -0500 Received: from mail-ob0-f179.google.com ([209.85.214.179]:47165) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U40ev-0002ko-9s for emacs-orgmode@gnu.org; Fri, 08 Feb 2013 21:59:21 -0500 Received: by mail-ob0-f179.google.com with SMTP id un3so4592262obb.10 for ; Fri, 08 Feb 2013 18:59:20 -0800 (PST) In-Reply-To: <8638x6y2zn.fsf@somewhere.org> 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: Sebastien Vauban Cc: emacs-orgmode@gnu.org --f46d044519d9c821bb04d541dcbe Content-Type: text/plain; charset=ISO-8859-1 Sebastien: Thanks! That helps a lot. I'm having trouble extending your example, however. A couple of questions -- - What signals the end of the block of text to be used as data? I take it that it's important that these all be comment lines staring with a colon after the #+name label? Is there a way to do the same thing with a begin and end block construction? - In this line: #+begin_src sh :stdin lines-of-text :results output does the flag :stdin mean that the following named block literally becomes the STDIN stream for the code block? If I replace your shell/grep example with this: #+begin_src perl :stdin lines-of-text :results output while (<>) { print $_; } #+end_src ...it doesn't work, although as far as I know that perl code snippet should in fact simply print out the incoming lines from stdin. Thanks again, Michael On Fri, Feb 8, 2013 at 3:17 PM, Sebastien Vauban wrote: > Hi Michael, > > Michael Baum wrote: > > I haven't been able to figure this out from the org-mode documents yet. > > What I would like to do is have a source code block in python or perl or > > something similar. to which I can pass a reference to several lines of > text > > that the source code block, when evaluated, would then act on. Which > would > > involve iterating through the data text one line at a time and writing > the > > output to a buffer. > > > > The text data could be indicated by a specific headline or a named block > of > > some sort or maybe an internal link, I'm not particularly fussy just so > > there's a mechanism to do this. > > > > Would appreciate any guidance. > > #+name: lines-of-text > : I haven't been able to figure this out from the org-mode documents yet. > : What I would like to do is have a source code block in python or perl or > : something similar. to which I can pass a reference to several lines of > text > : that the source code block, when evaluated, would then act on. Which > would > : involve iterating through the data text one line at a time and writing > the > : output to a buffer. > > #+begin_src sh :stdin lines-of-text :results output > grep would > #+end_src > > #+results: > #+begin_example > What I would like to do is have a source code block in python or perl or > that the source code block, when evaluated, would then act on. Which would > #+end_example > > Best regards, > Seb > > -- > Sebastien Vauban > > > -- ==================================== Michael Baum You should never have your best trousers on when you go out to fight for freedom and truth. - Ibsen --f46d044519d9c821bb04d541dcbe Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sebastien:

Thanks! That helps a lot. I'm having trouble extendin= g your example, however. A couple of questions --

- What signals the= end of the block of text to be used as data? I take it that it's impor= tant that these all be comment lines staring with a colon after the #+name = label? Is there a way to do the same thing with a begin and end block const= ruction?

- In this line:
=A0=A0=A0=A0=A0=A0 #+begin_src sh :stdin lines-of-te= xt :results output

does the flag :stdin mean that the following name= d block literally becomes the STDIN stream for the code block? If I replace= your shell/grep example with this:

#+begin_src perl :stdin lines-of-text :results output
while (<>= ;) {
=A0=A0 print $_;
}
#+end_src

...it doesn't work, a= lthough as far as I know that perl code snippet should in fact simply print= out the incoming lines from stdin.

Thanks again,

Michael

On Fri, = Feb 8, 2013 at 3:17 PM, Sebastien Vauban <wxhgmqzgwmuf@spammotel.= com> wrote:
Hi Michael,

Michael Baum wrote:
> I haven't been able to figure this out from the org-mode documents= yet.
> What I would like to do is have a source code block in python or perl = or
> something similar. to which I can pass a reference to several lines of= text
> that the source code block, when evaluated, would then act on. Which w= ould
> involve iterating through the data text one line at a time and writing= the
> output to a buffer.
>
> The text data could be indicated by a specific headline or a named blo= ck of
> some sort or maybe an internal link, I'm not particularly fussy ju= st so
> there's a mechanism to do this.
>
> Would appreciate any guidance.

#+name: lines-of-text
: I haven't been able to figure this out from the org-mode documents ye= t.
: What I would like to do is have a source code block in = python or perl or
: something similar. to which I can pass a reference to several lines of te= xt
: that the source code block, when evaluated, would then act on. Which woul= d
: involve iterating through the data text one line at a time and writing th= e
: output to a buffer.

#+begin_src sh :stdin lines-of-text :results output
=A0 grep would
#+end_src

#+results:
#+begin_example
What I would like to do is have a source code block in py= thon or perl or
that the source code block, when evaluated, would t= hen act on. Which would
#+end_example

Best regards,
=A0 Seb

--
Sebastien Vauban





--
=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D
Michael Baum <maabaum@gmail.com>

You should never have your best tro= users on when you go out
=A0to fight for freedom and truth. - Ibsen --f46d044519d9c821bb04d541dcbe-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sean O'Halpin" Subject: Re: How to pass a block of text to a code block as data? Date: Sat, 9 Feb 2013 18:49:26 +0000 Message-ID: References: <8638x6y2zn.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:35076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4FUO-0007j8-OZ for emacs-orgmode@gnu.org; Sat, 09 Feb 2013 13:49:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U4FUN-0007Dl-Nh for emacs-orgmode@gnu.org; Sat, 09 Feb 2013 13:49:28 -0500 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:55798) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4FUN-0007Dg-Ea for emacs-orgmode@gnu.org; Sat, 09 Feb 2013 13:49:27 -0500 Received: by mail-wi0-f170.google.com with SMTP id hm11so2058010wib.1 for ; Sat, 09 Feb 2013 10:49:26 -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: Michael Baum Cc: Sebastien Vauban , emacs-orgmode@gnu.org On Sat, Feb 9, 2013 at 2:59 AM, Michael Baum wrote: > > - What signals the end of the block of text to be used as data? I take it > that it's important that these all be comment lines staring with a colon > after the #+name label? Is there a way to do the same thing with a begin and > end block construction? > > - In this line: > > #+begin_src sh :stdin lines-of-text :results output > > does the flag :stdin mean that the following named block literally becomes > the STDIN stream for the code block? If I replace your shell/grep example > with this: > > #+begin_src perl :stdin lines-of-text :results output > while (<>) { > print $_; > } > #+end_src > > ...it doesn't work, although as far as I know that perl code snippet should > in fact simply print out the incoming lines from stdin. > > Thanks again, > > Michael Hi, The :stdin option is only defined for shell and awk AFAIK. (Might be an idea to add to other languages..) You can pass in a variable referring to the block of text, as shown below (example for ruby but should work for perl): #+begin_src org #+name: more-lines-of-text #+begin_example What signals the end of the block of text to be used as data? I take it that it's important that these all be comment lines staring with a colon after the #+name label? Is there a way to do the same thing with a begin and end block construction? #+end_example #+begin_src ruby :var lines=more-lines-of-text :results output puts lines.reverse #+end_src #+RESULTS: : ?noitcurtsnoc kcolb dne dna nigeb a : htiw gniht emas eht od ot yaw a ereht sI ?lebal eman+# eht retfa noloc : a htiw gnirats senil tnemmoc eb lla eseht taht tnatropmi s'ti taht ti : ekat I ?atad sa desu eb ot txet fo kcolb eht fo dne eht slangis tahW #+end_src Regards, Sean From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Baum Subject: Re: How to pass a block of text to a code block as data? Date: Mon, 11 Feb 2013 16:49:11 -0500 Message-ID: References: <8638x6y2zn.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0115f3be21c3bd04d579e18c Return-path: Received: from eggs.gnu.org ([208.118.235.92]:53436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U51FT-0000ya-Ft for emacs-orgmode@gnu.org; Mon, 11 Feb 2013 16:49:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U51FQ-0007G6-UQ for emacs-orgmode@gnu.org; Mon, 11 Feb 2013 16:49:15 -0500 Received: from mail-vc0-f181.google.com ([209.85.220.181]:58366) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U51FQ-0007Fd-KG for emacs-orgmode@gnu.org; Mon, 11 Feb 2013 16:49:12 -0500 Received: by mail-vc0-f181.google.com with SMTP id d16so4055144vcd.26 for ; Mon, 11 Feb 2013 13:49:11 -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: Sean O'Halpin Cc: Sebastien Vauban , emacs-orgmode@gnu.org --089e0115f3be21c3bd04d579e18c Content-Type: text/plain; charset=ISO-8859-1 Sean, that helps too, thank you. Now that you and Sebastien have gone to all this trouble I found the part of the manual that sort of describes this, but I clearly didn't understand it before. Possible needs a more worked-out example for the slow among us, like self. I've noticed one curious thing in trying a perl example. See first: ---------------------8<---------------------------------- #+name: wake #+BEGIN_EXAMPLE riverrun, past Eve and Adam's, from swerve of shore to bend of bay, brings us by a commodius vicus of recirculation back to Howth Castle and Environs. Sir Tristram, violer d'amores, fr'over the short sea, had passen- core rearrived from North Armorica on this side the scraggy isthmus of Europe Minor to wielderfight his penisolate war: nor had topsawyer's rocks by the stream Oconee exaggerated themselse to Laurens County's gorgios while they went doublin their mumper all the time: nor avoice from afire bellowsed mishe mishe to #+END_EXAMPLE #+begin_src perl :var inlines=wake :results output foreach $aln (split(/$/,$inlines)) { print $aln; } #+end_src #+results: : riverrun, past Eve and Adam's, from swerve of shore to bend : of bay, brings us by a commodius vicus of recirculation back to : Howth Castle and Environs. : Sir Tristram, violer d'amores, fr'over the short sea, had passen- : core rearrived from North Armorica on this side the scraggy : isthmus of Europe Minor to wielderfight his penisolate war: nor : had topsawyer's rocks by the stream Oconee exaggerated themselse : to Laurens County's gorgios while they went doublin their mumper : all the time: nor avoice from afire bellowsed mishe mishe to ---------------------8<---------------------------------- and then a more complicated block that's closer to my real task: ---------------------8<---------------------------------- #+NAME: job2 #+BEGIN_EXAMPLE !START !ID:7655 !DATE:02/10/2013 !CLOSE:03/15/2013 !UNTILFILLED: !POSITION:Science Editor !COMPANY:East Newark Times Herald News and World Defender !BEGIN-DESCRIPTION Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. !END-DESCRIPTION !BEGIN-SPECIAL Duis eget lorem ac odio lobortis suscipit nec et neque. Sed at quam ut mauris scelerisque congue id eget dui. Quisque tellus lectus, tristique eu posuere in, faucibus vitae urna. Duis vitae orci purus, quis euismod augue. !END-SPECIAL !SALARY:16.67 per hour !BEGIN-CONTACT Please submit online at http://enthnawd.org/jobs !END-CONTACT !END #+END_EXAMPLE #+begin_src perl :var inlines=job2 :results output foreach $aln (split(/$/,$inlines)) { print $aln; } #+end_src #+results: #+begin_example !START !ID:7655 !DATE:02/10/2013 !CLOSE:03/15/2013 !UNTILFILLED: !POSITION:Science Editor !COMPANY:East Newark Times Herald News and World Defender !BEGIN-DESCRIPTION Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. !END-DESCRIPTION !BEGIN-SPECIAL Duis eget lorem ac odio lobortis suscipit nec et neque. Sed at quam ut mauris scelerisque congue id eget dui. Quisque tellus lectus, tristique eu posuere in, faucibus vitae urna. Duis vitae orci purus, quis euismod augue. !END-SPECIAL !SALARY:16.67 per hour !BEGIN-CONTACT Please submit online at http://enthnawd.org/jobs !END-CONTACT !END #+end_example ---------------------8<---------------------------------- NOTICE THAT while both return the result as Example text, the first simple prepends each line with a colon, simple Example form, and the second wraps the result in an Example block without altering the lines. Not sure why? Is this just a function of the number of lines of the text? Michael -- ==================================== Michael Baum You should never have your best trousers on when you go out to fight for freedom and truth. - Ibsen --089e0115f3be21c3bd04d579e18c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sean, that helps too, thank you. Now that you and Sebastien have gone to al= l this trouble I found the part of the manual that sort of describes this, = but I clearly didn't understand it before. Possible needs a more worked= -out example for the slow among us, like self.

I've noticed one curious thing in trying a perl example. See first:=

---------------------8<----------------------------------
#+n= ame: wake
#+BEGIN_EXAMPLE
=A0=A0=A0 riverrun, past Eve and Adam's= , from swerve of shore to bend
of bay, brings us by a commodius vicus of recirculation back to
Howth Ca= stle and Environs.
=A0=A0=A0 Sir Tristram, violer d'amores, fr'o= ver the short sea, had passen-
core rearrived from North Armorica on thi= s side the scraggy
isthmus of Europe Minor to wielderfight his penisolate war: nor
had tops= awyer's rocks by the stream Oconee exaggerated themselse
to Laurens = County's gorgios while they went doublin their mumper
all the time: = nor avoice from afire bellowsed mishe mishe to
#+END_EXAMPLE

#+begin_src perl :var inlines=3Dwake :results output=A0 foreach $aln (split(/$/,$inlines)) {
=A0=A0=A0=A0=A0=A0 print $aln= ;
=A0 }
#+end_src


#+results:
: riverrun, past Eve and A= dam's, from swerve of shore to bend
: of bay, brings us by a commodius vicus of recirculation back to
: Howt= h Castle and Environs.
:=A0=A0=A0=A0 Sir Tristram, violer d'amores, = fr'over the short sea, had passen-
: core rearrived from North Armor= ica on this side the scraggy
: isthmus of Europe Minor to wielderfight his penisolate war: nor
: had = topsawyer's rocks by the stream Oconee exaggerated themselse
: to La= urens County's gorgios while they went doublin their mumper
: all th= e time: nor avoice from afire bellowsed mishe mishe to

---------------------8<----------------------------------

and= then a more complicated block that's closer to my real task:

--= -------------------8<----------------------------------

#+NAME: j= ob2
#+BEGIN_EXAMPLE
!START
!ID:7655
!DATE:02/10/2013
!CLOSE:03/15/2= 013
!UNTILFILLED:
!POSITION:Science Editor
!COMPANY:East Newark Ti= mes Herald News and World Defender
!BEGIN-DESCRIPTION
Lorem ipsum dol= or sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod ti= ncidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad mini= m veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut = aliquip ex ea commodo consequat.

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse mo= lestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros = et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril del= enit augue duis dolore te feugait nulla facilisi.

!END-DESCRIPTION
!BEGIN-SPECIAL
Duis eget lorem ac odio lobortis = suscipit nec et neque. Sed at quam ut mauris scelerisque congue id eget dui= . Quisque tellus lectus, tristique eu posuere in, faucibus vitae urna. Duis= vitae orci purus, quis euismod augue.
!END-SPECIAL
!SALARY:16.67 per hour
!BEGIN-CONTACT
Please submit o= nline at=A0 http://e= nthnawd.org/jobs
!END-CONTACT
!END
#+END_EXAMPLE


#+= begin_src perl :var inlines=3Djob2 :results output
=A0 foreach $aln (split(/$/,$inlines)) {
=A0=A0=A0=A0=A0=A0 print $aln;<= br>=A0 }
#+end_src

#+results:
#+begin_example
!START
!ID= :7655
!DATE:02/10/2013
!CLOSE:03/15/2013
!UNTILFILLED:
!POSITIO= N:Science Editor
!COMPANY:East Newark Times Herald News and World Defender
!BEGIN-DESCRIP= TION
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam = nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpa= t. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper sus= cipit lobortis nisl ut aliquip ex ea commodo consequat.

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse mo= lestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros = et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril del= enit augue duis dolore te feugait nulla facilisi.

!END-DESCRIPTION
!BEGIN-SPECIAL
Duis eget lorem ac odio lobortis = suscipit nec et neque. Sed at quam ut mauris scelerisque congue id eget dui= . Quisque tellus lectus, tristique eu posuere in, faucibus vitae urna. Duis= vitae orci purus, quis euismod augue.
!END-SPECIAL
!SALARY:16.67 per hour
!BEGIN-CONTACT
Please submit o= nline at=A0 http://e= nthnawd.org/jobs
!END-CONTACT
!END
#+end_example

------= ---------------8<----------------------------------

NOTICE THAT while both return the result as Example text, the first sim= ple prepends each line with a colon, simple Example form, and the second wr= aps the result in an Example block without altering the lines.

Not sure why? Is this just a function of the number of lines of the text?
Michael


--
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D
Michael Baum <maabaum@gmail.com>

You should never have your best trouse= rs on when you go out
=A0to fight for freedom and truth. - Ibsen --089e0115f3be21c3bd04d579e18c-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: How to pass a block of text to a code block as data? Date: Mon, 11 Feb 2013 15:07:02 -0700 Message-ID: <8738x25wu1.fsf@gmail.com> References: <8638x6y2zn.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:57748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U51Ww-0005Mt-NX for emacs-orgmode@gnu.org; Mon, 11 Feb 2013 17:07:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U51Wu-0004l4-Vq for emacs-orgmode@gnu.org; Mon, 11 Feb 2013 17:07:18 -0500 Received: from mail-da0-f48.google.com ([209.85.210.48]:61866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U51Wu-0004l0-Of for emacs-orgmode@gnu.org; Mon, 11 Feb 2013 17:07:16 -0500 Received: by mail-da0-f48.google.com with SMTP id v40so2873875dad.35 for ; Mon, 11 Feb 2013 14:07:15 -0800 (PST) In-Reply-To: (Michael Baum's message of "Mon, 11 Feb 2013 16:49:11 -0500") 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: Michael Baum Cc: Sebastien Vauban , emacs-orgmode@gnu.org Michael Baum writes: > Sean, that helps too, thank you. Now that you and Sebastien have gone to > all this trouble I found the part of the manual that sort of describes > this, but I clearly didn't understand it before. Possible needs a more > worked-out example for the slow among us, like self. > Patches are welcome, especially documentation patches. [...] > > NOTICE THAT while both return the result as Example text, the first simple > prepends each line with a colon, simple Example form, and the second wraps > the result in an Example block without altering the lines. > > Not sure why? Is this just a function of the number of lines of the text? > Yes, this is a function of the number of lines in the output text. You can control where this switch is made by changing the value of org-babel-min-lines-for-block-output. Best, -- Eric Schulte http://cs.unm.edu/~eschulte