]> code.delx.au - gnu-emacs/blobdiff - src/indent.c
(BITS_PER_CHAR, BITS_PER_INT, BITS_PER_SHORT)
[gnu-emacs] / src / indent.c
index 7f0540c5ba8887774c60f26d4fa3f0d94398ce39..ca154c91a2f84bcdead78e206fdd8dd1f7ab6887 100644 (file)
@@ -5,7 +5,7 @@ This file is part of GNU Emacs.
 
 GNU Emacs is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
+the Free Software Foundation; either version 2, or (at your option)
 any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
@@ -51,17 +51,16 @@ int last_known_column_modified;
 
 /* Get the display table to use for the current buffer.  */
 
-struct Lisp_Vector *
+struct Lisp_Char_Table *
 buffer_display_table ()
 {
   Lisp_Object thisbuf;
 
   thisbuf = current_buffer->display_table;
-  if (VECTORP (thisbuf) && XVECTOR (thisbuf)->size == DISP_TABLE_SIZE)
-    return XVECTOR (thisbuf);
-  if (VECTORP (Vstandard_display_table)
-      && XVECTOR (Vstandard_display_table)->size == DISP_TABLE_SIZE)
-    return XVECTOR (Vstandard_display_table);
+  if (DISP_TABLE_P (thisbuf))
+    return XCHAR_TABLE (thisbuf);
+  if (DISP_TABLE_P (Vstandard_display_table))
+    return XCHAR_TABLE (Vstandard_display_table);
   return 0;
 }
 \f
@@ -72,7 +71,7 @@ buffer_display_table ()
 static int
 character_width (c, dp)
      int c;
-     struct Lisp_Vector *dp;
+     struct Lisp_Char_Table *dp;
 {
   Lisp_Object elt;
 
@@ -106,7 +105,7 @@ character_width (c, dp)
    invalidate the buffer's width_run_cache.  */
 int
 disptab_matches_widthtab (disptab, widthtab)
-     struct Lisp_Vector *disptab;
+     struct Lisp_Char_Table *disptab;
      struct Lisp_Vector *widthtab;
 {
   int i;
@@ -126,7 +125,7 @@ disptab_matches_widthtab (disptab, widthtab)
 void
 recompute_width_table (buf, disptab)
      struct buffer *buf;
-     struct Lisp_Vector *disptab;
+     struct Lisp_Char_Table *disptab;
 {
   int i;
   struct Lisp_Vector *widthtab;
@@ -202,7 +201,7 @@ current_column ()
   register int c;
   register int tab_width = XINT (current_buffer->tab_width);
   int ctl_arrow = !NILP (current_buffer->ctl_arrow);
-  register struct Lisp_Vector *dp = buffer_display_table ();
+  register struct Lisp_Char_Table *dp = buffer_display_table ();
   int stopchar;
 
   if (point == last_known_column_point
@@ -289,7 +288,7 @@ string_display_width (string, beg, end)
   register int c;
   register int tab_width = XINT (current_buffer->tab_width);
   int ctl_arrow = !NILP (current_buffer->ctl_arrow);
-  register struct Lisp_Vector *dp = buffer_display_table ();
+  register struct Lisp_Char_Table *dp = buffer_display_table ();
   int b, e;
 
   if (NILP (end))
@@ -463,7 +462,7 @@ indented_beyond_p (pos, column)
 }
 
 \f
-DEFUN ("move-to-column", Fmove_to_column, Smove_to_column, 1, 2, 0,
+DEFUN ("move-to-column", Fmove_to_column, Smove_to_column, 1, 2, "p",
   "Move point to column COLUMN in the current line.\n\
 The column of a character is calculated by adding together the widths\n\
 as displayed of the previous characters in the line.\n\
@@ -485,7 +484,7 @@ and if COLUMN is in the middle of a tab character, change it to spaces.")
   register int end;
   register int tab_width = XINT (current_buffer->tab_width);
   register int ctl_arrow = !NILP (current_buffer->ctl_arrow);
-  register struct Lisp_Vector *dp = buffer_display_table ();
+  register struct Lisp_Char_Table *dp = buffer_display_table ();
 
   Lisp_Object val;
   int prev_col;
@@ -649,7 +648,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
   register int c;
   register int tab_width = XFASTINT (current_buffer->tab_width);
   register int ctl_arrow = !NILP (current_buffer->ctl_arrow);
-  register struct Lisp_Vector *dp = window_display_table (win);
+  register struct Lisp_Char_Table *dp = window_display_table (win);
   int selective
     = (INTEGERP (current_buffer->selective_display)
        ? XINT (current_buffer->selective_display)
@@ -1140,7 +1139,7 @@ vmotion (from, vtarget, w)
                                 lmargin + (XFASTINT (prevline) == BEG
                                            ? start_hpos : 0),
                                 0,
-                                from, 1 << (INTBITS - 2), 0,
+                                from, 1 << (BITS_PER_INT - 2), 0,
                                 width, hscroll, 0, w);
          vpos -= pos.vpos;
          first = 0;
@@ -1186,7 +1185,7 @@ vmotion (from, vtarget, w)
                             lmargin + (XFASTINT (prevline) == BEG
                                        ? start_hpos : 0),
                             0,
-                            from, 1 << (INTBITS - 2), 0,
+                            from, 1 << (BITS_PER_INT - 2), 0,
                             width, hscroll, 0, w);
       did_motion = 1;
     }
@@ -1197,7 +1196,7 @@ vmotion (from, vtarget, w)
       did_motion = 0;
     }
   return compute_motion (from, vpos, pos.hpos, did_motion,
-                        ZV, vtarget, - (1 << (INTBITS - 2)),
+                        ZV, vtarget, - (1 << (BITS_PER_INT - 2)),
                         width, hscroll, pos.vpos * width, w);
 }