From unknown Sun Jun 22 04:36:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72790: 30.0.90; editorconfig doesn't set tab_width to a default value Resent-From: Damien Cassou Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Aug 2024 13:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 72790 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 72790@debbugs.gnu.org Cc: Jay Kamat , 10sr <8.slashes@gmail.com>, Stefan Monnier X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.172450656427736 (code B ref -1); Sat, 24 Aug 2024 13:37:01 +0000 Received: (at submit) by debbugs.gnu.org; 24 Aug 2024 13:36:04 +0000 Received: from localhost ([127.0.0.1]:40718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1shqw0-0007DH-3R for submit@debbugs.gnu.org; Sat, 24 Aug 2024 09:36:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:47734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1shqvw-0007D1-9j for submit@debbugs.gnu.org; Sat, 24 Aug 2024 09:36:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1shqt4-000449-44 for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2024 09:33:02 -0400 Received: from mail.reprendre.net ([2001:910:1410:501::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1shqt1-0001uT-Fu for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2024 09:33:01 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 4BD512C0AC3; Sat, 24 Aug 2024 15:32:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cassou.me; s=dkim; t=1724506374; h=from:subject:date:message-id:to:cc:mime-version:content-type; bh=AzT0eh+cnmzDl166P/YYE9rO7WJlGHvZMWTyR/6Za1s=; b=Vk1f2O8Mvg5HPryb6FeJO2jrJJiqJ/IhhuTNri8awKn1oQlvoDYOEGkOL9uU7n252uyLAG UtFKtTVwB/NkZX/YZVl9efVVeqqmDN1WNqGVNbbdsfOWQBNL/IgomztkpVLqjBybEpz92z aciNX3Jv7m6muJf5G/dzO3rxsy9itwiqlEHiHbntu4lg2lno0qKCxojbhiT1u9/rKLpMOZ HxkaXs+uu3TvNk2yk5SRDw2sLbg+lVY4IT4fuZyp87B8e7KD5NH+IpYpnNag41a26I16EF sCgv39/va7ayE57vz1cjj+72niMeFmYKvps0oJxKGq/Wfiz//iWRIZXsCcEndQ== From: Damien Cassou Date: Sat, 24 Aug 2024 15:32:52 +0200 Message-ID: <87le0mrqpn.fsf@cassou.me> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Last-TLS-Session-Version: TLSv1.3 Received-SPF: pass client-ip=2001:910:1410:501::1; envelope-from=damien@cassou.me; helo=mail.reprendre.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=.editorconfig Content-Transfer-Encoding: base64 cm9vdCA9IHRydWUKClsqXQppbmRlbnRfc3R5bGUgPSB0YWIKaW5kZW50X3NpemUgPSA0Cgo= --=-=-= Content-Type: text/javascript Content-Disposition: attachment; filename=foo.js function foo() { f(); } --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 31 22:42:43 2024 Received: (at control) by debbugs.gnu.org; 1 Nov 2024 02:42:43 +0000 Received: from localhost ([127.0.0.1]:46075 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6hcY-0004IJ-U1 for submit@debbugs.gnu.org; Thu, 31 Oct 2024 22:42:43 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:2088) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t6hcW-0004I4-GN; Thu, 31 Oct 2024 22:42:41 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id DFFB14444CF; Thu, 31 Oct 2024 22:42:33 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1730428952; bh=L9PIajgRE4QRBp+UPt5hiaUVHzkf5oAxYOTx/vPfO3A=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=kFgLI2H7ipK7fPtM2XD9AM7WvumAZuDtD25nbWvfNKYexiGohd3el454AWtFx4vID NpUaccY1yGLXWrGw7Hlly3LNIgDuJZnl8x5hBOGpcsSsyP1S7zn808T6GWOU/SyH/J FjlKk6N1yhsSbpRYuXvPnINMFoDqkge9isJaMFltlqwE1RO4GzM77UUI7HXI/fXBfq sePaxPge6ey2NO8dKeFVY+LKywHQIV8FpLV1CueiqbTjj0TsklGEi38tQcpmcCUOZF 7jE0qYcUI1op0HdCHnW4WLWToybJoDSziLMSkkzVg78QK+SqA4RG5pPeK/fRshJ/ya QvEQ/xC8nGwLw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id BF01B4444CC; Thu, 31 Oct 2024 22:42:32 -0400 (EDT) Received: from pastel (104-195-225-43.cpe.teksavvy.com [104.195.225.43]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 783AE1200A3; Thu, 31 Oct 2024 22:42:32 -0400 (EDT) From: Stefan Monnier To: Stefan Kangas Subject: Re: bug#72808: 30.0.90; editorconfig doesn't set tab_width to a default value In-Reply-To: (Stefan Kangas's message of "Thu, 31 Oct 2024 19:09:21 -0700") Message-ID: References: <87seusbbd9.fsf@cassou.me> Date: Thu, 31 Oct 2024 22:42:31 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.036 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control Cc: Damien Cassou , 72808@debbugs.gnu.org, jaygkamat@gmail.com, 8.slashes@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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=F0=9F=99=82) installed = in `emacs-30` a patch which should make Emacs behave like Damien expects for the `.editorconfig` file he provided. Stefan