summaryrefslogtreecommitdiff
path: root/lisp/international
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-09-03 16:03:38 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-09-03 16:03:38 -0700
commitb49e353d9d01adbe60bc5d0b1658b4ef978b0b06 (patch)
tree9f2ffa6f7a6562abf661a4951012b488ad8b1ae7 /lisp/international
parent74b880cbc18bd0194c7b1fc44c4a983ee05adae2 (diff)
parentbc3200871917d5c54c8c4299a06bf8f8ba2ea02d (diff)
downloademacs-b49e353d9d01adbe60bc5d0b1658b4ef978b0b06.tar.gz
Merge from trunk.
Diffstat (limited to 'lisp/international')
-rw-r--r--lisp/international/characters.el20
-rw-r--r--lisp/international/charprop.el26
-rw-r--r--lisp/international/ucs-normalize.el10
-rw-r--r--lisp/international/uni-bidi.elbin8719 -> 7950 bytes
-rw-r--r--lisp/international/uni-category.elbin11396 -> 12759 bytes
-rw-r--r--lisp/international/uni-combining.elbin8369 -> 6251 bytes
-rw-r--r--lisp/international/uni-comment.elbin2386 -> 2407 bytes
-rw-r--r--lisp/international/uni-decimal.elbin1869 -> 2710 bytes
-rw-r--r--lisp/international/uni-decomposition.elbin28459 -> 28497 bytes
-rw-r--r--lisp/international/uni-digit.elbin2187 -> 3028 bytes
-rw-r--r--lisp/international/uni-lowercase.elbin5347 -> 6421 bytes
-rw-r--r--lisp/international/uni-mirrored.elbin10452 -> 9342 bytes
-rw-r--r--lisp/international/uni-name.elbin158765 -> 158786 bytes
-rw-r--r--lisp/international/uni-numeric.elbin3688 -> 4522 bytes
-rw-r--r--lisp/international/uni-old-name.elbin19692 -> 19713 bytes
-rw-r--r--lisp/international/uni-titlecase.elbin5434 -> 6462 bytes
-rw-r--r--lisp/international/uni-uppercase.elbin5430 -> 6458 bytes
17 files changed, 46 insertions, 10 deletions
diff --git a/lisp/international/characters.el b/lisp/international/characters.el
index a9657c17b9f..47426784e51 100644
--- a/lisp/international/characters.el
+++ b/lisp/international/characters.el
@@ -114,6 +114,16 @@ A character which can't be placed at end of line.")
Base characters (Unicode General Category L,N,P,S,Zs)")
(define-category ?^ "Combining
Combining diacritic or mark (Unicode General Category M)")
+
+;; bidi types
+(define-category ?R "Right-to-left (strong)
+Characters with \"strong\" right-to-left directionality, i.e.
+with R, AL, RLE, or RLO Unicode bidi character type.")
+
+(define-category ?L "Left-to-right (strong)
+Characters with \"strong\" left-to-right directionality, i.e.
+with L, LRE, or LRO Unicode bidi character type.")
+
;;; Setting syntax and category.
@@ -478,6 +488,16 @@ Combining diacritic or mark (Unicode General Category M)")
(modify-category-entry x category))
chars)))))
+;; Bidi categories
+
+(map-char-table (lambda (key val)
+ (cond
+ ((memq val '(R AL RLO RLE))
+ (modify-category-entry key ?R))
+ ((memq val '(L LRE LRO))
+ (modify-category-entry key ?L))))
+ (unicode-property-table-internal 'bidi-class))
+
;; Latin
(modify-category-entry '(#x80 . #x024F) ?l)
diff --git a/lisp/international/charprop.el b/lisp/international/charprop.el
index 919666010b1..2424e87ae44 100644
--- a/lisp/international/charprop.el
+++ b/lisp/international/charprop.el
@@ -29,15 +29,18 @@ one of these symbols representing compatibility formatting tag:
;; FILE: uni-decimal.el
(define-char-code-property 'decimal-digit-value "uni-decimal.el"
"Unicode numeric value (decimal digit).
-Property value is an integer.")
+Property value is an integer 0..9, or nil.
+The value nil stands for NaN \"Numeric_Value\".")
;; FILE: uni-digit.el
(define-char-code-property 'digit-value "uni-digit.el"
"Unicode numeric value (digit).
-Property value is an integer.")
+Property value is an integer 0..9, or nil.
+The value nil stands for NaN \"Numeric_Value\".")
;; FILE: uni-numeric.el
(define-char-code-property 'numeric-value "uni-numeric.el"
"Unicode numeric value (numeric).
-Property value is an integer or a floating point.")
+Property value is an integer, a floating point, or nil.
+The value nil stands for NaN \"Numeric_Value\".")
;; FILE: uni-mirrored.el
(define-char-code-property 'mirrored "uni-mirrored.el"
"Unicode bidi mirrored flag.
@@ -53,20 +56,27 @@ Property value is a string.")
;; FILE: uni-uppercase.el
(define-char-code-property 'uppercase "uni-uppercase.el"
"Unicode simple uppercase mapping.
-Property value is a character.")
+Property value is a character or nil.
+The value nil means that the actual property value of a character
+is the character itself.")
;; FILE: uni-lowercase.el
(define-char-code-property 'lowercase "uni-lowercase.el"
"Unicode simple lowercase mapping.
-Property value is a character.")
+Property value is a character or nil.
+The value nil means that the actual property value of a character
+is the character itself.")
;; FILE: uni-titlecase.el
(define-char-code-property 'titlecase "uni-titlecase.el"
"Unicode simple titlecase mapping.
-Property value is a character.")
+Property value is a character or nil.
+The value nil means that the actual property value of a character
+is the character itself.")
;; FILE: uni-mirrored.el
(define-char-code-property 'mirroring "uni-mirrored.el"
"Unicode bidi-mirroring characters.
-Property value is a character that has the corresponding mirroring image,
-or nil for non-mirrored character.")
+Property value is a character that has the corresponding mirroring image or nil.
+The value nil means that the actual property value of a character
+is the character itself.")
;; Local Variables:
;; coding: utf-8
;; no-byte-compile: t
diff --git a/lisp/international/ucs-normalize.el b/lisp/international/ucs-normalize.el
index f83e0f7588f..df05b355b46 100644
--- a/lisp/international/ucs-normalize.el
+++ b/lisp/international/ucs-normalize.el
@@ -139,14 +139,17 @@
(defun nfd (char)
(let ((decomposition
(get-char-code-property char 'decomposition)))
- (if (and decomposition (numberp (car decomposition)))
+ (if (and decomposition (numberp (car decomposition))
+ (or (> (length decomposition) 1)
+ (/= (car decomposition) char)))
decomposition)))
(defun nfkd (char)
(let ((decomposition
(get-char-code-property char 'decomposition)))
(if (symbolp (car decomposition)) (cdr decomposition)
- decomposition)))
+ (if (or (> (length decomposition) 1)
+ (/= (car decomposition) char)) decomposition))))
(defun hfs-nfd (char)
(when (or (and (>= char 0) (< char #x2000))
@@ -180,6 +183,9 @@
(setq ccc (ucs-normalize-ccc char))
(setq decomposition (get-char-code-property
char 'decomposition))
+ (if (and (= (length decomposition) 1)
+ (= (car decomposition) char))
+ (setq decomposition nil))
(if (and ccc (/= 0 ccc)) (add-to-list 'combining-chars char))
(if (and (numberp (car decomposition))
(/= (ucs-normalize-ccc (car decomposition))
diff --git a/lisp/international/uni-bidi.el b/lisp/international/uni-bidi.el
index e7682c6d8ff..4d86fc821fa 100644
--- a/lisp/international/uni-bidi.el
+++ b/lisp/international/uni-bidi.el
Binary files differ
diff --git a/lisp/international/uni-category.el b/lisp/international/uni-category.el
index a4455decc52..94b7c18b6e2 100644
--- a/lisp/international/uni-category.el
+++ b/lisp/international/uni-category.el
Binary files differ
diff --git a/lisp/international/uni-combining.el b/lisp/international/uni-combining.el
index 227b9d0af79..1437ff9acbd 100644
--- a/lisp/international/uni-combining.el
+++ b/lisp/international/uni-combining.el
Binary files differ
diff --git a/lisp/international/uni-comment.el b/lisp/international/uni-comment.el
index c9743064bd4..21ccfe3ffe7 100644
--- a/lisp/international/uni-comment.el
+++ b/lisp/international/uni-comment.el
Binary files differ
diff --git a/lisp/international/uni-decimal.el b/lisp/international/uni-decimal.el
index 2c424ffb5de..096257add20 100644
--- a/lisp/international/uni-decimal.el
+++ b/lisp/international/uni-decimal.el
Binary files differ
diff --git a/lisp/international/uni-decomposition.el b/lisp/international/uni-decomposition.el
index b0bf07bbe85..b9660cdab0a 100644
--- a/lisp/international/uni-decomposition.el
+++ b/lisp/international/uni-decomposition.el
Binary files differ
diff --git a/lisp/international/uni-digit.el b/lisp/international/uni-digit.el
index fc52fd8c28c..efb78b0e43d 100644
--- a/lisp/international/uni-digit.el
+++ b/lisp/international/uni-digit.el
Binary files differ
diff --git a/lisp/international/uni-lowercase.el b/lisp/international/uni-lowercase.el
index 41890018204..7afd9503cb3 100644
--- a/lisp/international/uni-lowercase.el
+++ b/lisp/international/uni-lowercase.el
Binary files differ
diff --git a/lisp/international/uni-mirrored.el b/lisp/international/uni-mirrored.el
index 006cf575591..e650166c24c 100644
--- a/lisp/international/uni-mirrored.el
+++ b/lisp/international/uni-mirrored.el
Binary files differ
diff --git a/lisp/international/uni-name.el b/lisp/international/uni-name.el
index 7fac18b278d..8b681631067 100644
--- a/lisp/international/uni-name.el
+++ b/lisp/international/uni-name.el
Binary files differ
diff --git a/lisp/international/uni-numeric.el b/lisp/international/uni-numeric.el
index d16e8c00870..a1865f1fb23 100644
--- a/lisp/international/uni-numeric.el
+++ b/lisp/international/uni-numeric.el
Binary files differ
diff --git a/lisp/international/uni-old-name.el b/lisp/international/uni-old-name.el
index 4e704e5cdd0..de2d67b9450 100644
--- a/lisp/international/uni-old-name.el
+++ b/lisp/international/uni-old-name.el
Binary files differ
diff --git a/lisp/international/uni-titlecase.el b/lisp/international/uni-titlecase.el
index b8098c81876..517edb20445 100644
--- a/lisp/international/uni-titlecase.el
+++ b/lisp/international/uni-titlecase.el
Binary files differ
diff --git a/lisp/international/uni-uppercase.el b/lisp/international/uni-uppercase.el
index 899276eb725..fcb22d72470 100644
--- a/lisp/international/uni-uppercase.el
+++ b/lisp/international/uni-uppercase.el
Binary files differ