Redesign bidi-aware edge positions of glyph rows, fix bug #6036.
authorEli Zaretskii <eliz@gnu.org>
Sat, 22 May 2010 19:32:21 +0000 (22:32 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 22 May 2010 19:32:21 +0000 (22:32 +0300)
 dispextern.h (struct glyph_row): New members minpos and maxpos.
 (MATRIX_ROW_START_CHARPOS, MATRIX_ROW_START_BYTEPOS)
 (MATRIX_ROW_END_CHARPOS, MATRIX_ROW_END_BYTEPOS): Reference minpos
 and maxpos members instead of start.pos and end.pos, respectively.
 xdisp.c (display_line): Compare IT_CHARPOS with the position in
 row->start.pos, rather than with MATRIX_ROW_START_CHARPOS.
 (cursor_row_p): Use row->end.pos rather than MATRIX_ROW_END_CHARPOS.
 (try_window_reusing_current_matrix, try_window_id): Use
 ROW->minpos rather than ROW->start.pos.
 (init_from_display_pos, init_iterator): Use EMACS_INT for
 character and byte positions.
 (find_row_edges): Renamed from find_row_end.  Accept additional
 arguments for minimum and maximum buffer positions seen by
 display_line for this row.  Don't use iterator to find the
 position following the maximum one; instead, increment the
 position found by display_line directly.  Fix logic; eol_pos
 should be tested before the rest.  Handle the case of characters
 delivered from display vector (bug#6036).  Fix tests related to
 it->method.  Handle the truncated_on_right_p rows.
 (RECORD_MAX_MIN_POS): New macro.
 (display_line): Use it to record the minimum and maximum buffer
 positions for glyphs in the row being assembled.  Record the
 position of the newline that terminates the line.  If word wrap is
 in effect, restore minimum and maximum positions seen up to the
 wrap point, when iterator returns to it.
 (try_window_reusing_current_matrix): Give up if in bidi-reordered
 row and cursor not already at point.  Restore original pre-bidi
 code for unidirectional buffers.
 dispnew.c (increment_row_positions, check_matrix_invariants):
 Increment and check row->start.pos and row->end.pos, in addition
 to MATRIX_ROW_START_CHARPOS and MATRIX_ROW_END_CHARPOS.
 .gdbinit (prowlims): Display row->minpos and row->maxpos.
 Display truncated_on_left_p and truncated_on_right_p flags.
 Formatting fixes.
 (pmtxrows): Display the ordinal number of each row.  Don't display
 rows beyond the last one.
 bidi.c (bidi_cache_iterator_state): Don't zero out new_paragraph:
 it is not copied by bidi_copy_it.

1  2 
src/ChangeLog
src/xdisp.c

diff --cc src/ChangeLog
 -2010-05-22  Eli Zaretskii  <eliz@gnu.org>
 -
 -      * xdisp.c (find_row_edges): Handle the case of characters
 -      delivered from display vector.  Fix tests related to it->method.
 -      Handle the truncated_on_right_p rows.
 -
+ 2010-05-19  Eli Zaretskii  <eliz@gnu.org>
 -      * .gdbinit (prowlims): Display row->minpos and row->maxpos.
 -      Display truncated_on_left_p and truncated_on_right_p flags.
 -      Formatting fixes.
 -      (pmtxrows): Display the ordinal number of each row.  Don't display
 -      rows beyond the last one.
 -
 -      * xdisp.c (RECORD_MAX_MIN_POS): New macro.
 -      (display_line): Use it to record the minimum and maximum buffer
 -      positions for glyphs in the row being assembled.  If word wrap is
 -      in effect, restore minimum and maximum positions seen up to the
 -      wrap point, when iterator returns to it.
 -      (find_row_edges): Fix logic; eol_pos should be tested before the
 -      rest.
 -      (try_window_reusing_current_matrix): Give up if in bidi-reordered
 -      row and cursor not already at point.  Restore original pre-bidi
 -      code for unidirectional buffers.
 -
 -      * bidi.c (bidi_cache_shrink, bidi_cache_iterator_state): Fix
 -      reallocation of the cache.  (Bug#6210)
 -      (bidi_cache_iterator_state): Don't zero out new_paragraph (it is
 -      not copied by bidi_copy_it).
 -
 -2010-05-18  Eli Zaretskii  <eliz@gnu.org>
++      Redesign and reimplement bidi-aware edge positions of glyph rows.
+       * dispextern.h (struct glyph_row): New members minpos and maxpos.
+       (MATRIX_ROW_START_CHARPOS, MATRIX_ROW_START_BYTEPOS)
+       (MATRIX_ROW_END_CHARPOS, MATRIX_ROW_END_BYTEPOS): Reference minpos
+       and maxpos members instead of start.pos and end.pos, respectively.
+       * xdisp.c (display_line): Compare IT_CHARPOS with the position in
+       row->start.pos, rather than with MATRIX_ROW_START_CHARPOS.
+       (cursor_row_p): Use row->end.pos rather than MATRIX_ROW_END_CHARPOS.
+       (try_window_reusing_current_matrix, try_window_id): Use
+       ROW->minpos rather than ROW->start.pos.
+       (init_from_display_pos, init_iterator): Use EMACS_INT for
+       character and byte positions.
+       (find_row_edges): Renamed from find_row_end.  Accept additional
+       arguments for minimum and maximum buffer positions seen by
+       display_line for this row.  Don't use iterator to find the
+       position following the maximum one; instead, increment the
 -      position found by display_line directly.
 -      (display_line): Record minimum and maximum buffer positions for
 -      glyphs in this row.  Record the position of the newline that
 -      terminates the line.
++      position found by display_line directly.  Fix logic; eol_pos
++      should be tested before the rest.  Handle the case of characters
++      delivered from display vector (bug#6036).  Fix tests related to
++      it->method.  Handle the truncated_on_right_p rows.
++      (RECORD_MAX_MIN_POS): New macro.
++      (display_line): Use it to record the minimum and maximum buffer
++      positions for glyphs in the row being assembled.  Record the
++      position of the newline that terminates the line.  If word wrap is
++      in effect, restore minimum and maximum positions seen up to the
++      wrap point, when iterator returns to it.
++      (try_window_reusing_current_matrix): Give up if in bidi-reordered
++      row and cursor not already at point.  Restore original pre-bidi
++      code for unidirectional buffers.
+       * dispnew.c (increment_row_positions, check_matrix_invariants):
+       Increment and check row->start.pos and row->end.pos, in addition
+       to MATRIX_ROW_START_CHARPOS and MATRIX_ROW_END_CHARPOS.
++      * .gdbinit (prowlims): Display row->minpos and row->maxpos.
++      Display truncated_on_left_p and truncated_on_right_p flags.
++      Formatting fixes.
++      (pmtxrows): Display the ordinal number of each row.  Don't display
++      rows beyond the last one.
++
++      * bidi.c (bidi_cache_iterator_state): Don't zero out new_paragraph:
++      it is not copied by bidi_copy_it.
++
 +2010-05-22  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * w32.c (sys_write): Break writes into chunks smaller than 32MB.
 +      (Bug#6237)
 +
 +2010-05-22  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * image.c (Fimage_flush): Rename from image-refresh.
 +
 +2010-05-21  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * xdisp.c (redisplay_internal): Clear caches even if redisplaying
 +      just one window.
 +
 +      * image.c (Vimage_cache_eviction_delay): Decrease to 300.
 +      (clear_image_cache): If the number of cached images is unusually
 +      large, decrease the cache eviction delay (Bug#6230).
 +
 +2010-05-21  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (${ns_appdir}, ${ns_appbindir}Emacs, ns-app):
 +      Move these rules to ns.mk.
 +      * ns.mk: New file.
 +
 +      * Makefile.in (../src/$(OLDXMENU), $(OLDXMENU)): Always define rules.
 +
 +      * Makefile.in (CANNOT_DUMP): New, set by configure.
 +      (emacs${EXEEXT}, bootstrap-emacs${EXEEXT}): Use $CANNOT_DUMP.
 +
 +2010-05-20  Juri Linkov  <juri@jurta.org>
 +
 +      * fileio.c (Fdelete_file): Change interative spec to use
 +      `read-file-name' like in `find-file-read-args' where the default
 +      value is `default-directory' instead of `buffer-file-name'.
 +      http://lists.gnu.org/archive/html/emacs-devel/2010-05/msg00533.html
 +
 +2010-05-20  Kevin Ryde  <user42@zip.com.au>
 +
 +      * keyboard.c (Vlast_command, Vkeyboard_translate_table)
 +      (Voverriding_terminal_local_map, Vsystem_key_alist)
 +      (Vlocal_function_key_map): Fix manual link in docstring (Bug#6224).
 +
 +2010-05-20  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (DEPDIR): New constant.
 +      (DEPFLAGS): Set with configure, not cpp.
 +      (MKDEPDIR): New, set by configure.
 +      (.c.o, .m.o, ecrt0.o): Use $MKDEPDIR.
 +      (clean): Use $DEPDIR.
 +      (deps_frag): Include from configure.
 +      Move static/dynamic dependency stuff to deps.mk/autodeps.mk.
 +      * deps.mk, autodeps.mk: New files, extracted from Makefile.in.
 +
- 2010-05-19  Eli Zaretskii  <eliz@gnu.org>
 +      * bidi.c (bidi_cache_shrink, bidi_cache_iterator_state): Fix
 +      reallocation of the cache.  (Bug#6210)
 +
 +2010-05-19  Glenn Morris  <rgm@gnu.org>
 +
 +      * s/msdos.h (ORDINARY_LINK): Move to sed2v2.inp.
 +
 +      * Makefile.in (LD, YMF_PASS_LDFLAGS): Set with configure, not cpp.
 +      (GNULIB_VAR): Remove.
 +      (LIBES): Use LIB_GCC instead of GNULIB_VAR.
 +
 +      * m/ibms390x.h (LINKER):
 +      * m/macppc.h (LINKER) [GNU_LINUX]:
 +      * s/aix4-2.h (ORDINARY_LINK):
 +      * s/cygwin.h (LINKER):
 +      * s/darwin.h (ORDINARY_LINK):
 +      * s/gnu.h (ORDINARY_LINK):
 +      * s/netbsd.h (LINKER):
 +      * s/usg5-4.h (ORDINARY_LINK):
 +      Move to configure.
 +
 +      * s/aix4-2.h (LINKER): Remove; this file sets ORDINARY_LINK.
 +
 +2010-05-18  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * character.c (Fstring, Funibyte_string): Use SAFE_ALLOCA to
 +      prevent stack overflow if number of arguments is too large
 +      (Bug#6214).
 +
  2010-05-18  Juanma Barranquero  <lekktu@gmail.com>
  
        * charset.c (load_charset_map_from_file): Don't call close after fclose.
diff --cc src/xdisp.c
Simple merge