Steinar Bang <s...@dod.no> writes:

>> May it be that you are using built-in version of edittorconfig?
> ...
> Library is file ~/.emacs.d/elpa/editorconfig-20250219.1528/editorconfig.elc

Ok. So, whatever the problem is, it is not with Emacs itself.
You may consider reporting about `editorconfig-exclude-regexps' to
editorconfig upstream.

As for Org mode, may you try another version of the patch (attached)?

>From 97ded0b6a7e014e55dc437bca1330b31246e4617 Mon Sep 17 00:00:00 2001
Message-ID: <97ded0b6a7e014e55dc437bca1330b31246e4617.1742024480.git.yanta...@posteo.net>
From: Ihor Radchenko <yanta...@posteo.net>
Date: Wed, 12 Mar 2025 18:45:11 +0100
Subject: [PATCH v2] org-mode: Be more aggressive setting tab-width to 8

* lisp/org.el (org--set-tab-width): New helper to set `tab-width'.
(org-mode): Override file-local and directory-local settings for
`tab-width', if any.  With non-standard `tab-width', parser cannot
work properly.

Reported-by: Steinar Bang <s...@dod.no>
Link: https://orgmode.org/list/87msdrw5qt....@dod.no
---
 lisp/org.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index bc61a7c462..70a903b0d2 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -4970,6 +4970,10 @@ (defvar org-mode-tags-syntax-table
     st)
   "Syntax table including \"@\" and \"_\" as word constituents.")
 
+(defun org--set-tab-width ()
+  "Set `tab-width' to be 8."
+  (setq-local tab-width 8))
+
 ;;;###autoload
 (define-derived-mode org-mode outline-mode "Org"
   "Outline-based notes management and organizer, alias
@@ -4992,7 +4996,11 @@ (define-derived-mode org-mode outline-mode "Org"
   (setq-local org-mode-loading t)
   ;; Force tab width - indentation is significant in lists, so we need
   ;; to make sure that it is consistent across configurations.
-  (setq-local tab-width 8)
+  (org--set-tab-width)
+  ;; Really force it, even if dir-locals or file-locals set it - we
+  ;; need tab-width = 8 as a part of Org syntax.
+  (add-hook 'hack-local-variables-hook
+            #'org--set-tab-width -90 'local)
   (org-load-modules-maybe)
   (when org-agenda-file-menu-enabled
     (org-install-agenda-files-menu))
-- 
2.47.1

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to