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

Previous Next

Package: emacs;

Reported by: Damien Cassou <damien <at> cassou.me>

Date: Sat, 24 Aug 2024 13:37:01 UTC

Severity: normal

Tags: wontfix

Merged with 72808

Found in version 30.0.90

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Damien Cassou <damien <at> cassou.me>
To: 72790 <at> debbugs.gnu.org
Cc: Jay Kamat <jaygkamat <at> gmail.com>, 10sr <8.slashes <at> gmail.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#72790: 30.0.90; editorconfig doesn't set tab_width to a default value
Date: Sat, 24 Aug 2024 15:32:52 +0200
[Message part 1 (text/plain, inline)]
Hi,

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,
the Emacs variable `tab-width` isn't set by the builtin version of
`editorconfig-mode` in this case.

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

How to reproduce:

1. Create a directory "~/tmp/emacs-test-indent-size"
2. Put the 2 attached files (".editorconfig" and "foo.js") inside
3. Run the code below

$ emacs --batch -Q \
  --eval "(require 'editorconfig)" \
  --eval "(find-file \"~/tmp/emacs-test-indent-size/foo.js\")" \
  --eval "(editorconfig-apply)" \
  --eval "(message \"%S\" (map-keys editorconfig-properties-hash)))"

Actual: (indent_style indent_size)
Expected: (indent_style indent_size tab_width)

4. Download editorconfig version 20240813.801 from [2]
5. Rerun the command above but with the following as first --eval argument:

   --eval "(add-to-list 'load-path \"/path/to/editorconfig-20240813.801\")" 

You get the expected result.

  [1] https://editorconfig.org/
  [2] https://melpa.org/#/editorconfig

In GNU Emacs 30.0.90 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
version 1.18.0, Xaw3d scroll bars)
Repository revision: 391e6f99fc8eed9cf2ede473b84be194aaab21c7
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12014000
System Description: Fedora Linux 40 (Workstation Edition)

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
[.editorconfig (application/octet-stream, attachment)]
[foo.js (text/javascript, attachment)]

This bug report was last modified 202 days ago.

Previous Next


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