aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2014-10-11 15:24:30 +0300
committerEli Zaretskii2014-10-11 15:24:30 +0300
commit8cc6103196a26b972653f200cf7a7992c534b13a (patch)
treebb5b5d92aa0499300425bfd4da9aefc3983a44f4 /src
parent4eb60cd3a157ff99d380028687e07f01354c65fc (diff)
downloademacs-8cc6103196a26b972653f200cf7a7992c534b13a.tar.gz
emacs-8cc6103196a26b972653f200cf7a7992c534b13a.zip
Rename type_after_w1 into type_after_wn.
Diffstat (limited to 'src')
-rw-r--r--src/bidi.c138
-rw-r--r--src/dispextern.h8
2 files changed, 73 insertions, 73 deletions
diff --git a/src/bidi.c b/src/bidi.c
index 37d7a6f4974..53191c14b8a 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -406,13 +406,13 @@ bidi_set_sos_type (struct bidi_it *bidi_it, int level_before, int level_after)
406 /* FIXME: should the default sos direction be user selectable? */ 406 /* FIXME: should the default sos direction be user selectable? */
407 bidi_it->sos = ((higher_level & 1) != 0 ? R2L : L2R); /* X10 */ 407 bidi_it->sos = ((higher_level & 1) != 0 ? R2L : L2R); /* X10 */
408 408
409 bidi_it->prev.type = bidi_it->prev.type_after_w1 = UNKNOWN_BT; 409 bidi_it->prev.type = bidi_it->prev.type_after_wn = UNKNOWN_BT;
410 bidi_it->last_strong.type = bidi_it->last_strong.type_after_w1 410 bidi_it->last_strong.type = bidi_it->last_strong.type_after_wn
411 = bidi_it->last_strong.orig_type = UNKNOWN_BT; 411 = bidi_it->last_strong.orig_type = UNKNOWN_BT;
412 bidi_it->prev_for_neutral.type = (bidi_it->sos == R2L ? STRONG_R : STRONG_L); 412 bidi_it->prev_for_neutral.type = (bidi_it->sos == R2L ? STRONG_R : STRONG_L);
413 bidi_it->prev_for_neutral.charpos = bidi_it->charpos; 413 bidi_it->prev_for_neutral.charpos = bidi_it->charpos;
414 bidi_it->prev_for_neutral.bytepos = bidi_it->bytepos; 414 bidi_it->prev_for_neutral.bytepos = bidi_it->bytepos;
415 bidi_it->next_for_neutral.type = bidi_it->next_for_neutral.type_after_w1 415 bidi_it->next_for_neutral.type = bidi_it->next_for_neutral.type_after_wn
416 = bidi_it->next_for_neutral.orig_type = UNKNOWN_BT; 416 = bidi_it->next_for_neutral.orig_type = UNKNOWN_BT;
417} 417}
418 418
@@ -472,7 +472,7 @@ bidi_pop_embedding_level (struct bidi_it *bidi_it)
472 the time we first use it. We initialize it here to 472 the time we first use it. We initialize it here to
473 UNKNOWN_BT to be able to catch any blunders in this 473 UNKNOWN_BT to be able to catch any blunders in this
474 logic. */ 474 logic. */
475 bidi_it->prev.orig_type = bidi_it->prev.type_after_w1 475 bidi_it->prev.orig_type = bidi_it->prev.type_after_wn
476 = bidi_it->prev.type = UNKNOWN_BT; 476 = bidi_it->prev.type = UNKNOWN_BT;
477 bidi_it->last_strong = st.last_strong; 477 bidi_it->last_strong = st.last_strong;
478 bidi_it->prev_for_neutral = st.prev_for_neutral; 478 bidi_it->prev_for_neutral = st.prev_for_neutral;
@@ -499,8 +499,8 @@ bidi_remember_char (struct bidi_saved_info *saved_info,
499 saved_info->bytepos = bidi_it->bytepos; 499 saved_info->bytepos = bidi_it->bytepos;
500 saved_info->type = bidi_it->type; 500 saved_info->type = bidi_it->type;
501 bidi_check_type (bidi_it->type); 501 bidi_check_type (bidi_it->type);
502 saved_info->type_after_w1 = bidi_it->type_after_w1; 502 saved_info->type_after_wn = bidi_it->type_after_wn;
503 bidi_check_type (bidi_it->type_after_w1); 503 bidi_check_type (bidi_it->type_after_wn);
504 saved_info->orig_type = bidi_it->orig_type; 504 saved_info->orig_type = bidi_it->orig_type;
505 bidi_check_type (bidi_it->orig_type); 505 bidi_check_type (bidi_it->orig_type);
506 saved_info->bracket_resolved = bidi_it->bracket_resolved; 506 saved_info->bracket_resolved = bidi_it->bracket_resolved;
@@ -759,8 +759,8 @@ bidi_cache_iterator_state (struct bidi_it *bidi_it, bool resolved)
759 costly copying of the entire struct. */ 759 costly copying of the entire struct. */
760 bidi_cache[idx].type = bidi_it->type; 760 bidi_cache[idx].type = bidi_it->type;
761 bidi_check_type (bidi_it->type); 761 bidi_check_type (bidi_it->type);
762 bidi_cache[idx].type_after_w1 = bidi_it->type_after_w1; 762 bidi_cache[idx].type_after_wn = bidi_it->type_after_wn;
763 bidi_check_type (bidi_it->type_after_w1); 763 bidi_check_type (bidi_it->type_after_wn);
764 if (resolved) 764 if (resolved)
765 bidi_cache[idx].resolved_level = bidi_it->resolved_level; 765 bidi_cache[idx].resolved_level = bidi_it->resolved_level;
766 else 766 else
@@ -1044,20 +1044,20 @@ bidi_init_it (ptrdiff_t charpos, ptrdiff_t bytepos, bool frame_window_p,
1044 bidi_it->new_paragraph = 1; 1044 bidi_it->new_paragraph = 1;
1045 bidi_it->separator_limit = -1; 1045 bidi_it->separator_limit = -1;
1046 bidi_it->type = NEUTRAL_B; 1046 bidi_it->type = NEUTRAL_B;
1047 bidi_it->type_after_w1 = NEUTRAL_B; 1047 bidi_it->type_after_wn = NEUTRAL_B;
1048 bidi_it->orig_type = NEUTRAL_B; 1048 bidi_it->orig_type = NEUTRAL_B;
1049 /* FIXME: Review this!!! */ 1049 /* FIXME: Review this!!! */
1050 bidi_it->prev.type = bidi_it->prev.type_after_w1 1050 bidi_it->prev.type = bidi_it->prev.type_after_wn
1051 = bidi_it->prev.orig_type = UNKNOWN_BT; 1051 = bidi_it->prev.orig_type = UNKNOWN_BT;
1052 bidi_it->last_strong.type = bidi_it->last_strong.type_after_w1 1052 bidi_it->last_strong.type = bidi_it->last_strong.type_after_wn
1053 = bidi_it->last_strong.orig_type = UNKNOWN_BT; 1053 = bidi_it->last_strong.orig_type = UNKNOWN_BT;
1054 bidi_it->next_for_neutral.charpos = -1; 1054 bidi_it->next_for_neutral.charpos = -1;
1055 bidi_it->next_for_neutral.type 1055 bidi_it->next_for_neutral.type
1056 = bidi_it->next_for_neutral.type_after_w1 1056 = bidi_it->next_for_neutral.type_after_wn
1057 = bidi_it->next_for_neutral.orig_type = UNKNOWN_BT; 1057 = bidi_it->next_for_neutral.orig_type = UNKNOWN_BT;
1058 bidi_it->prev_for_neutral.charpos = -1; 1058 bidi_it->prev_for_neutral.charpos = -1;
1059 bidi_it->prev_for_neutral.type 1059 bidi_it->prev_for_neutral.type
1060 = bidi_it->prev_for_neutral.type_after_w1 1060 = bidi_it->prev_for_neutral.type_after_wn
1061 = bidi_it->prev_for_neutral.orig_type = UNKNOWN_BT; 1061 = bidi_it->prev_for_neutral.orig_type = UNKNOWN_BT;
1062 bidi_it->sos = L2R; /* FIXME: should it be user-selectable? */ 1062 bidi_it->sos = L2R; /* FIXME: should it be user-selectable? */
1063 bidi_it->disp_pos = -1; /* invalid/unknown */ 1063 bidi_it->disp_pos = -1; /* invalid/unknown */
@@ -1755,7 +1755,7 @@ bidi_resolve_explicit (struct bidi_it *bidi_it)
1755 eassert (bidi_it->prev.charpos == bidi_it->charpos - 1); 1755 eassert (bidi_it->prev.charpos == bidi_it->charpos - 1);
1756 prev_type = bidi_it->prev.orig_type; 1756 prev_type = bidi_it->prev.orig_type;
1757 if (prev_type == FSI) 1757 if (prev_type == FSI)
1758 prev_type = bidi_it->type_after_w1; 1758 prev_type = bidi_it->type_after_wn;
1759 } 1759 }
1760 } 1760 }
1761 /* Don't move at end of buffer/string. */ 1761 /* Don't move at end of buffer/string. */
@@ -1771,7 +1771,7 @@ bidi_resolve_explicit (struct bidi_it *bidi_it)
1771 bidi_it->bytepos += bidi_it->ch_len; 1771 bidi_it->bytepos += bidi_it->ch_len;
1772 prev_type = bidi_it->orig_type; 1772 prev_type = bidi_it->orig_type;
1773 if (prev_type == FSI) 1773 if (prev_type == FSI)
1774 prev_type = bidi_it->type_after_w1; 1774 prev_type = bidi_it->type_after_wn;
1775 } 1775 }
1776 else /* EOB or end of string */ 1776 else /* EOB or end of string */
1777 prev_type = NEUTRAL_B; 1777 prev_type = NEUTRAL_B;
@@ -1857,14 +1857,14 @@ bidi_resolve_explicit (struct bidi_it *bidi_it)
1857 bidi_it->orig_type = type; 1857 bidi_it->orig_type = type;
1858 bidi_check_type (bidi_it->orig_type); 1858 bidi_check_type (bidi_it->orig_type);
1859 1859
1860 bidi_it->type_after_w1 = UNKNOWN_BT; 1860 bidi_it->type_after_wn = UNKNOWN_BT;
1861 1861
1862 switch (type) 1862 switch (type)
1863 { 1863 {
1864 case RLE: /* X2 */ 1864 case RLE: /* X2 */
1865 case RLO: /* X4 */ 1865 case RLO: /* X4 */
1866 bidi_it->type_after_w1 = type; 1866 bidi_it->type_after_wn = type;
1867 bidi_check_type (bidi_it->type_after_w1); 1867 bidi_check_type (bidi_it->type_after_wn);
1868 type = WEAK_BN; /* X9/Retaining */ 1868 type = WEAK_BN; /* X9/Retaining */
1869 if (new_level < BIDI_MAXDEPTH 1869 if (new_level < BIDI_MAXDEPTH
1870 && bidi_it->invalid_levels == 0 1870 && bidi_it->invalid_levels == 0
@@ -1873,7 +1873,7 @@ bidi_resolve_explicit (struct bidi_it *bidi_it)
1873 /* Compute the least odd embedding level greater than 1873 /* Compute the least odd embedding level greater than
1874 the current level. */ 1874 the current level. */
1875 new_level = ((new_level + 1) & ~1) + 1; 1875 new_level = ((new_level + 1) & ~1) + 1;
1876 if (bidi_it->type_after_w1 == RLE) 1876 if (bidi_it->type_after_wn == RLE)
1877 override = NEUTRAL_DIR; 1877 override = NEUTRAL_DIR;
1878 else 1878 else
1879 override = R2L; 1879 override = R2L;
@@ -1888,8 +1888,8 @@ bidi_resolve_explicit (struct bidi_it *bidi_it)
1888 break; 1888 break;
1889 case LRE: /* X3 */ 1889 case LRE: /* X3 */
1890 case LRO: /* X5 */ 1890 case LRO: /* X5 */
1891 bidi_it->type_after_w1 = type; 1891 bidi_it->type_after_wn = type;
1892 bidi_check_type (bidi_it->type_after_w1); 1892 bidi_check_type (bidi_it->type_after_wn);
1893 type = WEAK_BN; /* X9/Retaining */ 1893 type = WEAK_BN; /* X9/Retaining */
1894 if (new_level < BIDI_MAXDEPTH - 1 1894 if (new_level < BIDI_MAXDEPTH - 1
1895 && bidi_it->invalid_levels == 0 1895 && bidi_it->invalid_levels == 0
@@ -1898,7 +1898,7 @@ bidi_resolve_explicit (struct bidi_it *bidi_it)
1898 /* Compute the least even embedding level greater than 1898 /* Compute the least even embedding level greater than
1899 the current level. */ 1899 the current level. */
1900 new_level = ((new_level + 2) & ~1); 1900 new_level = ((new_level + 2) & ~1);
1901 if (bidi_it->type_after_w1 == LRE) 1901 if (bidi_it->type_after_wn == LRE)
1902 override = NEUTRAL_DIR; 1902 override = NEUTRAL_DIR;
1903 else 1903 else
1904 override = L2R; 1904 override = L2R;
@@ -1933,18 +1933,18 @@ bidi_resolve_explicit (struct bidi_it *bidi_it)
1933 /* FALLTHROUGH */ 1933 /* FALLTHROUGH */
1934 case RLI: /* X5a */ 1934 case RLI: /* X5a */
1935 if (override == NEUTRAL_DIR) 1935 if (override == NEUTRAL_DIR)
1936 bidi_it->type_after_w1 = type; 1936 bidi_it->type_after_wn = type;
1937 else /* Unicode 8.0 correction. */ 1937 else /* Unicode 8.0 correction. */
1938 bidi_it->type_after_w1 = (override == L2R ? STRONG_L : STRONG_R); 1938 bidi_it->type_after_wn = (override == L2R ? STRONG_L : STRONG_R);
1939 bidi_check_type (bidi_it->type_after_w1); 1939 bidi_check_type (bidi_it->type_after_wn);
1940 break; 1940 break;
1941 case LRI: /* X5b */ 1941 case LRI: /* X5b */
1942 fsi_as_lri: 1942 fsi_as_lri:
1943 if (override == NEUTRAL_DIR) 1943 if (override == NEUTRAL_DIR)
1944 bidi_it->type_after_w1 = type; 1944 bidi_it->type_after_wn = type;
1945 else /* Unicode 8.0 correction. */ 1945 else /* Unicode 8.0 correction. */
1946 bidi_it->type_after_w1 = (override == L2R ? STRONG_L : STRONG_R); 1946 bidi_it->type_after_wn = (override == L2R ? STRONG_L : STRONG_R);
1947 bidi_check_type (bidi_it->type_after_w1); 1947 bidi_check_type (bidi_it->type_after_wn);
1948 break; 1948 break;
1949 case PDI: /* X6a */ 1949 case PDI: /* X6a */
1950 if (bidi_it->invalid_isolates) 1950 if (bidi_it->invalid_isolates)
@@ -1961,15 +1961,15 @@ bidi_resolve_explicit (struct bidi_it *bidi_it)
1961 bidi_it->resolved_level = new_level; 1961 bidi_it->resolved_level = new_level;
1962 /* Unicode 8.0 correction. */ 1962 /* Unicode 8.0 correction. */
1963 if (bidi_it->level_stack[bidi_it->stack_idx].override == L2R) 1963 if (bidi_it->level_stack[bidi_it->stack_idx].override == L2R)
1964 bidi_it->type_after_w1 = STRONG_L; 1964 bidi_it->type_after_wn = STRONG_L;
1965 else if (bidi_it->level_stack[bidi_it->stack_idx].override == R2L) 1965 else if (bidi_it->level_stack[bidi_it->stack_idx].override == R2L)
1966 bidi_it->type_after_w1 = STRONG_R; 1966 bidi_it->type_after_wn = STRONG_R;
1967 else 1967 else
1968 bidi_it->type_after_w1 = type; 1968 bidi_it->type_after_wn = type;
1969 break; 1969 break;
1970 case PDF: /* X7 */ 1970 case PDF: /* X7 */
1971 bidi_it->type_after_w1 = type; 1971 bidi_it->type_after_wn = type;
1972 bidi_check_type (bidi_it->type_after_w1); 1972 bidi_check_type (bidi_it->type_after_wn);
1973 type = WEAK_BN; /* X9/Retaining */ 1973 type = WEAK_BN; /* X9/Retaining */
1974 break; 1974 break;
1975 default: 1975 default:
@@ -1984,7 +1984,7 @@ bidi_resolve_explicit (struct bidi_it *bidi_it)
1984 { 1984 {
1985 bidi_set_paragraph_end (bidi_it); 1985 bidi_set_paragraph_end (bidi_it);
1986 /* This is needed by bidi_resolve_weak below, and in L1. */ 1986 /* This is needed by bidi_resolve_weak below, and in L1. */
1987 bidi_it->type_after_w1 = bidi_it->type; 1987 bidi_it->type_after_wn = bidi_it->type;
1988 } 1988 }
1989 1989
1990 eassert (bidi_it->resolved_level >= 0); 1990 eassert (bidi_it->resolved_level >= 0);
@@ -2033,8 +2033,8 @@ bidi_resolve_weak (struct bidi_it *bidi_it)
2033 } 2033 }
2034 if (type == NEUTRAL_S || type == NEUTRAL_WS 2034 if (type == NEUTRAL_S || type == NEUTRAL_WS
2035 || type == WEAK_BN || type == STRONG_AL) 2035 || type == WEAK_BN || type == STRONG_AL)
2036 bidi_it->type_after_w1 = type; /* needed in L1 */ 2036 bidi_it->type_after_wn = type; /* needed in L1 */
2037 bidi_check_type (bidi_it->type_after_w1); 2037 bidi_check_type (bidi_it->type_after_wn);
2038 2038
2039 /* Level and directional override status are already recorded in 2039 /* Level and directional override status are already recorded in
2040 bidi_it, and do not need any change; see X6. */ 2040 bidi_it, and do not need any change; see X6. */
@@ -2051,14 +2051,14 @@ bidi_resolve_weak (struct bidi_it *bidi_it)
2051 because then either the type of this NSM would have been 2051 because then either the type of this NSM would have been
2052 also overridden, or the previous character is outside the 2052 also overridden, or the previous character is outside the
2053 current level run, and thus not relevant to this NSM. 2053 current level run, and thus not relevant to this NSM.
2054 This is why NSM gets the type_after_w1 of the previous 2054 This is why NSM gets the type_after_wn of the previous
2055 character. */ 2055 character. */
2056 /* bidi_set_sos_type sets type_after_w1 to UNKNOWN_BT. */ 2056 /* bidi_set_sos_type sets type_after_wn to UNKNOWN_BT. */
2057 if (bidi_it->prev.type_after_w1 != UNKNOWN_BT 2057 if (bidi_it->prev.type_after_wn != UNKNOWN_BT
2058 /* If type_after_w1 is NEUTRAL_B, this NSM is at sos. */ 2058 /* If type_after_wn is NEUTRAL_B, this NSM is at sos. */
2059 && bidi_it->prev.type_after_w1 != NEUTRAL_B) 2059 && bidi_it->prev.type_after_wn != NEUTRAL_B)
2060 { 2060 {
2061 if (bidi_isolate_fmt_char (bidi_it->prev.type_after_w1)) 2061 if (bidi_isolate_fmt_char (bidi_it->prev.type_after_wn))
2062 { 2062 {
2063 /* From W1: "Note that in an isolating run sequence, 2063 /* From W1: "Note that in an isolating run sequence,
2064 an isolate initiator followed by an NSM or any 2064 an isolate initiator followed by an NSM or any
@@ -2069,7 +2069,7 @@ bidi_resolve_weak (struct bidi_it *bidi_it)
2069 } 2069 }
2070 else 2070 else
2071 { 2071 {
2072 type = bidi_it->prev.type_after_w1; 2072 type = bidi_it->prev.type_after_wn;
2073 /* Unicode 8.0 correction for N0. */ 2073 /* Unicode 8.0 correction for N0. */
2074 if (type == NEUTRAL_ON 2074 if (type == NEUTRAL_ON
2075 && bidi_it->prev.bracket_resolved 2075 && bidi_it->prev.bracket_resolved
@@ -2086,17 +2086,17 @@ bidi_resolve_weak (struct bidi_it *bidi_it)
2086 emacs_abort (); 2086 emacs_abort ();
2087 } 2087 }
2088 if (type == WEAK_EN /* W2 */ 2088 if (type == WEAK_EN /* W2 */
2089 && bidi_it->last_strong.type_after_w1 == STRONG_AL) 2089 && bidi_it->last_strong.type_after_wn == STRONG_AL)
2090 type = WEAK_AN; 2090 type = WEAK_AN;
2091 else if (type == STRONG_AL) /* W3 */ 2091 else if (type == STRONG_AL) /* W3 */
2092 type = STRONG_R; 2092 type = STRONG_R;
2093 else if ((type == WEAK_ES /* W4 */ 2093 else if ((type == WEAK_ES /* W4 */
2094 && bidi_it->prev.type_after_w1 == WEAK_EN 2094 && bidi_it->prev.type_after_wn == WEAK_EN
2095 && bidi_it->prev.orig_type == WEAK_EN) 2095 && bidi_it->prev.orig_type == WEAK_EN)
2096 || (type == WEAK_CS 2096 || (type == WEAK_CS
2097 && ((bidi_it->prev.type_after_w1 == WEAK_EN 2097 && ((bidi_it->prev.type_after_wn == WEAK_EN
2098 && bidi_it->prev.orig_type == WEAK_EN) 2098 && bidi_it->prev.orig_type == WEAK_EN)
2099 || bidi_it->prev.type_after_w1 == WEAK_AN))) 2099 || bidi_it->prev.type_after_wn == WEAK_AN)))
2100 { 2100 {
2101 const unsigned char *s 2101 const unsigned char *s
2102 = (STRINGP (bidi_it->string.lstring) 2102 = (STRINGP (bidi_it->string.lstring)
@@ -2125,11 +2125,11 @@ bidi_resolve_weak (struct bidi_it *bidi_it)
2125 should not be changed into EN. */ 2125 should not be changed into EN. */
2126 if (type == WEAK_ES 2126 if (type == WEAK_ES
2127 && type_of_next == WEAK_EN 2127 && type_of_next == WEAK_EN
2128 && bidi_it->last_strong.type_after_w1 != STRONG_AL) 2128 && bidi_it->last_strong.type_after_wn != STRONG_AL)
2129 type = WEAK_EN; 2129 type = WEAK_EN;
2130 else if (type == WEAK_CS) 2130 else if (type == WEAK_CS)
2131 { 2131 {
2132 if (bidi_it->prev.type_after_w1 == WEAK_AN 2132 if (bidi_it->prev.type_after_wn == WEAK_AN
2133 && (type_of_next == WEAK_AN 2133 && (type_of_next == WEAK_AN
2134 /* If the next character is EN, but the last 2134 /* If the next character is EN, but the last
2135 strong-type character is AL, EN will be later 2135 strong-type character is AL, EN will be later
@@ -2137,18 +2137,18 @@ bidi_resolve_weak (struct bidi_it *bidi_it)
2137 So in that case, this ES should not be 2137 So in that case, this ES should not be
2138 changed into EN. */ 2138 changed into EN. */
2139 || (type_of_next == WEAK_EN 2139 || (type_of_next == WEAK_EN
2140 && bidi_it->last_strong.type_after_w1 == STRONG_AL))) 2140 && bidi_it->last_strong.type_after_wn == STRONG_AL)))
2141 type = WEAK_AN; 2141 type = WEAK_AN;
2142 else if (bidi_it->prev.type_after_w1 == WEAK_EN 2142 else if (bidi_it->prev.type_after_wn == WEAK_EN
2143 && type_of_next == WEAK_EN 2143 && type_of_next == WEAK_EN
2144 && bidi_it->last_strong.type_after_w1 != STRONG_AL) 2144 && bidi_it->last_strong.type_after_wn != STRONG_AL)
2145 type = WEAK_EN; 2145 type = WEAK_EN;
2146 } 2146 }
2147 } 2147 }
2148 else if (type == WEAK_ET /* W5: ET with EN before or after it */ 2148 else if (type == WEAK_ET /* W5: ET with EN before or after it */
2149 || type == WEAK_BN) /* W5/Retaining */ 2149 || type == WEAK_BN) /* W5/Retaining */
2150 { 2150 {
2151 if (bidi_it->prev.type_after_w1 == WEAK_EN) /* ET/BN w/EN before it */ 2151 if (bidi_it->prev.type_after_wn == WEAK_EN) /* ET/BN w/EN before it */
2152 type = WEAK_EN; 2152 type = WEAK_EN;
2153 else if (bidi_it->next_en_pos > bidi_it->charpos 2153 else if (bidi_it->next_en_pos > bidi_it->charpos
2154 && bidi_it->next_en_type != WEAK_BN) 2154 && bidi_it->next_en_type != WEAK_BN)
@@ -2209,7 +2209,7 @@ bidi_resolve_weak (struct bidi_it *bidi_it)
2209 { 2209 {
2210 /* If the last strong character is AL, the EN we've 2210 /* If the last strong character is AL, the EN we've
2211 found will become AN when we get to it (W2). */ 2211 found will become AN when we get to it (W2). */
2212 if (bidi_it->last_strong.type_after_w1 == STRONG_AL) 2212 if (bidi_it->last_strong.type_after_wn == STRONG_AL)
2213 type_of_next = WEAK_AN; 2213 type_of_next = WEAK_AN;
2214 else if (type == WEAK_BN) 2214 else if (type == WEAK_BN)
2215 type = NEUTRAL_ON; /* W6/Retaining */ 2215 type = NEUTRAL_ON; /* W6/Retaining */
@@ -2229,22 +2229,22 @@ bidi_resolve_weak (struct bidi_it *bidi_it)
2229 2229
2230 if (type == WEAK_ES || type == WEAK_ET || type == WEAK_CS /* W6 */ 2230 if (type == WEAK_ES || type == WEAK_ET || type == WEAK_CS /* W6 */
2231 || (type == WEAK_BN 2231 || (type == WEAK_BN
2232 && (bidi_it->prev.type_after_w1 == WEAK_CS /* W6/Retaining */ 2232 && (bidi_it->prev.type_after_wn == WEAK_CS /* W6/Retaining */
2233 || bidi_it->prev.type_after_w1 == WEAK_ES 2233 || bidi_it->prev.type_after_wn == WEAK_ES
2234 || bidi_it->prev.type_after_w1 == WEAK_ET))) 2234 || bidi_it->prev.type_after_wn == WEAK_ET)))
2235 type = NEUTRAL_ON; 2235 type = NEUTRAL_ON;
2236 2236
2237 /* Store the type we've got so far, before we clobber it with strong 2237 /* Store the type we've got so far, before we clobber it with strong
2238 types in W7 and while resolving neutral types. But leave alone 2238 types in W7 and while resolving neutral types. But leave alone
2239 the original types that were recorded above, because we will need 2239 the original types that were recorded above, because we will need
2240 them for the L1 clause. */ 2240 them for the L1 clause. */
2241 if (bidi_it->type_after_w1 == UNKNOWN_BT) 2241 if (bidi_it->type_after_wn == UNKNOWN_BT)
2242 bidi_it->type_after_w1 = type; 2242 bidi_it->type_after_wn = type;
2243 bidi_check_type (bidi_it->type_after_w1); 2243 bidi_check_type (bidi_it->type_after_wn);
2244 2244
2245 if (type == WEAK_EN) /* W7 */ 2245 if (type == WEAK_EN) /* W7 */
2246 { 2246 {
2247 if ((bidi_it->last_strong.type_after_w1 == STRONG_L) 2247 if ((bidi_it->last_strong.type_after_wn == STRONG_L)
2248 || (bidi_it->last_strong.type == UNKNOWN_BT && bidi_it->sos == L2R)) 2248 || (bidi_it->last_strong.type == UNKNOWN_BT && bidi_it->sos == L2R))
2249 type = STRONG_L; 2249 type = STRONG_L;
2250 } 2250 }
@@ -2405,7 +2405,7 @@ bidi_resolve_bracket_pairs (struct bidi_it *bidi_it)
2405 else 2405 else
2406 bidi_it->bracket_resolved = 1; 2406 bidi_it->bracket_resolved = 1;
2407 } 2407 }
2408 else if (bidi_get_category (bidi_it->type_after_w1) != NEUTRAL) 2408 else if (bidi_get_category (bidi_it->type_after_wn) != NEUTRAL)
2409 { 2409 {
2410 unsigned flag; 2410 unsigned flag;
2411 int sp; 2411 int sp;
@@ -2438,7 +2438,7 @@ bidi_resolve_bracket_pairs (struct bidi_it *bidi_it)
2438 } 2438 }
2439 /* Record the info about the previous character, so that it 2439 /* Record the info about the previous character, so that it
2440 will be cached with this state. */ 2440 will be cached with this state. */
2441 if (bidi_it->type_after_w1 != WEAK_BN /* W1/Retaining */ 2441 if (bidi_it->type_after_wn != WEAK_BN /* W1/Retaining */
2442 && bidi_it->type != WEAK_BN) 2442 && bidi_it->type != WEAK_BN)
2443 bidi_remember_char (&bidi_it->prev, bidi_it); 2443 bidi_remember_char (&bidi_it->prev, bidi_it);
2444 old_sidx = bidi_it->stack_idx; 2444 old_sidx = bidi_it->stack_idx;
@@ -2482,7 +2482,7 @@ bidi_resolve_bracket_pairs (struct bidi_it *bidi_it)
2482 type = saved_it.type; 2482 type = saved_it.type;
2483 break; 2483 break;
2484 } 2484 }
2485 if (bidi_it->type_after_w1 == NEUTRAL_ON) /* Unicode 8.0 correction */ 2485 if (bidi_it->type_after_wn == NEUTRAL_ON) /* Unicode 8.0 correction */
2486 btype = bidi_paired_bracket_type (bidi_it->ch); 2486 btype = bidi_paired_bracket_type (bidi_it->ch);
2487 else 2487 else
2488 btype = BIDI_BRACKET_NONE; 2488 btype = BIDI_BRACKET_NONE;
@@ -2608,7 +2608,7 @@ bidi_resolve_neutral (struct bidi_it *bidi_it)
2608 bidi_cache_iterator_state (bidi_it, type == NEUTRAL_B); 2608 bidi_cache_iterator_state (bidi_it, type == NEUTRAL_B);
2609 /* Record the info about the previous character, so that 2609 /* Record the info about the previous character, so that
2610 it will be cached with this state. */ 2610 it will be cached with this state. */
2611 if (bidi_it->type_after_w1 != WEAK_BN /* W1/Retaining */ 2611 if (bidi_it->type_after_wn != WEAK_BN /* W1/Retaining */
2612 && bidi_it->type != WEAK_BN) 2612 && bidi_it->type != WEAK_BN)
2613 bidi_remember_char (&bidi_it->prev, bidi_it); 2613 bidi_remember_char (&bidi_it->prev, bidi_it);
2614 old_sidx = bidi_it->stack_idx; 2614 old_sidx = bidi_it->stack_idx;
@@ -2750,12 +2750,12 @@ bidi_level_of_next_char (struct bidi_it *bidi_it)
2750 } 2750 }
2751 2751
2752 /* Record the info about the previous character. */ 2752 /* Record the info about the previous character. */
2753 if (bidi_it->type_after_w1 != WEAK_BN /* W1/Retaining */ 2753 if (bidi_it->type_after_wn != WEAK_BN /* W1/Retaining */
2754 && bidi_it->type != WEAK_BN) 2754 && bidi_it->type != WEAK_BN)
2755 bidi_remember_char (&bidi_it->prev, bidi_it); 2755 bidi_remember_char (&bidi_it->prev, bidi_it);
2756 if (bidi_it->type_after_w1 == STRONG_R 2756 if (bidi_it->type_after_wn == STRONG_R
2757 || bidi_it->type_after_w1 == STRONG_L 2757 || bidi_it->type_after_wn == STRONG_L
2758 || bidi_it->type_after_w1 == STRONG_AL) 2758 || bidi_it->type_after_wn == STRONG_AL)
2759 bidi_remember_char (&bidi_it->last_strong, bidi_it); 2759 bidi_remember_char (&bidi_it->last_strong, bidi_it);
2760 /* FIXME: it sounds like we don't need both prev and 2760 /* FIXME: it sounds like we don't need both prev and
2761 prev_for_neutral members, but I'm leaving them both for now. */ 2761 prev_for_neutral members, but I'm leaving them both for now. */
diff --git a/src/dispextern.h b/src/dispextern.h
index cfe834e572a..d476656e1b2 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1915,7 +1915,7 @@ typedef enum { NEUTRAL_DIR, L2R, R2L } bidi_dir_t;
1915struct bidi_saved_info { 1915struct bidi_saved_info {
1916 ptrdiff_t bytepos, charpos; /* character's buffer position */ 1916 ptrdiff_t bytepos, charpos; /* character's buffer position */
1917 bidi_type_t type; /* character's resolved bidi type */ 1917 bidi_type_t type; /* character's resolved bidi type */
1918 bidi_type_t type_after_w1; /* original type of the character, after W1 */ 1918 bidi_type_t type_after_wn; /* original type of the character, after W1 */
1919 bidi_type_t orig_type; /* type as we found it in the buffer */ 1919 bidi_type_t orig_type; /* type as we found it in the buffer */
1920 bool_bf bracket_resolved : 1; /* 1 if type was BPA-resolved */ 1920 bool_bf bracket_resolved : 1; /* 1 if type was BPA-resolved */
1921}; 1921};
@@ -1955,10 +1955,10 @@ struct bidi_it {
1955 ptrdiff_t nchars; /* its "length", usually 1; it's > 1 for a run 1955 ptrdiff_t nchars; /* its "length", usually 1; it's > 1 for a run
1956 of characters covered by a display string */ 1956 of characters covered by a display string */
1957 ptrdiff_t ch_len; /* its length in bytes */ 1957 ptrdiff_t ch_len; /* its length in bytes */
1958 bidi_type_t type; /* bidi type of this character, after 1958 bidi_type_t type; /* final bidi type of this character, after
1959 resolving weak and neutral types */ 1959 resolving weak and neutral types */
1960 bidi_type_t type_after_w1; /* original type, after overrides and W1 */ 1960 bidi_type_t type_after_wn; /* bidi type after overrides and Wn */
1961 bidi_type_t orig_type; /* original type, as found in the buffer */ 1961 bidi_type_t orig_type; /* original bidi type, as found in the buffer */
1962 char resolved_level; /* final resolved level of this character */ 1962 char resolved_level; /* final resolved level of this character */
1963 char isolate_level; /* count of isolate initiators unmatched by PDI */ 1963 char isolate_level; /* count of isolate initiators unmatched by PDI */
1964 ptrdiff_t invalid_levels; /* how many PDFs to ignore */ 1964 ptrdiff_t invalid_levels; /* how many PDFs to ignore */