[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [RFC] [PATCH] ob-core.el: allow the auto-generation of output fi
Re: [O] [RFC] [PATCH] ob-core.el: allow the auto-generation of output file names for src blocks.
Sun, 11 May 2014 16:38:15 -0400
Notmuch/0.17+160~g03680d1 (http://notmuchmail.org) Emacs/188.8.131.52 (x86_64-unknown-linux-gnu)
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 (...
>>> (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")
>> 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
> Please do make this change, I'd then be happy to apply the resulting
Done, as you and Bastien suggested.