From mboxrd@z Thu Jan 1 00:00:00 1970 From: cberry@tajo.ucsd.edu Subject: Re: new exporter, conditional options according to backend Date: Fri, 25 Jan 2013 09:37:21 -0800 Message-ID: <87ip6l2mge.fsf@tajo.ucsd.edu> References: <87hame8pdk.fsf@david.espiga4.com.ar> <87sj5w23ia.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:47460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TynDb-0005Jm-Dv for emacs-orgmode@gnu.org; Fri, 25 Jan 2013 12:37:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TynDZ-0002HH-9Q for emacs-orgmode@gnu.org; Fri, 25 Jan 2013 12:37:35 -0500 Received: from plane.gmane.org ([80.91.229.3]:46168) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TynDZ-0002H7-2T for emacs-orgmode@gnu.org; Fri, 25 Jan 2013 12:37:33 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TynDn-0007Hh-NM for emacs-orgmode@gnu.org; Fri, 25 Jan 2013 18:37:47 +0100 Received: from tajo.ucsd.edu ([137.110.122.165]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Jan 2013 18:37:47 +0100 Received: from cberry by tajo.ucsd.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Jan 2013 18:37:47 +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 Nicolas Goaziou writes: > Hello, > > Ezequiel Birman writes: > >> Is it possible to write something like this with the new exporter? >> >> #+OPTIONS: (if (and (boundp 'org-export-current-backend) (eq org-export-current-backend 'e-beamer)) "H:1" "H:3") > > There is no `org-export-current-backend' in the new exporter. Besides, > what you want is the default behaviour (see `org-e-beamer-frame-level' > variable). 'backend' is in the scope of transcoding functions like inline-src-block. I am currently taking advantage of this, but it is a shortcut rather than a necessity. Is your advice "Don't do that" ? Chuck > >> From what I read in org-export.el the backend is stored in a plist, not >> sure how to get it's value when exporting. >> >> Or, maybe I need to write a filter function to be run from >> org-export-before-process-hook? > > Filters are different from hook. A function in a hook operates on an Org > buffer. A filter function operates either on a string in output syntax > or on the parse tree. > > If, for some reason, you want to modify export options "on the fly", you > could create a filter function for parse tree, and modify options plist > from it: > > #+begin_src emacs-lisp > (defun my-options-change-fun (tree backend info) > (when (org-export-derived-backend-p backend 'e-beamer) > (plist-put info :with-author nil)) > ;; Don't forget to return tree. > tree) > > (add-to-list 'org-export-filter-parse-tree-functions > 'my-options-change-fun) > #+end_src > > > Regards,