diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-09-03 16:03:38 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-09-03 16:03:38 -0700 |
commit | b49e353d9d01adbe60bc5d0b1658b4ef978b0b06 (patch) | |
tree | 9f2ffa6f7a6562abf661a4951012b488ad8b1ae7 /lisp/international | |
parent | 74b880cbc18bd0194c7b1fc44c4a983ee05adae2 (diff) | |
parent | bc3200871917d5c54c8c4299a06bf8f8ba2ea02d (diff) | |
download | emacs-b49e353d9d01adbe60bc5d0b1658b4ef978b0b06.tar.gz |
Merge from trunk.
Diffstat (limited to 'lisp/international')
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 Binary files differindex e7682c6d8ff..4d86fc821fa 100644 --- a/lisp/international/uni-bidi.el +++ b/lisp/international/uni-bidi.el diff --git a/lisp/international/uni-category.el b/lisp/international/uni-category.el Binary files differindex a4455decc52..94b7c18b6e2 100644 --- a/lisp/international/uni-category.el +++ b/lisp/international/uni-category.el diff --git a/lisp/international/uni-combining.el b/lisp/international/uni-combining.el Binary files differindex 227b9d0af79..1437ff9acbd 100644 --- a/lisp/international/uni-combining.el +++ b/lisp/international/uni-combining.el diff --git a/lisp/international/uni-comment.el b/lisp/international/uni-comment.el Binary files differindex c9743064bd4..21ccfe3ffe7 100644 --- a/lisp/international/uni-comment.el +++ b/lisp/international/uni-comment.el diff --git a/lisp/international/uni-decimal.el b/lisp/international/uni-decimal.el Binary files differindex 2c424ffb5de..096257add20 100644 --- a/lisp/international/uni-decimal.el +++ b/lisp/international/uni-decimal.el diff --git a/lisp/international/uni-decomposition.el b/lisp/international/uni-decomposition.el Binary files differindex b0bf07bbe85..b9660cdab0a 100644 --- a/lisp/international/uni-decomposition.el +++ b/lisp/international/uni-decomposition.el diff --git a/lisp/international/uni-digit.el b/lisp/international/uni-digit.el Binary files differindex fc52fd8c28c..efb78b0e43d 100644 --- a/lisp/international/uni-digit.el +++ b/lisp/international/uni-digit.el diff --git a/lisp/international/uni-lowercase.el b/lisp/international/uni-lowercase.el Binary files differindex 41890018204..7afd9503cb3 100644 --- a/lisp/international/uni-lowercase.el +++ b/lisp/international/uni-lowercase.el diff --git a/lisp/international/uni-mirrored.el b/lisp/international/uni-mirrored.el Binary files differindex 006cf575591..e650166c24c 100644 --- a/lisp/international/uni-mirrored.el +++ b/lisp/international/uni-mirrored.el diff --git a/lisp/international/uni-name.el b/lisp/international/uni-name.el Binary files differindex 7fac18b278d..8b681631067 100644 --- a/lisp/international/uni-name.el +++ b/lisp/international/uni-name.el diff --git a/lisp/international/uni-numeric.el b/lisp/international/uni-numeric.el Binary files differindex d16e8c00870..a1865f1fb23 100644 --- a/lisp/international/uni-numeric.el +++ b/lisp/international/uni-numeric.el diff --git a/lisp/international/uni-old-name.el b/lisp/international/uni-old-name.el Binary files differindex 4e704e5cdd0..de2d67b9450 100644 --- a/lisp/international/uni-old-name.el +++ b/lisp/international/uni-old-name.el diff --git a/lisp/international/uni-titlecase.el b/lisp/international/uni-titlecase.el Binary files differindex b8098c81876..517edb20445 100644 --- a/lisp/international/uni-titlecase.el +++ b/lisp/international/uni-titlecase.el diff --git a/lisp/international/uni-uppercase.el b/lisp/international/uni-uppercase.el Binary files differindex 899276eb725..fcb22d72470 100644 --- a/lisp/international/uni-uppercase.el +++ b/lisp/international/uni-uppercase.el |