Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions editorconfig.el
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ This hook will be run even when there are no matching sections in
(meson-mode meson-indent-basic)
(mips-mode mips-tab-width)
(mustache-mode mustache-basic-offset)
(nix-ts-mode nix-ts-mode-indent-offset)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If nix-ts-mode followed the convention of using FOO-indent-offset (instead of FOO-mode-indent-offset), your patch would not be needed. So I suggest a bug report to the nix-ts-mode maintainers.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have send a bug report upstream.
nix-community/nix-ts-mode#69

Copy link

@purcell purcell Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Stefan, I'm a committer on nix-ts-mode, and I could conceivably help get this changed via aliasing and deprecation, but I've seen the same pattern in other popular modes out there, e.g. toml-ts-mode. It seems strange to require the -mode- not to be there, as that is a reasonable part of a variable name. I personally think it would be better to adjust the heuristic here.

(nxml-mode . editorconfig--get-indentation-nxml-mode)
(objc-mode c-basic-offset)
(octave-mode octave-block-offset)
Expand Down Expand Up @@ -266,6 +267,7 @@ This hook will be run even when there are no matching sections in
(templ-ts-mode go-ts-mode-indent-offset js-indent-level)
(toml-ts-mode toml-ts-mode-indent-offset)
(typescript-ts-base-mode typescript-ts-mode-indent-offset)
(typst-ts-mode typst-ts-indent-offset)
(verilog-mode verilog-indent-level
verilog-indent-level-behavioral
verilog-indent-level-declaration
Expand Down Expand Up @@ -305,7 +307,7 @@ When variable `buffer-file-name' matches any of the regexps, then
(with-eval-after-load 'recentf
(add-to-list 'editorconfig-exclude-regexps
(rx-to-string '(seq string-start
(eval (file-truename (expand-file-name recentf-save-file))))
(eval (file-truename (expand-file-name recentf-save-file))))
t)))

(defcustom editorconfig-trim-whitespaces-mode
Expand Down Expand Up @@ -444,7 +446,7 @@ set them to.
Major modes are expected to set this buffer-locally.")

(defun editorconfig--default-indent-size-function (size)
"Guess which variables to set to for the indentation step to have size SIZE.
"Guess which variables to set to for the indentation step to have size SIZE.
This relies on `editorconfig-indentation-alist' supplemented with a crude
heuristic for those modes not found there."
(let ((parents (if (fboundp 'derived-mode-all-parents) ;Emacs-30
Expand Down