Subject: bug#70105: 30.0.50; Emacs should support EditorConfig out of the box

From: Stefan Monnier <[email-masked]>
Date: Tue, 18 Jun 2024 09:17:03 -0400

>> I pushed to the branch `scratch/emacs-editorconfig` a bunch of patches
>> which add a few `lisp/editorconfig*.el` files.
>> The main effect is to define a new (global) minor mode
>> `editorconfig-mode` (I assumed we'll keep it disabled by default in
>> Emacs-30, but I think it would make sense to enable by default in
>> Emacs-31 (i.e. on `master` after the branch is cut)) as well as a new
>> major mode `editorconfig-conf-mode` to edit `.editorconfig` files.
> Is it possible for major modes to indicate that [*] editorconfig setting
> must not be used?

In the upstream package, yes, but I have not included that part
currently in the code I submit to Emacs.

> In particular, Org mode needs to use a fixed `tab-width' and
> editorconfig must not override that (it is a part of the syntax).

I don't understand: `tab-width` mostly affects the display, how can it
break Org mode?

In any case, Org is not the only mode with such needs (Makefile, Haskell,
Python, come to mind).  But also, disabling editorconfig wholesale seems
a bit crude.  Maybe we'll need a more targeted way to address the problem
(and there's always `hack-local-variables-hook`).

> We already had a user reporting problems caused by
> https://github.com/editorconfig/editorconfig-emacs where tab-width was
> changed to 4 by default.

The upstream code sets `tab-width` in more cases than the code
I'm submitting, so maybe I already fixed the problem?
Do you have a more precise URL for the issue?

        Stefan