diff --git a/settings/org-settings.el b/settings/org-settings.el index 988ff4da..cf8a7ec6 100644 --- a/settings/org-settings.el +++ b/settings/org-settings.el @@ -743,8 +743,8 @@ Suggest the URL title as a description for resource." :after (org)) (use-package ob-core - :defer t - :hook (org-babel-after-execute . org-redisplay-inline-images) + ;; :hook (org-babel-after-execute . org-redisplay-inline-images) + :commands (by-backend svg-fname) :config (setq org-babel-inline-result-wrap "%s") ;; default "=%s=" (setq org-confirm-babel-evaluate nil) ;; no "Evaluate this gnuplot code block on your system? (y or n)" @@ -755,20 +755,7 @@ Suggest the URL title as a description for resource." The key of plist elements is one of the following lisp symbols: html, latex, ascii, or t (meaning all other cases). If BODY is nil the return value is nil" - `(case org-export-current-backend ,@body)) - - ;; obsolete function - (defalias 'if-latex 'by-backend) - (make-obsolete 'if-latex 'by-backend "2020.09.07") - (advice-add 'if-latex :before - (lambda (&rest r) - "Warning: Function `if-latex' is obsolete. -Probably used inside an org file for a src block and/or for an org export. -Updating an old preamble.org should remove this warning." - (message "Warning: Function `if-latex' is obsolete. -Probably used inside an org file for a src block and/or for an org export. -Updating an old preamble.org should remove this warning.")) - '((name . "obsolete"))) + `(cl-case org-export-current-backend ,@body)) ;; TODO: still useful? (defun svg-fname (filename) @@ -807,7 +794,7 @@ Updating an old preamble.org should remove this warning.")) (add-to-list 'org-babel-load-languages '(ditaa . t)))) (use-package ob-gnuplot - :defer t + :commands (gpl-file gpl-term) :init (with-eval-after-load 'org (add-to-list 'org-babel-load-languages '(gnuplot . t))) @@ -831,7 +818,10 @@ set linetype 5 lc rgb '#76ab2f' lw 2 pt 5 ; \ set linetype 6 lc rgb '#4cbded' lw 2 pt 5 ; \ set linetype 7 lc rgb '#a1132e' lw 2 pt 5 ; \ filter(x,min,max) = (x >= min && x <= max) ? x : 1/0 ; \ -set datafile separator '\\t' # treat empty fields in a org-table as 'missing' rather than 'bad' (ignoring, shifting column) ") +set datafile separator '\\t' # treat empty fields in a org-table as 'missing' rather than 'bad' (ignoring, shifting column) " + "usage e.g. to prepend style for all gnuplot src blocks by-backend: +#+property: header-args:gnuplot :prologue (by-backend (latex gnuplot-init-light) (t gnuplot-init-dark)) +") (defvar gnuplot-init-dark "reset ; \ theme_type = 'dark' ; \ set border lc rgb '#cccccc' ; \ @@ -850,7 +840,10 @@ set linetype 5 lc rgb '#cc5279' lw 2 pt 5 ; \ set linetype 6 lc rgb '#76ab2f' lw 2 pt 5 ; \ set linetype 7 lc rgb '#ecb01f' lw 2 pt 5 ; \ filter(x,min,max) = (x >= min && x <= max) ? x : 1/0 ; \ -set datafile separator '\\t' # treat empty fields in a org-table as 'missing' rather than 'bad' (ignoring, shifting column) ") +set datafile separator '\\t' # treat empty fields in a org-table as 'missing' rather than 'bad' (ignoring, shifting column) " + "usage e.g. to prepend style for all gnuplot src blocks by-backend: +#+property: header-args:gnuplot :prologue (by-backend (latex gnuplot-init-light) (t gnuplot-init-dark)) +") (defun gpl-file (filename) "\ @@ -887,7 +880,7 @@ usage: #+HEADER: :term (gpl-term \"15cm,12cm\" \"380,300\") ) (use-package ob-latex - :defer t + :commands (tpl-file gpl-results) :config ;; tikz config for own org export projects (defun tpl-file (filename) @@ -1058,7 +1051,8 @@ usage: #+HEADER: :results (tpl-results) ) (use-package ob-python - :after (org-src python) + ;; :after (org-src python) + :commands (mpl-var mpl-prologue) ;; :commands (org-babel-execute:python ;; org-babel-variable-assignments:python) :init