aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2012-04-17 18:25:17 +0300
committerEli Zaretskii2012-04-17 18:25:17 +0300
commit20a68157367994c17c0e5adae02568ea4683d13d (patch)
tree7ec59ef6893f34ce24fdb80389decdf07120b877 /src
parent2c070447bfad37262d292fe130db7db22da822fb (diff)
downloademacs-20a68157367994c17c0e5adae02568ea4683d13d.tar.gz
emacs-20a68157367994c17c0e5adae02568ea4683d13d.zip
Fix bug #11261 with cursor movement in a continued line when header line is present.
src/xdisp.c (string_buffer_position_lim): Limit starting position to BEGV. (set_cursor_from_row): If called for a mode-line or header-line row, return zero immediately. (try_cursor_movement): If inside continuation line, don't back up farther than the first row after the header line, if any. Don't consider the header-line row as "partially visible", even if MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog11
-rw-r--r--src/xdisp.c21
2 files changed, 28 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 73c67125257..42c582994cf 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
12012-04-17 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (string_buffer_position_lim): Limit starting position to
4 BEGV.
5 (set_cursor_from_row): If called for a mode-line or header-line
6 row, return zero immediately.
7 (try_cursor_movement): If inside continuation line, don't back up
8 farther than the first row after the header line, if any. Don't
9 consider the header-line row as "partially visible", even if
10 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
11
12012-04-13 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change) 122012-04-13 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
2 13
3 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n" (bug#11238). 14 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n" (bug#11238).
diff --git a/src/xdisp.c b/src/xdisp.c
index 61b0b9df5e1..9881adfa34d 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -4979,7 +4979,7 @@ string_buffer_position_lim (Lisp_Object string,
4979 Lisp_Object limit, prop, pos; 4979 Lisp_Object limit, prop, pos;
4980 int found = 0; 4980 int found = 0;
4981 4981
4982 pos = make_number (from); 4982 pos = make_number (max (from, BEGV));
4983 4983
4984 if (!back_p) /* looking forward */ 4984 if (!back_p) /* looking forward */
4985 { 4985 {
@@ -13690,6 +13690,13 @@ set_cursor_from_row (struct window *w, struct glyph_row *row,
13690 comes from a text property, not from an overlay. */ 13690 comes from a text property, not from an overlay. */
13691 int string_from_text_prop = 0; 13691 int string_from_text_prop = 0;
13692 13692
13693 /* Don't even try doing anything if called for a mode-line or
13694 header-line row, since the rest of the code isn't prepared to
13695 deal with such calamities. */
13696 xassert (!row->mode_line_p);
13697 if (row->mode_line_p)
13698 return 0;
13699
13693 /* Skip over glyphs not having an object at the start and the end of 13700 /* Skip over glyphs not having an object at the start and the end of
13694 the row. These are special glyphs like truncation marks on 13701 the row. These are special glyphs like truncation marks on
13695 terminal frames. */ 13702 terminal frames. */
@@ -14906,6 +14913,8 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
14906 else if (rc != CURSOR_MOVEMENT_SUCCESS 14913 else if (rc != CURSOR_MOVEMENT_SUCCESS
14907 && !NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering))) 14914 && !NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)))
14908 { 14915 {
14916 struct glyph_row *row1;
14917
14909 /* If rows are bidi-reordered and point moved, back up 14918 /* If rows are bidi-reordered and point moved, back up
14910 until we find a row that does not belong to a 14919 until we find a row that does not belong to a
14911 continuation line. This is because we must consider 14920 continuation line. This is because we must consider
@@ -14916,24 +14925,28 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
14916 /* FIXME: Revisit this when glyph ``spilling'' in 14925 /* FIXME: Revisit this when glyph ``spilling'' in
14917 continuation lines' rows is implemented for 14926 continuation lines' rows is implemented for
14918 bidi-reordered rows. */ 14927 bidi-reordered rows. */
14919 while (MATRIX_ROW_CONTINUATION_LINE_P (row)) 14928 for (row1 = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
14929 MATRIX_ROW_CONTINUATION_LINE_P (row);
14930 --row)
14920 { 14931 {
14921 /* If we hit the beginning of the displayed portion 14932 /* If we hit the beginning of the displayed portion
14922 without finding the first row of a continued 14933 without finding the first row of a continued
14923 line, give up. */ 14934 line, give up. */
14924 if (row <= w->current_matrix->rows) 14935 if (row <= row1)
14925 { 14936 {
14926 rc = CURSOR_MOVEMENT_MUST_SCROLL; 14937 rc = CURSOR_MOVEMENT_MUST_SCROLL;
14927 break; 14938 break;
14928 } 14939 }
14929 xassert (row->enabled_p); 14940 xassert (row->enabled_p);
14930 --row;
14931 } 14941 }
14932 } 14942 }
14933 if (must_scroll) 14943 if (must_scroll)
14934 ; 14944 ;
14935 else if (rc != CURSOR_MOVEMENT_SUCCESS 14945 else if (rc != CURSOR_MOVEMENT_SUCCESS
14936 && MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row) 14946 && MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row)
14947 /* Make sure this isn't a header line by any chance, since
14948 then MATRIX_ROW_PARTIALLY_VISIBLE_P might yield non-zero. */
14949 && !row->mode_line_p
14937 && make_cursor_line_fully_visible_p) 14950 && make_cursor_line_fully_visible_p)
14938 { 14951 {
14939 if (PT == MATRIX_ROW_END_CHARPOS (row) 14952 if (PT == MATRIX_ROW_END_CHARPOS (row)