summaryrefslogtreecommitdiff
path: root/modeline.el
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2021-05-26 09:17:24 +0800
committerJSDurand <mmemmew@gmail.com>2021-05-26 09:17:24 +0800
commite1ce171f98076d1183da0e7ee1447c8b13ea5dbc (patch)
tree76710e76371186bc889cd5598186105a281c28c3 /modeline.el
parent853c5214e4863330016cc983b6c5f30a5bcd3750 (diff)
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.
Diffstat (limited to 'modeline.el')
-rw-r--r--modeline.el6
1 files changed, 4 insertions, 2 deletions
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))))))