From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Loris Bennett" Subject: Re: Error "No :file header argument given" - minor bug? Date: Wed, 02 Dec 2015 08:22:29 +0100 Message-ID: <87610hl3gq.fsf_-_@hornfels.zedat.fu-berlin.de> References: <874mg2zgeh.fsf@hornfels.zedat.fu-berlin.de> <87wpsyw411.fsf@hornfels.zedat.fu-berlin.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a41kV-0001Qh-J6 for emacs-orgmode@gnu.org; Wed, 02 Dec 2015 02:22:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a41kQ-0007ug-JB for emacs-orgmode@gnu.org; Wed, 02 Dec 2015 02:22:47 -0500 Received: from plane.gmane.org ([80.91.229.3]:36565) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a41kQ-0007ua-CZ for emacs-orgmode@gnu.org; Wed, 02 Dec 2015 02:22:42 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1a41kL-0008Hk-BP for emacs-orgmode@gnu.org; Wed, 02 Dec 2015 08:22:37 +0100 Received: from hornfels.zedat.fu-berlin.de ([160.45.11.110]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 Dec 2015 08:22:37 +0100 Received: from loris.bennett by hornfels.zedat.fu-berlin.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 Dec 2015 08:22:37 +0100 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: emacs-orgmode@gnu.org "Loris Bennett" writes: > "Loris Bennett" writes: > >> Hi, >> >> At the beginning of each month I generate a plot via a CALL to a block >> of R code: >> >> #+CALL: code;plot_usage_historical_facet(type="users") >> >> The type is used as part of the name of the output file. Today I got >> the error: >> >> user-error: No :file header argument given; cannot create graphical result. >> >> I have certainly updated Org since the last time I tried to create the >> plot and am now running version 8.3.2 (8.3.2-39-gd537a3-elpaplus). >> >> Is this (new) behaviour expected? If, so what do I have to do to >> generate a plot file with a name which is dependent on an argument? > > Looking at my code again, I think I may have been mistaken and this may > never have worked as I describe above. > > Thus the question should be: > > Is it possible to have a variable as part of the :file specification? To answer my own question: Probably not, but in my case it isn't necessary. In my R code I have: ggsave(filename=paste0("./usage_",type,"_historical_facet.pdf"),plot=p) and this produces, as desired, an output file where the file name depends on the argument passed by CALL, e.g. #+CALL: code;plot_usage_historical_facet(type="users") What threw me was that you still need ':file' header but the name specified there is irrelevant, e.g. #+HEADER: :file tmp.pdf When the block is evaluated, the file I want with the correct, argument-dependent name is created. However I also get 'tmp.pdf', but this file just seems to be an empty PDF shell without any pages. So this seems to be a minor bug. Maybe ':file' should be able to take a value which indicates that the name of the file will come from within the block. Cheers, Loris -- This signature is currently under construction.