* simple.el (list-processes): Doc fix.
[bpt/emacs.git] / src / frame.c
index 07783bd..e43352d 100644 (file)
@@ -132,15 +132,15 @@ set_menu_bar_lines_1 (Lisp_Object window, int n)
   struct window *w = XWINDOW (window);
 
   w->last_modified = 0;
-  XSETFASTINT (w->top_line, XFASTINT (w->top_line) + n);
-  XSETFASTINT (w->total_lines, XFASTINT (w->total_lines) - n);
+  XSETFASTINT (WVAR (w, top_line), XFASTINT (WVAR (w, top_line)) + n);
+  XSETFASTINT (WVAR (w, total_lines), XFASTINT (WVAR (w, total_lines)) - n);
 
   /* Handle just the top child in a vertical split.  */
-  if (!NILP (w->vchild))
-    set_menu_bar_lines_1 (w->vchild, n);
+  if (!NILP (WVAR (w, vchild)))
+    set_menu_bar_lines_1 (WVAR (w, vchild), n);
 
   /* Adjust all children in a horizontal split.  */
-  for (window = w->hchild; !NILP (window); window = w->next)
+  for (window = WVAR (w, hchild); !NILP (window); window = WVAR (w, next))
     {
       w = XWINDOW (window);
       set_menu_bar_lines_1 (window, n);
@@ -170,7 +170,7 @@ set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
       windows_or_buffers_changed++;
       FRAME_WINDOW_SIZES_CHANGED (f) = 1;
       FRAME_MENU_BAR_LINES (f) = nlines;
-      set_menu_bar_lines_1 (f->root_window, nlines - olines);
+      set_menu_bar_lines_1 (FVAR (f, root_window), nlines - olines);
       adjust_glyphs (f);
     }
 }
@@ -269,7 +269,7 @@ make_frame (int mini_p)
 
   /* Initialize Lisp data.  Note that allocate_frame initializes all
      Lisp data to nil, so do it only for slots which should not be nil.  */
-  f->tool_bar_position = Qtop;
+  FVAR (f, tool_bar_position) = Qtop;
 
   /* Initialize non-Lisp data.  Note that allocate_frame zeroes out all
      non-Lisp data, so do it only for slots which should not be zero.
@@ -289,20 +289,20 @@ make_frame (int mini_p)
   if (mini_p)
     {
       mini_window = make_window ();
-      XWINDOW (root_window)->next = mini_window;
-      XWINDOW (mini_window)->prev = root_window;
+      WVAR (XWINDOW (root_window), next) = mini_window;
+      WVAR (XWINDOW (mini_window), prev) = root_window;
       XWINDOW (mini_window)->mini = 1;
-      XWINDOW (mini_window)->frame = frame;
-      f->minibuffer_window = mini_window;
+      WVAR (XWINDOW (mini_window), frame) = frame;
+      FVAR (f, minibuffer_window) = mini_window;
     }
   else
     {
       mini_window = Qnil;
-      XWINDOW (root_window)->next = Qnil;
-      f->minibuffer_window = Qnil;
+      WVAR (XWINDOW (root_window), next) = Qnil;
+      FVAR (f, minibuffer_window) = Qnil;
     }
 
-  XWINDOW (root_window)->frame = frame;
+  WVAR (XWINDOW (root_window), frame) = frame;
 
   /* 10 is arbitrary,
      just so that there is "something there."
@@ -311,21 +311,21 @@ make_frame (int mini_p)
   SET_FRAME_COLS (f, 10);
   FRAME_LINES (f) = 10;
 
-  XSETFASTINT (XWINDOW (root_window)->total_cols, 10);
-  XSETFASTINT (XWINDOW (root_window)->total_lines, (mini_p ? 9 : 10));
+  XSETFASTINT (WVAR (XWINDOW (root_window), total_cols), 10);
+  XSETFASTINT (WVAR (XWINDOW (root_window), total_lines), (mini_p ? 9 : 10));
 
   if (mini_p)
     {
-      XSETFASTINT (XWINDOW (mini_window)->total_cols, 10);
-      XSETFASTINT (XWINDOW (mini_window)->top_line, 9);
-      XSETFASTINT (XWINDOW (mini_window)->total_lines, 1);
+      XSETFASTINT (WVAR (XWINDOW (mini_window), total_cols), 10);
+      XSETFASTINT (WVAR (XWINDOW (mini_window), top_line), 9);
+      XSETFASTINT (WVAR (XWINDOW (mini_window), total_lines), 1);
     }
 
   /* Choose a buffer for the frame's root window.  */
   {
     Lisp_Object buf;
 
-    XWINDOW (root_window)->buffer = Qt;
+    WVAR (XWINDOW (root_window), buffer) = Qt;
     buf = Fcurrent_buffer ();
     /* If buf is a 'hidden' buffer (i.e. one whose name starts with
        a space), try to find another one.  */
@@ -339,12 +339,12 @@ make_frame (int mini_p)
        etc.  Running Lisp functions at this point surely ends in a
        SEGV.  */
     set_window_buffer (root_window, buf, 0, 0);
-    f->buffer_list = Fcons (buf, Qnil);
+    FVAR (f, buffer_list) = Fcons (buf, Qnil);
   }
 
   if (mini_p)
     {
-      XWINDOW (mini_window)->buffer = Qt;
+      WVAR (XWINDOW (mini_window), buffer) = Qt;
       set_window_buffer (mini_window,
                         (NILP (Vminibuffer_list)
                          ? get_minibuffer (0)
@@ -352,11 +352,11 @@ make_frame (int mini_p)
                         0, 0);
     }
 
-  f->root_window = root_window;
-  f->selected_window = root_window;
+  FVAR (f, root_window) = root_window;
+  FVAR (f, selected_window) = root_window;
   /* Make sure this window seems more recently used than
      a newly-created, never-selected window.  */
-  XWINDOW (f->selected_window)->use_time = ++window_select_count;
+  XWINDOW (FVAR (f, selected_window))->use_time = ++window_select_count;
 
   return f;
 }
@@ -376,7 +376,7 @@ make_frame_without_minibuffer (register Lisp_Object mini_window, KBOARD *kb, Lis
     CHECK_LIVE_WINDOW (mini_window);
 
   if (!NILP (mini_window)
-      && FRAME_KBOARD (XFRAME (XWINDOW (mini_window)->frame)) != kb)
+      && FRAME_KBOARD (XFRAME (WVAR (XWINDOW (mini_window), frame))) != kb)
     error ("Frame and minibuffer must be on the same terminal");
 
   /* Make a frame containing just a root window.  */
@@ -398,14 +398,15 @@ make_frame_without_minibuffer (register Lisp_Object mini_window, KBOARD *kb, Lis
           UNGCPRO;
        }
 
-      mini_window = XFRAME (KVAR (kb, Vdefault_minibuffer_frame))->minibuffer_window;
+      mini_window = FVAR (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)),
+                         minibuffer_window);
     }
 
-  f->minibuffer_window = mini_window;
+  FVAR (f, minibuffer_window) = mini_window;
 
   /* Make the chosen minibuffer window display the proper minibuffer,
      unless it is already showing a minibuffer.  */
-  if (NILP (Fmemq (XWINDOW (mini_window)->buffer, Vminibuffer_list)))
+  if (NILP (Fmemq (WVAR (XWINDOW (mini_window), buffer), Vminibuffer_list)))
     Fset_window_buffer (mini_window,
                        (NILP (Vminibuffer_list)
                         ? get_minibuffer (0)
@@ -436,11 +437,11 @@ make_minibuffer_frame (void)
      Avoid infinite looping on the window chain by marking next pointer
      as nil. */
 
-  mini_window = f->minibuffer_window = f->root_window;
+  mini_window = FVAR (f, minibuffer_window) = FVAR (f, root_window);
   XWINDOW (mini_window)->mini = 1;
-  XWINDOW (mini_window)->next = Qnil;
-  XWINDOW (mini_window)->prev = Qnil;
-  XWINDOW (mini_window)->frame = frame;
+  WVAR (XWINDOW (mini_window), next) = Qnil;
+  WVAR (XWINDOW (mini_window), prev) = Qnil;
+  WVAR (XWINDOW (mini_window), frame) = frame;
 
   /* Put the proper buffer in that window.  */
 
@@ -477,7 +478,7 @@ make_initial_frame (void)
   Vframe_list = Fcons (frame, Vframe_list);
 
   tty_frame_count = 1;
-  f->name = build_pure_c_string ("F1");
+  FVAR (f, name) = build_pure_c_string ("F1");
 
   f->visible = 1;
   f->async_visible = 1;
@@ -518,7 +519,7 @@ make_terminal_frame (struct terminal *terminal)
   XSETFRAME (frame, f);
   Vframe_list = Fcons (frame, Vframe_list);
 
-  f->name = make_formatted_string (name, "F%"pMd, ++tty_frame_count);
+  FVAR (f, name) = make_formatted_string (name, "F%"pMd, ++tty_frame_count);
 
   f->visible = 1;              /* FRAME_SET_VISIBLE wd set frame_garbaged. */
   f->async_visible = 1;                /* Don't let visible be cleared later. */
@@ -569,7 +570,7 @@ get_future_frame_param (Lisp_Object parameter,
 
   result = Fassq (parameter, supplied_parms);
   if (NILP (result))
-    result = Fassq (parameter, XFRAME (selected_frame)->param_alist);
+    result = Fassq (parameter, FVAR (XFRAME (selected_frame), param_alist));
   if (NILP (result) && current_value != NULL)
     result = build_string (current_value);
   if (!NILP (result) && !STRINGP (result))
@@ -688,11 +689,11 @@ affects all frames on the same terminal device.  */)
 
   /* Make the frame face alist be frame-specific, so that each
      frame could change its face definitions independently.  */
-  f->face_alist = Fcopy_alist (sf->face_alist);
+  FVAR (f, face_alist) = Fcopy_alist (FVAR (sf, face_alist));
   /* Simple Fcopy_alist isn't enough, because we need the contents of
      the vectors which are the CDRs of associations in face_alist to
      be copied as well.  */
-  for (tem = f->face_alist; CONSP (tem); tem = XCDR (tem))
+  for (tem = FVAR (f, face_alist); CONSP (tem); tem = XCDR (tem))
     XSETCDR (XCAR (tem), Fcopy_sequence (XCDR (XCAR (tem))));
   return frame;
 }
@@ -796,7 +797,7 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor
   if (! FRAME_MINIBUF_ONLY_P (XFRAME (selected_frame)))
     last_nonminibuf_frame = XFRAME (selected_frame);
 
-  Fselect_window (XFRAME (frame)->selected_window, norecord);
+  Fselect_window (FVAR (XFRAME (frame), selected_window), norecord);
 
   /* We want to make sure that the next event generates a frame-switch
      event to the appropriate frame.  This seems kludgy to me, but
@@ -1237,11 +1238,11 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
     }
 
   /* Don't allow minibuf_window to remain on a deleted frame.  */
-  if (EQ (f->minibuffer_window, minibuf_window))
+  if (EQ (FVAR (f, minibuffer_window), minibuf_window))
     {
-      Fset_window_buffer (sf->minibuffer_window,
-                         XWINDOW (minibuf_window)->buffer, Qnil);
-      minibuf_window = sf->minibuffer_window;
+      Fset_window_buffer (FVAR (sf, minibuffer_window),
+                         WVAR (XWINDOW (minibuf_window), buffer), Qnil);
+      minibuf_window = FVAR (sf, minibuffer_window);
 
       /* If the dying minibuffer window was selected,
         select the new one.  */
@@ -1250,8 +1251,8 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
     }
 
   /* Don't let echo_area_window to remain on a deleted frame.  */
-  if (EQ (f->minibuffer_window, echo_area_window))
-    echo_area_window = sf->minibuffer_window;
+  if (EQ (FVAR (f, minibuffer_window), echo_area_window))
+    echo_area_window = FVAR (sf, minibuffer_window);
 
   /* Clear any X selections for this frame.  */
 #ifdef HAVE_X_WINDOWS
@@ -1272,8 +1273,8 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
 
   /* Mark all the windows that used to be on FRAME as deleted, and then
      remove the reference to them.  */
-  delete_all_child_windows (f->root_window);
-  f->root_window = Qnil;
+  delete_all_child_windows (FVAR (f, root_window));
+  FVAR (f, root_window) = Qnil;
 
   Vframe_list = Fdelq (frame, Vframe_list);
   FRAME_SET_VISIBLE (f, 0);
@@ -1282,7 +1283,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
      garbage collection.  The frame object itself may not be garbage
      collected until much later, because recent_keys and other data
      structures can still refer to it.  */
-  f->menu_bar_vector = Qnil;
+  FVAR (f, menu_bar_vector) = Qnil;
 
   free_font_driver_list (f);
   xfree (f->namebuf);
@@ -1655,7 +1656,7 @@ If omitted, FRAME defaults to the currently selected frame.  */)
     }
 #endif
 
-  make_frame_visible_1 (XFRAME (frame)->root_window);
+  make_frame_visible_1 (FVAR (XFRAME (frame), root_window));
 
   /* Make menu bar update for the Buffers and Frames menus.  */
   windows_or_buffers_changed++;
@@ -1671,17 +1672,17 @@ make_frame_visible_1 (Lisp_Object window)
 {
   struct window *w;
 
-  for (;!NILP (window); window = w->next)
+  for (;!NILP (window); window = WVAR (w, next))
     {
       w = XWINDOW (window);
 
-      if (!NILP (w->buffer))
-       BVAR (XBUFFER (w->buffer), display_time) = Fcurrent_time ();
+      if (!NILP (WVAR (w, buffer)))
+       BVAR (XBUFFER (WVAR (w, buffer)), display_time) = Fcurrent_time ();
 
-      if (!NILP (w->vchild))
-       make_frame_visible_1 (w->vchild);
-      if (!NILP (w->hchild))
-       make_frame_visible_1 (w->hchild);
+      if (!NILP (WVAR (w, vchild)))
+       make_frame_visible_1 (WVAR (w, vchild));
+      if (!NILP (WVAR (w, hchild)))
+       make_frame_visible_1 (WVAR (w, hchild));
     }
 }
 
@@ -1709,12 +1710,12 @@ displayed in the terminal.  */)
     error ("Attempt to make invisible the sole visible or iconified frame");
 
   /* Don't allow minibuf_window to remain on a deleted frame.  */
-  if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window))
+  if (EQ (FVAR (XFRAME (frame), minibuffer_window), minibuf_window))
     {
       struct frame *sf = XFRAME (selected_frame);
-      Fset_window_buffer (sf->minibuffer_window,
-                         XWINDOW (minibuf_window)->buffer, Qnil);
-      minibuf_window = sf->minibuffer_window;
+      Fset_window_buffer (FVAR (sf, minibuffer_window),
+                         WVAR (XWINDOW (minibuf_window), buffer), Qnil);
+      minibuf_window = FVAR (sf, minibuffer_window);
     }
 
   /* I think this should be done with a hook.  */
@@ -1747,12 +1748,12 @@ If omitted, FRAME defaults to the currently selected frame.  */)
 #endif
 
   /* Don't allow minibuf_window to remain on a deleted frame.  */
-  if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window))
+  if (EQ (FVAR (XFRAME (frame), minibuffer_window), minibuf_window))
     {
       struct frame *sf = XFRAME (selected_frame);
-      Fset_window_buffer (sf->minibuffer_window,
-                         XWINDOW (minibuf_window)->buffer, Qnil);
-      minibuf_window = sf->minibuffer_window;
+      Fset_window_buffer (FVAR (sf, minibuffer_window),
+                         WVAR (XWINDOW (minibuf_window), buffer), Qnil);
+      minibuf_window = FVAR (sf, minibuffer_window);
     }
 
   /* I think this should be done with a hook.  */
@@ -1906,7 +1907,7 @@ The redirection lasts until `redirect-frame-focus' is called to change it.  */)
 
   f = XFRAME (frame);
 
-  f->focus_frame = focus_frame;
+  FVAR (f, focus_frame) = focus_frame;
 
   if (FRAME_TERMINAL (f)->frame_rehighlight_hook)
     (*FRAME_TERMINAL (f)->frame_rehighlight_hook) (f);
@@ -1939,7 +1940,7 @@ get_frame_param (register struct frame *frame, Lisp_Object prop)
 {
   register Lisp_Object tem;
 
-  tem = Fassq (prop, frame->param_alist);
+  tem = Fassq (prop, FVAR (frame, param_alist));
   if (EQ (tem, Qnil))
     return tem;
   return Fcdr (tem);
@@ -1951,7 +1952,7 @@ get_frame_param (register struct frame *frame, Lisp_Object prop)
 Lisp_Object
 frame_buffer_predicate (Lisp_Object frame)
 {
-  return XFRAME (frame)->buffer_predicate;
+  return FVAR (XFRAME (frame), buffer_predicate);
 }
 
 /* Return the buffer-list of the selected frame.  */
@@ -1959,7 +1960,7 @@ frame_buffer_predicate (Lisp_Object frame)
 static Lisp_Object
 frame_buffer_list (Lisp_Object frame)
 {
-  return XFRAME (frame)->buffer_list;
+  return FVAR (XFRAME (frame), buffer_list);
 }
 
 /* Discard BUFFER from the buffer-list and buried-buffer-list of each frame.  */
@@ -1971,10 +1972,10 @@ frames_discard_buffer (Lisp_Object buffer)
 
   FOR_EACH_FRAME (tail, frame)
     {
-      XFRAME (frame)->buffer_list
-       = Fdelq (buffer, XFRAME (frame)->buffer_list);
-      XFRAME (frame)->buried_buffer_list
-        = Fdelq (buffer, XFRAME (frame)->buried_buffer_list);
+      FVAR (XFRAME (frame), buffer_list)
+       = Fdelq (buffer, FVAR (XFRAME (frame), buffer_list));
+      FVAR (XFRAME (frame), buried_buffer_list)
+        = Fdelq (buffer, FVAR (XFRAME (frame), buried_buffer_list));
     }
 }
 
@@ -2022,8 +2023,8 @@ set_term_frame_name (struct frame *f, Lisp_Object name)
 
       /* Check for no change needed in this very common case
         before we do any consing.  */
-      if (frame_name_fnn_p (SSDATA (f->name),
-                           SBYTES (f->name)))
+      if (frame_name_fnn_p (SSDATA (FVAR (f, name)),
+                           SBYTES (FVAR (f, name))))
        return;
 
       name = make_formatted_string (namebuf, "F%"pMd, ++tty_frame_count);
@@ -2033,7 +2034,7 @@ set_term_frame_name (struct frame *f, Lisp_Object name)
       CHECK_STRING (name);
 
       /* Don't change the name if it's already NAME.  */
-      if (! NILP (Fstring_equal (name, f->name)))
+      if (! NILP (Fstring_equal (name, FVAR (f, name))))
        return;
 
       /* Don't allow the user to set the frame name to F<num>, so it
@@ -2042,7 +2043,7 @@ set_term_frame_name (struct frame *f, Lisp_Object name)
        error ("Frame names of the form F<num> are usurped by Emacs");
     }
 
-  f->name = name;
+  FVAR (f, name) = name;
   update_mode_lines = 1;
 }
 
@@ -2059,7 +2060,7 @@ store_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
       for (; CONSP (val); val = XCDR (val))
        if (!NILP (Fbuffer_live_p (XCAR (val))))
          list = Fcons (XCAR (val), list);
-      f->buffer_list = Fnreverse (list);
+      FVAR (f, buffer_list) = Fnreverse (list);
       return;
     }
   if (EQ (prop, Qburied_buffer_list))
@@ -2068,7 +2069,7 @@ store_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
       for (; CONSP (val); val = XCDR (val))
        if (!NILP (Fbuffer_live_p (XCAR (val))))
          list = Fcons (XCAR (val), list);
-      f->buried_buffer_list = Fnreverse (list);
+      FVAR (f, buried_buffer_list) = Fnreverse (list);
       return;
     }
 
@@ -2103,9 +2104,9 @@ store_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
     FRAME_TTY (f)->previous_frame = NULL;
 
   /* Update the frame parameter alist.  */
-  old_alist_elt = Fassq (prop, f->param_alist);
+  old_alist_elt = Fassq (prop, FVAR (f, param_alist));
   if (EQ (old_alist_elt, Qnil))
-    f->param_alist = Fcons (Fcons (prop, val), f->param_alist);
+    FVAR (f, param_alist) = Fcons (Fcons (prop, val), FVAR (f, param_alist));
   else
     Fsetcdr (old_alist_elt, val);
 
@@ -2113,7 +2114,7 @@ store_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
      in addition to the alist.  */
 
   if (EQ (prop, Qbuffer_predicate))
-    f->buffer_predicate = val;
+    FVAR (f, buffer_predicate) = val;
 
   if (! FRAME_WINDOW_P (f))
     {
@@ -2129,11 +2130,11 @@ store_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
        error ("Surrogate minibuffer windows must be minibuffer windows");
 
       if ((FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f))
-         && !EQ (val, f->minibuffer_window))
+         && !EQ (val, FVAR (f, minibuffer_window)))
        error ("Can't change the surrogate minibuffer of a frame with its own minibuffer");
 
       /* Install the chosen minibuffer window, with proper buffer.  */
-      f->minibuffer_window = val;
+      FVAR (f, minibuffer_window) = val;
     }
 }
 
@@ -2158,7 +2159,7 @@ If FRAME is omitted, return information on the currently selected frame.  */)
   if (!FRAME_LIVE_P (f))
     return Qnil;
 
-  alist = Fcopy_alist (f->param_alist);
+  alist = Fcopy_alist (FVAR (f, param_alist));
   GCPRO1 (alist);
 
   if (!FRAME_WINDOW_P (f))
@@ -2204,7 +2205,7 @@ If FRAME is omitted, return information on the currently selected frame.  */)
                                    : FRAME_W32_P (f) ? "w32term"
                                    :"tty"));
     }
-  store_in_alist (&alist, Qname, f->name);
+  store_in_alist (&alist, Qname, FVAR (f, name));
   height = (f->new_text_lines ? f->new_text_lines : FRAME_LINES (f));
   store_in_alist (&alist, Qheight, make_number (height));
   width = (f->new_text_cols ? f->new_text_cols : FRAME_COLS (f));
@@ -2216,7 +2217,8 @@ If FRAME is omitted, return information on the currently selected frame.  */)
                   : FRAME_MINIBUF_WINDOW (f)));
   store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil));
   store_in_alist (&alist, Qbuffer_list, frame_buffer_list (frame));
-  store_in_alist (&alist, Qburied_buffer_list, XFRAME (frame)->buried_buffer_list);
+  store_in_alist (&alist, Qburied_buffer_list,
+                 FVAR (XFRAME (frame), buried_buffer_list));
 
   /* I think this should be done with a hook.  */
 #ifdef HAVE_WINDOW_SYSTEM
@@ -2257,7 +2259,7 @@ If FRAME is nil, describe the currently selected frame.  */)
     {
       /* Avoid consing in frequent cases.  */
       if (EQ (parameter, Qname))
-       value = f->name;
+       value = FVAR (f, name);
 #ifdef HAVE_X_WINDOWS
       else if (EQ (parameter, Qdisplay) && FRAME_X_P (f))
        value = XCAR (FRAME_X_DISPLAY_INFO (f)->name_list_element);
@@ -2265,7 +2267,7 @@ If FRAME is nil, describe the currently selected frame.  */)
       else if (EQ (parameter, Qbackground_color)
               || EQ (parameter, Qforeground_color))
        {
-         value = Fassq (parameter, f->param_alist);
+         value = Fassq (parameter, FVAR (f, param_alist));
          if (CONSP (value))
            {
              value = XCDR (value);
@@ -2303,7 +2305,7 @@ If FRAME is nil, describe the currently selected frame.  */)
        }
       else if (EQ (parameter, Qdisplay_type)
               || EQ (parameter, Qbackground_mode))
-       value = Fcdr (Fassq (parameter, f->param_alist));
+       value = Fcdr (Fassq (parameter, FVAR (f, param_alist)));
       else
        /* FIXME: Avoid this code path at all (as well as code duplication)
           by sharing more code with Fframe_parameters.  */
@@ -2889,14 +2891,14 @@ x_set_frame_parameters (FRAME_PTR f, Lisp_Object alist)
   if (! TYPE_RANGED_INTEGERP (int, icon_left))
     {
       icon_left_no_change = 1;
-      icon_left = Fcdr (Fassq (Qicon_left, f->param_alist));
+      icon_left = Fcdr (Fassq (Qicon_left, FVAR (f, param_alist)));
       if (NILP (icon_left))
        XSETINT (icon_left, 0);
     }
   if (! TYPE_RANGED_INTEGERP (int, icon_top))
     {
       icon_top_no_change = 1;
-      icon_top = Fcdr (Fassq (Qicon_top, f->param_alist));
+      icon_top = Fcdr (Fassq (Qicon_top, FVAR (f, param_alist)));
       if (NILP (icon_top))
        XSETINT (icon_top, 0);
     }
@@ -3056,7 +3058,7 @@ x_report_frame_params (struct frame *f, Lisp_Object *alistptr)
   store_in_alist (alistptr, Qouter_window_id,
                  make_formatted_string (buf, "%lu", w));
 #endif
-  store_in_alist (alistptr, Qicon_name, f->icon_name);
+  store_in_alist (alistptr, Qicon_name, FVAR (f, icon_name));
   FRAME_SAMPLE_VISIBILITY (f);
   store_in_alist (alistptr, Qvisibility,
                  (FRAME_VISIBLE_P (f) ? Qt
@@ -3070,7 +3072,7 @@ x_report_frame_params (struct frame *f, Lisp_Object *alistptr)
     XSETFASTINT (tem, FRAME_X_OUTPUT (f)->parent_desc);
   store_in_alist (alistptr, Qexplicit_name, (f->explicit_name ? Qt : Qnil));
   store_in_alist (alistptr, Qparent_id, tem);
-  store_in_alist (alistptr, Qtool_bar_position, f->tool_bar_position);
+  store_in_alist (alistptr, Qtool_bar_position, FVAR (f, tool_bar_position));
 }
 
 
@@ -3130,7 +3132,7 @@ x_set_screen_gamma (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu
     signal_error ("Invalid screen-gamma", new_value);
 
   /* Apply the new gamma value to the frame background.  */
-  bgcolor = Fassq (Qbackground_color, f->param_alist);
+  bgcolor = Fassq (Qbackground_color, FVAR (f, param_alist));
   if (CONSP (bgcolor) && (bgcolor = XCDR (bgcolor), STRINGP (bgcolor)))
     {
       Lisp_Object parm_index = Fget (Qbackground_color, Qx_frame_parameter);
@@ -3459,7 +3461,7 @@ x_icon_type (FRAME_PTR f)
 {
   Lisp_Object tem;
 
-  tem = assq_no_quit (Qicon_type, f->param_alist);
+  tem = assq_no_quit (Qicon_type, FVAR (f, param_alist));
   if (CONSP (tem))
     return XCDR (tem);
   else
@@ -3695,8 +3697,6 @@ display_x_get_resource (Display_Info *dpyinfo, Lisp_Object attribute, Lisp_Objec
 char *
 x_get_resource_string (const char *attribute, const char *class)
 {
-  char *name_key;
-  char *class_key;
   char *result;
   struct frame *sf = SELECTED_FRAME ();
   ptrdiff_t invocation_namelen = SBYTES (Vinvocation_name);
@@ -3704,8 +3704,8 @@ x_get_resource_string (const char *attribute, const char *class)
 
   /* Allocate space for the components, the dots which separate them,
      and the final '\0'.  */
-  SAFE_ALLOCA (name_key, char *, invocation_namelen + strlen (attribute) + 2);
-  class_key = alloca ((sizeof (EMACS_CLASS) - 1) + strlen (class) + 2);
+  char *name_key = SAFE_ALLOCA (invocation_namelen + strlen (attribute) + 2);
+  char *class_key = alloca ((sizeof (EMACS_CLASS) - 1) + strlen (class) + 2);
 
   esprintf (name_key, "%s.%s", SSDATA (Vinvocation_name), attribute);
   sprintf (class_key, "%s.%s", EMACS_CLASS, class);