branch: scratch/editorconfig-cc commit 480a6bba4761fe1074bd70b4dc9cb461e50fa3b4 Author: Hong Xu <h...@topbug.net> Commit: Stefan Monnier <monn...@iro.umontreal.ca>
Fix some issues caused by the previous commit. --- editorconfig.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/editorconfig.el b/editorconfig.el index 652f9eb173..d3378e4ff4 100644 --- a/editorconfig.el +++ b/editorconfig.el @@ -48,12 +48,14 @@ (defun edconf-string-integer-p (string) "Whether a string representing integer" - (string-match-p "\\`[0-9]+\\'" string)) + (if (stringp string) + (string-match-p "\\`[0-9]+\\'" string) + nil)) (defun edconf-set-indentation (style &optional size tab_width) - (if (and (edconf-string-integer-p size) (not (equal size "tab"))) + (if (edconf-string-integer-p size) (setq size (string-to-number size)) - (setq size nil)) + (when (not (equal size "tab")) (setq size nil))) (setq web-mode-indent-style 2) LaTeX-indent-level size LaTeX-item-indent size