emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Bastien <bzg@gnu.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: [RFC] [PATCH] ob-core.el: allow the auto-generation of output file names for src blocks.
Date: Tue, 22 Apr 2014 21:35:16 -0400	[thread overview]
Message-ID: <8738h49u2g.fsf@gmail.com> (raw)
In-Reply-To: 87d2g92au5.fsf@gmail.com

>> Looks useful to me, but ":file png" looks wrong, with too much
>> implicit.  We should find something less confusing.
>
> One option would be to use :file-ext instead, to generate a :file
> parameter.  I didn’t go this route because autogenerating :file from
> other parameters seemed like too much magic.  But your points in the
> other direction are good.
>
> How does this sound as an algorithm:
> 1. if :file is present, behave exactly as we do now
> 2. if :file is absent but :file-ext and a #+name is present, generate a
>    :file parameter from :output-dir, the #+name, and :file-ext.
>

This sounds like a great approach to me.

>
> Open questions:
> 1. should :file-ext without a #+name be a no-op, or an error?

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

> 
> 2. should :output-dir apply to the :file case as well?
>

If you mean "should :output-dir be used as the base when :file is a
relative pathname" then I'd say "yes", and I think if this isn't the
current behavior then the current behavior should be changed.

Thanks for this nice patch,
Eric

>
> --
> Aaron Ecay
>

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D

  reply	other threads:[~2014-04-23 11:14 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 [this message]
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
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:
  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=8738h49u2g.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    /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).