]> git.eshelyaron.com Git - emacs.git/commitdiff
Assign correct general-category and names to surrogates
authorEli Zaretskii <eliz@gnu.org>
Tue, 14 Apr 2015 15:37:07 +0000 (18:37 +0300)
committerEli Zaretskii <eliz@gnu.org>
Tue, 14 Apr 2015 15:37:07 +0000 (18:37 +0300)
* admin/unidata/unidata-gen.el (unidata-setup-list): Don't ignore
surrogates.  This avoids assigning them the default
general-category of 'Cn', i.e. unassigned codepoints.
(unidata-get-name): Give surrogates synthetic names.

admin/unidata/unidata-gen.el

index 8af6fa0dd72ec74a331f3481b5df8d5151448461..583d492495c21383a65b6797162e8bd963c7b97d 100644 (file)
         (tail table)
         (block-names '(("^<CJK Ideograph" . CJK\ IDEOGRAPH)
                        ("^<Hangul Syllable" . HANGUL\ SYLLABLE)
-                       ("^<.*Surrogate" . nil)
+                       ("^<.*High Surrogate" . HIGH\ SURROGATE)
+                       ("^<.*Low Surrogate" . LOW\ SURROGATE)
                        ("^<.*Private Use" . PRIVATE\ USE)))
         val char name)
     (setq unidata-text-file (expand-file-name unidata-text-file unidata-dir))
                    (if (string-match (caar l) block-name)
                        (setq name (cdar l) l nil)
                      (setq l (cdr l))))
-                 (if (not name)
-                     ;; As this is a surrogate pair range, ignore it.
-                     (setq val nil)
-                   (setcar val (cons first char))
-                   (setcar (cdr val) name))))
+                 (setcar val (cons first char))
+                 (setcar (cdr val) name)))
 
            (when val
              (setcdr tail (list val))
@@ -783,6 +781,10 @@ Property value is a symbol `o' (Open), `c' (Close), or `n' (None)."
             (format "%s-%04X" sym char))
            ((eq sym 'CJK\ COMPATIBILITY\ IDEOGRAPH)
             (format "%s-%04X" sym char))
+           ((eq sym 'HIGH\ SURROGATE)
+            (format "%s-%04X" sym char))
+           ((eq sym 'LOW\ SURROGATE)
+            (format "%s-%04X" sym char))
            ((eq sym 'VARIATION\ SELECTOR)
             (format "%s-%d" sym (+ (- char #xe0100) 17))))))))