]> code.delx.au - gnu-emacs/blobdiff - src/xfns.c
* keyboard.c (make_lispy_movement): Deal properly with mouse
[gnu-emacs] / src / xfns.c
index 1f4d5751d3074e31e7ccdfe30bc242d1466feb3c..6905a67b6d50c1130cbfbe3a264036e8342b21d3 100644 (file)
@@ -33,11 +33,16 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "buffer.h"
 #include "dispextern.h"
 #include "keyboard.h"
+#include "blockinput.h"
 
 #ifdef HAVE_X_WINDOWS
 extern void abort ();
 
+#ifndef VMS
 #include <X11/bitmaps/gray>
+#else
+#include "[.bitmaps]gray.xbm"
+#endif
 
 #define min(a,b) ((a) < (b) ? (a) : (b))
 #define max(a,b) ((a) > (b) ? (a) : (b))
@@ -51,7 +56,6 @@ static XrmDatabase xrdb;
 
 /* Title name and application name for X stuff. */
 extern char *x_id_name;
-extern Lisp_Object invocation_name;
 
 /* The background and shape of the mouse pointer, and shape when not
    over text or in the modeline. */
@@ -162,23 +166,22 @@ Lisp_Object Qcursor_type;
 Lisp_Object Qfont;
 Lisp_Object Qforeground_color;
 Lisp_Object Qgeometry;
+Lisp_Object Qicon;
 Lisp_Object Qicon_left;
 Lisp_Object Qicon_top;
 Lisp_Object Qicon_type;
-Lisp_Object Qiconic_startup;
 Lisp_Object Qinternal_border_width;
 Lisp_Object Qleft;
 Lisp_Object Qmouse_color;
 Lisp_Object Qnone;
 Lisp_Object Qparent_id;
 Lisp_Object Qsuppress_icon;
-Lisp_Object Qsuppress_initial_map;
 Lisp_Object Qtop;
 Lisp_Object Qundefined_color;
 Lisp_Object Qvertical_scroll_bars;
+Lisp_Object Qvisibility;
 Lisp_Object Qwindow_id;
 Lisp_Object Qx_frame_parameter;
-Lisp_Object Qvisibility;
 
 /* The below are defined in frame.c. */
 extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth;
@@ -195,6 +198,8 @@ struct face *x_face_table[MAX_FACES_AND_GLYPHS];
 /* Return the Emacs frame-object corresponding to an X window.
    It could be the frame's main window or an icon window.  */
 
+/* This function can be called during GC, so use XGCTYPE.  */
+
 struct frame *
 x_window_to_frame (wdesc)
      int wdesc;
@@ -202,10 +207,11 @@ x_window_to_frame (wdesc)
   Lisp_Object tail, frame;
   struct frame *f;
 
-  for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
+  for (tail = Vframe_list; XGCTYPE (tail) == Lisp_Cons;
+       tail = XCONS (tail)->cdr)
     {
       frame = XCONS (tail)->car;
-      if (XTYPE (frame) != Lisp_Frame)
+      if (XGCTYPE (frame) != Lisp_Frame)
         continue;
       f = XFRAME (frame);
       if (FRAME_X_WINDOW (f) == wdesc
@@ -644,6 +650,7 @@ x_set_cursor_color (f, arg, oldval)
       if (f->display.x->cursor_pixel == fore_pixel)
        fore_pixel = f->display.x->background_pixel;
     }
+  f->display.x->cursor_foreground_pixel = fore_pixel;
 
   if (FRAME_X_WINDOW (f) != 0)
     {
@@ -858,10 +865,10 @@ x_set_visibility (f, value, oldval)
 
   if (NILP (value))
     Fmake_frame_invisible (frame);
-  else if (EQ (value, Qt))
-    Fmake_frame_visible (frame);
-  else
+  else if (EQ (value, Qicon))
     Ficonify_frame (frame);
+  else
+    Fmake_frame_visible (frame);
 }
 
 static void
@@ -891,6 +898,13 @@ x_set_menu_bar_lines (f, value, oldval)
   int nlines;
   int olines = FRAME_MENU_BAR_LINES (f);
 
+  /* Right now, menu bars don't work properly in minibuf-only frames;
+     most of the commands try to apply themselves to the minibuffer
+     frame itslef, and get an error because you can't switch buffers
+     in or split the minibuffer window.  */
+  if (FRAME_MINIBUF_ONLY_P (f))
+    return;
+
   if (XTYPE (value) == Lisp_Int)
     nlines = XINT (value);
   else
@@ -1296,7 +1310,7 @@ and the class is `Emacs.CLASS.SUBCLASS'.")
     {
       /* Allocate space for the components, the dots which separate them,
         and the final '\0'.  */
-      name_key = (char *) alloca (XSTRING (invocation_name)->size
+      name_key = (char *) alloca (XSTRING (Vinvocation_name)->size
                                  + XSTRING (attribute)->size
                                  + 2);
       class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1)
@@ -1304,7 +1318,7 @@ and the class is `Emacs.CLASS.SUBCLASS'.")
                                   + 2);
 
       sprintf (name_key, "%s.%s",
-              XSTRING (invocation_name)->data,
+              XSTRING (Vinvocation_name)->data,
               XSTRING (attribute)->data);
       sprintf (class_key, "%s.%s",
               EMACS_CLASS,
@@ -1312,7 +1326,7 @@ and the class is `Emacs.CLASS.SUBCLASS'.")
     }
   else
     {
-      name_key = (char *) alloca (XSTRING (invocation_name)->size
+      name_key = (char *) alloca (XSTRING (Vinvocation_name)->size
                                  + XSTRING (component)->size
                                  + XSTRING (attribute)->size
                                  + 3);
@@ -1323,7 +1337,7 @@ and the class is `Emacs.CLASS.SUBCLASS'.")
                                   + 3);
 
       sprintf (name_key, "%s.%s.%s",
-              XSTRING (invocation_name)->data,
+              XSTRING (Vinvocation_name)->data,
               XSTRING (component)->data,
               XSTRING (attribute)->data);
       sprintf (class_key, "%s.%s",
@@ -1354,13 +1368,13 @@ The defaults are specified in the file `~/.Xdefaults'.")
   CHECK_STRING (arg, 1);
 
   value = (unsigned char *) XGetDefault (XDISPLAY 
-                                        XSTRING (invocation_name)->data,
+                                        XSTRING (Vinvocation_name)->data,
                                         XSTRING (arg)->data);
   if (value == 0)
     /* Try reversing last two args, in case this is the buggy version of X.  */
     value = (unsigned char *) XGetDefault (XDISPLAY
                                           XSTRING (arg)->data,
-                                          XSTRING (invocation_name)->data);
+                                          XSTRING (Vinvocation_name)->data);
   if (value != 0)
     return build_string (value);
   else
@@ -1430,7 +1444,19 @@ x_get_arg (alist, param, attribute, class, type)
              return tem;
 
            case symbol:
-             return intern (tem);
+             /* As a special case, we map the values `true' and `on'
+                to Qt, and `false' and `off' to Qnil.  */
+             {
+               Lisp_Object lower = Fdowncase (tem);
+               if (!strcmp (XSTRING (tem)->data, "on")
+                   || !strcmp (XSTRING (tem)->data, "true"))
+                 return Qt;
+               else if (!strcmp (XSTRING (tem)->data, "off")
+                     || !strcmp (XSTRING (tem)->data, "false"))
+                 return Qnil;
+               else
+                 return Fintern (tem, Qnil);
+             }
 
            default:
              abort ();
@@ -1467,7 +1493,7 @@ x_default_parameter (f, alist, prop, deflt, xprop, xclass, type)
   return tem;
 }
 \f
-DEFUN ("x-geometry", Fx_geometry, Sx_geometry, 1, 1, 0,
+DEFUN ("x-parse-geometry", Fx_parse_geometry, Sx_parse_geometry, 1, 1, 0,
        "Parse an X-style geometry string STRING.\n\
 Returns an alist of the form ((top . TOP), (left . LEFT) ... ).")
      (string)
@@ -1704,12 +1730,10 @@ x_icon (f, parms)
     x_wm_set_icon_position (f, XINT (icon_x), XINT (icon_y));
 
   /* Start up iconic or window? */
-  x_wm_set_window_state (f,
-                        (EQ (x_get_arg (parms, Qiconic_startup,
-                                        0, 0, boolean),
-                             Qt)
-                         ? IconicState
-                         : NormalState));
+  x_wm_set_window_state
+    (f, (EQ (x_get_arg (parms, Qvisibility, 0, 0, symbol), Qicon)
+        ? IconicState
+        : NormalState));
 
   UNBLOCK_INPUT;
 }
@@ -1734,6 +1758,8 @@ x_make_gc (f)
   GC temp_gc;
   XImage tileimage;
 
+  BLOCK_INPUT;
+
   /* Create the GC's of this frame.
      Note that many default values are used. */
 
@@ -1780,6 +1806,10 @@ x_make_gc (f)
        f->display.x->foreground_pixel,
        f->display.x->background_pixel,
        DefaultDepth (x_current_display, XDefaultScreen (x_current_display))));
+
+  init_frame_faces (f);
+
+  UNBLOCK_INPUT;
 }
 #endif /* HAVE_X11 */
 
@@ -1851,7 +1881,12 @@ be shared by the new frame.")
 
   /* Extract the window parameters from the supplied values
      that are needed to determine window geometry.  */
-  x_default_parameter (f, parms, Qfont, build_string ("9x15"),
+  x_default_parameter (f, parms, Qfont, 
+                      build_string
+                      /* If we use an XLFD name for this font, the lisp code
+                         knows how to find variants which are bold, italic,
+                         etcetera.  */
+                      ("-*-fixed-*-*-*-*-*-120-*-*-c-*-iso8859-1"),
                       "font", "Font", string);
   x_default_parameter (f, parms, Qborder_width, make_number (2),
                       "borderwidth", "BorderWidth", number);
@@ -1912,16 +1947,20 @@ be shared by the new frame.")
 
   /* Make the window appear on the frame and enable display,
      unless the caller says not to.  */
-  if (!EQ (x_get_arg (parms, Qsuppress_initial_map, 0, 0, boolean), Qt))
-    {
-      tem = x_get_arg (parms, Qvisibility, 0, 0, boolean);
-      if (EQ (tem, Qicon))
-       x_iconify_frame (f);
-      /* Note that the default is Qunbound,
-        so by default we do make visible.  */
-      else if (!EQ (tem, Qnil))
-       x_make_frame_visible (f);
-    }
+  {
+    Lisp_Object visibility = x_get_arg (parms, Qvisibility, 0, 0, symbol);
+
+    if (EQ (visibility, Qunbound))
+      visibility = Qt;
+
+    if (EQ (visibility, Qicon))
+      x_iconify_frame (f);
+    else if (! NILP (visibility))
+      x_make_frame_visible (f);
+    else
+      /* Must have been Qnil.  */
+      ;
+  }
 
   return frame;
 #else /* X10 */
@@ -2018,7 +2057,7 @@ be shared by the new frame.")
       BLOCK_INPUT;
       XGetWindowInfo (FRAME_X_WINDOW (f), &wininfo);
       XQueryTree (FRAME_X_WINDOW (f), &parent, &nchildren, &children);
-      free (children);
+      xfree (children);
       UNBLOCK_INPUT;
 
       height = PIXEL_TO_CHAR_HEIGHT (f, wininfo.height);
@@ -2148,9 +2187,17 @@ be shared by the new frame.")
   Fmodify_frame_parameters (frame, parms);
 
   /* Make the window appear on the frame and enable display.  */
+  {
+    Lisp_Object visibility = x_get_arg (parms, Qvisibility, 0, 0, symbol);
+
+    if (EQ (visibility, Qunbound))
+      visibility = Qt;
+
+    if (! EQ (visibility, Qicon)
+       && ! NILP (visibility))
+      x_make_window_visible (f);
+  }
 
-  if (!EQ (x_get_arg (parms, Qsuppress_initial_map, 0, 0, boolean), Qt))
-    x_make_window_visible (f);
   SET_FRAME_GARBAGED (f);
 
   return frame;
@@ -2259,7 +2306,7 @@ x_rubber_band (f, x, y, width, height, geo, str, hscroll, vscroll)
       *x -= wininfo.x;
       *y -= wininfo.y;
       XQueryTree (tempwindow, &tempwindow, &nchildren, &children);
-      free (children);
+      xfree (children);
     }
 
   UNBLOCK_INPUT;
@@ -2267,7 +2314,7 @@ x_rubber_band (f, x, y, width, height, geo, str, hscroll, vscroll)
 }
 #endif /* not HAVE_X11 */
 \f
-DEFUN ("x-defined-color", Fx_defined_color, Sx_defined_color, 1, 1, 0,
+DEFUN ("x-color-defined-p", Fx_color_defined_p, Sx_color_defined_p, 1, 1, 0,
   "Return t if the current X display supports the color named COLOR.")
   (color)
      Lisp_Object color;
@@ -3272,212 +3319,6 @@ x_draw_pixmap (f, x, y, image_data, width, height)
              f->display.x->normal_gc, 0, 0, width, height, x, y);
 }
 #endif
-\f
-#if 0
-
-#ifdef HAVE_X11
-#define XMouseEvent XEvent
-#define WhichMouseButton xbutton.button
-#define MouseWindow xbutton.window
-#define MouseX xbutton.x
-#define MouseY xbutton.y
-#define MouseTime xbutton.time
-#define ButtonReleased ButtonRelease
-#define ButtonPressed ButtonPress
-#else
-#define XMouseEvent XButtonEvent
-#define WhichMouseButton detail
-#define MouseWindow window
-#define MouseX x
-#define MouseY y
-#define MouseTime time
-#endif /* X11 */
-
-DEFUN ("x-mouse-events", Fx_mouse_events, Sx_mouse_events, 0, 0, 0,
-  "Return number of pending mouse events from X window system.")
-  ()
-{
-  return make_number (queue_event_count (&x_mouse_queue));
-}
-
-/* Encode the mouse button events in the form expected by the
-   mouse code in Lisp.  For X11, this means moving the masks around. */
-
-static int
-encode_mouse_button (mouse_event)
-     XMouseEvent mouse_event;
-{
-  register int event_code;
-  register char key_mask;
-
-  event_code = mouse_event.detail & 3;
-  key_mask = (mouse_event.detail >> 8) & 0xf0;
-  event_code |= key_mask >> 1;
-  if (mouse_event.type == ButtonReleased) event_code |= 0x04;
-  return event_code;
-}
-
-DEFUN ("x-get-mouse-event", Fx_get_mouse_event, Sx_get_mouse_event,
-  0, 1, 0,
-  "Get next mouse event out of mouse event buffer.\n\
-Optional ARG non-nil means return nil immediately if no pending event;\n\
-otherwise, wait for an event.  Returns a four-part list:\n\
-  ((X-POS Y-POS) WINDOW FRAME-PART KEYSEQ TIMESTAMP).\n\
-Normally X-POS and Y-POS are the position of the click on the frame\n\
- (measured in characters and lines), and WINDOW is the window clicked in.\n\
-KEYSEQ is a string, the key sequence to be looked up in the mouse maps.\n\
-If FRAME-PART is non-nil, the event was on a scroll bar;\n\
-then Y-POS is really the total length of the scroll bar, while X-POS is\n\
-the relative position of the scroll bar's value within that total length,\n\
-and a third element OFFSET appears in that list: the height of the thumb-up\n\
-area at the top of the scroll bar.\n\
-FRAME-PART is one of the following symbols:\n\
- `vertical-scroll-bar', `vertical-thumbup', `vertical-thumbdown',\n\
- `horizontal-scroll-bar', `horizontal-thumbleft', `horizontal-thumbright'.\n\
-TIMESTAMP is the lower 23 bits of the X-server's timestamp for\n\
-the mouse event.")
-  (arg)
-     Lisp_Object arg;
-{
-  XMouseEvent xrep;
-  register int com_letter;
-  register Lisp_Object tempx;
-  register Lisp_Object tempy;
-  Lisp_Object part, pos, timestamp;
-  int prefix;
-  struct frame *f;
-  
-  int tem;
-  
-  while (1)
-    {
-      BLOCK_INPUT;
-      tem = dequeue_event (&xrep, &x_mouse_queue);
-      UNBLOCK_INPUT;
-      
-      if (tem)
-       {
-         switch (xrep.type)
-           {
-           case ButtonPressed:
-           case ButtonReleased:
-
-             com_letter = encode_mouse_button (xrep);
-             mouse_timestamp = xrep.MouseTime;
-
-             if ((f = x_window_to_frame (xrep.MouseWindow)) != 0)
-               {
-                 Lisp_Object frame;
-                 
-                 if (f->display.x->icon_desc == xrep.MouseWindow)
-                   {
-                     x_make_frame_visible (f);
-                     continue;
-                   }
-
-                 XSET (tempx, Lisp_Int,
-                       min (f->width-1, max (0, (xrep.MouseX - f->display.x->internal_border_width)/FONT_WIDTH (f->display.x->font))));
-                 XSET (tempy, Lisp_Int,
-                       min (f->height-1, max (0, (xrep.MouseY - f->display.x->internal_border_width)/FONT_HEIGHT (f->display.x->font))));
-                 XSET (timestamp, Lisp_Int, (xrep.MouseTime & 0x7fffff));
-                 XSET (frame, Lisp_Frame, f);
-                 
-                 pos = Fcons (tempx, Fcons (tempy, Qnil));
-                 Vmouse_window
-                   = Flocate_window_from_coordinates (frame, pos);
-                 
-                 Vmouse_event
-                   = Fcons (pos,
-                            Fcons (Vmouse_window,
-                                   Fcons (Qnil,
-                                          Fcons (Fchar_to_string (make_number (com_letter)),
-                                                 Fcons (timestamp, Qnil)))));
-                 return Vmouse_event;
-               }
-             else if ((f = x_window_to_scroll_bar (xrep.MouseWindow, &part, &prefix)) != 0)
-               {
-                 int pos, len;
-                 Lisp_Object keyseq;
-                 char *partname;
-                 
-                 keyseq = concat2 (Fchar_to_string (make_number (prefix)),
-                                   Fchar_to_string (make_number (com_letter)));
-                 
-                 pos = xrep.MouseY - (f->display.x->v_scroll_bar_width - 2);
-                 XSET (tempx, Lisp_Int, pos);
-                 len = ((FONT_HEIGHT (f->display.x->font) * f->height)
-                        + f->display.x->internal_border_width
-                        - (2 * (f->display.x->v_scroll_bar_width - 2)));
-                 XSET (tempy, Lisp_Int, len);
-                 XSET (timestamp, Lisp_Int, (xrep.MouseTime & 0x7fffff));
-                 Vmouse_window = f->selected_window;
-                 Vmouse_event
-                   = Fcons (Fcons (tempx, Fcons (tempy, 
-                                                 Fcons (make_number (f->display.x->v_scroll_bar_width - 2),
-                                                        Qnil))),
-                            Fcons (Vmouse_window,
-                                   Fcons (intern (part),
-                                          Fcons (keyseq, Fcons (timestamp,
-                                                                Qnil)))));
-                 return Vmouse_event;
-               }
-             else
-               continue;
-
-#ifdef HAVE_X11
-           case MotionNotify:
-
-             com_letter = x11_encode_mouse_button (xrep);
-             if ((f = x_window_to_frame (xrep.MouseWindow)) != 0)
-               {
-                 Lisp_Object frame;
-                 
-                 XSET (tempx, Lisp_Int,
-                       min (f->width-1,
-                            max (0, (xrep.MouseX - f->display.x->internal_border_width)
-                                 / FONT_WIDTH (f->display.x->font))));
-                 XSET (tempy, Lisp_Int,
-                       min (f->height-1,
-                            max (0, (xrep.MouseY - f->display.x->internal_border_width)
-                                 / FONT_HEIGHT (f->display.x->font))));
-                                 
-                 XSET (frame, Lisp_Frame, f);
-                 XSET (timestamp, Lisp_Int, (xrep.MouseTime & 0x7fffff));
-                 
-                 pos = Fcons (tempx, Fcons (tempy, Qnil));
-                 Vmouse_window
-                   = Flocate_window_from_coordinates (frame, pos);
-                 
-                 Vmouse_event
-                   = Fcons (pos,
-                            Fcons (Vmouse_window,
-                                   Fcons (Qnil,
-                                          Fcons (Fchar_to_string (make_number (com_letter)),
-                                                 Fcons (timestamp, Qnil)))));
-                 return Vmouse_event;
-               }
-
-             break;
-#endif /* HAVE_X11 */
-
-           default:
-             if (f = x_window_to_frame (xrep.MouseWindow))
-               Vmouse_window = f->selected_window;
-             else if (f = x_window_to_scroll_bar (xrep.MouseWindow, &part, &prefix))
-               Vmouse_window = f->selected_window;
-             return Vmouse_event = Qnil;
-           }
-       }
-      
-      if (!NILP (arg))
-       return Qnil;
-
-      /* Wait till we get another mouse event.  */
-      wait_reading_process_input (0, 0, 2, 0);
-    }
-}
-#endif
-
 \f
 #ifndef HAVE_X11
 DEFUN ("x-store-cut-buffer", Fx_store_cut_buffer, Sx_store_cut_buffer,
@@ -3701,7 +3542,7 @@ select_visual (screen, depth)
 #ifdef HAVE_X11R4
   vinfo_template.visualid = XVisualIDFromVisual (v);
 #else
-  vinfo_template.visualid = x->visualid;
+  vinfo_template.visualid = v->visualid;
 #endif
 
   vinfo = XGetVisualInfo (x_current_display, VisualIDMask, &vinfo_template,
@@ -3757,7 +3598,11 @@ arg XRM_STRING is a string of resources in xrdb format.")
   else
     xrm_option = (unsigned char *) 0;
   xrdb = x_load_resources (x_current_display, xrm_option, EMACS_CLASS);
+#ifdef HAVE_X11R5
+  XrmSetDatabase (x_current_display, xrdb);
+#else
   x_current_display->db = xrdb;
+#endif
 
   x_screen = DefaultScreenOfDisplay (x_current_display);
 
@@ -3858,14 +3703,14 @@ syms_of_xfns ()
   staticpro (&Qforeground_color);
   Qgeometry = intern ("geometry");
   staticpro (&Qgeometry);
+  Qicon = intern ("icon");
+  staticpro (&Qicon);
   Qicon_left = intern ("icon-left");
   staticpro (&Qicon_left);
   Qicon_top = intern ("icon-top");
   staticpro (&Qicon_top);
   Qicon_type = intern ("icon-type");
   staticpro (&Qicon_type);
-  Qiconic_startup = intern ("iconic-startup");
-  staticpro (&Qiconic_startup);
   Qinternal_border_width = intern ("internal-border-width");
   staticpro (&Qinternal_border_width);
   Qleft = intern ("left");
@@ -3878,21 +3723,19 @@ syms_of_xfns ()
   staticpro (&Qparent_id);
   Qsuppress_icon = intern ("suppress-icon");
   staticpro (&Qsuppress_icon);
-  Qsuppress_initial_map = intern ("suppress-initial-map");
-  staticpro (&Qsuppress_initial_map);
   Qtop = intern ("top");
   staticpro (&Qtop);
   Qundefined_color = intern ("undefined-color");
   staticpro (&Qundefined_color);
   Qvertical_scroll_bars = intern ("vertical-scroll-bars");
   staticpro (&Qvertical_scroll_bars);
+  Qvisibility = intern ("visibility");
+  staticpro (&Qvisibility);
   Qwindow_id = intern ("window-id");
   staticpro (&Qwindow_id);
   Qx_frame_parameter = intern ("x-frame-parameter");
   staticpro (&Qx_frame_parameter);
   /* This is the end of symbol initialization.  */
-  Qvisibility = intern ("visibility");
-  staticpro (&Qvisibility);
 
   Fput (Qundefined_color, Qerror_conditions,
        Fcons (Qundefined_color, Fcons (Qerror, Qnil)));
@@ -3906,15 +3749,21 @@ syms_of_xfns ()
   mouse_buffer_offset = 0;
 
   DEFVAR_INT ("x-pointer-shape", &Vx_pointer_shape,
-             "The shape of the pointer when over text.");
+             "The shape of the pointer when over text.\n\
+Changing the value does not affect existing frames\n\
+unless you set the mouse color.");
   Vx_pointer_shape = Qnil;
 
+#if 0
   DEFVAR_INT ("x-nontext-pointer-shape", &Vx_nontext_pointer_shape,
              "The shape of the pointer when not over text.");
+#endif
   Vx_nontext_pointer_shape = Qnil;
 
+#if 0
   DEFVAR_INT ("x-mode-pointer-shape", &Vx_mode_pointer_shape,
              "The shape of the pointer when over the mode line.");
+#endif
   Vx_mode_pointer_shape = Qnil;
 
   DEFVAR_LISP ("x-cursor-fore-pixel", &Vx_cursor_fore_pixel,
@@ -3937,7 +3786,7 @@ syms_of_xfns ()
   defsubr (&Sx_uncontour_region);
 #endif
   defsubr (&Sx_display_color_p);
-  defsubr (&Sx_defined_color);
+  defsubr (&Sx_color_defined_p);
   defsubr (&Sx_server_vendor);
   defsubr (&Sx_server_version);
   defsubr (&Sx_display_pixel_width);
@@ -3961,7 +3810,7 @@ syms_of_xfns ()
   defsubr (&Sx_get_cut_buffer);
   defsubr (&Sx_set_face);
 #endif
-  defsubr (&Sx_geometry);
+  defsubr (&Sx_parse_geometry);
   defsubr (&Sx_create_frame);
   defsubr (&Sfocus_frame);
   defsubr (&Sunfocus_frame);
@@ -3973,13 +3822,6 @@ syms_of_xfns ()
   defsubr (&Sx_open_connection);
   defsubr (&Sx_close_current_connection);
   defsubr (&Sx_synchronize);
-
-  /* This was used in the old event interface which used a separate
-     event queue.*/
-#if 0
-  defsubr (&Sx_mouse_events);
-  defsubr (&Sx_get_mouse_event);
-#endif
 }
 
 #endif /* HAVE_X_WINDOWS */