From e1ce171f98076d1183da0e7ee1447c8b13ea5dbc Mon Sep 17 00:00:00 2001 From: JSDurand Date: Wed, 26 May 2021 09:17:24 +0800 Subject: modeline: Fix an error about matching non-strings * modeline.el (modeline-length): I was matching a variable whose can be nil. Check if it is a string before matching solves the potential problem. Also remove two files that need not be under version-control. --- modeline.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'modeline.el') diff --git a/modeline.el b/modeline.el index cb06b0d..91b5b17 100644 --- a/modeline.el +++ b/modeline.el @@ -91,8 +91,10 @@ Characters that take up more than one column will be counted with (let ((name (get-char-code-property char 'name)) (decomposition (get-char-code-property char 'decomposition))) (cond - ((or (string-match (rx-to-string '(seq bos "CJK")) - name) + ((or (and + (stringp name) + (string-match (rx-to-string '(seq bos "CJK")) + name)) (eq (car decomposition) 'wide)) (setq len (+ len 1.7))) ((setq len (1+ len)))))) -- cgit v1.2.3-18-g5258