character properties needed for reordering are not yet
available. */
it->bidi_p =
- NILP (Vpurify_flag)
+ !redisplay__inhibit_bidi
&& !NILP (BVAR (current_buffer, bidi_display_reordering))
&& it->multibyte_p;
loading loadup.el, as the necessary character property tables are
not yet available. */
it->bidi_p =
- NILP (Vpurify_flag)
+ !redisplay__inhibit_bidi
&& !NILP (BVAR (&buffer_defaults, bidi_display_reordering));
if (s == NULL)
{
ptrdiff_t ignore;
int next_face_id;
+ bool text_from_string = false;
+ /* Normally, the next buffer location is stored in
+ IT->current.pos... */
struct text_pos pos = it->current.pos;
- /* For a string from a display property, the next
- buffer position is stored in the 'position'
+ /* ...but for a string from a display property, the
+ next buffer position is stored in the 'position'
member of the iteration stack slot below the
current one, see handle_single_display_spec. By
- contrast, it->current.pos was not yet updated
- to point to that buffer position; that will
- happen in pop_it, after we finish displaying the
- current string. Note that we already checked
- above that it->sp is positive, so subtracting one
- from it is safe. */
+ contrast, it->current.pos was not yet updated to
+ point to that buffer position; that will happen
+ in pop_it, after we finish displaying the current
+ string. Note that we already checked above that
+ it->sp is positive, so subtracting one from it is
+ safe. */
if (it->from_disp_prop_p)
{
int stackp = it->sp - 1;
while (stackp >= 0
&& STRINGP ((it->stack + stackp)->string))
stackp--;
- eassert (stackp >= 0);
- pos = (it->stack + stackp)->position;
+ if (stackp < 0)
+ {
+ /* If no stack slot was found for iterating
+ a buffer, we are displaying text from a
+ string, most probably the mode line or
+ the header line, and that string has a
+ display string on some of its
+ characters. */
+ text_from_string = true;
+ pos = it->stack[it->sp - 1].position;
+ }
+ else
+ pos = (it->stack + stackp)->position;
}
else
INC_TEXT_POS (pos, it->multibyte_p);
- if (CHARPOS (pos) >= ZV)
+ if (text_from_string)
+ {
+ Lisp_Object base_string = it->stack[it->sp - 1].string;
+
+ if (CHARPOS (pos) >= SCHARS (base_string) - 1)
+ it->end_of_box_run_p = true;
+ else
+ {
+ next_face_id
+ = face_at_string_position (it->w, base_string,
+ CHARPOS (pos), 0,
+ &ignore, face_id, false);
+ it->end_of_box_run_p
+ = (FACE_FROM_ID (it->f, next_face_id)->box
+ == FACE_NO_BOX);
+ }
+ }
+ else if (CHARPOS (pos) >= ZV)
it->end_of_box_run_p = true;
else
{
- next_face_id = face_at_buffer_position
- (it->w, CHARPOS (pos), &ignore,
- CHARPOS (pos) + TEXT_PROP_DISTANCE_LIMIT, false, -1);
+ next_face_id =
+ face_at_buffer_position (it->w, CHARPOS (pos), &ignore,
+ CHARPOS (pos)
+ + TEXT_PROP_DISTANCE_LIMIT,
+ false, -1);
it->end_of_box_run_p
= (FACE_FROM_ID (it->f, next_face_id)->box
== FACE_NO_BOX);
suitable buffer from echo_buffer[] and clear it.
If WHICH < 0, set echo_area_buffer[1] to echo_area_buffer[0], so
- that the current message becomes the last displayed one, make
- choose a suitable buffer for echo_area_buffer[0], and clear it.
+ that the current message becomes the last displayed one, choose a
+ suitable buffer for echo_area_buffer[0], and clear it.
Value is what FN returns. */
echo_area_buffer[this_one] = Qnil;
}
- /* Choose a suitable buffer from echo_buffer[] is we don't
+ /* Choose a suitable buffer from echo_buffer[] if we don't
have one. */
if (NILP (echo_area_buffer[this_one]))
{
specbind (Qinhibit_free_realized_faces, Qnil);
/* Record this function, so it appears on the profiler's backtraces. */
- record_in_backtrace (Qredisplay_internal, 0, 0);
+ record_in_backtrace (Qredisplay_internal_xC_functionx, 0, 0);
FOR_EACH_FRAME (tail, frame)
XFRAME (frame)->already_hscrolled_p = false;
|| NILP (BVAR (buf, enable_multibyte_characters))
/* When we are loading loadup.el, the character property tables
needed for bidi iteration are not yet available. */
- || !NILP (Vpurify_flag))
+ || redisplay__inhibit_bidi)
return Qleft_to_right;
else if (!NILP (BVAR (buf, bidi_paragraph_direction)))
return BVAR (buf, bidi_paragraph_direction);
/* When we are loading loadup.el, the character property
tables needed for bidi iteration are not yet
available. */
- || !NILP (Vpurify_flag))
+ || redisplay__inhibit_bidi)
return Qnil;
validate_subarray (object, from, to, SCHARS (object), &from_pos, &to_pos);
/* When we are loading loadup.el, the character property
tables needed for bidi iteration are not yet
available. */
- || !NILP (Vpurify_flag))
+ || redisplay__inhibit_bidi)
return Qnil;
set_buffer_temp (buf);
/* Non-nil means don't actually do any redisplay. */
DEFSYM (Qinhibit_redisplay, "inhibit-redisplay");
- DEFSYM (Qredisplay_internal, "redisplay_internal (C function)");
+ DEFSYM (Qredisplay_internal_xC_functionx, "redisplay_internal (C function)");
DEFVAR_BOOL("inhibit-message", inhibit_message,
doc: /* Non-nil means calls to `message' are not displayed.
Vtruncate_partial_width_windows,
doc: /* Non-nil means truncate lines in windows narrower than the frame.
For an integer value, truncate lines in each window narrower than the
-full frame width, provided the window width is less than that integer;
-otherwise, respect the value of `truncate-lines'.
+full frame width, provided the total window width in column units is less
+than that integer; otherwise, respect the value of `truncate-lines'.
+The total width of the window is as returned by `window-total-width', it
+includes the fringes, the continuation and truncation glyphs, the
+display margins (if any), and the scroll bar
For any other non-nil value, truncate lines in all windows that do
not span the full frame width.
A value of `grow-only', the default, means let mini-windows grow only;
they return to their normal size when the minibuffer is closed, or the
echo area becomes empty. */);
- Vresize_mini_windows = Qgrow_only;
+ /* Contrary to the doc string, we initialize this to nil, so that
+ loading loadup.el won't try to resize windows before loading
+ window.el, where some functions we need to call for this live.
+ We assign the 'grow-only' value right after loading window.el
+ during loadup. */
+ Vresize_mini_windows = Qnil;
DEFVAR_LISP ("blink-cursor-alist", Vblink_cursor_alist,
doc: /* Alist specifying how to blink the cursor off.
DEFVAR_LISP ("redisplay--variables", Vredisplay__variables,
doc: /* A hash-table of variables changing which triggers a thorough redisplay. */);
Vredisplay__variables = Qnil;
+
+ DEFVAR_BOOL ("redisplay--inhibit-bidi", redisplay__inhibit_bidi,
+ doc: /* Non-nil means it is not safe to attempt bidi reordering for display. */);
+ /* Initialize to t, since we need to disable reordering until
+ loadup.el successfully loads charprop.el. */
+ redisplay__inhibit_bidi = true;
}