diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-06-22 00:09:03 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-06-22 00:09:03 +0100 |
commit | e118b9ad2a13ae851452c34ec6c6feced0972345 (patch) | |
tree | ac54a24606384595c8ec865e51ab7b4f886eb0c5 /Emacs/.config/emacs | |
parent | 8c50230f882abce791dc71fdcda322aeac903da9 (diff) | |
download | dotfiles-e118b9ad2a13ae851452c34ec6c6feced0972345.tar.gz dotfiles-e118b9ad2a13ae851452c34ec6c6feced0972345.tar.bz2 dotfiles-e118b9ad2a13ae851452c34ec6c6feced0972345.zip |
(Emacs)+d-mode,~org-babel-load-languages alist changes
+Emacs-d-mode
~C, Python sections update org-babel-load-languages themselves, for
cleaner code
Diffstat (limited to 'Emacs/.config/emacs')
-rw-r--r-- | Emacs/.config/emacs/config.org | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index fda5a0d..4e9aaa5 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -2564,8 +2564,6 @@ Emacs was very helpful here. org-use-sub-superscripts '{} org-babel-load-languages '((emacs-lisp . t) (lisp . t) - (C . t) - (python . t) (shell . t)))) #+end_src ** Org Core Functionality @@ -3035,6 +3033,29 @@ format [[file:~/Dotfiles/ClangFormat/.clang-format][config file]] in my dotfiles (clang-format-region (region-beginning) (region-end)) (clang-format-buffer)))) #+end_src +*** cc org babel +To ensure org-babel executes language blocks of C/C++ I need to add it +as an option in ~org-babel-load-languages~. +#+begin_src emacs-lisp +(use-package org + :after cc-mode + :init + (setf (alist-get 'C org-babel-load-languages) t)) +#+end_src +** D +D is a systems level programming language with C-style syntax. I +think it has some interesting ideas such as a toggleable garbage +collector. Here I just install the D-mode package, enable ~org-babel~ +execution of d-mode blocks and alias ~D-mode~ with ~d-mode~. + +#+begin_src emacs-lisp +(use-package d-mode + :straight t + :config + (fset 'D-mode 'd-mode) + (with-eval-after-load "org-mode" + (setf (alist-get 'd org-babel-load-languages) t))) +#+end_src ** Racket A scheme with lots of stuff inside it. Using it for a language design book so it's useful to have some Emacs binds for it. @@ -3170,7 +3191,8 @@ Even easier than making your own buffer. ** Python Works well for python. If you have ~pyls~ it should be on your path, so just run eglot if you need. But an LSP server is not necessary for a -lot of my time in python. +lot of my time in python. Here I also setup org-babel for python +source code blocks. #+begin_src emacs-lisp (use-package python :defer t @@ -3192,7 +3214,10 @@ lot of my time in python. ("return" . "⟼") ("yield" . "⟻")) :init - (setq python-indent-offset 4)) + (setq python-indent-offset 4) + :config + (with-eval-after-load "org-mode" + (setf (alist-get 'python org-babel-load-languages) t))) #+end_src *** Python shell Setup for python shell, including a toggle option @@ -3273,6 +3298,8 @@ development on Emacs. (window-height . 0.25)) :config (evil-set-initial-state 'sly-db-mode 'emacs) + (with-eval-after-load "org" + (setq-default org-babel-lisp-eval-fn #'sly-eval)) (+oreo/create-toggle-function +shell/toggle-sly "*sly-mrepl for sbcl*" |