aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2024-10-27 08:23:06 -0400
committerEli Zaretskii2024-10-27 08:23:06 -0400
commite4e3def201c1fc52785efe032c67ec383a2af93a (patch)
tree03b661f0fbae80c33a6823b1813a39e26bfcfcf2
parent20120bdfa420abaa1c7fb9a134c1970f047aa3f8 (diff)
parentdd52839dd9d5f5af1f961e3ace2554931ec66510 (diff)
downloademacs-e4e3def201c1fc52785efe032c67ec383a2af93a.tar.gz
emacs-e4e3def201c1fc52785efe032c67ec383a2af93a.zip
Merge from origin/emacs-30
dd52839dd9d * lisp/editorconfig.el (editorconfig--get-indentation): F...
-rw-r--r--lisp/editorconfig.el14
1 files changed, 12 insertions, 2 deletions
diff --git a/lisp/editorconfig.el b/lisp/editorconfig.el
index c21e12559a6..fbc7a59d823 100644
--- a/lisp/editorconfig.el
+++ b/lisp/editorconfig.el
@@ -434,8 +434,18 @@ heuristic for those modes not found there."
434 (let ((style (gethash 'indent_style props)) 434 (let ((style (gethash 'indent_style props))
435 (size (gethash 'indent_size props)) 435 (size (gethash 'indent_size props))
436 (tab_width (gethash 'tab_width props))) 436 (tab_width (gethash 'tab_width props)))
437 (when tab_width 437 (cond
438 (setq tab_width (string-to-number tab_width))) 438 (tab_width (setq tab_width (string-to-number tab_width)))
439 ;; The EditorConfig spec is excessively eager to set `tab-width'
440 ;; even when not explicitly requested (bug#73991).
441 ;; As a trade-off, we accept `indent_style=tab' as a good enough hint.
442 ((and (equal style "tab") (editorconfig-string-integer-p size))
443 (setq tab_width (string-to-number size))))
444
445 ;; When users choose `indent_size=tab', they most likely prefer
446 ;; `indent_style=tab' as well.
447 (when (and (null style) (equal size "tab"))
448 (setq style "tab"))
439 449
440 (setq size 450 (setq size
441 (cond ((editorconfig-string-integer-p size) 451 (cond ((editorconfig-string-integer-p size)