X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/8f23f280539076bf81fef5b7cbea963050715db0..a63643cd04cda0e835077a8bdcacb5513b1f6338:/src/frame.c diff --git a/src/frame.c b/src/frame.c index 8aac87023e..204eec3083 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1,5 +1,5 @@ /* 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. @@ -29,6 +29,13 @@ Boston, MA 02111-1307, USA. */ #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" @@ -41,45 +48,6 @@ Boston, MA 02111-1307, USA. */ #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; @@ -100,68 +68,13 @@ Lisp_Object Qvisible; 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; static void set_menu_bar_lines_1 (window, n) @@ -173,6 +86,11 @@ 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)) @@ -216,12 +134,6 @@ set_menu_bar_lines (f, value, oldval) } } -#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; @@ -311,7 +223,7 @@ make_frame (mini_p) 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; @@ -334,9 +246,9 @@ make_frame (mini_p) 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) @@ -411,10 +323,6 @@ make_frame (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; } @@ -555,30 +463,41 @@ make_terminal_frame () 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; + { + 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); -#else /* !macintosh */ + make_mac_terminal_frame (f); +#else f->output_data.x = &tty_display; -#endif /* !macintosh */ +#endif /* macintosh */ +#endif /* WINDOWSNT */ #endif /* MSDOS */ -#ifndef macintosh if (!noninteractive) init_frame_faces (f); -#endif + return f; } @@ -701,6 +620,9 @@ do_switch_frame (frame, no_enter, track) #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); @@ -932,7 +854,7 @@ next_frame (frame, minibuf) 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)) @@ -942,11 +864,9 @@ next_frame (frame, minibuf) 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 @@ -1002,11 +922,9 @@ prev_frame (frame, minibuf) 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)) @@ -1131,7 +1049,10 @@ DEFUN ("delete-frame", Fdelete_frame, Sdelete_frame, 0, 2, "", 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; { @@ -1153,7 +1074,13 @@ but if the second optional argument FORCE is non-nil, you may do so.") 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 @@ -1184,6 +1111,15 @@ but if the second optional argument FORCE is non-nil, you may do so.") } } + /* 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. */ @@ -1221,6 +1157,10 @@ but if the second optional argument FORCE is non-nil, you may do so.") 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)) @@ -1254,11 +1194,6 @@ but if the second optional argument FORCE is non-nil, you may do so.") 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 @@ -1271,14 +1206,6 @@ but if the second optional argument FORCE is non-nil, you may do so.") 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 @@ -1375,15 +1302,18 @@ 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.") +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; @@ -1405,7 +1335,11 @@ and nil for X and Y.") } #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, @@ -1856,9 +1790,13 @@ frames_bury_buffer (buffer) 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)); } } @@ -1944,20 +1882,41 @@ store_frame_param (f, prop, val) 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; @@ -2012,15 +1971,44 @@ If FRAME is omitted, return information on the currently selected frame.") { int fg = FRAME_FOREGROUND_PIXEL (f); int bg = FRAME_BACKGROUND_PIXEL (f); + Lisp_Object elt; - store_in_alist (&alist, intern ("foreground-color"), - tty_color_name (f, fg)); - store_in_alist (&alist, intern ("background-color"), - tty_color_name (f, bg)); + /* 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")); + : FRAME_W32_P (f) ? "w32term" + :"tty")); } store_in_alist (&alist, Qname, f->name); height = (FRAME_NEW_HEIGHT (f) ? FRAME_NEW_HEIGHT (f) : FRAME_HEIGHT (f)); @@ -2053,6 +2041,81 @@ If FRAME is omitted, return information on the currently selected frame.") 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\ @@ -2060,12 +2123,25 @@ ALIST is an alist of parameters to change and their new values.\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; @@ -2083,11 +2159,6 @@ so that `frame-parameters' will return them.") 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)); @@ -2119,7 +2190,7 @@ so that `frame-parameters' will return them.") } } - return Qnil; + return unbind_to (count, Qnil); } DEFUN ("frame-char-height", Fframe_char_height, Sframe_char_height, @@ -2333,9 +2404,67 @@ the rightmost or bottommost possible position (that stays within the screen).") 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."); @@ -2344,6 +2473,12 @@ syms_of_frame () "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\ @@ -2357,6 +2492,8 @@ this variable doesn't necessarily say anything meaningful about the\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); @@ -2392,6 +2529,7 @@ displayed."); 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);