emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-27 efdd463 1/2: Fix Arabic shaping when column-number-mode is in e


From: Eli Zaretskii
Subject: emacs-27 efdd463 1/2: Fix Arabic shaping when column-number-mode is in effect
Date: Sat, 25 Jul 2020 12:25:52 -0400 (EDT)

branch: emacs-27
commit efdd4632c95cc6be6efc099cfed051022fff7a84
Author: Pip Cet <pipcet@gmail.com>
Commit: Eli Zaretskii <eliz@gnu.org>

    Fix Arabic shaping when column-number-mode is in effect
    
    * src/indent.c (scan_for_column, compute_motion): Pass -1,
    instead of NEUTRAL_DIR, to 'composition_reseat_it'.
    * src/composite.c (composition_reseat_it): Interpret negative
    value of BIDI_LEVEL to mean the caller doesn't know what is the
    bidi direction of the text.  (Bug#41005)
---
 src/composite.c | 4 +++-
 src/indent.c    | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/composite.c b/src/composite.c
index 364d5c9..2fbe679 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -1217,7 +1217,9 @@ composition_reseat_it (struct composition_it *cmp_it, 
ptrdiff_t charpos,
        continue;
       if (charpos < endpos)
        {
-         if ((bidi_level & 1) == 0)
+         if (bidi_level < 0)
+           direction = Qnil;
+         else if ((bidi_level & 1) == 0)
            direction = QL2R;
          else
            direction = QR2L;
diff --git a/src/indent.c b/src/indent.c
index f7db427..939e593 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -598,7 +598,7 @@ scan_for_column (ptrdiff_t *endpos, EMACS_INT *goalcol, 
ptrdiff_t *prevcol)
       if (cmp_it.id >= 0
          || (scan == cmp_it.stop_pos
              && composition_reseat_it (&cmp_it, scan, scan_byte, end,
-                                       w, NEUTRAL_DIR, NULL, Qnil)))
+                                       w, -1, NULL, Qnil)))
        composition_update_it (&cmp_it, scan, scan_byte, Qnil);
       if (cmp_it.id >= 0)
        {
@@ -1506,7 +1506,7 @@ compute_motion (ptrdiff_t from, ptrdiff_t frombyte, 
EMACS_INT fromvpos,
          if (cmp_it.id >= 0
              || (pos == cmp_it.stop_pos
                  && composition_reseat_it (&cmp_it, pos, pos_byte, to, win,
-                                           NEUTRAL_DIR, NULL, Qnil)))
+                                           -1, NULL, Qnil)))
            composition_update_it (&cmp_it, pos, pos_byte, Qnil);
          if (cmp_it.id >= 0)
            {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]