+2010-01-09 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (handle_stop_backwards): Add a prototype.
+ (reseat): call handle_stop_backwards to recompute prev_stop and
+ base_level_stop for the new position. Solves the crash when
+ scrolling backwards.
+
2010-01-02 Eli Zaretskii <eliz@gnu.org>
* .gdbinit (pitx): Display some bidi information about the
static int store_mode_line_noprop P_ ((const unsigned char *, int, int));
static void x_consider_frame_title P_ ((Lisp_Object));
static void handle_stop P_ ((struct it *));
+static void handle_stop_backwards P_ ((struct it *, EMACS_INT));
static int tool_bar_lines_needed P_ ((struct frame *, int *));
static int single_display_spec_intangible_p P_ ((Lisp_Object));
static void ensure_echo_area_buffers P_ ((void));
if (force_p
|| CHARPOS (pos) > it->stop_charpos
|| CHARPOS (pos) < original_pos)
- handle_stop (it);
+ {
+ if (it->bidi_p)
+ {
+ /* For bidi iteration, we need to prime prev_stop and
+ base_level_stop with our best estimations. */
+ if (CHARPOS (pos) < it->prev_stop)
+ {
+ handle_stop_backwards (it, BEGV);
+ if (CHARPOS (pos) < it->base_level_stop)
+ it->base_level_stop = 0;
+ }
+ else if (CHARPOS (pos) > it->stop_charpos
+ && it->stop_charpos >= BEGV)
+ handle_stop_backwards (it, it->stop_charpos);
+ else /* force_p */
+ handle_stop (it);
+ }
+ else
+ {
+ handle_stop (it);
+ it->prev_stop = it->base_level_stop = 0;
+ }
+
+ }
CHECK_IT (it);
}
&& IT_CHARPOS (*it) < it->prev_stop)
{
if (it->base_level_stop <= 0)
- it->base_level_stop = 1;
+ it->base_level_stop = BEGV;
if (IT_CHARPOS (*it) < it->base_level_stop)
abort ();
handle_stop_backwards (it, it->base_level_stop);