EDIT 1 : a more simple use case
For this org file content:
* Headline 1
- Something to export
* Headline 2 :noexport:
#+begin_src python :results none :exports none
def foo():
pass
#+end_src
A simple html export (C-c C-e h o) leads to a processing of the python code block event if it is located in a noexport section: org-babel-exp process python at position 116...
Since I have hundreds of code blocks under non exported headlines, this leads to non useful long processing times. Is it possible to avoid this ?
Initial Question:
I have the following problem: I use a selective export with tags thanks to the following code:
#+name: myexporter
#+BEGIN_SRC emacs-lisp
(defun myexporter (tags filename)
(let
((org-export-select-tags tags) (async nil) (subtreep nil) (visible-only nil) (body-only nil) (ext-plist '()))
(org-export-to-file 'html filename async subtreep visible-only body-only)))
#+END_SRC
#+name: selectiveexport
#+BEGIN_SRC emacs-lisp :noweb yes
<<myexporter>>
(myexporter '("bar") "bar.html")
#+END_SRC
This code enables to select all sections with tag :bar:
and export them to an html file called bar.html.
My problem is that when I call the selective export all code block are systematically processed (and I have a lot in my file which makes the selective export quite slow).
For example, with the following org file
* Test :bar:
- Bla, bla
* Foo
#+name: foo
#+begin_src python :results none :exports none
def foo():
pass
#+end_src
the selective export leads to the following messages :
executing Emacs-Lisp code block (selectiveexport)...
org-babel-exp process emacs-lisp at position 21...
org-babel-exp process emacs-lisp at position 337...
org-babel-exp process python at position 796...
Saving file [...]/bar.html...
My problem is the org-babel-exp process python at position 796
that I would prefer not to be executed. I precise that it is executed even if a :noexport:
tag is assigned to section Foo
.
Is it possible to avoid this processing step ?