1 /* Generic frame functions.
2 Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000 Free Software Foundation.
4 This file is part of GNU Emacs.
6 GNU Emacs is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU Emacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Emacs; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
33 #ifdef HAVE_WINDOW_SYSTEM
36 #include "termhooks.h"
37 #include "dispextern.h"
45 extern struct mac_output
*NewMacWindow ();
46 extern void DisposeMacWindow (struct mac_output
*);
49 /* Evaluate this expression to rebuild the section of syms_of_frame
50 that initializes and staticpros the symbols declared below. Note
51 that Emacs 18 has a bug that keeps C-x C-e from being able to
52 evaluate this expression.
55 ;; Accumulate a list of the symbols we want to initialize from the
56 ;; declarations at the top of the file.
57 (goto-char (point-min))
58 (search-forward "/\*&&& symbols declared here &&&*\/\n")
60 (while (looking-at "Lisp_Object \\(Q[a-z_]+\\)")
62 (cons (buffer-substring (match-beginning 1) (match-end 1))
65 (setq symbol-list (nreverse symbol-list))
66 ;; Delete the section of syms_of_... where we initialize the symbols.
67 (search-forward "\n /\*&&& init symbols here &&&*\/\n")
68 (let ((start (point)))
69 (while (looking-at "^ Q")
71 (kill-region start (point)))
72 ;; Write a new symbol initialization section.
74 (insert (format " %s = intern (\"" (car symbol-list)))
75 (let ((start (point)))
76 (insert (substring (car symbol-list) 1))
77 (subst-char-in-region start (point) ?_ ?-))
78 (insert (format "\");\n staticpro (&%s);\n" (car symbol-list)))
79 (setq symbol-list (cdr symbol-list)))))
82 /*&&& symbols declared here &&&*/
84 Lisp_Object Qframe_live_p
;
87 Lisp_Object Qminibuffer
;
88 Lisp_Object Qmodeline
;
91 Lisp_Object Qunsplittable
;
92 Lisp_Object Qmenu_bar_lines
;
93 Lisp_Object Qtool_bar_lines
;
100 Lisp_Object Qbuffer_predicate
;
101 Lisp_Object Qbuffer_list
;
104 Lisp_Object Vterminal_frame
;
105 Lisp_Object Vdefault_frame_alist
;
106 Lisp_Object Vmouse_position_function
;
111 /*&&& init symbols here &&&*/
112 Qframep
= intern ("framep");
113 staticpro (&Qframep
);
114 Qframe_live_p
= intern ("frame-live-p");
115 staticpro (&Qframe_live_p
);
116 Qheight
= intern ("height");
117 staticpro (&Qheight
);
118 Qicon
= intern ("icon");
120 Qminibuffer
= intern ("minibuffer");
121 staticpro (&Qminibuffer
);
122 Qmodeline
= intern ("modeline");
123 staticpro (&Qmodeline
);
124 Qname
= intern ("name");
126 Qonly
= intern ("only");
128 Qunsplittable
= intern ("unsplittable");
129 staticpro (&Qunsplittable
);
130 Qmenu_bar_lines
= intern ("menu-bar-lines");
131 staticpro (&Qmenu_bar_lines
);
132 Qtool_bar_lines
= intern ("tool-bar-lines");
133 staticpro (&Qtool_bar_lines
);
134 Qwidth
= intern ("width");
138 Qw32
= intern ("w32");
142 Qmac
= intern ("mac");
144 Qvisible
= intern ("visible");
145 staticpro (&Qvisible
);
146 Qbuffer_predicate
= intern ("buffer-predicate");
147 staticpro (&Qbuffer_predicate
);
148 Qbuffer_list
= intern ("buffer-list");
149 staticpro (&Qbuffer_list
);
150 Qtitle
= intern ("title");
153 DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist
,
154 "Alist of default values for frame creation.\n\
155 These may be set in your init file, like this:\n\
156 (setq default-frame-alist '((width . 80) (height . 55) (menu-bar-lines . 1))\n\
157 These override values given in window system configuration data,\n\
158 including X Windows' defaults database.\n\
159 For values specific to the first Emacs frame, see `initial-frame-alist'.\n\
160 For values specific to the separate minibuffer frame, see\n\
161 `minibuffer-frame-alist'.\n\
162 The `menu-bar-lines' element of the list controls whether new frames\n\
163 have menu bars; `menu-bar-mode' works by altering this element.");
164 Vdefault_frame_alist
= Qnil
;
168 set_menu_bar_lines_1 (window
, n
)
172 struct window
*w
= XWINDOW (window
);
174 XSETFASTINT (w
->last_modified
, 0);
175 XSETFASTINT (w
->top
, XFASTINT (w
->top
) + n
);
176 XSETFASTINT (w
->height
, XFASTINT (w
->height
) - n
);
178 /* Handle just the top child in a vertical split. */
179 if (!NILP (w
->vchild
))
180 set_menu_bar_lines_1 (w
->vchild
, n
);
182 /* Adjust all children in a horizontal split. */
183 for (window
= w
->hchild
; !NILP (window
); window
= w
->next
)
185 w
= XWINDOW (window
);
186 set_menu_bar_lines_1 (window
, n
);
191 set_menu_bar_lines (f
, value
, oldval
)
193 Lisp_Object value
, oldval
;
196 int olines
= FRAME_MENU_BAR_LINES (f
);
198 /* Right now, menu bars don't work properly in minibuf-only frames;
199 most of the commands try to apply themselves to the minibuffer
200 frame itself, and get an error because you can't switch buffers
201 in or split the minibuffer window. */
202 if (FRAME_MINIBUF_ONLY_P (f
))
205 if (INTEGERP (value
))
206 nlines
= XINT (value
);
210 if (nlines
!= olines
)
212 windows_or_buffers_changed
++;
213 FRAME_WINDOW_SIZES_CHANGED (f
) = 1;
214 FRAME_MENU_BAR_LINES (f
) = nlines
;
215 set_menu_bar_lines_1 (f
->root_window
, nlines
- olines
);
222 /* These help us bind and responding to switch-frame events. */
223 #include "commands.h"
224 #include "keyboard.h"
226 Lisp_Object Vemacs_iconified
;
227 Lisp_Object Vframe_list
;
229 struct x_output tty_display
;
231 extern Lisp_Object Vminibuffer_list
;
232 extern Lisp_Object
get_minibuffer ();
233 extern Lisp_Object
Fhandle_switch_frame ();
234 extern Lisp_Object
Fredirect_frame_focus ();
235 extern Lisp_Object
x_get_focus_frame ();
237 DEFUN ("framep", Fframep
, Sframep
, 1, 1, 0,
238 "Return non-nil if OBJECT is a frame.\n\
239 Value is t for a termcap frame (a character-only terminal),\n\
240 `x' for an Emacs frame that is really an X window,\n\
241 `w32' for an Emacs frame that is a window on MS-Windows display,\n\
242 `mac' for an Emacs frame on a Macintosh display,\n\
243 `pc' for a direct-write MS-DOS frame.\n\
244 See also `frame-live-p'.")
248 if (!FRAMEP (object
))
250 switch (XFRAME (object
)->output_method
)
254 case output_x_window
:
258 case output_msdos_raw
:
267 DEFUN ("frame-live-p", Fframe_live_p
, Sframe_live_p
, 1, 1, 0,
268 "Return non-nil if OBJECT is a frame which has not been deleted.\n\
269 Value is nil if OBJECT is not a live frame. If object is a live\n\
270 frame, the return value indicates what sort of output device it is\n\
271 displayed on. Value is t for a termcap frame (a character-only\n\
272 terminal), `x' for an Emacs frame being displayed in an X window.")
276 return ((FRAMEP (object
)
277 && FRAME_LIVE_P (XFRAME (object
)))
287 register struct frame
*f
;
288 register Lisp_Object root_window
;
289 register Lisp_Object mini_window
;
290 register struct Lisp_Vector
*vec
;
293 vec
= allocate_vectorlike ((EMACS_INT
) VECSIZE (struct frame
));
294 for (i
= 0; i
< VECSIZE (struct frame
); i
++)
295 XSETFASTINT (vec
->contents
[i
], 0);
296 vec
->size
= VECSIZE (struct frame
);
297 f
= (struct frame
*)vec
;
298 XSETFRAME (frame
, f
);
300 f
->desired_matrix
= 0;
301 f
->current_matrix
= 0;
304 f
->glyphs_initialized_p
= 0;
305 f
->decode_mode_spec_buffer
= 0;
307 f
->async_visible
= 0;
308 f
->output_data
.nothing
= 0;
310 f
->async_iconified
= 0;
311 f
->wants_modeline
= 1;
316 f
->has_minibuffer
= mini_p
;
317 f
->focus_frame
= Qnil
;
318 f
->explicit_name
= 0;
319 f
->can_have_scroll_bars
= 0;
320 f
->vertical_scroll_bar_type
= vertical_scroll_bar_none
;
321 f
->param_alist
= Qnil
;
322 f
->scroll_bars
= Qnil
;
323 f
->condemned_scroll_bars
= Qnil
;
324 f
->face_alist
= Qnil
;
325 f
->face_cache
= NULL
;
326 f
->menu_bar_items
= Qnil
;
327 f
->menu_bar_vector
= Qnil
;
328 f
->menu_bar_items_used
= 0;
329 f
->buffer_predicate
= Qnil
;
330 f
->buffer_list
= Qnil
;
332 f
->kboard
= initial_kboard
;
336 f
->menu_bar_window
= Qnil
;
337 f
->tool_bar_window
= Qnil
;
338 f
->desired_tool_bar_items
= f
->current_tool_bar_items
= Qnil
;
339 f
->desired_tool_bar_string
= f
->current_tool_bar_string
= Qnil
;
340 f
->n_desired_tool_bar_items
= f
->n_current_tool_bar_items
= 0;
342 root_window
= make_window ();
345 mini_window
= make_window ();
346 XWINDOW (root_window
)->next
= mini_window
;
347 XWINDOW (mini_window
)->prev
= root_window
;
348 XWINDOW (mini_window
)->mini_p
= Qt
;
349 XWINDOW (mini_window
)->frame
= frame
;
350 f
->minibuffer_window
= mini_window
;
355 XWINDOW (root_window
)->next
= Qnil
;
356 f
->minibuffer_window
= Qnil
;
359 XWINDOW (root_window
)->frame
= frame
;
362 just so that there is "something there."
363 Correct size will be set up later with change_frame_size. */
365 SET_FRAME_WIDTH (f
, 10);
368 XSETFASTINT (XWINDOW (root_window
)->width
, 10);
369 XSETFASTINT (XWINDOW (root_window
)->height
, (mini_p
? 9 : 10));
373 XSETFASTINT (XWINDOW (mini_window
)->width
, 10);
374 XSETFASTINT (XWINDOW (mini_window
)->top
, 9);
375 XSETFASTINT (XWINDOW (mini_window
)->height
, 1);
378 /* Choose a buffer for the frame's root window. */
382 XWINDOW (root_window
)->buffer
= Qt
;
383 buf
= Fcurrent_buffer ();
384 /* If buf is a 'hidden' buffer (i.e. one whose name starts with
385 a space), try to find another one. */
386 if (XSTRING (Fbuffer_name (buf
))->data
[0] == ' ')
387 buf
= Fother_buffer (buf
, Qnil
, Qnil
);
389 /* Use set_window_buffer, not Fset_window_buffer, and don't let
390 hooks be run by it. The reason is that the whole frame/window
391 arrangement is not yet fully intialized at this point. Windows
392 don't have the right size, glyph matrices aren't initialized
393 etc. Running Lisp functions at this point surely ends in a
395 set_window_buffer (root_window
, buf
, 0);
396 f
->buffer_list
= Fcons (buf
, Qnil
);
401 XWINDOW (mini_window
)->buffer
= Qt
;
402 set_window_buffer (mini_window
,
403 (NILP (Vminibuffer_list
)
405 : Fcar (Vminibuffer_list
)),
409 f
->root_window
= root_window
;
410 f
->selected_window
= root_window
;
411 /* Make sure this window seems more recently used than
412 a newly-created, never-selected window. */
413 XSETFASTINT (XWINDOW (f
->selected_window
)->use_time
, ++window_select_count
);
415 #ifdef HAVE_WINDOW_SYSTEM
416 f
->fontset_data
= alloc_fontset_data ();
422 #ifdef HAVE_WINDOW_SYSTEM
423 /* Make a frame using a separate minibuffer window on another frame.
424 MINI_WINDOW is the minibuffer window to use. nil means use the
425 default (the global minibuffer). */
428 make_frame_without_minibuffer (mini_window
, kb
, display
)
429 register Lisp_Object mini_window
;
433 register struct frame
*f
;
436 if (!NILP (mini_window
))
437 CHECK_LIVE_WINDOW (mini_window
, 0);
440 if (!NILP (mini_window
)
441 && XFRAME (XWINDOW (mini_window
)->frame
)->kboard
!= kb
)
442 error ("frame and minibuffer must be on the same display");
445 /* Make a frame containing just a root window. */
448 if (NILP (mini_window
))
450 /* Use default-minibuffer-frame if possible. */
451 if (!FRAMEP (kb
->Vdefault_minibuffer_frame
)
452 || ! FRAME_LIVE_P (XFRAME (kb
->Vdefault_minibuffer_frame
)))
454 Lisp_Object frame_dummy
;
456 XSETFRAME (frame_dummy
, f
);
457 GCPRO1 (frame_dummy
);
458 /* If there's no minibuffer frame to use, create one. */
459 kb
->Vdefault_minibuffer_frame
=
460 call1 (intern ("make-initial-minibuffer-frame"), display
);
464 mini_window
= XFRAME (kb
->Vdefault_minibuffer_frame
)->minibuffer_window
;
467 f
->minibuffer_window
= mini_window
;
469 /* Make the chosen minibuffer window display the proper minibuffer,
470 unless it is already showing a minibuffer. */
471 if (NILP (Fmemq (XWINDOW (mini_window
)->buffer
, Vminibuffer_list
)))
472 Fset_window_buffer (mini_window
,
473 (NILP (Vminibuffer_list
)
475 : Fcar (Vminibuffer_list
)));
479 /* Make a frame containing only a minibuffer window. */
482 make_minibuffer_frame ()
484 /* First make a frame containing just a root window, no minibuffer. */
486 register struct frame
*f
= make_frame (0);
487 register Lisp_Object mini_window
;
488 register Lisp_Object frame
;
490 XSETFRAME (frame
, f
);
495 f
->wants_modeline
= 0;
496 f
->has_minibuffer
= 1;
498 /* Now label the root window as also being the minibuffer.
499 Avoid infinite looping on the window chain by marking next pointer
502 mini_window
= f
->minibuffer_window
= f
->root_window
;
503 XWINDOW (mini_window
)->mini_p
= Qt
;
504 XWINDOW (mini_window
)->next
= Qnil
;
505 XWINDOW (mini_window
)->prev
= Qnil
;
506 XWINDOW (mini_window
)->frame
= frame
;
508 /* Put the proper buffer in that window. */
510 Fset_window_buffer (mini_window
,
511 (NILP (Vminibuffer_list
)
513 : Fcar (Vminibuffer_list
)));
516 #endif /* HAVE_WINDOW_SYSTEM */
518 /* Construct a frame that refers to the terminal (stdin and stdout). */
520 static int terminal_frame_count
;
523 make_terminal_frame ()
525 register struct frame
*f
;
532 initial_kboard
= (KBOARD
*) xmalloc (sizeof (KBOARD
));
533 init_kboard (initial_kboard
);
534 initial_kboard
->next_kboard
= all_kboards
;
535 all_kboards
= initial_kboard
;
539 /* The first call must initialize Vframe_list. */
540 if (! (NILP (Vframe_list
) || CONSP (Vframe_list
)))
545 XSETFRAME (frame
, f
);
546 Vframe_list
= Fcons (frame
, Vframe_list
);
548 terminal_frame_count
++;
549 sprintf (name
, "F%d", terminal_frame_count
);
550 f
->name
= build_string (name
);
552 f
->visible
= 1; /* FRAME_SET_VISIBLE wd set frame_garbaged. */
553 f
->async_visible
= 1; /* Don't let visible be cleared later. */
555 f
->output_data
.x
= &the_only_x_display
;
556 if (!inhibit_window_system
557 && (!FRAMEP (selected_frame
) || !FRAME_LIVE_P (XFRAME (selected_frame
))
558 || XFRAME (selected_frame
)->output_method
== output_msdos_raw
))
559 f
->output_method
= output_msdos_raw
;
561 f
->output_method
= output_termcap
;
564 f
->output_data
.mac
= NewMacWindow(f
);
565 f
->output_data
.mac
->background_pixel
= 0xffffff;
566 f
->output_data
.mac
->foreground_pixel
= 0;
567 f
->output_data
.mac
->n_param_faces
= 0;
568 f
->output_data
.mac
->n_computed_faces
= 0;
569 f
->output_data
.mac
->size_computed_faces
= 0;
570 f
->output_method
= output_mac
;
573 init_frame_faces (f
);
574 #else /* !macintosh */
575 f
->output_data
.x
= &tty_display
;
576 #endif /* !macintosh */
581 init_frame_faces (f
);
586 DEFUN ("make-terminal-frame", Fmake_terminal_frame
, Smake_terminal_frame
,
587 1, 1, 0, "Create an additional terminal frame.\n\
588 You can create multiple frames on a text-only terminal in this way.\n\
589 Only the selected terminal frame is actually displayed.\n\
590 This function takes one argument, an alist specifying frame parameters.\n\
591 In practice, generally you don't need to specify any parameters.\n\
592 Note that changing the size of one terminal frame automatically affects all.")
597 Lisp_Object frame
, tem
;
598 struct frame
*sf
= SELECTED_FRAME ();
601 if (sf
->output_method
!= output_msdos_raw
602 && sf
->output_method
!= output_termcap
)
604 #else /* not MSDOS */
607 if (sf
->output_method
!= output_mac
)
608 error ("Not running on a Macintosh screen; cannot make a new Macintosh frame");
610 if (sf
->output_method
!= output_termcap
)
611 error ("Not using an ASCII terminal now; cannot make a new ASCII frame");
613 #endif /* not MSDOS */
615 f
= make_terminal_frame ();
617 change_frame_size (f
, FRAME_HEIGHT (sf
),
618 FRAME_WIDTH (sf
), 0, 0, 0);
621 XSETFRAME (frame
, f
);
622 Fmodify_frame_parameters (frame
, Vdefault_frame_alist
);
623 Fmodify_frame_parameters (frame
, parms
);
625 /* Make the frame face alist be frame-specific, so that each
626 frame could change its face definitions independently. */
627 f
->face_alist
= Fcopy_alist (sf
->face_alist
);
628 /* Simple Fcopy_alist isn't enough, because we need the contents of
629 the vectors which are the CDRs of associations in face_alist to
630 be copied as well. */
631 for (tem
= f
->face_alist
; CONSP (tem
); tem
= XCDR (tem
))
632 XCDR (XCAR (tem
)) = Fcopy_sequence (XCDR (XCAR (tem
)));
637 do_switch_frame (frame
, no_enter
, track
)
638 Lisp_Object frame
, no_enter
;
641 struct frame
*sf
= SELECTED_FRAME ();
643 /* If FRAME is a switch-frame event, extract the frame we should
646 && EQ (XCAR (frame
), Qswitch_frame
)
647 && CONSP (XCDR (frame
)))
648 frame
= XCAR (XCDR (frame
));
650 /* This used to say CHECK_LIVE_FRAME, but apparently it's possible for
651 a switch-frame event to arrive after a frame is no longer live,
652 especially when deleting the initial frame during startup. */
653 CHECK_FRAME (frame
, 0);
654 if (! FRAME_LIVE_P (XFRAME (frame
)))
657 if (sf
== XFRAME (frame
))
660 /* This is too greedy; it causes inappropriate focus redirection
661 that's hard to get rid of. */
663 /* If a frame's focus has been redirected toward the currently
664 selected frame, we should change the redirection to point to the
665 newly selected frame. This means that if the focus is redirected
666 from a minibufferless frame to a surrogate minibuffer frame, we
667 can use `other-window' to switch between all the frames using
668 that minibuffer frame, and the focus redirection will follow us
674 for (tail
= Vframe_list
; CONSP (tail
); tail
= XCDR (tail
))
678 if (!FRAMEP (XCAR (tail
)))
681 focus
= FRAME_FOCUS_FRAME (XFRAME (XCAR (tail
)));
683 if (FRAMEP (focus
) && XFRAME (focus
) == SELECTED_FRAME ())
684 Fredirect_frame_focus (XCAR (tail
), frame
);
688 /* Instead, apply it only to the frame we're pointing to. */
689 #ifdef HAVE_WINDOW_SYSTEM
690 if (track
&& (FRAME_WINDOW_P (XFRAME (frame
))))
692 Lisp_Object focus
, xfocus
;
694 xfocus
= x_get_focus_frame (XFRAME (frame
));
697 focus
= FRAME_FOCUS_FRAME (XFRAME (xfocus
));
698 if (FRAMEP (focus
) && XFRAME (focus
) == SELECTED_FRAME ())
699 Fredirect_frame_focus (xfocus
, frame
);
702 #endif /* HAVE_X_WINDOWS */
705 selected_frame
= frame
;
706 if (! FRAME_MINIBUF_ONLY_P (XFRAME (selected_frame
)))
707 last_nonminibuf_frame
= XFRAME (selected_frame
);
709 Fselect_window (XFRAME (frame
)->selected_window
);
711 /* We want to make sure that the next event generates a frame-switch
712 event to the appropriate frame. This seems kludgy to me, but
713 before you take it out, make sure that evaluating something like
714 (select-window (frame-root-window (new-frame))) doesn't end up
715 with your typing being interpreted in the new frame instead of
716 the one you're actually typing in. */
717 internal_last_event_frame
= Qnil
;
722 DEFUN ("select-frame", Fselect_frame
, Sselect_frame
, 1, 2, "e",
723 "Select the frame FRAME.\n\
724 Subsequent editing commands apply to its selected window.\n\
725 The selection of FRAME lasts until the next time the user does\n\
726 something to select a different frame, or until the next time this\n\
727 function is called.")
729 Lisp_Object frame
, no_enter
;
731 return do_switch_frame (frame
, no_enter
, 1);
735 DEFUN ("handle-switch-frame", Fhandle_switch_frame
, Shandle_switch_frame
, 1, 2, "e",
736 "Handle a switch-frame event EVENT.\n\
737 Switch-frame events are usually bound to this function.\n\
738 A switch-frame event tells Emacs that the window manager has requested\n\
739 that the user's events be directed to the frame mentioned in the event.\n\
740 This function selects the selected window of the frame of EVENT.\n\
742 If EVENT is frame object, handle it as if it were a switch-frame event\n\
745 Lisp_Object event
, no_enter
;
747 /* Preserve prefix arg that the command loop just cleared. */
748 current_kboard
->Vprefix_arg
= Vcurrent_prefix_arg
;
749 call1 (Vrun_hooks
, Qmouse_leave_buffer_hook
);
750 return do_switch_frame (event
, no_enter
, 0);
753 DEFUN ("ignore-event", Fignore_event
, Signore_event
, 0, 0, "",
754 "Do nothing, but preserve any prefix argument already specified.\n\
755 This is a suitable binding for iconify-frame and make-frame-visible.")
758 current_kboard
->Vprefix_arg
= Vcurrent_prefix_arg
;
762 DEFUN ("selected-frame", Fselected_frame
, Sselected_frame
, 0, 0, 0,
763 "Return the frame that is now selected.")
766 return selected_frame
;
769 DEFUN ("window-frame", Fwindow_frame
, Swindow_frame
, 1, 1, 0,
770 "Return the frame object that window WINDOW is on.")
774 CHECK_LIVE_WINDOW (window
, 0);
775 return XWINDOW (window
)->frame
;
778 DEFUN ("frame-first-window", Fframe_first_window
, Sframe_first_window
, 0, 1, 0,
779 "Returns the topmost, leftmost window of FRAME.\n\
780 If omitted, FRAME defaults to the currently selected frame.")
787 w
= SELECTED_FRAME ()->root_window
;
790 CHECK_LIVE_FRAME (frame
, 0);
791 w
= XFRAME (frame
)->root_window
;
793 while (NILP (XWINDOW (w
)->buffer
))
795 if (! NILP (XWINDOW (w
)->hchild
))
796 w
= XWINDOW (w
)->hchild
;
797 else if (! NILP (XWINDOW (w
)->vchild
))
798 w
= XWINDOW (w
)->vchild
;
805 DEFUN ("active-minibuffer-window", Factive_minibuffer_window
,
806 Sactive_minibuffer_window
, 0, 0, 0,
807 "Return the currently active minibuffer window, or nil if none.")
810 return minibuf_level
? minibuf_window
: Qnil
;
813 DEFUN ("frame-root-window", Fframe_root_window
, Sframe_root_window
, 0, 1, 0,
814 "Returns the root-window of FRAME.\n\
815 If omitted, FRAME defaults to the currently selected frame.")
822 window
= SELECTED_FRAME ()->root_window
;
825 CHECK_LIVE_FRAME (frame
, 0);
826 window
= XFRAME (frame
)->root_window
;
832 DEFUN ("frame-selected-window", Fframe_selected_window
,
833 Sframe_selected_window
, 0, 1, 0,
834 "Return the selected window of frame object FRAME.\n\
835 If omitted, FRAME defaults to the currently selected frame.")
842 window
= SELECTED_FRAME ()->selected_window
;
845 CHECK_LIVE_FRAME (frame
, 0);
846 window
= XFRAME (frame
)->selected_window
;
852 DEFUN ("set-frame-selected-window", Fset_frame_selected_window
,
853 Sset_frame_selected_window
, 2, 2, 0,
854 "Set the selected window of frame object FRAME to WINDOW.\n\
855 If FRAME is nil, the selected frame is used.\n\
856 If FRAME is the selected frame, this makes WINDOW the selected window.")
858 Lisp_Object frame
, window
;
861 frame
= selected_frame
;
863 CHECK_LIVE_FRAME (frame
, 0);
864 CHECK_LIVE_WINDOW (window
, 1);
866 if (! EQ (frame
, WINDOW_FRAME (XWINDOW (window
))))
867 error ("In `set-frame-selected-window', WINDOW is not on FRAME");
869 if (EQ (frame
, selected_frame
))
870 return Fselect_window (window
);
872 return XFRAME (frame
)->selected_window
= window
;
875 DEFUN ("frame-list", Fframe_list
, Sframe_list
,
877 "Return a list of all frames.")
880 return Fcopy_sequence (Vframe_list
);
883 /* Return the next frame in the frame list after FRAME.
884 If MINIBUF is nil, exclude minibuffer-only frames.
885 If MINIBUF is a window, include only its own frame
886 and any frame now using that window as the minibuffer.
887 If MINIBUF is `visible', include all visible frames.
888 If MINIBUF is 0, include all visible and iconified frames.
889 Otherwise, include all frames. */
892 next_frame (frame
, minibuf
)
899 /* There must always be at least one frame in Vframe_list. */
900 if (! CONSP (Vframe_list
))
903 /* If this frame is dead, it won't be in Vframe_list, and we'll loop
904 forever. Forestall that. */
905 CHECK_LIVE_FRAME (frame
, 0);
908 for (tail
= Vframe_list
; CONSP (tail
); tail
= XCDR (tail
))
915 && FRAME_KBOARD (XFRAME (f
)) == FRAME_KBOARD (XFRAME (frame
)))
917 /* Decide whether this frame is eligible to be returned. */
919 /* If we've looped all the way around without finding any
920 eligible frames, return the original frame. */
924 /* Let minibuf decide if this frame is acceptable. */
927 if (! FRAME_MINIBUF_ONLY_P (XFRAME (f
)))
930 else if (EQ (minibuf
, Qvisible
))
932 FRAME_SAMPLE_VISIBILITY (XFRAME (f
));
933 if (FRAME_VISIBLE_P (XFRAME (f
)))
936 else if (XFASTINT (minibuf
) == 0)
938 FRAME_SAMPLE_VISIBILITY (XFRAME (f
));
939 if (FRAME_VISIBLE_P (XFRAME (f
))
940 || FRAME_ICONIFIED_P (XFRAME (f
)))
943 else if (WINDOWP (minibuf
))
945 if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f
)), minibuf
)
946 /* Check that F either is, or has forwarded its focus to,
948 && (EQ (WINDOW_FRAME (XWINDOW (minibuf
)), f
)
949 || EQ (WINDOW_FRAME (XWINDOW (minibuf
)),
950 FRAME_FOCUS_FRAME (XFRAME (f
)))))
962 /* Return the previous frame in the frame list before FRAME.
963 If MINIBUF is nil, exclude minibuffer-only frames.
964 If MINIBUF is a window, include only its own frame
965 and any frame now using that window as the minibuffer.
966 If MINIBUF is `visible', include all visible frames.
967 If MINIBUF is 0, include all visible and iconified frames.
968 Otherwise, include all frames. */
971 prev_frame (frame
, minibuf
)
978 /* There must always be at least one frame in Vframe_list. */
979 if (! CONSP (Vframe_list
))
983 for (tail
= Vframe_list
; CONSP (tail
); tail
= XCDR (tail
))
991 if (EQ (frame
, f
) && !NILP (prev
))
994 if (FRAME_KBOARD (XFRAME (f
)) == FRAME_KBOARD (XFRAME (frame
)))
996 /* Decide whether this frame is eligible to be returned,
997 according to minibuf. */
1000 if (! FRAME_MINIBUF_ONLY_P (XFRAME (f
)))
1003 else if (WINDOWP (minibuf
))
1005 if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f
)), minibuf
)
1006 /* Check that F either is, or has forwarded its focus to,
1008 && (EQ (WINDOW_FRAME (XWINDOW (minibuf
)), f
)
1009 || EQ (WINDOW_FRAME (XWINDOW (minibuf
)),
1010 FRAME_FOCUS_FRAME (XFRAME (f
)))))
1013 else if (EQ (minibuf
, Qvisible
))
1015 FRAME_SAMPLE_VISIBILITY (XFRAME (f
));
1016 if (FRAME_VISIBLE_P (XFRAME (f
)))
1019 else if (XFASTINT (minibuf
) == 0)
1021 FRAME_SAMPLE_VISIBILITY (XFRAME (f
));
1022 if (FRAME_VISIBLE_P (XFRAME (f
))
1023 || FRAME_ICONIFIED_P (XFRAME (f
)))
1031 /* We've scanned the entire list. */
1033 /* We went through the whole frame list without finding a single
1034 acceptable frame. Return the original frame. */
1037 /* There were no acceptable frames in the list before FRAME; otherwise,
1038 we would have returned directly from the loop. Since PREV is the last
1039 acceptable frame in the list, return it. */
1044 DEFUN ("next-frame", Fnext_frame
, Snext_frame
, 0, 2, 0,
1045 "Return the next frame in the frame list after FRAME.\n\
1046 It considers only frames on the same terminal as FRAME.\n\
1047 By default, skip minibuffer-only frames.\n\
1048 If omitted, FRAME defaults to the selected frame.\n\
1049 If optional argument MINIFRAME is nil, exclude minibuffer-only frames.\n\
1050 If MINIFRAME is a window, include only its own frame\n\
1051 and any frame now using that window as the minibuffer.\n\
1052 If MINIFRAME is `visible', include all visible frames.\n\
1053 If MINIFRAME is 0, include all visible and iconified frames.\n\
1054 Otherwise, include all frames.")
1056 Lisp_Object frame
, miniframe
;
1059 frame
= selected_frame
;
1061 CHECK_LIVE_FRAME (frame
, 0);
1062 return next_frame (frame
, miniframe
);
1065 DEFUN ("previous-frame", Fprevious_frame
, Sprevious_frame
, 0, 2, 0,
1066 "Return the previous frame in the frame list before FRAME.\n\
1067 It considers only frames on the same terminal as FRAME.\n\
1068 By default, skip minibuffer-only frames.\n\
1069 If omitted, FRAME defaults to the selected frame.\n\
1070 If optional argument MINIFRAME is nil, exclude minibuffer-only frames.\n\
1071 If MINIFRAME is a window, include only its own frame\n\
1072 and any frame now using that window as the minibuffer.\n\
1073 If MINIFRAME is `visible', include all visible frames.\n\
1074 If MINIFRAME is 0, include all visible and iconified frames.\n\
1075 Otherwise, include all frames.")
1077 Lisp_Object frame
, miniframe
;
1080 frame
= selected_frame
;
1081 CHECK_LIVE_FRAME (frame
, 0);
1082 return prev_frame (frame
, miniframe
);
1085 /* Return 1 if it is ok to delete frame F;
1086 0 if all frames aside from F are invisible.
1087 (Exception: if F is the terminal frame, and we are using X, return 1.) */
1090 other_visible_frames (f
)
1093 /* We know the selected frame is visible,
1094 so if F is some other frame, it can't be the sole visible one. */
1095 if (f
== SELECTED_FRAME ())
1100 for (frames
= Vframe_list
;
1102 frames
= XCDR (frames
))
1106 this = XCAR (frames
);
1107 /* Verify that the frame's window still exists
1108 and we can still talk to it. And note any recent change
1110 #ifdef HAVE_WINDOW_SYSTEM
1111 if (FRAME_WINDOW_P (XFRAME (this)))
1113 x_sync (XFRAME (this));
1114 FRAME_SAMPLE_VISIBILITY (XFRAME (this));
1118 if (FRAME_VISIBLE_P (XFRAME (this))
1119 || FRAME_ICONIFIED_P (XFRAME (this))
1120 /* Allow deleting the terminal frame when at least
1121 one X frame exists! */
1122 || (FRAME_WINDOW_P (XFRAME (this)) && !FRAME_WINDOW_P (f
)))
1130 DEFUN ("delete-frame", Fdelete_frame
, Sdelete_frame
, 0, 2, "",
1131 "Delete FRAME, permanently eliminating it from use.\n\
1132 If omitted, FRAME defaults to the selected frame.\n\
1133 A frame may not be deleted if its minibuffer is used by other frames.\n\
1134 Normally, you may not delete a frame if all other frames are invisible,\n\
1135 but if the second optional argument FORCE is non-nil, you may do so.")
1137 Lisp_Object frame
, force
;
1140 struct frame
*sf
= SELECTED_FRAME ();
1141 int minibuffer_selected
;
1143 if (EQ (frame
, Qnil
))
1146 XSETFRAME (frame
, f
);
1150 CHECK_FRAME (frame
, 0);
1154 if (! FRAME_LIVE_P (f
))
1157 if (NILP (force
) && !other_visible_frames (f
))
1158 error ("Attempt to delete the sole visible or iconified frame");
1161 /* This is a nice idea, but x_connection_closed needs to be able
1162 to delete the last frame, if it is gone. */
1163 if (NILP (XCDR (Vframe_list
)))
1164 error ("Attempt to delete the only frame");
1167 /* Does this frame have a minibuffer, and is it the surrogate
1168 minibuffer for any other frame? */
1169 if (FRAME_HAS_MINIBUF_P (XFRAME (frame
)))
1173 for (frames
= Vframe_list
;
1175 frames
= XCDR (frames
))
1178 this = XCAR (frames
);
1180 if (! EQ (this, frame
)
1182 WINDOW_FRAME (XWINDOW
1183 (FRAME_MINIBUF_WINDOW (XFRAME (this))))))
1184 error ("Attempt to delete a surrogate minibuffer frame");
1188 minibuffer_selected
= EQ (minibuf_window
, selected_window
);
1190 /* Don't let the frame remain selected. */
1193 Lisp_Object tail
, frame1
;
1195 /* Look for another visible frame on the same terminal. */
1196 frame1
= next_frame (frame
, Qvisible
);
1198 /* If there is none, find *some* other frame. */
1199 if (NILP (frame1
) || EQ (frame1
, frame
))
1201 FOR_EACH_FRAME (tail
, frame1
)
1203 if (! EQ (frame
, frame1
))
1208 do_switch_frame (frame1
, Qnil
, 0);
1209 sf
= SELECTED_FRAME ();
1212 /* Don't allow minibuf_window to remain on a deleted frame. */
1213 if (EQ (f
->minibuffer_window
, minibuf_window
))
1215 Fset_window_buffer (sf
->minibuffer_window
,
1216 XWINDOW (minibuf_window
)->buffer
);
1217 minibuf_window
= sf
->minibuffer_window
;
1219 /* If the dying minibuffer window was selected,
1220 select the new one. */
1221 if (minibuffer_selected
)
1222 Fselect_window (minibuf_window
);
1225 /* Don't let echo_area_window to remain on a deleted frame. */
1226 if (EQ (f
->minibuffer_window
, echo_area_window
))
1227 echo_area_window
= sf
->minibuffer_window
;
1229 /* Clear any X selections for this frame. */
1230 #ifdef HAVE_X_WINDOWS
1232 x_clear_frame_selections (f
);
1236 This function must be called before the window tree of the
1237 frame is deleted because windows contain dynamically allocated
1241 /* Mark all the windows that used to be on FRAME as deleted, and then
1242 remove the reference to them. */
1243 delete_all_subwindows (XWINDOW (f
->root_window
));
1244 f
->root_window
= Qnil
;
1246 Vframe_list
= Fdelq (frame
, Vframe_list
);
1247 FRAME_SET_VISIBLE (f
, 0);
1251 if (FRAME_INSERT_COST (f
))
1252 xfree (FRAME_INSERT_COST (f
));
1253 if (FRAME_DELETEN_COST (f
))
1254 xfree (FRAME_DELETEN_COST (f
));
1255 if (FRAME_INSERTN_COST (f
))
1256 xfree (FRAME_INSERTN_COST (f
));
1257 if (FRAME_DELETE_COST (f
))
1258 xfree (FRAME_DELETE_COST (f
));
1259 if (FRAME_MESSAGE_BUF (f
))
1260 xfree (FRAME_MESSAGE_BUF (f
));
1262 #ifdef HAVE_WINDOW_SYSTEM
1263 /* Free all fontset data. */
1264 free_fontset_data (FRAME_FONTSET_DATA (f
));
1267 /* Since some events are handled at the interrupt level, we may get
1268 an event for f at any time; if we zero out the frame's display
1269 now, then we may trip up the event-handling code. Instead, we'll
1270 promise that the display of the frame must be valid until we have
1271 called the window-system-dependent frame destruction routine. */
1273 /* I think this should be done with a hook. */
1274 #ifdef HAVE_WINDOW_SYSTEM
1275 if (FRAME_WINDOW_P (f
))
1276 x_destroy_window (f
);
1279 /* Done by x_destroy_window above already */
1282 if (FRAME_MAC_P (f
))
1283 DisposeMacWindow (f
->output_data
.mac
);
1287 f
->output_data
.nothing
= 0;
1289 /* If we've deleted the last_nonminibuf_frame, then try to find
1291 if (f
== last_nonminibuf_frame
)
1295 last_nonminibuf_frame
= 0;
1297 for (frames
= Vframe_list
;
1299 frames
= XCDR (frames
))
1301 f
= XFRAME (XCAR (frames
));
1302 if (!FRAME_MINIBUF_ONLY_P (f
))
1304 last_nonminibuf_frame
= f
;
1310 /* If we've deleted this keyboard's default_minibuffer_frame, try to
1311 find another one. Prefer minibuffer-only frames, but also notice
1312 frames with other windows. */
1313 if (EQ (frame
, FRAME_KBOARD (f
)->Vdefault_minibuffer_frame
))
1317 /* The last frame we saw with a minibuffer, minibuffer-only or not. */
1318 Lisp_Object frame_with_minibuf
;
1319 /* Some frame we found on the same kboard, or nil if there are none. */
1320 Lisp_Object frame_on_same_kboard
;
1322 frame_on_same_kboard
= Qnil
;
1323 frame_with_minibuf
= Qnil
;
1325 for (frames
= Vframe_list
;
1327 frames
= XCDR (frames
))
1332 this = XCAR (frames
);
1337 /* Consider only frames on the same kboard
1338 and only those with minibuffers. */
1339 if (FRAME_KBOARD (f
) == FRAME_KBOARD (f1
)
1340 && FRAME_HAS_MINIBUF_P (f1
))
1342 frame_with_minibuf
= this;
1343 if (FRAME_MINIBUF_ONLY_P (f1
))
1347 if (FRAME_KBOARD (f
) == FRAME_KBOARD (f1
))
1348 frame_on_same_kboard
= this;
1351 if (!NILP (frame_on_same_kboard
))
1353 /* We know that there must be some frame with a minibuffer out
1354 there. If this were not true, all of the frames present
1355 would have to be minibufferless, which implies that at some
1356 point their minibuffer frames must have been deleted, but
1357 that is prohibited at the top; you can't delete surrogate
1358 minibuffer frames. */
1359 if (NILP (frame_with_minibuf
))
1362 FRAME_KBOARD (f
)->Vdefault_minibuffer_frame
= frame_with_minibuf
;
1365 /* No frames left on this kboard--say no minibuffer either. */
1366 FRAME_KBOARD (f
)->Vdefault_minibuffer_frame
= Qnil
;
1369 /* Cause frame titles to update--necessary if we now have just one frame. */
1370 update_mode_lines
= 1;
1375 /* Return mouse position in character cell units. */
1377 DEFUN ("mouse-position", Fmouse_position
, Smouse_position
, 0, 0, 0,
1378 "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\
1379 The position is given in character cells, where (0, 0) is the\n\
1380 upper-left corner.\n\
1381 If Emacs is running on a mouseless terminal or hasn't been programmed\n\
1382 to read the mouse position, it returns the selected frame for FRAME\n\
1383 and nil for X and Y.\n\
1384 Runs the abnormal hook `mouse-position-function' with the normal return\n\
1385 value as argument.")
1389 Lisp_Object lispy_dummy
;
1390 enum scroll_bar_part party_dummy
;
1391 Lisp_Object x
, y
, retval
;
1393 unsigned long long_dummy
;
1394 struct gcpro gcpro1
;
1396 f
= SELECTED_FRAME ();
1400 /* It's okay for the hook to refrain from storing anything. */
1401 if (mouse_position_hook
)
1402 (*mouse_position_hook
) (&f
, -1,
1403 &lispy_dummy
, &party_dummy
,
1410 pixel_to_glyph_coords (f
, col
, row
, &col
, &row
, NULL
, 1);
1415 XSETFRAME (lispy_dummy
, f
);
1416 retval
= Fcons (lispy_dummy
, Fcons (x
, y
));
1418 if (!NILP (Vmouse_position_function
))
1419 retval
= call1 (Vmouse_position_function
, retval
);
1420 RETURN_UNGCPRO (retval
);
1423 DEFUN ("mouse-pixel-position", Fmouse_pixel_position
,
1424 Smouse_pixel_position
, 0, 0, 0,
1425 "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\
1426 The position is given in pixel units, where (0, 0) is the\n\
1427 upper-left corner.\n\
1428 If Emacs is running on a mouseless terminal or hasn't been programmed\n\
1429 to read the mouse position, it returns the selected frame for FRAME\n\
1430 and nil for X and Y.")
1434 Lisp_Object lispy_dummy
;
1435 enum scroll_bar_part party_dummy
;
1437 unsigned long long_dummy
;
1439 f
= SELECTED_FRAME ();
1443 /* It's okay for the hook to refrain from storing anything. */
1444 if (mouse_position_hook
)
1445 (*mouse_position_hook
) (&f
, -1,
1446 &lispy_dummy
, &party_dummy
,
1450 XSETFRAME (lispy_dummy
, f
);
1451 return Fcons (lispy_dummy
, Fcons (x
, y
));
1454 DEFUN ("set-mouse-position", Fset_mouse_position
, Sset_mouse_position
, 3, 3, 0,
1455 "Move the mouse pointer to the center of character cell (X,Y) in FRAME.\n\
1456 Coordinates are relative to the frame, not a window,\n\
1457 so the coordinates of the top left character in the frame\n\
1458 may be nonzero due to left-hand scroll bars or the menu bar.\n\
1460 This function is a no-op for an X frame that is not visible.\n\
1461 If you have just created a frame, you must wait for it to become visible\n\
1462 before calling this function on it, like this.\n\
1463 (while (not (frame-visible-p frame)) (sleep-for .5))")
1465 Lisp_Object frame
, x
, y
;
1467 CHECK_LIVE_FRAME (frame
, 0);
1468 CHECK_NUMBER (x
, 2);
1469 CHECK_NUMBER (y
, 1);
1471 /* I think this should be done with a hook. */
1472 #ifdef HAVE_WINDOW_SYSTEM
1473 if (FRAME_WINDOW_P (XFRAME (frame
)))
1474 /* Warping the mouse will cause enternotify and focus events. */
1475 x_set_mouse_position (XFRAME (frame
), XINT (x
), XINT (y
));
1477 #if defined (MSDOS) && defined (HAVE_MOUSE)
1478 if (FRAME_MSDOS_P (XFRAME (frame
)))
1480 Fselect_frame (frame
, Qnil
);
1481 mouse_moveto (XINT (x
), XINT (y
));
1489 DEFUN ("set-mouse-pixel-position", Fset_mouse_pixel_position
,
1490 Sset_mouse_pixel_position
, 3, 3, 0,
1491 "Move the mouse pointer to pixel position (X,Y) in FRAME.\n\
1492 Note, this is a no-op for an X frame that is not visible.\n\
1493 If you have just created a frame, you must wait for it to become visible\n\
1494 before calling this function on it, like this.\n\
1495 (while (not (frame-visible-p frame)) (sleep-for .5))")
1497 Lisp_Object frame
, x
, y
;
1499 CHECK_LIVE_FRAME (frame
, 0);
1500 CHECK_NUMBER (x
, 2);
1501 CHECK_NUMBER (y
, 1);
1503 /* I think this should be done with a hook. */
1504 #ifdef HAVE_WINDOW_SYSTEM
1505 if (FRAME_WINDOW_P (XFRAME (frame
)))
1506 /* Warping the mouse will cause enternotify and focus events. */
1507 x_set_mouse_pixel_position (XFRAME (frame
), XINT (x
), XINT (y
));
1509 #if defined (MSDOS) && defined (HAVE_MOUSE)
1510 if (FRAME_MSDOS_P (XFRAME (frame
)))
1512 Fselect_frame (frame
, Qnil
);
1513 mouse_moveto (XINT (x
), XINT (y
));
1521 static void make_frame_visible_1
P_ ((Lisp_Object
));
1523 DEFUN ("make-frame-visible", Fmake_frame_visible
, Smake_frame_visible
,
1525 "Make the frame FRAME visible (assuming it is an X-window).\n\
1526 If omitted, FRAME defaults to the currently selected frame.")
1531 frame
= selected_frame
;
1533 CHECK_LIVE_FRAME (frame
, 0);
1535 /* I think this should be done with a hook. */
1536 #ifdef HAVE_WINDOW_SYSTEM
1537 if (FRAME_WINDOW_P (XFRAME (frame
)))
1539 FRAME_SAMPLE_VISIBILITY (XFRAME (frame
));
1540 x_make_frame_visible (XFRAME (frame
));
1544 make_frame_visible_1 (XFRAME (frame
)->root_window
);
1546 /* Make menu bar update for the Buffers and Frams menus. */
1547 windows_or_buffers_changed
++;
1552 /* Update the display_time slot of the buffers shown in WINDOW
1553 and all its descendents. */
1556 make_frame_visible_1 (window
)
1561 for (;!NILP (window
); window
= w
->next
)
1563 w
= XWINDOW (window
);
1565 if (!NILP (w
->buffer
))
1566 XBUFFER (w
->buffer
)->display_time
= Fcurrent_time ();
1568 if (!NILP (w
->vchild
))
1569 make_frame_visible_1 (w
->vchild
);
1570 if (!NILP (w
->hchild
))
1571 make_frame_visible_1 (w
->hchild
);
1575 DEFUN ("make-frame-invisible", Fmake_frame_invisible
, Smake_frame_invisible
,
1577 "Make the frame FRAME invisible (assuming it is an X-window).\n\
1578 If omitted, FRAME defaults to the currently selected frame.\n\
1579 Normally you may not make FRAME invisible if all other frames are invisible,\n\
1580 but if the second optional argument FORCE is non-nil, you may do so.")
1582 Lisp_Object frame
, force
;
1585 frame
= selected_frame
;
1587 CHECK_LIVE_FRAME (frame
, 0);
1589 if (NILP (force
) && !other_visible_frames (XFRAME (frame
)))
1590 error ("Attempt to make invisible the sole visible or iconified frame");
1592 #if 0 /* This isn't logically necessary, and it can do GC. */
1593 /* Don't let the frame remain selected. */
1594 if (EQ (frame
, selected_frame
))
1595 do_switch_frame (next_frame (frame
, Qt
), Qnil
, 0)
1598 /* Don't allow minibuf_window to remain on a deleted frame. */
1599 if (EQ (XFRAME (frame
)->minibuffer_window
, minibuf_window
))
1601 struct frame
*sf
= XFRAME (selected_frame
);
1602 Fset_window_buffer (sf
->minibuffer_window
,
1603 XWINDOW (minibuf_window
)->buffer
);
1604 minibuf_window
= sf
->minibuffer_window
;
1607 /* I think this should be done with a hook. */
1608 #ifdef HAVE_WINDOW_SYSTEM
1609 if (FRAME_WINDOW_P (XFRAME (frame
)))
1610 x_make_frame_invisible (XFRAME (frame
));
1613 /* Make menu bar update for the Buffers and Frams menus. */
1614 windows_or_buffers_changed
++;
1619 DEFUN ("iconify-frame", Ficonify_frame
, Siconify_frame
,
1621 "Make the frame FRAME into an icon.\n\
1622 If omitted, FRAME defaults to the currently selected frame.")
1627 frame
= selected_frame
;
1629 CHECK_LIVE_FRAME (frame
, 0);
1631 #if 0 /* This isn't logically necessary, and it can do GC. */
1632 /* Don't let the frame remain selected. */
1633 if (EQ (frame
, selected_frame
))
1634 Fhandle_switch_frame (next_frame (frame
, Qt
), Qnil
);
1637 /* Don't allow minibuf_window to remain on a deleted frame. */
1638 if (EQ (XFRAME (frame
)->minibuffer_window
, minibuf_window
))
1640 struct frame
*sf
= XFRAME (selected_frame
);
1641 Fset_window_buffer (sf
->minibuffer_window
,
1642 XWINDOW (minibuf_window
)->buffer
);
1643 minibuf_window
= sf
->minibuffer_window
;
1646 /* I think this should be done with a hook. */
1647 #ifdef HAVE_WINDOW_SYSTEM
1648 if (FRAME_WINDOW_P (XFRAME (frame
)))
1649 x_iconify_frame (XFRAME (frame
));
1652 /* Make menu bar update for the Buffers and Frams menus. */
1653 windows_or_buffers_changed
++;
1658 DEFUN ("frame-visible-p", Fframe_visible_p
, Sframe_visible_p
,
1660 "Return t if FRAME is now \"visible\" (actually in use for display).\n\
1661 A frame that is not \"visible\" is not updated and, if it works through\n\
1662 a window system, it may not show at all.\n\
1663 Return the symbol `icon' if frame is visible only as an icon.")
1667 CHECK_LIVE_FRAME (frame
, 0);
1669 FRAME_SAMPLE_VISIBILITY (XFRAME (frame
));
1671 if (FRAME_VISIBLE_P (XFRAME (frame
)))
1673 if (FRAME_ICONIFIED_P (XFRAME (frame
)))
1678 DEFUN ("visible-frame-list", Fvisible_frame_list
, Svisible_frame_list
,
1680 "Return a list of all frames now \"visible\" (being updated).")
1683 Lisp_Object tail
, frame
;
1688 for (tail
= Vframe_list
; CONSP (tail
); tail
= XCDR (tail
))
1690 frame
= XCAR (tail
);
1691 if (!FRAMEP (frame
))
1694 if (FRAME_VISIBLE_P (f
))
1695 value
= Fcons (frame
, value
);
1701 DEFUN ("raise-frame", Fraise_frame
, Sraise_frame
, 0, 1, "",
1702 "Bring FRAME to the front, so it occludes any frames it overlaps.\n\
1703 If FRAME is invisible, make it visible.\n\
1704 If you don't specify a frame, the selected frame is used.\n\
1705 If Emacs is displaying on an ordinary terminal or some other device which\n\
1706 doesn't support multiple overlapping frames, this function does nothing.")
1711 frame
= selected_frame
;
1713 CHECK_LIVE_FRAME (frame
, 0);
1715 /* Do like the documentation says. */
1716 Fmake_frame_visible (frame
);
1718 if (frame_raise_lower_hook
)
1719 (*frame_raise_lower_hook
) (XFRAME (frame
), 1);
1724 /* Should we have a corresponding function called Flower_Power? */
1725 DEFUN ("lower-frame", Flower_frame
, Slower_frame
, 0, 1, "",
1726 "Send FRAME to the back, so it is occluded by any frames that overlap it.\n\
1727 If you don't specify a frame, the selected frame is used.\n\
1728 If Emacs is displaying on an ordinary terminal or some other device which\n\
1729 doesn't support multiple overlapping frames, this function does nothing.")
1734 frame
= selected_frame
;
1736 CHECK_LIVE_FRAME (frame
, 0);
1738 if (frame_raise_lower_hook
)
1739 (*frame_raise_lower_hook
) (XFRAME (frame
), 0);
1745 DEFUN ("redirect-frame-focus", Fredirect_frame_focus
, Sredirect_frame_focus
,
1747 "Arrange for keystrokes typed at FRAME to be sent to FOCUS-FRAME.\n\
1748 In other words, switch-frame events caused by events in FRAME will\n\
1749 request a switch to FOCUS-FRAME, and `last-event-frame' will be\n\
1750 FOCUS-FRAME after reading an event typed at FRAME.\n\
1752 If FOCUS-FRAME is omitted or nil, any existing redirection is\n\
1753 cancelled, and the frame again receives its own keystrokes.\n\
1755 Focus redirection is useful for temporarily redirecting keystrokes to\n\
1756 a surrogate minibuffer frame when a frame doesn't have its own\n\
1757 minibuffer window.\n\
1759 A frame's focus redirection can be changed by select-frame. If frame\n\
1760 FOO is selected, and then a different frame BAR is selected, any\n\
1761 frames redirecting their focus to FOO are shifted to redirect their\n\
1762 focus to BAR. This allows focus redirection to work properly when the\n\
1763 user switches from one frame to another using `select-window'.\n\
1765 This means that a frame whose focus is redirected to itself is treated\n\
1766 differently from a frame whose focus is redirected to nil; the former\n\
1767 is affected by select-frame, while the latter is not.\n\
1769 The redirection lasts until `redirect-frame-focus' is called to change it.")
1770 (frame
, focus_frame
)
1771 Lisp_Object frame
, focus_frame
;
1773 /* Note that we don't check for a live frame here. It's reasonable
1774 to redirect the focus of a frame you're about to delete, if you
1775 know what other frame should receive those keystrokes. */
1776 CHECK_FRAME (frame
, 0);
1778 if (! NILP (focus_frame
))
1779 CHECK_LIVE_FRAME (focus_frame
, 1);
1781 XFRAME (frame
)->focus_frame
= focus_frame
;
1783 if (frame_rehighlight_hook
)
1784 (*frame_rehighlight_hook
) (XFRAME (frame
));
1790 DEFUN ("frame-focus", Fframe_focus
, Sframe_focus
, 1, 1, 0,
1791 "Return the frame to which FRAME's keystrokes are currently being sent.\n\
1792 This returns nil if FRAME's focus is not redirected.\n\
1793 See `redirect-frame-focus'.")
1797 CHECK_LIVE_FRAME (frame
, 0);
1799 return FRAME_FOCUS_FRAME (XFRAME (frame
));
1804 /* Return the value of frame parameter PROP in frame FRAME. */
1807 get_frame_param (frame
, prop
)
1808 register struct frame
*frame
;
1811 register Lisp_Object tem
;
1813 tem
= Fassq (prop
, frame
->param_alist
);
1819 /* Return the buffer-predicate of the selected frame. */
1822 frame_buffer_predicate (frame
)
1825 return XFRAME (frame
)->buffer_predicate
;
1828 /* Return the buffer-list of the selected frame. */
1831 frame_buffer_list (frame
)
1834 return XFRAME (frame
)->buffer_list
;
1837 /* Set the buffer-list of the selected frame. */
1840 set_frame_buffer_list (frame
, list
)
1841 Lisp_Object frame
, list
;
1843 XFRAME (frame
)->buffer_list
= list
;
1846 /* Discard BUFFER from the buffer-list of each frame. */
1849 frames_discard_buffer (buffer
)
1852 Lisp_Object frame
, tail
;
1854 FOR_EACH_FRAME (tail
, frame
)
1856 XFRAME (frame
)->buffer_list
1857 = Fdelq (buffer
, XFRAME (frame
)->buffer_list
);
1861 /* Move BUFFER to the end of the buffer-list of each frame. */
1864 frames_bury_buffer (buffer
)
1867 Lisp_Object frame
, tail
;
1869 FOR_EACH_FRAME (tail
, frame
)
1871 XFRAME (frame
)->buffer_list
1872 = nconc2 (Fdelq (buffer
, XFRAME (frame
)->buffer_list
),
1873 Fcons (buffer
, Qnil
));
1877 /* Modify the alist in *ALISTPTR to associate PROP with VAL.
1878 If the alist already has an element for PROP, we change it. */
1881 store_in_alist (alistptr
, prop
, val
)
1882 Lisp_Object
*alistptr
, val
;
1885 register Lisp_Object tem
;
1887 tem
= Fassq (prop
, *alistptr
);
1889 *alistptr
= Fcons (Fcons (prop
, val
), *alistptr
);
1895 frame_name_fnn_p (str
, len
)
1899 if (len
> 1 && str
[0] == 'F')
1903 strtol (str
+ 1, &end_ptr
, 10);
1905 if (end_ptr
== str
+ len
)
1911 /* Set the name of the terminal frame. Also used by MSDOS frames.
1912 Modeled after x_set_name which is used for WINDOW frames. */
1915 set_term_frame_name (f
, name
)
1919 f
->explicit_name
= ! NILP (name
);
1921 /* If NAME is nil, set the name to F<num>. */
1926 /* Check for no change needed in this very common case
1927 before we do any consing. */
1928 if (frame_name_fnn_p (XSTRING (f
->name
)->data
,
1929 STRING_BYTES (XSTRING (f
->name
))))
1932 terminal_frame_count
++;
1933 sprintf (namebuf
, "F%d", terminal_frame_count
);
1934 name
= build_string (namebuf
);
1938 CHECK_STRING (name
, 0);
1940 /* Don't change the name if it's already NAME. */
1941 if (! NILP (Fstring_equal (name
, f
->name
)))
1944 /* Don't allow the user to set the frame name to F<num>, so it
1945 doesn't clash with the names we generate for terminal frames. */
1946 if (frame_name_fnn_p (XSTRING (name
)->data
, STRING_BYTES (XSTRING (name
))))
1947 error ("Frame names of the form F<num> are usurped by Emacs");
1951 update_mode_lines
= 1;
1955 store_frame_param (f
, prop
, val
)
1957 Lisp_Object prop
, val
;
1959 register Lisp_Object tem
;
1961 if (EQ (prop
, Qbuffer_list
))
1963 f
->buffer_list
= val
;
1967 tem
= Fassq (prop
, f
->param_alist
);
1969 f
->param_alist
= Fcons (Fcons (prop
, val
), f
->param_alist
);
1973 if (EQ (prop
, Qbuffer_predicate
))
1974 f
->buffer_predicate
= val
;
1976 if (! FRAME_WINDOW_P (f
))
1978 if (EQ (prop
, Qmenu_bar_lines
))
1979 set_menu_bar_lines (f
, val
, make_number (FRAME_MENU_BAR_LINES (f
)));
1980 else if (EQ (prop
, Qname
))
1981 set_term_frame_name (f
, val
);
1984 if (EQ (prop
, Qminibuffer
) && WINDOWP (val
))
1986 if (! MINI_WINDOW_P (XWINDOW (val
)))
1987 error ("Surrogate minibuffer windows must be minibuffer windows.");
1989 if ((FRAME_HAS_MINIBUF_P (f
) || FRAME_MINIBUF_ONLY_P (f
))
1990 && !EQ (val
, f
->minibuffer_window
))
1991 error ("Can't change the surrogate minibuffer of a frame with its own minibuffer");
1993 /* Install the chosen minibuffer window, with proper buffer. */
1994 f
->minibuffer_window
= val
;
1998 DEFUN ("frame-parameters", Fframe_parameters
, Sframe_parameters
, 0, 1, 0,
1999 "Return the parameters-alist of frame FRAME.\n\
2000 It is a list of elements of the form (PARM . VALUE), where PARM is a symbol.\n\
2001 The meaningful PARMs depend on the kind of frame.\n\
2002 If FRAME is omitted, return information on the currently selected frame.")
2009 struct gcpro gcpro1
;
2011 if (EQ (frame
, Qnil
))
2012 frame
= selected_frame
;
2014 CHECK_FRAME (frame
, 0);
2017 if (!FRAME_LIVE_P (f
))
2020 alist
= Fcopy_alist (f
->param_alist
);
2023 if (!FRAME_WINDOW_P (f
))
2025 int fg
= FRAME_FOREGROUND_PIXEL (f
);
2026 int bg
= FRAME_BACKGROUND_PIXEL (f
);
2028 store_in_alist (&alist
, intern ("foreground-color"),
2029 tty_color_name (f
, fg
));
2030 store_in_alist (&alist
, intern ("background-color"),
2031 tty_color_name (f
, bg
));
2032 store_in_alist (&alist
, intern ("font"),
2033 build_string (FRAME_MSDOS_P (f
)
2035 : FRAME_W32_P (f
) ? "w32term" : "tty"));
2037 store_in_alist (&alist
, Qname
, f
->name
);
2038 height
= (FRAME_NEW_HEIGHT (f
) ? FRAME_NEW_HEIGHT (f
) : FRAME_HEIGHT (f
));
2039 store_in_alist (&alist
, Qheight
, make_number (height
));
2040 width
= (FRAME_NEW_WIDTH (f
) ? FRAME_NEW_WIDTH (f
) : FRAME_WIDTH (f
));
2041 store_in_alist (&alist
, Qwidth
, make_number (width
));
2042 store_in_alist (&alist
, Qmodeline
, (FRAME_WANTS_MODELINE_P (f
) ? Qt
: Qnil
));
2043 store_in_alist (&alist
, Qminibuffer
,
2044 (! FRAME_HAS_MINIBUF_P (f
) ? Qnil
2045 : FRAME_MINIBUF_ONLY_P (f
) ? Qonly
2046 : FRAME_MINIBUF_WINDOW (f
)));
2047 store_in_alist (&alist
, Qunsplittable
, (FRAME_NO_SPLIT_P (f
) ? Qt
: Qnil
));
2048 store_in_alist (&alist
, Qbuffer_list
,
2049 frame_buffer_list (selected_frame
));
2051 /* I think this should be done with a hook. */
2052 #ifdef HAVE_WINDOW_SYSTEM
2053 if (FRAME_WINDOW_P (f
))
2054 x_report_frame_params (f
, &alist
);
2058 /* This ought to be correct in f->param_alist for an X frame. */
2060 XSETFASTINT (lines
, FRAME_MENU_BAR_LINES (f
));
2061 store_in_alist (&alist
, Qmenu_bar_lines
, lines
);
2068 DEFUN ("modify-frame-parameters", Fmodify_frame_parameters
,
2069 Smodify_frame_parameters
, 2, 2, 0,
2070 "Modify the parameters of frame FRAME according to ALIST.\n\
2071 ALIST is an alist of parameters to change and their new values.\n\
2072 Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.\n\
2073 The meaningful PARMs depend on the kind of frame.\n\
2074 Undefined PARMs are ignored, but stored in the frame's parameter list\n\
2075 so that `frame-parameters' will return them.")
2077 Lisp_Object frame
, alist
;
2080 register Lisp_Object tail
, prop
, val
;
2082 if (EQ (frame
, Qnil
))
2083 frame
= selected_frame
;
2084 CHECK_LIVE_FRAME (frame
, 0);
2087 /* I think this should be done with a hook. */
2088 #ifdef HAVE_WINDOW_SYSTEM
2089 if (FRAME_WINDOW_P (f
))
2090 x_set_frame_parameters (f
, alist
);
2094 if (FRAME_MSDOS_P (f
))
2095 IT_set_frame_parameters (f
, alist
);
2099 if (FRAME_MAC_P (f
))
2100 mac_set_frame_parameters (f
, alist
);
2105 int length
= XINT (Flength (alist
));
2108 = (Lisp_Object
*) alloca (length
* sizeof (Lisp_Object
));
2110 = (Lisp_Object
*) alloca (length
* sizeof (Lisp_Object
));
2112 /* Extract parm names and values into those vectors. */
2115 for (tail
= alist
; CONSP (tail
); tail
= Fcdr (tail
))
2120 parms
[i
] = Fcar (elt
);
2121 values
[i
] = Fcdr (elt
);
2125 /* Now process them in reverse of specified order. */
2126 for (i
--; i
>= 0; i
--)
2130 store_frame_param (f
, prop
, val
);
2137 DEFUN ("frame-char-height", Fframe_char_height
, Sframe_char_height
,
2139 "Height in pixels of a line in the font in frame FRAME.\n\
2140 If FRAME is omitted, the selected frame is used.\n\
2141 For a terminal frame, the value is always 1.")
2148 frame
= selected_frame
;
2149 CHECK_FRAME (frame
, 0);
2152 #ifdef HAVE_WINDOW_SYSTEM
2153 if (FRAME_WINDOW_P (f
))
2154 return make_number (x_char_height (f
));
2157 return make_number (1);
2161 DEFUN ("frame-char-width", Fframe_char_width
, Sframe_char_width
,
2163 "Width in pixels of characters in the font in frame FRAME.\n\
2164 If FRAME is omitted, the selected frame is used.\n\
2165 The width is the same for all characters, because\n\
2166 currently Emacs supports only fixed-width fonts.\n\
2167 For a terminal screen, the value is always 1.")
2174 frame
= selected_frame
;
2175 CHECK_FRAME (frame
, 0);
2178 #ifdef HAVE_WINDOW_SYSTEM
2179 if (FRAME_WINDOW_P (f
))
2180 return make_number (x_char_width (f
));
2183 return make_number (1);
2186 DEFUN ("frame-pixel-height", Fframe_pixel_height
,
2187 Sframe_pixel_height
, 0, 1, 0,
2188 "Return a FRAME's height in pixels.\n\
2189 This counts only the height available for text lines,\n\
2190 not menu bars on window-system Emacs frames.\n\
2191 For a terminal frame, the result really gives the height in characters.\n\
2192 If FRAME is omitted, the selected frame is used.")
2199 frame
= selected_frame
;
2200 CHECK_FRAME (frame
, 0);
2203 #ifdef HAVE_WINDOW_SYSTEM
2204 if (FRAME_WINDOW_P (f
))
2205 return make_number (x_pixel_height (f
));
2208 return make_number (FRAME_HEIGHT (f
));
2211 DEFUN ("frame-pixel-width", Fframe_pixel_width
,
2212 Sframe_pixel_width
, 0, 1, 0,
2213 "Return FRAME's width in pixels.\n\
2214 For a terminal frame, the result really gives the width in characters.\n\
2215 If FRAME is omitted, the selected frame is used.")
2222 frame
= selected_frame
;
2223 CHECK_FRAME (frame
, 0);
2226 #ifdef HAVE_WINDOW_SYSTEM
2227 if (FRAME_WINDOW_P (f
))
2228 return make_number (x_pixel_width (f
));
2231 return make_number (FRAME_WIDTH (f
));
2234 DEFUN ("set-frame-height", Fset_frame_height
, Sset_frame_height
, 2, 3, 0,
2235 "Specify that the frame FRAME has LINES lines.\n\
2236 Optional third arg non-nil means that redisplay should use LINES lines\n\
2237 but that the idea of the actual height of the frame should not be changed.")
2238 (frame
, lines
, pretend
)
2239 Lisp_Object frame
, lines
, pretend
;
2241 register struct frame
*f
;
2243 CHECK_NUMBER (lines
, 0);
2245 frame
= selected_frame
;
2246 CHECK_LIVE_FRAME (frame
, 0);
2249 /* I think this should be done with a hook. */
2250 #ifdef HAVE_WINDOW_SYSTEM
2251 if (FRAME_WINDOW_P (f
))
2253 if (XINT (lines
) != f
->height
)
2254 x_set_window_size (f
, 1, f
->width
, XINT (lines
));
2255 do_pending_window_change (0);
2259 change_frame_size (f
, XINT (lines
), 0, !NILP (pretend
), 0, 0);
2263 DEFUN ("set-frame-width", Fset_frame_width
, Sset_frame_width
, 2, 3, 0,
2264 "Specify that the frame FRAME has COLS columns.\n\
2265 Optional third arg non-nil means that redisplay should use COLS columns\n\
2266 but that the idea of the actual width of the frame should not be changed.")
2267 (frame
, cols
, pretend
)
2268 Lisp_Object frame
, cols
, pretend
;
2270 register struct frame
*f
;
2271 CHECK_NUMBER (cols
, 0);
2273 frame
= selected_frame
;
2274 CHECK_LIVE_FRAME (frame
, 0);
2277 /* I think this should be done with a hook. */
2278 #ifdef HAVE_WINDOW_SYSTEM
2279 if (FRAME_WINDOW_P (f
))
2281 if (XINT (cols
) != f
->width
)
2282 x_set_window_size (f
, 1, XINT (cols
), f
->height
);
2283 do_pending_window_change (0);
2287 change_frame_size (f
, 0, XINT (cols
), !NILP (pretend
), 0, 0);
2291 DEFUN ("set-frame-size", Fset_frame_size
, Sset_frame_size
, 3, 3, 0,
2292 "Sets size of FRAME to COLS by ROWS, measured in characters.")
2294 Lisp_Object frame
, cols
, rows
;
2296 register struct frame
*f
;
2298 CHECK_LIVE_FRAME (frame
, 0);
2299 CHECK_NUMBER (cols
, 2);
2300 CHECK_NUMBER (rows
, 1);
2303 /* I think this should be done with a hook. */
2304 #ifdef HAVE_WINDOW_SYSTEM
2305 if (FRAME_WINDOW_P (f
))
2307 if (XINT (rows
) != f
->height
|| XINT (cols
) != f
->width
2308 || FRAME_NEW_HEIGHT (f
) || FRAME_NEW_WIDTH (f
))
2309 x_set_window_size (f
, 1, XINT (cols
), XINT (rows
));
2310 do_pending_window_change (0);
2314 change_frame_size (f
, XINT (rows
), XINT (cols
), 0, 0, 0);
2319 DEFUN ("set-frame-position", Fset_frame_position
,
2320 Sset_frame_position
, 3, 3, 0,
2321 "Sets position of FRAME in pixels to XOFFSET by YOFFSET.\n\
2322 This is actually the position of the upper left corner of the frame.\n\
2323 Negative values for XOFFSET or YOFFSET are interpreted relative to\n\
2324 the rightmost or bottommost possible position (that stays within the screen).")
2325 (frame
, xoffset
, yoffset
)
2326 Lisp_Object frame
, xoffset
, yoffset
;
2328 register struct frame
*f
;
2330 CHECK_LIVE_FRAME (frame
, 0);
2331 CHECK_NUMBER (xoffset
, 1);
2332 CHECK_NUMBER (yoffset
, 2);
2335 /* I think this should be done with a hook. */
2336 #ifdef HAVE_WINDOW_SYSTEM
2337 if (FRAME_WINDOW_P (f
))
2338 x_set_offset (f
, XINT (xoffset
), XINT (yoffset
), 1);
2350 staticpro (&Vframe_list
);
2352 DEFVAR_LISP ("terminal-frame", &Vterminal_frame
,
2353 "The initial frame-object, which represents Emacs's stdout.");
2355 DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified
,
2356 "Non-nil if all of emacs is iconified and frame updates are not needed.");
2357 Vemacs_iconified
= Qnil
;
2359 DEFVAR_LISP ("mouse-position-function", &Vmouse_position_function
,
2360 "If non-nil, function applied to the normal result of `mouse-position'.\n\
2361 This abnormal hook exists for the benefit of packages like XTerm-mouse\n\
2362 which need to do mouse handling at the Lisp level.");
2363 Vmouse_position_function
= Qnil
;
2365 DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame
,
2366 "Minibufferless frames use this frame's minibuffer.\n\
2368 Emacs cannot create minibufferless frames unless this is set to an\n\
2369 appropriate surrogate.\n\
2371 Emacs consults this variable only when creating minibufferless\n\
2372 frames; once the frame is created, it sticks with its assigned\n\
2373 minibuffer, no matter what this variable is set to. This means that\n\
2374 this variable doesn't necessarily say anything meaningful about the\n\
2375 current set of frames, or where the minibuffer is currently being\n\
2378 defsubr (&Sactive_minibuffer_window
);
2380 defsubr (&Sframe_live_p
);
2381 defsubr (&Smake_terminal_frame
);
2382 defsubr (&Shandle_switch_frame
);
2383 defsubr (&Signore_event
);
2384 defsubr (&Sselect_frame
);
2385 defsubr (&Sselected_frame
);
2386 defsubr (&Swindow_frame
);
2387 defsubr (&Sframe_root_window
);
2388 defsubr (&Sframe_first_window
);
2389 defsubr (&Sframe_selected_window
);
2390 defsubr (&Sset_frame_selected_window
);
2391 defsubr (&Sframe_list
);
2392 defsubr (&Snext_frame
);
2393 defsubr (&Sprevious_frame
);
2394 defsubr (&Sdelete_frame
);
2395 defsubr (&Smouse_position
);
2396 defsubr (&Smouse_pixel_position
);
2397 defsubr (&Sset_mouse_position
);
2398 defsubr (&Sset_mouse_pixel_position
);
2400 defsubr (&Sframe_configuration
);
2401 defsubr (&Srestore_frame_configuration
);
2403 defsubr (&Smake_frame_visible
);
2404 defsubr (&Smake_frame_invisible
);
2405 defsubr (&Siconify_frame
);
2406 defsubr (&Sframe_visible_p
);
2407 defsubr (&Svisible_frame_list
);
2408 defsubr (&Sraise_frame
);
2409 defsubr (&Slower_frame
);
2410 defsubr (&Sredirect_frame_focus
);
2411 defsubr (&Sframe_focus
);
2412 defsubr (&Sframe_parameters
);
2413 defsubr (&Smodify_frame_parameters
);
2414 defsubr (&Sframe_char_height
);
2415 defsubr (&Sframe_char_width
);
2416 defsubr (&Sframe_pixel_height
);
2417 defsubr (&Sframe_pixel_width
);
2418 defsubr (&Sset_frame_height
);
2419 defsubr (&Sset_frame_width
);
2420 defsubr (&Sset_frame_size
);
2421 defsubr (&Sset_frame_position
);
2427 initial_define_lispy_key (global_map
, "switch-frame", "handle-switch-frame");
2428 initial_define_lispy_key (global_map
, "delete-frame", "handle-delete-frame");
2429 initial_define_lispy_key (global_map
, "iconify-frame", "ignore-event");
2430 initial_define_lispy_key (global_map
, "make-frame-visible", "ignore-event");