unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#72808: 30.0.90; editorconfig doesn't set tab_width to a default value
       [not found] <pmg-aquar-1261481-87le0mrqpn.fsf@cassou.me>
@ 2024-08-25 19:25 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-08-25 20:23   ` Damien Cassou
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-08-25 19:25 UTC (permalink / raw)
  To: Damien Cassou; +Cc: 72808, jaygkamat, 8.slashes

> 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.






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#72808: 30.0.90; editorconfig doesn't set tab_width to a default value
  2024-08-25 19:25 ` bug#72808: 30.0.90; editorconfig doesn't set tab_width to a default value Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-08-25 20:23   ` Damien Cassou
  2024-09-07  7:27     ` Eli Zaretskii
  2024-11-01  2:09     ` Stefan Kangas
  0 siblings, 2 replies; 9+ messages in thread
From: Damien Cassou @ 2024-08-25 20:23 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 72808, jaygkamat, 8.slashes

Hi Stefan,

Stefan Monnier <monnier@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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#72808: 30.0.90; editorconfig doesn't set tab_width to a default value
  2024-08-25 20:23   ` Damien Cassou
@ 2024-09-07  7:27     ` Eli Zaretskii
  2024-09-08 11:25       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-11-01  2:09     ` Stefan Kangas
  1 sibling, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2024-09-07  7:27 UTC (permalink / raw)
  To: monnier, Damien Cassou; +Cc: 72808, jaygkamat, 8.slashes

> Cc: 72808@debbugs.gnu.org, jaygkamat@gmail.com, 8.slashes@gmail.com
> From: Damien Cassou <damien@cassou.me>
> Date: Sun, 25 Aug 2024 22:23:14 +0200
> 
> Hi Stefan,
> 
> Stefan Monnier <monnier@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?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#72808: 30.0.90; editorconfig doesn't set tab_width to a default value
  2024-09-07  7:27     ` Eli Zaretskii
@ 2024-09-08 11:25       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-09-21  9:07         ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-09-08 11:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Damien Cassou, 72808, jaygkamat, 8.slashes

>> 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






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#72808: 30.0.90; editorconfig doesn't set tab_width to a default value
  2024-09-08 11:25       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-09-21  9:07         ` Eli Zaretskii
  0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2024-09-21  9:07 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: damien, 72808, jaygkamat, 8.slashes

tags 72808 wontfix
close 72808
thanks

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Damien Cassou <damien@cassou.me>,  72808@debbugs.gnu.org,
>   jaygkamat@gmail.com,  8.slashes@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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#72808: 30.0.90; editorconfig doesn't set tab_width to a default value
  2024-08-25 20:23   ` Damien Cassou
  2024-09-07  7:27     ` Eli Zaretskii
@ 2024-11-01  2:09     ` Stefan Kangas
  2024-11-01  2:42       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 9+ messages in thread
From: Stefan Kangas @ 2024-11-01  2:09 UTC (permalink / raw)
  To: Damien Cassou, Stefan Monnier; +Cc: 72808, jaygkamat, 8.slashes

[Resending after unarchiving the bug.]

Damien Cassou <damien@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?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#72808: 30.0.90; editorconfig doesn't set tab_width to a default value
  2024-11-01  2:09     ` Stefan Kangas
@ 2024-11-01  2:42       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-11-01  7:37         ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-11-01  2:42 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Damien Cassou, 72808, jaygkamat, 8.slashes

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






^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#72808: 30.0.90; editorconfig doesn't set tab_width to a default value
  2024-11-01  2:42       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-11-01  7:37         ` Eli Zaretskii
  2024-11-01 10:51           ` Damien Cassou
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2024-11-01  7:37 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: damien, 72808, jaygkamat, stefankangas, 8.slashes

> Cc: Damien Cassou <damien@cassou.me>, 72808@debbugs.gnu.org,
>  jaygkamat@gmail.com, 8.slashes@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@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?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#72808: 30.0.90; editorconfig doesn't set tab_width to a default value
  2024-11-01  7:37         ` Eli Zaretskii
@ 2024-11-01 10:51           ` Damien Cassou
  0 siblings, 0 replies; 9+ messages in thread
From: Damien Cassou @ 2024-11-01 10:51 UTC (permalink / raw)
  To: Eli Zaretskii, Stefan Monnier; +Cc: 72808, jaygkamat, stefankangas, 8.slashes

Hi Eli,

Eli Zaretskii <eliz@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





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-11-01 10:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <pmg-aquar-1261481-87le0mrqpn.fsf@cassou.me>
2024-08-25 19:25 ` bug#72808: 30.0.90; editorconfig doesn't set tab_width to a default value Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-25 20:23   ` Damien Cassou
2024-09-07  7:27     ` Eli Zaretskii
2024-09-08 11:25       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-21  9:07         ` Eli Zaretskii
2024-11-01  2:09     ` Stefan Kangas
2024-11-01  2:42       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-01  7:37         ` Eli Zaretskii
2024-11-01 10:51           ` Damien Cassou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).