emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: rpgoldman@sift.info
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: Org babel does not work properly with included files
Date: Thu, 05 May 2011 10:56:41 -0600	[thread overview]
Message-ID: <87aaf0vpgb.fsf@gmail.com> (raw)
In-Reply-To: 4DBE1B3D.8080007@sift.info

Robert Goldman <rpgoldman@sift.info> writes:

> Looking over this some more, I see that the challenge is to:
>
> 1.  read the file parameters (whatever they are) from the original file
> (hence opening the file from the link) and
>
> 2.  read the header parameters from the export buffer, since the header
> may not actually be contained in the original file.
>

The above is a good summary.  Babel ensures that code blocks will be
evaluated in the original buffer, so that they can e.g., reference a
code block outside of the exported subtree when only exporting a
subtree.

>
> This seems like a substantial reorganization from the original, which
> attempts to do both tasks in the original file (and fails for included
> files).
>

I'm not sure that the current behavior is a bug.  Is it reasonable to
place code block parameters into an included file?  These parameters
would not be successfully found during interactive evaluation, and could
only plausibly be used during export as you anticipated.

Also, this would seem to break Babel's current guarantee that code
blocks will be evaluated in the original Org-mode file.

If this were to be implemented, I think one option would be to perform
the following on export
1. make a copy of the original buffer
2. call `org-export-handle-include-files' in this copy
3. resolve all parameters in this copied buffer

The above shouldn't be difficult to implement, and creating the copy
shouldn't add too much computational time to the export process.

My concern is that expansion of included files may be more likely to
cause confusing behavior (e.g., by change the evaluation environment
between interactive evaluation and export) than it would to be used
constructively.

Maybe I have missed your initial use case.

Thanks -- Eric

p.s. Sorry about the delayed reply I've had very little mailing
     list connectivity lately

>
> best,
> r
>
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

  reply	other threads:[~2011-05-05 20:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-02  0:44 Org babel does not work properly with included files Robert Goldman
2011-05-02  1:33 ` Nick Dokos
2011-05-02  1:48   ` Robert P. Goldman
2011-05-02  3:43     ` Nick Dokos
2011-05-02  4:15       ` Robert P. Goldman
2011-05-02  1:52   ` Robert P. Goldman
2011-05-02  2:47 ` Robert Goldman
2011-05-05 16:56   ` Eric Schulte [this message]
2011-05-05 21:12     ` Robert Goldman
2011-05-05 21:27       ` Eric Schulte
2011-05-05 22:10         ` Robert Goldman
2011-05-11 14:24           ` Robert Goldman

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=87aaf0vpgb.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --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).