changeset 23687:9913df387dfb

(compose-chars-component): Signal error if CH is a rule-based composition character. (compose-chars): Signal error if an already compsed character is going to be composed by rule-base.
author Kenichi Handa <handa@m17n.org>
date Wed, 11 Nov 1998 03:36:15 +0000
parents 29fd5e07b576
children 5f039c506e17
files lisp/international/mule-util.el
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/mule-util.el	Wed Nov 11 03:36:15 1998 +0000
+++ b/lisp/international/mule-util.el	Wed Nov 11 03:36:15 1998 +0000
@@ -470,7 +470,9 @@
       (format "\240%c" (+ ch 128))
     (let ((str (string-as-unibyte (char-to-string ch))))
       (if (cmpcharp ch)
-	  (substring str (if (= (aref str 1) ?\xFF) 2 1))
+	  (if (= (aref str 1) ?\xFF)
+	      (error "Can't compose a rule-based composition character")
+	    (substring str (if (= (aref str 1) ?\xFF) 2 1)))
 	(aset str 0 (+ (aref str 0) ?\x20))
 	str))))
 
@@ -493,12 +495,17 @@
     (let* ((with-rule (consp (car args)))
 	   (str (if with-rule (concat (vector leading-code-composition ?\xFF))
 		  (char-to-string leading-code-composition))))
+      (if (and with-rule
+	       (cmpcharp first-component))
+	  (error "Can't compose an already composed character"))
       (setq str (concat str (compose-chars-component first-component)))
       (while args
 	(if with-rule
 	    (progn
 	      (if (not (consp (car args)))
 		  (error "Invalid composition rule: %s" (car args)))
+	      (if (cmpcharp (car (cdr args)))
+		  (error "Can't compose an already composed character"))
 	      (setq str (concat str (compose-chars-rule (car args))
 				(compose-chars-component (car (cdr args))))
 		    args (cdr (cdr args))))