GNU bug report logs -
#70105
30.0.50; Emacs should support EditorConfig out of the box
Previous Next
Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>
Date: Sun, 31 Mar 2024 13:45:01 UTC
Severity: normal
Found in version 30.0.50
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
Message #50 received at 70105 <at> debbugs.gnu.org (full text, mbox):
>>> 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?
> Because Org mode syntax depends on indentation for lists:
>
> - parent list
> - sub-list
> - sub-sub-list
>
> When the indentation has tabs in it, (current-indentation) return value
> becomes a variable of `tab-width'. As a result, Org file syntax
> unexpectedly becomes dependent on seemingly unrelated Emacs
> configuration toggle.
> (I also considered let-binding `tab-width' when Org parser the file, but
> lists will then look funny visually)
If you use the `tab-width` set by the user then you have the advantage
that you parse the code in a way that is consistent with what the users
see (so the problem only bites the users who don't look at their code).
If you parse with a fixed `tab-width` OTOH the user may be puzzled
because the code looks like one thing to them but you parse it as
something else.
>> 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`).
> I did not imply that editorconfig should be _completely_ disabled.
> Just for tab-width in our case.
I mentioned it because that's the option that the upstream package offers.
> I guess that `hack-local-variables-hook' should be an ok
> option. Although it feels a bit funny to:
> 1. Set tab-width in org-mode body
> 2. Set it again in hack-local-variables-hook
There's also the option of saying that it's the user's fault.
It's hard to tell in general what would be the right behavior, so
I think it's important we look at concrete cases.
> Hmm... Sorry, I cannot see anything in the list archives.
> Either I made things up in my mind or it was discussed on IRC/Matrix.
I guess we'll have to wait to see if the issue pops up again.
Stefan
This bug report was last modified 1 year and 21 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.