From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Babel - :export-dir and :file-ext arguments cause all blocks to emit files Date: Fri, 25 May 2018 01:13:26 +0200 Message-ID: <87wovsprzd.fsf@nicolasgoaziou.fr> References: <3ac2f42a-8ff2-1464-fa36-451e2ef0eacd@pressure.to> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLzQN-00063R-6W for emacs-orgmode@gnu.org; Thu, 24 May 2018 19:13:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLzQJ-0001HA-8Y for emacs-orgmode@gnu.org; Thu, 24 May 2018 19:13:35 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:52361) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fLzQJ-0001Go-26 for emacs-orgmode@gnu.org; Thu, 24 May 2018 19:13:31 -0400 In-Reply-To: <3ac2f42a-8ff2-1464-fa36-451e2ef0eacd@pressure.to> (Alex Fenton's message of "Thu, 24 May 2018 23:50:30 +0200") 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" To: Alex Fenton Cc: emacs-orgmode@gnu.org Hello, Alex Fenton writes: > As far I understand it, |:output-dir| and |:file-ext| that were > intended to be used in the global document header, applying to all > blocks. > > However, it seems to mean that all blocks regardless of their :results > args then emit a file, and put their output as a [file:] link. It's > not clear from the docs why this happens. > > Am I missing something, or does this mean that these arguments are > useless unless a document happens only to emit graphics from blocks? > At the moment, the blocks (R, as it happens) are meant to sometimes > emit scalars, sometimes literal latex, sometimes tables to be > formatted by orgs, and sometimes graphics. But all the non-graphics > are at the moment being stuffed into (non-working) PDF files. > > Following a discussion and suggested, but not-working solution at: > https://emacs.stackexchange.com/questions/41618/org-modes-output-dir-and-file-ext-arguments-cause-all-output-to-be-saved-to I agree something is cheesy here. According to `org-babel-execute-src-block', if :file is set (it can also be forged from :file-ext and :output-dir according to `org-babel-generate-file-param'), results become the filename. Also, according to `org-babel-merge-params' both :file and :file-ext trump :results value, i.e., they automatically imply "file" in :results. and "results" in :exports. At this point, I'm not sure about :export, but I think it should be the other way for :results. IOW, :file and :file-ext should be taken into consideration only when :results contains "file". WDYT? Regards, -- Nicolas Goaziou