emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Aaron Ecay <aaronecay@gmail.com>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>, Alex Fenton <alex@pressure.to>
Cc: emacs-orgmode@gnu.org
Subject: Re: Babel - :export-dir and :file-ext arguments cause all blocks to emit files
Date: Fri, 25 May 2018 14:47:59 +0100	[thread overview]
Message-ID: <87fu2f7sog.fsf@gmail.com> (raw)
In-Reply-To: <87wovsprzd.fsf@nicolasgoaziou.fr>

Hi Nicolas, hi Alex,

First of all, no issue arises with :output-dir alone.  It can be
specified as a global header arg without issue.

The situation with :file is that it (currently and at all relevant times
in the past AFAIK) implies :results file.  That is because it would be a
little strange if:

#+begin_src R :file foo.pdf
  ...
#+end_src

did not result in the output going to foo.pdf

I designed :file-ext as a direct replacement for :file.  That is, instead
of the above, one would specify:

#+name: foo
#+begin_src R :file-ext pdf
  ...
#+end_src

and get the same result.  IOW, the design was *not* for :file-ext to be
specified globally.  This perhaps could have been documented better when
it was first introduced, and I see that subsequent changes in the manual
have not made things clearer.

The change Nicolas proposes is how I would make :file-ext work if I were
writing it from scratch today, with the benefit of hindsight.  I worry
that introducing it would break org documents in the wild, but maybe it is
worth it.  Itʼs probably possible to write an org-lint check for the most
common broken case (where :file-ext is specified directly on a block, but
:results file is not.  This check would not catch a case where :file-ext
was specified via a property for a buffer/subtree of blocks all of which
are supposed to produce file results.  Such a case should be rare, but
itʼs not impossible.)  Iʼm still not 100% convinced that the breakage
would be worth it, but I suppose I would incline towards that view.

OTOH I do not think the proposed change makes sense for :file, because
it would lead to a nonsensical situation in the case of the first block
in this email.  It never has made sense to specify :file by inheritance,
so I donʼt think anything should change for that case.

-- 
Aaron Ecay

  parent reply	other threads:[~2018-05-25 13:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-24 21:50 Babel - :export-dir and :file-ext arguments cause all blocks to emit files Alex Fenton
2018-05-24 23:13 ` Nicolas Goaziou
2018-05-25  5:32   ` Alex Fenton
2018-05-25 13:47   ` Aaron Ecay [this message]
2018-05-25 19:52     ` Alex Fenton
2018-05-27 16:40       ` Aaron Ecay
2018-05-27 19:54         ` Nicolas Goaziou
2018-05-27 20:39           ` Aaron Ecay
2018-05-27 20:50             ` Nicolas Goaziou

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=87fu2f7sog.fsf@gmail.com \
    --to=aaronecay@gmail.com \
    --cc=alex@pressure.to \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /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).