summaryrefslogtreecommitdiff
path: root/lisp/international
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2011-08-18 11:53:29 -0400
committerChong Yidong <cyd@stupidchicken.com>2011-08-18 11:53:29 -0400
commitf635daa1e056a564d13b4ef1ea8d1a4ff5b7401c (patch)
tree6b6f721809174e63545eccd2ff502ff67356c9fa /lisp/international
parent156bffbe26748a0e60ec7125da4b960a0b6b455f (diff)
downloademacs-f635daa1e056a564d13b4ef1ea8d1a4ff5b7401c.tar.gz
Add L and R categories to standard category table, and use them.
* lisp/international/characters.el: Add L and R categories. * lisp/subr.el (bidi-string-mark-left-to-right): Rename from string-mark-left-to-right. Use category search. * lisp/buff-menu.el (Buffer-menu-buffer+size): Callers changed.
Diffstat (limited to 'lisp/international')
-rw-r--r--lisp/international/characters.el20
1 files changed, 20 insertions, 0 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)