]> code.delx.au - gnu-emacs/blobdiff - src/indent.c
Qcall_interactively and Qexecute_kbd_macro are now static.
[gnu-emacs] / src / indent.c
index 4a30c00dd275ad886cb637bdc5884d7a09046077..9bf75bc6d958c01650b949ae37fbbaf5ebad4ab0 100644 (file)
@@ -138,7 +138,7 @@ recompute_width_table (struct buffer *buf, struct Lisp_Char_Table *disptab)
   struct Lisp_Vector *widthtab;
 
   if (!VECTORP (BVAR (buf, width_table)))
-    bset_width_table (buf, Fmake_vector (make_number (256), make_number (0)));
+    bset_width_table (buf, make_uninit_vector (256));
   widthtab = XVECTOR (BVAR (buf, width_table));
   eassert (widthtab->header.size == 256);
 
@@ -291,7 +291,7 @@ DEFUN ("current-column", Fcurrent_column, Scurrent_column, 0, 0, 0,
        doc: /* Return the horizontal position of point.  Beginning of line is column 0.
 This is calculated by adding together the widths of all the displayed
 representations of the character between the start of the previous line
-and point (eg. control characters will have a width of 2 or 4, tabs
+and point (e.g., control characters will have a width of 2 or 4, tabs
 will have a variable width).
 Ignores finite width of frame, which means that this function may return
 values greater than (frame-width).
@@ -1328,8 +1328,7 @@ compute_motion (ptrdiff_t from, EMACS_INT fromvpos, EMACS_INT fromhpos,
                  TO (we need to go back below).  */
              if (pos <= to)
                {
-                 pos = find_before_next_newline (pos, to, 1);
-                 pos_byte = CHAR_TO_BYTE (pos);
+                 pos = find_before_next_newline (pos, to, 1, &pos_byte);
                  hpos = width;
                  /* If we just skipped next_boundary,
                     loop around in the main while
@@ -1583,10 +1582,9 @@ compute_motion (ptrdiff_t from, EMACS_INT fromvpos, EMACS_INT fromhpos,
                          /* Skip any number of invisible lines all at once */
                          do
                            {
-                             pos = find_before_next_newline (pos, to, 1);
+                             pos = find_before_next_newline (pos, to, 1, &pos_byte);
                              if (pos < to)
-                               pos++;
-                             pos_byte = CHAR_TO_BYTE (pos);
+                               INC_BOTH (pos, pos_byte);
                            }
                          while (pos < to
                                 && indented_beyond_p (pos, pos_byte,
@@ -1622,10 +1620,7 @@ compute_motion (ptrdiff_t from, EMACS_INT fromvpos, EMACS_INT fromhpos,
                     everything from a ^M to the end of the line is invisible.
                     Stop *before* the real newline.  */
                  if (pos < to)
-                   {
-                     pos = find_before_next_newline (pos, to, 1);
-                     pos_byte = CHAR_TO_BYTE (pos);
-                   }
+                   pos = find_before_next_newline (pos, to, 1, &pos_byte);
                  /* If we just skipped next_boundary,
                     loop around in the main while
                     and handle it.  */
@@ -1845,21 +1840,20 @@ vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w)
 
       while ((vpos > vtarget || first) && from > BEGV)
        {
+         ptrdiff_t bytepos;
          Lisp_Object propval;
 
-         prevline = find_next_newline_no_quit (from - 1, -1);
+         prevline = find_next_newline_no_quit (from - 1, -1, &bytepos);
          while (prevline > BEGV
                 && ((selective > 0
-                     && indented_beyond_p (prevline,
-                                           CHAR_TO_BYTE (prevline),
-                                           selective))
+                     && indented_beyond_p (prevline, bytepos, selective))
                     /* Watch out for newlines with `invisible' property.
                        When moving upward, check the newline before.  */
                     || (propval = Fget_char_property (make_number (prevline - 1),
                                                       Qinvisible,
                                                       text_prop_object),
                         TEXT_PROP_MEANS_INVISIBLE (propval))))
-           prevline = find_next_newline_no_quit (prevline - 1, -1);
+           prevline = find_next_newline_no_quit (prevline - 1, -1, &bytepos);
          pos = *compute_motion (prevline, 0,
                                 lmargin,
                                 0,
@@ -1897,21 +1891,20 @@ vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w)
   from_byte = CHAR_TO_BYTE (from);
   if (from > BEGV && FETCH_BYTE (from_byte - 1) != '\n')
     {
+      ptrdiff_t bytepos;
       Lisp_Object propval;
 
-      prevline = find_next_newline_no_quit (from, -1);
+      prevline = find_next_newline_no_quit (from, -1, &bytepos);
       while (prevline > BEGV
             && ((selective > 0
-                 && indented_beyond_p (prevline,
-                                       CHAR_TO_BYTE (prevline),
-                                       selective))
+                 && indented_beyond_p (prevline, bytepos, selective))
                 /* Watch out for newlines with `invisible' property.
                    When moving downward, check the newline after.  */
                 || (propval = Fget_char_property (make_number (prevline),
                                                   Qinvisible,
                                                   text_prop_object),
                     TEXT_PROP_MEANS_INVISIBLE (propval))))
-       prevline = find_next_newline_no_quit (prevline - 1, -1);
+       prevline = find_next_newline_no_quit (prevline - 1, -1, &bytepos);
       pos = *compute_motion (prevline, 0,
                             lmargin,
                             0,
@@ -1970,7 +1963,7 @@ whether or not it is currently displayed in some window.  */)
   struct window *w;
   Lisp_Object old_buffer;
   EMACS_INT old_charpos IF_LINT (= 0), old_bytepos IF_LINT (= 0);
-  struct gcpro gcpro1, gcpro2, gcpro3;
+  struct gcpro gcpro1;
   Lisp_Object lcols = Qnil;
   double cols IF_LINT (= 0);
   void *itdata = NULL;
@@ -1987,7 +1980,7 @@ whether or not it is currently displayed in some window.  */)
   w = decode_live_window (window);
 
   old_buffer = Qnil;
-  GCPRO3 (old_buffer, old_charpos, old_bytepos);
+  GCPRO1 (old_buffer);
   if (XBUFFER (w->buffer) != current_buffer)
     {
       /* Set the window's buffer temporarily to the current buffer.  */