Make Emacs functions such as Fatom 'static' by default.
[bpt/emacs.git] / src / window.c
index b158073..72ab2a3 100644 (file)
@@ -216,7 +216,7 @@ make_window (void)
   return val;
 }
 
-DEFUN ("selected-window", Fselected_window, Sselected_window, 0, 0, 0,
+DEFUE ("selected-window", Fselected_window, Sselected_window, 0, 0, 0,
        doc: /* Return the window that the cursor now appears in and commands apply to.  */)
   (void)
 {
@@ -235,7 +235,8 @@ used by that frame.  */)
   return FRAME_MINIBUF_WINDOW (XFRAME (frame));
 }
 
-DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, Swindow_minibuffer_p, 0, 1, 0,
+DEFUE ("window-minibuffer-p", Fwindow_minibuffer_p,
+       Swindow_minibuffer_p, 0, 1, 0,
        doc: /* Return non-nil if WINDOW is a minibuffer window.
 WINDOW defaults to the selected window.  */)
   (Lisp_Object window)
@@ -245,7 +246,7 @@ WINDOW defaults to the selected window.  */)
 }
 
 
-DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p,
+DEFUE ("pos-visible-in-window-p", Fpos_visible_in_window_p,
        Spos_visible_in_window_p, 0, 3, 0,
        doc: /* Return non-nil if position POS is currently on the frame in WINDOW.
 Return nil if that position is scrolled vertically out of view.
@@ -442,7 +443,7 @@ decode_any_window (register Lisp_Object window)
   return XWINDOW (window);
 }
 
-DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0,
+DEFUE ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0,
        doc: /* Return the buffer that WINDOW is displaying.
 WINDOW defaults to the selected window.  */)
   (Lisp_Object window)
@@ -1196,7 +1197,7 @@ if it isn't already recorded.  */)
   return value;
 }
 
-DEFUN ("set-window-point", Fset_window_point, Sset_window_point, 2, 2, 0,
+DEFUE ("set-window-point", Fset_window_point, Sset_window_point, 2, 2, 0,
        doc: /* Make point value in WINDOW be at position POS in WINDOW's buffer.
 Return POS.  */)
   (Lisp_Object window, Lisp_Object pos)
@@ -1243,7 +1244,7 @@ overriding motion of point in order to display at this exact start.  */)
 }
 
 
-DEFUN ("window-dedicated-p", Fwindow_dedicated_p, Swindow_dedicated_p,
+DEFUE ("window-dedicated-p", Fwindow_dedicated_p, Swindow_dedicated_p,
        0, 1, 0,
        doc: /* Return non-nil when WINDOW is dedicated to its buffer.
 More precisely, return the value assigned by the last call of
@@ -1359,8 +1360,8 @@ window_display_table (struct window *w)
     {
       struct buffer *b = XBUFFER (w->buffer);
 
-      if (DISP_TABLE_P (b->display_table))
-       dp = XCHAR_TABLE (b->display_table);
+      if (DISP_TABLE_P (BVAR (b, display_table)))
+       dp = XCHAR_TABLE (BVAR (b, display_table));
       else if (DISP_TABLE_P (Vstandard_display_table))
        dp = XCHAR_TABLE (Vstandard_display_table);
     }
@@ -1414,9 +1415,9 @@ unshow_buffer (register struct window *w)
      So don't clobber point in that buffer.  */
   if (! EQ (buf, XWINDOW (selected_window)->buffer)
       /* This line helps to fix Horsley's testbug.el bug.  */
-      && !(WINDOWP (b->last_selected_window)
-          && w != XWINDOW (b->last_selected_window)
-          && EQ (buf, XWINDOW (b->last_selected_window)->buffer)))
+      && !(WINDOWP (BVAR (b, last_selected_window))
+          && w != XWINDOW (BVAR (b, last_selected_window))
+          && EQ (buf, XWINDOW (BVAR (b, last_selected_window))->buffer)))
     temp_set_point_both (b,
                         clip_to_bounds (BUF_BEGV (b),
                                         XMARKER (w->pointm)->charpos,
@@ -1425,9 +1426,9 @@ unshow_buffer (register struct window *w)
                                         marker_byte_position (w->pointm),
                                         BUF_ZV_BYTE (b)));
 
-  if (WINDOWP (b->last_selected_window)
-      && w == XWINDOW (b->last_selected_window))
-    b->last_selected_window = Qnil;
+  if (WINDOWP (BVAR (b, last_selected_window))
+      && w == XWINDOW (BVAR (b, last_selected_window)))
+    BVAR (b, last_selected_window) = Qnil;
 }
 
 /* Put replacement into the window structure in place of old. */
@@ -1484,7 +1485,7 @@ and so is its new parent, we should make replacement's
 children be children of that parent instead.  ***/
 }
 
-DEFUN ("delete-window", Fdelete_window, Sdelete_window, 0, 1, "",
+DEFUE ("delete-window", Fdelete_window, Sdelete_window, 0, 1, "",
        doc: /* Remove WINDOW from its frame.
 WINDOW defaults to the selected window.  Return nil.
 Signal an error when WINDOW is the only window on its frame.  */)
@@ -1769,8 +1770,10 @@ window_list (void)
 
    ALL_FRAMES  t means search all frames,
                nil means search just current frame,
-               `visible' means search just visible frames,
-               0 means search visible and iconified frames,
+               `visible' means search just visible frames on the
+                current terminal,
+               0 means search visible and iconified frames on the
+                current terminal,
                a window means search the frame that window belongs to,
                a frame means consider windows on that frame, only.  */
 
@@ -1836,8 +1839,8 @@ candidate_window_p (Lisp_Object window, Lisp_Object owindow, Lisp_Object minibuf
 
 
 /* Decode arguments as allowed by Fnext_window, Fprevious_window, and
-   Fwindow_list.  See there for the meaning of WINDOW, MINIBUF, and
-   ALL_FRAMES.  */
+   Fwindow_list.  See candidate_window_p for the meaning of WINDOW,
+   MINIBUF, and ALL_FRAMES.  */
 
 static void
 decode_next_window_args (Lisp_Object *window, Lisp_Object *minibuf, Lisp_Object *all_frames)
@@ -1871,12 +1874,6 @@ decode_next_window_args (Lisp_Object *window, Lisp_Object *minibuf, Lisp_Object
     ;
   else if (!EQ (*all_frames, Qt))
     *all_frames = Qnil;
-
-  /* Now *ALL_FRAMES is t meaning search all frames, nil meaning
-     search just current frame, `visible' meaning search just visible
-     frames, 0 meaning search visible and iconified frames, or a
-     window, meaning search the frame that window belongs to, or a
-     frame, meaning consider windows on that frame, only.  */
 }
 
 
@@ -1949,7 +1946,7 @@ next_window (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames, in
 }
 
 
-DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0,
+DEFUE ("next-window", Fnext_window, Snext_window, 0, 3, 0,
        doc: /* Return window following WINDOW in cyclic ordering of windows.
 WINDOW defaults to the selected window. The optional arguments
 MINIBUF and ALL-FRAMES specify the set of windows to consider.
@@ -1974,9 +1971,9 @@ ALL-FRAMES nil or omitted means consider all windows on WINDOW's
  windows on all frames that share that minibuffer too.
 ALL-FRAMES t means consider all windows on all existing frames.
 ALL-FRAMES `visible' means consider all windows on all visible
- frames.
+ frames on the current terminal.
 ALL-FRAMES 0 means consider all windows on all visible and
- iconified frames.
+ iconified frames on the current terminal.
 ALL-FRAMES a frame means consider all windows on that frame only.
 Anything else means consider all windows on WINDOW's frame and no
  others.
@@ -2213,13 +2210,13 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
          case DELETE_BUFFER_WINDOWS:
            if (EQ (w->buffer, obj))
              {
-               struct frame *f = XFRAME (WINDOW_FRAME (w));
+               struct frame *fr = XFRAME (WINDOW_FRAME (w));
 
                /* If this window is dedicated, and in a frame of its own,
                   kill the frame.  */
-               if (EQ (window, FRAME_ROOT_WINDOW (f))
+               if (EQ (window, FRAME_ROOT_WINDOW (fr))
                    && !NILP (w->dedicated)
-                   && other_visible_frames (f))
+                   && other_visible_frames (fr))
                  {
                    /* Skip the other windows on this frame.
                       There might be one, the minibuffer!  */
@@ -2271,16 +2268,16 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
            if (EQ (w->buffer, obj))
              {
                Lisp_Object buffer;
-               struct frame *f = XFRAME (w->frame);
+               struct frame *fr = XFRAME (w->frame);
 
                /* Find another buffer to show in this window.  */
                buffer = Fother_buffer (obj, Qnil, w->frame);
 
                /* If this window is dedicated, and in a frame of its own,
                   kill the frame.  */
-               if (EQ (window, FRAME_ROOT_WINDOW (f))
+               if (EQ (window, FRAME_ROOT_WINDOW (fr))
                    && !NILP (w->dedicated)
-                   && other_visible_frames (f))
+                   && other_visible_frames (fr))
                  {
                    /* Skip the other windows on this frame.
                       There might be one, the minibuffer!  */
@@ -2294,11 +2291,11 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
                  }
                else if (!NILP (w->dedicated) && !NILP (w->parent))
                  {
-                   Lisp_Object window;
-                   XSETWINDOW (window, w);
+                   Lisp_Object window_to_delete;
+                   XSETWINDOW (window_to_delete, w);
                    /* If this window is dedicated and not the only window
                       in its frame, then kill it.  */
-                   Fdelete_window (window);
+                   Fdelete_window (window_to_delete);
                  }
                else
                  {
@@ -2325,7 +2322,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
            /* Check for a window that has a killed buffer.  */
          case CHECK_ALL_WINDOWS:
            if (! NILP (w->buffer)
-               && NILP (XBUFFER (w->buffer)->name))
+               && NILP (BVAR (XBUFFER (w->buffer), name)))
              abort ();
            break;
 
@@ -2400,7 +2397,7 @@ If FRAME is a frame, search only that frame.  */)
                      frame);
 }
 
-DEFUN ("get-buffer-window", Fget_buffer_window, Sget_buffer_window, 0, 2, 0,
+DEFUE ("get-buffer-window", Fget_buffer_window, Sget_buffer_window, 0, 2, 0,
        doc: /* Return a window currently displaying BUFFER-OR-NAME, or nil if none.
 BUFFER-OR-NAME may be a buffer or a buffer name and defaults to the
 current buffer.
@@ -2729,7 +2726,7 @@ window_min_size_2 (struct window *w, int width_p, int safe_p)
     {
       int safe_size = (MIN_SAFE_WINDOW_HEIGHT
                       + ((BUFFERP (w->buffer)
-                          && !NILP (XBUFFER (w->buffer)->mode_line_format))
+                          && !NILP (BVAR (XBUFFER (w->buffer), mode_line_format)))
                          ? 1 : 0));
 
       return safe_p ? safe_size : max (window_min_height, safe_size);
@@ -2982,14 +2979,10 @@ shrink_windows (int total, int size, int nchildren, int shrinkable,
   while (total_shrink > total_removed)
     {
       int nonzero_sizes = 0;
-      int nonzero_idx = -1;
 
       for (i = 0; i < nchildren; ++i)
         if (new_sizes[i] > 0)
-          {
-            ++nonzero_sizes;
-            nonzero_idx = i;
-          }
+         ++nonzero_sizes;
 
       for (i = 0; i < nchildren; ++i)
         if (new_sizes[i] > min_sizes[i])
@@ -3128,7 +3121,7 @@ size_window (Lisp_Object window, int size, int width_p, int nodelete_p, int firs
     }
   else if (!NILP (*forward))
     {
-      int fixed_size, each, extra, n;
+      int fixed_size, each IF_LINT (= 0), extra IF_LINT (= 0), n;
       int resize_fixed_p, nfixed;
       int last_pos, first_pos, nchildren, total;
       int *new_sizes = NULL;
@@ -3174,11 +3167,11 @@ size_window (Lisp_Object window, int size, int width_p, int nodelete_p, int firs
       last_pos = first_pos;
       for (n = 0, child = *forward; !NILP (child); child = c->next, ++n)
        {
-         int new_size, old_size;
+         int new_child_size, old_child_size;
 
          c = XWINDOW (child);
-         old_size = WINDOW_TOTAL_SIZE (c, width_p);
-         new_size = old_size;
+         old_child_size = WINDOW_TOTAL_SIZE (c, width_p);
+         new_child_size = old_child_size;
 
          /* The top or left edge position of this child equals the
             bottom or right edge of its predecessor.  */
@@ -3190,18 +3183,20 @@ size_window (Lisp_Object window, int size, int width_p, int nodelete_p, int firs
          /* If this child can be resized, do it.  */
          if (resize_fixed_p || !window_fixed_size_p (c, width_p, 0))
            {
-             new_size = new_sizes ? new_sizes[n] : old_size + each + extra;
+             new_child_size =
+               new_sizes ? new_sizes[n] : old_child_size + each + extra;
              extra = 0;
            }
 
          /* Set new size.  Note that size_window also propagates
             edge positions to children, so it's not a no-op if we
             didn't change the child's size.  */
-         size_window (child, new_size, width_p, 1, first_only, last_only);
+         size_window (child, new_child_size, width_p, 1,
+                      first_only, last_only);
 
          /* Remember the bottom/right edge position of this child; it
             will be used to set the top/left edge of the next child.  */
-          last_pos += new_size;
+          last_pos += new_child_size;
        }
 
       xfree (new_sizes);
@@ -3281,8 +3276,10 @@ change_window_heights (Lisp_Object window, int n)
 \f
 int window_select_count;
 
-EXFUN (Fset_window_fringes, 4);
-EXFUN (Fset_window_scroll_bars, 4);
+INFUN (Fset_window_margins, 3);
+INFUN (Fset_window_fringes, 4);
+INFUN (Fset_window_scroll_bars, 4);
+INFUN (Fset_window_vscroll, 3);
 
 static void
 run_funs (Lisp_Object funs)
@@ -3329,12 +3326,12 @@ run_window_configuration_change_hook (struct frame *f)
        if (!NILP (Flocal_variable_p (Qwindow_configuration_change_hook,
                                      buffer)))
          {
-           int count = SPECPDL_INDEX ();
+           int count1 = SPECPDL_INDEX ();
            record_unwind_protect (select_window_norecord, Fselected_window ());
            select_window_norecord (window);
            run_funs (Fbuffer_local_value (Qwindow_configuration_change_hook,
                                           buffer));
-           unbind_to (count, Qnil);
+           unbind_to (count1, Qnil);
          }
       }
   }
@@ -3360,15 +3357,15 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
   w->buffer = buffer;
 
   if (EQ (window, selected_window))
-    b->last_selected_window = window;
+    BVAR (b, last_selected_window) = window;
 
   /* Let redisplay errors through.  */
   b->display_error_modiff = 0;
 
   /* Update time stamps of buffer display.  */
-  if (INTEGERP (b->display_count))
-    XSETINT (b->display_count, XINT (b->display_count) + 1);
-  b->display_time = Fcurrent_time ();
+  if (INTEGERP (BVAR (b, display_count)))
+    XSETINT (BVAR (b, display_count), XINT (BVAR (b, display_count)) + 1);
+  BVAR (b, display_time) = Fcurrent_time ();
 
   XSETFASTINT (w->window_end_pos, 0);
   XSETFASTINT (w->window_end_vpos, 0);
@@ -3421,18 +3418,18 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
       w->left_margin_cols = w->right_margin_cols = Qnil;
 
       Fset_window_fringes (window,
-                          b->left_fringe_width, b->right_fringe_width,
-                          b->fringes_outside_margins);
+                          BVAR (b, left_fringe_width), BVAR (b, right_fringe_width),
+                          BVAR (b, fringes_outside_margins));
 
       Fset_window_scroll_bars (window,
-                              b->scroll_bar_width,
-                              b->vertical_scroll_bar_type, Qnil);
+                              BVAR (b, scroll_bar_width),
+                              BVAR (b, vertical_scroll_bar_type), Qnil);
 
       w->left_margin_cols = save_left;
       w->right_margin_cols = save_right;
 
       Fset_window_margins (window,
-                          b->left_margin_cols, b->right_margin_cols);
+                          BVAR (b, left_margin_cols), BVAR (b, right_margin_cols));
     }
 
   if (run_hooks_p)
@@ -3447,7 +3444,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
 }
 
 
-DEFUN ("set-window-buffer", Fset_window_buffer, Sset_window_buffer, 2, 3, 0,
+DEFUE ("set-window-buffer", Fset_window_buffer, Sset_window_buffer, 2, 3, 0,
        doc: /* Make WINDOW display BUFFER-OR-NAME as its contents.
 WINDOW defaults to the selected window.  BUFFER-OR-NAME must be a buffer
 or the name of an existing buffer.  Optional third argument KEEP-MARGINS
@@ -3469,7 +3466,7 @@ This function runs `window-scroll-functions' before running
   XSETWINDOW (window, w);
   buffer = Fget_buffer (buffer_or_name);
   CHECK_BUFFER (buffer);
-  if (NILP (XBUFFER (buffer)->name))
+  if (NILP (BVAR (XBUFFER (buffer), name)))
     error ("Attempt to display deleted buffer");
 
   tem = w->buffer;
@@ -3481,7 +3478,7 @@ This function runs `window-scroll-functions' before running
       if (EQ (tem, buffer))
        return Qnil;
       else if (EQ (w->dedicated, Qt))
-       error ("Window is dedicated to `%s'", SDATA (XBUFFER (tem)->name));
+       error ("Window is dedicated to `%s'", SDATA (BVAR (XBUFFER (tem), name)));
       else
        w->dedicated = Qnil;
 
@@ -3552,7 +3549,7 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
 
   Fset_buffer (w->buffer);
 
-  XBUFFER (w->buffer)->last_selected_window = window;
+  BVAR (XBUFFER (w->buffer), last_selected_window) = window;
 
   /* Go to the point recorded in the window.
      This is important when the buffer is in more
@@ -3577,7 +3574,7 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap)
 /* Note that selected_window can be nil when this is called from
    Fset_window_configuration.  */
 
-DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0,
+DEFUE ("select-window", Fselect_window, Sselect_window, 1, 2, 0,
        doc: /* Select WINDOW.  Most editing will apply to WINDOW's buffer.
 If WINDOW is not already selected, make WINDOW's buffer current
 and make WINDOW the frame's selected window.  Return WINDOW.
@@ -3606,7 +3603,7 @@ select_frame_norecord (Lisp_Object frame)
     ? Fselect_frame (frame, Qt) : selected_frame;
 }
 \f
-Lisp_Object
+static Lisp_Object
 display_buffer (Lisp_Object buffer, Lisp_Object not_this_window_p, Lisp_Object override_frame)
 {
   return call3 (Qdisplay_buffer, buffer, not_this_window_p, override_frame);
@@ -3640,7 +3637,7 @@ displaying that buffer.  */)
 
   if (STRINGP (object))
     object = Fget_buffer (object);
-  if (BUFFERP (object) && !NILP (XBUFFER (object)->name))
+  if (BUFFERP (object) && !NILP (BVAR (XBUFFER (object), name)))
     {
       /* Walk all windows looking for buffer, and force update
         of each of those windows.  */
@@ -3663,16 +3660,13 @@ temp_output_buffer_show (register Lisp_Object buf)
   register Lisp_Object window;
   register struct window *w;
 
-  XBUFFER (buf)->directory = current_buffer->directory;
+  BVAR (XBUFFER (buf), directory) = BVAR (current_buffer, directory);
 
   Fset_buffer (buf);
   BUF_SAVE_MODIFF (XBUFFER (buf)) = MODIFF;
   BEGV = BEG;
   ZV = Z;
   SET_PT (BEG);
-#if 0  /* rms: there should be no reason for this.  */
-  XBUFFER (buf)->prevent_redisplay_optimizations_p = 1;
-#endif
   set_buffer_internal (old);
 
   if (!NILP (Vtemp_buffer_show_function))
@@ -3692,29 +3686,35 @@ temp_output_buffer_show (register Lisp_Object buf)
 
       /* Run temp-buffer-show-hook, with the chosen window selected
         and its buffer current.  */
-
-      if (!NILP (Vrun_hooks)
-         && !NILP (Fboundp (Qtemp_buffer_show_hook))
-         && !NILP (Fsymbol_value (Qtemp_buffer_show_hook)))
-       {
-         int count = SPECPDL_INDEX ();
-         Lisp_Object prev_window, prev_buffer;
-         prev_window = selected_window;
-         XSETBUFFER (prev_buffer, old);
-
-         /* Select the window that was chosen, for running the hook.
-            Note: Both Fselect_window and select_window_norecord may
-            set-buffer to the buffer displayed in the window,
-            so we need to save the current buffer.  --stef  */
-         record_unwind_protect (Fset_buffer, prev_buffer);
-         record_unwind_protect (select_window_norecord, prev_window);
-         Fselect_window (window, Qt);
-         Fset_buffer (w->buffer);
-         call1 (Vrun_hooks, Qtemp_buffer_show_hook);
-         unbind_to (count, Qnil);
-       }
+      {
+        int count = SPECPDL_INDEX ();
+        Lisp_Object prev_window, prev_buffer;
+        prev_window = selected_window;
+        XSETBUFFER (prev_buffer, old);
+
+        /* Select the window that was chosen, for running the hook.
+           Note: Both Fselect_window and select_window_norecord may
+           set-buffer to the buffer displayed in the window,
+           so we need to save the current buffer.  --stef  */
+        record_unwind_protect (Fset_buffer, prev_buffer);
+        record_unwind_protect (select_window_norecord, prev_window);
+        Fselect_window (window, Qt);
+        Fset_buffer (w->buffer);
+        Frun_hooks (1, &Qtemp_buffer_show_hook);
+        unbind_to (count, Qnil);
+      }
     }
 }
+
+DEFUN ("internal-temp-output-buffer-show",
+       Ftemp_output_buffer_show, Stemp_output_buffer_show,
+       1, 1, 0,
+       doc: /* Internal function for `with-output-to-temp-buffer''.  */)
+     (Lisp_Object buf)
+{
+  temp_output_buffer_show (buf);
+  return Qnil;
+}
 \f
 static void
 make_dummy_parent (Lisp_Object window)
@@ -3804,7 +3804,7 @@ See Info node `(elisp)Splitting Windows' for more details and examples.  */)
        error ("Window height %d too small (after splitting)", size_int);
       if (size_int + window_safe_height > XFASTINT (o->total_lines))
        error ("Window height %d too small (after splitting)",
-              XFASTINT (o->total_lines) - size_int);
+              (int) (XFASTINT (o->total_lines) - size_int));
       if (NILP (o->parent)
          || NILP (XWINDOW (o->parent)->vchild))
        {
@@ -3821,7 +3821,7 @@ See Info node `(elisp)Splitting Windows' for more details and examples.  */)
        error ("Window width %d too small (after splitting)", size_int);
       if (size_int + window_safe_width > XFASTINT (o->total_cols))
        error ("Window width %d too small (after splitting)",
-              XFASTINT (o->total_cols) - size_int);
+              (int) (XFASTINT (o->total_cols) - size_int));
       if (NILP (o->parent)
          || NILP (XWINDOW (o->parent)->hchild))
        {
@@ -4123,7 +4123,7 @@ enlarge_window (Lisp_Object window, int delta, int horiz_flag)
        {
          /* If trying to grow this window to or beyond size of the parent,
             just delete all the sibling windows.  */
-         Lisp_Object start, tem, next;
+         Lisp_Object start, tem;
 
          start = XWINDOW (parent)->vchild;
          if (NILP (start))
@@ -4133,9 +4133,9 @@ enlarge_window (Lisp_Object window, int delta, int horiz_flag)
          tem = XWINDOW (window)->next;
          while (! NILP (tem))
            {
-             next = XWINDOW (tem)->next;
+             Lisp_Object next1 = XWINDOW (tem)->next;
              delete_window (tem);
-             tem = next;
+             tem = next1;
            }
 
          /* Delete any siblings that come after WINDOW.
@@ -4144,9 +4144,9 @@ enlarge_window (Lisp_Object window, int delta, int horiz_flag)
          tem = start;
          while (! EQ (tem, window))
            {
-             next = XWINDOW (tem)->next;
+             Lisp_Object next1 = XWINDOW (tem)->next;
              delete_window (tem);
-             tem = next;
+             tem = next1;
            }
        }
       else
@@ -4834,8 +4834,8 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
         possibility of point becoming "stuck" on a tall line when
         scrolling by one line.  */
       if (window_scroll_pixel_based_preserve_y < 0
-         || !SYMBOLP (current_kboard->Vlast_command)
-         || NILP (Fget (current_kboard->Vlast_command, Qscroll_command)))
+         || !SYMBOLP (KVAR (current_kboard, Vlast_command))
+         || NILP (Fget (KVAR (current_kboard, Vlast_command), Qscroll_command)))
        {
          start_display (&it, w, start);
          move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS);
@@ -4868,7 +4868,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
             looking at an image that is taller that the window height.  */
          while (start_pos == IT_CHARPOS (it)
                 && start_pos > BEGV)
-           move_it_by_lines (&it, -1, 1);
+           move_it_by_lines (&it, -1);
        }
       else if (dy > 0)
        {
@@ -4878,11 +4878,11 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
             looking at an image that is taller that the window height.  */
          while (start_pos == IT_CHARPOS (it)
                 && start_pos < ZV)
-           move_it_by_lines (&it, 1, 1);
+           move_it_by_lines (&it, 1);
        }
     }
   else
-    move_it_by_lines (&it, n, 1);
+    move_it_by_lines (&it, n);
 
   /* We failed if we find ZV is already on the screen (scrolling up,
      means there's nothing past the end), or if we can't start any
@@ -4993,7 +4993,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
          while (it.current_y < this_scroll_margin)
            {
              int prev = it.current_y;
-             move_it_by_lines (&it, 1, 1);
+             move_it_by_lines (&it, 1);
              if (prev == it.current_y)
                break;
            }
@@ -5027,7 +5027,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
        partial_p = it.current_y + it.ascent + it.descent > it.last_visible_y;
       else
        {
-         move_it_by_lines (&it, 1, 1);
+         move_it_by_lines (&it, 1);
          partial_p = it.current_y > it.last_visible_y;
        }
 
@@ -5054,7 +5054,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
            /* The last line was only partially visible, so back up two
               lines to make sure we're on a fully visible line.  */
            {
-             move_it_by_lines (&it, -2, 0);
+             move_it_by_lines (&it, -2);
              SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
            }
          else
@@ -5091,8 +5091,8 @@ window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror)
   if (!NILP (Vscroll_preserve_screen_position))
     {
       if (window_scroll_preserve_vpos <= 0
-         || !SYMBOLP (current_kboard->Vlast_command)
-         || NILP (Fget (current_kboard->Vlast_command, Qscroll_command)))
+         || !SYMBOLP (KVAR (current_kboard, Vlast_command))
+         || NILP (Fget (KVAR (current_kboard, Vlast_command), Qscroll_command)))
        {
          struct position posit
            = *compute_motion (startpos, 0, 0, 0,
@@ -5502,7 +5502,7 @@ displayed_window_lines (struct window *w)
 }
 
 
-DEFUN ("recenter", Frecenter, Srecenter, 0, 1, "P",
+DEFUE ("recenter", Frecenter, Srecenter, 0, 1, "P",
        doc: /* Center point in selected window and maybe redisplay frame.
 With prefix argument ARG, recenter putting point on screen line ARG
 relative to the selected window.  If ARG is negative, it counts up from the
@@ -5524,7 +5524,7 @@ and redisplay normally--don't erase and redraw the frame.  */)
   struct buffer *obuf = current_buffer;
   int center_p = 0;
   EMACS_INT charpos, bytepos;
-  int iarg;
+  int iarg IF_LINT (= 0);
   int this_scroll_margin;
 
   /* If redisplay is suppressed due to an error, try again.  */
@@ -5597,14 +5597,14 @@ and redisplay normally--don't erase and redraw the frame.  */)
          start_display (&it, w, pt);
 
          /* Be sure we have the exact height of the full line containing PT.  */
-         move_it_by_lines (&it, 0, 1);
+         move_it_by_lines (&it, 0);
 
          /* The amount of pixels we have to move back is the window
             height minus what's displayed in the line containing PT,
             and the lines below.  */
          it.current_y = 0;
          it.vpos = 0;
-         move_it_by_lines (&it, nlines, 1);
+         move_it_by_lines (&it, nlines);
 
          if (it.vpos == nlines)
            h -= it.current_y;
@@ -5643,7 +5643,7 @@ and redisplay normally--don't erase and redraw the frame.  */)
          */
          h += extra_line_spacing;
          while (-it.current_y > h)
-           move_it_by_lines (&it, 1, 1);
+           move_it_by_lines (&it, 1);
 
          charpos = IT_CHARPOS (it);
          bytepos = IT_BYTEPOS (it);
@@ -5855,7 +5855,7 @@ DEFUN ("window-configuration-frame", Fwindow_configuration_frame, Swindow_config
   return XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame;
 }
 
-DEFUN ("set-window-configuration", Fset_window_configuration,
+DEFUE ("set-window-configuration", Fset_window_configuration,
        Sset_window_configuration, 1, 1, 0,
        doc: /* Set the configuration of windows and buffers as specified by CONFIGURATION.
 CONFIGURATION must be a value previously returned
@@ -5878,7 +5878,7 @@ the return value is nil.  Otherwise the value is t.  */)
   saved_windows = XVECTOR (data->saved_windows);
 
   new_current_buffer = data->current_buffer;
-  if (NILP (XBUFFER (new_current_buffer)->name))
+  if (NILP (BVAR (XBUFFER (new_current_buffer), name)))
     new_current_buffer = Qnil;
   else
     {
@@ -6063,14 +6063,14 @@ the return value is nil.  Otherwise the value is t.  */)
            w->buffer = p->buffer;
          else
            {
-             if (!NILP (XBUFFER (p->buffer)->name))
+             if (!NILP (BVAR (XBUFFER (p->buffer), name)))
                /* If saved buffer is alive, install it.  */
                {
                  w->buffer = p->buffer;
                  w->start_at_line_beg = p->start_at_line_beg;
                  set_marker_restricted (w->start, p->start, w->buffer);
                  set_marker_restricted (w->pointm, p->pointm, w->buffer);
-                 Fset_marker (XBUFFER (w->buffer)->mark,
+                 Fset_marker (BVAR (XBUFFER (w->buffer), mark),
                               p->mark, w->buffer);
 
                  /* As documented in Fcurrent_window_configuration, don't
@@ -6080,7 +6080,7 @@ the return value is nil.  Otherwise the value is t.  */)
                      && XBUFFER (p->buffer) == current_buffer)
                    Fgoto_char (w->pointm);
                }
-             else if (NILP (w->buffer) || NILP (XBUFFER (w->buffer)->name))
+             else if (NILP (w->buffer) || NILP (BVAR (XBUFFER (w->buffer), name)))
                /* Else unless window has a live buffer, get one.  */
                {
                  w->buffer = Fcdr (Fcar (Vbuffer_alist));
@@ -6121,7 +6121,7 @@ the return value is nil.  Otherwise the value is t.  */)
         has been restored into it.  We already swapped out that point
         from that window's old buffer.  */
       select_window (data->current_window, Qnil, 1);
-      XBUFFER (XWINDOW (selected_window)->buffer)->last_selected_window
+      BVAR (XBUFFER (XWINDOW (selected_window)->buffer), last_selected_window)
        = selected_window;
 
       if (NILP (data->focus_frame)
@@ -6322,7 +6322,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
          p->start = Fcopy_marker (w->start, Qnil);
          p->start_at_line_beg = w->start_at_line_beg;
 
-         tem = XBUFFER (w->buffer)->mark;
+         tem = BVAR (XBUFFER (w->buffer), mark);
          p->mark = Fcopy_marker (tem, Qnil);
        }
       else
@@ -6352,7 +6352,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
   return i;
 }
 
-DEFUN ("current-window-configuration", Fcurrent_window_configuration,
+DEFUE ("current-window-configuration", Fcurrent_window_configuration,
        Scurrent_window_configuration, 0, 1, 0,
        doc: /* Return an object representing the current window configuration of FRAME.
 If FRAME is nil or omitted, use the selected frame.
@@ -6400,28 +6400,6 @@ redirection (see `redirect-frame-focus').  */)
   return (tem);
 }
 
-DEFUN ("save-window-excursion", Fsave_window_excursion, Ssave_window_excursion,
-       0, UNEVALLED, 0,
-       doc: /* Execute BODY, preserving window sizes and contents.
-Return the value of the last form in BODY.
-Restore which buffer appears in which window, where display starts,
-and the value of point and mark for each window.
-Also restore the choice of selected window.
-Also restore which buffer is current.
-Does not restore the value of point in current buffer.
-usage: (save-window-excursion BODY...)  */)
-  (Lisp_Object args)
-{
-  register Lisp_Object val;
-  register int count = SPECPDL_INDEX ();
-
-  record_unwind_protect (Fset_window_configuration,
-                        Fcurrent_window_configuration (Qnil));
-  val = Fprogn (args);
-  return unbind_to (count, val);
-}
-
-
 \f
 /***********************************************************************
                            Window Split Tree
@@ -6566,7 +6544,7 @@ as nil.  */)
                            Fringes
  ***********************************************************************/
 
-DEFUN ("set-window-fringes", Fset_window_fringes, Sset_window_fringes,
+DEFUE ("set-window-fringes", Fset_window_fringes, Sset_window_fringes,
        2, 4, 0,
        doc: /* Set the fringe widths of window WINDOW.
 If WINDOW is nil, set the fringe widths of the currently selected
@@ -6632,8 +6610,8 @@ Value is a list of the form (LEFT-WIDTH RIGHT-WIDTH OUTSIDE-MARGINS).  */)
                            Scroll bars
  ***********************************************************************/
 
-DEFUN ("set-window-scroll-bars", Fset_window_scroll_bars, Sset_window_scroll_bars,
-       2, 4, 0,
+DEFUE ("set-window-scroll-bars", Fset_window_scroll_bars,
+       Sset_window_scroll_bars, 2, 4, 0,
        doc: /* Set width and type of scroll bars of window WINDOW.
 If window is nil, set scroll bars of the currently selected window.
 Second parameter WIDTH specifies the pixel width for the scroll bar;
@@ -7177,6 +7155,7 @@ frame to be redrawn only if it is a tty frame.  */);
   defsubr (&Sset_window_buffer);
   defsubr (&Sselect_window);
   defsubr (&Sforce_window_update);
+  defsubr (&Stemp_output_buffer_show);
   defsubr (&Ssplit_window);
   defsubr (&Senlarge_window);
   defsubr (&Sshrink_window);
@@ -7195,7 +7174,6 @@ frame to be redrawn only if it is a tty frame.  */);
   defsubr (&Swindow_configuration_frame);
   defsubr (&Sset_window_configuration);
   defsubr (&Scurrent_window_configuration);
-  defsubr (&Ssave_window_excursion);
   defsubr (&Swindow_tree);
   defsubr (&Sset_window_margins);
   defsubr (&Swindow_margins);
@@ -7228,4 +7206,3 @@ keys_of_window (void)
   initial_define_key (meta_map, Ctl ('V'), "scroll-other-window");
   initial_define_key (meta_map, 'v', "scroll-down-command");
 }
-