Even worse, Emacs is not concurrent. Thus I have to wait those 10 seconds without being able to continue typing. This is annoying.
The fix is actually simple: launch another Emacs process to compile the file. Now everything works in the background in a non-blocking way. The code is very simple. Bind it with a key and that's it.
(setq wy-obc-eval-str "--eval=(progn (find-file \"%s\") (org-beamer-export-to-pdf) (kill-emacs))") (defun wy-org-beamer-concurrent () (interactive) (save-buffer) (let ((eval-str (format wy-obc-eval-str buffer-file-name))) (call-process "emacs" nil 0 nil eval-str "--geometry" "60x5")))
PS: legoscia told me that there is emacs-async package (see question), which can free me from launching another emacs explicitly. This may be a better solution but I haven't tried that out.
No comments:
Post a Comment