I'd like to be able to pass more than one headline filter function to a BIND inside my org file:

#+BIND: org-export-filter-headline-functions (tmp-f-one tmp-f-two)

Although the pluralised name of the directive headline-functionS makes me think this function can accept more than one argument, in this case it seems to ignore tmp-f-one and only use the tmp-f-two.

How to I get this directive to filter using both functions?

  • Please do not change the question except for adding clarifications and fixing typos. Ask a new question instead. You have now changed the original question and made it into a different question, seemingly making the answer(s) irrelevant. Anybody who tries to read the question and answer now is bound to be confused.
    – NickD
    Nov 4 '21 at 16:22
  • @NickD how do I revert my edit? Nov 10 '21 at 14:48
  • If you have not opened a new question yet, you might want to save locally the current text of the question first. Then click on the "edited Nov 4 at 8:54" link above: that should let you see the two versions. Then go to the first version and hit Rollback: that should restore the question to that version, by adding a rollback action to the edit history (IOW, you should still be able to get to the second version, but being paranoid, I would still save it locally before mucking around with it). See the last question in this help topic.
    – NickD
    Nov 10 '21 at 15:13
  • 1
    In general, I don't believe in deleting questions unless they are inappropriate for the forum. If they are too vague, duplicates etc, they can be closed, but they are still available as pointers. Otherwise, my opinion is that "useless" questions might end up being very useful to somebody, even if based on a misunderstanding, because misunderstanding something is a very common occurrence :-) My take is that if somebody had a question, then there is a good chance that somebody else might have the same question in the future.
    – NickD
    Nov 11 '21 at 14:11
  • 1
    Well, here's the new question: emacs.stackexchange.com/questions/69324/… Nov 12 '21 at 13:04

What makes you think that tmp-f-one is ignored?

The following works fine for me:

#+BIND: org-export-filter-headline-functions (tmp-f-one tmp-f-two)

* Test one


* Test two


* Code                                                  :noexport:

#+begin_src elisp
  (defun tmp-f-one (data backend info)
    (string-replace "one" "ONE" data))

: tmp-f-one

#+begin_src elisp
  (defun tmp-f-two (data backend info)
    (string-replace "two" "TWO" data))

: tmp-f-two

Both headlines are modified as expected.

  • huh, I'm not getting the results I expect. Thanks for helping me test that assumption. Nov 3 '21 at 18:15
  • Does my example work in your environment?
    – NickD
    Nov 3 '21 at 18:36
  • Yes, I can see that both functions are executed. Nov 4 '21 at 8:40
  • I'll update my question to reflect my new understanding. Nov 4 '21 at 8:47
  • You should not do that. You have now broken the connection between the original question and the answer: that is a big NO! Ask a new question instead. And revert the edit to this question so that it makes sense again.
    – NickD
    Nov 4 '21 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.