mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Add automatic indentation-detection (experimental)
Editorconfig is given precedence. If it successfully sets an indent_style or indent_size for the current buffer, automatic indentation detection will be disabled.
This commit is contained in:
@ -39,6 +39,12 @@ extension, try to guess one."
|
||||
(apply orig-fn args)))
|
||||
(advice-add #'editorconfig-call-editorconfig-exec :around #'doom*editorconfig-smart-detection)
|
||||
|
||||
(defun +editorconfig|disable-indent-detection (props)
|
||||
(when (or (gethash 'indent_style props)
|
||||
(gethash 'indent_size props))
|
||||
(setq doom-inhibit-indent-detection t)))
|
||||
(add-hook 'editorconfig-custom-hooks #'+editorconfig|disable-indent-detection)
|
||||
|
||||
;; Editorconfig makes indentation too rigid in Lisp modes, so tell
|
||||
;; editorconfig to ignore indentation there. I prefer dynamic indentation
|
||||
;; support built into Emacs.
|
||||
|
Reference in New Issue
Block a user