(csharp-mode c-basic-offset)
(csharp-ts-mode c-basic-offset
csharp-ts-mode-indent-offset)
- (emacs-lisp-mode lisp-indent-offset)
+ (emacs-lisp-mode . editorconfig-set-indentation-lisp-mode)
(ess-mode ess-indent-offset)
(feature-mode feature-indent-offset
feature-indent-level)
(js-mode js-indent-level)
(jsonian-mode jsonian-default-indentation)
(latex-mode . editorconfig-set-indentation-latex-mode)
- (lisp-mode lisp-indent-offset)
+ (lisp-mode . editorconfig-set-indentation-lisp-mode)
(matlab-mode matlab-indent-level)
(octave-mode octave-block-offset)
;; No need to change `php-mode-coding-style' value for php-mode
(setq-local LaTeX-item-indent size)
(setq-local TeX-brace-indent-level size))
-(cl-defun editorconfig--should-set (symbol &optional size)
- "Determine if editorconfig should set SYMBOL.
-
-Optional arg SIZE is used when symbol is `lisp-indent-offset'.
-See `editorconfig-lisp-use-default-indent' for details."
+(defun editorconfig-set-indentation-lisp-mode (size)
+ "Set indent size to SIZE for Lisp mode(s)."
+ (when (cond ((null editorconfig-lisp-use-default-indent) t)
+ ((eql t editorconfig-lisp-use-default-indent) nil)
+ ((numberp editorconfig-lisp-use-default-indent)
+ (not (eql size editorconfig-lisp-use-default-indent)))
+ (t t))
+ (setq-local lisp-indent-offset size)))
+
+(cl-defun editorconfig--should-set (symbol)
+ "Determine if editorconfig should set SYMBOL."
(display-warning '(editorconfig editorconfig--should-set)
- (format "symbol: %S | size: %S"
- symbol
- size)
+ (format "symbol: %S"
+ symbol)
:debug)
(when (assq symbol file-local-variables-alist)
(cl-return-from editorconfig--should-set
(cl-return-from editorconfig--should-set
nil))
- (when (eq symbol 'lisp-indent-offset)
- (cl-return-from editorconfig--should-set
- (cond ((null editorconfig-lisp-use-default-indent) t)
- ((eql t editorconfig-lisp-use-default-indent) nil)
- ((numberp editorconfig-lisp-use-default-indent)
- (not (eql size editorconfig-lisp-use-default-indent)))
- (t t))))
-
t)
(defun editorconfig-set-indentation (style &optional size tab_width)