From: tomo Date: Sun, 11 Jan 2004 15:32:59 +0000 (+0000) Subject: (total-strokes-string<): Abolished. X-Git-Tag: r21-4-14-chise-0_21-17^2~1 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=7c2debc0f9903c0b3980134856c4cd0825bc43b1;p=chise%2Fxemacs-chise.git.1 (total-strokes-string<): Abolished. (chise-string<): New function. --- diff --git a/lisp/utf-2000/ideograph-util.el b/lisp/utf-2000/ideograph-util.el index c435990..38ccc19 100644 --- a/lisp/utf-2000/ideograph-util.el +++ b/lisp/utf-2000/ideograph-util.el @@ -404,26 +404,35 @@ 'ideographic-structure))) ;;;###autoload -(defun total-strokes-string< (string1 string2 &optional preferred-domains) +(defun chise-string< (string1 string2 accessors) (let ((len1 (length string1)) (len2 (length string2)) len (i 0) c1 c2 - s1 s2) + rest func + v1 v2) (setq len (min len1 len2)) (catch 'tag (while (< i len) (setq c1 (aref string1 i) c2 (aref string2 i)) - (setq s1 (or (char-total-strokes c1 preferred-domains) - 0) - s2 (or (char-total-strokes c2 preferred-domains) - 0)) - (cond ((< s1 s2) - (throw 'tag t)) - ((> s1 s2) - (throw 'tag nil))) + (setq rest accessors) + (while (and rest + (setq func (car rest)) + (setq v1 (funcall func c1) + v2 (funcall func c2)) + (eq v1 v2)) + (setq rest (cdr rest))) + (if v1 + (if v2 + (cond ((< v1 v2) + (throw 'tag t)) + ((> v1 v2) + (throw 'tag nil))) + (throw 'tag nil)) + (if v2 + (throw 'tag t))) (setq i (1+ i))) (< len1 len2))))