emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Aaron Ecay <aaronecay@gmail.com>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [RFC] [PATCH] ob-core.el: allow the auto-generation of output file names for src blocks.
Date: Sun, 11 May 2014 16:38:15 -0400	[thread overview]
Message-ID: <87tx8wnje4.fsf@gmail.com> (raw)
In-Reply-To: <87ha55a5tb.fsf@gmail.com>

Hi Eric, Bastien, Achim, et al.,

Thanks again for the feedback.  I just pushed the revised patch to master.

2014ko maiatzak 4an, Eric Schulte-ek idatzi zuen:


>>> One option might be to borrow naming behavior from the comment
>>> functionality in ob-tangle which looks like the following (from line 426
>>> in ob-tangle.el).
>>> (let (...
>>> (source-name
>>> (intern (or (nth 4 info)       ; explicit #+name:
>>> (format "%s:%d"    ; constructed from header and position
>>> (or (ignore-errors (nth 4 (org-heading-components)))
>>> "No heading")
>>> block-counter))))
>>> ...))
>> I’m not sure I like this approach.  It relies on counting source
>> blocks, so an addition/deletion of a block could change the index.
>> I’m worried that this can lead to the accumulation of many output
>> files: heading:1.ext, heading:2.ext, ... all with no clear indication
>> of what block they were spawned by.  It would also be possible for
>> the result links in the buffer to become inconsistent with the actual
>> block:auto-generated name mapping.
>> I think I would prefer the code in this patch to do nothing in this case
>> (not create a :file value), but for language-specific code that needs a
>> :file to raise an error to prompt the user to add a name.
> Fair enough, especially given that this default will be applied to *all*
> code blocks, this seems like a reasonable approach.

I went ahead with my suggested approach here.


>> Achim raises a backwards compatibility concern.  I am not sure how
>> serious it is: the default settings (no :output-dir) are backwards
>> compatible, and if users set that arg we ought to just give them what
>> they ask for.
>> Nonetheless, the new version of the patch conservatively obeys Achim’s
>> suggestion.  I can change this to your suggestion, if that is the
>> consensus.
> Please do make this change, I'd then be happy to apply the resulting
> patch.

Done, as you and Bastien suggested.


Aaron Ecay

  reply	other threads:[~2014-05-11 20:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-22 19:54 [RFC] [PATCH] ob-core.el: allow the auto-generation of output file names for src blocks Aaron Ecay
2014-04-22 21:22 ` Bastien
2014-04-23  0:04   ` Aaron Ecay
2014-04-23  1:35     ` Eric Schulte
2014-04-23 14:58       ` Bastien
2014-04-28  2:18       ` Aaron Ecay
2014-04-28  6:20         ` Achim Gratz
2014-04-29 13:25         ` Bastien
2014-05-04 13:55         ` Eric Schulte
2014-05-11 20:38           ` Aaron Ecay [this message]
2014-05-14 17:46             ` Achim Gratz
2014-05-15 10:05               ` Bastien
2014-05-16  3:28               ` Aaron Ecay
2014-05-17  6:20                 ` Achim Gratz
2014-04-23  6:27     ` Bastien
2014-04-23 11:07       ` Eric Schulte
2014-04-23 19:44     ` Achim Gratz

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:

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


* 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


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