From 87830974757826249b19187e645d4965ea084273 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 17 Jun 2011 12:55:19 -0700 Subject: [PATCH] * dispextern.h (struct it.selective): Now EMACS_INT, not int. * xdisp.c (forward_to_next_line_start) (back_to_previous_visible_line_start) (reseat_at_next_visible_line_start, next_element_from_buffer): Don't arbitrarily truncate the value of 'selective' to int. --- src/ChangeLog | 6 ++++++ src/dispextern.h | 2 +- src/xdisp.c | 9 +++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index d88aa4929ca..70bdbeea3b2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ 2011-06-17 Paul Eggert + * dispextern.h (struct it.selective): Now EMACS_INT, not int. + * xdisp.c (forward_to_next_line_start) + (back_to_previous_visible_line_start) + (reseat_at_next_visible_line_start, next_element_from_buffer): + Don't arbitrarily truncate the value of 'selective' to int. + * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0. * composite.c: Don't truncate sizes to 'int'. diff --git a/src/dispextern.h b/src/dispextern.h index 0ededf33ac6..774c880fee8 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -2259,7 +2259,7 @@ struct it /* -1 means selective display hides everything between a \r and the next newline; > 0 means hide lines indented more than that value. */ - int selective; + EMACS_INT selective; /* An enumeration describing what the next display element is after a call to get_next_display_element. */ diff --git a/src/xdisp.c b/src/xdisp.c index 2694bb4848d..c71acf88719 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -5179,7 +5179,8 @@ back_to_previous_line_start (struct it *it) static int forward_to_next_line_start (struct it *it, int *skipped_p) { - int old_selective, newline_found_p, n; + EMACS_INT old_selective; + int newline_found_p, n; const int MAX_NEWLINE_DISTANCE = 500; /* If already on a newline, just consume it to avoid unintended @@ -5271,7 +5272,7 @@ back_to_previous_visible_line_start (struct it *it) invisible. */ if (it->selective > 0 && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it), - (double) it->selective)) /* iftc */ + it->selective)) continue; /* Check the newline before point for invisibility. */ @@ -5365,7 +5366,7 @@ reseat_at_next_visible_line_start (struct it *it, int on_newline_p) if (it->selective > 0) while (IT_CHARPOS (*it) < ZV && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it), - (double) it->selective)) /* iftc */ + it->selective)) { xassert (IT_BYTEPOS (*it) == BEGV || FETCH_BYTE (IT_BYTEPOS (*it) - 1) == '\n'); @@ -6813,7 +6814,7 @@ next_element_from_buffer (struct it *it) && IT_CHARPOS (*it) + 1 < ZV && indented_beyond_p (IT_CHARPOS (*it) + 1, IT_BYTEPOS (*it) + 1, - (double) it->selective)) /* iftc */ + it->selective)) { success_p = next_element_from_ellipsis (it); it->dpvec_char_len = -1; -- 2.39.2