aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2001-01-17 20:11:33 +0000
committerGerd Moellmann2001-01-17 20:11:33 +0000
commit3aec872292038ac527a651ae98d5c586f00c8a9a (patch)
tree4a6add1cce6cfa6e88da8feee3fb05bb1eb2ff8b /src
parent35e8600f86ea1803882ad8a7c3f86a411c7bfefa (diff)
downloademacs-3aec872292038ac527a651ae98d5c586f00c8a9a.tar.gz
emacs-3aec872292038ac527a651ae98d5c586f00c8a9a.zip
(forward_to_next_line_start): Avoid calling
get_next_display_element when the newline is already found. This may change the iterator's position, when its current position is equal to the iterator's stop_charpos.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/xdisp.c12
2 files changed, 10 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 40404210f87..52319b2c352 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
12001-01-17 Gerd Moellmann <gerd@gnu.org> 12001-01-17 Gerd Moellmann <gerd@gnu.org>
2 2
3 * xdisp.c (forward_to_next_line_start): Avoid calling
4 get_next_display_element when the newline is already found. This
5 may change the iterator's position, when its current position is
6 equal to the iterator's stop_charpos.
7
3 * dispnew.c (direct_output_for_insert): If char_ins_del_ok is 8 * dispnew.c (direct_output_for_insert): If char_ins_del_ok is
4 zero, use this method only at the end of a line. 9 zero, use this method only at the end of a line.
5 10
diff --git a/src/xdisp.c b/src/xdisp.c
index bdbef8a1143..00e325b3251 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -3507,20 +3507,18 @@ forward_to_next_line_start (it, skipped_p)
3507 3507
3508 /* Scan for a newline within MAX_NEWLINE_DISTANCE display elements 3508 /* Scan for a newline within MAX_NEWLINE_DISTANCE display elements
3509 from buffer text. */ 3509 from buffer text. */
3510 n = newline_found_p = 0; 3510 for (n = newline_found_p = 0;
3511 while (n < MAX_NEWLINE_DISTANCE 3511 !newline_found_p && n < MAX_NEWLINE_DISTANCE;
3512 && get_next_display_element (it) 3512 n += STRINGP (it->string) ? 0 : 1)
3513 && !newline_found_p)
3514 { 3513 {
3514 get_next_display_element (it);
3515 newline_found_p = it->what == IT_CHARACTER && it->c == '\n'; 3515 newline_found_p = it->what == IT_CHARACTER && it->c == '\n';
3516 set_iterator_to_next (it, 0); 3516 set_iterator_to_next (it, 0);
3517 if (!STRINGP (it->string))
3518 ++n;
3519 } 3517 }
3520 3518
3521 /* If we didn't find a newline near enough, see if we can use a 3519 /* If we didn't find a newline near enough, see if we can use a
3522 short-cut. */ 3520 short-cut. */
3523 if (!newline_found_p && n == MAX_NEWLINE_DISTANCE) 3521 if (n == MAX_NEWLINE_DISTANCE)
3524 { 3522 {
3525 int start = IT_CHARPOS (*it); 3523 int start = IT_CHARPOS (*it);
3526 int limit = find_next_newline_no_quit (start, 1); 3524 int limit = find_next_newline_no_quit (start, 1);