From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: new exporter, conditional options according to backend Date: Fri, 25 Jan 2013 14:23:41 +0100 Message-ID: <87wqv19z1e.fsf@gmail.com> References: <87hame8pdk.fsf@david.espiga4.com.ar> <87sj5w23ia.fsf@gmail.com> <87pq0uqq2z.fsf@med.uni-goettingen.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:51789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TyjGK-0005Rw-5l for emacs-orgmode@gnu.org; Fri, 25 Jan 2013 08:24:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TyjGE-0005at-4r for emacs-orgmode@gnu.org; Fri, 25 Jan 2013 08:24:08 -0500 Received: from mail-wi0-f178.google.com ([209.85.212.178]:34830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TyjGD-0005aj-Tl for emacs-orgmode@gnu.org; Fri, 25 Jan 2013 08:24:02 -0500 Received: by mail-wi0-f178.google.com with SMTP id hn3so305420wib.5 for ; Fri, 25 Jan 2013 05:24:00 -0800 (PST) In-Reply-To: <87pq0uqq2z.fsf@med.uni-goettingen.de> (Andreas Leha's message of "Thu, 24 Jan 2013 21:32:52 +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: Andreas Leha Cc: emacs-orgmode@gnu.org Hello, Andreas Leha writes: > Sorry for hijacking this thread. But I am also interested in backend > specific options. Could you give an example of how to achieve something > like this with the new exporter: > > #+begin_src R :results graphics :file (if (and (boundp 'org-export-current-backend) (eq org-export-current-backend 'e-latex)) "foo.pdf" "foo.png") > plot(1:10) > #+end_src You need to process the buffer being exported before Babel blocks are expanded. You could use `org-export-before-processing-hook' for that. For example, you could define a specific extension for :file values, like "foo.xxx", process the buffer and and replace "xxx" with an appropriate extension according to the current back-end (the argument of the function). Regards, -- Nicolas Goaziou