2021-11-30 11:57:07 +01:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
|
|
|
emacs -Q --batch --eval "
|
|
|
|
(progn
|
|
|
|
(require 'org)
|
2021-12-23 15:29:03 +01:00
|
|
|
(require 'ob-latex)
|
2022-02-23 11:25:06 +01:00
|
|
|
(require 'ox-latex)
|
2022-04-17 19:05:06 +02:00
|
|
|
(defun org-eval-infixed-blocks (infix)
|
2021-11-30 11:57:07 +01:00
|
|
|
(when (eq major-mode 'org-mode)
|
|
|
|
(let ((blocks
|
|
|
|
(org-element-map
|
|
|
|
(org-element-parse-buffer 'greater-element nil) 'src-block
|
|
|
|
(lambda (block)
|
2022-04-17 19:05:06 +02:00
|
|
|
(when-let ((name (org-element-property :name block)))
|
|
|
|
(when (string-match-p infix name) block))))))
|
2021-11-30 11:57:07 +01:00
|
|
|
(dolist (block blocks)
|
|
|
|
(goto-char (org-element-property :begin block))
|
|
|
|
(org-babel-execute-src-block)))))
|
|
|
|
|
2022-04-17 19:05:06 +02:00
|
|
|
(defun org-eval-emacs-lisp-setup-blocks ()
|
|
|
|
(org-eval-infixed-blocks \"emacs-lisp-setup\"))
|
|
|
|
|
|
|
|
(add-to-list 'safe-local-eval-forms '(org-eval-emacs-lisp-setup-blocks))
|
2021-11-30 11:57:07 +01:00
|
|
|
|
|
|
|
(setq org-confirm-babel-evaluate nil)
|
|
|
|
(setq python-indent-guess-indent-offset nil)
|
|
|
|
|
2021-12-28 14:08:56 +01:00
|
|
|
(org-babel-tangle-file \"$1\" \"init.el\" \"emacs-lisp\")
|
2022-01-10 14:52:54 +01:00
|
|
|
(org-babel-tangle-file \"$1\" \"setup-include.org\" \"org\")
|
|
|
|
(org-babel-tangle-file \"$1\" nil \"perl\")
|
|
|
|
(org-babel-tangle-file \"$1\" nil \"python\"))
|
2021-11-30 11:57:07 +01:00
|
|
|
"
|
|
|
|
|
|
|
|
# Local Variables:
|
|
|
|
# mode: shell-script
|
|
|
|
# sh-indentation: 2
|
|
|
|
# sh-basic-offset: 2
|
|
|
|
# End:
|