From mboxrd@z Thu Jan 1 00:00:00 1970 From: chris.m.malone@gmail.com Subject: Re: Re: Illiterate programming question Date: Wed, 30 Mar 2011 22:38:47 +0000 Message-ID: References: <4D93A425.9070604@sift.info> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e0cb4e887a4d0c8bdb049fbad728 Return-path: Received: from [140.186.70.92] (port=53922 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q542M-0002rX-9P for emacs-orgmode@gnu.org; Wed, 30 Mar 2011 18:38:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q542K-00049b-QL for emacs-orgmode@gnu.org; Wed, 30 Mar 2011 18:38:50 -0400 Received: from mail-gx0-f199.google.com ([209.85.161.199]:38340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q542K-00049P-Id for emacs-orgmode@gnu.org; Wed, 30 Mar 2011 18:38:48 -0400 Received: by gxk5 with SMTP id 5so1048761gxk.6 for ; Wed, 30 Mar 2011 15:38:48 -0700 (PDT) In-Reply-To: <4D93A425.9070604@sift.info> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Robert Goldman Cc: nicholas.dokos@hp.com, Org Mode --e0cb4e887a4d0c8bdb049fbad728 Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes You could probably hack something up with a shell source code block that uses sed to find and display text between two delimiters, and then dump the results to the org-mode file. On Mar 30, 2011 5:44pm, Robert Goldman wrote: > On 3/30/11 Mar 30 -4:33 PM, Nick Dokos wrote: > > Robert Goldman rpgoldman@sift.info> wrote: > > > >> I would like to do the opposite of literate programming (hence the > >> subject line!): > >> > >> I would like to pull into my org file snippets from a code file. I know > >> that org-mode will let me import /entire/ source code files. Is there > >> some way to say "Import the region of this file between these two > >> delimiters?" > >> > >> If not, do you think it would be hard to add this feature? I already > >> have the snappy name, after all! > >> > > > > I don't really understand: can't you cut and paste? > Yes, but if I cut and paste the text of the code that I am describing > may change out from under my text. If I import the code, it stays in > sync (at least when the document is exported). > Honestly, I was tempted to do the literate programming thing with babel, > but was concerned that it might not work well as a multiple-author thing > (I would be writing the document, but someone else might be modifying > the code and might find org-babel confusing). > > > > And what do you mean that "org-mode will let me import /entire/ source > code > > files"? Is this a facility other than insert-file? Or are you talking > about > > the #+INCLUDE mechanism? > Yes, I was talking about #+INCLUDE. I was really wondering if there > mightn't be something like > #+INCLUDE ~/myfile.lisp :from "(defun sample-function" :to "; end > sample-function" > [sorry --- that's word-wrapped to further obscurity.] > cheers, > r --e0cb4e887a4d0c8bdb049fbad728 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable You could probably hack something up with a shell source code block that us= es sed to find and display text between two delimiters, and then dump the r= esults to the org-mode file.

On Mar 30, 2011 5:44pm, Robert Gold= man <rpgoldman@sift.info> wrote:
> On 3/30/11 Mar 30 -4:33 PM= , Nick Dokos wrote:
>
> > Robert Goldman rpgoldman@sift= .info> wrote:
>
> >
>
> >> I = would like to do the opposite of literate programming (hence the
> =
> >> subject line!):
>
> >>
>=
> >> I would like to pull into my org file snippets from a = code file. =A0I know
>
> >> that org-mode will let m= e import /entire/ source code files. =A0Is there
>
> >&= gt; some way to say "Import the region of this file between these two<= br />>
> >> delimiters?"
>
> >&g= t;
>
> >> If not, do you think it would be hard to a= dd this feature? =A0I already
>
> >> have the snappy= name, after all!
>
> >>
>
> >>
> > I don't really understand: can't you cut a= nd paste?
>
>
>
> Yes, but if I cut and = paste the text of the code that I am describing
>
> may ch= ange out from under my text. =A0If I import the code, it stays in
>=
> sync (at least when the document is exported).
>
= >
>
> Honestly, I was tempted to do the literate progr= amming thing with babel,
>
> but was concerned that it mig= ht not work well as a multiple-author thing
>
> (I would b= e writing the document, but someone else might be modifying
>
> the code and might find org-babel confusing).
>
> &g= t;
>
> > And what do you mean that "org-mode will = let me import /entire/ source code
>
> > files"? I= s this a facility other than insert-file? Or are you talking about
>= ;
> > the #+INCLUDE mechanism?
>
>
> =
> Yes, I was talking about #+INCLUDE. =A0I was really wondering if= there
>
> mightn't be something like
>
= >
>
> #+INCLUDE ~/myfile.lisp :from "(defun sampl= e-function" :to "; end
>
> sample-function"=
>
>
>
> [sorry --- that's word-wrap= ped to further obscurity.]
>
>
>
> cheer= s,
>
> r
>
>
> --e0cb4e887a4d0c8bdb049fbad728--