From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Goldman Subject: Re: Illiterate programming question Date: Wed, 30 Mar 2011 16:44:05 -0500 Message-ID: <4D93A425.9070604@sift.info> References: <4D93935B.1020402@sift.info> <8766.1301520804@alphaville.usa.hp.com> Reply-To: rpgoldman@sift.info Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=38430 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q53BR-0001jW-D5 for emacs-orgmode@gnu.org; Wed, 30 Mar 2011 17:44:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q53BQ-0002Gw-CU for emacs-orgmode@gnu.org; Wed, 30 Mar 2011 17:44:09 -0400 Received: from mpls.sift.info ([75.146.46.193]:33680) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q53BQ-0002Gk-5T for emacs-orgmode@gnu.org; Wed, 30 Mar 2011 17:44:08 -0400 In-Reply-To: <8766.1301520804@alphaville.usa.hp.com> 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: nicholas.dokos@hp.com Cc: Org Mode On 3/30/11 Mar 30 -4:33 PM, Nick Dokos wrote: > Robert Goldman 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