]> code.delx.au - gnu-emacs/blobdiff - src/indent.c
Replace LUCID_LIBW, MOTIF_LIBW with TOOLKIT_LIBW.
[gnu-emacs] / src / indent.c
index ba4787aa1c544b0ba9ed0cc5aa8a975290bd16ad..a7f41f7e8e40f450697978fe335fc8040a717d2b 100644 (file)
@@ -1,6 +1,6 @@
 /* Indentation functions.
    Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1998, 2000, 2001,
-                 2002, 2003, 2004, 2005, 2006, 2007, 2008
+                 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
                  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -20,6 +20,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 #include <stdio.h>
+#include <setjmp.h>
 
 #include "lisp.h"
 #include "buffer.h"
@@ -252,7 +253,7 @@ skip_invisible (pos, next_boundary_p, to, window)
     {
       /* Don't scan terribly far.  */
       XSETFASTINT (proplimit, min (pos + 100, to));
-      /* No matter what. don't go past next overlay change.  */
+      /* No matter what, don't go past next overlay change.  */
       if (XFASTINT (overlay_limit) < XFASTINT (proplimit))
        proplimit = overlay_limit;
       tmp = Fnext_single_property_change (position, Qinvisible,
@@ -294,7 +295,7 @@ skip_invisible (pos, next_boundary_p, to, window)
     int c;                                                             \
                                                                        \
     wide_column = 0;                                                   \
-    c = STRING_CHAR_AND_LENGTH (p, MAX_MULTIBYTE_LENGTH, bytes);       \
+    c = STRING_CHAR_AND_LENGTH (p, bytes);                             \
     if (BYTES_BY_CHAR_HEAD (*p) != bytes)                              \
       width = bytes * 4;                                               \
     else                                                               \
@@ -2063,7 +2064,7 @@ whether or not it is currently displayed in some window.  */)
     }
   else
     {
-      int it_start, oselective, first_x, it_overshoot_expected;
+      int it_start, first_x, it_overshoot_expected;
 
       SET_TEXT_POS (pt, PT, PT_BYTE);
       start_display (&it, w, pt);
@@ -2093,11 +2094,12 @@ whether or not it is currently displayed in some window.  */)
         really at some x > 0.  */
       reseat_at_previous_visible_line_start (&it);
       it.current_x = it.hpos = 0;
-      /* Temporarily disable selective display so we don't move too far */
-      oselective = it.selective;
-      it.selective = 0;
-      move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS);
-      it.selective = oselective;
+      if (IT_CHARPOS (it) != PT)
+       /* We used to temporarily disable selective display here; the
+          comment said this is "so we don't move too far" (2005-01-19
+          checkin by kfs).  But this does nothing useful that I can
+          tell, and it causes Bug#2694 .  -- cyd */
+       move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS);
 
       if (XINT (lines) <= 0)
        {
@@ -2133,7 +2135,7 @@ whether or not it is currently displayed in some window.  */)
                 which might span multiple screen lines (e.g., if it's
                 on a multi-line display string).  We want to start
                 from the last line that it occupies.  */
-             if (PT < ZV)
+             if (it_start < ZV)
                {
                  while (IT_CHARPOS (it) <= it_start)
                    {