unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenta USAMI <zonuexe@zonu.me>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 73991@debbugs.gnu.org
Subject: bug#73991: EditorConfig bundled with Emacs 30 does not set tab-width
Date: Fri, 25 Oct 2024 12:44:31 +0900	[thread overview]
Message-ID: <CAJB2i6bbh6YJNSPyoOTxPrV1DWNDF-j4bnhPuPznAgMQK41_gg@mail.gmail.com> (raw)
In-Reply-To: <jwvmsitwam1.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 2396 bytes --]

Hi Stefan,

> You can get the same behavior with
>
>    indent_size = tab
>    tab_width = 4

The settings mean the same thing, but I contribute to several projects on
GitHub, so it wouldn't make sense to rewrite them all.

I accidentally replied to Eli about bug#72808 instead of to ML, so I'm
resending it.

-----

I read bug #72808 and I don't quite understand what you and Stefan are
saying.

> > Yes, I consciously disagreed with the standard here.  IMO, this better
> > reflects Emacs's habitual behavior, so it makes more sense for Emacs
users.
My feedback is as follows:

Without tab-width being honored, editing code in a project based on this
setting would easily cause Emacs to break the indentation of that file.
I've been an editorconfig-mode user since 2014 and I don't think the
behavior is reasonable.
If that were the default behavior I could correct it with advice, but
forcing that on a large number of users would be terrible.
At the very least, I wish they would document it and make tab_width an
opt-in option via a customization variable.



2024年10月25日(金) 4:56 Stefan Monnier <monnier@iro.umontreal.ca>:

> > In Emacs 30.0.91, the debugger does not respond when watching the
> variable.
>
> You can get the same behavior with
>
>     indent_size = tab
>     tab_width = 4
>
> BTW, I think the patch below is in order: if the user sets
> "indent_size=tab", which means that the "indentation step" should be
> equal to `tab-width`, then we should default `indent-tabs-mode` to
> t (which in EditorConfig parlance means to default `indent_style` to
> `tab`).
>
> Can I push this to `emacs-30` or do you, dear maintainers, prefer that
> I push it to `master`?
>
>
>         Stefan
>
>
> diff --git a/lisp/editorconfig.el b/lisp/editorconfig.el
> index c21e12559a6..478d94a2dc1 100644
> --- a/lisp/editorconfig.el
> +++ b/lisp/editorconfig.el
> @@ -437,6 +437,11 @@ editorconfig--get-indentation
>      (when tab_width
>        (setq tab_width (string-to-number tab_width)))
>
> +    ;; When users choose `indent_size=tab', they most likely prefer
> +    ;; `indent_style=tab' as well.
> +    (when (and (null style) (equal size "tab"))
> +      (setq style "tab"))
> +
>      (setq size
>            (cond ((editorconfig-string-integer-p size)
>                   (string-to-number size))
>
>

[-- Attachment #2: Type: text/html, Size: 3048 bytes --]

  reply	other threads:[~2024-10-25  3:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-24 17:49 bug#73991: EditorConfig bundled with Emacs 30 does not set tab-width Kenta USAMI
2024-10-24 18:05 ` Eli Zaretskii
2024-10-24 19:56 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-25  3:44   ` Kenta USAMI [this message]
2024-10-25  7:37     ` Eli Zaretskii
2024-10-25  9:07       ` Kenta USAMI
2024-10-25 10:18         ` Eli Zaretskii
2024-10-25 10:49           ` Kenta USAMI
2024-10-25 17:27         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-25 17:25     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-26 15:20       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-26 16:20         ` Kenta USAMI
2024-10-25  6:18   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJB2i6bbh6YJNSPyoOTxPrV1DWNDF-j4bnhPuPznAgMQK41_gg@mail.gmail.com \
    --to=zonuexe@zonu.me \
    --cc=73991@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).