]> code.delx.au - gnu-emacs/blobdiff - lisp/international/ucs-normalize.el
Merge from mainline.
[gnu-emacs] / lisp / international / ucs-normalize.el
index 16b7c8de1709b06e1beca5434d3bb67e92f68041..5061e500587a9be47d1d57406ec6ff5b1043317d 100644 (file)
@@ -1,6 +1,6 @@
 ;;; ucs-normalize.el --- Unicode normalization NFC/NFD/NFKD/NFKC
 
-;; Copyright (C) 2009
+;; Copyright (C) 2009, 2010
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Taichi Kawabata <kawabata.taichi@gmail.com>
@@ -23,7 +23,7 @@
 
 ;;; Commentary:
 ;;
-;; This program has passed the NormalizationTest-5.1.0.txt.
+;; This program has passed the NormalizationTest-5.2.0.txt.
 ;;
 ;; References:
 ;; http://www.unicode.org/reports/tr15/
 
 ;;; Code:
 
-(defconst ucs-normalize-version "1.1")
+(defconst ucs-normalize-version "1.2")
 
 (eval-when-compile (require 'cl))
 
       #x1D1BF #x1D1C0)
    "Composition Exclusion List.
   This list is taken from
-    http://www.unicode.org/Public/UNIDATA/CompositionExclusions-5.1.0.txt")
+    http://www.unicode.org/Public/UNIDATA/5.2/CompositionExclusions.txt")
 
   ;; Unicode ranges that decompositions & combinings are defined.
   (defvar check-range nil)
-    (setq check-range '((#x00a0 . #x3400) (#xA600 . #xAC00) (#xF900 . #x10fff) (#x1d000 . #x1dfff) (#x2f800 . #x2faff)))
+    (setq check-range '((#x00a0 . #x3400) (#xA600 . #xAC00) (#xF900 . #x110ff) (#x1d000 . #x1dfff) (#x1f100 . #x1f2ff) (#x2f800 . #x2faff)))
 
   ;; Basic normalization functions
   (defun nfd (char)
@@ -326,7 +326,7 @@ Note that Hangul are excluded.")
   (ucs-normalize-make-translation-table-from-alist (eval-when-compile hfs-nfd-alist)))
 
 (defun ucs-normalize-sort (chars)
-  "Sort by canonical combining class of chars."
+  "Sort by canonical combining class of CHARS."
   (sort chars
         (lambda (ch1 ch2)
           (< (ucs-normalize-ccc ch1) (ucs-normalize-ccc ch2)))))
@@ -382,7 +382,7 @@ If COMPOSITION-PREDICATE is not given, then do nothing."
                            &optional composition-predicate)
     "Quick-Check List for DECOMPOSITION-TRANSLATION and COMPOSITION-PREDICATE.
 It includes Singletons, CompositionExclusions, and Non-Starter
-decomposition.  "
+decomposition."
     (let (entries decomposition composition)
       (mapc
        (lambda (start-end)
@@ -604,7 +604,7 @@ COMPOSITION-PREDICATE will be used to compose region."
 (defun ucs-normalize-hfs-nfd-pre-write-conversion (from to)
   (let ((old-buf (current-buffer)))
     (set-buffer (generate-new-buffer " *temp*"))
-    (if (stringp from) 
+    (if (stringp from)
         (insert from)
       (insert-buffer-substring old-buf from to))
     (ucs-normalize-HFS-NFD-region (point-min) (point-max))