Fix org source block language execution
This commit is contained in:
parent
e83e8218fd
commit
7c1e0a4391
30
config.org
30
config.org
@ -248,7 +248,7 @@
|
|||||||
|
|
||||||
=babel= lets us evaluate Org documents containing source blocks!
|
=babel= lets us evaluate Org documents containing source blocks!
|
||||||
I've left the enabling of this for most languages to the section
|
I've left the enabling of this for most languages to the section
|
||||||
for that language, but I'll add Emacs Lisp and shell here.
|
for that language, but I'll add Shell and Elisp here.
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(org-babel-do-load-languages
|
(org-babel-do-load-languages
|
||||||
@ -257,6 +257,24 @@
|
|||||||
(shell . t)))
|
(shell . t)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
The interface org-babel exposes is a little annoying as later in
|
||||||
|
this config we'll want to preserve the prior value of
|
||||||
|
[[help:org-babel-load-languages][org-babel-load-languages]] when enabling another language. However,
|
||||||
|
~org-babel-do-load-languages~ /sets the passed symbol to the passed
|
||||||
|
value/ with [[help:set-default][set-default]] before going through the pairs in
|
||||||
|
~org-babel-load-languages~. Don't ask me why, seems like an
|
||||||
|
obviously bad design. Workaround is to define a function here to
|
||||||
|
use later so at least it won't /look/ ugly.
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(defun enable-org-babel-lang (lang)
|
||||||
|
"Enable executing source block in the passed language in
|
||||||
|
org-mode. Doesn't affect other enabled languages."
|
||||||
|
(org-babel-do-load-languages
|
||||||
|
'org-babel-load-languages
|
||||||
|
(append org-babel-load-languages `((,lang . t)))))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
By default trying to execute a source block prompts you, which is
|
By default trying to execute a source block prompts you, which is
|
||||||
super annoying since I'm realistically not going to try to run any
|
super annoying since I'm realistically not going to try to run any
|
||||||
code from Org documents I haven't written, so that needs
|
code from Org documents I haven't written, so that needs
|
||||||
@ -608,13 +626,10 @@
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
**** Source blocks
|
**** Source blocks
|
||||||
To enable execution of CL source blocks in Org mode, add an item
|
Enable execution of CL source blocks in Org mode:
|
||||||
to [[help:org-babel-load-languages][org-babel-load-languages]].
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(org-babel-do-load-languages
|
(enable-org-babel-lang 'lisp)
|
||||||
'org-babel-load-languages
|
|
||||||
'((lisp . t)))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Paredit
|
*** Paredit
|
||||||
@ -843,8 +858,7 @@
|
|||||||
diagrams):
|
diagrams):
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(add-to-list 'org-babel-load-languages
|
(enable-org-babel-lang 'mermaid)
|
||||||
'(mermaid . t))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Tool Integrations
|
* Tool Integrations
|
||||||
|
Loading…
x
Reference in New Issue
Block a user