annotate src/frame.c @ 830:d7f1e2db9faf

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Tue, 21 Jul 1992 19:48:07 +0000
parents 17ccc9d015f5
children 336ffe2bd537
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
1
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2 /* Generic frame functions.
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
3 Copyright (C) 1989, 1992 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
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
19 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
21 #include <stdio.h>
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
22
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23 #include "config.h"
732
a8d94735277e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 714
diff changeset
24
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
25 #ifdef MULTI_FRAME
732
a8d94735277e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 714
diff changeset
26
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
27 #include "lisp.h"
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
28 #include "frame.h"
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
29 #include "window.h"
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
30 #include "termhooks.h"
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
31
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
32 Lisp_Object Vemacs_iconified;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
33 Lisp_Object Qframep;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
34 Lisp_Object Qlive_frame_p;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
35 Lisp_Object Vframe_list;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
36 Lisp_Object Vterminal_frame;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
37 Lisp_Object Vdefault_minibuffer_frame;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
38 Lisp_Object Vdefault_frame_alist;
539
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
39 Lisp_Object Qminibuffer;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41 extern Lisp_Object Vminibuffer_list;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42 extern Lisp_Object get_minibuffer ();
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
44 DEFUN ("framep", Fframep, Sframep, 1, 1, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
45 "Return non-nil if OBJECT is a frame.\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
46 Value is t for a termcap frame (a character-only terminal),\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
47 `x' for an Emacs frame that is really an X window.\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
48 Also see `live-frame-p'.")
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
49 (object)
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
50 Lisp_Object object;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
51 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
52 if (XTYPE (object) != Lisp_Frame)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
53 return Qnil;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
54 switch (XFRAME (object)->output_method)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
55 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
56 case output_termcap:
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
57 return Qt;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
58 case output_x_window:
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
59 return intern ("x");
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
60 default:
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
61 abort ();
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
62 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
63 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
64
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
65 DEFUN ("live-frame-p", Flive_frame_p, Slive_frame_p, 1, 1, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
66 "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
67 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
68 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
69 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
70 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
71 (object)
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
72 Lisp_Object object;
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
73 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
74 return ((FRAMEP (object)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
75 && FRAME_LIVE_P (XFRAME (object)))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
76 ? Fframep (object)
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
77 : Qnil);
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
78 }
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
79
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
80 struct frame *
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
81 make_frame (mini_p)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
82 int mini_p;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
83 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
84 Lisp_Object frame;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
85 register struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
86 register Lisp_Object root_window;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
87 register Lisp_Object mini_window;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
88
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
89 frame = Fmake_vector (((sizeof (struct frame) - (sizeof (Lisp_Vector)
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
90 - sizeof (Lisp_Object)))
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
91 / sizeof (Lisp_Object)),
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
92 make_number (0));
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
93 XSETTYPE (frame, Lisp_Frame);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
94 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
95
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
96 f->cursor_x = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
97 f->cursor_y = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
98 f->current_glyphs = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
99 f->desired_glyphs = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
100 f->visible = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
101 f->display.nothing = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
102 f->iconified = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
103 f->wants_modeline = 1;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
104 f->auto_raise = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
105 f->auto_lower = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
106 f->no_split = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
107 f->garbaged = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
108 f->has_minibuffer = mini_p;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
109 f->focus_frame = frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
110
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
111 f->param_alist = Qnil;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
112
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
113 root_window = make_window (0);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
114 if (mini_p)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
115 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
116 mini_window = make_window (0);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
117 XWINDOW (root_window)->next = mini_window;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
118 XWINDOW (mini_window)->prev = root_window;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
119 XWINDOW (mini_window)->mini_p = Qt;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
120 XWINDOW (mini_window)->frame = frame;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
121 f->minibuffer_window = mini_window;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
122 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
123 else
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
124 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
125 mini_window = Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
126 XWINDOW (root_window)->next = Qnil;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
127 f->minibuffer_window = Qnil;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
128 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
129
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
130 XWINDOW (root_window)->frame = frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
131
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
132 /* 10 is arbitrary,
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
133 just so that there is "something there."
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
134 Correct size will be set up later with change_frame_size. */
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
135
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
136 f->width = 10;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
137 f->height = 10;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
138
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
139 XFASTINT (XWINDOW (root_window)->width) = 10;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
140 XFASTINT (XWINDOW (root_window)->height) = (mini_p ? 9 : 10);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
141
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
142 if (mini_p)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
143 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
144 XFASTINT (XWINDOW (mini_window)->width) = 10;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
145 XFASTINT (XWINDOW (mini_window)->top) = 9;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
146 XFASTINT (XWINDOW (mini_window)->height) = 1;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
147 }
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 /* Choose a buffer for the frame's root window. */
386
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
150 {
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
151 Lisp_Object buf;
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
152
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
153 XWINDOW (root_window)->buffer = Qt;
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
154 buf = Fcurrent_buffer ();
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
155 /* 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
156 a space), try to find another one. */
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
157 if (XSTRING (Fbuffer_name (buf))->data[0] == ' ')
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
158 buf = Fother_buffer (buf);
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
159 Fset_window_buffer (root_window, buf);
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
160 }
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
161
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
162 if (mini_p)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
163 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
164 XWINDOW (mini_window)->buffer = Qt;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
165 Fset_window_buffer (mini_window,
485
8c615e453683 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 454
diff changeset
166 (NILP (Vminibuffer_list)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
167 ? get_minibuffer (0)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
168 : Fcar (Vminibuffer_list)));
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
169 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
170
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
171 f->root_window = root_window;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
172 f->selected_window = root_window;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
173 /* Make sure this window seems more recently used than
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
174 a newly-created, never-selected window. */
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
175 XFASTINT (XWINDOW (f->selected_window)->use_time) = ++window_select_count;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
176
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
177 Vframe_list = Fcons (frame, Vframe_list);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
178
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
179 return f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
180 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
181
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
182 /* Make a frame using a separate minibuffer window on another frame.
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
183 MINI_WINDOW is the minibuffer window to use. nil means use the
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
184 default (the global minibuffer). */
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
185
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
186 struct frame *
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
187 make_frame_without_minibuffer (mini_window)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
188 register Lisp_Object mini_window;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
189 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
190 register struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
191
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
192 /* Choose the minibuffer window to use. */
485
8c615e453683 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 454
diff changeset
193 if (NILP (mini_window))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
194 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
195 if (XTYPE (Vdefault_minibuffer_frame) != Lisp_Frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
196 error ("default-minibuffer-frame must be set when creating minibufferless frames");
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
197 if (! FRAME_LIVE_P (XFRAME (Vdefault_minibuffer_frame)))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
198 error ("default-minibuffer-frame must be a live frame");
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
199 mini_window = XFRAME (Vdefault_minibuffer_frame)->minibuffer_window;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
200 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
201 else
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
202 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
203 CHECK_WINDOW (mini_window, 0);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
204 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
205
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
206 /* Make a frame containing just a root window. */
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
207 f = make_frame (0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
208
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
209 /* Install the chosen minibuffer window, with proper buffer. */
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
210 f->minibuffer_window = mini_window;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
211 Fset_window_buffer (mini_window,
485
8c615e453683 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 454
diff changeset
212 (NILP (Vminibuffer_list)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
213 ? get_minibuffer (0)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
214 : Fcar (Vminibuffer_list)));
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
215 return f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
216 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
217
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
218 /* Make a frame containing only a minibuffer window. */
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
219
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
220 struct frame *
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
221 make_minibuffer_frame ()
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
222 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
223 /* First make a frame containing just a root window, no minibuffer. */
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
224
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
225 register struct frame *f = make_frame (0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
226 register Lisp_Object mini_window;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
227 register Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
228
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
229 XSET (frame, Lisp_Frame, f);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
230
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
231 /* ??? Perhaps leave it to the user program to set auto_raise. */
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
232 f->auto_raise = 1;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
233 f->auto_lower = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
234 f->no_split = 1;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
235 f->wants_modeline = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
236 f->has_minibuffer = 1;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
237
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
238 /* Now label the root window as also being the minibuffer.
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
239 Avoid infinite looping on the window chain by marking next pointer
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
240 as nil. */
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
241
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
242 mini_window = f->minibuffer_window = f->root_window;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
243 XWINDOW (mini_window)->mini_p = Qt;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
244 XWINDOW (mini_window)->next = Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
245 XWINDOW (mini_window)->prev = mini_window;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
246 XWINDOW (mini_window)->frame = frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
247
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
248 /* Put the proper buffer in that window. */
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
249
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
250 Fset_window_buffer (mini_window,
485
8c615e453683 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 454
diff changeset
251 (NILP (Vminibuffer_list)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
252 ? get_minibuffer (0)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
253 : Fcar (Vminibuffer_list)));
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
254 return f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
255 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
256
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
257 /* Construct a frame that refers to the terminal (stdin and stdout). */
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
258
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
259 struct frame *
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
260 make_terminal_frame ()
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
261 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
262 register struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
263
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
264 Vframe_list = Qnil;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
265 f = make_frame (1);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
266 f->name = build_string ("terminal");
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
267 f->visible = 1;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
268 f->display.nothing = 1; /* Nonzero means frame isn't deleted. */
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
269 XSET (Vterminal_frame, Lisp_Frame, f);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
270 return f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
271 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
272
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
273 DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 2, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
274 "Select the frame FRAME. FRAMES's selected window becomes \"the\"\n\
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
275 selected window. If the optional parameter NO-ENTER is non-nil, don't\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
276 focus on that frame.")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
277 (frame, no_enter)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
278 Lisp_Object frame, no_enter;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
279 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
280 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
281
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
282 if (selected_frame == XFRAME (frame))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
283 return frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
284
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
285 selected_frame = XFRAME (frame);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
286 if (! FRAME_MINIBUF_ONLY_P (selected_frame))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
287 last_nonminibuf_frame = selected_frame;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
288
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
289 Fselect_window (XFRAME (frame)->selected_window);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
290
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
291 #ifdef HAVE_X_WINDOWS
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
292 #ifdef MULTI_FRAME
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
293 if (FRAME_IS_X (XFRAME (frame))
485
8c615e453683 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 454
diff changeset
294 && NILP (no_enter))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
295 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
296 Ffocus_frame (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
297 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
298 #endif
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
299 #endif
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
300 choose_minibuf_frame ();
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
301
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
302 return frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
303 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
304
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
305 DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
306 "Return the frame that is now selected.")
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
307 ()
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
308 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
309 Lisp_Object tem;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
310 XSET (tem, Lisp_Frame, selected_frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
311 return tem;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
312 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
313
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
314 DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
315 "Return the frame object that window WINDOW is on.")
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
316 (window)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
317 Lisp_Object window;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
318 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
319 CHECK_WINDOW (window, 0);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
320 return XWINDOW (window)->frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
321 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
322
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
323 DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
324 "Returns the root-window of FRAME.")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
325 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
326 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
327 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
328 if (NILP (frame))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
329 XSET (frame, Lisp_Frame, selected_frame);
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
330 else
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
331 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
332
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
333 return XFRAME (frame)->root_window;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
334 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
335
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
336 DEFUN ("frame-selected-window", Fframe_selected_window,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
337 Sframe_selected_window, 0, 1, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
338 "Return the selected window of frame object FRAME.")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
339 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
340 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
341 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
342 if (NILP (frame))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
343 XSET (frame, Lisp_Frame, selected_frame);
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
344 else
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
345 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
346
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
347 return XFRAME (frame)->selected_window;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
348 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
349
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
350 DEFUN ("frame-list", Fframe_list, Sframe_list,
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
351 0, 0, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
352 "Return a list of all frames.")
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
353 ()
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
354 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
355 return Fcopy_sequence (Vframe_list);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
356 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
357
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
358 #ifdef MULTI_FRAME
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
359
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
360 /* Return the next frame in the frame list after FRAME.
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
361 If MINIBUF is non-nil, include all frames.
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
362 If MINIBUF is nil, exclude minibuffer-only frames.
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
363 If MINIBUF is a window, include only frames using that window for
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
364 their minibuffer. */
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
365 Lisp_Object
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
366 next_frame (frame, minibuf)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
367 Lisp_Object frame;
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
368 Lisp_Object minibuf;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
369 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
370 Lisp_Object tail;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
371 int passed = 0;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
372
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
373 /* There must always be at least one frame in Vframe_list. */
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
374 if (! CONSP (Vframe_list))
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
375 abort ();
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
376
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
377 while (1)
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
378 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
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 if (passed)
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
381 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
382 Lisp_Object f = XCONS (tail)->car;
335
33aa13a3f279 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 286
diff changeset
383
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
384 /* Decide whether this frame is eligible to be returned,
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
385 according to minibuf. */
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
386 if ((NILP (minibuf) && ! FRAME_MINIBUF_ONLY_P (XFRAME (f)))
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
387 || XTYPE (minibuf) != Lisp_Window
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
388 || EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
389 || EQ (f, frame))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
390 return f;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
391 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
392
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
393 if (EQ (frame, XCONS (tail)->car))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
394 passed++;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
395 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
396 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
397
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
398 /* Return the previous frame in the frame list before FRAME.
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
399 If MINIBUF is non-nil, include all frames.
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
400 If MINIBUF is nil, exclude minibuffer-only frames.
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
401 If MINIBUF is a window, include only frames using that window for
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
402 their minibuffer. */
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
403 Lisp_Object
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
404 prev_frame (frame, minibuf)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
405 Lisp_Object frame;
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
406 Lisp_Object minibuf;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
407 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
408 Lisp_Object tail;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
409 Lisp_Object prev;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
410
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
411 /* There must always be at least one frame in Vframe_list. */
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
412 if (! CONSP (Vframe_list))
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
413 abort ();
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
414
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
415 prev = Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
416 while (1)
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
417 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
418 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
419 {
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
420 Lisp_Object scr = XCONS (tail)->car;
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
421
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
422 if (XTYPE (scr) != Lisp_Frame)
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
423 abort ();
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
424
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
425 if (EQ (frame, scr) && !NILP (prev))
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
426 return prev;
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
427
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
428 /* Decide whether this frame is eligible to be returned,
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
429 according to minibuf. */
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
430 if ((NILP (minibuf) && ! FRAME_MINIBUF_ONLY_P (XFRAME (scr)))
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
431 || XTYPE (minibuf) != Lisp_Window
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
432 || EQ (FRAME_MINIBUF_WINDOW (XFRAME (scr)), minibuf))
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
433 prev = scr;
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
434 }
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
435
485
8c615e453683 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 454
diff changeset
436 if (NILP (prev))
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
437 /* We went through the whole frame list without finding a single
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
438 acceptable frame. Return the original frame. */
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
439 prev = frame;
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
440 }
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
441
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
442 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
443
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
444 DEFUN ("next-frame", Fnext_frame, Snext_frame, 0, 2, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
445 "Return the next frame in the frame list after FRAME.\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
446 If optional argument MINIBUF is non-nil, include all frames. If\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
447 MINIBUF is nil or omitted, exclude minibuffer-only frames. If\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
448 MINIBUF is a window, include only frames using that window for their\n\
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
449 minibuffer.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
450 (frame, miniframe)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
451 Lisp_Object frame, miniframe;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
452 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
453 Lisp_Object tail;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
454
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
455 if (NILP (frame))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
456 XSET (frame, Lisp_Frame, selected_frame);
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
457 else
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
458 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
459
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
460 return next_frame (frame, miniframe);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
461 }
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
462 #endif /* MULTI_FRAME */
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
463
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
464 DEFUN ("delete-frame", Fdelete_frame, Sdelete_frame, 0, 1, "",
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
465 "Delete FRAME, permanently eliminating it from use.\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
466 If omitted, FRAME defaults to the selected frame.\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
467 A frame may not be deleted if its minibuffer is used by other frames.")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
468 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
469 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
470 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
471 struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
472 union display displ;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
473
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
474 if (EQ (frame, Qnil))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
475 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
476 f = selected_frame;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
477 XSET (frame, Lisp_Frame, f);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
478 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
479 else
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
480 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
481 CHECK_FRAME (frame, 0);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
482 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
483 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
484
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
485 if (! FRAME_LIVE_P (f))
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
486 return;
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
487
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
488 /* Are there any other frames besides this one? */
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
489 if (f == selected_frame && EQ (next_frame (frame, Qt), frame))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
490 error ("Attempt to delete the only frame");
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
491
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
492 /* Does this frame have a minibuffer, and is it the surrogate
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
493 minibuffer for any other frame? */
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
494 if (FRAME_HAS_MINIBUF (XFRAME (frame)))
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
495 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
496 Lisp_Object frames;
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
497
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
498 for (frames = Vframe_list;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
499 CONSP (frames);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
500 frames = XCONS (frames)->cdr)
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
501 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
502 Lisp_Object this = XCONS (frames)->car;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
503
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
504 if (! EQ (this, frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
505 && EQ (frame,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
506 (WINDOW_FRAME
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
507 (XWINDOW
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
508 (FRAME_MINIBUF_WINDOW
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
509 (XFRAME (this)))))))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
510 error ("Attempt to delete a surrogate minibuffer frame");
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
511 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
512 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
513
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
514 /* Don't let the frame remain selected. */
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
515 if (f == selected_frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
516 Fselect_frame (next_frame (frame, Qt));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
517
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
518 /* Don't allow minibuf_window to remain on a deleted frame. */
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
519 if (EQ (f->minibuffer_window, minibuf_window))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
520 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
521 Fset_window_buffer (selected_frame->minibuffer_window,
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
522 XWINDOW (minibuf_window)->buffer);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
523 minibuf_window = selected_frame->minibuffer_window;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
524 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
525
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
526 Vframe_list = Fdelq (frame, Vframe_list);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
527 f->visible = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
528 displ = f->display;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
529 f->display.nothing = 0;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
530
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
531 #ifdef HAVE_X_WINDOWS
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
532 if (FRAME_IS_X (f))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
533 x_destroy_window (f, displ);
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
534 #endif
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
535
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
536 /* 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
537 another one. */
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
538 if (f == last_nonminibuf_frame)
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
539 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
540 Lisp_Object frames;
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
541
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
542 last_nonminibuf_frame = 0;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
543
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
544 for (frames = Vframe_list;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
545 CONSP (frames);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
546 frames = XCONS (frames)->cdr)
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
547 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
548 f = XFRAME (XCONS (frames)->car);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
549 if (!FRAME_MINIBUF_ONLY_P (f))
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
550 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
551 last_nonminibuf_frame = f;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
552 break;
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
553 }
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
554 }
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
555 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
556
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
557 /* If we've deleted Vdefault_minibuffer_frame, try to find another
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
558 one. Prefer minibuffer-only frames, but also notice frames
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
559 with other windows. */
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
560 if (EQ (frame, Vdefault_minibuffer_frame))
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
561 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
562 Lisp_Object frames;
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
563
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
564 /* The last frame we saw with a minibuffer, minibuffer-only or not. */
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
565 Lisp_Object frame_with_minibuf = Qnil;
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
566
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
567 for (frames = Vframe_list;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
568 CONSP (frames);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
569 frames = XCONS (frames)->cdr)
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
570 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
571 Lisp_Object this = XCONS (frames)->car;
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
572
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
573 if (XTYPE (this) != Lisp_Frame)
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
574 abort ();
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
575 f = XFRAME (this);
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
576
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
577 if (FRAME_HAS_MINIBUF (f))
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
578 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
579 frame_with_minibuf = this;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
580 if (FRAME_MINIBUF_ONLY_P (f))
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
581 break;
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
582 }
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
583 }
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
584
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
585 /* We know that there must be some frame with a minibuffer out
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
586 there. If this were not true, all of the frames present
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
587 would have to be minibufferless, which implies that at some
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
588 point their minibuffer frames must have been deleted, but
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
589 that is prohibited at the top; you can't delete surrogate
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
590 minibuffer frames. */
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
591 if (NILP (frame_with_minibuf))
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
592 abort ();
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
593
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
594 Vdefault_minibuffer_frame = frame_with_minibuf;
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
595 }
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
596
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
597 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
598 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
599
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
600 /* Return mouse position in character cell units. */
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
601
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
602 DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
603 "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
604 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
605 to read the mouse position, it returns the selected frame for FRAME\n\
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
606 and nil for X and Y.")
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
607 ()
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
608 {
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
609 Lisp_Object x, y, dummy;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
610 FRAME_PTR f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
611
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
612 if (mouse_position_hook)
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
613 (*mouse_position_hook) (&f, &x, &y, &dummy);
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
614 else
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
615 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
616 f = selected_frame;
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
617 x = y = Qnil;
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
618 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
619
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
620 XSET (dummy, Lisp_Frame, f);
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
621 return Fcons (dummy, Fcons (make_number (x), make_number (y)));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
622 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
623
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
624 DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
625 "Move the mouse pointer to the center of cell (X,Y) in FRAME.\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
626 WARNING: If you use this under X, you should do `unfocus-frame' afterwards.")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
627 (frame, x, y)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
628 Lisp_Object frame, x, y;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
629 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
630 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
631 CHECK_NUMBER (x, 2);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
632 CHECK_NUMBER (y, 1);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
633
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
634 #ifdef HAVE_X_WINDOWS
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
635 if (FRAME_IS_X (XFRAME (frame)))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
636 /* Warping the mouse will cause enternotify and focus events. */
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
637 x_set_mouse_position (XFRAME (frame), x, y);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
638 #endif
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
639
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
640 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
641 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
642
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
643 #if 0
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
644 /* ??? Can this be replaced with a Lisp function?
756
0276f8eb306f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 732
diff changeset
645 It is used in minibuf.c. Can we get rid of that?
0276f8eb306f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 732
diff changeset
646 Yes. All uses in minibuf.c are gone, and parallels to these
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
647 functions have been defined in frame.el. */
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
648
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
649 DEFUN ("frame-configuration", Fframe_configuration, Sframe_configuration,
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
650 0, 0, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
651 "Return object describing current frame configuration.\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
652 The frame configuration is the current mouse position and selected frame.\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
653 This object can be given to `restore-frame-configuration'\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
654 to restore this frame configuration.")
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
655 ()
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
656 {
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
657 Lisp_Object c, time;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
658
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
659 c = Fmake_vector (make_number(4), Qnil);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
660 XVECTOR (c)->contents[0] = Fselected_frame();
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
661 if (mouse_position_hook)
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
662 (*mouse_position_hook) (&XVECTOR (c)->contents[1]
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
663 &XVECTOR (c)->contents[2],
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
664 &XVECTOR (c)->contents[3],
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
665 &time);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
666 return c;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
667 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
668
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
669 DEFUN ("restore-frame-configuration", Frestore_frame_configuration,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
670 Srestore_frame_configuration,
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
671 1, 1, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
672 "Restores frame configuration CONFIGURATION.")
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
673 (config)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
674 Lisp_Object config;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
675 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
676 Lisp_Object x_pos, y_pos, frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
677
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
678 CHECK_VECTOR (config, 0);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
679 if (XVECTOR (config)->size != 3)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
680 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
681 error ("Wrong size vector passed to restore-frame-configuration");
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
682 }
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
683 frame = XVECTOR (config)->contents[0];
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
684 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
685
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
686 Fselect_frame (frame, Qnil);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
687
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
688 #if 0
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
689 /* This seems to interfere with the frame selection mechanism. jla */
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
690 x_pos = XVECTOR (config)->contents[2];
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
691 y_pos = XVECTOR (config)->contents[3];
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
692 set_mouse_position (frame, XINT (x_pos), XINT (y_pos));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
693 #endif
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
694
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
695 return frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
696 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
697 #endif
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
698
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
699 DEFUN ("make-frame-visible", Fmake_frame_visible, Smake_frame_visible,
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
700 1, 1, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
701 "Make the frame FRAME visible (assuming it is an X-window).\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
702 Also raises the frame so that nothing obscures it.")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
703 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
704 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
705 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
706 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
707
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
708 if (FRAME_IS_X (XFRAME (frame)))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
709 x_make_frame_visible (XFRAME (frame));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
710
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
711 return frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
712 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
713
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
714 DEFUN ("make-frame-invisible", Fmake_frame_invisible, Smake_frame_invisible,
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
715 1, 1, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
716 "Make the frame FRAME invisible (assuming it is an X-window).")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
717 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
718 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
719 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
720 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
721
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
722 if (FRAME_IS_X (XFRAME (frame)))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
723 x_make_frame_invisible (XFRAME (frame));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
724
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
725 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
726 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
727
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
728 DEFUN ("iconify-frame", Ficonify_frame, Siconify_frame,
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
729 1, 1, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
730 "Make the frame FRAME into an icon.")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
731 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
732 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
733 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
734 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
735
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
736 if (FRAME_IS_X (XFRAME (frame)))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
737 x_iconify_frame (XFRAME (frame));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
738
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
739 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
740 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
741
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
742 DEFUN ("frame-visible-p", Fframe_visible_p, Sframe_visible_p,
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
743 1, 1, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
744 "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
745 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
746 a window system, it may not show at all.\n\
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
747 Return the symbol `icon' if window is visible only as an icon.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
748 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
749 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
750 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
751 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
752
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
753 if (XFRAME (frame)->visible)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
754 return Qt;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
755 if (XFRAME (frame)->iconified)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
756 return intern ("icon");
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
757 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
758 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
759
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
760 DEFUN ("visible-frame-list", Fvisible_frame_list, Svisible_frame_list,
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
761 0, 0, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
762 "Return a list of all frames now \"visible\" (being updated).")
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
763 ()
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
764 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
765 Lisp_Object tail, frame;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
766 struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
767 Lisp_Object value;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
768
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
769 value = Qnil;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
770 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
771 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
772 frame = XCONS (tail)->car;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
773 if (XTYPE (frame) != Lisp_Frame)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
774 continue;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
775 f = XFRAME (frame);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
776 if (f->visible)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
777 value = Fcons (frame, value);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
778 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
779 return value;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
780 }
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
781
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
782
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
783
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
784 DEFUN ("redirect-frame-focus", Fredirect_frame_focus, Sredirect_frame_focus,
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
785 1, 2, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
786 "Arrange for keystrokes typed at FRAME to be sent to FOCUS-FRAME.\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
787 This means that, after reading a keystroke typed at FRAME,\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
788 `last-event-frame' will be FOCUS-FRAME.\n\
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
789 \n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
790 If FOCUS-FRAME is omitted or eq to FRAME, any existing redirection is\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
791 cancelled, and the frame again receives its own keystrokes.\n\
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
792 \n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
793 The redirection lasts until the next call to `redirect-frame-focus'\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
794 or `select-frame'.\n\
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
795 \n\
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
796 This is useful for temporarily redirecting keystrokes to the minibuffer\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
797 window when a frame doesn't have its own minibuffer.")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
798 (frame, focus_frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
799 Lisp_Object frame, focus_frame;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
800 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
801 CHECK_LIVE_FRAME (frame, 0);
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
802
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
803 if (NILP (focus_frame))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
804 focus_frame = frame;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
805 else
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
806 CHECK_LIVE_FRAME (focus_frame, 1);
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
807
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
808 XFRAME (frame)->focus_frame = focus_frame;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
809
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
810 if (frame_rehighlight_hook)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
811 (*frame_rehighlight_hook) ();
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
812
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
813 return Qnil;
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
814 }
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
815
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
816
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
817 DEFUN ("frame-focus", Fframe_focus, Sframe_focus, 1, 1, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
818 "Return the frame to which FRAME's keystrokes are currently being sent.\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
819 See `redirect-frame-focus'.")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
820 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
821 Lisp_Object frame;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
822 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
823 CHECK_LIVE_FRAME (frame, 0);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
824 return FRAME_FOCUS_FRAME (XFRAME (frame));
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
825 }
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
826
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
827
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
828
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
829 Lisp_Object
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
830 get_frame_param (frame, prop)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
831 register struct frame *frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
832 Lisp_Object prop;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
833 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
834 register Lisp_Object tem;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
835
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
836 tem = Fassq (prop, frame->param_alist);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
837 if (EQ (tem, Qnil))
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
838 return tem;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
839 return Fcdr (tem);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
840 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
841
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
842 void
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
843 store_in_alist (alistptr, propname, val)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
844 Lisp_Object *alistptr, val;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
845 char *propname;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
846 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
847 register Lisp_Object tem;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
848 register Lisp_Object prop;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
849
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
850 prop = intern (propname);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
851 tem = Fassq (prop, *alistptr);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
852 if (EQ (tem, Qnil))
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
853 *alistptr = Fcons (Fcons (prop, val), *alistptr);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
854 else
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
855 Fsetcdr (tem, val);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
856 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
857
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
858 void
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
859 store_frame_param (f, prop, val)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
860 struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
861 Lisp_Object prop, val;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
862 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
863 register Lisp_Object tem;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
864
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
865 tem = Fassq (prop, f->param_alist);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
866 if (EQ (tem, Qnil))
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
867 f->param_alist = Fcons (Fcons (prop, val), f->param_alist);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
868 else
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
869 Fsetcdr (tem, val);
539
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
870
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
871 if (EQ (prop, Qminibuffer)
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
872 && XTYPE (val) == Lisp_Window)
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
873 {
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
874 if (! MINI_WINDOW_P (XWINDOW (val)))
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
875 error ("Surrogate minibuffer windows must be minibuffer windows.");
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
876
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
877 if (FRAME_HAS_MINIBUF (f) || FRAME_MINIBUF_ONLY_P (f))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
878 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
879
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
880 /* Install the chosen minibuffer window, with proper buffer. */
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
881 f->minibuffer_window = val;
539
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
882 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
883 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
884
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
885 DEFUN ("frame-parameters", Fframe_parameters, Sframe_parameters, 0, 1, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
886 "Return the parameters-alist of frame FRAME.\n\
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
887 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
888 The meaningful PARMs depend on the kind of frame.\n\
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
889 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
890 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
891 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
892 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
893 Lisp_Object alist;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
894 struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
895
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
896 if (EQ (frame, Qnil))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
897 f = selected_frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
898 else
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
899 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
900 CHECK_FRAME (frame, 0);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
901 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
902 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
903
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
904 if (f->display.nothing == 0)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
905 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
906
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
907 alist = Fcopy_alist (f->param_alist);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
908 store_in_alist (&alist, "name", f->name);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
909 store_in_alist (&alist, "height", make_number (f->height));
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
910 store_in_alist (&alist, "width", make_number (f->width));
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
911 store_in_alist (&alist, "modeline", (f->wants_modeline ? Qt : Qnil));
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
912 store_in_alist (&alist, "minibuffer",
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
913 (FRAME_HAS_MINIBUF (f)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
914 ? (FRAME_MINIBUF_ONLY_P (f) ? intern ("only") : Qt)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
915 : FRAME_MINIBUF_WINDOW (f)));
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
916 store_in_alist (&alist, "unsplittable", (f->no_split ? Qt : Qnil));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
917
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
918 if (FRAME_IS_X (f))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
919 x_report_frame_params (f, &alist);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
920 return alist;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
921 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
922
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
923 DEFUN ("modify-frame-parameters", Fmodify_frame_parameters,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
924 Smodify_frame_parameters, 2, 2, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
925 "Modify the parameters of frame FRAME according to ALIST.\n\
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
926 ALIST is an alist of parameters to change and their new values.\n\
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
927 Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
928 The meaningful PARMs depend on the kind of frame; undefined PARMs are ignored.")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
929 (frame, alist)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
930 Lisp_Object frame, alist;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
931 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
932 register struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
933 register Lisp_Object tail, elt, prop, val;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
934
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
935 if (EQ (frame, Qnil))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
936 f = selected_frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
937 else
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
938 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
939 CHECK_LIVE_FRAME (frame, 0);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
940 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
941 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
942
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
943 if (FRAME_IS_X (f))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
944 for (tail = alist; !EQ (tail, Qnil); tail = Fcdr (tail))
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
945 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
946 elt = Fcar (tail);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
947 prop = Fcar (elt);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
948 val = Fcdr (elt);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
949 x_set_frame_param (f, prop, val,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
950 get_frame_param (f, prop));
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
951 store_frame_param (f, prop, val);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
952 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
953
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
954 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
955 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
956
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
957
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
958 #if 0
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
959 /* This function isn't useful enough by itself to include; we need to
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
960 add functions to allow the user to find the size of a font before
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
961 this is actually useful. */
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
962
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
963 DEFUN ("frame-pixel-size", Fframe_pixel_size,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
964 Sframe_pixel_size, 1, 1, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
965 "Return a cons (width . height) of FRAME's size in pixels.")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
966 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
967 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
968 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
969 register struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
970 int width, height;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
971
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
972 CHECK_LIVE_FRAME (frame, 0);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
973 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
974
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
975 return Fcons (make_number (x_pixel_width (f)),
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
976 make_number (x_pixel_height (f)));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
977 }
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
978 #endif
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
979
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
980 #if 0
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
981 /* These functions have no C callers, and can be written nicely in lisp. */
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
982
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
983 DEFUN ("frame-height", Fframe_height, Sframe_height, 0, 0, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
984 "Return number of lines available for display on selected frame.")
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
985 ()
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
986 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
987 return make_number (FRAME_HEIGHT (selected_frame));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
988 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
989
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
990 DEFUN ("frame-width", Fframe_width, Sframe_width, 0, 0, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
991 "Return number of columns available for display on selected frame.")
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
992 ()
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
993 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
994 return make_number (FRAME_WIDTH (selected_frame));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
995 }
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
996 #endif
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
997
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
998 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
999 "Specify that the frame FRAME has LINES lines.\n\
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1000 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
1001 but that the idea of the actual height of the frame should not be changed.")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1002 (frame, rows, pretend)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1003 Lisp_Object rows, pretend;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1004 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1005 register struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1006
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1007 CHECK_NUMBER (rows, 0);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1008 if (NILP (frame))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1009 f = selected_frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1010 else
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1011 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1012 CHECK_LIVE_FRAME (frame, 0);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1013 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1014 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1015
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1016 if (FRAME_IS_X (f))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1017 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1018 if (XINT (rows) != f->width)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1019 x_set_window_size (f, f->width, XINT (rows));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1020 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1021 else
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1022 change_frame_size (f, XINT (rows), 0, !NILP (pretend));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1023 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1024 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1025
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1026 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
1027 "Specify that the frame FRAME has COLS columns.\n\
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1028 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
1029 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
1030 (frame, cols, pretend)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1031 Lisp_Object cols, pretend;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1032 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1033 register struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1034 CHECK_NUMBER (cols, 0);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1035 if (NILP (frame))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1036 f = selected_frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1037 else
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1038 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1039 CHECK_LIVE_FRAME (frame, 0);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1040 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1041 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1042
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1043 if (FRAME_IS_X (f))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1044 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1045 if (XINT (cols) != f->width)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1046 x_set_window_size (f, XINT (cols), f->height);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1047 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1048 else
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1049 change_frame_size (selected_frame, 0, XINT (cols), !NILP (pretend));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1050 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1051 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1052
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1053 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
1054 "Sets size of FRAME to COLS by ROWS, measured in characters.")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1055 (frame, cols, rows)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1056 Lisp_Object frame, cols, rows;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1057 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1058 register struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1059 int mask;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1060
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1061 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1062 CHECK_NUMBER (cols, 2);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1063 CHECK_NUMBER (rows, 1);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1064 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1065
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1066 if (FRAME_IS_X (f))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1067 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1068 if (XINT (rows) != f->height || XINT (cols) != f->width)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1069 x_set_window_size (f, XINT (cols), XINT (rows));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1070 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1071 else
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1072 change_frame_size (f, XINT (rows), XINT (cols), 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1073
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1074 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1075 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1076
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1077 DEFUN ("set-frame-position", Fset_frame_position,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1078 Sset_frame_position, 3, 3, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1079 "Sets position of FRAME in pixels to XOFFSET by YOFFSET.\n\
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
1080 If XOFFSET or YOFFSET are negative, they are interpreted relative to\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1081 the leftmost or bottommost position FRAME could occupy without going\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1082 off the frame.")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1083 (frame, xoffset, yoffset)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1084 Lisp_Object frame, xoffset, yoffset;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1085 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1086 register struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1087 int mask;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1088
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1089 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1090 CHECK_NUMBER (xoffset, 1);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1091 CHECK_NUMBER (yoffset, 2);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1092 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1093
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1094 if (FRAME_IS_X (f))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1095 x_set_offset (f, XINT (xoffset), XINT (yoffset));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1096
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1097 return Qt;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1098 }
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
1099
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1100
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1101 #ifndef HAVE_X11
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1102 DEFUN ("rubber-band-rectangle", Frubber_band_rectangle, Srubber_band_rectangle,
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1103 3, 3, "",
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1104 "Ask user to specify a window position and size on FRAME with the mouse.\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1105 Arguments are FRAME, NAME and GEO. NAME is a name to be displayed as\n\
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1106 the purpose of this rectangle. GEO is an X-windows size spec that can\n\
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1107 specify defaults for some sizes/positions. If GEO specifies everything,\n\
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1108 the mouse is not used.\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1109 Returns a list of five values: (FRAME LEFT TOP WIDTH HEIGHT).")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1110 (frame, name, geo)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1111 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1112 Lisp_Object name;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1113 Lisp_Object geo;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1114 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1115 int vals[4];
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1116 Lisp_Object nums[4];
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1117 int i;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1118
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1119 CHECK_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1120 CHECK_STRING (name, 1);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1121 CHECK_STRING (geo, 2);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1122
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1123 switch (XFRAME (frame)->output_method)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1124 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1125 case output_x_window:
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1126 x_rubber_band (XFRAME (frame), &vals[0], &vals[1], &vals[2], &vals[3],
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1127 XSTRING (geo)->data, XSTRING (name)->data);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1128 break;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1129
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1130 default:
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1131 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1132 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1133
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1134 for (i = 0; i < 4; i++)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1135 XFASTINT (nums[i]) = vals[i];
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1136 return Fcons (frame, Flist (4, nums));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1137 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1138 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1139 #endif /* not HAVE_X11 */
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1140
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1141 choose_minibuf_frame ()
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1142 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1143 /* For lowest-level minibuf, put it on currently selected frame
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1144 if frame has a minibuffer. */
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1145 if (minibuf_level == 0
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1146 && selected_frame != 0
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1147 && !EQ (minibuf_window, selected_frame->minibuffer_window)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1148 && !EQ (Qnil, selected_frame->minibuffer_window))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1149 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1150 Fset_window_buffer (selected_frame->minibuffer_window,
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1151 XWINDOW (minibuf_window)->buffer);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1152 minibuf_window = selected_frame->minibuffer_window;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1153 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1154 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1155
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1156 syms_of_frame ()
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1157 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1158 Qframep = intern ("framep");
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1159 Qlive_frame_p = intern ("live_frame_p");
539
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
1160 Qminibuffer = intern ("minibuffer");
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
1161
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1162 staticpro (&Qframep);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1163 staticpro (&Qlive_frame_p);
539
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
1164 staticpro (&Qminibuffer);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1165
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1166 staticpro (&Vframe_list);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1167
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1168 DEFVAR_LISP ("terminal-frame", &Vterminal_frame,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1169 "The initial frame-object, which represents Emacs's stdout.");
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1170
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1171 DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1172 "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
1173 Vemacs_iconified = Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1174
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1175 DEFVAR_LISP ("default-minibuffer-frame", &Vdefault_minibuffer_frame,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1176 "Minibufferless frames use this frame's minibuffer.\n\
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
1177 \n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1178 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
1179 appropriate surrogate.\n\
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
1180 \n\
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
1181 Emacs consults this variable only when creating minibufferless\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1182 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
1183 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
1184 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
1185 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
1186 displayed.");
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1187 Vdefault_minibuffer_frame = Qnil;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1188
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1189 DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1190 "Alist of default values for frame creation.\n\
386
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
1191 These may be set in your init file, like this:\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1192 (setq default-frame-alist '((width . 80) (height . 55)))\n\
386
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
1193 These override values given in window system configuration data, like\n\
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
1194 X Windows' defaults database.\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1195 For values specific to the first Emacs frame, see `initial-frame-alist'.\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1196 For values specific to the separate minibuffer frame, see\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1197 `minibuffer-frame-alist'.");
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1198 Vdefault_frame_alist = Qnil;
386
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
1199
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1200 defsubr (&Sframep);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1201 defsubr (&Slive_frame_p);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1202 defsubr (&Sselect_frame);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1203 defsubr (&Sselected_frame);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1204 defsubr (&Swindow_frame);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1205 defsubr (&Sframe_root_window);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1206 defsubr (&Sframe_selected_window);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1207 defsubr (&Sframe_list);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1208 defsubr (&Snext_frame);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1209 defsubr (&Sdelete_frame);
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
1210 defsubr (&Smouse_position);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1211 defsubr (&Sset_mouse_position);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1212 #if 0
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1213 defsubr (&Sframe_configuration);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1214 defsubr (&Srestore_frame_configuration);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1215 #endif
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1216 defsubr (&Smake_frame_visible);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1217 defsubr (&Smake_frame_invisible);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1218 defsubr (&Siconify_frame);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1219 defsubr (&Sframe_visible_p);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1220 defsubr (&Svisible_frame_list);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1221 defsubr (&Sredirect_frame_focus);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1222 defsubr (&Sframe_focus);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1223 defsubr (&Sframe_parameters);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1224 defsubr (&Smodify_frame_parameters);
785
17ccc9d015f5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 777
diff changeset
1225 #if 0
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1226 defsubr (&Sframe_pixel_size);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1227 defsubr (&Sframe_height);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1228 defsubr (&Sframe_width);
785
17ccc9d015f5 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 777
diff changeset
1229 #endif
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1230 defsubr (&Sset_frame_height);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1231 defsubr (&Sset_frame_width);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1232 defsubr (&Sset_frame_size);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1233 defsubr (&Sset_frame_position);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1234 #ifndef HAVE_X11
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1235 defsubr (&Srubber_band_rectangle);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1236 #endif /* HAVE_X11 */
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1237 }
732
a8d94735277e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 714
diff changeset
1238
a8d94735277e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 714
diff changeset
1239 #endif