diff options
| author | Glenn Morris | 2009-08-22 19:14:37 +0000 |
|---|---|---|
| committer | Glenn Morris | 2009-08-22 19:14:37 +0000 |
| commit | 7537cf237a296384498a7a3b69799e08962f1461 (patch) | |
| tree | fa4af129fbde49e1ad17817f28189899f9eb92e3 | |
| parent | 5dcc825f21c290704e0bb205080e4f6e36bad69c (diff) | |
| download | emacs-7537cf237a296384498a7a3b69799e08962f1461.tar.gz emacs-7537cf237a296384498a7a3b69799e08962f1461.zip | |
(nfd, decomposition-translation-alist, decomposition-char-recursively)
(alist-list-to-vector, quick-check-list, quick-check-list-to-regexp):
Declare.
| -rw-r--r-- | lisp/international/ucs-normalize.el | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/lisp/international/ucs-normalize.el b/lisp/international/ucs-normalize.el index a0e46adef54..16b7c8de170 100644 --- a/lisp/international/ucs-normalize.el +++ b/lisp/international/ucs-normalize.el | |||
| @@ -88,8 +88,8 @@ | |||
| 88 | ;; with previous character, then the beginning of the block is | 88 | ;; with previous character, then the beginning of the block is |
| 89 | ;; the searched character. If searched character is combining | 89 | ;; the searched character. If searched character is combining |
| 90 | ;; character, then previous character will be the target | 90 | ;; character, then previous character will be the target |
| 91 | ;; character | 91 | ;; character |
| 92 | ;; (2) end of the block | 92 | ;; (2) end of the block |
| 93 | ;; Block ends at non-composable starter character. | 93 | ;; Block ends at non-composable starter character. |
| 94 | ;; | 94 | ;; |
| 95 | ;; C. Decomposition (`ucs-normalize-block') | 95 | ;; C. Decomposition (`ucs-normalize-block') |
| @@ -112,6 +112,8 @@ | |||
| 112 | 112 | ||
| 113 | (eval-when-compile (require 'cl)) | 113 | (eval-when-compile (require 'cl)) |
| 114 | 114 | ||
| 115 | (declare-function nfd "ucs-normalize" (char)) | ||
| 116 | |||
| 115 | (eval-when-compile | 117 | (eval-when-compile |
| 116 | 118 | ||
| 117 | (defconst ucs-normalize-composition-exclusions | 119 | (defconst ucs-normalize-composition-exclusions |
| @@ -166,7 +168,7 @@ | |||
| 166 | 168 | ||
| 167 | (eval-when-compile | 169 | (eval-when-compile |
| 168 | 170 | ||
| 169 | (defvar combining-chars nil) | 171 | (defvar combining-chars nil) |
| 170 | (setq combining-chars nil) | 172 | (setq combining-chars nil) |
| 171 | (defvar decomposition-pair-to-composition nil) | 173 | (defvar decomposition-pair-to-composition nil) |
| 172 | (setq decomposition-pair-to-composition nil) | 174 | (setq decomposition-pair-to-composition nil) |
| @@ -199,9 +201,9 @@ | |||
| 199 | check-range)) | 201 | check-range)) |
| 200 | 202 | ||
| 201 | (setq combining-chars | 203 | (setq combining-chars |
| 202 | (append combining-chars | 204 | (append combining-chars |
| 203 | '(?ᅡ ?ᅢ ?ᅣ ?ᅤ ?ᅥ ?ᅦ ?ᅧ ?ᅨ ?ᅩ ?ᅪ | 205 | '(?ᅡ ?ᅢ ?ᅣ ?ᅤ ?ᅥ ?ᅦ ?ᅧ ?ᅨ ?ᅩ ?ᅪ |
| 204 | ?ᅫ ?ᅬ ?ᅭ ?ᅮ ?ᅯ ?ᅰ ?ᅱ ?ᅲ ?ᅳ ?ᅴ ?ᅵ | 206 | ?ᅫ ?ᅬ ?ᅭ ?ᅮ ?ᅯ ?ᅰ ?ᅱ ?ᅲ ?ᅳ ?ᅴ ?ᅵ |
| 205 | ?ᆨ ?ᆩ ?ᆪ ?ᆫ ?ᆬ ?ᆭ ?ᆮ ?ᆯ ?ᆰ ?ᆱ ?ᆲ ?ᆳ ?ᆴ | 207 | ?ᆨ ?ᆩ ?ᆪ ?ᆫ ?ᆬ ?ᆭ ?ᆮ ?ᆯ ?ᆰ ?ᆱ ?ᆲ ?ᆳ ?ᆴ |
| 206 | ?ᆵ ?ᆶ ?ᆷ ?ᆸ ?ᆹ ?ᆺ ?ᆻ ?ᆼ ?ᆽ ?ᆾ ?ᆿ ?ᇀ ?ᇁ ?ᇂ))) | 208 | ?ᆵ ?ᆶ ?ᆷ ?ᆸ ?ᆹ ?ᆺ ?ᆻ ?ᆼ ?ᆽ ?ᆾ ?ᆿ ?ᇀ ?ᇁ ?ᇂ))) |
| 207 | ) | 209 | ) |
| @@ -251,6 +253,12 @@ Note that Hangul are excluded.") | |||
| 251 | (setq ucs-normalize-combining-chars-regexp | 253 | (setq ucs-normalize-combining-chars-regexp |
| 252 | (eval-when-compile (concat (regexp-opt (mapcar 'char-to-string combining-chars)) "+"))) | 254 | (eval-when-compile (concat (regexp-opt (mapcar 'char-to-string combining-chars)) "+"))) |
| 253 | 255 | ||
| 256 | (declare-function decomposition-translation-alist "ucs-normalize" | ||
| 257 | (decomposition-function)) | ||
| 258 | (declare-function decomposition-char-recursively "ucs-normalize" | ||
| 259 | (char decomposition-function)) | ||
| 260 | (declare-function alist-list-to-vector "ucs-normalize" (alist)) | ||
| 261 | |||
| 254 | (eval-when-compile | 262 | (eval-when-compile |
| 255 | 263 | ||
| 256 | (defun decomposition-translation-alist (decomposition-function) | 264 | (defun decomposition-translation-alist (decomposition-function) |
| @@ -262,7 +270,7 @@ Note that Hangul are excluded.") | |||
| 262 | (if decomposition | 270 | (if decomposition |
| 263 | (setq alist (cons (cons char | 271 | (setq alist (cons (cons char |
| 264 | (apply 'append | 272 | (apply 'append |
| 265 | (mapcar (lambda (x) | 273 | (mapcar (lambda (x) |
| 266 | (decomposition-char-recursively | 274 | (decomposition-char-recursively |
| 267 | x decomposition-function)) | 275 | x decomposition-function)) |
| 268 | decomposition))) | 276 | decomposition))) |
| @@ -274,7 +282,7 @@ Note that Hangul are excluded.") | |||
| 274 | (let ((decomposition (funcall decomposition-function char))) | 282 | (let ((decomposition (funcall decomposition-function char))) |
| 275 | (if decomposition | 283 | (if decomposition |
| 276 | (apply 'append | 284 | (apply 'append |
| 277 | (mapcar (lambda (x) | 285 | (mapcar (lambda (x) |
| 278 | (decomposition-char-recursively x decomposition-function)) | 286 | (decomposition-char-recursively x decomposition-function)) |
| 279 | decomposition)) | 287 | decomposition)) |
| 280 | (list char)))) | 288 | (list char)))) |
| @@ -295,8 +303,8 @@ Note that Hangul are excluded.") | |||
| 295 | (setq ucs-normalize-hangul-translation-alist | 303 | (setq ucs-normalize-hangul-translation-alist |
| 296 | (let ((i 0) entries) | 304 | (let ((i 0) entries) |
| 297 | (while (< i 11172) | 305 | (while (< i 11172) |
| 298 | (setq entries | 306 | (setq entries |
| 299 | (cons (cons (+ #xac00 i) | 307 | (cons (cons (+ #xac00 i) |
| 300 | (if (= 0 (% i 28)) | 308 | (if (= 0 (% i 28)) |
| 301 | (vector (+ #x1100 (/ i 588)) | 309 | (vector (+ #x1100 (/ i 588)) |
| 302 | (+ #x1161 (/ (% i 588) 28))) | 310 | (+ #x1161 (/ (% i 588) 28))) |
| @@ -307,7 +315,7 @@ Note that Hangul are excluded.") | |||
| 307 | i (1+ i))) entries)) | 315 | i (1+ i))) entries)) |
| 308 | 316 | ||
| 309 | (defun ucs-normalize-make-translation-table-from-alist (alist) | 317 | (defun ucs-normalize-make-translation-table-from-alist (alist) |
| 310 | (make-translation-table-from-alist | 318 | (make-translation-table-from-alist |
| 311 | (append alist ucs-normalize-hangul-translation-alist))) | 319 | (append alist ucs-normalize-hangul-translation-alist))) |
| 312 | 320 | ||
| 313 | (define-translation-table 'ucs-normalize-nfd-table | 321 | (define-translation-table 'ucs-normalize-nfd-table |
| @@ -364,6 +372,10 @@ If COMPOSITION-PREDICATE is not given, then do nothing." | |||
| 364 | chars))) | 372 | chars))) |
| 365 | ) | 373 | ) |
| 366 | 374 | ||
| 375 | (declare-function quick-check-list "ucs-normalize" | ||
| 376 | (decomposition-translation &optional composition-predicate)) | ||
| 377 | (declare-function quick-check-list-to-regexp "ucs-normalize" (quick-check-list)) | ||
| 378 | |||
| 367 | (eval-when-compile | 379 | (eval-when-compile |
| 368 | 380 | ||
| 369 | (defun quick-check-list (decomposition-translation | 381 | (defun quick-check-list (decomposition-translation |
| @@ -377,7 +389,7 @@ decomposition. " | |||
| 377 | (do ((i (car start-end) (+ i 1))) ((> i (cdr start-end))) | 389 | (do ((i (car start-end) (+ i 1))) ((> i (cdr start-end))) |
| 378 | (setq decomposition | 390 | (setq decomposition |
| 379 | (string-to-list | 391 | (string-to-list |
| 380 | (with-temp-buffer | 392 | (with-temp-buffer |
| 381 | (insert i) | 393 | (insert i) |
| 382 | (translate-region 1 2 decomposition-translation) | 394 | (translate-region 1 2 decomposition-translation) |
| 383 | (buffer-string)))) | 395 | (buffer-string)))) |