aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2012-03-22 13:20:07 +0900
committerKenichi Handa2012-03-22 13:20:07 +0900
commita640d29ae4a121bb90be8d380d08c6a91e90294e (patch)
treef75700e17ea33896d3576954d39ed9a50ef27c55
parent136220349968063bef3f249baddba30a24b52ec2 (diff)
downloademacs-a640d29ae4a121bb90be8d380d08c6a91e90294e.tar.gz
emacs-a640d29ae4a121bb90be8d380d08c6a91e90294e.zip
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 @@
12012-03-22 Kenichi Handa <handa@m17n.org>
2
3 * international/quail.el (quail-insert-kbd-layout): Fix previous
4 change. To avoid unwanted bidi reordering, use
5 bidi-string-mark-left-to-right instead of inserting LRO and PDF.
6
12012-03-21 Chong Yidong <cyd@gnu.org> 72012-03-21 Chong Yidong <cyd@gnu.org>
2 8
3 * faces.el (make-face, make-empty-face, copy-face): 9 * 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'."
825 (setq i 0) 825 (setq i 0)
826 (while (< i quail-keyboard-layout-len) 826 (while (< i quail-keyboard-layout-len)
827 (when (= (% i 30) 0) 827 (when (= (% i 30) 0)
828 ;; Insert LRO to avoid bidi-reordering of keyboard cells.
829 (insert (propertize (string ?\x202d) 'invisible t))
830 (setq row (/ i 30)) 828 (setq row (/ i 30))
831 (if (> row 1) 829 (if (> row 1)
832 (insert-char 32 (+ row (/ (- row 2) 2))))) 830 (insert-char 32 (+ row (/ (- row 2) 2)))))
@@ -835,25 +833,26 @@ The format of KBD-LAYOUT is the same as `quail-keyboard-layout'."
835 (insert bar) 833 (insert bar)
836 (if (< (if (stringp lower) (string-width lower) (char-width lower)) 2) 834 (if (< (if (stringp lower) (string-width lower) (char-width lower)) 2)
837 (insert " ")) 835 (insert " "))
838 (if (and (characterp lower) 836 (if (characterp lower)
839 (eq (get-char-code-property lower 'general-category) 'Mn)) 837 (if (eq (get-char-code-property lower 'general-category) 'Mn)
840 ;; Pad the left and right of non-spacing characters. 838 ;; Pad the left and right of non-spacing characters.
841 (setq lower (compose-string (string lower) 0 1 839 (setq lower (compose-string (string lower) 0 1
842 (format "\t%c\t" lower)))) 840 (format "\t%c\t" lower)))
843 (if (and (characterp upper) 841 (setq lower (string lower))))
844 (eq (get-char-code-property upper 'general-category) 'Mn)) 842 (if (characterp upper)
845 ;; Pad the left and right of non-spacing characters. 843 (if (eq (get-char-code-property upper 'general-category) 'Mn)
846 (setq upper (compose-string (string upper) 0 1 844 ;; Pad the left and right of non-spacing characters.
847 (format "\t%c\t" upper)))) 845 (setq upper (compose-string (string upper) 0 1
848 (insert lower (propertize " " 'invisible t) upper) 846 (format "\t%c\t" upper)))
849 (if (< (if (stringp upper) (string-width upper) (char-width upper)) 2) 847 (setq upper (string upper))))
848 (insert (bidi-string-mark-left-to-right lower)
849 (propertize " " 'invisible t)
850 (bidi-string-mark-left-to-right upper))
851 (if (< (string-width upper) 2)
850 (insert " ")) 852 (insert " "))
851 (setq i (+ i 2)) 853 (setq i (+ i 2))
852 (if (= (% i 30) 0) 854 (if (= (% i 30) 0)
853 (insert bar 855 (insert bar "\n")))
854 ;; Insert PDF to deny the previously inserted LRO.
855 (propertize (string ?\x202c) 'invisible t)
856 "\n")))
857 ;; Insert horizontal lines while deleting blank key columns at the 856 ;; Insert horizontal lines while deleting blank key columns at the
858 ;; beginning and end of each line. 857 ;; beginning and end of each line.
859 (save-restriction 858 (save-restriction