annotate src/frame.c @ 36971:3819e613c7c2

(Fframe_list): Don't return a tooltip frame.
author Gerd Moellmann <gerd@gnu.org>
date Sun, 25 Mar 2001 11:37:11 +0000
parents a9485f8e43d6
children 1b91be709189
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1 /* Generic frame functions.
36433
20b42ba5a623 (make_frame): Use allocate_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 35817
diff changeset
2 Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001
20b42ba5a623 (make_frame): Use allocate_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 35817
diff changeset
3 Free Software Foundation.
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5 This file is part of GNU Emacs.
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7 GNU Emacs is free software; you can redistribute it and/or modify
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
8 it under the terms of the GNU General Public License as published by
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
9 the Free Software Foundation; either version 2, or (at your option)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10 any later version.
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12 GNU Emacs is distributed in the hope that it will be useful,
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15 GNU General Public License for more details.
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
18 along with GNU Emacs; see the file COPYING. If not, write to
14186
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 14077
diff changeset
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 14077
diff changeset
20 Boston, MA 02111-1307, USA. */
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21
7900
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
22 #include <config.h>
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
23
7900
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
24 #include <stdio.h>
987
afb21e974ed2 * frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents: 965
diff changeset
25 #include "lisp.h"
17032
814257735e7d Include "charset.h"
Karl Heuer <kwzh@gnu.org>
parents: 16588
diff changeset
26 #include "charset.h"
21825
697991d2a2c4 Conditionally include xterm.h using HAVE_X_WINDOWS.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21524
diff changeset
27 #ifdef HAVE_X_WINDOWS
21514
fa9ff387d260 Fix -Wimplicit warnings.
Andreas Schwab <schwab@suse.de>
parents: 21359
diff changeset
28 #include "xterm.h"
17032
814257735e7d Include "charset.h"
Karl Heuer <kwzh@gnu.org>
parents: 16588
diff changeset
29 #endif
27633
ab6c81c6edf8 [WINDOWSNT]: Include w32term.h.
Andrew Innes <andrewi@gnu.org>
parents: 27575
diff changeset
30 #ifdef WINDOWSNT
ab6c81c6edf8 [WINDOWSNT]: Include w32term.h.
Andrew Innes <andrewi@gnu.org>
parents: 27575
diff changeset
31 #include "w32term.h"
ab6c81c6edf8 [WINDOWSNT]: Include w32term.h.
Andrew Innes <andrewi@gnu.org>
parents: 27575
diff changeset
32 #endif
32752
923b8d6d8277 Initial check-in: changes for building Emacs under Mac OS.
Andrew Choi <akochoi@shaw.ca>
parents: 32545
diff changeset
33 #ifdef macintosh
923b8d6d8277 Initial check-in: changes for building Emacs under Mac OS.
Andrew Choi <akochoi@shaw.ca>
parents: 32545
diff changeset
34 #include "macterm.h"
923b8d6d8277 Initial check-in: changes for building Emacs under Mac OS.
Andrew Choi <akochoi@shaw.ca>
parents: 32545
diff changeset
35 #endif
31102
6a0caa788013 Include keyboard.h before frame.h.
Andrew Innes <andrewi@gnu.org>
parents: 29995
diff changeset
36 #include "buffer.h"
6a0caa788013 Include keyboard.h before frame.h.
Andrew Innes <andrewi@gnu.org>
parents: 29995
diff changeset
37 /* These help us bind and responding to switch-frame events. */
6a0caa788013 Include keyboard.h before frame.h.
Andrew Innes <andrewi@gnu.org>
parents: 29995
diff changeset
38 #include "commands.h"
6a0caa788013 Include keyboard.h before frame.h.
Andrew Innes <andrewi@gnu.org>
parents: 29995
diff changeset
39 #include "keyboard.h"
987
afb21e974ed2 * frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents: 965
diff changeset
40 #include "frame.h"
23515
1e52542fb338 Include frame.h before fontset.h.
Kenichi Handa <handa@m17n.org>
parents: 22188
diff changeset
41 #ifdef HAVE_WINDOW_SYSTEM
1e52542fb338 Include frame.h before fontset.h.
Kenichi Handa <handa@m17n.org>
parents: 22188
diff changeset
42 #include "fontset.h"
1e52542fb338 Include frame.h before fontset.h.
Kenichi Handa <handa@m17n.org>
parents: 22188
diff changeset
43 #endif
5392
d8d5844c3ba6 Always include termhooks.h.
Richard M. Stallman <rms@gnu.org>
parents: 5231
diff changeset
44 #include "termhooks.h"
21514
fa9ff387d260 Fix -Wimplicit warnings.
Andreas Schwab <schwab@suse.de>
parents: 21359
diff changeset
45 #include "dispextern.h"
7162
06a13bf36a8c (Fframe_parameters) [!MULTI_FRAME]: Unstub it again.
Karl Heuer <kwzh@gnu.org>
parents: 7134
diff changeset
46 #include "window.h"
9572
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 9309
diff changeset
47 #ifdef MSDOS
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 9309
diff changeset
48 #include "msdos.h"
25117
f6f34f0bc1af (make_terminal_frame) [MSDOS]: Don't call
Eli Zaretskii <eliz@gnu.org>
parents: 25030
diff changeset
49 #include "dosfns.h"
9572
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 9309
diff changeset
50 #endif
732
a8d94735277e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 714
diff changeset
51
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
52 Lisp_Object Qframep;
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
53 Lisp_Object Qframe_live_p;
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
54 Lisp_Object Qheight;
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
55 Lisp_Object Qicon;
539
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
56 Lisp_Object Qminibuffer;
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
57 Lisp_Object Qmodeline;
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
58 Lisp_Object Qname;
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
59 Lisp_Object Qonly;
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
60 Lisp_Object Qunsplittable;
2131
468df2d7e371 (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2068
diff changeset
61 Lisp_Object Qmenu_bar_lines;
25544
693ca9ba497a Change spelling of `toolbar' to `tool_bar' or `tool-bar'.
Gerd Moellmann <gerd@gnu.org>
parents: 25523
diff changeset
62 Lisp_Object Qtool_bar_lines;
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
63 Lisp_Object Qwidth;
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
64 Lisp_Object Qx;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16568
diff changeset
65 Lisp_Object Qw32;
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
66 Lisp_Object Qpc;
25523
9e9eeb68482e (Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents: 25350
diff changeset
67 Lisp_Object Qmac;
6246
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
68 Lisp_Object Qvisible;
10207
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
69 Lisp_Object Qbuffer_predicate;
17221
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
70 Lisp_Object Qbuffer_list;
14217
673d1913844b (syms_of_frame_1): Initialize Qtitle.
Richard M. Stallman <rms@gnu.org>
parents: 14186
diff changeset
71 Lisp_Object Qtitle;
31399
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
72 Lisp_Object Qdisplay_type;
31448
70b366918608 (Fframe_parameter): Handle `name' and `background-mode'
Gerd Moellmann <gerd@gnu.org>
parents: 31442
diff changeset
73 Lisp_Object Qbackground_mode;
33509
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
74 Lisp_Object Qinhibit_default_face_x_resources;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
75
12761
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
76 Lisp_Object Vterminal_frame;
13522
6a97ea1245b5 (syms_of_frame_1): Set up Vdefault_frame_alist here.
Richard M. Stallman <rms@gnu.org>
parents: 13498
diff changeset
77 Lisp_Object Vdefault_frame_alist;
27795
83292274bbd4 (Vmouse_position_function): New variable.
Dave Love <fx@gnu.org>
parents: 27725
diff changeset
78 Lisp_Object Vmouse_position_function;
12761
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
79
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
80 static void
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
81 set_menu_bar_lines_1 (window, n)
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
82 Lisp_Object window;
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
83 int n;
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
84 {
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
85 struct window *w = XWINDOW (window);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
86
13498
c10046894834 (set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
parents: 13412
diff changeset
87 XSETFASTINT (w->last_modified, 0);
12761
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
88 XSETFASTINT (w->top, XFASTINT (w->top) + n);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
89 XSETFASTINT (w->height, XFASTINT (w->height) - n);
28010
5e3c139838a6 (x_set_menu_bar_lines_1): Adjust window's orig_top and
Gerd Moellmann <gerd@gnu.org>
parents: 27800
diff changeset
90
5e3c139838a6 (x_set_menu_bar_lines_1): Adjust window's orig_top and
Gerd Moellmann <gerd@gnu.org>
parents: 27800
diff changeset
91 if (INTEGERP (w->orig_top))
5e3c139838a6 (x_set_menu_bar_lines_1): Adjust window's orig_top and
Gerd Moellmann <gerd@gnu.org>
parents: 27800
diff changeset
92 XSETFASTINT (w->orig_top, XFASTINT (w->orig_top) + n);
5e3c139838a6 (x_set_menu_bar_lines_1): Adjust window's orig_top and
Gerd Moellmann <gerd@gnu.org>
parents: 27800
diff changeset
93 if (INTEGERP (w->orig_height))
5e3c139838a6 (x_set_menu_bar_lines_1): Adjust window's orig_top and
Gerd Moellmann <gerd@gnu.org>
parents: 27800
diff changeset
94 XSETFASTINT (w->orig_height, XFASTINT (w->orig_height) - n);
12761
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
95
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
96 /* Handle just the top child in a vertical split. */
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
97 if (!NILP (w->vchild))
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
98 set_menu_bar_lines_1 (w->vchild, n);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
99
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
100 /* Adjust all children in a horizontal split. */
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
101 for (window = w->hchild; !NILP (window); window = w->next)
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
102 {
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
103 w = XWINDOW (window);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
104 set_menu_bar_lines_1 (window, n);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
105 }
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
106 }
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
107
20038
bb460edc7187 (set_menu_bar_lines): Make the function external instead
Eli Zaretskii <eliz@gnu.org>
parents: 19532
diff changeset
108 void
12761
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
109 set_menu_bar_lines (f, value, oldval)
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
110 struct frame *f;
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
111 Lisp_Object value, oldval;
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
112 {
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
113 int nlines;
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
114 int olines = FRAME_MENU_BAR_LINES (f);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
115
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
116 /* Right now, menu bars don't work properly in minibuf-only frames;
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
117 most of the commands try to apply themselves to the minibuffer
16051
ccf489f8596e Removed support for !MULTI_FRAME.
Karl Heuer <kwzh@gnu.org>
parents: 15696
diff changeset
118 frame itself, and get an error because you can't switch buffers
12761
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
119 in or split the minibuffer window. */
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
120 if (FRAME_MINIBUF_ONLY_P (f))
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
121 return;
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
122
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
123 if (INTEGERP (value))
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
124 nlines = XINT (value);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
125 else
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
126 nlines = 0;
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
127
13498
c10046894834 (set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
parents: 13412
diff changeset
128 if (nlines != olines)
c10046894834 (set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
parents: 13412
diff changeset
129 {
c10046894834 (set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
parents: 13412
diff changeset
130 windows_or_buffers_changed++;
c10046894834 (set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
parents: 13412
diff changeset
131 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
c10046894834 (set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
parents: 13412
diff changeset
132 FRAME_MENU_BAR_LINES (f) = nlines;
c10046894834 (set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
parents: 13412
diff changeset
133 set_menu_bar_lines_1 (f->root_window, nlines - olines);
25030
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
134 adjust_glyphs (f);
13498
c10046894834 (set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
parents: 13412
diff changeset
135 }
12761
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
136 }
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
137
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
138 Lisp_Object Vemacs_iconified;
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
139 Lisp_Object Vframe_list;
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
140
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26164
diff changeset
141 struct x_output tty_display;
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26164
diff changeset
142
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
143 extern Lisp_Object Vminibuffer_list;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
144 extern Lisp_Object get_minibuffer ();
5172
9aa201005b16 (Fhandle_switch_frame, Fredirect_frame_focus): Declared.
Richard M. Stallman <rms@gnu.org>
parents: 5105
diff changeset
145 extern Lisp_Object Fhandle_switch_frame ();
9aa201005b16 (Fhandle_switch_frame, Fredirect_frame_focus): Declared.
Richard M. Stallman <rms@gnu.org>
parents: 5105
diff changeset
146 extern Lisp_Object Fredirect_frame_focus ();
12005
4a722a97c8d3 Declare x_get_focus_frame.
Karl Heuer <kwzh@gnu.org>
parents: 11906
diff changeset
147 extern Lisp_Object x_get_focus_frame ();
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
148
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
149 DEFUN ("framep", Fframep, Sframep, 1, 1, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
150 "Return non-nil if OBJECT is a frame.\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
151 Value is t for a termcap frame (a character-only terminal),\n\
9572
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 9309
diff changeset
152 `x' for an Emacs frame that is really an X window,\n\
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26164
diff changeset
153 `w32' for an Emacs frame that is a window on MS-Windows display,\n\
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26164
diff changeset
154 `mac' for an Emacs frame on a Macintosh display,\n\
9572
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 9309
diff changeset
155 `pc' for a direct-write MS-DOS frame.\n\
10851
8064f933eed7 (Fframep): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 10783
diff changeset
156 See also `frame-live-p'.")
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
157 (object)
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
158 Lisp_Object object;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
159 {
9127
0b4836daa8e1 (Fframep, make_frame_without_minibuffer, do_switch_frame, prev_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9032
diff changeset
160 if (!FRAMEP (object))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
161 return Qnil;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
162 switch (XFRAME (object)->output_method)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
163 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
164 case output_termcap:
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
165 return Qt;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
166 case output_x_window:
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
167 return Qx;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16568
diff changeset
168 case output_w32:
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16568
diff changeset
169 return Qw32;
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
170 case output_msdos_raw:
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
171 return Qpc;
25523
9e9eeb68482e (Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents: 25350
diff changeset
172 case output_mac:
9e9eeb68482e (Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents: 25350
diff changeset
173 return Qmac;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
174 default:
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
175 abort ();
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
176 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
177 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
178
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
179 DEFUN ("frame-live-p", Fframe_live_p, Sframe_live_p, 1, 1, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
180 "Return non-nil if OBJECT is a frame which has not been deleted.\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
181 Value is nil if OBJECT is not a live frame. If object is a live\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
182 frame, the return value indicates what sort of output device it is\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
183 displayed on. Value is t for a termcap frame (a character-only\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
184 terminal), `x' for an Emacs frame being displayed in an X window.")
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
185 (object)
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
186 Lisp_Object object;
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
187 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
188 return ((FRAMEP (object)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
189 && FRAME_LIVE_P (XFRAME (object)))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
190 ? Fframep (object)
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
191 : Qnil);
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
192 }
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
193
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
194 struct frame *
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
195 make_frame (mini_p)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
196 int mini_p;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
197 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
198 Lisp_Object frame;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
199 register struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
200 register Lisp_Object root_window;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
201 register Lisp_Object mini_window;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
202
36433
20b42ba5a623 (make_frame): Use allocate_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 35817
diff changeset
203 f = allocate_frame ();
9972
92b33538b36a (make_frame): Use allocate_vectorlike and VECSIZE.
Karl Heuer <kwzh@gnu.org>
parents: 9901
diff changeset
204 XSETFRAME (frame, f);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
205
25030
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
206 f->desired_matrix = 0;
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
207 f->current_matrix = 0;
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
208 f->desired_pool = 0;
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
209 f->current_pool = 0;
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
210 f->glyphs_initialized_p = 0;
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
211 f->decode_mode_spec_buffer = 0;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
212 f->visible = 0;
1652
93497cd89204 * frame.c (make_frame): Initialize async_visible and
Jim Blandy <jimb@redhat.com>
parents: 1514
diff changeset
213 f->async_visible = 0;
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12630
diff changeset
214 f->output_data.nothing = 0;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
215 f->iconified = 0;
1652
93497cd89204 * frame.c (make_frame): Initialize async_visible and
Jim Blandy <jimb@redhat.com>
parents: 1514
diff changeset
216 f->async_iconified = 0;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
217 f->wants_modeline = 1;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
218 f->auto_raise = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
219 f->auto_lower = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
220 f->no_split = 0;
27725
fb13a4706619 (make_frame): Set frame initiallly to `garbaged'.
Gerd Moellmann <gerd@gnu.org>
parents: 27633
diff changeset
221 f->garbaged = 1;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
222 f->has_minibuffer = mini_p;
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
223 f->focus_frame = Qnil;
1006
a13ee72d74a2 * frame.c (make_frame): Clear the explicit_name member of the new
Jim Blandy <jimb@redhat.com>
parents: 987
diff changeset
224 f->explicit_name = 0;
1989
b1c1ab20f810 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1920
diff changeset
225 f->can_have_scroll_bars = 0;
16263
a369af16e836 (make_frame): Switch from boolean `has_vertical_scrollbars' integer to
Richard M. Stallman <rms@gnu.org>
parents: 16184
diff changeset
226 f->vertical_scroll_bar_type = vertical_scroll_bar_none;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
227 f->param_alist = Qnil;
1989
b1c1ab20f810 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1920
diff changeset
228 f->scroll_bars = Qnil;
b1c1ab20f810 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1920
diff changeset
229 f->condemned_scroll_bars = Qnil;
2417
8c07933beed9 (make_frame): Init face_alist field.
Richard M. Stallman <rms@gnu.org>
parents: 2298
diff changeset
230 f->face_alist = Qnil;
25030
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
231 f->face_cache = NULL;
6130
d4e5878462cb (make_frame): Init menu_bar_items field to 0.
Richard M. Stallman <rms@gnu.org>
parents: 6054
diff changeset
232 f->menu_bar_items = Qnil;
7095
098b87bde5a7 (make_frame): Initialize fields menu_bar_vector and menu_bar_items_used.
Richard M. Stallman <rms@gnu.org>
parents: 7055
diff changeset
233 f->menu_bar_vector = Qnil;
098b87bde5a7 (make_frame): Initialize fields menu_bar_vector and menu_bar_items_used.
Richard M. Stallman <rms@gnu.org>
parents: 7055
diff changeset
234 f->menu_bar_items_used = 0;
10207
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
235 f->buffer_predicate = Qnil;
17221
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
236 f->buffer_list = Qnil;
11017
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
237 #ifdef MULTI_KBOARD
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
238 f->kboard = initial_kboard;
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
239 #endif
14303
48e3ee5005cd (make_frame): Initialize title parameter to Qnil.
Karl Heuer <kwzh@gnu.org>
parents: 14223
diff changeset
240 f->namebuf = 0;
14223
596bb10704dd (make_frame): Initialize frame title field to nil.
Erik Naggum <erik@naggum.no>
parents: 14217
diff changeset
241 f->title = Qnil;
25030
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
242 f->menu_bar_window = Qnil;
25544
693ca9ba497a Change spelling of `toolbar' to `tool_bar' or `tool-bar'.
Gerd Moellmann <gerd@gnu.org>
parents: 25523
diff changeset
243 f->tool_bar_window = Qnil;
33760
22dc6e2e7410 (make_frame): Change initialization of tool bar
Gerd Moellmann <gerd@gnu.org>
parents: 33512
diff changeset
244 f->tool_bar_items = Qnil;
25544
693ca9ba497a Change spelling of `toolbar' to `tool_bar' or `tool-bar'.
Gerd Moellmann <gerd@gnu.org>
parents: 25523
diff changeset
245 f->desired_tool_bar_string = f->current_tool_bar_string = Qnil;
33760
22dc6e2e7410 (make_frame): Change initialization of tool bar
Gerd Moellmann <gerd@gnu.org>
parents: 33512
diff changeset
246 f->n_tool_bar_items = 0;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
247
987
afb21e974ed2 * frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents: 965
diff changeset
248 root_window = make_window ();
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
249 if (mini_p)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
250 {
987
afb21e974ed2 * frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents: 965
diff changeset
251 mini_window = make_window ();
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
252 XWINDOW (root_window)->next = mini_window;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
253 XWINDOW (mini_window)->prev = root_window;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
254 XWINDOW (mini_window)->mini_p = Qt;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
255 XWINDOW (mini_window)->frame = frame;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
256 f->minibuffer_window = mini_window;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
257 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
258 else
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
259 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
260 mini_window = Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
261 XWINDOW (root_window)->next = Qnil;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
262 f->minibuffer_window = Qnil;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
263 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
264
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
265 XWINDOW (root_window)->frame = frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
266
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
267 /* 10 is arbitrary,
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
268 just so that there is "something there."
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
269 Correct size will be set up later with change_frame_size. */
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
270
16263
a369af16e836 (make_frame): Switch from boolean `has_vertical_scrollbars' integer to
Richard M. Stallman <rms@gnu.org>
parents: 16184
diff changeset
271 SET_FRAME_WIDTH (f, 10);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
272 f->height = 10;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
273
9309
27370f65dfa1 (make_frame, Fframe_parameters, Fselected_frame, syms_of_frame): Don't use
Karl Heuer <kwzh@gnu.org>
parents: 9268
diff changeset
274 XSETFASTINT (XWINDOW (root_window)->width, 10);
27370f65dfa1 (make_frame, Fframe_parameters, Fselected_frame, syms_of_frame): Don't use
Karl Heuer <kwzh@gnu.org>
parents: 9268
diff changeset
275 XSETFASTINT (XWINDOW (root_window)->height, (mini_p ? 9 : 10));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
276
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
277 if (mini_p)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
278 {
9309
27370f65dfa1 (make_frame, Fframe_parameters, Fselected_frame, syms_of_frame): Don't use
Karl Heuer <kwzh@gnu.org>
parents: 9268
diff changeset
279 XSETFASTINT (XWINDOW (mini_window)->width, 10);
27370f65dfa1 (make_frame, Fframe_parameters, Fselected_frame, syms_of_frame): Don't use
Karl Heuer <kwzh@gnu.org>
parents: 9268
diff changeset
280 XSETFASTINT (XWINDOW (mini_window)->top, 9);
27370f65dfa1 (make_frame, Fframe_parameters, Fselected_frame, syms_of_frame): Don't use
Karl Heuer <kwzh@gnu.org>
parents: 9268
diff changeset
281 XSETFASTINT (XWINDOW (mini_window)->height, 1);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
282 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
283
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
284 /* Choose a buffer for the frame's root window. */
386
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
285 {
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
286 Lisp_Object buf;
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
287
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
288 XWINDOW (root_window)->buffer = Qt;
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
289 buf = Fcurrent_buffer ();
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
290 /* If buf is a 'hidden' buffer (i.e. one whose name starts with
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
291 a space), try to find another one. */
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
292 if (XSTRING (Fbuffer_name (buf))->data[0] == ' ')
22188
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
293 buf = Fother_buffer (buf, Qnil, Qnil);
17221
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
294
25030
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
295 /* Use set_window_buffer, not Fset_window_buffer, and don't let
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
296 hooks be run by it. The reason is that the whole frame/window
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
297 arrangement is not yet fully intialized at this point. Windows
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
298 don't have the right size, glyph matrices aren't initialized
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
299 etc. Running Lisp functions at this point surely ends in a
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
300 SEGV. */
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
301 set_window_buffer (root_window, buf, 0);
17221
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
302 f->buffer_list = Fcons (buf, Qnil);
386
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
303 }
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
304
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
305 if (mini_p)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
306 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
307 XWINDOW (mini_window)->buffer = Qt;
25030
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
308 set_window_buffer (mini_window,
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
309 (NILP (Vminibuffer_list)
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
310 ? get_minibuffer (0)
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
311 : Fcar (Vminibuffer_list)),
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
312 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
313 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
314
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
315 f->root_window = root_window;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
316 f->selected_window = root_window;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
317 /* Make sure this window seems more recently used than
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
318 a newly-created, never-selected window. */
9309
27370f65dfa1 (make_frame, Fframe_parameters, Fselected_frame, syms_of_frame): Don't use
Karl Heuer <kwzh@gnu.org>
parents: 9268
diff changeset
319 XSETFASTINT (XWINDOW (f->selected_window)->use_time, ++window_select_count);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
320
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
321 return f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
322 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
323
21359
f66e706fc9d6 (make_frame_without_minibuffer): Conditionalize on HAVE_WINDOW_SYSTEM.
Richard M. Stallman <rms@gnu.org>
parents: 21244
diff changeset
324 #ifdef HAVE_WINDOW_SYSTEM
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
325 /* Make a frame using a separate minibuffer window on another frame.
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
326 MINI_WINDOW is the minibuffer window to use. nil means use the
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
327 default (the global minibuffer). */
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
328
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
329 struct frame *
12010
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
330 make_frame_without_minibuffer (mini_window, kb, display)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
331 register Lisp_Object mini_window;
11775
fe7852953b75 (make_frame_without_minibuffer): New arg KB.
Karl Heuer <kwzh@gnu.org>
parents: 11773
diff changeset
332 KBOARD *kb;
12010
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
333 Lisp_Object display;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
334 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
335 register struct frame *f;
15555
5ceed3aa6a1c (make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents: 15396
diff changeset
336 struct gcpro gcpro1;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
337
12010
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
338 if (!NILP (mini_window))
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
339 CHECK_LIVE_WINDOW (mini_window, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
340
11775
fe7852953b75 (make_frame_without_minibuffer): New arg KB.
Karl Heuer <kwzh@gnu.org>
parents: 11773
diff changeset
341 #ifdef MULTI_KBOARD
12010
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
342 if (!NILP (mini_window)
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
343 && XFRAME (XWINDOW (mini_window)->frame)->kboard != kb)
11775
fe7852953b75 (make_frame_without_minibuffer): New arg KB.
Karl Heuer <kwzh@gnu.org>
parents: 11773
diff changeset
344 error ("frame and minibuffer must be on the same display");
fe7852953b75 (make_frame_without_minibuffer): New arg KB.
Karl Heuer <kwzh@gnu.org>
parents: 11773
diff changeset
345 #endif
fe7852953b75 (make_frame_without_minibuffer): New arg KB.
Karl Heuer <kwzh@gnu.org>
parents: 11773
diff changeset
346
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
347 /* Make a frame containing just a root window. */
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
348 f = make_frame (0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
349
12010
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
350 if (NILP (mini_window))
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
351 {
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
352 /* Use default-minibuffer-frame if possible. */
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
353 if (!FRAMEP (kb->Vdefault_minibuffer_frame)
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
354 || ! FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame)))
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
355 {
15555
5ceed3aa6a1c (make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents: 15396
diff changeset
356 Lisp_Object frame_dummy;
5ceed3aa6a1c (make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents: 15396
diff changeset
357
5ceed3aa6a1c (make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents: 15396
diff changeset
358 XSETFRAME (frame_dummy, f);
5ceed3aa6a1c (make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents: 15396
diff changeset
359 GCPRO1 (frame_dummy);
12010
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
360 /* If there's no minibuffer frame to use, create one. */
15555
5ceed3aa6a1c (make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents: 15396
diff changeset
361 kb->Vdefault_minibuffer_frame =
5ceed3aa6a1c (make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents: 15396
diff changeset
362 call1 (intern ("make-initial-minibuffer-frame"), display);
5ceed3aa6a1c (make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents: 15396
diff changeset
363 UNGCPRO;
12010
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
364 }
15555
5ceed3aa6a1c (make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents: 15396
diff changeset
365
12010
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
366 mini_window = XFRAME (kb->Vdefault_minibuffer_frame)->minibuffer_window;
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
367 }
15001
c74ce6421d04 (make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents: 14966
diff changeset
368
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
369 f->minibuffer_window = mini_window;
15001
c74ce6421d04 (make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents: 14966
diff changeset
370
c74ce6421d04 (make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents: 14966
diff changeset
371 /* Make the chosen minibuffer window display the proper minibuffer,
c74ce6421d04 (make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents: 14966
diff changeset
372 unless it is already showing a minibuffer. */
c74ce6421d04 (make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents: 14966
diff changeset
373 if (NILP (Fmemq (XWINDOW (mini_window)->buffer, Vminibuffer_list)))
c74ce6421d04 (make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents: 14966
diff changeset
374 Fset_window_buffer (mini_window,
c74ce6421d04 (make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents: 14966
diff changeset
375 (NILP (Vminibuffer_list)
c74ce6421d04 (make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents: 14966
diff changeset
376 ? get_minibuffer (0)
c74ce6421d04 (make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents: 14966
diff changeset
377 : Fcar (Vminibuffer_list)));
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
378 return f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
379 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
380
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
381 /* Make a frame containing only a minibuffer window. */
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
382
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
383 struct frame *
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
384 make_minibuffer_frame ()
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
385 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
386 /* First make a frame containing just a root window, no minibuffer. */
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
387
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
388 register struct frame *f = make_frame (0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
389 register Lisp_Object mini_window;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
390 register Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
391
9268
cb55d0155265 (make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9214
diff changeset
392 XSETFRAME (frame, f);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
393
1006
a13ee72d74a2 * frame.c (make_frame): Clear the explicit_name member of the new
Jim Blandy <jimb@redhat.com>
parents: 987
diff changeset
394 f->auto_raise = 0;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
395 f->auto_lower = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
396 f->no_split = 1;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
397 f->wants_modeline = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
398 f->has_minibuffer = 1;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
399
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
400 /* Now label the root window as also being the minibuffer.
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
401 Avoid infinite looping on the window chain by marking next pointer
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
402 as nil. */
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
403
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
404 mini_window = f->minibuffer_window = f->root_window;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
405 XWINDOW (mini_window)->mini_p = Qt;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
406 XWINDOW (mini_window)->next = Qnil;
1006
a13ee72d74a2 * frame.c (make_frame): Clear the explicit_name member of the new
Jim Blandy <jimb@redhat.com>
parents: 987
diff changeset
407 XWINDOW (mini_window)->prev = Qnil;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
408 XWINDOW (mini_window)->frame = frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
409
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
410 /* Put the proper buffer in that window. */
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
411
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
412 Fset_window_buffer (mini_window,
485
8c615e453683 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 454
diff changeset
413 (NILP (Vminibuffer_list)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
414 ? get_minibuffer (0)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
415 : Fcar (Vminibuffer_list)));
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
416 return f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
417 }
21359
f66e706fc9d6 (make_frame_without_minibuffer): Conditionalize on HAVE_WINDOW_SYSTEM.
Richard M. Stallman <rms@gnu.org>
parents: 21244
diff changeset
418 #endif /* HAVE_WINDOW_SYSTEM */
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
419
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
420 /* Construct a frame that refers to the terminal (stdin and stdout). */
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
421
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
422 static int terminal_frame_count;
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
423
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
424 struct frame *
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
425 make_terminal_frame ()
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
426 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
427 register struct frame *f;
5231
6646271e8d32 (make_terminal_frame): Add frame to Vframe_list.
Richard M. Stallman <rms@gnu.org>
parents: 5172
diff changeset
428 Lisp_Object frame;
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
429 char name[20];
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
430
11017
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
431 #ifdef MULTI_KBOARD
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
432 if (!initial_kboard)
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
433 {
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
434 initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
435 init_kboard (initial_kboard);
11364
9c609a5bd245 (make_terminal_frame): all_kboards means initial_kboard too.
Karl Heuer <kwzh@gnu.org>
parents: 11355
diff changeset
436 initial_kboard->next_kboard = all_kboards;
9c609a5bd245 (make_terminal_frame): all_kboards means initial_kboard too.
Karl Heuer <kwzh@gnu.org>
parents: 11355
diff changeset
437 all_kboards = initial_kboard;
11017
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
438 }
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
439 #endif
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
440
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
441 /* The first call must initialize Vframe_list. */
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
442 if (! (NILP (Vframe_list) || CONSP (Vframe_list)))
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
443 Vframe_list = Qnil;
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
444
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
445 f = make_frame (1);
5231
6646271e8d32 (make_terminal_frame): Add frame to Vframe_list.
Richard M. Stallman <rms@gnu.org>
parents: 5172
diff changeset
446
9268
cb55d0155265 (make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9214
diff changeset
447 XSETFRAME (frame, f);
5231
6646271e8d32 (make_terminal_frame): Add frame to Vframe_list.
Richard M. Stallman <rms@gnu.org>
parents: 5172
diff changeset
448 Vframe_list = Fcons (frame, Vframe_list);
6646271e8d32 (make_terminal_frame): Add frame to Vframe_list.
Richard M. Stallman <rms@gnu.org>
parents: 5172
diff changeset
449
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
450 terminal_frame_count++;
17857
c39f34ef5d76 (make_terminal_frame): Don't add `Emacs' to frame name.
Richard M. Stallman <rms@gnu.org>
parents: 17573
diff changeset
451 sprintf (name, "F%d", terminal_frame_count);
c39f34ef5d76 (make_terminal_frame): Don't add `Emacs' to frame name.
Richard M. Stallman <rms@gnu.org>
parents: 17573
diff changeset
452 f->name = build_string (name);
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
453
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
454 f->visible = 1; /* FRAME_SET_VISIBLE wd set frame_garbaged. */
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
455 f->async_visible = 1; /* Don't let visible be cleared later. */
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
456 #ifdef MSDOS
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
457 f->output_data.x = &the_only_x_display;
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26164
diff changeset
458 if (!inhibit_window_system
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26164
diff changeset
459 && (!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame))
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26164
diff changeset
460 || XFRAME (selected_frame)->output_method == output_msdos_raw))
31470
2e399023961d (make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents: 31448
diff changeset
461 {
2e399023961d (make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents: 31448
diff changeset
462 f->output_method = output_msdos_raw;
2e399023961d (make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents: 31448
diff changeset
463 /* This initialization of foreground and background pixels is
2e399023961d (make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents: 31448
diff changeset
464 only important for the initial frame created in temacs. If
2e399023961d (make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents: 31448
diff changeset
465 we don't do that, we get black background and foreground in
2e399023961d (make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents: 31448
diff changeset
466 the dumped Emacs because the_only_x_display is a static
2e399023961d (make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents: 31448
diff changeset
467 variable, hence it is born all-zeroes, and zero is the code
2e399023961d (make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents: 31448
diff changeset
468 for the black color. Other frames all inherit their pixels
2e399023961d (make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents: 31448
diff changeset
469 from what's already in the_only_x_display. */
2e399023961d (make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents: 31448
diff changeset
470 if ((!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame)))
2e399023961d (make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents: 31448
diff changeset
471 && f->output_data.x->background_pixel == 0
2e399023961d (make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents: 31448
diff changeset
472 && f->output_data.x->foreground_pixel == 0)
2e399023961d (make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents: 31448
diff changeset
473 {
2e399023961d (make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents: 31448
diff changeset
474 f->output_data.x->background_pixel = FACE_TTY_DEFAULT_BG_COLOR;
2e399023961d (make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents: 31448
diff changeset
475 f->output_data.x->foreground_pixel = FACE_TTY_DEFAULT_FG_COLOR;
2e399023961d (make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents: 31448
diff changeset
476 }
2e399023961d (make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents: 31448
diff changeset
477 }
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26164
diff changeset
478 else
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26164
diff changeset
479 f->output_method = output_termcap;
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26164
diff changeset
480 #else
35003
c6726a1e70ce (make_terminal_frame) [WINDOWSNT]: Make terminal frames
Andrew Innes <andrewi@gnu.org>
parents: 33760
diff changeset
481 #ifdef WINDOWSNT
35447
c6cb860208d8 (Qw32_console): Remove variable.
Andrew Innes <andrewi@gnu.org>
parents: 35003
diff changeset
482 f->output_method = output_termcap;
35003
c6726a1e70ce (make_terminal_frame) [WINDOWSNT]: Make terminal frames
Andrew Innes <andrewi@gnu.org>
parents: 33760
diff changeset
483 f->output_data.x = &tty_display;
c6726a1e70ce (make_terminal_frame) [WINDOWSNT]: Make terminal frames
Andrew Innes <andrewi@gnu.org>
parents: 33760
diff changeset
484 #else
25523
9e9eeb68482e (Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents: 25350
diff changeset
485 #ifdef macintosh
32752
923b8d6d8277 Initial check-in: changes for building Emacs under Mac OS.
Andrew Choi <akochoi@shaw.ca>
parents: 32545
diff changeset
486 make_mac_terminal_frame (f);
923b8d6d8277 Initial check-in: changes for building Emacs under Mac OS.
Andrew Choi <akochoi@shaw.ca>
parents: 32545
diff changeset
487 #else
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26164
diff changeset
488 f->output_data.x = &tty_display;
32752
923b8d6d8277 Initial check-in: changes for building Emacs under Mac OS.
Andrew Choi <akochoi@shaw.ca>
parents: 32545
diff changeset
489 #endif /* macintosh */
35003
c6726a1e70ce (make_terminal_frame) [WINDOWSNT]: Make terminal frames
Andrew Innes <andrewi@gnu.org>
parents: 33760
diff changeset
490 #endif /* WINDOWSNT */
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26164
diff changeset
491 #endif /* MSDOS */
25523
9e9eeb68482e (Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents: 25350
diff changeset
492
25117
f6f34f0bc1af (make_terminal_frame) [MSDOS]: Don't call
Eli Zaretskii <eliz@gnu.org>
parents: 25030
diff changeset
493 if (!noninteractive)
f6f34f0bc1af (make_terminal_frame) [MSDOS]: Don't call
Eli Zaretskii <eliz@gnu.org>
parents: 25030
diff changeset
494 init_frame_faces (f);
32752
923b8d6d8277 Initial check-in: changes for building Emacs under Mac OS.
Andrew Choi <akochoi@shaw.ca>
parents: 32545
diff changeset
495
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
496 return f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
497 }
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
498
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
499 DEFUN ("make-terminal-frame", Fmake_terminal_frame, Smake_terminal_frame,
10783
bb2d929daaa3 (Fmake_terminal_frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 10768
diff changeset
500 1, 1, 0, "Create an additional terminal frame.\n\
bb2d929daaa3 (Fmake_terminal_frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 10768
diff changeset
501 You can create multiple frames on a text-only terminal in this way.\n\
bb2d929daaa3 (Fmake_terminal_frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 10768
diff changeset
502 Only the selected terminal frame is actually displayed.\n\
bb2d929daaa3 (Fmake_terminal_frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 10768
diff changeset
503 This function takes one argument, an alist specifying frame parameters.\n\
bb2d929daaa3 (Fmake_terminal_frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 10768
diff changeset
504 In practice, generally you don't need to specify any parameters.\n\
bb2d929daaa3 (Fmake_terminal_frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 10768
diff changeset
505 Note that changing the size of one terminal frame automatically affects all.")
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
506 (parms)
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
507 Lisp_Object parms;
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
508 {
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
509 struct frame *f;
25523
9e9eeb68482e (Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents: 25350
diff changeset
510 Lisp_Object frame, tem;
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
511 struct frame *sf = SELECTED_FRAME ();
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
512
15392
ac7e878c5526 (Fmake_terminal_frame): Test MSDOS, not __MSDOS__.
Richard M. Stallman <rms@gnu.org>
parents: 15391
diff changeset
513 #ifdef MSDOS
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26164
diff changeset
514 if (sf->output_method != output_msdos_raw
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26164
diff changeset
515 && sf->output_method != output_termcap)
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
516 abort ();
25523
9e9eeb68482e (Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents: 25350
diff changeset
517 #else /* not MSDOS */
9e9eeb68482e (Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents: 25350
diff changeset
518
9e9eeb68482e (Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents: 25350
diff changeset
519 #ifdef macintosh
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
520 if (sf->output_method != output_mac)
25523
9e9eeb68482e (Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents: 25350
diff changeset
521 error ("Not running on a Macintosh screen; cannot make a new Macintosh frame");
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
522 #else
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
523 if (sf->output_method != output_termcap)
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
524 error ("Not using an ASCII terminal now; cannot make a new ASCII frame");
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
525 #endif
25523
9e9eeb68482e (Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents: 25350
diff changeset
526 #endif /* not MSDOS */
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
527
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
528 f = make_terminal_frame ();
25523
9e9eeb68482e (Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents: 25350
diff changeset
529
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
530 change_frame_size (f, FRAME_HEIGHT (sf),
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
531 FRAME_WIDTH (sf), 0, 0, 0);
25030
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
532 adjust_glyphs (f);
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
533 calculate_costs (f);
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
534 XSETFRAME (frame, f);
16184
ca018789eb73 (Fmake_terminal_frame): Use Vdefault_frame_alist.
Richard M. Stallman <rms@gnu.org>
parents: 16112
diff changeset
535 Fmodify_frame_parameters (frame, Vdefault_frame_alist);
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
536 Fmodify_frame_parameters (frame, parms);
25209
eea9647c8246 (Fframe_parameters): Swap foreground and background
Eli Zaretskii <eliz@gnu.org>
parents: 25158
diff changeset
537
eea9647c8246 (Fframe_parameters): Swap foreground and background
Eli Zaretskii <eliz@gnu.org>
parents: 25158
diff changeset
538 /* Make the frame face alist be frame-specific, so that each
eea9647c8246 (Fframe_parameters): Swap foreground and background
Eli Zaretskii <eliz@gnu.org>
parents: 25158
diff changeset
539 frame could change its face definitions independently. */
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
540 f->face_alist = Fcopy_alist (sf->face_alist);
25209
eea9647c8246 (Fframe_parameters): Swap foreground and background
Eli Zaretskii <eliz@gnu.org>
parents: 25158
diff changeset
541 /* Simple Fcopy_alist isn't enough, because we need the contents of
eea9647c8246 (Fframe_parameters): Swap foreground and background
Eli Zaretskii <eliz@gnu.org>
parents: 25158
diff changeset
542 the vectors which are the CDRs of associations in face_alist to
eea9647c8246 (Fframe_parameters): Swap foreground and background
Eli Zaretskii <eliz@gnu.org>
parents: 25158
diff changeset
543 be copied as well. */
eea9647c8246 (Fframe_parameters): Swap foreground and background
Eli Zaretskii <eliz@gnu.org>
parents: 25158
diff changeset
544 for (tem = f->face_alist; CONSP (tem); tem = XCDR (tem))
eea9647c8246 (Fframe_parameters): Swap foreground and background
Eli Zaretskii <eliz@gnu.org>
parents: 25158
diff changeset
545 XCDR (XCAR (tem)) = Fcopy_sequence (XCDR (XCAR (tem)));
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
546 return frame;
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
547 }
36810
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
548
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
549
36810
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
550 /* Perform the switch to frame FRAME.
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
551
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
552 If FRAME is a switch-frame event `(switch-frame FRAME1)', use
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
553 FRAME1 as frame.
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
554
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
555 If TRACK is non-zero and the frame that currently has the focus
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
556 redirects its focus to the selected frame, redirect that focused
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
557 frame's focus to FRAME instead.
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
558
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
559 FOR_DELETION non-zero means that the selected frame is being
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
560 deleted, which includes the possibility that the frame's display
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
561 is dead. */
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
562
12286
723569a0028c (Fdelete_frame): Use do_switch_frame directly.
Richard M. Stallman <rms@gnu.org>
parents: 12283
diff changeset
563 Lisp_Object
36810
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
564 do_switch_frame (frame, track, for_deletion)
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
565 Lisp_Object frame;
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
566 int track, for_deletion;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
567 {
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
568 struct frame *sf = SELECTED_FRAME ();
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
569
1385
a4a205bdd2c1 * frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents: 1346
diff changeset
570 /* If FRAME is a switch-frame event, extract the frame we should
a4a205bdd2c1 * frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents: 1346
diff changeset
571 switch to. */
a4a205bdd2c1 * frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents: 1346
diff changeset
572 if (CONSP (frame)
26164
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
573 && EQ (XCAR (frame), Qswitch_frame)
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
574 && CONSP (XCDR (frame)))
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
575 frame = XCAR (XCDR (frame));
1385
a4a205bdd2c1 * frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents: 1346
diff changeset
576
6352
6f48bd9145f9 (Fhandle_switch_frame): Ignore switch to dead frame.
Karl Heuer <kwzh@gnu.org>
parents: 6346
diff changeset
577 /* This used to say CHECK_LIVE_FRAME, but apparently it's possible for
6f48bd9145f9 (Fhandle_switch_frame): Ignore switch to dead frame.
Karl Heuer <kwzh@gnu.org>
parents: 6346
diff changeset
578 a switch-frame event to arrive after a frame is no longer live,
6f48bd9145f9 (Fhandle_switch_frame): Ignore switch to dead frame.
Karl Heuer <kwzh@gnu.org>
parents: 6346
diff changeset
579 especially when deleting the initial frame during startup. */
6f48bd9145f9 (Fhandle_switch_frame): Ignore switch to dead frame.
Karl Heuer <kwzh@gnu.org>
parents: 6346
diff changeset
580 CHECK_FRAME (frame, 0);
6f48bd9145f9 (Fhandle_switch_frame): Ignore switch to dead frame.
Karl Heuer <kwzh@gnu.org>
parents: 6346
diff changeset
581 if (! FRAME_LIVE_P (XFRAME (frame)))
6f48bd9145f9 (Fhandle_switch_frame): Ignore switch to dead frame.
Karl Heuer <kwzh@gnu.org>
parents: 6346
diff changeset
582 return Qnil;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
583
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
584 if (sf == XFRAME (frame))
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
585 return frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
586
6486
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
587 /* This is too greedy; it causes inappropriate focus redirection
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
588 that's hard to get rid of. */
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
589 #if 0
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
590 /* If a frame's focus has been redirected toward the currently
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
591 selected frame, we should change the redirection to point to the
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
592 newly selected frame. This means that if the focus is redirected
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
593 from a minibufferless frame to a surrogate minibuffer frame, we
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
594 can use `other-window' to switch between all the frames using
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
595 that minibuffer frame, and the focus redirection will follow us
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
596 around. */
6486
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
597 if (track)
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
598 {
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
599 Lisp_Object tail;
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
600
26164
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
601 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
6486
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
602 {
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
603 Lisp_Object focus;
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
604
26164
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
605 if (!FRAMEP (XCAR (tail)))
6486
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
606 abort ();
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
607
26164
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
608 focus = FRAME_FOCUS_FRAME (XFRAME (XCAR (tail)));
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
609
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
610 if (FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ())
26164
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
611 Fredirect_frame_focus (XCAR (tail), frame);
6486
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
612 }
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
613 }
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
614 #else /* ! 0 */
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
615 /* Instead, apply it only to the frame we're pointing to. */
13412
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
616 #ifdef HAVE_WINDOW_SYSTEM
36810
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
617 if (track && FRAME_WINDOW_P (XFRAME (frame)))
6486
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
618 {
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
619 Lisp_Object focus, xfocus;
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
620
11529
5beffe62d4ef (do_switch_frame): x_get_focus_frame needs an arg.
Karl Heuer <kwzh@gnu.org>
parents: 11495
diff changeset
621 xfocus = x_get_focus_frame (XFRAME (frame));
6486
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
622 if (FRAMEP (xfocus))
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
623 {
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
624 focus = FRAME_FOCUS_FRAME (XFRAME (xfocus));
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
625 if (FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ())
6486
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
626 Fredirect_frame_focus (xfocus, frame);
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
627 }
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
628 }
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
629 #endif /* HAVE_X_WINDOWS */
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
630 #endif /* ! 0 */
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
631
36810
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
632 if (!for_deletion && FRAME_HAS_MINIBUF_P (sf))
35611
3e7efd5ea1da (do_switch_frame): If selected frame has a mini-window,
Gerd Moellmann <gerd@gnu.org>
parents: 35447
diff changeset
633 resize_mini_window (XWINDOW (FRAME_MINIBUF_WINDOW (sf)), 1);
3e7efd5ea1da (do_switch_frame): If selected frame has a mini-window,
Gerd Moellmann <gerd@gnu.org>
parents: 35447
diff changeset
634
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
635 selected_frame = frame;
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
636 if (! FRAME_MINIBUF_ONLY_P (XFRAME (selected_frame)))
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
637 last_nonminibuf_frame = XFRAME (selected_frame);
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
638
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
639 Fselect_window (XFRAME (frame)->selected_window);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
640
1920
ac5e559a819a * frame.c (Fselect_frame): Set Vlast_event_frame to Qnil after
Jim Blandy <jimb@redhat.com>
parents: 1870
diff changeset
641 /* We want to make sure that the next event generates a frame-switch
3591
507f64624555 Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents: 3497
diff changeset
642 event to the appropriate frame. This seems kludgy to me, but
1920
ac5e559a819a * frame.c (Fselect_frame): Set Vlast_event_frame to Qnil after
Jim Blandy <jimb@redhat.com>
parents: 1870
diff changeset
643 before you take it out, make sure that evaluating something like
ac5e559a819a * frame.c (Fselect_frame): Set Vlast_event_frame to Qnil after
Jim Blandy <jimb@redhat.com>
parents: 1870
diff changeset
644 (select-window (frame-root-window (new-frame))) doesn't end up
ac5e559a819a * frame.c (Fselect_frame): Set Vlast_event_frame to Qnil after
Jim Blandy <jimb@redhat.com>
parents: 1870
diff changeset
645 with your typing being interpreted in the new frame instead of
ac5e559a819a * frame.c (Fselect_frame): Set Vlast_event_frame to Qnil after
Jim Blandy <jimb@redhat.com>
parents: 1870
diff changeset
646 the one you're actually typing in. */
10853
3db086133785 (do_switch_frame): Undo Feb 6 change.
Karl Heuer <kwzh@gnu.org>
parents: 10851
diff changeset
647 internal_last_event_frame = Qnil;
1920
ac5e559a819a * frame.c (Fselect_frame): Set Vlast_event_frame to Qnil after
Jim Blandy <jimb@redhat.com>
parents: 1870
diff changeset
648
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
649 return frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
650 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
651
6486
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
652 DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 2, "e",
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
653 "Select the frame FRAME.\n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
654 Subsequent editing commands apply to its selected window.\n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
655 The selection of FRAME lasts until the next time the user does\n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
656 something to select a different frame, or until the next time this\n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
657 function is called.")
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
658 (frame, no_enter)
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
659 Lisp_Object frame, no_enter;
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
660 {
36810
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
661 return do_switch_frame (frame, 1, 0);
6486
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
662 }
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
663
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
664
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
665 DEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 2, "e",
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
666 "Handle a switch-frame event EVENT.\n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
667 Switch-frame events are usually bound to this function.\n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
668 A switch-frame event tells Emacs that the window manager has requested\n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
669 that the user's events be directed to the frame mentioned in the event.\n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
670 This function selects the selected window of the frame of EVENT.\n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
671 \n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
672 If EVENT is frame object, handle it as if it were a switch-frame event\n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
673 to that frame.")
14077
a6d3ce4a2f8e (Fhandle_switch_frame, Fset_frame_height): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents: 13748
diff changeset
674 (event, no_enter)
a6d3ce4a2f8e (Fhandle_switch_frame, Fset_frame_height): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents: 13748
diff changeset
675 Lisp_Object event, no_enter;
6486
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
676 {
12255
41083bd094ac (Fhandle_switch_frame): Preserve prefix arg.
Karl Heuer <kwzh@gnu.org>
parents: 12222
diff changeset
677 /* Preserve prefix arg that the command loop just cleared. */
41083bd094ac (Fhandle_switch_frame): Preserve prefix arg.
Karl Heuer <kwzh@gnu.org>
parents: 12222
diff changeset
678 current_kboard->Vprefix_arg = Vcurrent_prefix_arg;
13106
22011e724596 (Qmouse_leave_buffer_hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 12987
diff changeset
679 call1 (Vrun_hooks, Qmouse_leave_buffer_hook);
36810
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
680 return do_switch_frame (event, 0, 0);
6486
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
681 }
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
682
12283
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
683 DEFUN ("ignore-event", Fignore_event, Signore_event, 0, 0, "",
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
684 "Do nothing, but preserve any prefix argument already specified.\n\
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
685 This is a suitable binding for iconify-frame and make-frame-visible.")
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
686 ()
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
687 {
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
688 current_kboard->Vprefix_arg = Vcurrent_prefix_arg;
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
689 return Qnil;
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
690 }
6486
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
691
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
692 DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
693 "Return the frame that is now selected.")
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
694 ()
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
695 {
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
696 return selected_frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
697 }
7055
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
698
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
699 DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
700 "Return the frame object that window WINDOW is on.")
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
701 (window)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
702 Lisp_Object window;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
703 {
1437
36ef55ecb265 * frame.c (make_frame_without_minibuffer, Fwindow_frame): Use
Jim Blandy <jimb@redhat.com>
parents: 1385
diff changeset
704 CHECK_LIVE_WINDOW (window, 0);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
705 return XWINDOW (window)->frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
706 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
707
6527
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
708 DEFUN ("frame-first-window", Fframe_first_window, Sframe_first_window, 0, 1, 0,
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
709 "Returns the topmost, leftmost window of FRAME.\n\
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
710 If omitted, FRAME defaults to the currently selected frame.")
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
711 (frame)
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
712 Lisp_Object frame;
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
713 {
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
714 Lisp_Object w;
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
715
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
716 if (NILP (frame))
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
717 w = SELECTED_FRAME ()->root_window;
6527
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
718 else
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
719 {
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
720 CHECK_LIVE_FRAME (frame, 0);
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
721 w = XFRAME (frame)->root_window;
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
722 }
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
723 while (NILP (XWINDOW (w)->buffer))
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
724 {
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
725 if (! NILP (XWINDOW (w)->hchild))
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
726 w = XWINDOW (w)->hchild;
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
727 else if (! NILP (XWINDOW (w)->vchild))
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
728 w = XWINDOW (w)->vchild;
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
729 else
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
730 abort ();
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
731 }
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
732 return w;
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
733 }
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
734
11169
d0550c056e5b [MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 11126
diff changeset
735 DEFUN ("active-minibuffer-window", Factive_minibuffer_window,
d0550c056e5b [MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 11126
diff changeset
736 Sactive_minibuffer_window, 0, 0, 0,
d0550c056e5b [MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 11126
diff changeset
737 "Return the currently active minibuffer window, or nil if none.")
d0550c056e5b [MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 11126
diff changeset
738 ()
d0550c056e5b [MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 11126
diff changeset
739 {
d0550c056e5b [MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 11126
diff changeset
740 return minibuf_level ? minibuf_window : Qnil;
d0550c056e5b [MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 11126
diff changeset
741 }
d0550c056e5b [MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 11126
diff changeset
742
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
743 DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0,
1251
4e556fda7a4d * frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents: 1118
diff changeset
744 "Returns the root-window of FRAME.\n\
4e556fda7a4d * frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents: 1118
diff changeset
745 If omitted, FRAME defaults to the currently selected frame.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
746 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
747 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
748 {
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
749 Lisp_Object window;
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
750
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
751 if (NILP (frame))
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
752 window = SELECTED_FRAME ()->root_window;
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
753 else
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
754 {
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
755 CHECK_LIVE_FRAME (frame, 0);
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
756 window = XFRAME (frame)->root_window;
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
757 }
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
758
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
759 return window;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
760 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
761
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
762 DEFUN ("frame-selected-window", Fframe_selected_window,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
763 Sframe_selected_window, 0, 1, 0,
1251
4e556fda7a4d * frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents: 1118
diff changeset
764 "Return the selected window of frame object FRAME.\n\
4e556fda7a4d * frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents: 1118
diff changeset
765 If omitted, FRAME defaults to the currently selected frame.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
766 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
767 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
768 {
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
769 Lisp_Object window;
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
770
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
771 if (NILP (frame))
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
772 window = SELECTED_FRAME ()->selected_window;
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
773 else
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
774 {
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
775 CHECK_LIVE_FRAME (frame, 0);
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
776 window = XFRAME (frame)->selected_window;
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
777 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
778
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
779 return window;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
780 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
781
7055
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
782 DEFUN ("set-frame-selected-window", Fset_frame_selected_window,
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
783 Sset_frame_selected_window, 2, 2, 0,
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
784 "Set the selected window of frame object FRAME to WINDOW.\n\
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
785 If FRAME is nil, the selected frame is used.\n\
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
786 If FRAME is the selected frame, this makes WINDOW the selected window.")
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
787 (frame, window)
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
788 Lisp_Object frame, window;
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
789 {
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
790 if (NILP (frame))
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
791 frame = selected_frame;
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
792
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
793 CHECK_LIVE_FRAME (frame, 0);
7055
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
794 CHECK_LIVE_WINDOW (window, 1);
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
795
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
796 if (! EQ (frame, WINDOW_FRAME (XWINDOW (window))))
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
797 error ("In `set-frame-selected-window', WINDOW is not on FRAME");
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
798
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
799 if (EQ (frame, selected_frame))
7055
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
800 return Fselect_window (window);
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
801
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
802 return XFRAME (frame)->selected_window = window;
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
803 }
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
804
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
805 DEFUN ("frame-list", Fframe_list, Sframe_list,
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
806 0, 0, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
807 "Return a list of all frames.")
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
808 ()
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
809 {
36971
3819e613c7c2 (Fframe_list): Don't return a tooltip frame.
Gerd Moellmann <gerd@gnu.org>
parents: 36810
diff changeset
810 Lisp_Object frames;
3819e613c7c2 (Fframe_list): Don't return a tooltip frame.
Gerd Moellmann <gerd@gnu.org>
parents: 36810
diff changeset
811 frames = Fcopy_sequence (Vframe_list);
3819e613c7c2 (Fframe_list): Don't return a tooltip frame.
Gerd Moellmann <gerd@gnu.org>
parents: 36810
diff changeset
812 if (FRAMEP (tip_frame))
3819e613c7c2 (Fframe_list): Don't return a tooltip frame.
Gerd Moellmann <gerd@gnu.org>
parents: 36810
diff changeset
813 frames = Fdelq (tip_frame, frames);
3819e613c7c2 (Fframe_list): Don't return a tooltip frame.
Gerd Moellmann <gerd@gnu.org>
parents: 36810
diff changeset
814 return frames;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
815 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
816
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
817 /* Return the next frame in the frame list after FRAME.
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
818 If MINIBUF is nil, exclude minibuffer-only frames.
8168
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
819 If MINIBUF is a window, include only its own frame
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
820 and any frame now using that window as the minibuffer.
6246
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
821 If MINIBUF is `visible', include all visible frames.
8168
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
822 If MINIBUF is 0, include all visible and iconified frames.
6246
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
823 Otherwise, include all frames. */
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
824
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
825 Lisp_Object
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
826 next_frame (frame, minibuf)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
827 Lisp_Object frame;
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
828 Lisp_Object minibuf;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
829 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
830 Lisp_Object tail;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
831 int passed = 0;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
832
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
833 /* There must always be at least one frame in Vframe_list. */
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
834 if (! CONSP (Vframe_list))
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
835 abort ();
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
836
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
837 /* If this frame is dead, it won't be in Vframe_list, and we'll loop
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
838 forever. Forestall that. */
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
839 CHECK_LIVE_FRAME (frame, 0);
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
840
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
841 while (1)
26164
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
842 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
843 {
6500
551bff5cffde (next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
parents: 6486
diff changeset
844 Lisp_Object f;
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
845
26164
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
846 f = XCAR (tail);
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
847
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
848 if (passed
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
849 && FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame)))
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
850 {
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
851 /* Decide whether this frame is eligible to be returned. */
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
852
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
853 /* If we've looped all the way around without finding any
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
854 eligible frames, return the original frame. */
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
855 if (EQ (f, frame))
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
856 return f;
335
33aa13a3f279 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 286
diff changeset
857
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
858 /* Let minibuf decide if this frame is acceptable. */
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
859 if (NILP (minibuf))
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
860 {
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
861 if (! FRAME_MINIBUF_ONLY_P (XFRAME (f)))
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
862 return f;
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
863 }
6246
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
864 else if (EQ (minibuf, Qvisible))
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
865 {
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
866 FRAME_SAMPLE_VISIBILITY (XFRAME (f));
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
867 if (FRAME_VISIBLE_P (XFRAME (f)))
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
868 return f;
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
869 }
29987
c38afaed3dd0 (next_frame): Don't check frame-focus redirection in
Gerd Moellmann <gerd@gnu.org>
parents: 29616
diff changeset
870 else if (INTEGERP (minibuf) && XINT (minibuf) == 0)
8168
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
871 {
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
872 FRAME_SAMPLE_VISIBILITY (XFRAME (f));
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
873 if (FRAME_VISIBLE_P (XFRAME (f))
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
874 || FRAME_ICONIFIED_P (XFRAME (f)))
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
875 return f;
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
876 }
6246
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
877 else if (WINDOWP (minibuf))
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
878 {
8168
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
879 if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf)
29995
ec33931795c4 (next_frame, prev_frame): If MINIBUF is a window,
Gerd Moellmann <gerd@gnu.org>
parents: 29987
diff changeset
880 || EQ (WINDOW_FRAME (XWINDOW (minibuf)), f)
ec33931795c4 (next_frame, prev_frame): If MINIBUF is a window,
Gerd Moellmann <gerd@gnu.org>
parents: 29987
diff changeset
881 || EQ (WINDOW_FRAME (XWINDOW (minibuf)),
ec33931795c4 (next_frame, prev_frame): If MINIBUF is a window,
Gerd Moellmann <gerd@gnu.org>
parents: 29987
diff changeset
882 FRAME_FOCUS_FRAME (XFRAME (f))))
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
883 return f;
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
884 }
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
885 else
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
886 return f;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
887 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
888
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
889 if (EQ (frame, f))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
890 passed++;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
891 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
892 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
893
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
894 /* Return the previous frame in the frame list before FRAME.
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
895 If MINIBUF is nil, exclude minibuffer-only frames.
8168
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
896 If MINIBUF is a window, include only its own frame
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
897 and any frame now using that window as the minibuffer.
6246
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
898 If MINIBUF is `visible', include all visible frames.
8168
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
899 If MINIBUF is 0, include all visible and iconified frames.
6246
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
900 Otherwise, include all frames. */
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
901
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
902 Lisp_Object
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
903 prev_frame (frame, minibuf)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
904 Lisp_Object frame;
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
905 Lisp_Object minibuf;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
906 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
907 Lisp_Object tail;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
908 Lisp_Object prev;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
909
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
910 /* There must always be at least one frame in Vframe_list. */
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
911 if (! CONSP (Vframe_list))
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
912 abort ();
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
913
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
914 prev = Qnil;
26164
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
915 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
916 {
6500
551bff5cffde (next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
parents: 6486
diff changeset
917 Lisp_Object f;
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
918
26164
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
919 f = XCAR (tail);
9127
0b4836daa8e1 (Fframep, make_frame_without_minibuffer, do_switch_frame, prev_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9032
diff changeset
920 if (!FRAMEP (f))
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
921 abort ();
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
922
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
923 if (EQ (frame, f) && !NILP (prev))
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
924 return prev;
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
925
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
926 if (FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame)))
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
927 {
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
928 /* Decide whether this frame is eligible to be returned,
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
929 according to minibuf. */
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
930 if (NILP (minibuf))
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
931 {
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
932 if (! FRAME_MINIBUF_ONLY_P (XFRAME (f)))
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
933 prev = f;
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
934 }
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
935 else if (WINDOWP (minibuf))
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
936 {
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
937 if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf)
29995
ec33931795c4 (next_frame, prev_frame): If MINIBUF is a window,
Gerd Moellmann <gerd@gnu.org>
parents: 29987
diff changeset
938 || EQ (WINDOW_FRAME (XWINDOW (minibuf)), f)
ec33931795c4 (next_frame, prev_frame): If MINIBUF is a window,
Gerd Moellmann <gerd@gnu.org>
parents: 29987
diff changeset
939 || EQ (WINDOW_FRAME (XWINDOW (minibuf)),
ec33931795c4 (next_frame, prev_frame): If MINIBUF is a window,
Gerd Moellmann <gerd@gnu.org>
parents: 29987
diff changeset
940 FRAME_FOCUS_FRAME (XFRAME (f))))
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
941 prev = f;
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
942 }
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
943 else if (EQ (minibuf, Qvisible))
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
944 {
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
945 FRAME_SAMPLE_VISIBILITY (XFRAME (f));
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
946 if (FRAME_VISIBLE_P (XFRAME (f)))
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
947 prev = f;
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
948 }
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
949 else if (XFASTINT (minibuf) == 0)
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
950 {
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
951 FRAME_SAMPLE_VISIBILITY (XFRAME (f));
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
952 if (FRAME_VISIBLE_P (XFRAME (f))
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
953 || FRAME_ICONIFIED_P (XFRAME (f)))
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
954 prev = f;
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
955 }
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
956 else
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
957 prev = f;
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
958 }
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
959 }
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
960
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
961 /* We've scanned the entire list. */
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
962 if (NILP (prev))
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
963 /* We went through the whole frame list without finding a single
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
964 acceptable frame. Return the original frame. */
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
965 return frame;
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
966 else
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
967 /* There were no acceptable frames in the list before FRAME; otherwise,
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
968 we would have returned directly from the loop. Since PREV is the last
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
969 acceptable frame in the list, return it. */
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
970 return prev;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
971 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
972
4424
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
973
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
974 DEFUN ("next-frame", Fnext_frame, Snext_frame, 0, 2, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
975 "Return the next frame in the frame list after FRAME.\n\
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
976 It considers only frames on the same terminal as FRAME.\n\
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
977 By default, skip minibuffer-only frames.\n\
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
978 If omitted, FRAME defaults to the selected frame.\n\
4227
b283670201b4 (Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents: 3970
diff changeset
979 If optional argument MINIFRAME is nil, exclude minibuffer-only frames.\n\
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
980 If MINIFRAME is a window, include only its own frame\n\
8168
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
981 and any frame now using that window as the minibuffer.\n\
6246
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
982 If MINIFRAME is `visible', include all visible frames.\n\
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
983 If MINIFRAME is 0, include all visible and iconified frames.\n\
6246
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
984 Otherwise, include all frames.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
985 (frame, miniframe)
1251
4e556fda7a4d * frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents: 1118
diff changeset
986 Lisp_Object frame, miniframe;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
987 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
988 if (NILP (frame))
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
989 frame = selected_frame;
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
990
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
991 CHECK_LIVE_FRAME (frame, 0);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
992 return next_frame (frame, miniframe);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
993 }
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
994
4424
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
995 DEFUN ("previous-frame", Fprevious_frame, Sprevious_frame, 0, 2, 0,
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
996 "Return the previous frame in the frame list before FRAME.\n\
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
997 It considers only frames on the same terminal as FRAME.\n\
4424
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
998 By default, skip minibuffer-only frames.\n\
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
999 If omitted, FRAME defaults to the selected frame.\n\
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
1000 If optional argument MINIFRAME is nil, exclude minibuffer-only frames.\n\
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1001 If MINIFRAME is a window, include only its own frame\n\
8168
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
1002 and any frame now using that window as the minibuffer.\n\
6246
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
1003 If MINIFRAME is `visible', include all visible frames.\n\
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1004 If MINIFRAME is 0, include all visible and iconified frames.\n\
6246
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
1005 Otherwise, include all frames.")
4424
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
1006 (frame, miniframe)
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
1007 Lisp_Object frame, miniframe;
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
1008 {
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
1009 if (NILP (frame))
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1010 frame = selected_frame;
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1011 CHECK_LIVE_FRAME (frame, 0);
4424
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
1012 return prev_frame (frame, miniframe);
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
1013 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1014
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1015 /* Return 1 if it is ok to delete frame F;
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1016 0 if all frames aside from F are invisible.
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1017 (Exception: if F is the terminal frame, and we are using X, return 1.) */
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1018
7646
de2c4334fad4 (other_visible_frames): No longer static.
Richard M. Stallman <rms@gnu.org>
parents: 7570
diff changeset
1019 int
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1020 other_visible_frames (f)
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1021 FRAME_PTR f;
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1022 {
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1023 /* We know the selected frame is visible,
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1024 so if F is some other frame, it can't be the sole visible one. */
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1025 if (f == SELECTED_FRAME ())
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1026 {
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1027 Lisp_Object frames;
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1028 int count = 0;
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1029
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1030 for (frames = Vframe_list;
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1031 CONSP (frames);
26164
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
1032 frames = XCDR (frames))
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1033 {
6500
551bff5cffde (next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
parents: 6486
diff changeset
1034 Lisp_Object this;
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1035
26164
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
1036 this = XCAR (frames);
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1037 /* Verify that the frame's window still exists
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1038 and we can still talk to it. And note any recent change
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1039 in visibility. */
13412
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
1040 #ifdef HAVE_WINDOW_SYSTEM
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
1041 if (FRAME_WINDOW_P (XFRAME (this)))
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1042 {
9648
14b1481b7c6d (other_visible_frames): Pass a frame ptr to x_sync.
Richard M. Stallman <rms@gnu.org>
parents: 9572
diff changeset
1043 x_sync (XFRAME (this));
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1044 FRAME_SAMPLE_VISIBILITY (XFRAME (this));
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1045 }
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1046 #endif
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1047
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1048 if (FRAME_VISIBLE_P (XFRAME (this))
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1049 || FRAME_ICONIFIED_P (XFRAME (this))
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1050 /* Allow deleting the terminal frame when at least
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1051 one X frame exists! */
13412
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
1052 || (FRAME_WINDOW_P (XFRAME (this)) && !FRAME_WINDOW_P (f)))
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1053 count++;
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1054 }
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1055 return count > 1;
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1056 }
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1057 return 1;
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1058 }
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1059
4341
d07ef5ea3b58 (Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents: 4227
diff changeset
1060 DEFUN ("delete-frame", Fdelete_frame, Sdelete_frame, 0, 2, "",
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1061 "Delete FRAME, permanently eliminating it from use.\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1062 If omitted, FRAME defaults to the selected frame.\n\
4341
d07ef5ea3b58 (Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents: 4227
diff changeset
1063 A frame may not be deleted if its minibuffer is used by other frames.\n\
d07ef5ea3b58 (Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents: 4227
diff changeset
1064 Normally, you may not delete a frame if all other frames are invisible,\n\
32909
44cb0900a858 (Fdelete_frame): Doc fix. Move running the hook
Gerd Moellmann <gerd@gnu.org>
parents: 32907
diff changeset
1065 but if the second optional argument FORCE is non-nil, you may do so.\n\
44cb0900a858 (Fdelete_frame): Doc fix. Move running the hook
Gerd Moellmann <gerd@gnu.org>
parents: 32907
diff changeset
1066 \n\
44cb0900a858 (Fdelete_frame): Doc fix. Move running the hook
Gerd Moellmann <gerd@gnu.org>
parents: 32907
diff changeset
1067 This function runs `delete-frame-hook' before actually deleting the\n\
44cb0900a858 (Fdelete_frame): Doc fix. Move running the hook
Gerd Moellmann <gerd@gnu.org>
parents: 32907
diff changeset
1068 frame. The hook is called with one argument FRAME.")
4341
d07ef5ea3b58 (Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents: 4227
diff changeset
1069 (frame, force)
d07ef5ea3b58 (Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents: 4227
diff changeset
1070 Lisp_Object frame, force;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1071 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1072 struct frame *f;
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1073 struct frame *sf = SELECTED_FRAME ();
12222
7286ed64badd (Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
parents: 12010
diff changeset
1074 int minibuffer_selected;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1075
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1076 if (EQ (frame, Qnil))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1077 {
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1078 f = sf;
9268
cb55d0155265 (make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9214
diff changeset
1079 XSETFRAME (frame, f);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1080 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1081 else
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1082 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1083 CHECK_FRAME (frame, 0);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1084 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1085 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1086
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1087 if (! FRAME_LIVE_P (f))
1920
ac5e559a819a * frame.c (Fselect_frame): Set Vlast_event_frame to Qnil after
Jim Blandy <jimb@redhat.com>
parents: 1870
diff changeset
1088 return Qnil;
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
1089
35660
b9366f467430 * alloc.c (allocate_string) [macintosh]: Call check_string_bytes
Andrew Choi <akochoi@shaw.ca>
parents: 35611
diff changeset
1090 if (NILP (force) && !other_visible_frames (f)
b9366f467430 * alloc.c (allocate_string) [macintosh]: Call check_string_bytes
Andrew Choi <akochoi@shaw.ca>
parents: 35611
diff changeset
1091 #ifdef macintosh
b9366f467430 * alloc.c (allocate_string) [macintosh]: Call check_string_bytes
Andrew Choi <akochoi@shaw.ca>
parents: 35611
diff changeset
1092 /* Terminal frame deleted before any other visible frames are
b9366f467430 * alloc.c (allocate_string) [macintosh]: Call check_string_bytes
Andrew Choi <akochoi@shaw.ca>
parents: 35611
diff changeset
1093 created. */
b9366f467430 * alloc.c (allocate_string) [macintosh]: Call check_string_bytes
Andrew Choi <akochoi@shaw.ca>
parents: 35611
diff changeset
1094 && strcmp (XSTRING (f->name)->data, "F1") != 0
b9366f467430 * alloc.c (allocate_string) [macintosh]: Call check_string_bytes
Andrew Choi <akochoi@shaw.ca>
parents: 35611
diff changeset
1095 #endif
b9366f467430 * alloc.c (allocate_string) [macintosh]: Call check_string_bytes
Andrew Choi <akochoi@shaw.ca>
parents: 35611
diff changeset
1096 )
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1097 error ("Attempt to delete the sole visible or iconified frame");
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1098
18945
7f491075707a (Fdelete_frame): Undo previous change.
Richard M. Stallman <rms@gnu.org>
parents: 18698
diff changeset
1099 #if 0
7f491075707a (Fdelete_frame): Undo previous change.
Richard M. Stallman <rms@gnu.org>
parents: 18698
diff changeset
1100 /* This is a nice idea, but x_connection_closed needs to be able
7f491075707a (Fdelete_frame): Undo previous change.
Richard M. Stallman <rms@gnu.org>
parents: 18698
diff changeset
1101 to delete the last frame, if it is gone. */
26164
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
1102 if (NILP (XCDR (Vframe_list)))
18698
52271ad26a1d (Fdelete_frame): Always err for deleting the only frame.
Richard M. Stallman <rms@gnu.org>
parents: 18380
diff changeset
1103 error ("Attempt to delete the only frame");
18945
7f491075707a (Fdelete_frame): Undo previous change.
Richard M. Stallman <rms@gnu.org>
parents: 18698
diff changeset
1104 #endif
18698
52271ad26a1d (Fdelete_frame): Always err for deleting the only frame.
Richard M. Stallman <rms@gnu.org>
parents: 18380
diff changeset
1105
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1106 /* Does this frame have a minibuffer, and is it the surrogate
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1107 minibuffer for any other frame? */
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
1108 if (FRAME_HAS_MINIBUF_P (XFRAME (frame)))
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1109 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1110 Lisp_Object frames;
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1111
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1112 for (frames = Vframe_list;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1113 CONSP (frames);
26164
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
1114 frames = XCDR (frames))
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1115 {
6157
9422e430f067 (Fdelete_frame): Don't initialize a Lisp_Object.
Richard M. Stallman <rms@gnu.org>
parents: 6130
diff changeset
1116 Lisp_Object this;
26164
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
1117 this = XCAR (frames);
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1118
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1119 if (! EQ (this, frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1120 && EQ (frame,
6157
9422e430f067 (Fdelete_frame): Don't initialize a Lisp_Object.
Richard M. Stallman <rms@gnu.org>
parents: 6130
diff changeset
1121 WINDOW_FRAME (XWINDOW
9422e430f067 (Fdelete_frame): Don't initialize a Lisp_Object.
Richard M. Stallman <rms@gnu.org>
parents: 6130
diff changeset
1122 (FRAME_MINIBUF_WINDOW (XFRAME (this))))))
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1123 error ("Attempt to delete a surrogate minibuffer frame");
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1124 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1125 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1126
32909
44cb0900a858 (Fdelete_frame): Doc fix. Move running the hook
Gerd Moellmann <gerd@gnu.org>
parents: 32907
diff changeset
1127 /* Run `delete-frame-hook'. */
44cb0900a858 (Fdelete_frame): Doc fix. Move running the hook
Gerd Moellmann <gerd@gnu.org>
parents: 32907
diff changeset
1128 if (!NILP (Vrun_hooks))
44cb0900a858 (Fdelete_frame): Doc fix. Move running the hook
Gerd Moellmann <gerd@gnu.org>
parents: 32907
diff changeset
1129 {
44cb0900a858 (Fdelete_frame): Doc fix. Move running the hook
Gerd Moellmann <gerd@gnu.org>
parents: 32907
diff changeset
1130 Lisp_Object args[2];
44cb0900a858 (Fdelete_frame): Doc fix. Move running the hook
Gerd Moellmann <gerd@gnu.org>
parents: 32907
diff changeset
1131 args[0] = intern ("delete-frame-hook");
44cb0900a858 (Fdelete_frame): Doc fix. Move running the hook
Gerd Moellmann <gerd@gnu.org>
parents: 32907
diff changeset
1132 args[1] = frame;
44cb0900a858 (Fdelete_frame): Doc fix. Move running the hook
Gerd Moellmann <gerd@gnu.org>
parents: 32907
diff changeset
1133 Frun_hook_with_args (2, args);
44cb0900a858 (Fdelete_frame): Doc fix. Move running the hook
Gerd Moellmann <gerd@gnu.org>
parents: 32907
diff changeset
1134 }
44cb0900a858 (Fdelete_frame): Doc fix. Move running the hook
Gerd Moellmann <gerd@gnu.org>
parents: 32907
diff changeset
1135
12222
7286ed64badd (Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
parents: 12010
diff changeset
1136 minibuffer_selected = EQ (minibuf_window, selected_window);
7286ed64badd (Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
parents: 12010
diff changeset
1137
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1138 /* Don't let the frame remain selected. */
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1139 if (f == sf)
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1140 {
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1141 Lisp_Object tail, frame1;
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1142
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1143 /* Look for another visible frame on the same terminal. */
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1144 frame1 = next_frame (frame, Qvisible);
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1145
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1146 /* If there is none, find *some* other frame. */
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1147 if (NILP (frame1) || EQ (frame1, frame))
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1148 {
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1149 FOR_EACH_FRAME (tail, frame1)
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1150 {
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1151 if (! EQ (frame, frame1))
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1152 break;
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1153 }
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1154 }
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1155
36810
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
1156 do_switch_frame (frame1, 0, 1);
25736
84179b4e7743 (Fdelete_frame): Correct local variable pointing to
Gerd Moellmann <gerd@gnu.org>
parents: 25710
diff changeset
1157 sf = SELECTED_FRAME ();
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1158 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1159
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1160 /* Don't allow minibuf_window to remain on a deleted frame. */
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1161 if (EQ (f->minibuffer_window, minibuf_window))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1162 {
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1163 Fset_window_buffer (sf->minibuffer_window,
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1164 XWINDOW (minibuf_window)->buffer);
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1165 minibuf_window = sf->minibuffer_window;
12222
7286ed64badd (Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
parents: 12010
diff changeset
1166
7286ed64badd (Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
parents: 12010
diff changeset
1167 /* If the dying minibuffer window was selected,
7286ed64badd (Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
parents: 12010
diff changeset
1168 select the new one. */
7286ed64badd (Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
parents: 12010
diff changeset
1169 if (minibuffer_selected)
7286ed64badd (Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
parents: 12010
diff changeset
1170 Fselect_window (minibuf_window);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1171 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1172
27800
403b2b833ce2 (Fdelete_frame): Don't let echo_area_window to remain on a deleted frame.
Eli Zaretskii <eliz@gnu.org>
parents: 27797
diff changeset
1173 /* Don't let echo_area_window to remain on a deleted frame. */
403b2b833ce2 (Fdelete_frame): Don't let echo_area_window to remain on a deleted frame.
Eli Zaretskii <eliz@gnu.org>
parents: 27797
diff changeset
1174 if (EQ (f->minibuffer_window, echo_area_window))
403b2b833ce2 (Fdelete_frame): Don't let echo_area_window to remain on a deleted frame.
Eli Zaretskii <eliz@gnu.org>
parents: 27797
diff changeset
1175 echo_area_window = sf->minibuffer_window;
403b2b833ce2 (Fdelete_frame): Don't let echo_area_window to remain on a deleted frame.
Eli Zaretskii <eliz@gnu.org>
parents: 27797
diff changeset
1176
8099
a06382fd175d (Fdelete_frame): Call x_clear_frame_selections.
Richard M. Stallman <rms@gnu.org>
parents: 8054
diff changeset
1177 /* Clear any X selections for this frame. */
a06382fd175d (Fdelete_frame): Call x_clear_frame_selections.
Richard M. Stallman <rms@gnu.org>
parents: 8054
diff changeset
1178 #ifdef HAVE_X_WINDOWS
a06382fd175d (Fdelete_frame): Call x_clear_frame_selections.
Richard M. Stallman <rms@gnu.org>
parents: 8054
diff changeset
1179 if (FRAME_X_P (f))
a06382fd175d (Fdelete_frame): Call x_clear_frame_selections.
Richard M. Stallman <rms@gnu.org>
parents: 8054
diff changeset
1180 x_clear_frame_selections (f);
a06382fd175d (Fdelete_frame): Call x_clear_frame_selections.
Richard M. Stallman <rms@gnu.org>
parents: 8054
diff changeset
1181 #endif
a06382fd175d (Fdelete_frame): Call x_clear_frame_selections.
Richard M. Stallman <rms@gnu.org>
parents: 8054
diff changeset
1182
25030
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
1183 /* Free glyphs.
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
1184 This function must be called before the window tree of the
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
1185 frame is deleted because windows contain dynamically allocated
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
1186 memory. */
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
1187 free_glyphs (f);
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
1188
1680
ea9f3949f153 * frame.c (Fdelete_frame): Delete all the windows in the frame's
Jim Blandy <jimb@redhat.com>
parents: 1652
diff changeset
1189 /* Mark all the windows that used to be on FRAME as deleted, and then
ea9f3949f153 * frame.c (Fdelete_frame): Delete all the windows in the frame's
Jim Blandy <jimb@redhat.com>
parents: 1652
diff changeset
1190 remove the reference to them. */
ea9f3949f153 * frame.c (Fdelete_frame): Delete all the windows in the frame's
Jim Blandy <jimb@redhat.com>
parents: 1652
diff changeset
1191 delete_all_subwindows (XWINDOW (f->root_window));
ea9f3949f153 * frame.c (Fdelete_frame): Delete all the windows in the frame's
Jim Blandy <jimb@redhat.com>
parents: 1652
diff changeset
1192 f->root_window = Qnil;
ea9f3949f153 * frame.c (Fdelete_frame): Delete all the windows in the frame's
Jim Blandy <jimb@redhat.com>
parents: 1652
diff changeset
1193
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1194 Vframe_list = Fdelq (frame, Vframe_list);
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1195 FRAME_SET_VISIBLE (f, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1196
11495
da1a40d86231 (Fdelete_frame): Free f->namebuf.
Karl Heuer <kwzh@gnu.org>
parents: 11494
diff changeset
1197 if (f->namebuf)
25030
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
1198 xfree (f->namebuf);
8666
844edbc22875 (Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents: 8586
diff changeset
1199 if (FRAME_INSERT_COST (f))
25030
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
1200 xfree (FRAME_INSERT_COST (f));
8666
844edbc22875 (Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents: 8586
diff changeset
1201 if (FRAME_DELETEN_COST (f))
25030
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
1202 xfree (FRAME_DELETEN_COST (f));
8666
844edbc22875 (Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents: 8586
diff changeset
1203 if (FRAME_INSERTN_COST (f))
25030
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
1204 xfree (FRAME_INSERTN_COST (f));
8666
844edbc22875 (Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents: 8586
diff changeset
1205 if (FRAME_DELETE_COST (f))
25030
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
1206 xfree (FRAME_DELETE_COST (f));
17573
bfd86808adcc (Fdelete_frame): Free FRAME_MESSAGE_BUF.
Richard M. Stallman <rms@gnu.org>
parents: 17235
diff changeset
1207 if (FRAME_MESSAGE_BUF (f))
25030
c69d9e48269b (make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents: 23746
diff changeset
1208 xfree (FRAME_MESSAGE_BUF (f));
8666
844edbc22875 (Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents: 8586
diff changeset
1209
1809
69b3ee873a9b * frame.c (Fdelete_frame): Clear the frame's display after calling
Jim Blandy <jimb@redhat.com>
parents: 1784
diff changeset
1210 /* Since some events are handled at the interrupt level, we may get
69b3ee873a9b * frame.c (Fdelete_frame): Clear the frame's display after calling
Jim Blandy <jimb@redhat.com>
parents: 1784
diff changeset
1211 an event for f at any time; if we zero out the frame's display
69b3ee873a9b * frame.c (Fdelete_frame): Clear the frame's display after calling
Jim Blandy <jimb@redhat.com>
parents: 1784
diff changeset
1212 now, then we may trip up the event-handling code. Instead, we'll
69b3ee873a9b * frame.c (Fdelete_frame): Clear the frame's display after calling
Jim Blandy <jimb@redhat.com>
parents: 1784
diff changeset
1213 promise that the display of the frame must be valid until we have
69b3ee873a9b * frame.c (Fdelete_frame): Clear the frame's display after calling
Jim Blandy <jimb@redhat.com>
parents: 1784
diff changeset
1214 called the window-system-dependent frame destruction routine. */
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1215
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1216 /* I think this should be done with a hook. */
13412
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
1217 #ifdef HAVE_WINDOW_SYSTEM
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
1218 if (FRAME_WINDOW_P (f))
1809
69b3ee873a9b * frame.c (Fdelete_frame): Clear the frame's display after calling
Jim Blandy <jimb@redhat.com>
parents: 1784
diff changeset
1219 x_destroy_window (f);
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1220 #endif
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1221
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12630
diff changeset
1222 f->output_data.nothing = 0;
1809
69b3ee873a9b * frame.c (Fdelete_frame): Clear the frame's display after calling
Jim Blandy <jimb@redhat.com>
parents: 1784
diff changeset
1223
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1224 /* If we've deleted the last_nonminibuf_frame, then try to find
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1225 another one. */
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1226 if (f == last_nonminibuf_frame)
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1227 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1228 Lisp_Object frames;
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1229
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1230 last_nonminibuf_frame = 0;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1231
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1232 for (frames = Vframe_list;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1233 CONSP (frames);
26164
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
1234 frames = XCDR (frames))
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1235 {
26164
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
1236 f = XFRAME (XCAR (frames));
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1237 if (!FRAME_MINIBUF_ONLY_P (f))
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1238 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1239 last_nonminibuf_frame = f;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1240 break;
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1241 }
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1242 }
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1243 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1244
11906
3ca56969ba07 (Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents: 11794
diff changeset
1245 /* If we've deleted this keyboard's default_minibuffer_frame, try to
3ca56969ba07 (Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents: 11794
diff changeset
1246 find another one. Prefer minibuffer-only frames, but also notice
3ca56969ba07 (Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents: 11794
diff changeset
1247 frames with other windows. */
11779
6234b3610a6f Vdefault_minibuffer_frame is now part of KBOARD instead
Karl Heuer <kwzh@gnu.org>
parents: 11775
diff changeset
1248 if (EQ (frame, FRAME_KBOARD (f)->Vdefault_minibuffer_frame))
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1249 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1250 Lisp_Object frames;
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1251
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1252 /* The last frame we saw with a minibuffer, minibuffer-only or not. */
6500
551bff5cffde (next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
parents: 6486
diff changeset
1253 Lisp_Object frame_with_minibuf;
12380
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1254 /* Some frame we found on the same kboard, or nil if there are none. */
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1255 Lisp_Object frame_on_same_kboard;
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1256
12380
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1257 frame_on_same_kboard = Qnil;
6500
551bff5cffde (next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
parents: 6486
diff changeset
1258 frame_with_minibuf = Qnil;
12380
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1259
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1260 for (frames = Vframe_list;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1261 CONSP (frames);
26164
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
1262 frames = XCDR (frames))
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1263 {
6500
551bff5cffde (next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
parents: 6486
diff changeset
1264 Lisp_Object this;
11906
3ca56969ba07 (Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents: 11794
diff changeset
1265 struct frame *f1;
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1266
26164
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
1267 this = XCAR (frames);
9127
0b4836daa8e1 (Fframep, make_frame_without_minibuffer, do_switch_frame, prev_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9032
diff changeset
1268 if (!FRAMEP (this))
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1269 abort ();
11906
3ca56969ba07 (Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents: 11794
diff changeset
1270 f1 = XFRAME (this);
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1271
11906
3ca56969ba07 (Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents: 11794
diff changeset
1272 /* Consider only frames on the same kboard
3ca56969ba07 (Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents: 11794
diff changeset
1273 and only those with minibuffers. */
3ca56969ba07 (Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents: 11794
diff changeset
1274 if (FRAME_KBOARD (f) == FRAME_KBOARD (f1)
3ca56969ba07 (Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents: 11794
diff changeset
1275 && FRAME_HAS_MINIBUF_P (f1))
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1276 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1277 frame_with_minibuf = this;
11906
3ca56969ba07 (Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents: 11794
diff changeset
1278 if (FRAME_MINIBUF_ONLY_P (f1))
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1279 break;
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1280 }
12380
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1281
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1282 if (FRAME_KBOARD (f) == FRAME_KBOARD (f1))
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1283 frame_on_same_kboard = this;
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1284 }
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1285
12380
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1286 if (!NILP (frame_on_same_kboard))
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1287 {
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1288 /* We know that there must be some frame with a minibuffer out
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1289 there. If this were not true, all of the frames present
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1290 would have to be minibufferless, which implies that at some
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1291 point their minibuffer frames must have been deleted, but
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1292 that is prohibited at the top; you can't delete surrogate
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1293 minibuffer frames. */
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1294 if (NILP (frame_with_minibuf))
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1295 abort ();
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1296
12380
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1297 FRAME_KBOARD (f)->Vdefault_minibuffer_frame = frame_with_minibuf;
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1298 }
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1299 else
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1300 /* No frames left on this kboard--say no minibuffer either. */
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1301 FRAME_KBOARD (f)->Vdefault_minibuffer_frame = Qnil;
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1302 }
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1303
16280
f4833d0bfaaa (Fdelete_frame): Set update_mode_lines.
Richard M. Stallman <rms@gnu.org>
parents: 16263
diff changeset
1304 /* Cause frame titles to update--necessary if we now have just one frame. */
f4833d0bfaaa (Fdelete_frame): Set update_mode_lines.
Richard M. Stallman <rms@gnu.org>
parents: 16263
diff changeset
1305 update_mode_lines = 1;
f4833d0bfaaa (Fdelete_frame): Set update_mode_lines.
Richard M. Stallman <rms@gnu.org>
parents: 16263
diff changeset
1306
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1307 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1308 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1309
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1310 /* Return mouse position in character cell units. */
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1311
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
1312 DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1313 "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\
3693
8e83f20d0e39 * frame.c (Fmouse_position): Doc fix.
Jim Blandy <jimb@redhat.com>
parents: 3676
diff changeset
1314 The position is given in character cells, where (0, 0) is the\n\
8e83f20d0e39 * frame.c (Fmouse_position): Doc fix.
Jim Blandy <jimb@redhat.com>
parents: 3676
diff changeset
1315 upper-left corner.\n\
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
1316 If Emacs is running on a mouseless terminal or hasn't been programmed\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1317 to read the mouse position, it returns the selected frame for FRAME\n\
27795
83292274bbd4 (Vmouse_position_function): New variable.
Dave Love <fx@gnu.org>
parents: 27725
diff changeset
1318 and nil for X and Y.\n\
83292274bbd4 (Vmouse_position_function): New variable.
Dave Love <fx@gnu.org>
parents: 27725
diff changeset
1319 Runs the abnormal hook `mouse-position-function' with the normal return\n\
83292274bbd4 (Vmouse_position_function): New variable.
Dave Love <fx@gnu.org>
parents: 27725
diff changeset
1320 value as argument.")
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
1321 ()
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1322 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1323 FRAME_PTR f;
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1324 Lisp_Object lispy_dummy;
1989
b1c1ab20f810 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1920
diff changeset
1325 enum scroll_bar_part party_dummy;
27795
83292274bbd4 (Vmouse_position_function): New variable.
Dave Love <fx@gnu.org>
parents: 27725
diff changeset
1326 Lisp_Object x, y, retval;
6054
24ffc4bc4067 (Fmouse_position): Convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents: 6012
diff changeset
1327 int col, row;
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1328 unsigned long long_dummy;
27797
da774b48eb7f (Fmouse_position): GCPRO retval instead of x and y.
Gerd Moellmann <gerd@gnu.org>
parents: 27795
diff changeset
1329 struct gcpro gcpro1;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1330
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1331 f = SELECTED_FRAME ();
3658
c2831d419bec (Fmouse_position): Set up defaults before calling the hook.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1332 x = y = Qnil;
c2831d419bec (Fmouse_position): Set up defaults before calling the hook.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1333
11025
6c5aef697fbe (Fmouse_position): Do work only if HAVE_MOUSE.
Karl Heuer <kwzh@gnu.org>
parents: 11017
diff changeset
1334 #ifdef HAVE_MOUSE
3658
c2831d419bec (Fmouse_position): Set up defaults before calling the hook.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1335 /* It's okay for the hook to refrain from storing anything. */
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
1336 if (mouse_position_hook)
20178
fb9facb8fda0 (Fmouse_pixel_position, Fmouse_position):
Karl Heuer <kwzh@gnu.org>
parents: 20038
diff changeset
1337 (*mouse_position_hook) (&f, -1,
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1338 &lispy_dummy, &party_dummy,
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1339 &x, &y,
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1340 &long_dummy);
6854
c976ac5d85ec (Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
parents: 6806
diff changeset
1341 if (! NILP (x))
c976ac5d85ec (Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
parents: 6806
diff changeset
1342 {
c976ac5d85ec (Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
parents: 6806
diff changeset
1343 col = XINT (x);
c976ac5d85ec (Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
parents: 6806
diff changeset
1344 row = XINT (y);
12006
3e9db7cb1d05 (Fmouse_position): Use NULL, not 0, as arg of pixel_to_glyph_coords.
Karl Heuer <kwzh@gnu.org>
parents: 12005
diff changeset
1345 pixel_to_glyph_coords (f, col, row, &col, &row, NULL, 1);
6854
c976ac5d85ec (Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
parents: 6806
diff changeset
1346 XSETINT (x, col);
c976ac5d85ec (Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
parents: 6806
diff changeset
1347 XSETINT (y, row);
c976ac5d85ec (Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
parents: 6806
diff changeset
1348 }
11025
6c5aef697fbe (Fmouse_position): Do work only if HAVE_MOUSE.
Karl Heuer <kwzh@gnu.org>
parents: 11017
diff changeset
1349 #endif
9268
cb55d0155265 (make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9214
diff changeset
1350 XSETFRAME (lispy_dummy, f);
27795
83292274bbd4 (Vmouse_position_function): New variable.
Dave Love <fx@gnu.org>
parents: 27725
diff changeset
1351 retval = Fcons (lispy_dummy, Fcons (x, y));
27797
da774b48eb7f (Fmouse_position): GCPRO retval instead of x and y.
Gerd Moellmann <gerd@gnu.org>
parents: 27795
diff changeset
1352 GCPRO1 (retval);
27795
83292274bbd4 (Vmouse_position_function): New variable.
Dave Love <fx@gnu.org>
parents: 27725
diff changeset
1353 if (!NILP (Vmouse_position_function))
27797
da774b48eb7f (Fmouse_position): GCPRO retval instead of x and y.
Gerd Moellmann <gerd@gnu.org>
parents: 27795
diff changeset
1354 retval = call1 (Vmouse_position_function, retval);
da774b48eb7f (Fmouse_position): GCPRO retval instead of x and y.
Gerd Moellmann <gerd@gnu.org>
parents: 27795
diff changeset
1355 RETURN_UNGCPRO (retval);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1356 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1357
7025
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1358 DEFUN ("mouse-pixel-position", Fmouse_pixel_position,
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1359 Smouse_pixel_position, 0, 0, 0,
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1360 "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1361 The position is given in pixel units, where (0, 0) is the\n\
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1362 upper-left corner.\n\
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1363 If Emacs is running on a mouseless terminal or hasn't been programmed\n\
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1364 to read the mouse position, it returns the selected frame for FRAME\n\
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1365 and nil for X and Y.")
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1366 ()
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1367 {
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1368 FRAME_PTR f;
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1369 Lisp_Object lispy_dummy;
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1370 enum scroll_bar_part party_dummy;
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1371 Lisp_Object x, y;
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1372 unsigned long long_dummy;
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1373
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1374 f = SELECTED_FRAME ();
7025
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1375 x = y = Qnil;
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1376
11126
786f1c82a38e (Fmouse_position--both definitions): Pass 0 for `insist'.
Richard M. Stallman <rms@gnu.org>
parents: 11025
diff changeset
1377 #ifdef HAVE_MOUSE
7025
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1378 /* It's okay for the hook to refrain from storing anything. */
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1379 if (mouse_position_hook)
20178
fb9facb8fda0 (Fmouse_pixel_position, Fmouse_position):
Karl Heuer <kwzh@gnu.org>
parents: 20038
diff changeset
1380 (*mouse_position_hook) (&f, -1,
7025
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1381 &lispy_dummy, &party_dummy,
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1382 &x, &y,
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1383 &long_dummy);
11126
786f1c82a38e (Fmouse_position--both definitions): Pass 0 for `insist'.
Richard M. Stallman <rms@gnu.org>
parents: 11025
diff changeset
1384 #endif
9268
cb55d0155265 (make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9214
diff changeset
1385 XSETFRAME (lispy_dummy, f);
7025
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1386 return Fcons (lispy_dummy, Fcons (x, y));
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1387 }
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1388
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1389 DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0,
3694
f0e305fceb86 Doc fix.
Jim Blandy <jimb@redhat.com>
parents: 3693
diff changeset
1390 "Move the mouse pointer to the center of character cell (X,Y) in FRAME.\n\
23746
06f68bc4b777 (Fset_mouse_position): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 23633
diff changeset
1391 Coordinates are relative to the frame, not a window,\n\
06f68bc4b777 (Fset_mouse_position): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 23633
diff changeset
1392 so the coordinates of the top left character in the frame\n\
06f68bc4b777 (Fset_mouse_position): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 23633
diff changeset
1393 may be nonzero due to left-hand scroll bars or the menu bar.\n\
06f68bc4b777 (Fset_mouse_position): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 23633
diff changeset
1394 \n\
06f68bc4b777 (Fset_mouse_position): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 23633
diff changeset
1395 This function is a no-op for an X frame that is not visible.\n\
12774
9b17b06bc9cd (Fset_mouse_position, Fset_mouse_pixel_position): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 12761
diff changeset
1396 If you have just created a frame, you must wait for it to become visible\n\
9b17b06bc9cd (Fset_mouse_position, Fset_mouse_pixel_position): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 12761
diff changeset
1397 before calling this function on it, like this.\n\
9b17b06bc9cd (Fset_mouse_position, Fset_mouse_pixel_position): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 12761
diff changeset
1398 (while (not (frame-visible-p frame)) (sleep-for .5))")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1399 (frame, x, y)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1400 Lisp_Object frame, x, y;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1401 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1402 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1403 CHECK_NUMBER (x, 2);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1404 CHECK_NUMBER (y, 1);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1405
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1406 /* I think this should be done with a hook. */
13412
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
1407 #ifdef HAVE_WINDOW_SYSTEM
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
1408 if (FRAME_WINDOW_P (XFRAME (frame)))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1409 /* Warping the mouse will cause enternotify and focus events. */
21524
e4ab93e19658 (Fset_mouse_position, Fset_mouse_pixel_position): Fix
Andreas Schwab <schwab@suse.de>
parents: 21514
diff changeset
1410 x_set_mouse_position (XFRAME (frame), XINT (x), XINT (y));
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1411 #else
15396
fbecc317220d Whitespace changes.
Richard M. Stallman <rms@gnu.org>
parents: 15392
diff changeset
1412 #if defined (MSDOS) && defined (HAVE_MOUSE)
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1413 if (FRAME_MSDOS_P (XFRAME (frame)))
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1414 {
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1415 Fselect_frame (frame, Qnil);
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1416 mouse_moveto (XINT (x), XINT (y));
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1417 }
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1418 #endif
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1419 #endif
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1420
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1421 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1422 }
7025
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1423
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1424 DEFUN ("set-mouse-pixel-position", Fset_mouse_pixel_position,
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1425 Sset_mouse_pixel_position, 3, 3, 0,
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1426 "Move the mouse pointer to pixel position (X,Y) in FRAME.\n\
12774
9b17b06bc9cd (Fset_mouse_position, Fset_mouse_pixel_position): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 12761
diff changeset
1427 Note, this is a no-op for an X frame that is not visible.\n\
9b17b06bc9cd (Fset_mouse_position, Fset_mouse_pixel_position): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 12761
diff changeset
1428 If you have just created a frame, you must wait for it to become visible\n\
9b17b06bc9cd (Fset_mouse_position, Fset_mouse_pixel_position): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 12761
diff changeset
1429 before calling this function on it, like this.\n\
9b17b06bc9cd (Fset_mouse_position, Fset_mouse_pixel_position): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 12761
diff changeset
1430 (while (not (frame-visible-p frame)) (sleep-for .5))")
7025
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1431 (frame, x, y)
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1432 Lisp_Object frame, x, y;
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1433 {
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1434 CHECK_LIVE_FRAME (frame, 0);
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1435 CHECK_NUMBER (x, 2);
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1436 CHECK_NUMBER (y, 1);
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1437
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1438 /* I think this should be done with a hook. */
13412
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
1439 #ifdef HAVE_WINDOW_SYSTEM
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
1440 if (FRAME_WINDOW_P (XFRAME (frame)))
7025
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1441 /* Warping the mouse will cause enternotify and focus events. */
21524
e4ab93e19658 (Fset_mouse_position, Fset_mouse_pixel_position): Fix
Andreas Schwab <schwab@suse.de>
parents: 21514
diff changeset
1442 x_set_mouse_pixel_position (XFRAME (frame), XINT (x), XINT (y));
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1443 #else
15396
fbecc317220d Whitespace changes.
Richard M. Stallman <rms@gnu.org>
parents: 15392
diff changeset
1444 #if defined (MSDOS) && defined (HAVE_MOUSE)
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1445 if (FRAME_MSDOS_P (XFRAME (frame)))
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1446 {
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1447 Fselect_frame (frame, Qnil);
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1448 mouse_moveto (XINT (x), XINT (y));
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1449 }
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1450 #endif
7025
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1451 #endif
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1452
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1453 return Qnil;
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1454 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1455
22188
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1456 static void make_frame_visible_1 P_ ((Lisp_Object));
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1457
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1458 DEFUN ("make-frame-visible", Fmake_frame_visible, Smake_frame_visible,
3834
1b2144b795aa * frame.c (Fmake_frame_visible): Make this interactively callable;
Jim Blandy <jimb@redhat.com>
parents: 3763
diff changeset
1459 0, 1, "",
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1460 "Make the frame FRAME visible (assuming it is an X-window).\n\
1251
4e556fda7a4d * frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents: 1118
diff changeset
1461 If omitted, FRAME defaults to the currently selected frame.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1462 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1463 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1464 {
872
336ffe2bd537 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 785
diff changeset
1465 if (NILP (frame))
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1466 frame = selected_frame;
872
336ffe2bd537 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 785
diff changeset
1467
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1468 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1469
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1470 /* I think this should be done with a hook. */
13412
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
1471 #ifdef HAVE_WINDOW_SYSTEM
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
1472 if (FRAME_WINDOW_P (XFRAME (frame)))
5105
9b41ddf1b5f7 (Fmake_frame_visible): Use FRAME_SAMPLE_VISIBILITY. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 4961
diff changeset
1473 {
9b41ddf1b5f7 (Fmake_frame_visible): Use FRAME_SAMPLE_VISIBILITY. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 4961
diff changeset
1474 FRAME_SAMPLE_VISIBILITY (XFRAME (frame));
9b41ddf1b5f7 (Fmake_frame_visible): Use FRAME_SAMPLE_VISIBILITY. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 4961
diff changeset
1475 x_make_frame_visible (XFRAME (frame));
9b41ddf1b5f7 (Fmake_frame_visible): Use FRAME_SAMPLE_VISIBILITY. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 4961
diff changeset
1476 }
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
1477 #endif
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1478
22188
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1479 make_frame_visible_1 (XFRAME (frame)->root_window);
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1480
7900
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
1481 /* Make menu bar update for the Buffers and Frams menus. */
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
1482 windows_or_buffers_changed++;
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
1483
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1484 return frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1485 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1486
22188
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1487 /* Update the display_time slot of the buffers shown in WINDOW
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1488 and all its descendents. */
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1489
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1490 static void
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1491 make_frame_visible_1 (window)
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1492 Lisp_Object window;
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1493 {
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1494 struct window *w;
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1495
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1496 for (;!NILP (window); window = w->next)
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1497 {
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1498 w = XWINDOW (window);
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1499
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1500 if (!NILP (w->buffer))
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1501 XBUFFER (w->buffer)->display_time = Fcurrent_time ();
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1502
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1503 if (!NILP (w->vchild))
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1504 make_frame_visible_1 (w->vchild);
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1505 if (!NILP (w->hchild))
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1506 make_frame_visible_1 (w->hchild);
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1507 }
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1508 }
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1509
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1510 DEFUN ("make-frame-invisible", Fmake_frame_invisible, Smake_frame_invisible,
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1511 0, 2, "",
1251
4e556fda7a4d * frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents: 1118
diff changeset
1512 "Make the frame FRAME invisible (assuming it is an X-window).\n\
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1513 If omitted, FRAME defaults to the currently selected frame.\n\
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1514 Normally you may not make FRAME invisible if all other frames are invisible,\n\
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1515 but if the second optional argument FORCE is non-nil, you may do so.")
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1516 (frame, force)
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1517 Lisp_Object frame, force;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1518 {
872
336ffe2bd537 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 785
diff changeset
1519 if (NILP (frame))
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1520 frame = selected_frame;
872
336ffe2bd537 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 785
diff changeset
1521
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1522 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1523
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1524 if (NILP (force) && !other_visible_frames (XFRAME (frame)))
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1525 error ("Attempt to make invisible the sole visible or iconified frame");
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1526
8586
c78654909acf (Fmake_frame_invisible, Ficonify_frame): Don't switch frames.
Karl Heuer <kwzh@gnu.org>
parents: 8264
diff changeset
1527 #if 0 /* This isn't logically necessary, and it can do GC. */
3283
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1528 /* Don't let the frame remain selected. */
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1529 if (EQ (frame, selected_frame))
36810
a9485f8e43d6 (do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents: 36804
diff changeset
1530 do_switch_frame (next_frame (frame, Qt), 0, 0)
8586
c78654909acf (Fmake_frame_invisible, Ficonify_frame): Don't switch frames.
Karl Heuer <kwzh@gnu.org>
parents: 8264
diff changeset
1531 #endif
3283
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1532
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1533 /* Don't allow minibuf_window to remain on a deleted frame. */
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1534 if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window))
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1535 {
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1536 struct frame *sf = XFRAME (selected_frame);
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1537 Fset_window_buffer (sf->minibuffer_window,
3283
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1538 XWINDOW (minibuf_window)->buffer);
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1539 minibuf_window = sf->minibuffer_window;
3283
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1540 }
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1541
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1542 /* I think this should be done with a hook. */
13412
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
1543 #ifdef HAVE_WINDOW_SYSTEM
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
1544 if (FRAME_WINDOW_P (XFRAME (frame)))
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1545 x_make_frame_invisible (XFRAME (frame));
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
1546 #endif
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1547
7900
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
1548 /* Make menu bar update for the Buffers and Frams menus. */
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
1549 windows_or_buffers_changed++;
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
1550
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1551 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1552 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1553
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1554 DEFUN ("iconify-frame", Ficonify_frame, Siconify_frame,
872
336ffe2bd537 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 785
diff changeset
1555 0, 1, "",
1251
4e556fda7a4d * frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents: 1118
diff changeset
1556 "Make the frame FRAME into an icon.\n\
4e556fda7a4d * frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents: 1118
diff changeset
1557 If omitted, FRAME defaults to the currently selected frame.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1558 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1559 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1560 {
872
336ffe2bd537 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 785
diff changeset
1561 if (NILP (frame))
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1562 frame = selected_frame;
872
336ffe2bd537 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 785
diff changeset
1563
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1564 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1565
8586
c78654909acf (Fmake_frame_invisible, Ficonify_frame): Don't switch frames.
Karl Heuer <kwzh@gnu.org>
parents: 8264
diff changeset
1566 #if 0 /* This isn't logically necessary, and it can do GC. */
3283
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1567 /* Don't let the frame remain selected. */
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1568 if (EQ (frame, selected_frame))
3283
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1569 Fhandle_switch_frame (next_frame (frame, Qt), Qnil);
8586
c78654909acf (Fmake_frame_invisible, Ficonify_frame): Don't switch frames.
Karl Heuer <kwzh@gnu.org>
parents: 8264
diff changeset
1570 #endif
3283
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1571
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1572 /* Don't allow minibuf_window to remain on a deleted frame. */
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1573 if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window))
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1574 {
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1575 struct frame *sf = XFRAME (selected_frame);
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1576 Fset_window_buffer (sf->minibuffer_window,
3283
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1577 XWINDOW (minibuf_window)->buffer);
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1578 minibuf_window = sf->minibuffer_window;
3283
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1579 }
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1580
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1581 /* I think this should be done with a hook. */
13412
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
1582 #ifdef HAVE_WINDOW_SYSTEM
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
1583 if (FRAME_WINDOW_P (XFRAME (frame)))
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1584 x_iconify_frame (XFRAME (frame));
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
1585 #endif
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1586
7900
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
1587 /* Make menu bar update for the Buffers and Frams menus. */
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
1588 windows_or_buffers_changed++;
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
1589
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1590 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1591 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1592
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1593 DEFUN ("frame-visible-p", Fframe_visible_p, Sframe_visible_p,
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1594 1, 1, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1595 "Return t if FRAME is now \"visible\" (actually in use for display).\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1596 A frame that is not \"visible\" is not updated and, if it works through\n\
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1597 a window system, it may not show at all.\n\
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
1598 Return the symbol `icon' if frame is visible only as an icon.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1599 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1600 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1601 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1602 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1603
6012
650c0f231d17 (Fframe_visible_p): Do FRAME_SAMPLE_VISIBILITY first.
Richard M. Stallman <rms@gnu.org>
parents: 5925
diff changeset
1604 FRAME_SAMPLE_VISIBILITY (XFRAME (frame));
650c0f231d17 (Fframe_visible_p): Do FRAME_SAMPLE_VISIBILITY first.
Richard M. Stallman <rms@gnu.org>
parents: 5925
diff changeset
1605
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1606 if (FRAME_VISIBLE_P (XFRAME (frame)))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1607 return Qt;
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1608 if (FRAME_ICONIFIED_P (XFRAME (frame)))
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
1609 return Qicon;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1610 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1611 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1612
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1613 DEFUN ("visible-frame-list", Fvisible_frame_list, Svisible_frame_list,
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1614 0, 0, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1615 "Return a list of all frames now \"visible\" (being updated).")
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1616 ()
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1617 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1618 Lisp_Object tail, frame;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1619 struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1620 Lisp_Object value;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1621
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1622 value = Qnil;
26164
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
1623 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1624 {
26164
d39ec0a27081 more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents: 26088
diff changeset
1625 frame = XCAR (tail);
9127
0b4836daa8e1 (Fframep, make_frame_without_minibuffer, do_switch_frame, prev_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9032
diff changeset
1626 if (!FRAMEP (frame))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1627 continue;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1628 f = XFRAME (frame);
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1629 if (FRAME_VISIBLE_P (f))
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1630 value = Fcons (frame, value);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1631 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1632 return value;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1633 }
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1634
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1635
11754
7691dbfc7571 (Fraise_frame, Flower_frame): Make arg FRAME optional.
Richard M. Stallman <rms@gnu.org>
parents: 11535
diff changeset
1636 DEFUN ("raise-frame", Fraise_frame, Sraise_frame, 0, 1, "",
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1637 "Bring FRAME to the front, so it occludes any frames it overlaps.\n\
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1638 If FRAME is invisible, make it visible.\n\
11211
2f9a24a4c9eb (Fraise_frame, Flower_frame): Now interactive.
Richard M. Stallman <rms@gnu.org>
parents: 11169
diff changeset
1639 If you don't specify a frame, the selected frame is used.\n\
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1640 If Emacs is displaying on an ordinary terminal or some other device which\n\
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1641 doesn't support multiple overlapping frames, this function does nothing.")
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1642 (frame)
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1643 Lisp_Object frame;
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1644 {
11211
2f9a24a4c9eb (Fraise_frame, Flower_frame): Now interactive.
Richard M. Stallman <rms@gnu.org>
parents: 11169
diff changeset
1645 if (NILP (frame))
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1646 frame = selected_frame;
11211
2f9a24a4c9eb (Fraise_frame, Flower_frame): Now interactive.
Richard M. Stallman <rms@gnu.org>
parents: 11169
diff changeset
1647
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1648 CHECK_LIVE_FRAME (frame, 0);
4961
dd67510308ae (Fraise_frame): Do like the documentation says, and make
Richard M. Stallman <rms@gnu.org>
parents: 4798
diff changeset
1649
dd67510308ae (Fraise_frame): Do like the documentation says, and make
Richard M. Stallman <rms@gnu.org>
parents: 4798
diff changeset
1650 /* Do like the documentation says. */
dd67510308ae (Fraise_frame): Do like the documentation says, and make
Richard M. Stallman <rms@gnu.org>
parents: 4798
diff changeset
1651 Fmake_frame_visible (frame);
dd67510308ae (Fraise_frame): Do like the documentation says, and make
Richard M. Stallman <rms@gnu.org>
parents: 4798
diff changeset
1652
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1653 if (frame_raise_lower_hook)
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1654 (*frame_raise_lower_hook) (XFRAME (frame), 1);
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1655
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1656 return Qnil;
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1657 }
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1658
2282
f727944c11aa * frame.c (Fraise_frame, Flower_frame): Renamed from
Jim Blandy <jimb@redhat.com>
parents: 2207
diff changeset
1659 /* Should we have a corresponding function called Flower_Power? */
11754
7691dbfc7571 (Fraise_frame, Flower_frame): Make arg FRAME optional.
Richard M. Stallman <rms@gnu.org>
parents: 11535
diff changeset
1660 DEFUN ("lower-frame", Flower_frame, Slower_frame, 0, 1, "",
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1661 "Send FRAME to the back, so it is occluded by any frames that overlap it.\n\
11211
2f9a24a4c9eb (Fraise_frame, Flower_frame): Now interactive.
Richard M. Stallman <rms@gnu.org>
parents: 11169
diff changeset
1662 If you don't specify a frame, the selected frame is used.\n\
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1663 If Emacs is displaying on an ordinary terminal or some other device which\n\
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1664 doesn't support multiple overlapping frames, this function does nothing.")
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1665 (frame)
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1666 Lisp_Object frame;
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1667 {
11211
2f9a24a4c9eb (Fraise_frame, Flower_frame): Now interactive.
Richard M. Stallman <rms@gnu.org>
parents: 11169
diff changeset
1668 if (NILP (frame))
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1669 frame = selected_frame;
11211
2f9a24a4c9eb (Fraise_frame, Flower_frame): Now interactive.
Richard M. Stallman <rms@gnu.org>
parents: 11169
diff changeset
1670
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1671 CHECK_LIVE_FRAME (frame, 0);
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1672
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1673 if (frame_raise_lower_hook)
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1674 (*frame_raise_lower_hook) (XFRAME (frame), 0);
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1675
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1676 return Qnil;
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1677 }
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1678
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1679
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1680 DEFUN ("redirect-frame-focus", Fredirect_frame_focus, Sredirect_frame_focus,
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1681 1, 2, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1682 "Arrange for keystrokes typed at FRAME to be sent to FOCUS-FRAME.\n\
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1683 In other words, switch-frame events caused by events in FRAME will\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1684 request a switch to FOCUS-FRAME, and `last-event-frame' will be\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1685 FOCUS-FRAME after reading an event typed at FRAME.\n\
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1686 \n\
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1687 If FOCUS-FRAME is omitted or nil, any existing redirection is\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1688 cancelled, and the frame again receives its own keystrokes.\n\
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1689 \n\
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1690 Focus redirection is useful for temporarily redirecting keystrokes to\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1691 a surrogate minibuffer frame when a frame doesn't have its own\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1692 minibuffer window.\n\
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1693 \n\
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1694 A frame's focus redirection can be changed by select-frame. If frame\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1695 FOO is selected, and then a different frame BAR is selected, any\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1696 frames redirecting their focus to FOO are shifted to redirect their\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1697 focus to BAR. This allows focus redirection to work properly when the\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1698 user switches from one frame to another using `select-window'.\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1699 \n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1700 This means that a frame whose focus is redirected to itself is treated\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1701 differently from a frame whose focus is redirected to nil; the former\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1702 is affected by select-frame, while the latter is not.\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1703 \n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1704 The redirection lasts until `redirect-frame-focus' is called to change it.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1705 (frame, focus_frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1706 Lisp_Object frame, focus_frame;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1707 {
3970
020fe391d5c1 * frame.c (Fredirect_frame_focus): Allow redirection of focus of
Jim Blandy <jimb@redhat.com>
parents: 3834
diff changeset
1708 /* Note that we don't check for a live frame here. It's reasonable
020fe391d5c1 * frame.c (Fredirect_frame_focus): Allow redirection of focus of
Jim Blandy <jimb@redhat.com>
parents: 3834
diff changeset
1709 to redirect the focus of a frame you're about to delete, if you
020fe391d5c1 * frame.c (Fredirect_frame_focus): Allow redirection of focus of
Jim Blandy <jimb@redhat.com>
parents: 3834
diff changeset
1710 know what other frame should receive those keystrokes. */
020fe391d5c1 * frame.c (Fredirect_frame_focus): Allow redirection of focus of
Jim Blandy <jimb@redhat.com>
parents: 3834
diff changeset
1711 CHECK_FRAME (frame, 0);
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
1712
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1713 if (! NILP (focus_frame))
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1714 CHECK_LIVE_FRAME (focus_frame, 1);
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1715
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1716 XFRAME (frame)->focus_frame = focus_frame;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1717
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1718 if (frame_rehighlight_hook)
11535
ae282c46aec2 (Fredirect_frame_focus): Fix earlier change; use a frame known to be non-nil.
Karl Heuer <kwzh@gnu.org>
parents: 11532
diff changeset
1719 (*frame_rehighlight_hook) (XFRAME (frame));
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1720
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1721 return Qnil;
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1722 }
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1723
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1724
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1725 DEFUN ("frame-focus", Fframe_focus, Sframe_focus, 1, 1, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1726 "Return the frame to which FRAME's keystrokes are currently being sent.\n\
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1727 This returns nil if FRAME's focus is not redirected.\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1728 See `redirect-frame-focus'.")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1729 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1730 Lisp_Object frame;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1731 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1732 CHECK_LIVE_FRAME (frame, 0);
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1733
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1734 return FRAME_FOCUS_FRAME (XFRAME (frame));
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1735 }
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1736
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1737
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1738
10207
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1739 /* Return the value of frame parameter PROP in frame FRAME. */
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1740
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1741 Lisp_Object
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1742 get_frame_param (frame, prop)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1743 register struct frame *frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1744 Lisp_Object prop;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1745 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1746 register Lisp_Object tem;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1747
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1748 tem = Fassq (prop, frame->param_alist);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1749 if (EQ (tem, Qnil))
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1750 return tem;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1751 return Fcdr (tem);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1752 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1753
10207
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1754 /* Return the buffer-predicate of the selected frame. */
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1755
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1756 Lisp_Object
22188
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1757 frame_buffer_predicate (frame)
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1758 Lisp_Object frame;
10207
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1759 {
22188
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1760 return XFRAME (frame)->buffer_predicate;
10207
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1761 }
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1762
17221
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1763 /* Return the buffer-list of the selected frame. */
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1764
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1765 Lisp_Object
22188
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1766 frame_buffer_list (frame)
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1767 Lisp_Object frame;
17221
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1768 {
22188
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1769 return XFRAME (frame)->buffer_list;
17221
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1770 }
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1771
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1772 /* Set the buffer-list of the selected frame. */
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1773
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1774 void
22188
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1775 set_frame_buffer_list (frame, list)
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1776 Lisp_Object frame, list;
17221
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1777 {
22188
9fba463768ec (frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents: 21825
diff changeset
1778 XFRAME (frame)->buffer_list = list;
17221
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1779 }
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1780
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1781 /* Discard BUFFER from the buffer-list of each frame. */
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1782
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1783 void
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1784 frames_discard_buffer (buffer)
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1785 Lisp_Object buffer;
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1786 {
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1787 Lisp_Object frame, tail;
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1788
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1789 FOR_EACH_FRAME (tail, frame)
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1790 {
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1791 XFRAME (frame)->buffer_list
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1792 = Fdelq (buffer, XFRAME (frame)->buffer_list);
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1793 }
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1794 }
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1795
17235
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1796 /* Move BUFFER to the end of the buffer-list of each frame. */
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1797
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1798 void
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1799 frames_bury_buffer (buffer)
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1800 Lisp_Object buffer;
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1801 {
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1802 Lisp_Object frame, tail;
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1803
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1804 FOR_EACH_FRAME (tail, frame)
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1805 {
28930
963baceb2414 (frames_bury_buffer): Don't add a buffer to the frame's
Gerd Moellmann <gerd@gnu.org>
parents: 28225
diff changeset
1806 struct frame *f = XFRAME (frame);
963baceb2414 (frames_bury_buffer): Don't add a buffer to the frame's
Gerd Moellmann <gerd@gnu.org>
parents: 28225
diff changeset
1807 Lisp_Object found;
963baceb2414 (frames_bury_buffer): Don't add a buffer to the frame's
Gerd Moellmann <gerd@gnu.org>
parents: 28225
diff changeset
1808
963baceb2414 (frames_bury_buffer): Don't add a buffer to the frame's
Gerd Moellmann <gerd@gnu.org>
parents: 28225
diff changeset
1809 found = Fmemq (buffer, f->buffer_list);
963baceb2414 (frames_bury_buffer): Don't add a buffer to the frame's
Gerd Moellmann <gerd@gnu.org>
parents: 28225
diff changeset
1810 if (!NILP (found))
963baceb2414 (frames_bury_buffer): Don't add a buffer to the frame's
Gerd Moellmann <gerd@gnu.org>
parents: 28225
diff changeset
1811 f->buffer_list = nconc2 (Fdelq (buffer, f->buffer_list),
963baceb2414 (frames_bury_buffer): Don't add a buffer to the frame's
Gerd Moellmann <gerd@gnu.org>
parents: 28225
diff changeset
1812 Fcons (buffer, Qnil));
17235
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1813 }
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1814 }
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1815
10207
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1816 /* Modify the alist in *ALISTPTR to associate PROP with VAL.
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1817 If the alist already has an element for PROP, we change it. */
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1818
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1819 void
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
1820 store_in_alist (alistptr, prop, val)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1821 Lisp_Object *alistptr, val;
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
1822 Lisp_Object prop;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1823 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1824 register Lisp_Object tem;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1825
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1826 tem = Fassq (prop, *alistptr);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1827 if (EQ (tem, Qnil))
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1828 *alistptr = Fcons (Fcons (prop, val), *alistptr);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1829 else
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1830 Fsetcdr (tem, val);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1831 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1832
20280
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1833 static int
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1834 frame_name_fnn_p (str, len)
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1835 char *str;
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1836 int len;
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1837 {
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1838 if (len > 1 && str[0] == 'F')
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1839 {
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1840 char *end_ptr;
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1841
25789
d68642dd5bbf (frame_name_fnn_p): Fix previous change.
Eli Zaretskii <eliz@gnu.org>
parents: 25736
diff changeset
1842 strtol (str + 1, &end_ptr, 10);
d68642dd5bbf (frame_name_fnn_p): Fix previous change.
Eli Zaretskii <eliz@gnu.org>
parents: 25736
diff changeset
1843
20280
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1844 if (end_ptr == str + len)
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1845 return 1;
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1846 }
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1847 return 0;
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1848 }
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1849
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1850 /* Set the name of the terminal frame. Also used by MSDOS frames.
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1851 Modeled after x_set_name which is used for WINDOW frames. */
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1852
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1853 void
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1854 set_term_frame_name (f, name)
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1855 struct frame *f;
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1856 Lisp_Object name;
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1857 {
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1858 f->explicit_name = ! NILP (name);
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1859
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1860 /* If NAME is nil, set the name to F<num>. */
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1861 if (NILP (name))
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1862 {
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1863 char namebuf[20];
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1864
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1865 /* Check for no change needed in this very common case
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1866 before we do any consing. */
20622
619c69f1ab83 (set_term_frame_name): Use size_byte.
Richard M. Stallman <rms@gnu.org>
parents: 20280
diff changeset
1867 if (frame_name_fnn_p (XSTRING (f->name)->data,
21244
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20622
diff changeset
1868 STRING_BYTES (XSTRING (f->name))))
20280
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1869 return;
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1870
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1871 terminal_frame_count++;
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1872 sprintf (namebuf, "F%d", terminal_frame_count);
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1873 name = build_string (namebuf);
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1874 }
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1875 else
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1876 {
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1877 CHECK_STRING (name, 0);
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1878
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1879 /* Don't change the name if it's already NAME. */
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1880 if (! NILP (Fstring_equal (name, f->name)))
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1881 return;
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1882
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1883 /* Don't allow the user to set the frame name to F<num>, so it
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1884 doesn't clash with the names we generate for terminal frames. */
21244
50929073a0ba Use STRING_BYTES and SET_STRING_BYTES.
Richard M. Stallman <rms@gnu.org>
parents: 20622
diff changeset
1885 if (frame_name_fnn_p (XSTRING (name)->data, STRING_BYTES (XSTRING (name))))
20280
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1886 error ("Frame names of the form F<num> are usurped by Emacs");
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1887 }
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1888
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1889 f->name = name;
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1890 update_mode_lines = 1;
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1891 }
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1892
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1893 void
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1894 store_frame_param (f, prop, val)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1895 struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1896 Lisp_Object prop, val;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1897 {
29616
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1898 register Lisp_Object old_alist_elt;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1899
29616
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1900 /* The buffer-alist parameter is stored in a special place and is
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1901 not in the alist. */
17221
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1902 if (EQ (prop, Qbuffer_list))
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1903 {
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1904 f->buffer_list = val;
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1905 return;
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1906 }
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1907
29616
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1908 /* If PROP is a symbol which is supposed to have frame-local values,
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1909 and it is set up based on this frame, switch to the global
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1910 binding. That way, we can create or alter the frame-local binding
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1911 without messing up the symbol's status. */
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1912 if (SYMBOLP (prop))
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1913 {
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1914 Lisp_Object valcontents;
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1915 valcontents = XSYMBOL (prop)->value;
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1916 if ((BUFFER_LOCAL_VALUEP (valcontents)
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1917 || SOME_BUFFER_LOCAL_VALUEP (valcontents))
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1918 && XBUFFER_LOCAL_VALUE (valcontents)->check_frame
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1919 && XFRAME (XBUFFER_LOCAL_VALUE (valcontents)->frame) == f)
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1920 swap_in_global_binding (prop);
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1921 }
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1922
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1923 /* Update the frame parameter alist. */
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1924 old_alist_elt = Fassq (prop, f->param_alist);
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1925 if (EQ (old_alist_elt, Qnil))
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1926 f->param_alist = Fcons (Fcons (prop, val), f->param_alist);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1927 else
29616
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1928 Fsetcdr (old_alist_elt, val);
539
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
1929
29616
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1930 /* Update some other special parameters in their special places
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1931 in addition to the alist. */
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
1932
10207
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1933 if (EQ (prop, Qbuffer_predicate))
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1934 f->buffer_predicate = val;
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1935
13412
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
1936 if (! FRAME_WINDOW_P (f))
20280
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1937 {
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1938 if (EQ (prop, Qmenu_bar_lines))
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1939 set_menu_bar_lines (f, val, make_number (FRAME_MENU_BAR_LINES (f)));
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1940 else if (EQ (prop, Qname))
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1941 set_term_frame_name (f, val);
7916c0d8f2ae (frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 20178
diff changeset
1942 }
12761
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
1943
9127
0b4836daa8e1 (Fframep, make_frame_without_minibuffer, do_switch_frame, prev_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9032
diff changeset
1944 if (EQ (prop, Qminibuffer) && WINDOWP (val))
539
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
1945 {
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
1946 if (! MINI_WINDOW_P (XWINDOW (val)))
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
1947 error ("Surrogate minibuffer windows must be minibuffer windows.");
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
1948
25710
ee1da070c50f (Fnext_frame): Remove unused variable(s).
Gerd Moellmann <gerd@gnu.org>
parents: 25669
diff changeset
1949 if ((FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f))
16371
906cef1d36bd (store_frame_param): Allow setting a frame's minibuffer
Karl Heuer <kwzh@gnu.org>
parents: 16280
diff changeset
1950 && !EQ (val, f->minibuffer_window))
906cef1d36bd (store_frame_param): Allow setting a frame's minibuffer
Karl Heuer <kwzh@gnu.org>
parents: 16280
diff changeset
1951 error ("Can't change the surrogate minibuffer of a frame with its own minibuffer");
539
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
1952
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
1953 /* Install the chosen minibuffer window, with proper buffer. */
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1954 f->minibuffer_window = val;
539
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
1955 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1956 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1957
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1958 DEFUN ("frame-parameters", Fframe_parameters, Sframe_parameters, 0, 1, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1959 "Return the parameters-alist of frame FRAME.\n\
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1960 It is a list of elements of the form (PARM . VALUE), where PARM is a symbol.\n\
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
1961 The meaningful PARMs depend on the kind of frame.\n\
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
1962 If FRAME is omitted, return information on the currently selected frame.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1963 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1964 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1965 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1966 Lisp_Object alist;
7162
06a13bf36a8c (Fframe_parameters) [!MULTI_FRAME]: Unstub it again.
Karl Heuer <kwzh@gnu.org>
parents: 7134
diff changeset
1967 FRAME_PTR f;
15062
de7528327c39 (Fframe_parameters, both definitions):
Richard M. Stallman <rms@gnu.org>
parents: 15001
diff changeset
1968 int height, width;
27575
2344fab04513 (Fframe_parameters): Add GCPRO because tty_color_name can GC.
Gerd Moellmann <gerd@gnu.org>
parents: 26729
diff changeset
1969 struct gcpro gcpro1;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1970
36804
e4331ae9636d (Fframe_parameters): In the `buffer-list' frame
Gerd Moellmann <gerd@gnu.org>
parents: 36433
diff changeset
1971 if (NILP (frame))
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1972 frame = selected_frame;
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1973
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1974 CHECK_FRAME (frame, 0);
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
1975 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1976
7162
06a13bf36a8c (Fframe_parameters) [!MULTI_FRAME]: Unstub it again.
Karl Heuer <kwzh@gnu.org>
parents: 7134
diff changeset
1977 if (!FRAME_LIVE_P (f))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1978 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1979
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1980 alist = Fcopy_alist (f->param_alist);
27575
2344fab04513 (Fframe_parameters): Add GCPRO because tty_color_name can GC.
Gerd Moellmann <gerd@gnu.org>
parents: 26729
diff changeset
1981 GCPRO1 (alist);
2344fab04513 (Fframe_parameters): Add GCPRO because tty_color_name can GC.
Gerd Moellmann <gerd@gnu.org>
parents: 26729
diff changeset
1982
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26164
diff changeset
1983 if (!FRAME_WINDOW_P (f))
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1984 {
25117
f6f34f0bc1af (make_terminal_frame) [MSDOS]: Don't call
Eli Zaretskii <eliz@gnu.org>
parents: 25030
diff changeset
1985 int fg = FRAME_FOREGROUND_PIXEL (f);
f6f34f0bc1af (make_terminal_frame) [MSDOS]: Don't call
Eli Zaretskii <eliz@gnu.org>
parents: 25030
diff changeset
1986 int bg = FRAME_BACKGROUND_PIXEL (f);
32545
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
1987 Lisp_Object elt;
25117
f6f34f0bc1af (make_terminal_frame) [MSDOS]: Don't call
Eli Zaretskii <eliz@gnu.org>
parents: 25030
diff changeset
1988
32545
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
1989 /* If the frame's parameter alist says the colors are
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
1990 unspecified and reversed, take the frame's background pixel
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
1991 for foreground and vice versa. */
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
1992 elt = Fassq (Qforeground_color, alist);
33005
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
1993 if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt)))
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
1994 {
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
1995 if (strncmp (XSTRING (XCDR (elt))->data,
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
1996 unspecified_bg,
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
1997 XSTRING (XCDR (elt))->size) == 0)
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
1998 store_in_alist (&alist, Qforeground_color, tty_color_name (f, bg));
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
1999 else if (strncmp (XSTRING (XCDR (elt))->data,
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
2000 unspecified_fg,
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
2001 XSTRING (XCDR (elt))->size) == 0)
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
2002 store_in_alist (&alist, Qforeground_color, tty_color_name (f, fg));
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
2003 }
32545
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2004 else
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2005 store_in_alist (&alist, Qforeground_color, tty_color_name (f, fg));
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2006 elt = Fassq (Qbackground_color, alist);
33005
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
2007 if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt)))
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
2008 {
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
2009 if (strncmp (XSTRING (XCDR (elt))->data,
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
2010 unspecified_fg,
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
2011 XSTRING (XCDR (elt))->size) == 0)
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
2012 store_in_alist (&alist, Qbackground_color, tty_color_name (f, fg));
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
2013 else if (strncmp (XSTRING (XCDR (elt))->data,
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
2014 unspecified_bg,
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
2015 XSTRING (XCDR (elt))->size) == 0)
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
2016 store_in_alist (&alist, Qbackground_color, tty_color_name (f, bg));
87893013088c (Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents: 32909
diff changeset
2017 }
32545
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2018 else
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2019 store_in_alist (&alist, Qbackground_color, tty_color_name (f, bg));
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26164
diff changeset
2020 store_in_alist (&alist, intern ("font"),
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26164
diff changeset
2021 build_string (FRAME_MSDOS_P (f)
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 26164
diff changeset
2022 ? "ms-dos"
35003
c6726a1e70ce (make_terminal_frame) [WINDOWSNT]: Make terminal frames
Andrew Innes <andrewi@gnu.org>
parents: 33760
diff changeset
2023 : FRAME_W32_P (f) ? "w32term"
c6726a1e70ce (make_terminal_frame) [WINDOWSNT]: Make terminal frames
Andrew Innes <andrewi@gnu.org>
parents: 33760
diff changeset
2024 :"tty"));
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
2025 }
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
2026 store_in_alist (&alist, Qname, f->name);
15062
de7528327c39 (Fframe_parameters, both definitions):
Richard M. Stallman <rms@gnu.org>
parents: 15001
diff changeset
2027 height = (FRAME_NEW_HEIGHT (f) ? FRAME_NEW_HEIGHT (f) : FRAME_HEIGHT (f));
de7528327c39 (Fframe_parameters, both definitions):
Richard M. Stallman <rms@gnu.org>
parents: 15001
diff changeset
2028 store_in_alist (&alist, Qheight, make_number (height));
de7528327c39 (Fframe_parameters, both definitions):
Richard M. Stallman <rms@gnu.org>
parents: 15001
diff changeset
2029 width = (FRAME_NEW_WIDTH (f) ? FRAME_NEW_WIDTH (f) : FRAME_WIDTH (f));
de7528327c39 (Fframe_parameters, both definitions):
Richard M. Stallman <rms@gnu.org>
parents: 15001
diff changeset
2030 store_in_alist (&alist, Qwidth, make_number (width));
7162
06a13bf36a8c (Fframe_parameters) [!MULTI_FRAME]: Unstub it again.
Karl Heuer <kwzh@gnu.org>
parents: 7134
diff changeset
2031 store_in_alist (&alist, Qmodeline, (FRAME_WANTS_MODELINE_P (f) ? Qt : Qnil));
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
2032 store_in_alist (&alist, Qminibuffer,
1870
d90e9fecad48 * frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
2033 (! FRAME_HAS_MINIBUF_P (f) ? Qnil
7162
06a13bf36a8c (Fframe_parameters) [!MULTI_FRAME]: Unstub it again.
Karl Heuer <kwzh@gnu.org>
parents: 7134
diff changeset
2034 : FRAME_MINIBUF_ONLY_P (f) ? Qonly
06a13bf36a8c (Fframe_parameters) [!MULTI_FRAME]: Unstub it again.
Karl Heuer <kwzh@gnu.org>
parents: 7134
diff changeset
2035 : FRAME_MINIBUF_WINDOW (f)));
06a13bf36a8c (Fframe_parameters) [!MULTI_FRAME]: Unstub it again.
Karl Heuer <kwzh@gnu.org>
parents: 7134
diff changeset
2036 store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil));
36804
e4331ae9636d (Fframe_parameters): In the `buffer-list' frame
Gerd Moellmann <gerd@gnu.org>
parents: 36433
diff changeset
2037 store_in_alist (&alist, Qbuffer_list, frame_buffer_list (frame));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2038
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
2039 /* I think this should be done with a hook. */
13412
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
2040 #ifdef HAVE_WINDOW_SYSTEM
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
2041 if (FRAME_WINDOW_P (f))
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2042 x_report_frame_params (f, &alist);
8244
15d4c2bd29e6 [MULTI_FRAME] (Fframe_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 8168
diff changeset
2043 else
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
2044 #endif
8904
af3ff2dbaddd (Fframe_parameters): Fix Lisp_Object vs. int problems.
Karl Heuer <kwzh@gnu.org>
parents: 8685
diff changeset
2045 {
af3ff2dbaddd (Fframe_parameters): Fix Lisp_Object vs. int problems.
Karl Heuer <kwzh@gnu.org>
parents: 8685
diff changeset
2046 /* This ought to be correct in f->param_alist for an X frame. */
af3ff2dbaddd (Fframe_parameters): Fix Lisp_Object vs. int problems.
Karl Heuer <kwzh@gnu.org>
parents: 8685
diff changeset
2047 Lisp_Object lines;
9309
27370f65dfa1 (make_frame, Fframe_parameters, Fselected_frame, syms_of_frame): Don't use
Karl Heuer <kwzh@gnu.org>
parents: 9268
diff changeset
2048 XSETFASTINT (lines, FRAME_MENU_BAR_LINES (f));
8904
af3ff2dbaddd (Fframe_parameters): Fix Lisp_Object vs. int problems.
Karl Heuer <kwzh@gnu.org>
parents: 8685
diff changeset
2049 store_in_alist (&alist, Qmenu_bar_lines, lines);
af3ff2dbaddd (Fframe_parameters): Fix Lisp_Object vs. int problems.
Karl Heuer <kwzh@gnu.org>
parents: 8685
diff changeset
2050 }
27575
2344fab04513 (Fframe_parameters): Add GCPRO because tty_color_name can GC.
Gerd Moellmann <gerd@gnu.org>
parents: 26729
diff changeset
2051
2344fab04513 (Fframe_parameters): Add GCPRO because tty_color_name can GC.
Gerd Moellmann <gerd@gnu.org>
parents: 26729
diff changeset
2052 UNGCPRO;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2053 return alist;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2054 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2055
31399
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2056
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2057 DEFUN ("frame-parameter", Fframe_parameter, Sframe_parameter, 2, 2, 0,
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2058 "Return FRAME's value for parameter PARAMETER.\n\
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2059 If FRAME is nil, describe the currently selected frame.")
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2060 (frame, parameter)
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2061 Lisp_Object frame, parameter;
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2062 {
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2063 struct frame *f;
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2064 Lisp_Object value;
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2065
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2066 if (NILP (frame))
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2067 frame = selected_frame;
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2068 else
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2069 CHECK_FRAME (frame, 0);
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2070 CHECK_SYMBOL (parameter, 1);
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2071
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2072 f = XFRAME (frame);
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2073 value = Qnil;
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2074
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2075 if (FRAME_LIVE_P (f))
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2076 {
31442
cb166d3ac8e7 (Fframe_parameter): Handle `name' specially.
Gerd Moellmann <gerd@gnu.org>
parents: 31399
diff changeset
2077 if (EQ (parameter, Qname))
cb166d3ac8e7 (Fframe_parameter): Handle `name' specially.
Gerd Moellmann <gerd@gnu.org>
parents: 31399
diff changeset
2078 value = f->name;
31448
70b366918608 (Fframe_parameter): Handle `name' and `background-mode'
Gerd Moellmann <gerd@gnu.org>
parents: 31442
diff changeset
2079 #ifdef HAVE_X_WINDOWS
70b366918608 (Fframe_parameter): Handle `name' and `background-mode'
Gerd Moellmann <gerd@gnu.org>
parents: 31442
diff changeset
2080 else if (EQ (parameter, Qdisplay) && FRAME_X_P (f))
70b366918608 (Fframe_parameter): Handle `name' and `background-mode'
Gerd Moellmann <gerd@gnu.org>
parents: 31442
diff changeset
2081 value = XCAR (FRAME_X_DISPLAY_INFO (f)->name_list_element);
70b366918608 (Fframe_parameter): Handle `name' and `background-mode'
Gerd Moellmann <gerd@gnu.org>
parents: 31442
diff changeset
2082 #endif /* HAVE_X_WINDOWS */
31399
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2083 else
31442
cb166d3ac8e7 (Fframe_parameter): Handle `name' specially.
Gerd Moellmann <gerd@gnu.org>
parents: 31399
diff changeset
2084 {
cb166d3ac8e7 (Fframe_parameter): Handle `name' specially.
Gerd Moellmann <gerd@gnu.org>
parents: 31399
diff changeset
2085 value = Fassq (parameter, f->param_alist);
cb166d3ac8e7 (Fframe_parameter): Handle `name' specially.
Gerd Moellmann <gerd@gnu.org>
parents: 31399
diff changeset
2086 if (CONSP (value))
32254
f93728883f64 (Fframe_parameter): For non-windowed frames, if
Eli Zaretskii <eliz@gnu.org>
parents: 31470
diff changeset
2087 {
f93728883f64 (Fframe_parameter): For non-windowed frames, if
Eli Zaretskii <eliz@gnu.org>
parents: 31470
diff changeset
2088 value = XCDR (value);
f93728883f64 (Fframe_parameter): For non-windowed frames, if
Eli Zaretskii <eliz@gnu.org>
parents: 31470
diff changeset
2089 /* Fframe_parameters puts the actual fg/bg color names,
f93728883f64 (Fframe_parameter): For non-windowed frames, if
Eli Zaretskii <eliz@gnu.org>
parents: 31470
diff changeset
2090 even if f->param_alist says otherwise. This is
f93728883f64 (Fframe_parameter): For non-windowed frames, if
Eli Zaretskii <eliz@gnu.org>
parents: 31470
diff changeset
2091 important when param_alist's notion of colors is
f93728883f64 (Fframe_parameter): For non-windowed frames, if
Eli Zaretskii <eliz@gnu.org>
parents: 31470
diff changeset
2092 "unspecified". We need to do the same here. */
f93728883f64 (Fframe_parameter): For non-windowed frames, if
Eli Zaretskii <eliz@gnu.org>
parents: 31470
diff changeset
2093 if (STRINGP (value) && !FRAME_WINDOW_P (f))
f93728883f64 (Fframe_parameter): For non-windowed frames, if
Eli Zaretskii <eliz@gnu.org>
parents: 31470
diff changeset
2094 {
32545
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2095 char *color_name;
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2096 EMACS_INT csz;
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2097
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2098 if (EQ (parameter, Qbackground_color))
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2099 {
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2100 color_name = XSTRING (value)->data;
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2101 csz = XSTRING (value)->size;
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2102 if (strncmp (color_name, unspecified_bg, csz) == 0)
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2103 value = tty_color_name (f, FRAME_BACKGROUND_PIXEL (f));
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2104 else if (strncmp (color_name, unspecified_fg, csz) == 0)
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2105 value = tty_color_name (f, FRAME_FOREGROUND_PIXEL (f));
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2106 }
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2107 else if (EQ (parameter, Qforeground_color))
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2108 {
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2109 color_name = XSTRING (value)->data;
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2110 csz = XSTRING (value)->size;
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2111 if (strncmp (color_name, unspecified_fg, csz) == 0)
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2112 value = tty_color_name (f, FRAME_FOREGROUND_PIXEL (f));
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2113 else if (strncmp (color_name, unspecified_bg, csz) == 0)
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2114 value = tty_color_name (f, FRAME_BACKGROUND_PIXEL (f));
288723d38c06 (Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents: 32254
diff changeset
2115 }
32254
f93728883f64 (Fframe_parameter): For non-windowed frames, if
Eli Zaretskii <eliz@gnu.org>
parents: 31470
diff changeset
2116 }
f93728883f64 (Fframe_parameter): For non-windowed frames, if
Eli Zaretskii <eliz@gnu.org>
parents: 31470
diff changeset
2117 }
31448
70b366918608 (Fframe_parameter): Handle `name' and `background-mode'
Gerd Moellmann <gerd@gnu.org>
parents: 31442
diff changeset
2118 else if (EQ (parameter, Qdisplay_type)
70b366918608 (Fframe_parameter): Handle `name' and `background-mode'
Gerd Moellmann <gerd@gnu.org>
parents: 31442
diff changeset
2119 || EQ (parameter, Qbackground_mode))
70b366918608 (Fframe_parameter): Handle `name' and `background-mode'
Gerd Moellmann <gerd@gnu.org>
parents: 31442
diff changeset
2120 /* Avoid consing in frequent cases. */
31442
cb166d3ac8e7 (Fframe_parameter): Handle `name' specially.
Gerd Moellmann <gerd@gnu.org>
parents: 31399
diff changeset
2121 value = Qnil;
cb166d3ac8e7 (Fframe_parameter): Handle `name' specially.
Gerd Moellmann <gerd@gnu.org>
parents: 31399
diff changeset
2122 else
cb166d3ac8e7 (Fframe_parameter): Handle `name' specially.
Gerd Moellmann <gerd@gnu.org>
parents: 31399
diff changeset
2123 value = Fcdr (Fassq (parameter, Fframe_parameters (frame)));
cb166d3ac8e7 (Fframe_parameter): Handle `name' specially.
Gerd Moellmann <gerd@gnu.org>
parents: 31399
diff changeset
2124 }
31399
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2125 }
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2126
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2127 return value;
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2128 }
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2129
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2130
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2131 DEFUN ("modify-frame-parameters", Fmodify_frame_parameters,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2132 Smodify_frame_parameters, 2, 2, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2133 "Modify the parameters of frame FRAME according to ALIST.\n\
35817
b102dd3ed2a3 (Fmodify_frame_parameters): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 35660
diff changeset
2134 If FRAME is nil, it defaults to the selected frame.\n\
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2135 ALIST is an alist of parameters to change and their new values.\n\
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2136 Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.\n\
16536
a144fa66d84b (Fmodify_frame_parameters): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 16371
diff changeset
2137 The meaningful PARMs depend on the kind of frame.\n\
a144fa66d84b (Fmodify_frame_parameters): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 16371
diff changeset
2138 Undefined PARMs are ignored, but stored in the frame's parameter list\n\
29616
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
2139 so that `frame-parameters' will return them.\n\
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
2140 \n\
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
2141 The value of frame parameter FOO can also be accessed\n\
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
2142 as a frame-local binding for the variable FOO, if you have\n\
8d7a0f575a0e (Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 28930
diff changeset
2143 enabled such bindings for that variable with `make-variable-frame-local'.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2144 (frame, alist)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2145 Lisp_Object frame, alist;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2146 {
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
2147 FRAME_PTR f;
25710
ee1da070c50f (Fnext_frame): Remove unused variable(s).
Gerd Moellmann <gerd@gnu.org>
parents: 25669
diff changeset
2148 register Lisp_Object tail, prop, val;
33509
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2149 int count = BINDING_STACK_SIZE ();
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2150
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2151 /* Bind this to t to inhibit initialization of the default face from
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2152 X resources in face-set-after-frame-default. If we don't inhibit
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2153 this, modifying the `font' frame parameter, for example, while
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2154 there is a `default.attributeFont' X resource, won't work,
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2155 because `default's font is reset to the value of the X resource
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2156 and that resets the `font' frame parameter. */
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2157 specbind (Qinhibit_default_face_x_resources, Qt);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2158
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2159 if (EQ (frame, Qnil))
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
2160 frame = selected_frame;
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
2161 CHECK_LIVE_FRAME (frame, 0);
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
2162 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2163
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
2164 /* I think this should be done with a hook. */
13412
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
2165 #ifdef HAVE_WINDOW_SYSTEM
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
2166 if (FRAME_WINDOW_P (f))
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
2167 x_set_frame_parameters (f, alist);
10207
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
2168 else
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
2169 #endif
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
2170 #ifdef MSDOS
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
2171 if (FRAME_MSDOS_P (f))
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
2172 IT_set_frame_parameters (f, alist);
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
2173 else
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
2174 #endif
25523
9e9eeb68482e (Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents: 25350
diff changeset
2175
16568
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2176 {
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2177 int length = XINT (Flength (alist));
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2178 int i;
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2179 Lisp_Object *parms
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2180 = (Lisp_Object *) alloca (length * sizeof (Lisp_Object));
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2181 Lisp_Object *values
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2182 = (Lisp_Object *) alloca (length * sizeof (Lisp_Object));
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2183
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2184 /* Extract parm names and values into those vectors. */
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2185
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2186 i = 0;
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2187 for (tail = alist; CONSP (tail); tail = Fcdr (tail))
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2188 {
25710
ee1da070c50f (Fnext_frame): Remove unused variable(s).
Gerd Moellmann <gerd@gnu.org>
parents: 25669
diff changeset
2189 Lisp_Object elt;
16568
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2190
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2191 elt = Fcar (tail);
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2192 parms[i] = Fcar (elt);
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2193 values[i] = Fcdr (elt);
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2194 i++;
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2195 }
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2196
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2197 /* Now process them in reverse of specified order. */
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2198 for (i--; i >= 0; i--)
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2199 {
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2200 prop = parms[i];
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2201 val = values[i];
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2202 store_frame_param (f, prop, val);
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2203 }
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
2204 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2205
33509
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2206 return unbind_to (count, Qnil);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2207 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2208
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2209 DEFUN ("frame-char-height", Fframe_char_height, Sframe_char_height,
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2210 0, 1, 0,
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2211 "Height in pixels of a line in the font in frame FRAME.\n\
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2212 If FRAME is omitted, the selected frame is used.\n\
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2213 For a terminal frame, the value is always 1.")
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2214 (frame)
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2215 Lisp_Object frame;
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2216 {
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2217 struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2218
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2219 if (NILP (frame))
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
2220 frame = selected_frame;
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
2221 CHECK_FRAME (frame, 0);
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
2222 f = XFRAME (frame);
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
2223
13412
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
2224 #ifdef HAVE_WINDOW_SYSTEM
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
2225 if (FRAME_WINDOW_P (f))
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2226 return make_number (x_char_height (f));
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2227 else
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2228 #endif
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2229 return make_number (1);
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2230 }
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2231
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2232
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2233 DEFUN ("frame-char-width", Fframe_char_width, Sframe_char_width,
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2234 0, 1, 0,
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2235 "Width in pixels of characters in the font in frame FRAME.\n\
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2236 If FRAME is omitted, the selected frame is used.\n\
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2237 The width is the same for all characters, because\n\
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2238 currently Emacs supports only fixed-width fonts.\n\
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2239 For a terminal screen, the value is always 1.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2240 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2241 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2242 {
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2243 struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2244
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2245 if (NILP (frame))
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
2246 frame = selected_frame;
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
2247 CHECK_FRAME (frame, 0);
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
2248 f = XFRAME (frame);
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2249
13412
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
2250 #ifdef HAVE_WINDOW_SYSTEM
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
2251 if (FRAME_WINDOW_P (f))
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2252 return make_number (x_char_width (f));
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2253 else
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
2254 #endif
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2255 return make_number (1);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2256 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2257
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2258 DEFUN ("frame-pixel-height", Fframe_pixel_height,
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2259 Sframe_pixel_height, 0, 1, 0,
3676
5160a6967f80 Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 3658
diff changeset
2260 "Return a FRAME's height in pixels.\n\
19532
9dcee56b2966 (Fframe_pixel_height): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 18945
diff changeset
2261 This counts only the height available for text lines,\n\
9dcee56b2966 (Fframe_pixel_height): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 18945
diff changeset
2262 not menu bars on window-system Emacs frames.\n\
3676
5160a6967f80 Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 3658
diff changeset
2263 For a terminal frame, the result really gives the height in characters.\n\
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2264 If FRAME is omitted, the selected frame is used.")
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2265 (frame)
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2266 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2267 {
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2268 struct frame *f;
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2269
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2270 if (NILP (frame))
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
2271 frame = selected_frame;
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
2272 CHECK_FRAME (frame, 0);
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
2273 f = XFRAME (frame);
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2274
13412
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
2275 #ifdef HAVE_WINDOW_SYSTEM
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
2276 if (FRAME_WINDOW_P (f))
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2277 return make_number (x_pixel_height (f));
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2278 else
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2279 #endif
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2280 return make_number (FRAME_HEIGHT (f));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2281 }
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2282
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2283 DEFUN ("frame-pixel-width", Fframe_pixel_width,
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2284 Sframe_pixel_width, 0, 1, 0,
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2285 "Return FRAME's width in pixels.\n\
3676
5160a6967f80 Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 3658
diff changeset
2286 For a terminal frame, the result really gives the width in characters.\n\
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2287 If FRAME is omitted, the selected frame is used.")
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2288 (frame)
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2289 Lisp_Object frame;
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2290 {
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2291 struct frame *f;
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2292
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2293 if (NILP (frame))
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
2294 frame = selected_frame;
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
2295 CHECK_FRAME (frame, 0);
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
2296 f = XFRAME (frame);
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2297
13412
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
2298 #ifdef HAVE_WINDOW_SYSTEM
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
2299 if (FRAME_WINDOW_P (f))
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2300 return make_number (x_pixel_width (f));
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2301 else
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
2302 #endif
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2303 return make_number (FRAME_WIDTH (f));
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2304 }
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2305
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2306 DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2307 "Specify that the frame FRAME has LINES lines.\n\
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2308 Optional third arg non-nil means that redisplay should use LINES lines\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2309 but that the idea of the actual height of the frame should not be changed.")
14077
a6d3ce4a2f8e (Fhandle_switch_frame, Fset_frame_height): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents: 13748
diff changeset
2310 (frame, lines, pretend)
a6d3ce4a2f8e (Fhandle_switch_frame, Fset_frame_height): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents: 13748
diff changeset
2311 Lisp_Object frame, lines, pretend;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2312 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2313 register struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2314
14077
a6d3ce4a2f8e (Fhandle_switch_frame, Fset_frame_height): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents: 13748
diff changeset
2315 CHECK_NUMBER (lines, 0);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2316 if (NILP (frame))
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
2317 frame = selected_frame;
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
2318 CHECK_LIVE_FRAME (frame, 0);
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
2319 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2320
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
2321 /* I think this should be done with a hook. */
13412
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
2322 #ifdef HAVE_WINDOW_SYSTEM
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
2323 if (FRAME_WINDOW_P (f))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2324 {
14077
a6d3ce4a2f8e (Fhandle_switch_frame, Fset_frame_height): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents: 13748
diff changeset
2325 if (XINT (lines) != f->height)
a6d3ce4a2f8e (Fhandle_switch_frame, Fset_frame_height): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents: 13748
diff changeset
2326 x_set_window_size (f, 1, f->width, XINT (lines));
25350
f964a1e5b29c Call change_frame_size and do_pending_window_change with
Gerd Moellmann <gerd@gnu.org>
parents: 25209
diff changeset
2327 do_pending_window_change (0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2328 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2329 else
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
2330 #endif
25350
f964a1e5b29c Call change_frame_size and do_pending_window_change with
Gerd Moellmann <gerd@gnu.org>
parents: 25209
diff changeset
2331 change_frame_size (f, XINT (lines), 0, !NILP (pretend), 0, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2332 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2333 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2334
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2335 DEFUN ("set-frame-width", Fset_frame_width, Sset_frame_width, 2, 3, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2336 "Specify that the frame FRAME has COLS columns.\n\
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2337 Optional third arg non-nil means that redisplay should use COLS columns\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2338 but that the idea of the actual width of the frame should not be changed.")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2339 (frame, cols, pretend)
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
2340 Lisp_Object frame, cols, pretend;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2341 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2342 register struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2343 CHECK_NUMBER (cols, 0);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2344 if (NILP (frame))
25669
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
2345 frame = selected_frame;
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
2346 CHECK_LIVE_FRAME (frame, 0);
97d5951366cd (Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents: 25544
diff changeset
2347 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2348
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
2349 /* I think this should be done with a hook. */
13412
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
2350 #ifdef HAVE_WINDOW_SYSTEM
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
2351 if (FRAME_WINDOW_P (f))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2352 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2353 if (XINT (cols) != f->width)
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
2354 x_set_window_size (f, 1, XINT (cols), f->height);
25350
f964a1e5b29c Call change_frame_size and do_pending_window_change with
Gerd Moellmann <gerd@gnu.org>
parents: 25209
diff changeset
2355 do_pending_window_change (0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2356 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2357 else
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
2358 #endif
25350
f964a1e5b29c Call change_frame_size and do_pending_window_change with
Gerd Moellmann <gerd@gnu.org>
parents: 25209
diff changeset
2359 change_frame_size (f, 0, XINT (cols), !NILP (pretend), 0, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2360 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2361 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2362
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2363 DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 3, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2364 "Sets size of FRAME to COLS by ROWS, measured in characters.")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2365 (frame, cols, rows)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2366 Lisp_Object frame, cols, rows;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2367 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2368 register struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2369
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2370 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2371 CHECK_NUMBER (cols, 2);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2372 CHECK_NUMBER (rows, 1);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2373 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2374
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
2375 /* I think this should be done with a hook. */
13412
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
2376 #ifdef HAVE_WINDOW_SYSTEM
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
2377 if (FRAME_WINDOW_P (f))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2378 {
14966
a8d71d222bb7 (Fset_frame_size): Do call Fset_frame_size
Richard M. Stallman <rms@gnu.org>
parents: 14303
diff changeset
2379 if (XINT (rows) != f->height || XINT (cols) != f->width
a8d71d222bb7 (Fset_frame_size): Do call Fset_frame_size
Richard M. Stallman <rms@gnu.org>
parents: 14303
diff changeset
2380 || FRAME_NEW_HEIGHT (f) || FRAME_NEW_WIDTH (f))
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
2381 x_set_window_size (f, 1, XINT (cols), XINT (rows));
25350
f964a1e5b29c Call change_frame_size and do_pending_window_change with
Gerd Moellmann <gerd@gnu.org>
parents: 25209
diff changeset
2382 do_pending_window_change (0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2383 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2384 else
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
2385 #endif
25350
f964a1e5b29c Call change_frame_size and do_pending_window_change with
Gerd Moellmann <gerd@gnu.org>
parents: 25209
diff changeset
2386 change_frame_size (f, XINT (rows), XINT (cols), 0, 0, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2387
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2388 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2389 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2390
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2391 DEFUN ("set-frame-position", Fset_frame_position,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2392 Sset_frame_position, 3, 3, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2393 "Sets position of FRAME in pixels to XOFFSET by YOFFSET.\n\
4341
d07ef5ea3b58 (Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents: 4227
diff changeset
2394 This is actually the position of the upper left corner of the frame.\n\
d07ef5ea3b58 (Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents: 4227
diff changeset
2395 Negative values for XOFFSET or YOFFSET are interpreted relative to\n\
4412
12c4e5b53463 (Fset_frame_position): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 4341
diff changeset
2396 the rightmost or bottommost possible position (that stays within the screen).")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2397 (frame, xoffset, yoffset)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2398 Lisp_Object frame, xoffset, yoffset;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2399 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2400 register struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2401
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2402 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2403 CHECK_NUMBER (xoffset, 1);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2404 CHECK_NUMBER (yoffset, 2);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2405 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2406
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
2407 /* I think this should be done with a hook. */
13412
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
2408 #ifdef HAVE_WINDOW_SYSTEM
1ed740e9aa64 [HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents: 13396
diff changeset
2409 if (FRAME_WINDOW_P (f))
6921
50060d486c47 (Fset_frame_position): Pass new arg to x_set_offset.
Richard M. Stallman <rms@gnu.org>
parents: 6854
diff changeset
2410 x_set_offset (f, XINT (xoffset), XINT (yoffset), 1);
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
2411 #endif
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2412
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2413 return Qt;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2414 }
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
2415
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2416
21514
fa9ff387d260 Fix -Wimplicit warnings.
Andreas Schwab <schwab@suse.de>
parents: 21359
diff changeset
2417 void
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2418 syms_of_frame ()
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2419 {
33509
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2420 Qframep = intern ("framep");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2421 staticpro (&Qframep);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2422 Qframe_live_p = intern ("frame-live-p");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2423 staticpro (&Qframe_live_p);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2424 Qheight = intern ("height");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2425 staticpro (&Qheight);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2426 Qicon = intern ("icon");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2427 staticpro (&Qicon);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2428 Qminibuffer = intern ("minibuffer");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2429 staticpro (&Qminibuffer);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2430 Qmodeline = intern ("modeline");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2431 staticpro (&Qmodeline);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2432 Qname = intern ("name");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2433 staticpro (&Qname);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2434 Qonly = intern ("only");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2435 staticpro (&Qonly);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2436 Qunsplittable = intern ("unsplittable");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2437 staticpro (&Qunsplittable);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2438 Qmenu_bar_lines = intern ("menu-bar-lines");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2439 staticpro (&Qmenu_bar_lines);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2440 Qtool_bar_lines = intern ("tool-bar-lines");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2441 staticpro (&Qtool_bar_lines);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2442 Qwidth = intern ("width");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2443 staticpro (&Qwidth);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2444 Qx = intern ("x");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2445 staticpro (&Qx);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2446 Qw32 = intern ("w32");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2447 staticpro (&Qw32);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2448 Qpc = intern ("pc");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2449 staticpro (&Qpc);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2450 Qmac = intern ("mac");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2451 staticpro (&Qmac);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2452 Qvisible = intern ("visible");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2453 staticpro (&Qvisible);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2454 Qbuffer_predicate = intern ("buffer-predicate");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2455 staticpro (&Qbuffer_predicate);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2456 Qbuffer_list = intern ("buffer-list");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2457 staticpro (&Qbuffer_list);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2458 Qtitle = intern ("title");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2459 staticpro (&Qtitle);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2460 Qdisplay_type = intern ("display-type");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2461 staticpro (&Qdisplay_type);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2462 Qbackground_mode = intern ("background-mode");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2463 staticpro (&Qbackground_mode);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2464
33509
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2465 DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist,
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2466 "Alist of default values for frame creation.\n\
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2467 These may be set in your init file, like this:\n\
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2468 (setq default-frame-alist '((width . 80) (height . 55) (menu-bar-lines . 1))\n\
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2469 These override values given in window system configuration data,\n\
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2470 including X Windows' defaults database.\n\
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2471 For values specific to the first Emacs frame, see `initial-frame-alist'.\n\
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2472 For values specific to the separate minibuffer frame, see\n\
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2473 `minibuffer-frame-alist'.\n\
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2474 The `menu-bar-lines' element of the list controls whether new frames\n\
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2475 have menu bars; `menu-bar-mode' works by altering this element.");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2476 Vdefault_frame_alist = Qnil;
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2477
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2478 Qinhibit_default_face_x_resources
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2479 = intern ("inhibit-default-face-x-resources");
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2480 staticpro (&Qinhibit_default_face_x_resources);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2481
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2482 DEFVAR_LISP ("terminal-frame", &Vterminal_frame,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2483 "The initial frame-object, which represents Emacs's stdout.");
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2484
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2485 DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2486 "Non-nil if all of emacs is iconified and frame updates are not needed.");
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2487 Vemacs_iconified = Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2488
27795
83292274bbd4 (Vmouse_position_function): New variable.
Dave Love <fx@gnu.org>
parents: 27725
diff changeset
2489 DEFVAR_LISP ("mouse-position-function", &Vmouse_position_function,
83292274bbd4 (Vmouse_position_function): New variable.
Dave Love <fx@gnu.org>
parents: 27725
diff changeset
2490 "If non-nil, function applied to the normal result of `mouse-position'.\n\
83292274bbd4 (Vmouse_position_function): New variable.
Dave Love <fx@gnu.org>
parents: 27725
diff changeset
2491 This abnormal hook exists for the benefit of packages like XTerm-mouse\n\
83292274bbd4 (Vmouse_position_function): New variable.
Dave Love <fx@gnu.org>
parents: 27725
diff changeset
2492 which need to do mouse handling at the Lisp level.");
83292274bbd4 (Vmouse_position_function): New variable.
Dave Love <fx@gnu.org>
parents: 27725
diff changeset
2493 Vmouse_position_function = Qnil;
83292274bbd4 (Vmouse_position_function): New variable.
Dave Love <fx@gnu.org>
parents: 27725
diff changeset
2494
11779
6234b3610a6f Vdefault_minibuffer_frame is now part of KBOARD instead
Karl Heuer <kwzh@gnu.org>
parents: 11775
diff changeset
2495 DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2496 "Minibufferless frames use this frame's minibuffer.\n\
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
2497 \n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2498 Emacs cannot create minibufferless frames unless this is set to an\n\
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
2499 appropriate surrogate.\n\
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
2500 \n\
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
2501 Emacs consults this variable only when creating minibufferless\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2502 frames; once the frame is created, it sticks with its assigned\n\
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
2503 minibuffer, no matter what this variable is set to. This means that\n\
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
2504 this variable doesn't necessarily say anything meaningful about the\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2505 current set of frames, or where the minibuffer is currently being\n\
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
2506 displayed.");
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2507
33509
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2508 staticpro (&Vframe_list);
a7d245e080d1 (syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents: 33005
diff changeset
2509
11169
d0550c056e5b [MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 11126
diff changeset
2510 defsubr (&Sactive_minibuffer_window);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2511 defsubr (&Sframep);
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
2512 defsubr (&Sframe_live_p);
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
2513 defsubr (&Smake_terminal_frame);
2298
872a3a2c3fed * frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents: 2282
diff changeset
2514 defsubr (&Shandle_switch_frame);
12283
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
2515 defsubr (&Signore_event);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2516 defsubr (&Sselect_frame);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2517 defsubr (&Sselected_frame);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2518 defsubr (&Swindow_frame);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2519 defsubr (&Sframe_root_window);
7570
20cbb114367b (syms_of_frame): Set up frame-first-window as Lisp fn.
Richard M. Stallman <rms@gnu.org>
parents: 7307
diff changeset
2520 defsubr (&Sframe_first_window);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2521 defsubr (&Sframe_selected_window);
7055
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
2522 defsubr (&Sset_frame_selected_window);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2523 defsubr (&Sframe_list);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2524 defsubr (&Snext_frame);
4424
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
2525 defsubr (&Sprevious_frame);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2526 defsubr (&Sdelete_frame);
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
2527 defsubr (&Smouse_position);
7025
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
2528 defsubr (&Smouse_pixel_position);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2529 defsubr (&Sset_mouse_position);
7025
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
2530 defsubr (&Sset_mouse_pixel_position);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2531 #if 0
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2532 defsubr (&Sframe_configuration);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2533 defsubr (&Srestore_frame_configuration);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2534 #endif
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2535 defsubr (&Smake_frame_visible);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2536 defsubr (&Smake_frame_invisible);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2537 defsubr (&Siconify_frame);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2538 defsubr (&Sframe_visible_p);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2539 defsubr (&Svisible_frame_list);
2282
f727944c11aa * frame.c (Fraise_frame, Flower_frame): Renamed from
Jim Blandy <jimb@redhat.com>
parents: 2207
diff changeset
2540 defsubr (&Sraise_frame);
f727944c11aa * frame.c (Fraise_frame, Flower_frame): Renamed from
Jim Blandy <jimb@redhat.com>
parents: 2207
diff changeset
2541 defsubr (&Slower_frame);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2542 defsubr (&Sredirect_frame_focus);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2543 defsubr (&Sframe_focus);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2544 defsubr (&Sframe_parameters);
31399
db831ffcd565 (Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31102
diff changeset
2545 defsubr (&Sframe_parameter);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2546 defsubr (&Smodify_frame_parameters);
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2547 defsubr (&Sframe_char_height);
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2548 defsubr (&Sframe_char_width);
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2549 defsubr (&Sframe_pixel_height);
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2550 defsubr (&Sframe_pixel_width);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2551 defsubr (&Sset_frame_height);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2552 defsubr (&Sset_frame_width);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2553 defsubr (&Sset_frame_size);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2554 defsubr (&Sset_frame_position);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2555 }
732
a8d94735277e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 714
diff changeset
2556
21514
fa9ff387d260 Fix -Wimplicit warnings.
Andreas Schwab <schwab@suse.de>
parents: 21359
diff changeset
2557 void
1385
a4a205bdd2c1 * frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents: 1346
diff changeset
2558 keys_of_frame ()
a4a205bdd2c1 * frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents: 1346
diff changeset
2559 {
2298
872a3a2c3fed * frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents: 2282
diff changeset
2560 initial_define_lispy_key (global_map, "switch-frame", "handle-switch-frame");
9214
a31be7afcc83 (keys_of_frame): Make binding for delete-frame.
Richard M. Stallman <rms@gnu.org>
parents: 9127
diff changeset
2561 initial_define_lispy_key (global_map, "delete-frame", "handle-delete-frame");
12283
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
2562 initial_define_lispy_key (global_map, "iconify-frame", "ignore-event");
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
2563 initial_define_lispy_key (global_map, "make-frame-visible", "ignore-event");
1385
a4a205bdd2c1 * frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents: 1346
diff changeset
2564 }