a guest Oct 11th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- #!/usr/bin/emacs --script
- ;;; naive build system for Org-mode files
- (defun build-doc(doc-file)
- "Export .org file as HTML"
- (find-file-read-only doc-file)
- (org-export-as-html 3)) ;; 3 is: how many levels of the outline should become headlines
- (defun build-docs()
- "Export all the .org files in the current directory"
- (setq docs (directory-files "." t "^[^.#].*\.*org$"))
- (while docs
- (build-doc (car docs))
- (setq docs (cdr docs))))
- (defun run-build-loop()
- "Endlessly: wait for some .org file modification, and re-export all the *.org"
- (while t
- (shell-command "inotifywait -e move_self -e modify -e close_write [^#]*.org")
- (mapc 'kill-buffer (buffer-list))))
RAW Paste Data