mirror of
https://github.com/doomemacs/doomemacs
synced 2025-09-24 16:30:58 -05:00
BREAKING CHANGE: Moves ws-butler, dtrt-indent, and whitespace defaults out of Doom's core and into a new module. ws-butler is gated behind +trim and dtrt-indent behind +guess. Users who depend on/like these packages will need to enable the new module and their respective flags (which is the default going forward). This change is motivated by an ongoing effort to slim down Doom's core (by (re)moving non-essentials from it). This also addresses an issue where dtrt-indent would vastly increase load times for some major-modes (e.g. elixir-mode & elm-mode, see #7537) by restricting it to non-project files and non-read-only buffers AND excludign those two major modes from indent guessing. Fix: #8516 Fix: #7537
31 lines
1.1 KiB
EmacsLisp
31 lines
1.1 KiB
EmacsLisp
;;; lang/janet/config.el -*- lexical-binding: t; -*-
|
|
|
|
(use-package! janet-mode
|
|
;; HACK: Needed to override autoloaded `auto-mode-alist' and
|
|
;; `interpreter-mode-alist' entries from this or `janet-ts-mode', so we can
|
|
;; rely on `major-mode-remap-defaults' instead.
|
|
:mode "\\.\\(jdn\\|janet\\)\\'"
|
|
:interpreter "janet[0-9]*\\'"
|
|
:config
|
|
;; HACK: janet-mode calls `janet--set-indentation' each time it's activated,
|
|
;; making its (global) side-effects unnecessarily difficult to change, so I
|
|
;; disable it and call it manually (and once).
|
|
;; REVIEW: PR this upstream?
|
|
(defadvice! +janet--inhibit-indent-init-a (fn &rest args)
|
|
:around #'janet-mode
|
|
(letf! ((#'janet--set-indentation #'ignore))
|
|
(apply fn args)))
|
|
|
|
(janet--set-indentation)
|
|
(dolist (sym '(with label catseq eachp eachk))
|
|
(put sym 'janet-indent-function 'defun)))
|
|
|
|
|
|
(use-package! janet-ts-mode
|
|
:when (modulep! +tree-sitter)
|
|
:defer t
|
|
:init
|
|
(set-tree-sitter! 'janet-mode 'janet-ts-mode
|
|
`((janet-simple :url "https://github.com/sogaiu/tree-sitter-janet-simple"
|
|
:cc ,(if (featurep :system 'windows) "gcc.exe")))))
|