(vc-cvs-after-dir-status, vc-cvs-parse-status): Detect
[bpt/emacs.git] / src / indent.c
index fb7ff5a..b444382 100644 (file)
@@ -1,6 +1,7 @@
 /* Indentation functions.
    Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1998, 2000, 2001,
-                 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+                 2002, 2003, 2004, 2005, 2006, 2007, 2008
+                 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -24,7 +25,7 @@ Boston, MA 02110-1301, USA.  */
 
 #include "lisp.h"
 #include "buffer.h"
-#include "charset.h"
+#include "character.h"
 #include "category.h"
 #include "indent.h"
 #include "keyboard.h"
@@ -39,7 +40,7 @@ Boston, MA 02110-1301, USA.  */
 /* Indentation can insert tabs if this is non-zero;
    otherwise always uses spaces.  */
 
-int indent_tabs_mode;
+static int indent_tabs_mode;
 
 #define CR 015
 
@@ -49,7 +50,7 @@ int indent_tabs_mode;
    Some things in set last_known_column_point to -1
    to mark the memorized value as invalid.  */
 
-double last_known_column;
+static double last_known_column;
 
 /* Value of point when current_column was called.  */
 
@@ -57,7 +58,7 @@ EMACS_INT last_known_column_point;
 
 /* Value of MODIFF when current_column was called.  */
 
-int last_known_column_modified;
+static int last_known_column_modified;
 
 static double current_column_1 P_ ((void));
 static double position_indentation P_ ((int));
@@ -291,7 +292,7 @@ check_composition (pos, pos_byte, point, len, len_byte, width)
      int *len, *len_byte, *width;
 {
   Lisp_Object prop;
-  int start, end;
+  EMACS_INT start, end;
   int id;
 
   if (! find_composition (pos, -1, &start, &end, &prop, Qnil)
@@ -327,7 +328,7 @@ check_composition (pos, pos_byte, point, len, len_byte, width)
        if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, c)))              \
          width = XVECTOR (DISP_CHAR_VECTOR (dp, c))->size;             \
        else                                                            \
-         width = WIDTH_BY_CHAR_HEAD (*p);                              \
+         width = CHAR_WIDTH (c);                                       \
        if (width > 1)                                                  \
          wide_column = width;                                          \
       }                                                                        \
@@ -446,9 +447,9 @@ current_column ()
                 next_element_from_display_vector does it.  */
              Lisp_Object entry = AREF (charvec, i);
 
-             if (INTEGERP (entry)
-                 && GLYPH_CHAR_VALID_P (XFASTINT (entry)))
-               c = FAST_GLYPH_CHAR (XFASTINT (entry));
+             if (GLYPH_CODE_P (entry)
+                 && GLYPH_CODE_CHAR_VALID_P (entry))
+               c = GLYPH_CODE_CHAR (entry);
              else
                c = ' ';
            }
@@ -582,12 +583,11 @@ current_column_1 ()
            {
              /* This should be handled the same as
                 next_element_from_display_vector does it.  */
-             Lisp_Object entry;
-             entry = AREF (charvec, i);
+             Lisp_Object entry = AREF (charvec, i);
 
-             if (INTEGERP (entry)
-                 && GLYPH_CHAR_VALID_P (XFASTINT (entry)))
-               c = FAST_GLYPH_CHAR (XFASTINT (entry));
+             if (GLYPH_CODE_P (entry)
+                 && GLYPH_CODE_CHAR_VALID_P (entry))
+               c = GLYPH_CODE_CHAR (entry);
              else
                c = ' ';
 
@@ -1020,13 +1020,11 @@ The return value is the current column.  */)
            {
              /* This should be handled the same as
                 next_element_from_display_vector does it.  */
+             Lisp_Object entry = AREF (charvec, i);
 
-             Lisp_Object entry;
-             entry = AREF (charvec, i);
-
-             if (INTEGERP (entry)
-                 && GLYPH_CHAR_VALID_P (XFASTINT (entry)))
-               c = FAST_GLYPH_CHAR (XFASTINT (entry));
+             if (GLYPH_CODE_P (entry)
+                 && GLYPH_CODE_CHAR_VALID_P (entry))
+               c = GLYPH_CODE_CHAR (entry);
              else
                c = ' ';
 
@@ -1192,7 +1190,7 @@ struct position val_compute_motion;
 struct position *
 compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, hscroll, tab_offset, win)
      EMACS_INT from, fromvpos, fromhpos, to, tovpos, tohpos;
-     EMACS_INT did_motion;
+     int did_motion;
      EMACS_INT width;
      EMACS_INT hscroll, tab_offset;
      struct window *win;
@@ -1626,9 +1624,9 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
                     next_element_from_display_vector does it.  */
                  Lisp_Object entry = AREF (charvec, i);
 
-                 if (INTEGERP (entry)
-                     && GLYPH_CHAR_VALID_P (XFASTINT (entry)))
-                   c = FAST_GLYPH_CHAR (XFASTINT (entry));
+                 if (GLYPH_CODE_P (entry)
+                     && GLYPH_CODE_CHAR_VALID_P (entry))
+                   c = GLYPH_CODE_CHAR (entry);
                  else
                    c = ' ';
                }
@@ -2159,8 +2157,7 @@ void
 syms_of_indent ()
 {
   DEFVAR_BOOL ("indent-tabs-mode", &indent_tabs_mode,
-              doc: /* *Indentation can insert tabs if this is non-nil.
-Setting this variable automatically makes it local to the current buffer.  */);
+              doc: /* *Indentation can insert tabs if this is non-nil.  */);
   indent_tabs_mode = 1;
 
   defsubr (&Scurrent_indentation);