GNU bug report logs - #72808
30.0.90; editorconfig doesn't set tab_width to a default value

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Sun, 25 Aug 2024 19:28:01 UTC

Severity: normal

Tags: wontfix

Merged with 72790

Found in version 30.0.90

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 72808 in the body.
You can then email your comments to 72808 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#72808; Package emacs. (Sun, 25 Aug 2024 19:28:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 25 Aug 2024 19:28:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Damien Cassou <damien <at> cassou.me>
Cc: bug-gnu-emacs <at> gnu.org, Jay Kamat <jaygkamat <at> gmail.com>,
 10sr <8.slashes <at> gmail.com>
Subject: Re: 30.0.90; editorconfig doesn't set tab_width to a default value
Date: Sun, 25 Aug 2024 15:25:56 -0400
> when a .editorconfig file assigns a value for "indent_size" and no
> value for "tab_width", I expect "tab_width" to default to the value of
> "indent_size" as described in the documentation [1]. Unfortunately,

Yes, I consciously disagreed with the standard here.  IMO, this better
reflects Emacs's habitual behavior, so it makes more sense for Emacs users.

> Possible workarounds:
>
> 1. One can use MELPA's version of editorconfig instead of the builtin
>    one; or
> 2. One can explicitly set "tab_width" in .editorconfig

Indeed, you can already get the "missing" behavior  by setting
`indent_size` to `tab` and then setting `tab_width` to the desired
indentation size.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72808; Package emacs. (Sun, 25 Aug 2024 20:25:01 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Damien Cassou <damien <at> cassou.me>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: bug-gnu-emacs <at> gnu.org, Jay Kamat <jaygkamat <at> gmail.com>,
 10sr <8.slashes <at> gmail.com>
Subject: Re: 30.0.90; editorconfig doesn't set tab_width to a default value
Date: Sun, 25 Aug 2024 22:23:14 +0200
Hi Stefan,

Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>> when a .editorconfig file assigns a value for "indent_size" and no
>> value for "tab_width", I expect "tab_width" to default to the value of
>> "indent_size" as described in the documentation [1]. Unfortunately,
>
> Yes, I consciously disagreed with the standard here.  IMO, this better
> reflects Emacs's habitual behavior, so it makes more sense for Emacs users.
>
> Indeed, you can already get the "missing" behavior  by setting
> `indent_size` to `tab` and then setting `tab_width` to the desired
> indentation size.

The problem is that the .editorconfig file can be shared across users of
different editors for a given project. Emacs disagreeing with the
standard means that Emacs users will now have to explain to their
colleagues why they are introducing a change in a .editorconfig file
that the standard says is unnecessary. This is putting me, at least, in
an uncomfortable position with non-Emacs users in my team. Additionally,
if other editors disagree with the standard for other reasons, we may
quickly reach a situation where no content of .editorconfig will suit
everyone.

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72808; Package emacs. (Sat, 07 Sep 2024 07:28:01 GMT) Full text and rfc822 format available.

Message #11 received at 72808 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: monnier <at> iro.umontreal.ca, Damien Cassou <damien <at> cassou.me>
Cc: 72808 <at> debbugs.gnu.org, jaygkamat <at> gmail.com, 8.slashes <at> gmail.com
Subject: Re: bug#72808: 30.0.90;
 editorconfig doesn't set tab_width to a default value
Date: Sat, 07 Sep 2024 10:27:44 +0300
> Cc: 72808 <at> debbugs.gnu.org, jaygkamat <at> gmail.com, 8.slashes <at> gmail.com
> From: Damien Cassou <damien <at> cassou.me>
> Date: Sun, 25 Aug 2024 22:23:14 +0200
> 
> Hi Stefan,
> 
> Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
> >> when a .editorconfig file assigns a value for "indent_size" and no
> >> value for "tab_width", I expect "tab_width" to default to the value of
> >> "indent_size" as described in the documentation [1]. Unfortunately,
> >
> > Yes, I consciously disagreed with the standard here.  IMO, this better
> > reflects Emacs's habitual behavior, so it makes more sense for Emacs users.
> >
> > Indeed, you can already get the "missing" behavior  by setting
> > `indent_size` to `tab` and then setting `tab_width` to the desired
> > indentation size.
> 
> The problem is that the .editorconfig file can be shared across users of
> different editors for a given project. Emacs disagreeing with the
> standard means that Emacs users will now have to explain to their
> colleagues why they are introducing a change in a .editorconfig file
> that the standard says is unnecessary. This is putting me, at least, in
> an uncomfortable position with non-Emacs users in my team. Additionally,
> if other editors disagree with the standard for other reasons, we may
> quickly reach a situation where no content of .editorconfig will suit
> everyone.

Stefan, any further comments, or should we close this as wontfix?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72808; Package emacs. (Sun, 08 Sep 2024 11:26:01 GMT) Full text and rfc822 format available.

Message #14 received at 72808 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Damien Cassou <damien <at> cassou.me>, 72808 <at> debbugs.gnu.org,
 jaygkamat <at> gmail.com, 8.slashes <at> gmail.com
Subject: Re: bug#72808: 30.0.90; editorconfig doesn't set tab_width to a
 default value
Date: Sun, 08 Sep 2024 07:25:17 -0400
>> The problem is that the .editorconfig file can be shared across users of
>> different editors for a given project. Emacs disagreeing with the
>> standard means that Emacs users will now have to explain to their
>> colleagues why they are introducing a change in a .editorconfig file
>> that the standard says is unnecessary. This is putting me, at least, in
>> an uncomfortable position with non-Emacs users in my team. Additionally,
>> if other editors disagree with the standard for other reasons, we may
>> quickly reach a situation where no content of .editorconfig will suit
>> everyone.
> Stefan, any further comments, or should we close this as wontfix?

I think Damien's argument makes a lot of sense.
I think mine makes sense as well.
I can't really judge which one will work out more often right, but as
the writer of the code I decided to try out my choice.

But I don't have a really strong opinion about it (I do have a strong
opinion that the EditorConfig standard's choice is wrong, but not
whether we should follow it or not): if you think Damien's preference is
better for Emacs, I'm fine to make the change.

Otherwise, I suggest we leave it like that for Emacs-30 and see how
things turn out.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72808; Package emacs. (Sat, 21 Sep 2024 09:09:02 GMT) Full text and rfc822 format available.

Message #17 received at 72808 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: damien <at> cassou.me, 72808 <at> debbugs.gnu.org, jaygkamat <at> gmail.com,
 8.slashes <at> gmail.com
Subject: Re: bug#72808: 30.0.90; editorconfig doesn't set tab_width to a
 default value
Date: Sat, 21 Sep 2024 12:07:43 +0300
tags 72808 wontfix
close 72808
thanks

> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: Damien Cassou <damien <at> cassou.me>,  72808 <at> debbugs.gnu.org,
>   jaygkamat <at> gmail.com,  8.slashes <at> gmail.com
> Date: Sun, 08 Sep 2024 07:25:17 -0400
> 
> >> The problem is that the .editorconfig file can be shared across users of
> >> different editors for a given project. Emacs disagreeing with the
> >> standard means that Emacs users will now have to explain to their
> >> colleagues why they are introducing a change in a .editorconfig file
> >> that the standard says is unnecessary. This is putting me, at least, in
> >> an uncomfortable position with non-Emacs users in my team. Additionally,
> >> if other editors disagree with the standard for other reasons, we may
> >> quickly reach a situation where no content of .editorconfig will suit
> >> everyone.
> > Stefan, any further comments, or should we close this as wontfix?
> 
> I think Damien's argument makes a lot of sense.
> I think mine makes sense as well.
> I can't really judge which one will work out more often right, but as
> the writer of the code I decided to try out my choice.
> 
> But I don't have a really strong opinion about it (I do have a strong
> opinion that the EditorConfig standard's choice is wrong, but not
> whether we should follow it or not): if you think Damien's preference is
> better for Emacs, I'm fine to make the change.
> 
> Otherwise, I suggest we leave it like that for Emacs-30 and see how
> things turn out.

I'm okay with closing this as wontfix.  Let's see if we have more
complaints like this.




Added tag(s) wontfix. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 21 Sep 2024 09:09:03 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 72808 <at> debbugs.gnu.org and Stefan Monnier <monnier <at> iro.umontreal.ca> Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 21 Sep 2024 09:09:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 19 Oct 2024 11:24:06 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 01 Nov 2024 02:09:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72808; Package emacs. (Fri, 01 Nov 2024 02:11:01 GMT) Full text and rfc822 format available.

Message #28 received at 72808 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Damien Cassou <damien <at> cassou.me>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 72808 <at> debbugs.gnu.org, jaygkamat <at> gmail.com, 8.slashes <at> gmail.com
Subject: Re: bug#72808: 30.0.90; editorconfig doesn't set tab_width to a
 default value
Date: Thu, 31 Oct 2024 19:09:21 -0700
[Resending after unarchiving the bug.]

Damien Cassou <damien <at> cassou.me> writes:

> The problem is that the .editorconfig file can be shared across users of
> different editors for a given project. Emacs disagreeing with the
> standard means that Emacs users will now have to explain to their
> colleagues why they are introducing a change in a .editorconfig file
> that the standard says is unnecessary. This is putting me, at least, in
> an uncomfortable position with non-Emacs users in my team. Additionally,
> if other editors disagree with the standard for other reasons, we may
> quickly reach a situation where no content of .editorconfig will suit
> everyone.

I agree, FWIW.

This makes our .editorconfig support less useful than it could be.  The
point, to my mind at least, is exactly that users *shouldn't* have to do
any extra work to get the right settings when opening a new project.  If
it has a correct .editorconfig file, everything should Just Work (TM).

IOW, the user experience I prefer is not "new project, so now you have
to send yet another .editorconfig patch".  At $WORK, for example, this
is complicated by things like which team maintains a given repository,
how amenable they are likely to be to a seemingly redundant patch to
improve support for Emacs, etc.  In all likelihood, I will just end up
creating .dir-locals.el files instead, to avoid the discussion.

If we insist on this, how about adding an option to turn the
incompatible behaviour off?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72808; Package emacs. (Fri, 01 Nov 2024 02:43:01 GMT) Full text and rfc822 format available.

Message #31 received at 72808 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: Damien Cassou <damien <at> cassou.me>, 72808 <at> debbugs.gnu.org,
 jaygkamat <at> gmail.com, 8.slashes <at> gmail.com
Subject: Re: bug#72808: 30.0.90; editorconfig doesn't set tab_width to a
 default value
Date: Thu, 31 Oct 2024 22:42:31 -0400
forcemerge 72808 72790
thanks

>> The problem is that the .editorconfig file can be shared across users of
>> different editors for a given project. Emacs disagreeing with the
>> standard means that Emacs users will now have to explain to their
>> colleagues why they are introducing a change in a .editorconfig file
>> that the standard says is unnecessary. This is putting me, at least, in
>> an uncomfortable position with non-Emacs users in my team. Additionally,
>> if other editors disagree with the standard for other reasons, we may
>> quickly reach a situation where no content of .editorconfig will suit
>> everyone.
>
> I agree, FWIW.
>
> This makes our .editorconfig support less useful than it could be.  The
> point, to my mind at least, is exactly that users *shouldn't* have to do
> any extra work to get the right settings when opening a new project.  If
> it has a correct .editorconfig file, everything should Just Work (TM).
>
> IOW, the user experience I prefer is not "new project, so now you have
> to send yet another .editorconfig patch".  At $WORK, for example, this
> is complicated by things like which team maintains a given repository,
> how amenable they are likely to be to a seemingly redundant patch to
> improve support for Emacs, etc.  In all likelihood, I will just end up
> creating .dir-locals.el files instead, to avoid the discussion.
>
> If we insist on this, how about adding an option to turn the
> incompatible behaviour off?

Note that in response to the very similar request in bug#73991 (where
I also point out more reasons why I think the EditorConfig spec is just
poorly thought out in this respect), I (reluctantly🙂) installed in
`emacs-30` a patch which should make Emacs behave like Damien expects
for the `.editorconfig` file he provided.


        Stefan





Forcibly Merged 72790 72808. Request was from Stefan Monnier <monnier <at> iro.umontreal.ca> to control <at> debbugs.gnu.org. (Fri, 01 Nov 2024 02:43:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72808; Package emacs. (Fri, 01 Nov 2024 07:38:02 GMT) Full text and rfc822 format available.

Message #36 received at 72808 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: damien <at> cassou.me, 72808 <at> debbugs.gnu.org, jaygkamat <at> gmail.com,
 stefankangas <at> gmail.com, 8.slashes <at> gmail.com
Subject: Re: bug#72808: 30.0.90;
 editorconfig doesn't set tab_width to a default value
Date: Fri, 01 Nov 2024 09:37:22 +0200
> Cc: Damien Cassou <damien <at> cassou.me>, 72808 <at> debbugs.gnu.org,
>  jaygkamat <at> gmail.com, 8.slashes <at> gmail.com
> Date: Thu, 31 Oct 2024 22:42:31 -0400
> From:  Stefan Monnier via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> Note that in response to the very similar request in bug#73991 (where
> I also point out more reasons why I think the EditorConfig spec is just
> poorly thought out in this respect), I (reluctantly🙂) installed in
> `emacs-30` a patch which should make Emacs behave like Damien expects
> for the `.editorconfig` file he provided.

Indeed.  Moreover, people who claim that we must behave like other
editors should also explain how to reconcile that with the fact that
Emacs has a much more complex handling of tab-width wrt indentation,
and in particular we almost completely decoupled these two.  It is
IMNSHO unthinkable that support of EditorConfig will change how Emacs
handles tabs and indentation in its various major modes.

So saying that we should comply is not enough, because everyone here
is in favor of compliance.  The problem, and the reason why Stefan
didn't comply 100% with that single setting, is that there are
significant conceptual problems with providing such compliance without
breaking expectations of Emacs users.  Thus, if you think what we have
is insufficient, please tell how to be more compatible without
breaking traditional Emacs behaviors wrt to tabs and indentation.
Because we cannot possibly allow that tail to wag the dog, can we?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72808; Package emacs. (Fri, 01 Nov 2024 10:52:01 GMT) Full text and rfc822 format available.

Message #39 received at 72808 <at> debbugs.gnu.org (full text, mbox):

From: Damien Cassou <damien <at> cassou.me>
To: Eli Zaretskii <eliz <at> gnu.org>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 72808 <at> debbugs.gnu.org, jaygkamat <at> gmail.com, stefankangas <at> gmail.com,
 8.slashes <at> gmail.com
Subject: Re: bug#72808: 30.0.90; editorconfig doesn't set tab_width to a
 default value
Date: Fri, 01 Nov 2024 11:51:10 +0100
Hi Eli,

Eli Zaretskii <eliz <at> gnu.org> writes:
> Indeed.  Moreover, people who claim that we must behave like other
> editors should also explain how to reconcile that with the fact that
> Emacs has a much more complex handling of tab-width wrt indentation,
> and in particular we almost completely decoupled these two.

it is highly possible that the editorconfig file format isn't as
powerful as what Emacs provides. It would make sense for someone
knowledgeable to discuss these arguments in the editorconfig's mailing
list: https://editorconfig.org/#contributing.

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 29 Nov 2024 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 203 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.