]> code.delx.au - gnu-emacs/blobdiff - src/frame.c
(Fwhile): If mocklisp, test for nonzeroness.
[gnu-emacs] / src / frame.c
index 00cb7cdf06f0229a8075b8815e36488035e9728f..e706283a0b243d4bd7b05893b26f64fb4c6f4ef7 100644 (file)
@@ -326,7 +326,7 @@ make_terminal_frame ()
 \f
 DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 2, "e",
   "Select the frame FRAME.\n\
-Subseqent editing commands apply to its selected window.\n\
+Subsequent editing commands apply to its selected window.\n\
 The selection of FRAME lasts until the next time the user does\n\
 something to select a different frame, or until the next time this\n\
 function is called.")
@@ -394,7 +394,7 @@ to that frame.")
   choose_minibuf_frame ();
 
   /* We want to make sure that the next event generates a frame-switch
-     event to the appropriate frame.  This seems kludgey to me, but
+     event to the appropriate frame.  This seems kludgy to me, but
      before you take it out, make sure that evaluating something like
      (select-window (frame-root-window (new-frame))) doesn't end up
      with your typing being interpreted in the new frame instead of
@@ -743,6 +743,8 @@ A frame may not be deleted if its minibuffer is used by other frames.")
 
 DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0,
   "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\
+The position is given in character cells, where (0, 0) is the\n\
+upper-left corner.\n\
 If Emacs is running on a mouseless terminal or hasn't been programmed\n\
 to read the mouse position, it returns the selected frame for FRAME\n\
 and nil for X and Y.")
@@ -754,23 +756,22 @@ and nil for X and Y.")
   Lisp_Object x, y;
   unsigned long long_dummy;
 
+  f = selected_frame;
+  x = y = Qnil;
+
+  /* It's okay for the hook to refrain from storing anything.  */
   if (mouse_position_hook)
     (*mouse_position_hook) (&f,
                            &lispy_dummy, &party_dummy,
                            &x, &y,
                            &long_dummy);
-  else
-    {
-      f = selected_frame;
-      x = y = Qnil;
-    }
 
   XSET (lispy_dummy, Lisp_Frame, f);
-  return Fcons (lispy_dummy, Fcons (make_number (x), make_number (y)));
+  return Fcons (lispy_dummy, Fcons (x, y));
 }
 
 DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0,
-  "Move the mouse pointer to the center of cell (X,Y) in FRAME.\n\
+  "Move the mouse pointer to the center of character cell (X,Y) in FRAME.\n\
 WARNING:  If you use this under X, you should do `unfocus-frame' afterwards.")
   (frame, x, y)
      Lisp_Object frame, x, y;
@@ -790,7 +791,7 @@ WARNING:  If you use this under X, you should do `unfocus-frame' afterwards.")
 }
 \f
 DEFUN ("make-frame-visible", Fmake_frame_visible, Smake_frame_visible,
-       0, 1, 0,
+       0, 1, "",
   "Make the frame FRAME visible (assuming it is an X-window).\n\
 Also raises the frame so that nothing obscures it.\n\
 If omitted, FRAME defaults to the currently selected frame.")
@@ -979,7 +980,10 @@ The redirection lasts until `redirect-frame-focus' is called to change it.")
   (frame, focus_frame)
     Lisp_Object frame, focus_frame;
 {
-  CHECK_LIVE_FRAME (frame, 0);
+  /* 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);
 
   if (! NILP (focus_frame))
     CHECK_LIVE_FRAME (focus_frame, 1);
@@ -1061,7 +1065,7 @@ store_frame_param (f, prop, val)
        error ("Surrogate minibuffer windows must be minibuffer windows.");
 
       if (FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f))
-       error ("Can't change the surrogate minibuffer of a frame with its own minibuffer.");
+       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;
@@ -1207,8 +1211,8 @@ For a terminal screen, the value is always 1.")
 
 DEFUN ("frame-pixel-height", Fframe_pixel_height, 
        Sframe_pixel_height, 0, 1, 0,
-  "Return a FRAME's heightin pixels.\n\
-For a terminal frame, the result really gives the sizes in characters.\n\
+  "Return a FRAME's height in pixels.\n\
+For a terminal frame, the result really gives the height in characters.\n\
 If FRAME is omitted, the selected frame is used.")
   (frame)
      Lisp_Object frame;
@@ -1234,7 +1238,7 @@ If FRAME is omitted, the selected frame is used.")
 DEFUN ("frame-pixel-width", Fframe_pixel_width, 
        Sframe_pixel_width, 0, 1, 0,
   "Return FRAME's width in pixels.\n\
-For a terminal frame, the result really gives the sizes in characters.\n\
+For a terminal frame, the result really gives the width in characters.\n\
 If FRAME is omitted, the selected frame is used.")
   (frame)
      Lisp_Object frame;
@@ -1371,46 +1375,6 @@ off the screen.")
   return Qt;
 }
 
-\f
-#ifndef HAVE_X11
-DEFUN ("rubber-band-rectangle", Frubber_band_rectangle, Srubber_band_rectangle,
-       3, 3, "",
-  "Ask user to specify a window position and size on FRAME with the mouse.\n\
-Arguments are FRAME, NAME and GEO.  NAME is a name to be displayed as\n\
-the purpose of this rectangle.  GEO is an X-windows size spec that can\n\
-specify defaults for some sizes/positions.  If GEO specifies everything,\n\
-the mouse is not used.\n\
-Returns a list of five values: (FRAME LEFT TOP WIDTH HEIGHT).")
-  (frame, name, geo)
-     Lisp_Object frame;
-     Lisp_Object name;
-     Lisp_Object geo;
-{
-  int vals[4];
-  Lisp_Object nums[4];
-  int i;
-
-  CHECK_FRAME (frame, 0);
-  CHECK_STRING (name, 1);
-  CHECK_STRING (geo, 2);
-
-  switch (XFRAME (frame)->output_method)
-    {
-    case output_x_window:
-      x_rubber_band (XFRAME (frame), &vals[0], &vals[1], &vals[2], &vals[3],
-                    XSTRING (geo)->data, XSTRING (name)->data);
-      break;
-
-    default:
-      return Qnil;
-    }
-
-  for (i = 0; i < 4; i++)
-    XFASTINT (nums[i]) = vals[i];
-  return Fcons (frame, Flist (4, nums));
-  return Qnil;
-}
-#endif /* not HAVE_X11 */
 \f
 choose_minibuf_frame ()
 {
@@ -1530,9 +1494,6 @@ For values specific to the separate minibuffer frame, see\n\
   defsubr (&Sset_frame_width);
   defsubr (&Sset_frame_size);
   defsubr (&Sset_frame_position);
-#ifndef HAVE_X11
-  defsubr (&Srubber_band_rectangle);
-#endif /* HAVE_X11 */
 }
 
 keys_of_frame ()