emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] new exporter, conditional options according to backend


From: Ezequiel Birman
Subject: Re: [O] new exporter, conditional options according to backend
Date: Sun, 20 Jan 2013 01:38:43 -0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

>>>>> "Nicolas" == Nicolas Goaziou <address@hidden> writes:

    > Hello, Ezequiel Birman <address@hidden> 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).

    >> 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,

    > -- Nicolas Goaziou

Thanks for the example and the clarificatons re filters versus hooks,
and for thinking of those sane defaults ahead too.

-- 
Ezequiel Birman




reply via email to

[Prev in Thread] Current Thread [Next in Thread]