[org] set up shell source blocks

This commit is contained in:
contrapunctus 2021-09-22 09:23:03 +05:30
parent b8e9db537c
commit 83f52f3c84
1 changed files with 21 additions and 2 deletions

View File

@ -1615,12 +1615,20 @@ With PREFIX argument and CMD not supplied - prompt for command."
("n" my-org-hydra-nav/body "navigation")
("b" my-compile-org-lp "compile")
("C-b" contrapunctus-async-tangle "babel-tangle")
("e" my-org-eval-hydra/body "eval")
("h" my-help-hydra/body "Help")
("E" toggle-debug-on-error "tdoe")
("Q" toggle-debug-on-quit "tdoq"))
#+END_SRC
**** eval
#+BEGIN_SRC emacs-lisp
(defhydra my-org-eval-hydra (:color blue)
"Eval"
("e" org-babel-execute-src-block "eval block"))
#+END_SRC
**** org block
#+BEGIN_SRC emacs-lisp
(defhydra my-org-hydra-block (:color blue)
@ -1628,7 +1636,7 @@ With PREFIX argument and CMD not supplied - prompt for command."
("e" (my-org-hydra-insert-block "SRC" "emacs-lisp") "Emacs Lisp")
("t" (my-org-hydra-insert-block "SRC" "emacs-lisp :tangle test :load test") "Emacs Lisp test")
("E" (my-org-hydra-insert-block "SRC" "emacs-lisp :tangle no :load no") "Emacs Lisp example")
("h" (my-org-hydra-insert-block "SRC" "shell :tangle no") "Shell")
("h" (my-org-hydra-insert-block "SRC" "sh") "Shell")
("o" (my-org-hydra-insert-block "QUOTE") "quote")
("v" (my-org-hydra-insert-block "VERSE") "verse")
("s" (my-org-hydra-insert-block "SRC" "scheme") "Scheme"))
@ -2696,6 +2704,17 @@ BUG - improper behaviour with checkboxes.
(use-package ox-texinfo)
#+END_SRC
From https://emacs.stackexchange.com/questions/20577/org-babel-load-all-languages-on-demand
#+BEGIN_SRC emacs-lisp
(defadvice org-babel-execute-src-block (around load-language nil activate)
"Load language if needed"
(let ((language (org-element-property :language (org-element-at-point))))
(unless (cdr (assoc (intern language) org-babel-load-languages))
(add-to-list 'org-babel-load-languages (cons (intern language) t))
(org-babel-do-load-languages 'org-babel-load-languages org-babel-load-languages))
ad-do-it))
#+END_SRC
**** org-html-themify
#+BEGIN_SRC emacs-lisp
(use-package org-html-themify