]> code.delx.au - gnu-emacs/blobdiff - src/frame.c
2002-08-10 Andrew Choi <akochoi@shaw.ca>
[gnu-emacs] / src / frame.c
index 8d9ef248d017bf5234b8bcdc9c3e4b71d9c231a3..6adc1f32d8565635b12552bef2eb5a7a1fab2dae 100644 (file)
@@ -30,14 +30,13 @@ Boston, MA 02111-1307, USA.  */
 #ifdef WINDOWSNT
 #include "w32term.h"
 #endif
-#ifdef macintosh
+#ifdef MAC_OS
 #include "macterm.h"
 #endif
 #include "buffer.h"
 /* These help us bind and responding to switch-frame events.  */
 #include "commands.h"
 #include "keyboard.h"
-#include "keymap.h"
 #include "frame.h"
 #ifdef HAVE_WINDOW_SYSTEM
 #include "fontset.h"
@@ -73,10 +72,14 @@ Lisp_Object Qtitle;
 Lisp_Object Qdisplay_type;
 Lisp_Object Qbackground_mode;
 Lisp_Object Qinhibit_default_face_x_resources;
+Lisp_Object Qleft_fringe;
+Lisp_Object Qright_fringe;
+Lisp_Object Qtty_color_mode;
 
 Lisp_Object Vterminal_frame;
 Lisp_Object Vdefault_frame_alist;
 Lisp_Object Vmouse_position_function;
+Lisp_Object Vmouse_highlight;
 \f
 static void
 set_menu_bar_lines_1 (window, n)
@@ -181,8 +184,8 @@ DEFUN ("frame-live-p", Fframe_live_p, Sframe_live_p, 1, 1, 0,
        doc: /* Return non-nil if OBJECT is a frame which has not been deleted.
 Value is nil if OBJECT is not a live frame.  If object is a live
 frame, the return value indicates what sort of output device it is
-displayed on.  Value is t for a termcap frame (a character-only
-terminal), `x' for an Emacs frame being displayed in an X window.  */)
+displayed on.  See the documentation of `framep' for possible
+return values.  */)
      (object)
      Lisp_Object object;
 {
@@ -290,7 +293,7 @@ make_frame (mini_p)
     buf = Fcurrent_buffer ();
     /* If buf is a 'hidden' buffer (i.e. one whose name starts with
        a space), try to find another one.  */
-    if (XSTRING (Fbuffer_name (buf))->data[0] == ' ')
+    if (SREF (Fbuffer_name (buf), 0) == ' ')
       buf = Fother_buffer (buf, Qnil, Qnil);
 
     /* Use set_window_buffer, not Fset_window_buffer, and don't let
@@ -337,7 +340,7 @@ make_frame_without_minibuffer (mini_window, kb, display)
   struct gcpro gcpro1;
 
   if (!NILP (mini_window))
-    CHECK_LIVE_WINDOW (mini_window, 0);
+    CHECK_LIVE_WINDOW (mini_window);
 
 #ifdef MULTI_KBOARD
   if (!NILP (mini_window)
@@ -483,11 +486,11 @@ make_terminal_frame ()
   f->output_method = output_termcap;
   f->output_data.x = &tty_display;
 #else
-#ifdef macintosh
+#ifdef MAC_OS8
   make_mac_terminal_frame (f);
 #else
   f->output_data.x = &tty_display;
-#endif /* macintosh */
+#endif /* MAC_OS8 */
 #endif /* WINDOWSNT */
 #endif /* MSDOS */
 
@@ -518,7 +521,7 @@ Note that changing the size of one terminal frame automatically affects all.  */
     abort ();
 #else /* not MSDOS */
 
-#ifdef macintosh
+#ifdef MAC_OS
   if (sf->output_method != output_mac)
     error ("Not running on a Macintosh screen; cannot make a new Macintosh frame");
 #else
@@ -579,7 +582,7 @@ do_switch_frame (frame, track, for_deletion)
   /* This used to say CHECK_LIVE_FRAME, but apparently it's possible for
      a switch-frame event to arrive after a frame is no longer live,
      especially when deleting the initial frame during startup.  */
-  CHECK_FRAME (frame, 0);
+  CHECK_FRAME (frame);
   if (! FRAME_LIVE_P (XFRAME (frame)))
     return Qnil;
 
@@ -640,6 +643,23 @@ do_switch_frame (frame, track, for_deletion)
 
   Fselect_window (XFRAME (frame)->selected_window);
 
+#ifndef WINDOWSNT
+  /* Make sure to switch the tty color mode to that of the newly
+     selected frame.  */
+  sf = SELECTED_FRAME ();
+  if (FRAME_TERMCAP_P (sf))
+    {
+      Lisp_Object color_mode_spec, color_mode;
+
+      color_mode_spec = assq_no_quit (Qtty_color_mode, sf->param_alist);
+      if (CONSP (color_mode_spec))
+       color_mode = XCDR (color_mode_spec);
+      else
+       color_mode = make_number (0);
+      set_tty_color_mode (sf, color_mode);
+    }
+#endif /* !WINDOWSNT */
+
   /* We want to make sure that the next event generates a frame-switch
      event to the appropriate frame.  This seems kludgy to me, but
      before you take it out, make sure that evaluating something like
@@ -703,7 +723,7 @@ DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0,
      (window)
      Lisp_Object window;
 {
-  CHECK_LIVE_WINDOW (window, 0);
+  CHECK_LIVE_WINDOW (window);
   return XWINDOW (window)->frame;
 }
 
@@ -719,7 +739,7 @@ If omitted, FRAME defaults to the currently selected frame.  */)
     w = SELECTED_FRAME ()->root_window;
   else
     {
-      CHECK_LIVE_FRAME (frame, 0);
+      CHECK_LIVE_FRAME (frame);
       w = XFRAME (frame)->root_window;
     }
   while (NILP (XWINDOW (w)->buffer))
@@ -754,7 +774,7 @@ If omitted, FRAME defaults to the currently selected frame.  */)
     window = SELECTED_FRAME ()->root_window;
   else
     {
-      CHECK_LIVE_FRAME (frame, 0);
+      CHECK_LIVE_FRAME (frame);
       window = XFRAME (frame)->root_window;
     }
   
@@ -774,7 +794,7 @@ If omitted, FRAME defaults to the currently selected frame.  */)
     window = SELECTED_FRAME ()->selected_window;
   else
     {
-      CHECK_LIVE_FRAME (frame, 0);
+      CHECK_LIVE_FRAME (frame);
       window = XFRAME (frame)->selected_window;
     }
 
@@ -792,8 +812,8 @@ If FRAME is the selected frame, this makes WINDOW the selected window.  */)
   if (NILP (frame))
     frame = selected_frame;
   
-  CHECK_LIVE_FRAME (frame, 0);
-  CHECK_LIVE_WINDOW (window, 1);
+  CHECK_LIVE_FRAME (frame);
+  CHECK_LIVE_WINDOW (window);
 
   if (! EQ (frame, WINDOW_FRAME (XWINDOW (window))))
     error ("In `set-frame-selected-window', WINDOW is not on FRAME");
@@ -840,7 +860,7 @@ next_frame (frame, minibuf)
 
   /* If this frame is dead, it won't be in Vframe_list, and we'll loop
      forever.  Forestall that.  */
-  CHECK_LIVE_FRAME (frame, 0);
+  CHECK_LIVE_FRAME (frame);
 
   while (1)
     for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
@@ -992,7 +1012,7 @@ Otherwise, include all frames.  */)
   if (NILP (frame))
     frame = selected_frame;
   
-  CHECK_LIVE_FRAME (frame, 0);
+  CHECK_LIVE_FRAME (frame);
   return next_frame (frame, miniframe);
 }
 
@@ -1012,7 +1032,7 @@ Otherwise, include all frames.  */)
 {
   if (NILP (frame))
     frame = selected_frame;
-  CHECK_LIVE_FRAME (frame, 0);
+  CHECK_LIVE_FRAME (frame);
   return prev_frame (frame, miniframe);
 }
 \f
@@ -1084,7 +1104,7 @@ frame.  The hook is called with one argument FRAME.  */)
     }
   else
     {
-      CHECK_FRAME (frame, 0);
+      CHECK_FRAME (frame);
       f = XFRAME (frame);
     }
 
@@ -1092,10 +1112,10 @@ frame.  The hook is called with one argument FRAME.  */)
     return Qnil;
 
   if (NILP (force) && !other_visible_frames (f)
-#ifdef macintosh
+#ifdef MAC_OS8
       /* Terminal frame deleted before any other visible frames are
         created.  */
-      && strcmp (XSTRING (f->name)->data, "F1") != 0
+      && strcmp (SDATA (f->name), "F1") != 0
 #endif
      )
     error ("Attempt to delete the sole visible or iconified frame");
@@ -1404,9 +1424,9 @@ before calling this function on it, like this.
   (frame, x, y)
      Lisp_Object frame, x, y;
 {
-  CHECK_LIVE_FRAME (frame, 0);
-  CHECK_NUMBER (x, 2);
-  CHECK_NUMBER (y, 1);
+  CHECK_LIVE_FRAME (frame);
+  CHECK_NUMBER (x);
+  CHECK_NUMBER (y);
 
   /* I think this should be done with a hook.  */
 #ifdef HAVE_WINDOW_SYSTEM
@@ -1436,9 +1456,9 @@ before calling this function on it, like this.
   (frame, x, y)
      Lisp_Object frame, x, y;
 {
-  CHECK_LIVE_FRAME (frame, 0);
-  CHECK_NUMBER (x, 2);
-  CHECK_NUMBER (y, 1);
+  CHECK_LIVE_FRAME (frame);
+  CHECK_NUMBER (x);
+  CHECK_NUMBER (y);
 
   /* I think this should be done with a hook.  */
 #ifdef HAVE_WINDOW_SYSTEM
@@ -1470,7 +1490,7 @@ If omitted, FRAME defaults to the currently selected frame.  */)
   if (NILP (frame))
     frame = selected_frame;
 
-  CHECK_LIVE_FRAME (frame, 0);
+  CHECK_LIVE_FRAME (frame);
 
   /* I think this should be done with a hook.  */
 #ifdef HAVE_WINDOW_SYSTEM
@@ -1524,7 +1544,7 @@ but if the second optional argument FORCE is non-nil, you may do so.  */)
   if (NILP (frame))
     frame = selected_frame;
 
-  CHECK_LIVE_FRAME (frame, 0);
+  CHECK_LIVE_FRAME (frame);
 
   if (NILP (force) && !other_visible_frames (XFRAME (frame)))
     error ("Attempt to make invisible the sole visible or iconified frame");
@@ -1566,7 +1586,7 @@ If omitted, FRAME defaults to the currently selected frame.  */)
   if (NILP (frame))
     frame = selected_frame;
   
-  CHECK_LIVE_FRAME (frame, 0);
+  CHECK_LIVE_FRAME (frame);
 
 #if 0 /* This isn't logically necessary, and it can do GC.  */
   /* Don't let the frame remain selected.  */
@@ -1604,7 +1624,7 @@ Return the symbol `icon' if frame is visible only as an icon.  */)
      (frame)
      Lisp_Object frame;
 {
-  CHECK_LIVE_FRAME (frame, 0);
+  CHECK_LIVE_FRAME (frame);
 
   FRAME_SAMPLE_VISIBILITY (XFRAME (frame));
 
@@ -1650,7 +1670,7 @@ doesn't support multiple overlapping frames, this function does nothing.  */)
   if (NILP (frame))
     frame = selected_frame;
 
-  CHECK_LIVE_FRAME (frame, 0);
+  CHECK_LIVE_FRAME (frame);
 
   /* Do like the documentation says. */
   Fmake_frame_visible (frame);
@@ -1673,7 +1693,7 @@ doesn't support multiple overlapping frames, this function does nothing.  */)
   if (NILP (frame))
     frame = selected_frame;
 
-  CHECK_LIVE_FRAME (frame, 0);
+  CHECK_LIVE_FRAME (frame);
   
   if (frame_raise_lower_hook)
     (*frame_raise_lower_hook) (XFRAME (frame), 0);
@@ -1713,10 +1733,10 @@ The redirection lasts until `redirect-frame-focus' is called to change it.  */)
   /* Note that we don't check for a live frame here.  It's reasonable
      to redirect the focus of a frame you're about to delete, if you
      know what other frame should receive those keystrokes.  */
-  CHECK_FRAME (frame, 0);
+  CHECK_FRAME (frame);
 
   if (! NILP (focus_frame))
-    CHECK_LIVE_FRAME (focus_frame, 1);
+    CHECK_LIVE_FRAME (focus_frame);
 
   XFRAME (frame)->focus_frame = focus_frame;
 
@@ -1734,7 +1754,7 @@ See `redirect-frame-focus'.  */)
      (frame)
      Lisp_Object frame;
 {
-  CHECK_LIVE_FRAME (frame, 0);
+  CHECK_LIVE_FRAME (frame);
 
   return FRAME_FOCUS_FRAME (XFRAME (frame));
 }
@@ -1798,26 +1818,6 @@ frames_discard_buffer (buffer)
     }
 }
 
-/* Move BUFFER to the end of the buffer-list of each frame.  */
-
-void
-frames_bury_buffer (buffer)
-     Lisp_Object buffer;
-{
-  Lisp_Object frame, tail;
-
-  FOR_EACH_FRAME (tail, frame)
-    {
-      struct frame *f = XFRAME (frame);
-      Lisp_Object found;
-      
-      found = Fmemq (buffer, f->buffer_list);
-      if (!NILP (found))
-       f->buffer_list = nconc2 (Fdelq (buffer, f->buffer_list),
-                                Fcons (buffer, Qnil));
-    }
-}
-
 /* Modify the alist in *ALISTPTR to associate PROP with VAL.
    If the alist already has an element for PROP, we change it.  */
 
@@ -1869,8 +1869,8 @@ set_term_frame_name (f, name)
 
       /* Check for no change needed in this very common case
         before we do any consing.  */
-      if (frame_name_fnn_p (XSTRING (f->name)->data,
-                           STRING_BYTES (XSTRING (f->name))))
+      if (frame_name_fnn_p (SDATA (f->name),
+                           SBYTES (f->name)))
        return;
 
       terminal_frame_count++;
@@ -1879,7 +1879,7 @@ set_term_frame_name (f, name)
     }
   else
     {
-      CHECK_STRING (name, 0);
+      CHECK_STRING (name);
 
       /* Don't change the name if it's already NAME.  */
       if (! NILP (Fstring_equal (name, f->name)))
@@ -1887,7 +1887,7 @@ set_term_frame_name (f, name)
 
       /* Don't allow the user to set the frame name to F<num>, so it
         doesn't clash with the names we generate for terminal frames.  */
-      if (frame_name_fnn_p (XSTRING (name)->data, STRING_BYTES (XSTRING (name))))
+      if (frame_name_fnn_p (SDATA (name), SBYTES (name)))
        error ("Frame names of the form F<num> are usurped by Emacs");
     }
 
@@ -1925,6 +1925,14 @@ store_frame_param (f, prop, val)
        swap_in_global_binding (prop);
     }
 
+#ifndef WINDOWSNT
+  /* The tty color mode needs to be set before the frame's parameter
+     alist is updated with the new value, because set_tty_color_mode
+     wants to look at the old mode.  */
+  if (FRAME_TERMCAP_P (f) && EQ (prop, Qtty_color_mode))
+    set_tty_color_mode (f, val);
+#endif
+
   /* Update the frame parameter alist.  */
   old_alist_elt = Fassq (prop, f->param_alist);
   if (EQ (old_alist_elt, Qnil))
@@ -1976,7 +1984,7 @@ If FRAME is omitted, return information on the currently selected frame.  */)
   if (NILP (frame))
     frame = selected_frame;
 
-  CHECK_FRAME (frame, 0);
+  CHECK_FRAME (frame);
   f = XFRAME (frame);
 
   if (!FRAME_LIVE_P (f))
@@ -1997,13 +2005,13 @@ If FRAME is omitted, return information on the currently selected frame.  */)
       elt = Fassq (Qforeground_color, alist);
       if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt)))
        {
-         if (strncmp (XSTRING (XCDR (elt))->data,
+         if (strncmp (SDATA (XCDR (elt)),
                       unspecified_bg,
-                      XSTRING (XCDR (elt))->size) == 0)
+                      SCHARS (XCDR (elt))) == 0)
            store_in_alist (&alist, Qforeground_color, tty_color_name (f, bg));
-         else if (strncmp (XSTRING (XCDR (elt))->data,
+         else if (strncmp (SDATA (XCDR (elt)),
                            unspecified_fg,
-                           XSTRING (XCDR (elt))->size) == 0)
+                           SCHARS (XCDR (elt))) == 0)
            store_in_alist (&alist, Qforeground_color, tty_color_name (f, fg));
        }
       else
@@ -2011,13 +2019,13 @@ If FRAME is omitted, return information on the currently selected frame.  */)
       elt = Fassq (Qbackground_color, alist);
       if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt)))
        {
-         if (strncmp (XSTRING (XCDR (elt))->data,
+         if (strncmp (SDATA (XCDR (elt)),
                       unspecified_fg,
-                      XSTRING (XCDR (elt))->size) == 0)
+                      SCHARS (XCDR (elt))) == 0)
            store_in_alist (&alist, Qbackground_color, tty_color_name (f, fg));
-         else if (strncmp (XSTRING (XCDR (elt))->data,
+         else if (strncmp (SDATA (XCDR (elt)),
                            unspecified_bg,
-                           XSTRING (XCDR (elt))->size) == 0)
+                           SCHARS (XCDR (elt))) == 0)
            store_in_alist (&alist, Qbackground_color, tty_color_name (f, bg));
        }
       else
@@ -2071,14 +2079,15 @@ If FRAME is nil, describe the currently selected frame.  */)
   if (NILP (frame))
     frame = selected_frame;
   else
-    CHECK_FRAME (frame, 0);
-  CHECK_SYMBOL (parameter, 1);
+    CHECK_FRAME (frame);
+  CHECK_SYMBOL (parameter);
   
   f = XFRAME (frame);
   value = Qnil;
   
   if (FRAME_LIVE_P (f))
     {
+      /* Avoid consing in frequent cases.  */
       if (EQ (parameter, Qname))
        value = f->name;
 #ifdef HAVE_X_WINDOWS
@@ -2098,13 +2107,13 @@ If FRAME is nil, describe the currently selected frame.  */)
                 "unspecified".  We need to do the same here.  */
              if (STRINGP (value) && !FRAME_WINDOW_P (f))
                {
-                 char *color_name;
+                 const char *color_name;
                  EMACS_INT csz;
 
                  if (EQ (parameter, Qbackground_color))
                    {
-                     color_name = XSTRING (value)->data;
-                     csz = XSTRING (value)->size;
+                     color_name = SDATA (value);
+                     csz = SCHARS (value);
                      if (strncmp (color_name, unspecified_bg, csz) == 0)
                        value = tty_color_name (f, FRAME_BACKGROUND_PIXEL (f));
                      else if (strncmp (color_name, unspecified_fg, csz) == 0)
@@ -2112,8 +2121,8 @@ If FRAME is nil, describe the currently selected frame.  */)
                    }
                  else if (EQ (parameter, Qforeground_color))
                    {
-                     color_name = XSTRING (value)->data;
-                     csz = XSTRING (value)->size;
+                     color_name = SDATA (value);
+                     csz = SCHARS (value);
                      if (strncmp (color_name, unspecified_fg, csz) == 0)
                        value = tty_color_name (f, FRAME_FOREGROUND_PIXEL (f));
                      else if (strncmp (color_name, unspecified_bg, csz) == 0)
@@ -2153,7 +2162,7 @@ enabled such bindings for that variable with `make-variable-frame-local'.  */)
 {
   FRAME_PTR f;
   register Lisp_Object tail, prop, val;
-  int count = BINDING_STACK_SIZE ();
+  int count = SPECPDL_INDEX ();
 
   /* Bind this to t to inhibit initialization of the default face from
      X resources in face-set-after-frame-default.  If we don't inhibit
@@ -2165,7 +2174,7 @@ enabled such bindings for that variable with `make-variable-frame-local'.  */)
 
   if (EQ (frame, Qnil))
     frame = selected_frame;
-  CHECK_LIVE_FRAME (frame, 0);
+  CHECK_LIVE_FRAME (frame);
   f = XFRAME (frame);
 
   /* I think this should be done with a hook.  */
@@ -2225,7 +2234,7 @@ For a terminal frame, the value is always 1.  */)
 
   if (NILP (frame))
     frame = selected_frame;
-  CHECK_FRAME (frame, 0);
+  CHECK_FRAME (frame);
   f = XFRAME (frame);
 
 #ifdef HAVE_WINDOW_SYSTEM
@@ -2251,7 +2260,7 @@ For a terminal screen, the value is always 1.  */)
 
   if (NILP (frame))
     frame = selected_frame;
-  CHECK_FRAME (frame, 0);
+  CHECK_FRAME (frame);
   f = XFRAME (frame);
 
 #ifdef HAVE_WINDOW_SYSTEM
@@ -2276,7 +2285,7 @@ If FRAME is omitted, the selected frame is used.  */)
 
   if (NILP (frame))
     frame = selected_frame;
-  CHECK_FRAME (frame, 0);
+  CHECK_FRAME (frame);
   f = XFRAME (frame);
 
 #ifdef HAVE_WINDOW_SYSTEM
@@ -2299,7 +2308,7 @@ If FRAME is omitted, the selected frame is used.  */)
 
   if (NILP (frame))
     frame = selected_frame;
-  CHECK_FRAME (frame, 0);
+  CHECK_FRAME (frame);
   f = XFRAME (frame);
 
 #ifdef HAVE_WINDOW_SYSTEM
@@ -2319,10 +2328,10 @@ but that the idea of the actual height of the frame should not be changed.  */)
 {
   register struct frame *f;
 
-  CHECK_NUMBER (lines, 0);
+  CHECK_NUMBER (lines);
   if (NILP (frame))
     frame = selected_frame;
-  CHECK_LIVE_FRAME (frame, 0);
+  CHECK_LIVE_FRAME (frame);
   f = XFRAME (frame);
 
   /* I think this should be done with a hook.  */
@@ -2347,10 +2356,10 @@ but that the idea of the actual width of the frame should not be changed.  */)
      Lisp_Object frame, cols, pretend;
 {
   register struct frame *f;
-  CHECK_NUMBER (cols, 0);
+  CHECK_NUMBER (cols);
   if (NILP (frame))
     frame = selected_frame;
-  CHECK_LIVE_FRAME (frame, 0);
+  CHECK_LIVE_FRAME (frame);
   f = XFRAME (frame);
 
   /* I think this should be done with a hook.  */
@@ -2374,9 +2383,9 @@ DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 3, 0,
 {
   register struct frame *f;
 
-  CHECK_LIVE_FRAME (frame, 0);
-  CHECK_NUMBER (cols, 2);
-  CHECK_NUMBER (rows, 1);
+  CHECK_LIVE_FRAME (frame);
+  CHECK_NUMBER (cols);
+  CHECK_NUMBER (rows);
   f = XFRAME (frame);
 
   /* I think this should be done with a hook.  */
@@ -2406,9 +2415,9 @@ the rightmost or bottommost possible position (that stays within the screen).  *
 {
   register struct frame *f;
 
-  CHECK_LIVE_FRAME (frame, 0);
-  CHECK_NUMBER (xoffset, 1);
-  CHECK_NUMBER (yoffset, 2);
+  CHECK_LIVE_FRAME (frame);
+  CHECK_NUMBER (xoffset);
+  CHECK_NUMBER (yoffset);
   f = XFRAME (frame);
 
   /* I think this should be done with a hook.  */
@@ -2468,6 +2477,12 @@ syms_of_frame ()
   staticpro (&Qdisplay_type);
   Qbackground_mode = intern ("background-mode");
   staticpro (&Qbackground_mode);
+  Qleft_fringe = intern ("left-fringe");
+  staticpro (&Qleft_fringe);
+  Qright_fringe = intern ("right-fringe");
+  staticpro (&Qright_fringe);
+  Qtty_color_mode = intern ("tty-color-mode");
+  staticpro (&Qtty_color_mode);
 
   DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist,
               doc: /* Alist of default values for frame creation.
@@ -2479,7 +2494,8 @@ For values specific to the first Emacs frame, see `initial-frame-alist'.
 For values specific to the separate minibuffer frame, see
  `minibuffer-frame-alist'.
 The `menu-bar-lines' element of the list controls whether new frames
- have menu bars; `menu-bar-mode' works by altering this element.  */);
+ have menu bars; `menu-bar-mode' works by altering this element.
+Setting this variable does not affect existing frames, only new ones.  */);
   Vdefault_frame_alist = Qnil;
 
   Qinhibit_default_face_x_resources
@@ -2501,6 +2517,14 @@ This abnormal hook exists for the benefit of packages like `xt-mouse.el'
 which need to do mouse handling at the Lisp level.  */);
   Vmouse_position_function = Qnil;
 
+  DEFVAR_LISP ("mouse-highlight", &Vmouse_highlight,
+              doc: /* If non-nil, clickable text is highlighted when mouse is over it.  
+If the value is an integer, highlighting is only shown after moving the
+mouse, while keyboard input turns off the highlight even when the mouse
+is over the clickable text.  However, the mouse shape still indicates
+when the mouse is over clickable text.  */);
+  Vmouse_highlight = Qt;
+
   DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,
                 doc: /* Minibufferless frames use this frame's minibuffer.
 
@@ -2564,12 +2588,3 @@ This variable is local to the current terminal and cannot be buffer-local.  */);
   defsubr (&Sset_frame_size);
   defsubr (&Sset_frame_position);
 }
-
-void
-keys_of_frame ()
-{
-  initial_define_lispy_key (global_map, "switch-frame", "handle-switch-frame");
-  initial_define_lispy_key (global_map, "delete-frame", "handle-delete-frame");
-  initial_define_lispy_key (global_map, "iconify-frame", "ignore-event");
-  initial_define_lispy_key (global_map, "make-frame-visible", "ignore-event");
-}