Compare commits

...

3 Commits

View File

@ -376,6 +376,8 @@ the contents of packages and allows to update packages to the latest version.
#+begin_src emacs-lisp -n :results silent #+begin_src emacs-lisp -n :results silent
(when (require 'treesit nil 'noerror) (when (require 'treesit nil 'noerror)
(setopt (setopt
;; Set `tab-width' in `after-change-major-mode-hook' function too.
go-ts-mode-indent-offset 2
treesit-language-source-alist treesit-language-source-alist
'((bash "https://github.com/tree-sitter/tree-sitter-bash" "master" "src") '((bash "https://github.com/tree-sitter/tree-sitter-bash" "master" "src")
(c "https://github.com/tree-sitter/tree-sitter-c" "master" "src") (c "https://github.com/tree-sitter/tree-sitter-c" "master" "src")
@ -383,7 +385,9 @@ the contents of packages and allows to update packages to the latest version.
(cpp "https://github.com/tree-sitter/tree-sitter-cpp" "master" "src") (cpp "https://github.com/tree-sitter/tree-sitter-cpp" "master" "src")
(css "https://github.com/tree-sitter/tree-sitter-css" "master" "src") (css "https://github.com/tree-sitter/tree-sitter-css" "master" "src")
(glsl "https://github.com/theHamsta/tree-sitter-glsl" "master" "src") (glsl "https://github.com/theHamsta/tree-sitter-glsl" "master" "src")
;; go-ts-mode requires libtree-sitter-go and libtree-sitter-gomode.
(go "https://github.com/tree-sitter/tree-sitter-go" "master" "src") (go "https://github.com/tree-sitter/tree-sitter-go" "master" "src")
(gomod "https://github.com/camdencheek/tree-sitter-go-mod" "main" "src")
(html "https://github.com/tree-sitter/tree-sitter-html" "master" "src") (html "https://github.com/tree-sitter/tree-sitter-html" "master" "src")
(java "https://github.com/tree-sitter/tree-sitter-java" "master" "src") (java "https://github.com/tree-sitter/tree-sitter-java" "master" "src")
(javascript "https://github.com/tree-sitter/tree-sitter-javascript" (javascript "https://github.com/tree-sitter/tree-sitter-javascript"
@ -405,8 +409,11 @@ the contents of packages and allows to update packages to the latest version.
"master" "typescript/src") "master" "typescript/src")
(yaml "https://github.com/ikatyang/tree-sitter-yaml" "master" "src"))) (yaml "https://github.com/ikatyang/tree-sitter-yaml" "master" "src")))
(add-to-list 'auto-mode-alist (add-hook 'after-change-major-mode-hook
`(,(rx ".py" (opt (any "iw")) eos) . python-ts-mode))) (defun on-go-ts-mode-hook ()
(when (derived-mode-p 'go-ts-mode 'go-mod-ts-mode)
(setq-local tab-width 2))))
(add-to-list 'auto-mode-alist `(,(rx ".go" eos) . go-ts-mode)))
#+end_src #+end_src
* [[info:emacs#Faces][Text faces or styles (info)]] * [[info:emacs#Faces][Text faces or styles (info)]]
@ -4096,7 +4103,7 @@ Listing [[lst:sbcl-core-for-sly]] tangles to a script to dump such a [[http://ww
#+caption[Configure =slime=]: #+caption[Configure =slime=]:
#+caption: Configure =slime=. #+caption: Configure =slime=.
#+name: lst:configure-slime #+name: lst:configure-slime
#+begin_src emacs-lisp -n :results silent #+begin_src emacs-lisp -n :results silent :tangle no
(when (ensure-package-installation 'slime) (when (ensure-package-installation 'slime)
(with-eval-after-load 'slime (with-eval-after-load 'slime
(setq slime-default-lisp 'sbcl (setq slime-default-lisp 'sbcl
@ -4728,49 +4735,6 @@ byte code:
13 return 13 return
#+end_src #+end_src
** [[https://fennel-lang.org/][Fennel Programming]]
:PROPERTIES:
:CUSTOM_ID: sec:fennel-programming
:END:
Here is a list of links describing how to install and setup [[https://fennel-lang.org/][Fennel]] and how to
install and use [[https://gitlab.com/andreyorst/ob-fennel][ob-fennel]] with the [[https://love2d.org/][LÖVE 2D game engine]]:
1. [[https://fennel-lang.org/][The Fennel Programming Language]]
2. [[https://fennel-lang.org/setup][Setting up Fennel]]
3. [[https://gitlab.com/andreyorst/ob-fennel][Org Babel support for the Fennel language: ob-fennel]]
4. [[https://andreyorst.gitlab.io/posts/2022-09-26-reproducible-research-with-org-mode-fennel-and-love/][Reproducible Research with Org Mode, Fennel, and LÖVE]]
#+caption[Install =fennel-mode= and =ob-fennel= when =fennel= is an executable]:
#+caption: Install =fennel-mode= and =ob-fennel= when =fennel= is an executable.
#+name: lst:install-ob-fennel-mode
#+begin_src emacs-lisp -n :results silent
(when (and (executable-find "fennel")
(ensure-package-installation 'fennel-mode))
(unless (package-installed-p 'ob-fennel)
(package-vc-install "https://gitlab.com/andreyorst/ob-fennel"))
(when (package-installed-p 'ob-fennel)
(ensure-package-installation 'ob-fennel)
(set-org-babel-language-activity 'fennel (fboundp 'fennel-mode))))
#+end_src
#+caption[Fennel example]:
#+caption: Fennel example.
#+header: :var x=10 y=20
#+name: lst:fennel-example
#+begin_src fennel -n :eval never-export :results silent :session fennel
(+ x y)
#+end_src
#+caption[Install =Fennel= with luarocks on Darwin]:
#+caption: Install =Fennel= with luarocks on Darwin.
#+name: lst:install-fennel-on-darwin
#+begin_src shell -n :eval never :results silent :tangle no
luarocks \
install --local readline \
HISTORY_INCDIR=/usr/local/opt/readline/include \
HISTORY_DIR=/usr/local/opt/readline/lib
#+end_src
** [[https://en.wikibooks.org/wiki/Scheme_Programming][Scheme Programming]] ** [[https://en.wikibooks.org/wiki/Scheme_Programming][Scheme Programming]]
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: sec:scheme-programming :CUSTOM_ID: sec:scheme-programming