From 22b2e9c901231312d6d8c6fd5d138b98501bc65e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 2 Jun 2020 20:44:59 +0300 Subject: [PATCH] Fix Arabic composition rules * lisp/language/misc-lang.el (composition-function-table): Reorder Arabic composition rules in descending order of lookback. * src/composite.c (syms_of_composite): Document the order of rules in 'composition-function-table'. --- lisp/language/misc-lang.el | 8 ++++---- src/composite.c | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/language/misc-lang.el b/lisp/language/misc-lang.el index e25e63b4c5c..e3a24c41536 100644 --- a/lisp/language/misc-lang.el +++ b/lisp/language/misc-lang.el @@ -136,10 +136,10 @@ thin (i.e. 1-dot width) space." (set-char-table-range composition-function-table '(#x600 . #x74F) - (list (vector "[\u0600-\u074F\u200C\u200D]+" 0 - 'arabic-shape-gstring) - (vector "[\u200C\u200D][\u0600-\u074F\u200C\u200D]+" 1 - 'arabic-shape-gstring))) + (list (vector "[\u200C\u200D][\u0600-\u074F\u200C\u200D]+" + 1 'arabic-shape-gstring) + (vector "[\u0600-\u074F\u200C\u200D]+" + 0 'arabic-shape-gstring))) (provide 'misc-lang) diff --git a/src/composite.c b/src/composite.c index 518502be49f..5c56107fb77 100644 --- a/src/composite.c +++ b/src/composite.c @@ -1987,7 +1987,8 @@ preceding and/or following characters, this char-table contains a function to call to compose that character. The element at index C in the table, if non-nil, is a list of -composition rules of this form: ([PATTERN PREV-CHARS FUNC] ...) +composition rules of the form ([PATTERN PREV-CHARS FUNC] ...); +they must be in the descending order of PREV-CHARS values. PATTERN is a regular expression which C and the surrounding characters must match. -- 2.39.5