[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] scratch/editorconfig-cc 92519a8c25 022/351: Don't set indent si
From: |
Stefan Monnier |
Subject: |
[nongnu] scratch/editorconfig-cc 92519a8c25 022/351: Don't set indent size if the given value makes no sense. |
Date: |
Thu, 13 Jun 2024 18:38:38 -0400 (EDT) |
branch: scratch/editorconfig-cc
commit 92519a8c255cfd7d2b730842c7cb00304f992735
Author: Hong Xu <hong@topbug.net>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
Don't set indent size if the given value makes no sense.
---
editorconfig.el | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/editorconfig.el b/editorconfig.el
index d7266c39e6..652f9eb173 100644
--- a/editorconfig.el
+++ b/editorconfig.el
@@ -46,7 +46,14 @@
(defvar edconf-exec-path "editorconfig")
+(defun edconf-string-integer-p (string)
+ "Whether a string representing integer"
+ (string-match-p "\\`[0-9]+\\'" string))
+
(defun edconf-set-indentation (style &optional size tab_width)
+ (if (and (edconf-string-integer-p size) (not (equal size "tab")))
+ (setq size (string-to-number size))
+ (setq size nil))
(setq web-mode-indent-style 2)
LaTeX-indent-level size
LaTeX-item-indent size
@@ -67,7 +74,7 @@
(defun edconf-set-line-length (length)
"set the max line length (fill-column)"
- (if length
+ (when (edconf-string-integer-p length)
(set-fill-column (string-to-number length))))
(defun edconf-get-properties ()
- [nongnu] scratch/editorconfig-cc 9fdc9cc689 218/351: Add variable editorconfig-trim-whitespaces-mode, (continued)
- [nongnu] scratch/editorconfig-cc 9fdc9cc689 218/351: Add variable editorconfig-trim-whitespaces-mode, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 96123213ed 229/351: Add support for Emacs24.5, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc de83e09632 243/351: Update docstring, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 4beeb9c830 253/351: Make editorconfig-properties-hash permanetn-local, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc ee5b70f1e2 068/351: editorocnfig-core: Throw error when parsing .editorconfig failed, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 3bdd68d5af 069/351: Add tcl-mode indentation support, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 32fb0d6b9c 056/351: Use `require` instead of `load` in usage example, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 903e483a70 052/351: Make `editorconfig-apply' an interactive command, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 4fd932bb7c 060/351: Check package metadata using ert framework, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 56722d34df 019/351: Add sh-indentation to the list of indent variable., Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 92519a8c25 022/351: Don't set indent size if the given value makes no sense.,
Stefan Monnier <=
- [nongnu] scratch/editorconfig-cc 242cc0ccea 045/351: Use core in elisp as a fallback, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc b1643c7360 077/351: Add support for scss-mode, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc e7a0874591 026/351: Add hook mechanism., Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc c02d94298b 082/351: Add editorocnfig-display-current-properties, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc e452e1d45b 086/351: Bump version to 0.7.4, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 1eabf1ce45 110/351: Add link to Melpa stable, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc 0057f62085 103/351: Bump version to 0.7.5, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc c9b5e73d1d 138/351: Add support for verilog-mode, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc aa57926fdf 163/351: docs -> doc, Stefan Monnier, 2024/06/13
- [nongnu] scratch/editorconfig-cc f2c8300dba 129/351: Add Usami Kenta to the contributor list., Stefan Monnier, 2024/06/13