/* Generic frame functions.
- Copyright (C) 1993, 1994, 1995, 1997, 1999 Free Software Foundation.
+ Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000 Free Software Foundation.
This file is part of GNU Emacs.
#ifdef HAVE_X_WINDOWS
#include "xterm.h"
#endif
+#ifdef WINDOWSNT
+#include "w32term.h"
+#endif
+#ifdef macintosh
+#include "macterm.h"
+#endif
+#include "buffer.h"
+/* These help us bind and responding to switch-frame events. */
+#include "commands.h"
+#include "keyboard.h"
#include "frame.h"
#ifdef HAVE_WINDOW_SYSTEM
#include "fontset.h"
#include "dosfns.h"
#endif
-#ifdef macintosh
-extern struct mac_output *NewMacWindow ();
-extern void DisposeMacWindow (struct mac_output *);
-#endif
-
-/* Evaluate this expression to rebuild the section of syms_of_frame
- that initializes and staticpros the symbols declared below. Note
- that Emacs 18 has a bug that keeps C-x C-e from being able to
- evaluate this expression.
-
-(progn
- ;; Accumulate a list of the symbols we want to initialize from the
- ;; declarations at the top of the file.
- (goto-char (point-min))
- (search-forward "/\*&&& symbols declared here &&&*\/\n")
- (let (symbol-list)
- (while (looking-at "Lisp_Object \\(Q[a-z_]+\\)")
- (setq symbol-list
- (cons (buffer-substring (match-beginning 1) (match-end 1))
- symbol-list))
- (forward-line 1))
- (setq symbol-list (nreverse symbol-list))
- ;; Delete the section of syms_of_... where we initialize the symbols.
- (search-forward "\n /\*&&& init symbols here &&&*\/\n")
- (let ((start (point)))
- (while (looking-at "^ Q")
- (forward-line 2))
- (kill-region start (point)))
- ;; Write a new symbol initialization section.
- (while symbol-list
- (insert (format " %s = intern (\"" (car symbol-list)))
- (let ((start (point)))
- (insert (substring (car symbol-list) 1))
- (subst-char-in-region start (point) ?_ ?-))
- (insert (format "\");\n staticpro (&%s);\n" (car symbol-list)))
- (setq symbol-list (cdr symbol-list)))))
- */
-
-/*&&& symbols declared here &&&*/
Lisp_Object Qframep;
Lisp_Object Qframe_live_p;
Lisp_Object Qheight;
Lisp_Object Qbuffer_predicate;
Lisp_Object Qbuffer_list;
Lisp_Object Qtitle;
+Lisp_Object Qdisplay_type;
+Lisp_Object Qbackground_mode;
+Lisp_Object Qinhibit_default_face_x_resources;
Lisp_Object Vterminal_frame;
Lisp_Object Vdefault_frame_alist;
-
-static void
-syms_of_frame_1 ()
-{
- /*&&& init symbols here &&&*/
- Qframep = intern ("framep");
- staticpro (&Qframep);
- Qframe_live_p = intern ("frame-live-p");
- staticpro (&Qframe_live_p);
- Qheight = intern ("height");
- staticpro (&Qheight);
- Qicon = intern ("icon");
- staticpro (&Qicon);
- Qminibuffer = intern ("minibuffer");
- staticpro (&Qminibuffer);
- Qmodeline = intern ("modeline");
- staticpro (&Qmodeline);
- Qname = intern ("name");
- staticpro (&Qname);
- Qonly = intern ("only");
- staticpro (&Qonly);
- Qunsplittable = intern ("unsplittable");
- staticpro (&Qunsplittable);
- Qmenu_bar_lines = intern ("menu-bar-lines");
- staticpro (&Qmenu_bar_lines);
- Qtool_bar_lines = intern ("tool-bar-lines");
- staticpro (&Qtool_bar_lines);
- Qwidth = intern ("width");
- staticpro (&Qwidth);
- Qx = intern ("x");
- staticpro (&Qx);
- Qw32 = intern ("w32");
- staticpro (&Qw32);
- Qpc = intern ("pc");
- staticpro (&Qpc);
- Qmac = intern ("mac");
- staticpro (&Qmac);
- Qvisible = intern ("visible");
- staticpro (&Qvisible);
- Qbuffer_predicate = intern ("buffer-predicate");
- staticpro (&Qbuffer_predicate);
- Qbuffer_list = intern ("buffer-list");
- staticpro (&Qbuffer_list);
- Qtitle = intern ("title");
- staticpro (&Qtitle);
-
- DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist,
- "Alist of default values for frame creation.\n\
-These may be set in your init file, like this:\n\
- (setq default-frame-alist '((width . 80) (height . 55) (menu-bar-lines . 1))\n\
-These override values given in window system configuration data,\n\
- including X Windows' defaults database.\n\
-For values specific to the first Emacs frame, see `initial-frame-alist'.\n\
-For values specific to the separate minibuffer frame, see\n\
- `minibuffer-frame-alist'.\n\
-The `menu-bar-lines' element of the list controls whether new frames\n\
- have menu bars; `menu-bar-mode' works by altering this element.");
- Vdefault_frame_alist = Qnil;
-}
+Lisp_Object Vmouse_position_function;
\f
static void
set_menu_bar_lines_1 (window, n)
XSETFASTINT (w->last_modified, 0);
XSETFASTINT (w->top, XFASTINT (w->top) + n);
XSETFASTINT (w->height, XFASTINT (w->height) - n);
+
+ if (INTEGERP (w->orig_top))
+ XSETFASTINT (w->orig_top, XFASTINT (w->orig_top) + n);
+ if (INTEGERP (w->orig_height))
+ XSETFASTINT (w->orig_height, XFASTINT (w->orig_height) - n);
/* Handle just the top child in a vertical split. */
if (!NILP (w->vchild))
}
}
\f
-#include "buffer.h"
-
-/* These help us bind and responding to switch-frame events. */
-#include "commands.h"
-#include "keyboard.h"
-
Lisp_Object Vemacs_iconified;
Lisp_Object Vframe_list;
+struct x_output tty_display;
+
extern Lisp_Object Vminibuffer_list;
extern Lisp_Object get_minibuffer ();
extern Lisp_Object Fhandle_switch_frame ();
"Return non-nil if OBJECT is a frame.\n\
Value is t for a termcap frame (a character-only terminal),\n\
`x' for an Emacs frame that is really an X window,\n\
+`w32' for an Emacs frame that is a window on MS-Windows display,\n\
+`mac' for an Emacs frame on a Macintosh display,\n\
`pc' for a direct-write MS-DOS frame.\n\
See also `frame-live-p'.")
(object)
f->auto_raise = 0;
f->auto_lower = 0;
f->no_split = 0;
- f->garbaged = 0;
+ f->garbaged = 1;
f->has_minibuffer = mini_p;
f->focus_frame = Qnil;
f->explicit_name = 0;
f->title = Qnil;
f->menu_bar_window = Qnil;
f->tool_bar_window = Qnil;
- f->desired_tool_bar_items = f->current_tool_bar_items = Qnil;
+ f->tool_bar_items = Qnil;
f->desired_tool_bar_string = f->current_tool_bar_string = Qnil;
- f->n_desired_tool_bar_items = f->n_current_tool_bar_items = 0;
+ f->n_tool_bar_items = 0;
root_window = make_window ();
if (mini_p)
a newly-created, never-selected window. */
XSETFASTINT (XWINDOW (f->selected_window)->use_time, ++window_select_count);
-#ifdef HAVE_WINDOW_SYSTEM
- f->fontset_data = alloc_fontset_data ();
-#endif
-
return f;
}
\f
f->async_visible = 1; /* Don't let visible be cleared later. */
#ifdef MSDOS
f->output_data.x = &the_only_x_display;
- f->output_method = output_msdos_raw;
-#endif /* MSDOS */
-
+ if (!inhibit_window_system
+ && (!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame))
+ || XFRAME (selected_frame)->output_method == output_msdos_raw))
+ {
+ f->output_method = output_msdos_raw;
+ /* This initialization of foreground and background pixels is
+ only important for the initial frame created in temacs. If
+ we don't do that, we get black background and foreground in
+ the dumped Emacs because the_only_x_display is a static
+ variable, hence it is born all-zeroes, and zero is the code
+ for the black color. Other frames all inherit their pixels
+ from what's already in the_only_x_display. */
+ if ((!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame)))
+ && f->output_data.x->background_pixel == 0
+ && f->output_data.x->foreground_pixel == 0)
+ {
+ f->output_data.x->background_pixel = FACE_TTY_DEFAULT_BG_COLOR;
+ f->output_data.x->foreground_pixel = FACE_TTY_DEFAULT_FG_COLOR;
+ }
+ }
+ else
+ f->output_method = output_termcap;
+#else
+#ifdef WINDOWSNT
+ f->output_method = output_termcap;
+ f->output_data.x = &tty_display;
+#else
#ifdef macintosh
- f->output_data.mac = NewMacWindow(f);
- f->output_data.mac->background_pixel = 0xffffff;
- f->output_data.mac->foreground_pixel = 0;
- f->output_data.mac->n_param_faces = 0;
- f->output_data.mac->n_computed_faces = 0;
- f->output_data.mac->size_computed_faces = 0;
- f->output_method = output_mac;
- f->auto_raise = 1;
- f->auto_lower = 1;
- init_frame_faces (f);
+ make_mac_terminal_frame (f);
+#else
+ f->output_data.x = &tty_display;
#endif /* macintosh */
-
-#ifndef MSDOS
-#ifndef macintosh
- f->output_data.nothing = 1; /* Nonzero means frame isn't deleted. */
-#endif
-#endif
+#endif /* WINDOWSNT */
+#endif /* MSDOS */
if (!noninteractive)
init_frame_faces (f);
+
return f;
}
struct frame *sf = SELECTED_FRAME ();
#ifdef MSDOS
- if (sf->output_method != output_msdos_raw)
+ if (sf->output_method != output_msdos_raw
+ && sf->output_method != output_termcap)
abort ();
#else /* not MSDOS */
#endif /* HAVE_X_WINDOWS */
#endif /* ! 0 */
+ if (FRAME_HAS_MINIBUF_P (sf))
+ resize_mini_window (XWINDOW (FRAME_MINIBUF_WINDOW (sf)), 1);
+
selected_frame = frame;
if (! FRAME_MINIBUF_ONLY_P (XFRAME (selected_frame)))
last_nonminibuf_frame = XFRAME (selected_frame);
if (FRAME_VISIBLE_P (XFRAME (f)))
return f;
}
- else if (XFASTINT (minibuf) == 0)
+ else if (INTEGERP (minibuf) && XINT (minibuf) == 0)
{
FRAME_SAMPLE_VISIBILITY (XFRAME (f));
if (FRAME_VISIBLE_P (XFRAME (f))
else if (WINDOWP (minibuf))
{
if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf)
- /* Check that F either is, or has forwarded its focus to,
- MINIBUF's frame. */
- && (EQ (WINDOW_FRAME (XWINDOW (minibuf)), f)
- || EQ (WINDOW_FRAME (XWINDOW (minibuf)),
- FRAME_FOCUS_FRAME (XFRAME (f)))))
+ || EQ (WINDOW_FRAME (XWINDOW (minibuf)), f)
+ || EQ (WINDOW_FRAME (XWINDOW (minibuf)),
+ FRAME_FOCUS_FRAME (XFRAME (f))))
return f;
}
else
else if (WINDOWP (minibuf))
{
if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf)
- /* Check that F either is, or has forwarded its focus to,
- MINIBUF's frame. */
- && (EQ (WINDOW_FRAME (XWINDOW (minibuf)), f)
- || EQ (WINDOW_FRAME (XWINDOW (minibuf)),
- FRAME_FOCUS_FRAME (XFRAME (f)))))
+ || EQ (WINDOW_FRAME (XWINDOW (minibuf)), f)
+ || EQ (WINDOW_FRAME (XWINDOW (minibuf)),
+ FRAME_FOCUS_FRAME (XFRAME (f))))
prev = f;
}
else if (EQ (minibuf, Qvisible))
If omitted, FRAME defaults to the selected frame.\n\
A frame may not be deleted if its minibuffer is used by other frames.\n\
Normally, you may not delete a frame if all other frames are invisible,\n\
-but if the second optional argument FORCE is non-nil, you may do so.")
+but if the second optional argument FORCE is non-nil, you may do so.\n\
+\n\
+This function runs `delete-frame-hook' before actually deleting the\n\
+frame. The hook is called with one argument FRAME.")
(frame, force)
Lisp_Object frame, force;
{
if (! FRAME_LIVE_P (f))
return Qnil;
- if (NILP (force) && !other_visible_frames (f))
+ if (NILP (force) && !other_visible_frames (f)
+#ifdef macintosh
+ /* Terminal frame deleted before any other visible frames are
+ created. */
+ && strcmp (XSTRING (f->name)->data, "F1") != 0
+#endif
+ )
error ("Attempt to delete the sole visible or iconified frame");
#if 0
}
}
+ /* Run `delete-frame-hook'. */
+ if (!NILP (Vrun_hooks))
+ {
+ Lisp_Object args[2];
+ args[0] = intern ("delete-frame-hook");
+ args[1] = frame;
+ Frun_hook_with_args (2, args);
+ }
+
minibuffer_selected = EQ (minibuf_window, selected_window);
/* Don't let the frame remain selected. */
Fselect_window (minibuf_window);
}
+ /* 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;
+
/* Clear any X selections for this frame. */
#ifdef HAVE_X_WINDOWS
if (FRAME_X_P (f))
if (FRAME_MESSAGE_BUF (f))
xfree (FRAME_MESSAGE_BUF (f));
-#ifdef HAVE_WINDOW_SYSTEM
- /* Free all fontset data. */
- free_fontset_data (FRAME_FONTSET_DATA (f));
-#endif
-
/* Since some events are handled at the interrupt level, we may get
an event for f at any time; if we zero out the frame's display
now, then we may trip up the event-handling code. Instead, we'll
x_destroy_window (f);
#endif
-/* Done by x_destroy_window above already */
-#if 0
-#ifdef macintosh
- if (FRAME_MAC_P (f))
- DisposeMacWindow (f->output_data.mac);
-#endif
-#endif
-
f->output_data.nothing = 0;
/* If we've deleted the last_nonminibuf_frame, then try to find
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.")
+and nil for X and Y.\n\
+Runs the abnormal hook `mouse-position-function' with the normal return\n\
+value as argument.")
()
{
FRAME_PTR f;
Lisp_Object lispy_dummy;
enum scroll_bar_part party_dummy;
- Lisp_Object x, y;
+ Lisp_Object x, y, retval;
int col, row;
unsigned long long_dummy;
+ struct gcpro gcpro1;
f = SELECTED_FRAME ();
x = y = Qnil;
}
#endif
XSETFRAME (lispy_dummy, f);
- return Fcons (lispy_dummy, Fcons (x, y));
+ retval = Fcons (lispy_dummy, Fcons (x, y));
+ GCPRO1 (retval);
+ if (!NILP (Vmouse_position_function))
+ retval = call1 (Vmouse_position_function, retval);
+ RETURN_UNGCPRO (retval);
}
DEFUN ("mouse-pixel-position", Fmouse_pixel_position,
FOR_EACH_FRAME (tail, frame)
{
- XFRAME (frame)->buffer_list
- = nconc2 (Fdelq (buffer, XFRAME (frame)->buffer_list),
- Fcons (buffer, Qnil));
+ 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));
}
}
struct frame *f;
Lisp_Object prop, val;
{
- register Lisp_Object tem;
+ register Lisp_Object old_alist_elt;
+ /* The buffer-alist parameter is stored in a special place and is
+ not in the alist. */
if (EQ (prop, Qbuffer_list))
{
f->buffer_list = val;
return;
}
- tem = Fassq (prop, f->param_alist);
- if (EQ (tem, Qnil))
+ /* If PROP is a symbol which is supposed to have frame-local values,
+ and it is set up based on this frame, switch to the global
+ binding. That way, we can create or alter the frame-local binding
+ without messing up the symbol's status. */
+ if (SYMBOLP (prop))
+ {
+ Lisp_Object valcontents;
+ valcontents = XSYMBOL (prop)->value;
+ if ((BUFFER_LOCAL_VALUEP (valcontents)
+ || SOME_BUFFER_LOCAL_VALUEP (valcontents))
+ && XBUFFER_LOCAL_VALUE (valcontents)->check_frame
+ && XFRAME (XBUFFER_LOCAL_VALUE (valcontents)->frame) == f)
+ swap_in_global_binding (prop);
+ }
+
+ /* Update the frame parameter alist. */
+ old_alist_elt = Fassq (prop, f->param_alist);
+ if (EQ (old_alist_elt, Qnil))
f->param_alist = Fcons (Fcons (prop, val), f->param_alist);
else
- Fsetcdr (tem, val);
+ Fsetcdr (old_alist_elt, val);
+ /* Update some other special parameters in their special places
+ in addition to the alist. */
+
if (EQ (prop, Qbuffer_predicate))
f->buffer_predicate = val;
Lisp_Object alist;
FRAME_PTR f;
int height, width;
+ struct gcpro gcpro1;
if (EQ (frame, Qnil))
frame = selected_frame;
return Qnil;
alist = Fcopy_alist (f->param_alist);
-#ifdef MSDOS
- if (FRAME_MSDOS_P (f))
+ GCPRO1 (alist);
+
+ if (!FRAME_WINDOW_P (f))
{
int fg = FRAME_FOREGROUND_PIXEL (f);
int bg = FRAME_BACKGROUND_PIXEL (f);
- Lisp_Object qreverse = intern ("reverse");
- int rv =
- !NILP (Fassq (qreverse, alist))
- || !NILP (Fassq (qreverse, Vdefault_frame_alist));
-
- store_in_alist (&alist, intern ("foreground-color"),
- build_string (msdos_stdcolor_name (rv ? bg : fg)));
- store_in_alist (&alist, intern ("background-color"),
- build_string (msdos_stdcolor_name (rv ? fg : bg)));
+ Lisp_Object elt;
+
+ /* If the frame's parameter alist says the colors are
+ unspecified and reversed, take the frame's background pixel
+ for foreground and vice versa. */
+ elt = Fassq (Qforeground_color, alist);
+ if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt)))
+ {
+ if (strncmp (XSTRING (XCDR (elt))->data,
+ unspecified_bg,
+ XSTRING (XCDR (elt))->size) == 0)
+ store_in_alist (&alist, Qforeground_color, tty_color_name (f, bg));
+ else if (strncmp (XSTRING (XCDR (elt))->data,
+ unspecified_fg,
+ XSTRING (XCDR (elt))->size) == 0)
+ store_in_alist (&alist, Qforeground_color, tty_color_name (f, fg));
+ }
+ else
+ store_in_alist (&alist, Qforeground_color, tty_color_name (f, fg));
+ elt = Fassq (Qbackground_color, alist);
+ if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt)))
+ {
+ if (strncmp (XSTRING (XCDR (elt))->data,
+ unspecified_fg,
+ XSTRING (XCDR (elt))->size) == 0)
+ store_in_alist (&alist, Qbackground_color, tty_color_name (f, fg));
+ else if (strncmp (XSTRING (XCDR (elt))->data,
+ unspecified_bg,
+ XSTRING (XCDR (elt))->size) == 0)
+ store_in_alist (&alist, Qbackground_color, tty_color_name (f, bg));
+ }
+ else
+ store_in_alist (&alist, Qbackground_color, tty_color_name (f, bg));
+ store_in_alist (&alist, intern ("font"),
+ build_string (FRAME_MSDOS_P (f)
+ ? "ms-dos"
+ : FRAME_W32_P (f) ? "w32term"
+ :"tty"));
}
- store_in_alist (&alist, intern ("font"), build_string ("ms-dos"));
-#endif
store_in_alist (&alist, Qname, f->name);
height = (FRAME_NEW_HEIGHT (f) ? FRAME_NEW_HEIGHT (f) : FRAME_HEIGHT (f));
store_in_alist (&alist, Qheight, make_number (height));
XSETFASTINT (lines, FRAME_MENU_BAR_LINES (f));
store_in_alist (&alist, Qmenu_bar_lines, lines);
}
+
+ UNGCPRO;
return alist;
}
+
+DEFUN ("frame-parameter", Fframe_parameter, Sframe_parameter, 2, 2, 0,
+ "Return FRAME's value for parameter PARAMETER.\n\
+If FRAME is nil, describe the currently selected frame.")
+ (frame, parameter)
+ Lisp_Object frame, parameter;
+{
+ struct frame *f;
+ Lisp_Object value;
+
+ if (NILP (frame))
+ frame = selected_frame;
+ else
+ CHECK_FRAME (frame, 0);
+ CHECK_SYMBOL (parameter, 1);
+
+ f = XFRAME (frame);
+ value = Qnil;
+
+ if (FRAME_LIVE_P (f))
+ {
+ if (EQ (parameter, Qname))
+ value = 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);
+#endif /* HAVE_X_WINDOWS */
+ else
+ {
+ value = Fassq (parameter, f->param_alist);
+ if (CONSP (value))
+ {
+ value = XCDR (value);
+ /* Fframe_parameters puts the actual fg/bg color names,
+ even if f->param_alist says otherwise. This is
+ important when param_alist's notion of colors is
+ "unspecified". We need to do the same here. */
+ if (STRINGP (value) && !FRAME_WINDOW_P (f))
+ {
+ char *color_name;
+ EMACS_INT csz;
+
+ if (EQ (parameter, Qbackground_color))
+ {
+ color_name = XSTRING (value)->data;
+ csz = XSTRING (value)->size;
+ 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)
+ value = tty_color_name (f, FRAME_FOREGROUND_PIXEL (f));
+ }
+ else if (EQ (parameter, Qforeground_color))
+ {
+ color_name = XSTRING (value)->data;
+ csz = XSTRING (value)->size;
+ 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)
+ value = tty_color_name (f, FRAME_BACKGROUND_PIXEL (f));
+ }
+ }
+ }
+ else if (EQ (parameter, Qdisplay_type)
+ || EQ (parameter, Qbackground_mode))
+ /* Avoid consing in frequent cases. */
+ value = Qnil;
+ else
+ value = Fcdr (Fassq (parameter, Fframe_parameters (frame)));
+ }
+ }
+
+ return value;
+}
+
+
DEFUN ("modify-frame-parameters", Fmodify_frame_parameters,
Smodify_frame_parameters, 2, 2, 0,
"Modify the parameters of frame FRAME according to ALIST.\n\
Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.\n\
The meaningful PARMs depend on the kind of frame.\n\
Undefined PARMs are ignored, but stored in the frame's parameter list\n\
-so that `frame-parameters' will return them.")
+so that `frame-parameters' will return them.\n\
+\n\
+The value of frame parameter FOO can also be accessed\n\
+as a frame-local binding for the variable FOO, if you have\n\
+enabled such bindings for that variable with `make-variable-frame-local'.")
(frame, alist)
Lisp_Object frame, alist;
{
FRAME_PTR f;
register Lisp_Object tail, prop, val;
+ int count = BINDING_STACK_SIZE ();
+
+ /* 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
+ this, modifying the `font' frame parameter, for example, while
+ there is a `default.attributeFont' X resource, won't work,
+ because `default's font is reset to the value of the X resource
+ and that resets the `font' frame parameter. */
+ specbind (Qinhibit_default_face_x_resources, Qt);
if (EQ (frame, Qnil))
frame = selected_frame;
IT_set_frame_parameters (f, alist);
else
#endif
-#ifdef macintosh
- if (FRAME_MAC_P (f))
- mac_set_frame_parameters (f, alist);
- else
-#endif
{
int length = XINT (Flength (alist));
}
}
- return Qnil;
+ return unbind_to (count, Qnil);
}
\f
DEFUN ("frame-char-height", Fframe_char_height, Sframe_char_height,
void
syms_of_frame ()
{
- syms_of_frame_1 ();
+ Qframep = intern ("framep");
+ staticpro (&Qframep);
+ Qframe_live_p = intern ("frame-live-p");
+ staticpro (&Qframe_live_p);
+ Qheight = intern ("height");
+ staticpro (&Qheight);
+ Qicon = intern ("icon");
+ staticpro (&Qicon);
+ Qminibuffer = intern ("minibuffer");
+ staticpro (&Qminibuffer);
+ Qmodeline = intern ("modeline");
+ staticpro (&Qmodeline);
+ Qname = intern ("name");
+ staticpro (&Qname);
+ Qonly = intern ("only");
+ staticpro (&Qonly);
+ Qunsplittable = intern ("unsplittable");
+ staticpro (&Qunsplittable);
+ Qmenu_bar_lines = intern ("menu-bar-lines");
+ staticpro (&Qmenu_bar_lines);
+ Qtool_bar_lines = intern ("tool-bar-lines");
+ staticpro (&Qtool_bar_lines);
+ Qwidth = intern ("width");
+ staticpro (&Qwidth);
+ Qx = intern ("x");
+ staticpro (&Qx);
+ Qw32 = intern ("w32");
+ staticpro (&Qw32);
+ Qpc = intern ("pc");
+ staticpro (&Qpc);
+ Qmac = intern ("mac");
+ staticpro (&Qmac);
+ Qvisible = intern ("visible");
+ staticpro (&Qvisible);
+ Qbuffer_predicate = intern ("buffer-predicate");
+ staticpro (&Qbuffer_predicate);
+ Qbuffer_list = intern ("buffer-list");
+ staticpro (&Qbuffer_list);
+ Qtitle = intern ("title");
+ staticpro (&Qtitle);
+ Qdisplay_type = intern ("display-type");
+ staticpro (&Qdisplay_type);
+ Qbackground_mode = intern ("background-mode");
+ staticpro (&Qbackground_mode);
- staticpro (&Vframe_list);
+ DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist,
+ "Alist of default values for frame creation.\n\
+These may be set in your init file, like this:\n\
+ (setq default-frame-alist '((width . 80) (height . 55) (menu-bar-lines . 1))\n\
+These override values given in window system configuration data,\n\
+ including X Windows' defaults database.\n\
+For values specific to the first Emacs frame, see `initial-frame-alist'.\n\
+For values specific to the separate minibuffer frame, see\n\
+ `minibuffer-frame-alist'.\n\
+The `menu-bar-lines' element of the list controls whether new frames\n\
+ have menu bars; `menu-bar-mode' works by altering this element.");
+ Vdefault_frame_alist = Qnil;
+
+ Qinhibit_default_face_x_resources
+ = intern ("inhibit-default-face-x-resources");
+ staticpro (&Qinhibit_default_face_x_resources);
DEFVAR_LISP ("terminal-frame", &Vterminal_frame,
"The initial frame-object, which represents Emacs's stdout.");
"Non-nil if all of emacs is iconified and frame updates are not needed.");
Vemacs_iconified = Qnil;
+ DEFVAR_LISP ("mouse-position-function", &Vmouse_position_function,
+ "If non-nil, function applied to the normal result of `mouse-position'.\n\
+This abnormal hook exists for the benefit of packages like XTerm-mouse\n\
+which need to do mouse handling at the Lisp level.");
+ Vmouse_position_function = Qnil;
+
DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,
"Minibufferless frames use this frame's minibuffer.\n\
\n\
current set of frames, or where the minibuffer is currently being\n\
displayed.");
+ staticpro (&Vframe_list);
+
defsubr (&Sactive_minibuffer_window);
defsubr (&Sframep);
defsubr (&Sframe_live_p);
defsubr (&Sredirect_frame_focus);
defsubr (&Sframe_focus);
defsubr (&Sframe_parameters);
+ defsubr (&Sframe_parameter);
defsubr (&Smodify_frame_parameters);
defsubr (&Sframe_char_height);
defsubr (&Sframe_char_width);