emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: chris.m.malone@gmail.com
To: Robert Goldman <rpgoldman@sift.info>
Cc: nicholas.dokos@hp.com, Org Mode <emacs-orgmode@gnu.org>
Subject: Re: Re: Illiterate programming question
Date: Wed, 30 Mar 2011 22:38:47 +0000	[thread overview]
Message-ID: <e0cb4e887a4d0c8c03049fbad72b@google.com> (raw)
In-Reply-To: <4D93A425.9070604@sift.info>

[-- Attachment #1: Type: text/plain, Size: 1839 bytes --]

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 <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. 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




[-- Attachment #2: Type: text/html, Size: 2747 bytes --]

  reply	other threads:[~2011-03-30 22:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-30 20:32 Illiterate programming question Robert Goldman
2011-03-30 21:33 ` Nick Dokos
2011-03-30 21:39   ` Erik Iverson
2011-03-30 21:44   ` Robert Goldman
2011-03-30 22:38     ` chris.m.malone [this message]
2011-03-30 22:45     ` Sébastien Vauban
2011-03-30 22:52     ` Eric Schulte
2011-03-31 20:09       ` Sean O'Halpin
2011-03-31 20:13         ` Nick Dokos
2011-04-01  2:29           ` Sean O'Halpin
2011-04-01  5:46             ` Nick Dokos
2011-04-01 16:41               ` Eric Schulte
2011-04-01 21:11                 ` Sébastien Vauban

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e0cb4e887a4d0c8c03049fbad72b@google.com \
    --to=chris.m.malone@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=nicholas.dokos@hp.com \
    --cc=rpgoldman@sift.info \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).