* dispextern.h (struct it.selective): Now EMACS_INT, not int.
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 17 Jun 2011 19:55:19 +0000 (12:55 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 17 Jun 2011 19:55:19 +0000 (12:55 -0700)
* 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
src/dispextern.h
src/xdisp.c

index d88aa49..70bdbee 100644 (file)
@@ -1,5 +1,11 @@
 2011-06-17  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * 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'.
index 0ededf3..774c880 100644 (file)
@@ -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.  */
index 2694bb4..c71acf8 100644 (file)
@@ -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;