summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2012-03-22 13:20:07 +0900
committerKenichi Handa <handa@m17n.org>2012-03-22 13:20:07 +0900
commita640d29ae4a121bb90be8d380d08c6a91e90294e (patch)
treef75700e17ea33896d3576954d39ed9a50ef27c55
parent136220349968063bef3f249baddba30a24b52ec2 (diff)
downloademacs-a640d29ae4a121bb90be8d380d08c6a91e90294e.tar.gz
international/quail.el (quail-insert-kbd-layout): Fix previous change. To avoid unwanted bidi reordering, use bidi-string-mark-left-to-right instead of inserting LRO and PDF.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/international/quail.el35
2 files changed, 23 insertions, 18 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ea7d81bb969..d87c52a3e04 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2012-03-22 Kenichi Handa <handa@m17n.org>
+
+ * international/quail.el (quail-insert-kbd-layout): Fix previous
+ change. To avoid unwanted bidi reordering, use
+ bidi-string-mark-left-to-right instead of inserting LRO and PDF.
+
2012-03-21 Chong Yidong <cyd@gnu.org>
* faces.el (make-face, make-empty-face, copy-face):
diff --git a/lisp/international/quail.el b/lisp/international/quail.el
index e0e6bfd465b..70e6d4b69cb 100644
--- a/lisp/international/quail.el
+++ b/lisp/international/quail.el
@@ -825,8 +825,6 @@ The format of KBD-LAYOUT is the same as `quail-keyboard-layout'."
(setq i 0)
(while (< i quail-keyboard-layout-len)
(when (= (% i 30) 0)
- ;; Insert LRO to avoid bidi-reordering of keyboard cells.
- (insert (propertize (string ?\x202d) 'invisible t))
(setq row (/ i 30))
(if (> row 1)
(insert-char 32 (+ row (/ (- row 2) 2)))))
@@ -835,25 +833,26 @@ The format of KBD-LAYOUT is the same as `quail-keyboard-layout'."
(insert bar)
(if (< (if (stringp lower) (string-width lower) (char-width lower)) 2)
(insert " "))
- (if (and (characterp lower)
- (eq (get-char-code-property lower 'general-category) 'Mn))
- ;; Pad the left and right of non-spacing characters.
- (setq lower (compose-string (string lower) 0 1
- (format "\t%c\t" lower))))
- (if (and (characterp upper)
- (eq (get-char-code-property upper 'general-category) 'Mn))
- ;; Pad the left and right of non-spacing characters.
- (setq upper (compose-string (string upper) 0 1
- (format "\t%c\t" upper))))
- (insert lower (propertize " " 'invisible t) upper)
- (if (< (if (stringp upper) (string-width upper) (char-width upper)) 2)
+ (if (characterp lower)
+ (if (eq (get-char-code-property lower 'general-category) 'Mn)
+ ;; Pad the left and right of non-spacing characters.
+ (setq lower (compose-string (string lower) 0 1
+ (format "\t%c\t" lower)))
+ (setq lower (string lower))))
+ (if (characterp upper)
+ (if (eq (get-char-code-property upper 'general-category) 'Mn)
+ ;; Pad the left and right of non-spacing characters.
+ (setq upper (compose-string (string upper) 0 1
+ (format "\t%c\t" upper)))
+ (setq upper (string upper))))
+ (insert (bidi-string-mark-left-to-right lower)
+ (propertize " " 'invisible t)
+ (bidi-string-mark-left-to-right upper))
+ (if (< (string-width upper) 2)
(insert " "))
(setq i (+ i 2))
(if (= (% i 30) 0)
- (insert bar
- ;; Insert PDF to deny the previously inserted LRO.
- (propertize (string ?\x202c) 'invisible t)
- "\n")))
+ (insert bar "\n")))
;; Insert horizontal lines while deleting blank key columns at the
;; beginning and end of each line.
(save-restriction