aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2011-08-24 16:33:55 +0900
committerKenichi Handa2011-08-24 16:33:55 +0900
commitde62b4dfd0dd8254aee693b3c583386e050fb739 (patch)
tree5af21d6557b292cacb98278dd82a9741e8e7bb7f
parent963b492b635cd33a6a5dd46119208a378e3e6378 (diff)
downloademacs-de62b4dfd0dd8254aee693b3c583386e050fb739.tar.gz
emacs-de62b4dfd0dd8254aee693b3c583386e050fb739.zip
international/ucs-normalize.el: If decomposition property of CHAR is the default one (i.e. a list of CHAR itself), treat it as nil.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/international/ucs-normalize.el10
2 files changed, 15 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 85253feacc5..2a33661c9c5 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12011-08-24 Kenichi Handa <handa@m17n.org>
2
3 * international/ucs-normalize.el: If decomposition property of
4 CHAR is the default one (i.e. a list of CHAR itself), treat it as
5 nil.
6 (nfd, nfkd): Likewise.
7
12011-08-24 Stefan Monnier <monnier@iro.umontreal.ca> 82011-08-24 Stefan Monnier <monnier@iro.umontreal.ca>
2 9
3 * mpc.el (mpc--proc-filter): Don't signal mpc-proc-error since signals 10 * mpc.el (mpc--proc-filter): Don't signal mpc-proc-error since signals
diff --git a/lisp/international/ucs-normalize.el b/lisp/international/ucs-normalize.el
index f83e0f7588f..df05b355b46 100644
--- a/lisp/international/ucs-normalize.el
+++ b/lisp/international/ucs-normalize.el
@@ -139,14 +139,17 @@
139 (defun nfd (char) 139 (defun nfd (char)
140 (let ((decomposition 140 (let ((decomposition
141 (get-char-code-property char 'decomposition))) 141 (get-char-code-property char 'decomposition)))
142 (if (and decomposition (numberp (car decomposition))) 142 (if (and decomposition (numberp (car decomposition))
143 (or (> (length decomposition) 1)
144 (/= (car decomposition) char)))
143 decomposition))) 145 decomposition)))
144 146
145 (defun nfkd (char) 147 (defun nfkd (char)
146 (let ((decomposition 148 (let ((decomposition
147 (get-char-code-property char 'decomposition))) 149 (get-char-code-property char 'decomposition)))
148 (if (symbolp (car decomposition)) (cdr decomposition) 150 (if (symbolp (car decomposition)) (cdr decomposition)
149 decomposition))) 151 (if (or (> (length decomposition) 1)
152 (/= (car decomposition) char)) decomposition))))
150 153
151 (defun hfs-nfd (char) 154 (defun hfs-nfd (char)
152 (when (or (and (>= char 0) (< char #x2000)) 155 (when (or (and (>= char 0) (< char #x2000))
@@ -180,6 +183,9 @@
180 (setq ccc (ucs-normalize-ccc char)) 183 (setq ccc (ucs-normalize-ccc char))
181 (setq decomposition (get-char-code-property 184 (setq decomposition (get-char-code-property
182 char 'decomposition)) 185 char 'decomposition))
186 (if (and (= (length decomposition) 1)
187 (= (car decomposition) char))
188 (setq decomposition nil))
183 (if (and ccc (/= 0 ccc)) (add-to-list 'combining-chars char)) 189 (if (and ccc (/= 0 ccc)) (add-to-list 'combining-chars char))
184 (if (and (numberp (car decomposition)) 190 (if (and (numberp (car decomposition))
185 (/= (ucs-normalize-ccc (car decomposition)) 191 (/= (ucs-normalize-ccc (car decomposition))