From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte 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 Message-ID: <8738h49u2g.fsf@gmail.com> References: <1398196476-4773-1-git-send-email-aaronecay@gmail.com> <87bnvt2h6r.fsf@bzg.ath.cx> <87d2g92au5.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wcv8R-0000rZ-PU for emacs-orgmode@gnu.org; Wed, 23 Apr 2014 07:14:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wcv8L-0006pO-Cv for emacs-orgmode@gnu.org; Wed, 23 Apr 2014 07:14:39 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: emacs-orgmode@gnu.org >> 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=E2=80=99t go this route because autogenerating :file f= rom > 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-component= s))) "No heading") block-counter)))) ...)) >=20 > 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 > --=20 Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D