From c65b8834ba1535116a54a130fbb11cedcf3f10fd Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Mon, 15 May 2023 14:05:56 +0200 Subject: [PATCH] Factor out Go setup into its own section --- README.org | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/README.org b/README.org index e701bce..0138b00 100644 --- a/README.org +++ b/README.org @@ -376,8 +376,6 @@ the contents of packages and allows to update packages to the latest version. #+begin_src emacs-lisp -n :results silent (when (require 'treesit nil 'noerror) (setopt - ;; Set `tab-width' in `after-change-major-mode-hook' function too. - go-ts-mode-indent-offset 2 treesit-language-source-alist '((bash "https://github.com/tree-sitter/tree-sitter-bash" "master" "src") (c "https://github.com/tree-sitter/tree-sitter-c" "master" "src") @@ -407,13 +405,7 @@ the contents of packages and allows to update packages to the latest version. "master" "tsx/src") (typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src") - (yaml "https://github.com/ikatyang/tree-sitter-yaml" "master" "src"))) - - (add-hook 'after-change-major-mode-hook - (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))) + (yaml "https://github.com/ikatyang/tree-sitter-yaml" "master" "src")))) #+end_src * [[info:emacs#Faces][Text faces or styles (info)]] @@ -4667,6 +4659,20 @@ byte code: 1. [[https://gobyexample.com/][Go by example]] +#+caption[Setup Go programming]: +#+caption: Setup Go programming. +#+name: lst:setup-go +#+begin_src emacs-lisp -n +(when (featurep 'treesit) + ;; Set `tab-width' in `after-change-major-mode-hook' function too. + (setopt go-ts-mode-indent-offset 2) + (add-hook 'after-change-major-mode-hook + (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 + ** [[info:maxima#Top][Maxima Programming (info)]] :PROPERTIES: :CUSTOM_ID: sec:maxima-programming