Some of my org mode files take a long time to export because they include code for number crunching that is executed during export (via Org Babel) . I usually minimize the Emacs frame while the export process is running and work on something else. Unfortunately, the Emacs frame is automatically raised during export and I think it happens every time pdflatex is run (three times). These frames then get in my way and I have to minimize them again and again. How can I prevent Org mode from raising the frame during export?
Edit: Minimal example:
(setq org-confirm-babel-evaluate nil)
- Open a new file
test.organd paste content shown below.
- C-c C-e l p to export to PDF via LaTeX.
- Immediately minimize Emacs frame using window manager.
- Wait 5 seconds.
Result: Emacs frame raised after ~5s.
#+BEGIN_SRC emacs-lisp :exports results :results value (if (sit-for 5) "Finished waiting." "Interrupted while waiting.") #+END_SRC
Edit 2: I'm using Emacs 26.0.60 (compiled from source) with Org mode 9.1.6 (from ELPA) but I have been experiencing this problem with many versions of Emacs and Org mode and for at least three years (before that I didn't use Org's exporting facility). My window manager is FVWM2 on Ubuntu 16.04.4 LTS.