[Emacs] Better addition of languages to `org-babel-load-languages'

This commit is contained in:
Lucien Cartier-Tilet 2021-11-08 15:10:20 +01:00
parent 4da47a0a7b
commit 7bd6cdad76
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -3262,15 +3262,19 @@ to easily convert a LaTeX snippet into a PNG, regardless of the
exporter I use afterwards. Its installation is pretty simple: exporter I use afterwards. Its installation is pretty simple:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package ob-latex-as-png (use-package ob-latex-as-png
:after (org) :after org
:straight (:build t) :straight (:build t)
:defer t) :defer t
:init
(add-to-list 'org-babel-load-languages '(latex-as-png . t)))
#+end_src #+end_src
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package ob-restclient (use-package ob-restclient
:straight (:build t) :straight (:build t)
:defer t) :defer t
:init
(add-to-list 'org-babel-load-languages '(restclient . t)))
#+end_src #+end_src
One of the amazing features of org-mode is its literary programming capacities One of the amazing features of org-mode is its literary programming capacities
@ -3284,8 +3288,6 @@ activated. Here are the languages I activated in my Org-mode configuration:
| gnuplot | | gnuplot |
| latex | | latex |
| makefile | | makefile |
| plantuml |
| python |
| sass | | sass |
| shell | | shell |
@ -3300,21 +3302,15 @@ activated. Here are the languages I activated in my Org-mode configuration:
"\n ")) "\n "))
#+END_SRC #+END_SRC
#+RESULTS[52f5db378c4060c5ce47e6228e95feefba4fe24d]: org-babel-languages-gen #+RESULTS[6ee465842066eca1ca245b962239bd8a1ef84a10]: org-babel-languages-gen
#+begin_example : '((C . t)
'((C . t) : (dot . t)
(dot . t) : (emacs-lisp . t)
(emacs-lisp . t) : (gnuplot . t)
(gnuplot . t) : (latex . t)
(latex . t) : (makefile . t)
(latex-as-png . t) : (sass . t)
(makefile . t) : (shell . t))
(plantuml . t)
(python . t)
(restclient . t)
(sass . t)
(shell . t))
#+end_example
The corresponding code is as follows: The corresponding code is as follows:
#+NAME: org-babel-load-languages #+NAME: org-babel-load-languages
@ -4869,6 +4865,7 @@ comma.
:init :init
(setq python-indent-guess-indent-offset-verbose nil) (setq python-indent-guess-indent-offset-verbose nil)
(add-hook 'python-mode-local-vars-hook #'lsp) (add-hook 'python-mode-local-vars-hook #'lsp)
(add-to-list 'org-babel-load-languages '(python . t))
:config :config
(setq python-indent-guess-indent-offset-verbose nil) (setq python-indent-guess-indent-offset-verbose nil)
(when (and (executable-find "python3") (when (and (executable-find "python3")