aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2016-03-12 11:51:03 +0200
committerEli Zaretskii2016-03-12 11:51:03 +0200
commit48196164aa206d057874119cac2025d376566365 (patch)
tree56a9f7915878b4b688bc313c4acef58d7e6aabe4 /src
parent6d8e1f0276fb6cce8d3f1e707bf52c18f8fb70d0 (diff)
downloademacs-48196164aa206d057874119cac2025d376566365.tar.gz
emacs-48196164aa206d057874119cac2025d376566365.zip
Avoid crashes at startup on systems that CANNOT_DUMP
* src/xdisp.c (syms_of_xdisp) <redisplay--inhibit-bidi>: New boolean variable. (init_iterator, reseat_to_string) (Fcurrent_bidi_paragraph_direction) (Fbidi_find_overridden_directionality): Use redisplay--inhibit-bidi instead of purify-flag, to determine when it's safe to reorder bidirectional text. * lisp/loadup.el (redisplay--inhibit-bidi): Set to t at the beginning of the file. Reset to nil when charprop.el is successfully loaded, or when we are going to dump, whichever happens last. (Bug#22975)
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index e5ac6504067..ce992d42531 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2946,7 +2946,7 @@ init_iterator (struct it *it, struct window *w,
2946 character properties needed for reordering are not yet 2946 character properties needed for reordering are not yet
2947 available. */ 2947 available. */
2948 it->bidi_p = 2948 it->bidi_p =
2949 NILP (Vpurify_flag) 2949 !redisplay__inhibit_bidi
2950 && !NILP (BVAR (current_buffer, bidi_display_reordering)) 2950 && !NILP (BVAR (current_buffer, bidi_display_reordering))
2951 && it->multibyte_p; 2951 && it->multibyte_p;
2952 2952
@@ -6641,7 +6641,7 @@ reseat_to_string (struct it *it, const char *s, Lisp_Object string,
6641 loading loadup.el, as the necessary character property tables are 6641 loading loadup.el, as the necessary character property tables are
6642 not yet available. */ 6642 not yet available. */
6643 it->bidi_p = 6643 it->bidi_p =
6644 NILP (Vpurify_flag) 6644 !redisplay__inhibit_bidi
6645 && !NILP (BVAR (&buffer_defaults, bidi_display_reordering)); 6645 && !NILP (BVAR (&buffer_defaults, bidi_display_reordering));
6646 6646
6647 if (s == NULL) 6647 if (s == NULL)
@@ -21230,7 +21230,7 @@ See also `bidi-paragraph-direction'. */)
21230 || NILP (BVAR (buf, enable_multibyte_characters)) 21230 || NILP (BVAR (buf, enable_multibyte_characters))
21231 /* When we are loading loadup.el, the character property tables 21231 /* When we are loading loadup.el, the character property tables
21232 needed for bidi iteration are not yet available. */ 21232 needed for bidi iteration are not yet available. */
21233 || !NILP (Vpurify_flag)) 21233 || redisplay__inhibit_bidi)
21234 return Qleft_to_right; 21234 return Qleft_to_right;
21235 else if (!NILP (BVAR (buf, bidi_paragraph_direction))) 21235 else if (!NILP (BVAR (buf, bidi_paragraph_direction)))
21236 return BVAR (buf, bidi_paragraph_direction); 21236 return BVAR (buf, bidi_paragraph_direction);
@@ -21354,7 +21354,7 @@ the `bidi-class' property of a character. */)
21354 /* When we are loading loadup.el, the character property 21354 /* When we are loading loadup.el, the character property
21355 tables needed for bidi iteration are not yet 21355 tables needed for bidi iteration are not yet
21356 available. */ 21356 available. */
21357 || !NILP (Vpurify_flag)) 21357 || redisplay__inhibit_bidi)
21358 return Qnil; 21358 return Qnil;
21359 21359
21360 validate_subarray (object, from, to, SCHARS (object), &from_pos, &to_pos); 21360 validate_subarray (object, from, to, SCHARS (object), &from_pos, &to_pos);
@@ -21382,7 +21382,7 @@ the `bidi-class' property of a character. */)
21382 /* When we are loading loadup.el, the character property 21382 /* When we are loading loadup.el, the character property
21383 tables needed for bidi iteration are not yet 21383 tables needed for bidi iteration are not yet
21384 available. */ 21384 available. */
21385 || !NILP (Vpurify_flag)) 21385 || redisplay__inhibit_bidi)
21386 return Qnil; 21386 return Qnil;
21387 21387
21388 set_buffer_temp (buf); 21388 set_buffer_temp (buf);
@@ -31806,6 +31806,12 @@ display table takes effect; in this case, Emacs does not consult
31806 DEFVAR_LISP ("redisplay--variables", Vredisplay__variables, 31806 DEFVAR_LISP ("redisplay--variables", Vredisplay__variables,
31807 doc: /* A hash-table of variables changing which triggers a thorough redisplay. */); 31807 doc: /* A hash-table of variables changing which triggers a thorough redisplay. */);
31808 Vredisplay__variables = Qnil; 31808 Vredisplay__variables = Qnil;
31809
31810 DEFVAR_BOOL ("redisplay--inhibit-bidi", redisplay__inhibit_bidi,
31811 doc: /* Non-nil means it is not safe to attempt bidi reordering for display. */);
31812 /* Initialize to t, since we need to disable reordering until
31813 loadup.el successfully loads charprop.el. */
31814 redisplay__inhibit_bidi = true;
31809} 31815}
31810 31816
31811 31817