On 21.9.2013, at 14:44, Nicolas Goaziou <n.goaz...@gmail.com> wrote:

> Carsten Dominik <carsten.domi...@gmail.com> writes:
> 
>> OK, I'll try this. However, if the code is a bit more extensive, an
>> SRC block would make it more comfortable to maintain this code inside
>> a file. If I want to write a somewhat complex filter function, it is
>> not convenient to do so in #+BIND line.
> 
> I can't see why it would be inconvenient, since you needn't define the
> filter within the BIND keyword.
> 
> Anyway, you can write a source block that sets locally the filters. That
> should work too.

Indeed, this can be done.  Here is an example (thanks also to Eric for
quick help with the export arguments):

* Special export setup                                             :noexport:

#+begin_src emacs-lisp :exports results :results none
  (defun my-org-export-filter-timestamp-function (timestamp backend info)
    "removes relevant brackets from a timestamp"
    (when (org-export-derived-backend-p backend 'html)
      (replace-regexp-in-string "&[gl]t;\\|[][]" "" timestamp)))
  (make-local-variable 'org-export-filter-timestamp-functions)
  (add-to-list 'org-export-filter-timestamp-functions
               'my-org-export-filter-timestamp-function)
#+end_src

- Carsten

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to