mini_window = make_window ();
XWINDOW (root_window)->next = mini_window;
XWINDOW (mini_window)->prev = root_window;
- XWINDOW (mini_window)->mini_p = Qt;
+ XWINDOW (mini_window)->mini = 1;
XWINDOW (mini_window)->frame = frame;
f->minibuffer_window = mini_window;
}
as nil. */
mini_window = f->minibuffer_window = f->root_window;
- XWINDOW (mini_window)->mini_p = Qt;
+ XWINDOW (mini_window)->mini = 1;
XWINDOW (mini_window)->next = Qnil;
XWINDOW (mini_window)->prev = Qnil;
XWINDOW (mini_window)->frame = frame;
doc: /* Create an additional terminal frame, possibly on another terminal.
This function takes one argument, an alist specifying frame parameters.
-You can create multiple frames on a single text-only terminal, but
-only one of them (the selected terminal frame) is actually displayed.
+You can create multiple frames on a single text terminal, but only one
+of them (the selected terminal frame) is actually displayed.
In practice, generally you don't need to specify any parameters,
except when you want to create a new frame on another terminal.
this function is called. If you are using a window system, the
previously selected frame may be restored as the selected frame
when returning to the command loop, because it still may have
-the window system's input focus. On a text-only terminal, the
-next redisplay will display FRAME.
+the window system's input focus. On a text terminal, the next
+redisplay will display FRAME.
This function returns FRAME, or nil if FRAME has been deleted. */)
(Lisp_Object frame, Lisp_Object norecord)
static int
other_visible_frames (FRAME_PTR f)
{
- /* We know the selected frame is visible,
- so if F is some other frame, it can't be the sole visible one. */
- if (f == SELECTED_FRAME ())
- {
- Lisp_Object frames;
- int count = 0;
+ Lisp_Object frames;
- for (frames = Vframe_list;
- CONSP (frames);
- frames = XCDR (frames))
- {
- Lisp_Object this;
+ for (frames = Vframe_list; CONSP (frames); frames = XCDR (frames))
+ {
+ Lisp_Object this = XCAR (frames);
+ if (f == XFRAME (this))
+ continue;
- this = XCAR (frames);
- /* Verify that the frame's window still exists
- and we can still talk to it. And note any recent change
- in visibility. */
+ /* Verify that we can still talk to the frame's X window,
+ and note any recent change in visibility. */
#ifdef HAVE_WINDOW_SYSTEM
- if (FRAME_WINDOW_P (XFRAME (this)))
- {
- x_sync (XFRAME (this));
- FRAME_SAMPLE_VISIBILITY (XFRAME (this));
- }
+ if (FRAME_WINDOW_P (XFRAME (this)))
+ {
+ x_sync (XFRAME (this));
+ FRAME_SAMPLE_VISIBILITY (XFRAME (this));
+ }
#endif
- if (FRAME_VISIBLE_P (XFRAME (this))
- || FRAME_ICONIFIED_P (XFRAME (this))
- /* Allow deleting the terminal frame when at least
- one X frame exists! */
- || (FRAME_WINDOW_P (XFRAME (this)) && !FRAME_WINDOW_P (f)))
- count++;
- }
- return count > 1;
+ if (FRAME_VISIBLE_P (XFRAME (this))
+ || FRAME_ICONIFIED_P (XFRAME (this))
+ /* Allow deleting the terminal frame when at least one X
+ frame exists. */
+ || (FRAME_WINDOW_P (XFRAME (this)) && !FRAME_WINDOW_P (f)))
+ return 1;
}
- return 1;
+ return 0;
}
/* Delete FRAME. When FORCE equals Qnoelisp, delete FRAME
described for Fdelete_frame. */
Lisp_Object
delete_frame (Lisp_Object frame, Lisp_Object force)
- /* If we use `register' here, gcc-4.0.2 on amd64 using
- -DUSE_LISP_UNION_TYPE complains further down that we're getting the
- address of `force'. Go figure. */
-
{
struct frame *f;
struct frame *sf = SELECTED_FRAME ();
FOR_EACH_FRAME (tail, frame1)
{
if (! EQ (frame, frame1) && FRAME_LIVE_P (XFRAME (frame1)))
- break;
+ {
+ /* Do not change a text terminal's top-frame. */
+ struct frame *f1 = XFRAME (frame1);
+ if (FRAME_TERMCAP_P (f1) || FRAME_MSDOS_P (f1))
+ {
+ Lisp_Object top_frame = FRAME_TTY (f1)->top_frame;
+ if (!EQ (top_frame, frame))
+ frame1 = top_frame;
+ }
+ break;
+ }
}
}
#ifdef NS_IMPL_COCOA
(Lisp_Object frame, Lisp_Object x, Lisp_Object y)
{
CHECK_LIVE_FRAME (frame);
- CHECK_NUMBER (x);
- CHECK_NUMBER (y);
+ CHECK_TYPE_RANGED_INTEGER (int, x);
+ CHECK_TYPE_RANGED_INTEGER (int, y);
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM
(Lisp_Object frame, Lisp_Object x, Lisp_Object y)
{
CHECK_LIVE_FRAME (frame);
- CHECK_NUMBER (x);
- CHECK_NUMBER (y);
+ CHECK_TYPE_RANGED_INTEGER (int, x);
+ CHECK_TYPE_RANGED_INTEGER (int, y);
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM
Normally you may not make FRAME invisible if all other frames are invisible,
but if the second optional argument FORCE is non-nil, you may do so.
-This function has no effect on text-only terminal frames. Such frames
-are always considered visible, whether or not they are currently being
+This function has no effect on text terminal frames. Such frames are
+always considered visible, whether or not they are currently being
displayed in the terminal. */)
(Lisp_Object frame, Lisp_Object force)
{
if (NILP (force) && !other_visible_frames (XFRAME (frame)))
error ("Attempt to make invisible the sole visible or iconified frame");
-#if 0 /* This isn't logically necessary, and it can do GC. */
- /* Don't let the frame remain selected. */
- if (EQ (frame, selected_frame))
- do_switch_frame (next_frame (frame, Qt), 0, 0, Qnil)
-#endif
-
/* Don't allow minibuf_window to remain on a deleted frame. */
if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window))
{
On graphical displays, invisible frames are not updated and are
usually not displayed at all, even in a window system's \"taskbar\".
-If FRAME is a text-only terminal frame, this always returns t.
+If FRAME is a text terminal frame, this always returns t.
Such frames are always considered visible, whether or not they are
currently being displayed on the terminal. */)
(Lisp_Object frame)
f = XFRAME (frame);
if (FRAME_TERMCAP_P (f))
- /* On a text-only terminal select FRAME. */
+ /* On a text terminal select FRAME. */
Fselect_frame (frame, Qnil);
else
/* Do like the documentation says. */
}
static int
-frame_name_fnn_p (char *str, EMACS_INT len)
+frame_name_fnn_p (char *str, ptrdiff_t len)
{
if (len > 1 && str[0] == 'F' && '0' <= str[1] && str[1] <= '9')
{
if (STRINGP (value) && !FRAME_WINDOW_P (f))
{
const char *color_name;
- EMACS_INT csz;
+ ptrdiff_t csz;
if (EQ (parameter, Qbackground_color))
{
#endif
{
- int length = XINT (Flength (alist));
- int i;
- Lisp_Object *parms
- = (Lisp_Object *) alloca (length * sizeof (Lisp_Object));
- Lisp_Object *values
- = (Lisp_Object *) alloca (length * sizeof (Lisp_Object));
+ EMACS_INT length = XFASTINT (Flength (alist));
+ ptrdiff_t i;
+ Lisp_Object *parms;
+ Lisp_Object *values;
+ USE_SAFE_ALLOCA;
+ SAFE_ALLOCA_LISP (parms, 2 * length);
+ values = parms + length;
/* Extract parm names and values into those vectors. */
|| EQ (prop, Qbackground_color))
update_face_from_frame_parameter (f, prop, val);
}
+
+ SAFE_FREE ();
}
return Qnil;
}
In a graphical version with no toolkit, it includes both the tool bar
and menu bar.
-For a text-only terminal, it includes the menu bar. In this case, the
+For a text terminal, it includes the menu bar. In this case, the
result is really in characters rather than pixels (i.e., is identical
to `frame-height'). */)
(Lisp_Object frame)
{
register struct frame *f;
- CHECK_NUMBER (lines);
+ CHECK_TYPE_RANGED_INTEGER (int, lines);
if (NILP (frame))
frame = selected_frame;
CHECK_LIVE_FRAME (frame);
(Lisp_Object frame, Lisp_Object cols, Lisp_Object pretend)
{
register struct frame *f;
- CHECK_NUMBER (cols);
+ CHECK_TYPE_RANGED_INTEGER (int, cols);
if (NILP (frame))
frame = selected_frame;
CHECK_LIVE_FRAME (frame);
register struct frame *f;
CHECK_LIVE_FRAME (frame);
- CHECK_NUMBER (cols);
- CHECK_NUMBER (rows);
+ CHECK_TYPE_RANGED_INTEGER (int, cols);
+ CHECK_TYPE_RANGED_INTEGER (int, rows);
f = XFRAME (frame);
/* I think this should be done with a hook. */
register struct frame *f;
CHECK_LIVE_FRAME (frame);
- CHECK_NUMBER (xoffset);
- CHECK_NUMBER (yoffset);
+ CHECK_TYPE_RANGED_INTEGER (int, xoffset);
+ CHECK_TYPE_RANGED_INTEGER (int, yoffset);
f = XFRAME (frame);
/* I think this should be done with a hook. */
prop = parms[i];
val = values[i];
- if (EQ (prop, Qwidth) && NATNUMP (val))
+ if (EQ (prop, Qwidth) && RANGED_INTEGERP (0, val, INT_MAX))
{
size_changed = 1;
width = XFASTINT (val);
}
- else if (EQ (prop, Qheight) && NATNUMP (val))
+ else if (EQ (prop, Qheight) && RANGED_INTEGERP (0, val, INT_MAX))
{
size_changed = 1;
height = XFASTINT (val);
}
/* Don't die if just one of these was set. */
- if (EQ (left, Qunbound))
+ if (! TYPE_RANGED_INTEGERP (int, left))
{
left_no_change = 1;
if (f->left_pos < 0)
else
XSETINT (left, f->left_pos);
}
- if (EQ (top, Qunbound))
+ if (! TYPE_RANGED_INTEGERP (int, top))
{
top_no_change = 1;
if (f->top_pos < 0)
}
/* If one of the icon positions was not set, preserve or default it. */
- if (EQ (icon_left, Qunbound) || ! INTEGERP (icon_left))
+ if (! TYPE_RANGED_INTEGERP (int, icon_left))
{
icon_left_no_change = 1;
icon_left = Fcdr (Fassq (Qicon_left, f->param_alist));
if (NILP (icon_left))
XSETINT (icon_left, 0);
}
- if (EQ (icon_top, Qunbound) || ! INTEGERP (icon_top))
+ if (! TYPE_RANGED_INTEGERP (int, icon_top))
{
icon_top_no_change = 1;
icon_top = Fcdr (Fassq (Qicon_top, f->param_alist));
{
if (NILP (new_value))
f->extra_line_spacing = 0;
- else if (NATNUMP (new_value))
+ else if (RANGED_INTEGERP (0, new_value, INT_MAX))
f->extra_line_spacing = XFASTINT (new_value);
else
signal_error ("Invalid line-spacing", new_value);
void
x_set_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
- CHECK_NUMBER (arg);
+ CHECK_TYPE_RANGED_INTEGER (int, arg);
if (XINT (arg) == f->border_width)
return;
{
int old = FRAME_INTERNAL_BORDER_WIDTH (f);
- CHECK_NUMBER (arg);
+ CHECK_TYPE_RANGED_INTEGER (int, arg);
FRAME_INTERNAL_BORDER_WIDTH (f) = XINT (arg);
if (FRAME_INTERNAL_BORDER_WIDTH (f) < 0)
FRAME_INTERNAL_BORDER_WIDTH (f) = 0;
f->top_pos = 0;
else
{
- CHECK_NUMBER (tem0);
+ CHECK_TYPE_RANGED_INTEGER (int, tem0);
f->top_pos = XINT (tem0);
if (f->top_pos < 0)
window_prompting |= YNegative;
f->left_pos = 0;
else
{
- CHECK_NUMBER (tem1);
+ CHECK_TYPE_RANGED_INTEGER (int, tem1);
f->left_pos = XINT (tem1);
if (f->left_pos < 0)
window_prompting |= XNegative;