765
|
1 /* Generic frame functions.
|
17221
|
2 Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation.
|
286
|
3
|
|
4 This file is part of GNU Emacs.
|
|
5
|
|
6 GNU Emacs is free software; you can redistribute it and/or modify
|
|
7 it under the terms of the GNU General Public License as published by
|
708
|
8 the Free Software Foundation; either version 2, or (at your option)
|
286
|
9 any later version.
|
|
10
|
|
11 GNU Emacs is distributed in the hope that it will be useful,
|
|
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14 GNU General Public License for more details.
|
|
15
|
|
16 You should have received a copy of the GNU General Public License
|
|
17 along with GNU Emacs; see the file COPYING. If not, write to
|
14186
|
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
19 Boston, MA 02111-1307, USA. */
|
286
|
20
|
7900
|
21 #include <config.h>
|
363
|
22
|
7900
|
23 #include <stdio.h>
|
20280
|
24 #ifdef HAVE_STDLIB_H
|
|
25 #include <stdlib.h>
|
|
26 #endif
|
987
|
27 #include "lisp.h"
|
17032
|
28 #include "charset.h"
|
|
29 #ifdef HAVE_WINDOW_SYSTEM
|
|
30 #include "fontset.h"
|
21825
|
31 #endif
|
|
32 #ifdef HAVE_X_WINDOWS
|
21514
|
33 #include "xterm.h"
|
17032
|
34 #endif
|
987
|
35 #include "frame.h"
|
5392
|
36 #include "termhooks.h"
|
21514
|
37 #include "dispextern.h"
|
7162
|
38 #include "window.h"
|
9572
|
39 #ifdef MSDOS
|
|
40 #include "msdos.h"
|
|
41 #endif
|
732
|
42
|
965
|
43 /* Evaluate this expression to rebuild the section of syms_of_frame
|
|
44 that initializes and staticpros the symbols declared below. Note
|
|
45 that Emacs 18 has a bug that keeps C-x C-e from being able to
|
|
46 evaluate this expression.
|
|
47
|
|
48 (progn
|
|
49 ;; Accumulate a list of the symbols we want to initialize from the
|
|
50 ;; declarations at the top of the file.
|
|
51 (goto-char (point-min))
|
|
52 (search-forward "/\*&&& symbols declared here &&&*\/\n")
|
|
53 (let (symbol-list)
|
|
54 (while (looking-at "Lisp_Object \\(Q[a-z_]+\\)")
|
|
55 (setq symbol-list
|
|
56 (cons (buffer-substring (match-beginning 1) (match-end 1))
|
|
57 symbol-list))
|
|
58 (forward-line 1))
|
|
59 (setq symbol-list (nreverse symbol-list))
|
|
60 ;; Delete the section of syms_of_... where we initialize the symbols.
|
|
61 (search-forward "\n /\*&&& init symbols here &&&*\/\n")
|
|
62 (let ((start (point)))
|
|
63 (while (looking-at "^ Q")
|
|
64 (forward-line 2))
|
|
65 (kill-region start (point)))
|
|
66 ;; Write a new symbol initialization section.
|
|
67 (while symbol-list
|
|
68 (insert (format " %s = intern (\"" (car symbol-list)))
|
|
69 (let ((start (point)))
|
|
70 (insert (substring (car symbol-list) 1))
|
|
71 (subst-char-in-region start (point) ?_ ?-))
|
|
72 (insert (format "\");\n staticpro (&%s);\n" (car symbol-list)))
|
|
73 (setq symbol-list (cdr symbol-list)))))
|
|
74 */
|
|
75
|
|
76 /*&&& symbols declared here &&&*/
|
|
77 Lisp_Object Qframep;
|
1821
|
78 Lisp_Object Qframe_live_p;
|
965
|
79 Lisp_Object Qheight;
|
|
80 Lisp_Object Qicon;
|
539
|
81 Lisp_Object Qminibuffer;
|
965
|
82 Lisp_Object Qmodeline;
|
|
83 Lisp_Object Qname;
|
|
84 Lisp_Object Qonly;
|
|
85 Lisp_Object Qunsplittable;
|
2131
|
86 Lisp_Object Qmenu_bar_lines;
|
965
|
87 Lisp_Object Qwidth;
|
|
88 Lisp_Object Qx;
|
16588
|
89 Lisp_Object Qw32;
|
15391
|
90 Lisp_Object Qpc;
|
6246
|
91 Lisp_Object Qvisible;
|
10207
|
92 Lisp_Object Qbuffer_predicate;
|
17221
|
93 Lisp_Object Qbuffer_list;
|
14217
|
94 Lisp_Object Qtitle;
|
286
|
95
|
12761
|
96 Lisp_Object Vterminal_frame;
|
13522
|
97 Lisp_Object Vdefault_frame_alist;
|
12761
|
98
|
|
99 static void
|
|
100 syms_of_frame_1 ()
|
|
101 {
|
|
102 /*&&& init symbols here &&&*/
|
|
103 Qframep = intern ("framep");
|
|
104 staticpro (&Qframep);
|
|
105 Qframe_live_p = intern ("frame-live-p");
|
|
106 staticpro (&Qframe_live_p);
|
|
107 Qheight = intern ("height");
|
|
108 staticpro (&Qheight);
|
|
109 Qicon = intern ("icon");
|
|
110 staticpro (&Qicon);
|
|
111 Qminibuffer = intern ("minibuffer");
|
|
112 staticpro (&Qminibuffer);
|
|
113 Qmodeline = intern ("modeline");
|
|
114 staticpro (&Qmodeline);
|
|
115 Qname = intern ("name");
|
|
116 staticpro (&Qname);
|
|
117 Qonly = intern ("only");
|
|
118 staticpro (&Qonly);
|
|
119 Qunsplittable = intern ("unsplittable");
|
|
120 staticpro (&Qunsplittable);
|
|
121 Qmenu_bar_lines = intern ("menu-bar-lines");
|
|
122 staticpro (&Qmenu_bar_lines);
|
|
123 Qwidth = intern ("width");
|
|
124 staticpro (&Qwidth);
|
|
125 Qx = intern ("x");
|
|
126 staticpro (&Qx);
|
16588
|
127 Qw32 = intern ("w32");
|
|
128 staticpro (&Qw32);
|
15391
|
129 Qpc = intern ("pc");
|
|
130 staticpro (&Qpc);
|
12761
|
131 Qvisible = intern ("visible");
|
|
132 staticpro (&Qvisible);
|
|
133 Qbuffer_predicate = intern ("buffer-predicate");
|
|
134 staticpro (&Qbuffer_predicate);
|
17221
|
135 Qbuffer_list = intern ("buffer-list");
|
|
136 staticpro (&Qbuffer_list);
|
14217
|
137 Qtitle = intern ("title");
|
|
138 staticpro (&Qtitle);
|
13106
|
139
|
13522
|
140 DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist,
|
|
141 "Alist of default values for frame creation.\n\
|
|
142 These may be set in your init file, like this:\n\
|
|
143 (setq default-frame-alist '((width . 80) (height . 55) (menu-bar-lines . 1))\n\
|
|
144 These override values given in window system configuration data,\n\
|
|
145 including X Windows' defaults database.\n\
|
|
146 For values specific to the first Emacs frame, see `initial-frame-alist'.\n\
|
|
147 For values specific to the separate minibuffer frame, see\n\
|
|
148 `minibuffer-frame-alist'.\n\
|
|
149 The `menu-bar-lines' element of the list controls whether new frames\n\
|
|
150 have menu bars; `menu-bar-mode' works by altering this element.");
|
|
151 Vdefault_frame_alist = Qnil;
|
12761
|
152 }
|
|
153
|
|
154 static void
|
|
155 set_menu_bar_lines_1 (window, n)
|
|
156 Lisp_Object window;
|
|
157 int n;
|
|
158 {
|
|
159 struct window *w = XWINDOW (window);
|
|
160
|
13498
c10046894834
(set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
161 XSETFASTINT (w->last_modified, 0);
|
12761
|
162 XSETFASTINT (w->top, XFASTINT (w->top) + n);
|
|
163 XSETFASTINT (w->height, XFASTINT (w->height) - n);
|
|
164
|
|
165 /* Handle just the top child in a vertical split. */
|
|
166 if (!NILP (w->vchild))
|
|
167 set_menu_bar_lines_1 (w->vchild, n);
|
|
168
|
|
169 /* Adjust all children in a horizontal split. */
|
|
170 for (window = w->hchild; !NILP (window); window = w->next)
|
|
171 {
|
|
172 w = XWINDOW (window);
|
|
173 set_menu_bar_lines_1 (window, n);
|
|
174 }
|
|
175 }
|
|
176
|
20038
|
177 void
|
12761
|
178 set_menu_bar_lines (f, value, oldval)
|
|
179 struct frame *f;
|
|
180 Lisp_Object value, oldval;
|
|
181 {
|
|
182 int nlines;
|
|
183 int olines = FRAME_MENU_BAR_LINES (f);
|
|
184
|
|
185 /* Right now, menu bars don't work properly in minibuf-only frames;
|
|
186 most of the commands try to apply themselves to the minibuffer
|
16051
|
187 frame itself, and get an error because you can't switch buffers
|
12761
|
188 in or split the minibuffer window. */
|
|
189 if (FRAME_MINIBUF_ONLY_P (f))
|
|
190 return;
|
|
191
|
|
192 if (INTEGERP (value))
|
|
193 nlines = XINT (value);
|
|
194 else
|
|
195 nlines = 0;
|
|
196
|
13498
c10046894834
(set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
197 if (nlines != olines)
|
c10046894834
(set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
198 {
|
c10046894834
(set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
199 windows_or_buffers_changed++;
|
c10046894834
(set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
200 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
|
c10046894834
(set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
201 FRAME_MENU_BAR_LINES (f) = nlines;
|
c10046894834
(set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
202 set_menu_bar_lines_1 (f->root_window, nlines - olines);
|
c10046894834
(set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
203 }
|
12761
|
204 }
|
|
205
|
|
206 #include "buffer.h"
|
|
207
|
|
208 /* These help us bind and responding to switch-frame events. */
|
|
209 #include "commands.h"
|
|
210 #include "keyboard.h"
|
|
211
|
|
212 Lisp_Object Vemacs_iconified;
|
|
213 Lisp_Object Vframe_list;
|
|
214
|
286
|
215 extern Lisp_Object Vminibuffer_list;
|
|
216 extern Lisp_Object get_minibuffer ();
|
5172
|
217 extern Lisp_Object Fhandle_switch_frame ();
|
|
218 extern Lisp_Object Fredirect_frame_focus ();
|
12005
|
219 extern Lisp_Object x_get_focus_frame ();
|
286
|
220
|
765
|
221 DEFUN ("framep", Fframep, Sframep, 1, 1, 0,
|
|
222 "Return non-nil if OBJECT is a frame.\n\
|
|
223 Value is t for a termcap frame (a character-only terminal),\n\
|
9572
|
224 `x' for an Emacs frame that is really an X window,\n\
|
|
225 `pc' for a direct-write MS-DOS frame.\n\
|
10851
|
226 See also `frame-live-p'.")
|
454
|
227 (object)
|
|
228 Lisp_Object object;
|
286
|
229 {
|
9127
|
230 if (!FRAMEP (object))
|
286
|
231 return Qnil;
|
765
|
232 switch (XFRAME (object)->output_method)
|
286
|
233 {
|
|
234 case output_termcap:
|
|
235 return Qt;
|
|
236 case output_x_window:
|
965
|
237 return Qx;
|
16588
|
238 case output_w32:
|
|
239 return Qw32;
|
15391
|
240 case output_msdos_raw:
|
|
241 return Qpc;
|
286
|
242 default:
|
|
243 abort ();
|
|
244 }
|
|
245 }
|
|
246
|
1821
|
247 DEFUN ("frame-live-p", Fframe_live_p, Sframe_live_p, 1, 1, 0,
|
765
|
248 "Return non-nil if OBJECT is a frame which has not been deleted.\n\
|
|
249 Value is nil if OBJECT is not a live frame. If object is a live\n\
|
|
250 frame, the return value indicates what sort of output device it is\n\
|
|
251 displayed on. Value is t for a termcap frame (a character-only\n\
|
|
252 terminal), `x' for an Emacs frame being displayed in an X window.")
|
454
|
253 (object)
|
|
254 Lisp_Object object;
|
|
255 {
|
765
|
256 return ((FRAMEP (object)
|
|
257 && FRAME_LIVE_P (XFRAME (object)))
|
|
258 ? Fframep (object)
|
454
|
259 : Qnil);
|
|
260 }
|
|
261
|
765
|
262 struct frame *
|
|
263 make_frame (mini_p)
|
286
|
264 int mini_p;
|
|
265 {
|
765
|
266 Lisp_Object frame;
|
|
267 register struct frame *f;
|
286
|
268 register Lisp_Object root_window;
|
|
269 register Lisp_Object mini_window;
|
9972
|
270 register struct Lisp_Vector *vec;
|
|
271 int i;
|
286
|
272
|
9972
|
273 vec = allocate_vectorlike ((EMACS_INT) VECSIZE (struct frame));
|
|
274 for (i = 0; i < VECSIZE (struct frame); i++)
|
|
275 XSETFASTINT (vec->contents[i], 0);
|
|
276 vec->size = VECSIZE (struct frame);
|
|
277 f = (struct frame *)vec;
|
|
278 XSETFRAME (frame, f);
|
286
|
279
|
765
|
280 f->cursor_x = 0;
|
|
281 f->cursor_y = 0;
|
|
282 f->current_glyphs = 0;
|
|
283 f->desired_glyphs = 0;
|
|
284 f->visible = 0;
|
1652
|
285 f->async_visible = 0;
|
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
286 f->output_data.nothing = 0;
|
765
|
287 f->iconified = 0;
|
1652
|
288 f->async_iconified = 0;
|
765
|
289 f->wants_modeline = 1;
|
|
290 f->auto_raise = 0;
|
|
291 f->auto_lower = 0;
|
|
292 f->no_split = 0;
|
|
293 f->garbaged = 0;
|
|
294 f->has_minibuffer = mini_p;
|
1709
|
295 f->focus_frame = Qnil;
|
1006
|
296 f->explicit_name = 0;
|
1989
|
297 f->can_have_scroll_bars = 0;
|
16263
a369af16e836
(make_frame): Switch from boolean `has_vertical_scrollbars' integer to
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
298 f->vertical_scroll_bar_type = vertical_scroll_bar_none;
|
765
|
299 f->param_alist = Qnil;
|
1989
|
300 f->scroll_bars = Qnil;
|
|
301 f->condemned_scroll_bars = Qnil;
|
2417
|
302 f->face_alist = Qnil;
|
6130
|
303 f->menu_bar_items = Qnil;
|
7095
098b87bde5a7
(make_frame): Initialize fields menu_bar_vector and menu_bar_items_used.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
304 f->menu_bar_vector = Qnil;
|
098b87bde5a7
(make_frame): Initialize fields menu_bar_vector and menu_bar_items_used.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
305 f->menu_bar_items_used = 0;
|
10207
|
306 f->buffer_predicate = Qnil;
|
17221
|
307 f->buffer_list = Qnil;
|
11017
|
308 #ifdef MULTI_KBOARD
|
|
309 f->kboard = initial_kboard;
|
|
310 #endif
|
14303
|
311 f->namebuf = 0;
|
14223
|
312 f->title = Qnil;
|
286
|
313
|
987
|
314 root_window = make_window ();
|
286
|
315 if (mini_p)
|
|
316 {
|
987
|
317 mini_window = make_window ();
|
286
|
318 XWINDOW (root_window)->next = mini_window;
|
|
319 XWINDOW (mini_window)->prev = root_window;
|
|
320 XWINDOW (mini_window)->mini_p = Qt;
|
765
|
321 XWINDOW (mini_window)->frame = frame;
|
|
322 f->minibuffer_window = mini_window;
|
286
|
323 }
|
|
324 else
|
|
325 {
|
|
326 mini_window = Qnil;
|
|
327 XWINDOW (root_window)->next = Qnil;
|
765
|
328 f->minibuffer_window = Qnil;
|
286
|
329 }
|
|
330
|
765
|
331 XWINDOW (root_window)->frame = frame;
|
286
|
332
|
|
333 /* 10 is arbitrary,
|
|
334 just so that there is "something there."
|
765
|
335 Correct size will be set up later with change_frame_size. */
|
286
|
336
|
16263
a369af16e836
(make_frame): Switch from boolean `has_vertical_scrollbars' integer to
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
337 SET_FRAME_WIDTH (f, 10);
|
765
|
338 f->height = 10;
|
286
|
339
|
9309
27370f65dfa1
(make_frame, Fframe_parameters, Fselected_frame, syms_of_frame): Don't use
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
340 XSETFASTINT (XWINDOW (root_window)->width, 10);
|
27370f65dfa1
(make_frame, Fframe_parameters, Fselected_frame, syms_of_frame): Don't use
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
341 XSETFASTINT (XWINDOW (root_window)->height, (mini_p ? 9 : 10));
|
286
|
342
|
|
343 if (mini_p)
|
|
344 {
|
9309
27370f65dfa1
(make_frame, Fframe_parameters, Fselected_frame, syms_of_frame): Don't use
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
345 XSETFASTINT (XWINDOW (mini_window)->width, 10);
|
27370f65dfa1
(make_frame, Fframe_parameters, Fselected_frame, syms_of_frame): Don't use
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
346 XSETFASTINT (XWINDOW (mini_window)->top, 9);
|
27370f65dfa1
(make_frame, Fframe_parameters, Fselected_frame, syms_of_frame): Don't use
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
347 XSETFASTINT (XWINDOW (mini_window)->height, 1);
|
286
|
348 }
|
|
349
|
765
|
350 /* Choose a buffer for the frame's root window. */
|
386
|
351 {
|
|
352 Lisp_Object buf;
|
|
353
|
|
354 XWINDOW (root_window)->buffer = Qt;
|
|
355 buf = Fcurrent_buffer ();
|
|
356 /* If buf is a 'hidden' buffer (i.e. one whose name starts with
|
|
357 a space), try to find another one. */
|
|
358 if (XSTRING (Fbuffer_name (buf))->data[0] == ' ')
|
22188
|
359 buf = Fother_buffer (buf, Qnil, Qnil);
|
386
|
360 Fset_window_buffer (root_window, buf);
|
17221
|
361
|
|
362 f->buffer_list = Fcons (buf, Qnil);
|
386
|
363 }
|
|
364
|
286
|
365 if (mini_p)
|
|
366 {
|
|
367 XWINDOW (mini_window)->buffer = Qt;
|
|
368 Fset_window_buffer (mini_window,
|
485
|
369 (NILP (Vminibuffer_list)
|
286
|
370 ? get_minibuffer (0)
|
|
371 : Fcar (Vminibuffer_list)));
|
|
372 }
|
|
373
|
765
|
374 f->root_window = root_window;
|
|
375 f->selected_window = root_window;
|
363
|
376 /* Make sure this window seems more recently used than
|
|
377 a newly-created, never-selected window. */
|
9309
27370f65dfa1
(make_frame, Fframe_parameters, Fselected_frame, syms_of_frame): Don't use
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
378 XSETFASTINT (XWINDOW (f->selected_window)->use_time, ++window_select_count);
|
286
|
379
|
17032
|
380 #ifdef HAVE_WINDOW_SYSTEM
|
|
381 f->fontset_data = alloc_fontset_data ();
|
|
382 #endif
|
|
383
|
765
|
384 return f;
|
286
|
385 }
|
|
386
|
21359
f66e706fc9d6
(make_frame_without_minibuffer): Conditionalize on HAVE_WINDOW_SYSTEM.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
387 #ifdef HAVE_WINDOW_SYSTEM
|
765
|
388 /* Make a frame using a separate minibuffer window on another frame.
|
286
|
389 MINI_WINDOW is the minibuffer window to use. nil means use the
|
|
390 default (the global minibuffer). */
|
|
391
|
765
|
392 struct frame *
|
12010
|
393 make_frame_without_minibuffer (mini_window, kb, display)
|
286
|
394 register Lisp_Object mini_window;
|
11775
|
395 KBOARD *kb;
|
12010
|
396 Lisp_Object display;
|
286
|
397 {
|
765
|
398 register struct frame *f;
|
15555
|
399 struct gcpro gcpro1;
|
286
|
400
|
12010
|
401 if (!NILP (mini_window))
|
|
402 CHECK_LIVE_WINDOW (mini_window, 0);
|
286
|
403
|
11775
|
404 #ifdef MULTI_KBOARD
|
12010
|
405 if (!NILP (mini_window)
|
|
406 && XFRAME (XWINDOW (mini_window)->frame)->kboard != kb)
|
11775
|
407 error ("frame and minibuffer must be on the same display");
|
|
408 #endif
|
|
409
|
765
|
410 /* Make a frame containing just a root window. */
|
|
411 f = make_frame (0);
|
286
|
412
|
12010
|
413 if (NILP (mini_window))
|
|
414 {
|
|
415 /* Use default-minibuffer-frame if possible. */
|
|
416 if (!FRAMEP (kb->Vdefault_minibuffer_frame)
|
|
417 || ! FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame)))
|
|
418 {
|
15555
|
419 Lisp_Object frame_dummy;
|
|
420
|
|
421 XSETFRAME (frame_dummy, f);
|
|
422 GCPRO1 (frame_dummy);
|
12010
|
423 /* If there's no minibuffer frame to use, create one. */
|
15555
|
424 kb->Vdefault_minibuffer_frame =
|
|
425 call1 (intern ("make-initial-minibuffer-frame"), display);
|
|
426 UNGCPRO;
|
12010
|
427 }
|
15555
|
428
|
12010
|
429 mini_window = XFRAME (kb->Vdefault_minibuffer_frame)->minibuffer_window;
|
|
430 }
|
15001
|
431
|
765
|
432 f->minibuffer_window = mini_window;
|
15001
|
433
|
|
434 /* Make the chosen minibuffer window display the proper minibuffer,
|
|
435 unless it is already showing a minibuffer. */
|
|
436 if (NILP (Fmemq (XWINDOW (mini_window)->buffer, Vminibuffer_list)))
|
|
437 Fset_window_buffer (mini_window,
|
|
438 (NILP (Vminibuffer_list)
|
|
439 ? get_minibuffer (0)
|
|
440 : Fcar (Vminibuffer_list)));
|
765
|
441 return f;
|
286
|
442 }
|
|
443
|
765
|
444 /* Make a frame containing only a minibuffer window. */
|
286
|
445
|
765
|
446 struct frame *
|
|
447 make_minibuffer_frame ()
|
286
|
448 {
|
765
|
449 /* First make a frame containing just a root window, no minibuffer. */
|
286
|
450
|
765
|
451 register struct frame *f = make_frame (0);
|
286
|
452 register Lisp_Object mini_window;
|
765
|
453 register Lisp_Object frame;
|
286
|
454
|
9268
|
455 XSETFRAME (frame, f);
|
286
|
456
|
1006
|
457 f->auto_raise = 0;
|
765
|
458 f->auto_lower = 0;
|
|
459 f->no_split = 1;
|
|
460 f->wants_modeline = 0;
|
|
461 f->has_minibuffer = 1;
|
286
|
462
|
|
463 /* Now label the root window as also being the minibuffer.
|
|
464 Avoid infinite looping on the window chain by marking next pointer
|
|
465 as nil. */
|
|
466
|
765
|
467 mini_window = f->minibuffer_window = f->root_window;
|
286
|
468 XWINDOW (mini_window)->mini_p = Qt;
|
|
469 XWINDOW (mini_window)->next = Qnil;
|
1006
|
470 XWINDOW (mini_window)->prev = Qnil;
|
765
|
471 XWINDOW (mini_window)->frame = frame;
|
286
|
472
|
|
473 /* Put the proper buffer in that window. */
|
|
474
|
|
475 Fset_window_buffer (mini_window,
|
485
|
476 (NILP (Vminibuffer_list)
|
286
|
477 ? get_minibuffer (0)
|
|
478 : Fcar (Vminibuffer_list)));
|
765
|
479 return f;
|
286
|
480 }
|
21359
f66e706fc9d6
(make_frame_without_minibuffer): Conditionalize on HAVE_WINDOW_SYSTEM.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
481 #endif /* HAVE_WINDOW_SYSTEM */
|
286
|
482
|
765
|
483 /* Construct a frame that refers to the terminal (stdin and stdout). */
|
286
|
484
|
10768
|
485 static int terminal_frame_count;
|
|
486
|
765
|
487 struct frame *
|
|
488 make_terminal_frame ()
|
286
|
489 {
|
765
|
490 register struct frame *f;
|
5231
|
491 Lisp_Object frame;
|
10768
|
492 char name[20];
|
286
|
493
|
11017
|
494 #ifdef MULTI_KBOARD
|
|
495 if (!initial_kboard)
|
|
496 {
|
|
497 initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
|
|
498 init_kboard (initial_kboard);
|
11364
|
499 initial_kboard->next_kboard = all_kboards;
|
|
500 all_kboards = initial_kboard;
|
11017
|
501 }
|
|
502 #endif
|
|
503
|
10768
|
504 /* The first call must initialize Vframe_list. */
|
|
505 if (! (NILP (Vframe_list) || CONSP (Vframe_list)))
|
|
506 Vframe_list = Qnil;
|
|
507
|
765
|
508 f = make_frame (1);
|
5231
|
509
|
9268
|
510 XSETFRAME (frame, f);
|
5231
|
511 Vframe_list = Fcons (frame, Vframe_list);
|
|
512
|
10768
|
513 terminal_frame_count++;
|
17857
|
514 sprintf (name, "F%d", terminal_frame_count);
|
|
515 f->name = build_string (name);
|
10768
|
516
|
|
517 f->visible = 1; /* FRAME_SET_VISIBLE wd set frame_garbaged. */
|
|
518 f->async_visible = 1; /* Don't let visible be cleared later. */
|
15391
|
519 #ifdef MSDOS
|
|
520 f->output_data.x = &the_only_x_display;
|
|
521 f->output_method = output_msdos_raw;
|
|
522 init_frame_faces (f);
|
|
523 #else /* not MSDOS */
|
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
524 f->output_data.nothing = 1; /* Nonzero means frame isn't deleted. */
|
15391
|
525 #endif
|
765
|
526 return f;
|
286
|
527 }
|
10768
|
528
|
|
529 DEFUN ("make-terminal-frame", Fmake_terminal_frame, Smake_terminal_frame,
|
10783
|
530 1, 1, 0, "Create an additional terminal frame.\n\
|
|
531 You can create multiple frames on a text-only terminal in this way.\n\
|
|
532 Only the selected terminal frame is actually displayed.\n\
|
|
533 This function takes one argument, an alist specifying frame parameters.\n\
|
|
534 In practice, generally you don't need to specify any parameters.\n\
|
|
535 Note that changing the size of one terminal frame automatically affects all.")
|
10768
|
536 (parms)
|
|
537 Lisp_Object parms;
|
|
538 {
|
|
539 struct frame *f;
|
|
540 Lisp_Object frame;
|
|
541
|
15392
|
542 #ifdef MSDOS
|
15391
|
543 if (selected_frame->output_method != output_msdos_raw)
|
|
544 abort ();
|
|
545 #else
|
10768
|
546 if (selected_frame->output_method != output_termcap)
|
|
547 error ("Not using an ASCII terminal now; cannot make a new ASCII frame");
|
15391
|
548 #endif
|
10768
|
549
|
|
550 f = make_terminal_frame ();
|
|
551 change_frame_size (f, FRAME_HEIGHT (selected_frame),
|
|
552 FRAME_WIDTH (selected_frame), 0, 0);
|
|
553 remake_frame_glyphs (f);
|
|
554 calculate_costs (f);
|
|
555 XSETFRAME (frame, f);
|
16184
|
556 Fmodify_frame_parameters (frame, Vdefault_frame_alist);
|
10768
|
557 Fmodify_frame_parameters (frame, parms);
|
12722
|
558 f->face_alist = selected_frame->face_alist;
|
10768
|
559 return frame;
|
|
560 }
|
286
|
561
|
12286
|
562 Lisp_Object
|
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
563 do_switch_frame (frame, no_enter, track)
|
765
|
564 Lisp_Object frame, no_enter;
|
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
565 int track;
|
286
|
566 {
|
1385
|
567 /* If FRAME is a switch-frame event, extract the frame we should
|
|
568 switch to. */
|
|
569 if (CONSP (frame)
|
|
570 && EQ (XCONS (frame)->car, Qswitch_frame)
|
|
571 && CONSP (XCONS (frame)->cdr))
|
|
572 frame = XCONS (XCONS (frame)->cdr)->car;
|
|
573
|
6352
|
574 /* This used to say CHECK_LIVE_FRAME, but apparently it's possible for
|
|
575 a switch-frame event to arrive after a frame is no longer live,
|
|
576 especially when deleting the initial frame during startup. */
|
|
577 CHECK_FRAME (frame, 0);
|
|
578 if (! FRAME_LIVE_P (XFRAME (frame)))
|
|
579 return Qnil;
|
286
|
580
|
765
|
581 if (selected_frame == XFRAME (frame))
|
|
582 return frame;
|
286
|
583
|
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
584 /* This is too greedy; it causes inappropriate focus redirection
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
585 that's hard to get rid of. */
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
586 #if 0
|
1709
|
587 /* If a frame's focus has been redirected toward the currently
|
|
588 selected frame, we should change the redirection to point to the
|
|
589 newly selected frame. This means that if the focus is redirected
|
|
590 from a minibufferless frame to a surrogate minibuffer frame, we
|
|
591 can use `other-window' to switch between all the frames using
|
|
592 that minibuffer frame, and the focus redirection will follow us
|
|
593 around. */
|
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
594 if (track)
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
595 {
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
596 Lisp_Object tail;
|
1709
|
597
|
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
598 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
599 {
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
600 Lisp_Object focus;
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
601
|
9127
|
602 if (!FRAMEP (XCONS (tail)->car))
|
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
603 abort ();
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
604
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
605 focus = FRAME_FOCUS_FRAME (XFRAME (XCONS (tail)->car));
|
1709
|
606
|
9127
|
607 if (FRAMEP (focus) && XFRAME (focus) == selected_frame)
|
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
608 Fredirect_frame_focus (XCONS (tail)->car, frame);
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
609 }
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
610 }
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
611 #else /* ! 0 */
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
612 /* Instead, apply it only to the frame we're pointing to. */
|
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
613 #ifdef HAVE_WINDOW_SYSTEM
|
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
614 if (track && (FRAME_WINDOW_P (XFRAME (frame))))
|
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
615 {
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
616 Lisp_Object focus, xfocus;
|
1709
|
617
|
11529
|
618 xfocus = x_get_focus_frame (XFRAME (frame));
|
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
619 if (FRAMEP (xfocus))
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
620 {
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
621 focus = FRAME_FOCUS_FRAME (XFRAME (xfocus));
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
622 if (FRAMEP (focus) && XFRAME (focus) == selected_frame)
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
623 Fredirect_frame_focus (xfocus, frame);
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
624 }
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
625 }
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
626 #endif /* HAVE_X_WINDOWS */
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
627 #endif /* ! 0 */
|
1709
|
628
|
765
|
629 selected_frame = XFRAME (frame);
|
|
630 if (! FRAME_MINIBUF_ONLY_P (selected_frame))
|
|
631 last_nonminibuf_frame = selected_frame;
|
363
|
632
|
765
|
633 Fselect_window (XFRAME (frame)->selected_window);
|
286
|
634
|
1920
|
635 /* We want to make sure that the next event generates a frame-switch
|
3591
|
636 event to the appropriate frame. This seems kludgy to me, but
|
1920
|
637 before you take it out, make sure that evaluating something like
|
|
638 (select-window (frame-root-window (new-frame))) doesn't end up
|
|
639 with your typing being interpreted in the new frame instead of
|
|
640 the one you're actually typing in. */
|
10853
|
641 internal_last_event_frame = Qnil;
|
1920
|
642
|
765
|
643 return frame;
|
286
|
644 }
|
|
645
|
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
646 DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 2, "e",
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
647 "Select the frame FRAME.\n\
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
648 Subsequent editing commands apply to its selected window.\n\
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
649 The selection of FRAME lasts until the next time the user does\n\
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
650 something to select a different frame, or until the next time this\n\
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
651 function is called.")
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
652 (frame, no_enter)
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
653 Lisp_Object frame, no_enter;
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
654 {
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
655 return do_switch_frame (frame, no_enter, 1);
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
656 }
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
657
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
658
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
659 DEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 2, "e",
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
660 "Handle a switch-frame event EVENT.\n\
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
661 Switch-frame events are usually bound to this function.\n\
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
662 A switch-frame event tells Emacs that the window manager has requested\n\
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
663 that the user's events be directed to the frame mentioned in the event.\n\
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
664 This function selects the selected window of the frame of EVENT.\n\
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
665 \n\
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
666 If EVENT is frame object, handle it as if it were a switch-frame event\n\
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
667 to that frame.")
|
14077
|
668 (event, no_enter)
|
|
669 Lisp_Object event, no_enter;
|
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
670 {
|
12255
|
671 /* Preserve prefix arg that the command loop just cleared. */
|
|
672 current_kboard->Vprefix_arg = Vcurrent_prefix_arg;
|
13106
|
673 call1 (Vrun_hooks, Qmouse_leave_buffer_hook);
|
14077
|
674 return do_switch_frame (event, no_enter, 0);
|
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
675 }
|
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
676
|
12283
|
677 DEFUN ("ignore-event", Fignore_event, Signore_event, 0, 0, "",
|
|
678 "Do nothing, but preserve any prefix argument already specified.\n\
|
|
679 This is a suitable binding for iconify-frame and make-frame-visible.")
|
|
680 ()
|
|
681 {
|
|
682 current_kboard->Vprefix_arg = Vcurrent_prefix_arg;
|
|
683 return Qnil;
|
|
684 }
|
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
685
|
765
|
686 DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0,
|
|
687 "Return the frame that is now selected.")
|
286
|
688 ()
|
|
689 {
|
|
690 Lisp_Object tem;
|
9268
|
691 XSETFRAME (tem, selected_frame);
|
286
|
692 return tem;
|
|
693 }
|
7055
|
694
|
765
|
695 DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0,
|
|
696 "Return the frame object that window WINDOW is on.")
|
286
|
697 (window)
|
|
698 Lisp_Object window;
|
|
699 {
|
1437
|
700 CHECK_LIVE_WINDOW (window, 0);
|
765
|
701 return XWINDOW (window)->frame;
|
286
|
702 }
|
|
703
|
6527
|
704 DEFUN ("frame-first-window", Fframe_first_window, Sframe_first_window, 0, 1, 0,
|
|
705 "Returns the topmost, leftmost window of FRAME.\n\
|
|
706 If omitted, FRAME defaults to the currently selected frame.")
|
|
707 (frame)
|
|
708 Lisp_Object frame;
|
|
709 {
|
|
710 Lisp_Object w;
|
|
711
|
|
712 if (NILP (frame))
|
|
713 w = selected_frame->root_window;
|
|
714 else
|
|
715 {
|
|
716 CHECK_LIVE_FRAME (frame, 0);
|
|
717 w = XFRAME (frame)->root_window;
|
|
718 }
|
|
719 while (NILP (XWINDOW (w)->buffer))
|
|
720 {
|
|
721 if (! NILP (XWINDOW (w)->hchild))
|
|
722 w = XWINDOW (w)->hchild;
|
|
723 else if (! NILP (XWINDOW (w)->vchild))
|
|
724 w = XWINDOW (w)->vchild;
|
|
725 else
|
|
726 abort ();
|
|
727 }
|
|
728 return w;
|
|
729 }
|
|
730
|
11169
|
731 DEFUN ("active-minibuffer-window", Factive_minibuffer_window,
|
|
732 Sactive_minibuffer_window, 0, 0, 0,
|
|
733 "Return the currently active minibuffer window, or nil if none.")
|
|
734 ()
|
|
735 {
|
|
736 return minibuf_level ? minibuf_window : Qnil;
|
|
737 }
|
|
738
|
765
|
739 DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0,
|
1251
|
740 "Returns the root-window of FRAME.\n\
|
|
741 If omitted, FRAME defaults to the currently selected frame.")
|
765
|
742 (frame)
|
|
743 Lisp_Object frame;
|
286
|
744 {
|
765
|
745 if (NILP (frame))
|
9268
|
746 XSETFRAME (frame, selected_frame);
|
454
|
747 else
|
765
|
748 CHECK_LIVE_FRAME (frame, 0);
|
286
|
749
|
765
|
750 return XFRAME (frame)->root_window;
|
286
|
751 }
|
|
752
|
765
|
753 DEFUN ("frame-selected-window", Fframe_selected_window,
|
|
754 Sframe_selected_window, 0, 1, 0,
|
1251
|
755 "Return the selected window of frame object FRAME.\n\
|
|
756 If omitted, FRAME defaults to the currently selected frame.")
|
765
|
757 (frame)
|
|
758 Lisp_Object frame;
|
286
|
759 {
|
765
|
760 if (NILP (frame))
|
9268
|
761 XSETFRAME (frame, selected_frame);
|
454
|
762 else
|
765
|
763 CHECK_LIVE_FRAME (frame, 0);
|
286
|
764
|
765
|
765 return XFRAME (frame)->selected_window;
|
286
|
766 }
|
|
767
|
7055
|
768 DEFUN ("set-frame-selected-window", Fset_frame_selected_window,
|
|
769 Sset_frame_selected_window, 2, 2, 0,
|
|
770 "Set the selected window of frame object FRAME to WINDOW.\n\
|
|
771 If FRAME is nil, the selected frame is used.\n\
|
|
772 If FRAME is the selected frame, this makes WINDOW the selected window.")
|
|
773 (frame, window)
|
|
774 Lisp_Object frame, window;
|
|
775 {
|
|
776 if (NILP (frame))
|
9268
|
777 XSETFRAME (frame, selected_frame);
|
7055
|
778 else
|
|
779 CHECK_LIVE_FRAME (frame, 0);
|
|
780
|
|
781 CHECK_LIVE_WINDOW (window, 1);
|
|
782
|
|
783 if (! EQ (frame, WINDOW_FRAME (XWINDOW (window))))
|
|
784 error ("In `set-frame-selected-window', WINDOW is not on FRAME");
|
|
785
|
|
786 if (XFRAME (frame) == selected_frame)
|
|
787 return Fselect_window (window);
|
|
788
|
|
789 return XFRAME (frame)->selected_window = window;
|
|
790 }
|
|
791
|
765
|
792 DEFUN ("frame-list", Fframe_list, Sframe_list,
|
286
|
793 0, 0, 0,
|
765
|
794 "Return a list of all frames.")
|
286
|
795 ()
|
|
796 {
|
765
|
797 return Fcopy_sequence (Vframe_list);
|
286
|
798 }
|
|
799
|
765
|
800 /* Return the next frame in the frame list after FRAME.
|
|
801 If MINIBUF is nil, exclude minibuffer-only frames.
|
8168
|
802 If MINIBUF is a window, include only its own frame
|
|
803 and any frame now using that window as the minibuffer.
|
6246
|
804 If MINIBUF is `visible', include all visible frames.
|
8168
|
805 If MINIBUF is 0, include all visible and iconified frames.
|
6246
|
806 Otherwise, include all frames. */
|
|
807
|
286
|
808 Lisp_Object
|
765
|
809 next_frame (frame, minibuf)
|
|
810 Lisp_Object frame;
|
454
|
811 Lisp_Object minibuf;
|
286
|
812 {
|
|
813 Lisp_Object tail;
|
|
814 int passed = 0;
|
|
815
|
765
|
816 /* There must always be at least one frame in Vframe_list. */
|
|
817 if (! CONSP (Vframe_list))
|
454
|
818 abort ();
|
|
819
|
1821
|
820 /* If this frame is dead, it won't be in Vframe_list, and we'll loop
|
|
821 forever. Forestall that. */
|
|
822 CHECK_LIVE_FRAME (frame, 0);
|
|
823
|
286
|
824 while (1)
|
765
|
825 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
|
286
|
826 {
|
6500
551bff5cffde
(next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
827 Lisp_Object f;
|
1118
|
828
|
6500
551bff5cffde
(next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
829 f = XCONS (tail)->car;
|
12379
|
830
|
|
831 if (passed
|
|
832 && FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame)))
|
363
|
833 {
|
1118
|
834 /* Decide whether this frame is eligible to be returned. */
|
|
835
|
|
836 /* If we've looped all the way around without finding any
|
|
837 eligible frames, return the original frame. */
|
|
838 if (EQ (f, frame))
|
|
839 return f;
|
335
|
840
|
1118
|
841 /* Let minibuf decide if this frame is acceptable. */
|
|
842 if (NILP (minibuf))
|
|
843 {
|
|
844 if (! FRAME_MINIBUF_ONLY_P (XFRAME (f)))
|
|
845 return f;
|
|
846 }
|
6246
|
847 else if (EQ (minibuf, Qvisible))
|
|
848 {
|
|
849 FRAME_SAMPLE_VISIBILITY (XFRAME (f));
|
|
850 if (FRAME_VISIBLE_P (XFRAME (f)))
|
|
851 return f;
|
|
852 }
|
8168
|
853 else if (XFASTINT (minibuf) == 0)
|
|
854 {
|
|
855 FRAME_SAMPLE_VISIBILITY (XFRAME (f));
|
|
856 if (FRAME_VISIBLE_P (XFRAME (f))
|
|
857 || FRAME_ICONIFIED_P (XFRAME (f)))
|
|
858 return f;
|
|
859 }
|
6246
|
860 else if (WINDOWP (minibuf))
|
1118
|
861 {
|
8168
|
862 if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf)
|
|
863 /* Check that F either is, or has forwarded its focus to,
|
|
864 MINIBUF's frame. */
|
|
865 && (EQ (WINDOW_FRAME (XWINDOW (minibuf)), f)
|
|
866 || EQ (WINDOW_FRAME (XWINDOW (minibuf)),
|
|
867 FRAME_FOCUS_FRAME (XFRAME (f)))))
|
1118
|
868 return f;
|
|
869 }
|
|
870 else
|
765
|
871 return f;
|
363
|
872 }
|
286
|
873
|
1118
|
874 if (EQ (frame, f))
|
286
|
875 passed++;
|
|
876 }
|
|
877 }
|
|
878
|
765
|
879 /* Return the previous frame in the frame list before FRAME.
|
|
880 If MINIBUF is nil, exclude minibuffer-only frames.
|
8168
|
881 If MINIBUF is a window, include only its own frame
|
|
882 and any frame now using that window as the minibuffer.
|
6246
|
883 If MINIBUF is `visible', include all visible frames.
|
8168
|
884 If MINIBUF is 0, include all visible and iconified frames.
|
6246
|
885 Otherwise, include all frames. */
|
|
886
|
286
|
887 Lisp_Object
|
765
|
888 prev_frame (frame, minibuf)
|
|
889 Lisp_Object frame;
|
454
|
890 Lisp_Object minibuf;
|
286
|
891 {
|
|
892 Lisp_Object tail;
|
|
893 Lisp_Object prev;
|
|
894
|
765
|
895 /* There must always be at least one frame in Vframe_list. */
|
|
896 if (! CONSP (Vframe_list))
|
454
|
897 abort ();
|
|
898
|
286
|
899 prev = Qnil;
|
1118
|
900 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
|
454
|
901 {
|
6500
551bff5cffde
(next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
902 Lisp_Object f;
|
454
|
903
|
6500
551bff5cffde
(next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
904 f = XCONS (tail)->car;
|
9127
|
905 if (!FRAMEP (f))
|
1118
|
906 abort ();
|
454
|
907
|
1118
|
908 if (EQ (frame, f) && !NILP (prev))
|
|
909 return prev;
|
454
|
910
|
12379
|
911 if (FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame)))
|
1118
|
912 {
|
12379
|
913 /* Decide whether this frame is eligible to be returned,
|
|
914 according to minibuf. */
|
|
915 if (NILP (minibuf))
|
|
916 {
|
|
917 if (! FRAME_MINIBUF_ONLY_P (XFRAME (f)))
|
|
918 prev = f;
|
|
919 }
|
|
920 else if (WINDOWP (minibuf))
|
|
921 {
|
|
922 if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf)
|
|
923 /* Check that F either is, or has forwarded its focus to,
|
|
924 MINIBUF's frame. */
|
|
925 && (EQ (WINDOW_FRAME (XWINDOW (minibuf)), f)
|
|
926 || EQ (WINDOW_FRAME (XWINDOW (minibuf)),
|
|
927 FRAME_FOCUS_FRAME (XFRAME (f)))))
|
|
928 prev = f;
|
|
929 }
|
|
930 else if (EQ (minibuf, Qvisible))
|
|
931 {
|
|
932 FRAME_SAMPLE_VISIBILITY (XFRAME (f));
|
|
933 if (FRAME_VISIBLE_P (XFRAME (f)))
|
|
934 prev = f;
|
|
935 }
|
|
936 else if (XFASTINT (minibuf) == 0)
|
|
937 {
|
|
938 FRAME_SAMPLE_VISIBILITY (XFRAME (f));
|
|
939 if (FRAME_VISIBLE_P (XFRAME (f))
|
|
940 || FRAME_ICONIFIED_P (XFRAME (f)))
|
|
941 prev = f;
|
|
942 }
|
|
943 else
|
1118
|
944 prev = f;
|
454
|
945 }
|
1118
|
946 }
|
454
|
947
|
1118
|
948 /* We've scanned the entire list. */
|
|
949 if (NILP (prev))
|
|
950 /* We went through the whole frame list without finding a single
|
|
951 acceptable frame. Return the original frame. */
|
|
952 return frame;
|
|
953 else
|
|
954 /* There were no acceptable frames in the list before FRAME; otherwise,
|
|
955 we would have returned directly from the loop. Since PREV is the last
|
|
956 acceptable frame in the list, return it. */
|
|
957 return prev;
|
286
|
958 }
|
|
959
|
4424
|
960
|
765
|
961 DEFUN ("next-frame", Fnext_frame, Snext_frame, 0, 2, 0,
|
|
962 "Return the next frame in the frame list after FRAME.\n\
|
12379
|
963 It considers only frames on the same terminal as FRAME.\n\
|
1709
|
964 By default, skip minibuffer-only frames.\n\
|
1118
|
965 If omitted, FRAME defaults to the selected frame.\n\
|
4227
|
966 If optional argument MINIFRAME is nil, exclude minibuffer-only frames.\n\
|
12379
|
967 If MINIFRAME is a window, include only its own frame\n\
|
8168
|
968 and any frame now using that window as the minibuffer.\n\
|
6246
|
969 If MINIFRAME is `visible', include all visible frames.\n\
|
12379
|
970 If MINIFRAME is 0, include all visible and iconified frames.\n\
|
6246
|
971 Otherwise, include all frames.")
|
765
|
972 (frame, miniframe)
|
1251
|
973 Lisp_Object frame, miniframe;
|
286
|
974 {
|
|
975 Lisp_Object tail;
|
|
976
|
765
|
977 if (NILP (frame))
|
9268
|
978 XSETFRAME (frame, selected_frame);
|
454
|
979 else
|
765
|
980 CHECK_LIVE_FRAME (frame, 0);
|
286
|
981
|
765
|
982 return next_frame (frame, miniframe);
|
286
|
983 }
|
1821
|
984
|
4424
|
985 DEFUN ("previous-frame", Fprevious_frame, Sprevious_frame, 0, 2, 0,
|
|
986 "Return the previous frame in the frame list before FRAME.\n\
|
12379
|
987 It considers only frames on the same terminal as FRAME.\n\
|
4424
|
988 By default, skip minibuffer-only frames.\n\
|
|
989 If omitted, FRAME defaults to the selected frame.\n\
|
|
990 If optional argument MINIFRAME is nil, exclude minibuffer-only frames.\n\
|
12379
|
991 If MINIFRAME is a window, include only its own frame\n\
|
8168
|
992 and any frame now using that window as the minibuffer.\n\
|
6246
|
993 If MINIFRAME is `visible', include all visible frames.\n\
|
12379
|
994 If MINIFRAME is 0, include all visible and iconified frames.\n\
|
6246
|
995 Otherwise, include all frames.")
|
4424
|
996 (frame, miniframe)
|
|
997 Lisp_Object frame, miniframe;
|
|
998 {
|
|
999 Lisp_Object tail;
|
|
1000
|
|
1001 if (NILP (frame))
|
9268
|
1002 XSETFRAME (frame, selected_frame);
|
4424
|
1003 else
|
|
1004 CHECK_LIVE_FRAME (frame, 0);
|
|
1005
|
|
1006 return prev_frame (frame, miniframe);
|
|
1007 }
|
286
|
1008
|
5925
|
1009 /* Return 1 if it is ok to delete frame F;
|
|
1010 0 if all frames aside from F are invisible.
|
|
1011 (Exception: if F is the terminal frame, and we are using X, return 1.) */
|
|
1012
|
7646
|
1013 int
|
5925
|
1014 other_visible_frames (f)
|
|
1015 FRAME_PTR f;
|
|
1016 {
|
|
1017 /* We know the selected frame is visible,
|
|
1018 so if F is some other frame, it can't be the sole visible one. */
|
|
1019 if (f == selected_frame)
|
|
1020 {
|
|
1021 Lisp_Object frames;
|
|
1022 int count = 0;
|
|
1023
|
|
1024 for (frames = Vframe_list;
|
|
1025 CONSP (frames);
|
|
1026 frames = XCONS (frames)->cdr)
|
|
1027 {
|
6500
551bff5cffde
(next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
1028 Lisp_Object this;
|
5925
|
1029
|
6500
551bff5cffde
(next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
1030 this = XCONS (frames)->car;
|
5925
|
1031 /* Verify that the frame's window still exists
|
|
1032 and we can still talk to it. And note any recent change
|
|
1033 in visibility. */
|
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
1034 #ifdef HAVE_WINDOW_SYSTEM
|
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
1035 if (FRAME_WINDOW_P (XFRAME (this)))
|
5925
|
1036 {
|
9648
|
1037 x_sync (XFRAME (this));
|
5925
|
1038 FRAME_SAMPLE_VISIBILITY (XFRAME (this));
|
|
1039 }
|
|
1040 #endif
|
|
1041
|
|
1042 if (FRAME_VISIBLE_P (XFRAME (this))
|
|
1043 || FRAME_ICONIFIED_P (XFRAME (this))
|
|
1044 /* Allow deleting the terminal frame when at least
|
|
1045 one X frame exists! */
|
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
1046 || (FRAME_WINDOW_P (XFRAME (this)) && !FRAME_WINDOW_P (f)))
|
5925
|
1047 count++;
|
|
1048 }
|
|
1049 return count > 1;
|
|
1050 }
|
|
1051 return 1;
|
|
1052 }
|
|
1053
|
4341
d07ef5ea3b58
(Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1054 DEFUN ("delete-frame", Fdelete_frame, Sdelete_frame, 0, 2, "",
|
765
|
1055 "Delete FRAME, permanently eliminating it from use.\n\
|
|
1056 If omitted, FRAME defaults to the selected frame.\n\
|
4341
d07ef5ea3b58
(Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1057 A frame may not be deleted if its minibuffer is used by other frames.\n\
|
d07ef5ea3b58
(Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1058 Normally, you may not delete a frame if all other frames are invisible,\n\
|
d07ef5ea3b58
(Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1059 but if the second optional argument FORCE is non-nil, you may do so.")
|
d07ef5ea3b58
(Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1060 (frame, force)
|
d07ef5ea3b58
(Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1061 Lisp_Object frame, force;
|
286
|
1062 {
|
765
|
1063 struct frame *f;
|
12222
7286ed64badd
(Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1064 int minibuffer_selected;
|
286
|
1065
|
765
|
1066 if (EQ (frame, Qnil))
|
286
|
1067 {
|
765
|
1068 f = selected_frame;
|
9268
|
1069 XSETFRAME (frame, f);
|
286
|
1070 }
|
|
1071 else
|
|
1072 {
|
765
|
1073 CHECK_FRAME (frame, 0);
|
|
1074 f = XFRAME (frame);
|
286
|
1075 }
|
|
1076
|
765
|
1077 if (! FRAME_LIVE_P (f))
|
1920
|
1078 return Qnil;
|
454
|
1079
|
5925
|
1080 if (NILP (force) && !other_visible_frames (f))
|
|
1081 error ("Attempt to delete the sole visible or iconified frame");
|
286
|
1082
|
18945
|
1083 #if 0
|
|
1084 /* This is a nice idea, but x_connection_closed needs to be able
|
|
1085 to delete the last frame, if it is gone. */
|
18698
|
1086 if (NILP (XCONS (Vframe_list)->cdr))
|
|
1087 error ("Attempt to delete the only frame");
|
18945
|
1088 #endif
|
18698
|
1089
|
765
|
1090 /* Does this frame have a minibuffer, and is it the surrogate
|
|
1091 minibuffer for any other frame? */
|
965
|
1092 if (FRAME_HAS_MINIBUF_P (XFRAME (frame)))
|
363
|
1093 {
|
765
|
1094 Lisp_Object frames;
|
708
|
1095
|
765
|
1096 for (frames = Vframe_list;
|
|
1097 CONSP (frames);
|
|
1098 frames = XCONS (frames)->cdr)
|
708
|
1099 {
|
6157
|
1100 Lisp_Object this;
|
|
1101 this = XCONS (frames)->car;
|
363
|
1102
|
765
|
1103 if (! EQ (this, frame)
|
|
1104 && EQ (frame,
|
6157
|
1105 WINDOW_FRAME (XWINDOW
|
|
1106 (FRAME_MINIBUF_WINDOW (XFRAME (this))))))
|
765
|
1107 error ("Attempt to delete a surrogate minibuffer frame");
|
708
|
1108 }
|
286
|
1109 }
|
|
1110
|
12222
7286ed64badd
(Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1111 minibuffer_selected = EQ (minibuf_window, selected_window);
|
7286ed64badd
(Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1112
|
765
|
1113 /* Don't let the frame remain selected. */
|
|
1114 if (f == selected_frame)
|
12379
|
1115 {
|
|
1116 Lisp_Object tail, frame1;
|
|
1117
|
|
1118 /* Look for another visible frame on the same terminal. */
|
|
1119 frame1 = next_frame (frame, Qvisible);
|
|
1120
|
|
1121 /* If there is none, find *some* other frame. */
|
|
1122 if (NILP (frame1) || EQ (frame1, frame))
|
|
1123 {
|
|
1124 FOR_EACH_FRAME (tail, frame1)
|
|
1125 {
|
|
1126 if (! EQ (frame, frame1))
|
|
1127 break;
|
|
1128 }
|
|
1129 }
|
|
1130
|
|
1131 do_switch_frame (frame1, Qnil, 0);
|
|
1132 }
|
286
|
1133
|
765
|
1134 /* Don't allow minibuf_window to remain on a deleted frame. */
|
|
1135 if (EQ (f->minibuffer_window, minibuf_window))
|
286
|
1136 {
|
765
|
1137 Fset_window_buffer (selected_frame->minibuffer_window,
|
286
|
1138 XWINDOW (minibuf_window)->buffer);
|
765
|
1139 minibuf_window = selected_frame->minibuffer_window;
|
12222
7286ed64badd
(Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1140
|
7286ed64badd
(Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1141 /* If the dying minibuffer window was selected,
|
7286ed64badd
(Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1142 select the new one. */
|
7286ed64badd
(Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1143 if (minibuffer_selected)
|
7286ed64badd
(Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1144 Fselect_window (minibuf_window);
|
286
|
1145 }
|
|
1146
|
8099
|
1147 /* Clear any X selections for this frame. */
|
|
1148 #ifdef HAVE_X_WINDOWS
|
|
1149 if (FRAME_X_P (f))
|
|
1150 x_clear_frame_selections (f);
|
|
1151 #endif
|
|
1152
|
1680
|
1153 /* Mark all the windows that used to be on FRAME as deleted, and then
|
|
1154 remove the reference to them. */
|
|
1155 delete_all_subwindows (XWINDOW (f->root_window));
|
|
1156 f->root_window = Qnil;
|
|
1157
|
765
|
1158 Vframe_list = Fdelq (frame, Vframe_list);
|
1709
|
1159 FRAME_SET_VISIBLE (f, 0);
|
286
|
1160
|
18380
d515bf202434
(Fdelete_frame): Clear echo_area_glyphs if it was in this frame.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1161 if (echo_area_glyphs == FRAME_MESSAGE_BUF (f))
|
d515bf202434
(Fdelete_frame): Clear echo_area_glyphs if it was in this frame.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1162 {
|
d515bf202434
(Fdelete_frame): Clear echo_area_glyphs if it was in this frame.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1163 echo_area_glyphs = 0;
|
d515bf202434
(Fdelete_frame): Clear echo_area_glyphs if it was in this frame.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1164 previous_echo_glyphs = 0;
|
d515bf202434
(Fdelete_frame): Clear echo_area_glyphs if it was in this frame.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1165 }
|
d515bf202434
(Fdelete_frame): Clear echo_area_glyphs if it was in this frame.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1166
|
11495
|
1167 if (f->namebuf)
|
|
1168 free (f->namebuf);
|
8666
|
1169 if (FRAME_CURRENT_GLYPHS (f))
|
|
1170 free_frame_glyphs (f, FRAME_CURRENT_GLYPHS (f));
|
|
1171 if (FRAME_DESIRED_GLYPHS (f))
|
|
1172 free_frame_glyphs (f, FRAME_DESIRED_GLYPHS (f));
|
|
1173 if (FRAME_TEMP_GLYPHS (f))
|
|
1174 free_frame_glyphs (f, FRAME_TEMP_GLYPHS (f));
|
|
1175 if (FRAME_INSERT_COST (f))
|
|
1176 free (FRAME_INSERT_COST (f));
|
|
1177 if (FRAME_DELETEN_COST (f))
|
8685
|
1178 free (FRAME_DELETEN_COST (f));
|
8666
|
1179 if (FRAME_INSERTN_COST (f))
|
8685
|
1180 free (FRAME_INSERTN_COST (f));
|
8666
|
1181 if (FRAME_DELETE_COST (f))
|
8685
|
1182 free (FRAME_DELETE_COST (f));
|
17573
|
1183 if (FRAME_MESSAGE_BUF (f))
|
|
1184 free (FRAME_MESSAGE_BUF (f));
|
8666
|
1185
|
17032
|
1186 #ifdef HAVE_WINDOW_SYSTEM
|
|
1187 /* Free all fontset data. */
|
|
1188 free_fontset_data (FRAME_FONTSET_DATA (f));
|
|
1189 #endif
|
|
1190
|
1809
|
1191 /* Since some events are handled at the interrupt level, we may get
|
|
1192 an event for f at any time; if we zero out the frame's display
|
|
1193 now, then we may trip up the event-handling code. Instead, we'll
|
|
1194 promise that the display of the frame must be valid until we have
|
|
1195 called the window-system-dependent frame destruction routine. */
|
1821
|
1196
|
|
1197 /* I think this should be done with a hook. */
|
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
1198 #ifdef HAVE_WINDOW_SYSTEM
|
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
1199 if (FRAME_WINDOW_P (f))
|
1809
|
1200 x_destroy_window (f);
|
363
|
1201 #endif
|
|
1202
|
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1203 f->output_data.nothing = 0;
|
1809
|
1204
|
765
|
1205 /* If we've deleted the last_nonminibuf_frame, then try to find
|
363
|
1206 another one. */
|
765
|
1207 if (f == last_nonminibuf_frame)
|
363
|
1208 {
|
765
|
1209 Lisp_Object frames;
|
708
|
1210
|
765
|
1211 last_nonminibuf_frame = 0;
|
363
|
1212
|
765
|
1213 for (frames = Vframe_list;
|
|
1214 CONSP (frames);
|
|
1215 frames = XCONS (frames)->cdr)
|
363
|
1216 {
|
765
|
1217 f = XFRAME (XCONS (frames)->car);
|
|
1218 if (!FRAME_MINIBUF_ONLY_P (f))
|
363
|
1219 {
|
765
|
1220 last_nonminibuf_frame = f;
|
363
|
1221 break;
|
|
1222 }
|
|
1223 }
|
|
1224 }
|
286
|
1225
|
11906
|
1226 /* If we've deleted this keyboard's default_minibuffer_frame, try to
|
|
1227 find another one. Prefer minibuffer-only frames, but also notice
|
|
1228 frames with other windows. */
|
11779
|
1229 if (EQ (frame, FRAME_KBOARD (f)->Vdefault_minibuffer_frame))
|
708
|
1230 {
|
765
|
1231 Lisp_Object frames;
|
708
|
1232
|
765
|
1233 /* The last frame we saw with a minibuffer, minibuffer-only or not. */
|
6500
551bff5cffde
(next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
1234 Lisp_Object frame_with_minibuf;
|
12380
|
1235 /* Some frame we found on the same kboard, or nil if there are none. */
|
|
1236 Lisp_Object frame_on_same_kboard;
|
708
|
1237
|
12380
|
1238 frame_on_same_kboard = Qnil;
|
6500
551bff5cffde
(next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
1239 frame_with_minibuf = Qnil;
|
12380
|
1240
|
765
|
1241 for (frames = Vframe_list;
|
|
1242 CONSP (frames);
|
|
1243 frames = XCONS (frames)->cdr)
|
708
|
1244 {
|
6500
551bff5cffde
(next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
1245 Lisp_Object this;
|
11906
|
1246 struct frame *f1;
|
708
|
1247
|
6500
551bff5cffde
(next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
1248 this = XCONS (frames)->car;
|
9127
|
1249 if (!FRAMEP (this))
|
708
|
1250 abort ();
|
11906
|
1251 f1 = XFRAME (this);
|
708
|
1252
|
11906
|
1253 /* Consider only frames on the same kboard
|
|
1254 and only those with minibuffers. */
|
|
1255 if (FRAME_KBOARD (f) == FRAME_KBOARD (f1)
|
|
1256 && FRAME_HAS_MINIBUF_P (f1))
|
708
|
1257 {
|
765
|
1258 frame_with_minibuf = this;
|
11906
|
1259 if (FRAME_MINIBUF_ONLY_P (f1))
|
708
|
1260 break;
|
|
1261 }
|
12380
|
1262
|
|
1263 if (FRAME_KBOARD (f) == FRAME_KBOARD (f1))
|
|
1264 frame_on_same_kboard = this;
|
708
|
1265 }
|
|
1266
|
12380
|
1267 if (!NILP (frame_on_same_kboard))
|
|
1268 {
|
|
1269 /* We know that there must be some frame with a minibuffer out
|
|
1270 there. If this were not true, all of the frames present
|
|
1271 would have to be minibufferless, which implies that at some
|
|
1272 point their minibuffer frames must have been deleted, but
|
|
1273 that is prohibited at the top; you can't delete surrogate
|
|
1274 minibuffer frames. */
|
|
1275 if (NILP (frame_with_minibuf))
|
|
1276 abort ();
|
708
|
1277
|
12380
|
1278 FRAME_KBOARD (f)->Vdefault_minibuffer_frame = frame_with_minibuf;
|
|
1279 }
|
|
1280 else
|
|
1281 /* No frames left on this kboard--say no minibuffer either. */
|
|
1282 FRAME_KBOARD (f)->Vdefault_minibuffer_frame = Qnil;
|
708
|
1283 }
|
|
1284
|
16280
|
1285 /* Cause frame titles to update--necessary if we now have just one frame. */
|
|
1286 update_mode_lines = 1;
|
|
1287
|
286
|
1288 return Qnil;
|
|
1289 }
|
|
1290
|
|
1291 /* Return mouse position in character cell units. */
|
|
1292
|
454
|
1293 DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0,
|
765
|
1294 "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\
|
3693
|
1295 The position is given in character cells, where (0, 0) is the\n\
|
|
1296 upper-left corner.\n\
|
454
|
1297 If Emacs is running on a mouseless terminal or hasn't been programmed\n\
|
765
|
1298 to read the mouse position, it returns the selected frame for FRAME\n\
|
454
|
1299 and nil for X and Y.")
|
|
1300 ()
|
286
|
1301 {
|
765
|
1302 FRAME_PTR f;
|
1821
|
1303 Lisp_Object lispy_dummy;
|
1989
|
1304 enum scroll_bar_part party_dummy;
|
1821
|
1305 Lisp_Object x, y;
|
6054
|
1306 int col, row;
|
1821
|
1307 unsigned long long_dummy;
|
286
|
1308
|
3658
|
1309 f = selected_frame;
|
|
1310 x = y = Qnil;
|
|
1311
|
11025
|
1312 #ifdef HAVE_MOUSE
|
3658
|
1313 /* It's okay for the hook to refrain from storing anything. */
|
454
|
1314 if (mouse_position_hook)
|
20178
|
1315 (*mouse_position_hook) (&f, -1,
|
1821
|
1316 &lispy_dummy, &party_dummy,
|
|
1317 &x, &y,
|
|
1318 &long_dummy);
|
6854
c976ac5d85ec
(Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
1319 if (! NILP (x))
|
c976ac5d85ec
(Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
1320 {
|
c976ac5d85ec
(Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
1321 col = XINT (x);
|
c976ac5d85ec
(Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
1322 row = XINT (y);
|
12006
|
1323 pixel_to_glyph_coords (f, col, row, &col, &row, NULL, 1);
|
6854
c976ac5d85ec
(Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
1324 XSETINT (x, col);
|
c976ac5d85ec
(Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
1325 XSETINT (y, row);
|
c976ac5d85ec
(Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
1326 }
|
11025
|
1327 #endif
|
9268
|
1328 XSETFRAME (lispy_dummy, f);
|
3658
|
1329 return Fcons (lispy_dummy, Fcons (x, y));
|
286
|
1330 }
|
|
1331
|
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1332 DEFUN ("mouse-pixel-position", Fmouse_pixel_position,
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1333 Smouse_pixel_position, 0, 0, 0,
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1334 "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1335 The position is given in pixel units, where (0, 0) is the\n\
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1336 upper-left corner.\n\
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1337 If Emacs is running on a mouseless terminal or hasn't been programmed\n\
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1338 to read the mouse position, it returns the selected frame for FRAME\n\
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1339 and nil for X and Y.")
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1340 ()
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1341 {
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1342 FRAME_PTR f;
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1343 Lisp_Object lispy_dummy;
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1344 enum scroll_bar_part party_dummy;
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1345 Lisp_Object x, y;
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1346 int col, row;
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1347 unsigned long long_dummy;
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1348
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1349 f = selected_frame;
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1350 x = y = Qnil;
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1351
|
11126
|
1352 #ifdef HAVE_MOUSE
|
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1353 /* It's okay for the hook to refrain from storing anything. */
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1354 if (mouse_position_hook)
|
20178
|
1355 (*mouse_position_hook) (&f, -1,
|
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1356 &lispy_dummy, &party_dummy,
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1357 &x, &y,
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1358 &long_dummy);
|
11126
|
1359 #endif
|
9268
|
1360 XSETFRAME (lispy_dummy, f);
|
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1361 return Fcons (lispy_dummy, Fcons (x, y));
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1362 }
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1363
|
286
|
1364 DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0,
|
3694
|
1365 "Move the mouse pointer to the center of character cell (X,Y) in FRAME.\n\
|
12774
|
1366 Note, this is a no-op for an X frame that is not visible.\n\
|
|
1367 If you have just created a frame, you must wait for it to become visible\n\
|
|
1368 before calling this function on it, like this.\n\
|
|
1369 (while (not (frame-visible-p frame)) (sleep-for .5))")
|
765
|
1370 (frame, x, y)
|
|
1371 Lisp_Object frame, x, y;
|
286
|
1372 {
|
765
|
1373 CHECK_LIVE_FRAME (frame, 0);
|
286
|
1374 CHECK_NUMBER (x, 2);
|
|
1375 CHECK_NUMBER (y, 1);
|
|
1376
|
1821
|
1377 /* I think this should be done with a hook. */
|
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
1378 #ifdef HAVE_WINDOW_SYSTEM
|
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
1379 if (FRAME_WINDOW_P (XFRAME (frame)))
|
286
|
1380 /* Warping the mouse will cause enternotify and focus events. */
|
21524
|
1381 x_set_mouse_position (XFRAME (frame), XINT (x), XINT (y));
|
15391
|
1382 #else
|
15396
|
1383 #if defined (MSDOS) && defined (HAVE_MOUSE)
|
15391
|
1384 if (FRAME_MSDOS_P (XFRAME (frame)))
|
|
1385 {
|
|
1386 Fselect_frame (frame, Qnil);
|
|
1387 mouse_moveto (XINT (x), XINT (y));
|
|
1388 }
|
|
1389 #endif
|
286
|
1390 #endif
|
|
1391
|
|
1392 return Qnil;
|
|
1393 }
|
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1394
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1395 DEFUN ("set-mouse-pixel-position", Fset_mouse_pixel_position,
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1396 Sset_mouse_pixel_position, 3, 3, 0,
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1397 "Move the mouse pointer to pixel position (X,Y) in FRAME.\n\
|
12774
|
1398 Note, this is a no-op for an X frame that is not visible.\n\
|
|
1399 If you have just created a frame, you must wait for it to become visible\n\
|
|
1400 before calling this function on it, like this.\n\
|
|
1401 (while (not (frame-visible-p frame)) (sleep-for .5))")
|
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1402 (frame, x, y)
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1403 Lisp_Object frame, x, y;
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1404 {
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1405 CHECK_LIVE_FRAME (frame, 0);
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1406 CHECK_NUMBER (x, 2);
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1407 CHECK_NUMBER (y, 1);
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1408
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1409 /* I think this should be done with a hook. */
|
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
1410 #ifdef HAVE_WINDOW_SYSTEM
|
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
1411 if (FRAME_WINDOW_P (XFRAME (frame)))
|
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1412 /* Warping the mouse will cause enternotify and focus events. */
|
21524
|
1413 x_set_mouse_pixel_position (XFRAME (frame), XINT (x), XINT (y));
|
15391
|
1414 #else
|
15396
|
1415 #if defined (MSDOS) && defined (HAVE_MOUSE)
|
15391
|
1416 if (FRAME_MSDOS_P (XFRAME (frame)))
|
|
1417 {
|
|
1418 Fselect_frame (frame, Qnil);
|
|
1419 mouse_moveto (XINT (x), XINT (y));
|
|
1420 }
|
|
1421 #endif
|
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1422 #endif
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1423
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1424 return Qnil;
|
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
1425 }
|
286
|
1426
|
22188
|
1427 static void make_frame_visible_1 P_ ((Lisp_Object));
|
|
1428
|
765
|
1429 DEFUN ("make-frame-visible", Fmake_frame_visible, Smake_frame_visible,
|
3834
|
1430 0, 1, "",
|
765
|
1431 "Make the frame FRAME visible (assuming it is an X-window).\n\
|
1251
|
1432 If omitted, FRAME defaults to the currently selected frame.")
|
765
|
1433 (frame)
|
|
1434 Lisp_Object frame;
|
286
|
1435 {
|
872
|
1436 if (NILP (frame))
|
9268
|
1437 XSETFRAME (frame, selected_frame);
|
872
|
1438
|
765
|
1439 CHECK_LIVE_FRAME (frame, 0);
|
286
|
1440
|
1821
|
1441 /* I think this should be done with a hook. */
|
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
1442 #ifdef HAVE_WINDOW_SYSTEM
|
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
1443 if (FRAME_WINDOW_P (XFRAME (frame)))
|
5105
|
1444 {
|
|
1445 FRAME_SAMPLE_VISIBILITY (XFRAME (frame));
|
|
1446 x_make_frame_visible (XFRAME (frame));
|
|
1447 }
|
965
|
1448 #endif
|
286
|
1449
|
22188
|
1450 make_frame_visible_1 (XFRAME (frame)->root_window);
|
|
1451
|
7900
|
1452 /* Make menu bar update for the Buffers and Frams menus. */
|
|
1453 windows_or_buffers_changed++;
|
|
1454
|
765
|
1455 return frame;
|
286
|
1456 }
|
|
1457
|
22188
|
1458 /* Update the display_time slot of the buffers shown in WINDOW
|
|
1459 and all its descendents. */
|
|
1460
|
|
1461 static void
|
|
1462 make_frame_visible_1 (window)
|
|
1463 Lisp_Object window;
|
|
1464 {
|
|
1465 struct window *w;
|
|
1466
|
|
1467 for (;!NILP (window); window = w->next)
|
|
1468 {
|
|
1469 w = XWINDOW (window);
|
|
1470
|
|
1471 if (!NILP (w->buffer))
|
|
1472 XBUFFER (w->buffer)->display_time = Fcurrent_time ();
|
|
1473
|
|
1474 if (!NILP (w->vchild))
|
|
1475 make_frame_visible_1 (w->vchild);
|
|
1476 if (!NILP (w->hchild))
|
|
1477 make_frame_visible_1 (w->hchild);
|
|
1478 }
|
|
1479 }
|
|
1480
|
765
|
1481 DEFUN ("make-frame-invisible", Fmake_frame_invisible, Smake_frame_invisible,
|
5925
|
1482 0, 2, "",
|
1251
|
1483 "Make the frame FRAME invisible (assuming it is an X-window).\n\
|
5925
|
1484 If omitted, FRAME defaults to the currently selected frame.\n\
|
|
1485 Normally you may not make FRAME invisible if all other frames are invisible,\n\
|
|
1486 but if the second optional argument FORCE is non-nil, you may do so.")
|
|
1487 (frame, force)
|
|
1488 Lisp_Object frame, force;
|
286
|
1489 {
|
872
|
1490 if (NILP (frame))
|
9268
|
1491 XSETFRAME (frame, selected_frame);
|
872
|
1492
|
765
|
1493 CHECK_LIVE_FRAME (frame, 0);
|
286
|
1494
|
5925
|
1495 if (NILP (force) && !other_visible_frames (XFRAME (frame)))
|
|
1496 error ("Attempt to make invisible the sole visible or iconified frame");
|
|
1497
|
8586
|
1498 #if 0 /* This isn't logically necessary, and it can do GC. */
|
3283
|
1499 /* Don't let the frame remain selected. */
|
|
1500 if (XFRAME (frame) == selected_frame)
|
12286
|
1501 do_switch_frame (next_frame (frame, Qt), Qnil, 0)
|
8586
|
1502 #endif
|
3283
|
1503
|
|
1504 /* Don't allow minibuf_window to remain on a deleted frame. */
|
|
1505 if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window))
|
|
1506 {
|
|
1507 Fset_window_buffer (selected_frame->minibuffer_window,
|
|
1508 XWINDOW (minibuf_window)->buffer);
|
|
1509 minibuf_window = selected_frame->minibuffer_window;
|
|
1510 }
|
|
1511
|
1821
|
1512 /* I think this should be done with a hook. */
|
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
1513 #ifdef HAVE_WINDOW_SYSTEM
|
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
1514 if (FRAME_WINDOW_P (XFRAME (frame)))
|
765
|
1515 x_make_frame_invisible (XFRAME (frame));
|
965
|
1516 #endif
|
286
|
1517
|
7900
|
1518 /* Make menu bar update for the Buffers and Frams menus. */
|
|
1519 windows_or_buffers_changed++;
|
|
1520
|
286
|
1521 return Qnil;
|
|
1522 }
|
|
1523
|
765
|
1524 DEFUN ("iconify-frame", Ficonify_frame, Siconify_frame,
|
872
|
1525 0, 1, "",
|
1251
|
1526 "Make the frame FRAME into an icon.\n\
|
|
1527 If omitted, FRAME defaults to the currently selected frame.")
|
765
|
1528 (frame)
|
|
1529 Lisp_Object frame;
|
286
|
1530 {
|
872
|
1531 if (NILP (frame))
|
9268
|
1532 XSETFRAME (frame, selected_frame);
|
872
|
1533
|
765
|
1534 CHECK_LIVE_FRAME (frame, 0);
|
286
|
1535
|
8586
|
1536 #if 0 /* This isn't logically necessary, and it can do GC. */
|
3283
|
1537 /* Don't let the frame remain selected. */
|
|
1538 if (XFRAME (frame) == selected_frame)
|
|
1539 Fhandle_switch_frame (next_frame (frame, Qt), Qnil);
|
8586
|
1540 #endif
|
3283
|
1541
|
|
1542 /* Don't allow minibuf_window to remain on a deleted frame. */
|
|
1543 if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window))
|
|
1544 {
|
|
1545 Fset_window_buffer (selected_frame->minibuffer_window,
|
|
1546 XWINDOW (minibuf_window)->buffer);
|
|
1547 minibuf_window = selected_frame->minibuffer_window;
|
|
1548 }
|
|
1549
|
1821
|
1550 /* I think this should be done with a hook. */
|
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
1551 #ifdef HAVE_WINDOW_SYSTEM
|
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
1552 if (FRAME_WINDOW_P (XFRAME (frame)))
|
765
|
1553 x_iconify_frame (XFRAME (frame));
|
965
|
1554 #endif
|
286
|
1555
|
7900
|
1556 /* Make menu bar update for the Buffers and Frams menus. */
|
|
1557 windows_or_buffers_changed++;
|
|
1558
|
286
|
1559 return Qnil;
|
|
1560 }
|
|
1561
|
765
|
1562 DEFUN ("frame-visible-p", Fframe_visible_p, Sframe_visible_p,
|
286
|
1563 1, 1, 0,
|
765
|
1564 "Return t if FRAME is now \"visible\" (actually in use for display).\n\
|
|
1565 A frame that is not \"visible\" is not updated and, if it works through\n\
|
286
|
1566 a window system, it may not show at all.\n\
|
965
|
1567 Return the symbol `icon' if frame is visible only as an icon.")
|
765
|
1568 (frame)
|
|
1569 Lisp_Object frame;
|
286
|
1570 {
|
765
|
1571 CHECK_LIVE_FRAME (frame, 0);
|
286
|
1572
|
6012
|
1573 FRAME_SAMPLE_VISIBILITY (XFRAME (frame));
|
|
1574
|
1709
|
1575 if (FRAME_VISIBLE_P (XFRAME (frame)))
|
286
|
1576 return Qt;
|
1709
|
1577 if (FRAME_ICONIFIED_P (XFRAME (frame)))
|
965
|
1578 return Qicon;
|
286
|
1579 return Qnil;
|
|
1580 }
|
|
1581
|
765
|
1582 DEFUN ("visible-frame-list", Fvisible_frame_list, Svisible_frame_list,
|
286
|
1583 0, 0, 0,
|
765
|
1584 "Return a list of all frames now \"visible\" (being updated).")
|
286
|
1585 ()
|
|
1586 {
|
765
|
1587 Lisp_Object tail, frame;
|
|
1588 struct frame *f;
|
286
|
1589 Lisp_Object value;
|
|
1590
|
|
1591 value = Qnil;
|
765
|
1592 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
|
286
|
1593 {
|
765
|
1594 frame = XCONS (tail)->car;
|
9127
|
1595 if (!FRAMEP (frame))
|
286
|
1596 continue;
|
765
|
1597 f = XFRAME (frame);
|
1709
|
1598 if (FRAME_VISIBLE_P (f))
|
765
|
1599 value = Fcons (frame, value);
|
286
|
1600 }
|
|
1601 return value;
|
|
1602 }
|
363
|
1603
|
|
1604
|
11754
|
1605 DEFUN ("raise-frame", Fraise_frame, Sraise_frame, 0, 1, "",
|
1821
|
1606 "Bring FRAME to the front, so it occludes any frames it overlaps.\n\
|
|
1607 If FRAME is invisible, make it visible.\n\
|
11211
|
1608 If you don't specify a frame, the selected frame is used.\n\
|
1821
|
1609 If Emacs is displaying on an ordinary terminal or some other device which\n\
|
|
1610 doesn't support multiple overlapping frames, this function does nothing.")
|
|
1611 (frame)
|
|
1612 Lisp_Object frame;
|
|
1613 {
|
11211
|
1614 if (NILP (frame))
|
|
1615 XSETFRAME (frame, selected_frame);
|
|
1616
|
1821
|
1617 CHECK_LIVE_FRAME (frame, 0);
|
4961
|
1618
|
|
1619 /* Do like the documentation says. */
|
|
1620 Fmake_frame_visible (frame);
|
|
1621
|
1821
|
1622 if (frame_raise_lower_hook)
|
|
1623 (*frame_raise_lower_hook) (XFRAME (frame), 1);
|
|
1624
|
|
1625 return Qnil;
|
|
1626 }
|
|
1627
|
2282
|
1628 /* Should we have a corresponding function called Flower_Power? */
|
11754
|
1629 DEFUN ("lower-frame", Flower_frame, Slower_frame, 0, 1, "",
|
1821
|
1630 "Send FRAME to the back, so it is occluded by any frames that overlap it.\n\
|
11211
|
1631 If you don't specify a frame, the selected frame is used.\n\
|
1821
|
1632 If Emacs is displaying on an ordinary terminal or some other device which\n\
|
|
1633 doesn't support multiple overlapping frames, this function does nothing.")
|
|
1634 (frame)
|
|
1635 Lisp_Object frame;
|
|
1636 {
|
11211
|
1637 if (NILP (frame))
|
|
1638 XSETFRAME (frame, selected_frame);
|
|
1639
|
1821
|
1640 CHECK_LIVE_FRAME (frame, 0);
|
|
1641
|
|
1642 if (frame_raise_lower_hook)
|
|
1643 (*frame_raise_lower_hook) (XFRAME (frame), 0);
|
|
1644
|
|
1645 return Qnil;
|
|
1646 }
|
|
1647
|
363
|
1648
|
765
|
1649 DEFUN ("redirect-frame-focus", Fredirect_frame_focus, Sredirect_frame_focus,
|
363
|
1650 1, 2, 0,
|
765
|
1651 "Arrange for keystrokes typed at FRAME to be sent to FOCUS-FRAME.\n\
|
1709
|
1652 In other words, switch-frame events caused by events in FRAME will\n\
|
|
1653 request a switch to FOCUS-FRAME, and `last-event-frame' will be\n\
|
|
1654 FOCUS-FRAME after reading an event typed at FRAME.\n\
|
363
|
1655 \n\
|
1709
|
1656 If FOCUS-FRAME is omitted or nil, any existing redirection is\n\
|
765
|
1657 cancelled, and the frame again receives its own keystrokes.\n\
|
363
|
1658 \n\
|
1709
|
1659 Focus redirection is useful for temporarily redirecting keystrokes to\n\
|
|
1660 a surrogate minibuffer frame when a frame doesn't have its own\n\
|
|
1661 minibuffer window.\n\
|
363
|
1662 \n\
|
1709
|
1663 A frame's focus redirection can be changed by select-frame. If frame\n\
|
|
1664 FOO is selected, and then a different frame BAR is selected, any\n\
|
|
1665 frames redirecting their focus to FOO are shifted to redirect their\n\
|
|
1666 focus to BAR. This allows focus redirection to work properly when the\n\
|
|
1667 user switches from one frame to another using `select-window'.\n\
|
|
1668 \n\
|
|
1669 This means that a frame whose focus is redirected to itself is treated\n\
|
|
1670 differently from a frame whose focus is redirected to nil; the former\n\
|
|
1671 is affected by select-frame, while the latter is not.\n\
|
|
1672 \n\
|
|
1673 The redirection lasts until `redirect-frame-focus' is called to change it.")
|
765
|
1674 (frame, focus_frame)
|
|
1675 Lisp_Object frame, focus_frame;
|
363
|
1676 {
|
3970
|
1677 /* Note that we don't check for a live frame here. It's reasonable
|
|
1678 to redirect the focus of a frame you're about to delete, if you
|
|
1679 know what other frame should receive those keystrokes. */
|
|
1680 CHECK_FRAME (frame, 0);
|
454
|
1681
|
1709
|
1682 if (! NILP (focus_frame))
|
765
|
1683 CHECK_LIVE_FRAME (focus_frame, 1);
|
363
|
1684
|
765
|
1685 XFRAME (frame)->focus_frame = focus_frame;
|
363
|
1686
|
765
|
1687 if (frame_rehighlight_hook)
|
11535
ae282c46aec2
(Fredirect_frame_focus): Fix earlier change; use a frame known to be non-nil.
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
1688 (*frame_rehighlight_hook) (XFRAME (frame));
|
363
|
1689
|
|
1690 return Qnil;
|
|
1691 }
|
|
1692
|
|
1693
|
765
|
1694 DEFUN ("frame-focus", Fframe_focus, Sframe_focus, 1, 1, 0,
|
|
1695 "Return the frame to which FRAME's keystrokes are currently being sent.\n\
|
1709
|
1696 This returns nil if FRAME's focus is not redirected.\n\
|
765
|
1697 See `redirect-frame-focus'.")
|
|
1698 (frame)
|
|
1699 Lisp_Object frame;
|
363
|
1700 {
|
765
|
1701 CHECK_LIVE_FRAME (frame, 0);
|
1709
|
1702
|
765
|
1703 return FRAME_FOCUS_FRAME (XFRAME (frame));
|
363
|
1704 }
|
|
1705
|
|
1706
|
286
|
1707
|
10207
|
1708 /* Return the value of frame parameter PROP in frame FRAME. */
|
|
1709
|
286
|
1710 Lisp_Object
|
765
|
1711 get_frame_param (frame, prop)
|
|
1712 register struct frame *frame;
|
286
|
1713 Lisp_Object prop;
|
|
1714 {
|
|
1715 register Lisp_Object tem;
|
|
1716
|
765
|
1717 tem = Fassq (prop, frame->param_alist);
|
286
|
1718 if (EQ (tem, Qnil))
|
|
1719 return tem;
|
|
1720 return Fcdr (tem);
|
|
1721 }
|
|
1722
|
10207
|
1723 /* Return the buffer-predicate of the selected frame. */
|
|
1724
|
|
1725 Lisp_Object
|
22188
|
1726 frame_buffer_predicate (frame)
|
|
1727 Lisp_Object frame;
|
10207
|
1728 {
|
22188
|
1729 return XFRAME (frame)->buffer_predicate;
|
10207
|
1730 }
|
|
1731
|
17221
|
1732 /* Return the buffer-list of the selected frame. */
|
|
1733
|
|
1734 Lisp_Object
|
22188
|
1735 frame_buffer_list (frame)
|
|
1736 Lisp_Object frame;
|
17221
|
1737 {
|
22188
|
1738 return XFRAME (frame)->buffer_list;
|
17221
|
1739 }
|
|
1740
|
|
1741 /* Set the buffer-list of the selected frame. */
|
|
1742
|
|
1743 void
|
22188
|
1744 set_frame_buffer_list (frame, list)
|
|
1745 Lisp_Object frame, list;
|
17221
|
1746 {
|
22188
|
1747 XFRAME (frame)->buffer_list = list;
|
17221
|
1748 }
|
|
1749
|
|
1750 /* Discard BUFFER from the buffer-list of each frame. */
|
|
1751
|
|
1752 void
|
|
1753 frames_discard_buffer (buffer)
|
|
1754 Lisp_Object buffer;
|
|
1755 {
|
|
1756 Lisp_Object frame, tail;
|
|
1757
|
|
1758 FOR_EACH_FRAME (tail, frame)
|
|
1759 {
|
|
1760 XFRAME (frame)->buffer_list
|
|
1761 = Fdelq (buffer, XFRAME (frame)->buffer_list);
|
|
1762 }
|
|
1763 }
|
|
1764
|
17235
|
1765 /* Move BUFFER to the end of the buffer-list of each frame. */
|
|
1766
|
|
1767 void
|
|
1768 frames_bury_buffer (buffer)
|
|
1769 Lisp_Object buffer;
|
|
1770 {
|
|
1771 Lisp_Object frame, tail;
|
|
1772
|
|
1773 FOR_EACH_FRAME (tail, frame)
|
|
1774 {
|
|
1775 XFRAME (frame)->buffer_list
|
|
1776 = nconc2 (Fdelq (buffer, XFRAME (frame)->buffer_list),
|
|
1777 Fcons (buffer, Qnil));
|
|
1778 }
|
|
1779 }
|
|
1780
|
10207
|
1781 /* Modify the alist in *ALISTPTR to associate PROP with VAL.
|
|
1782 If the alist already has an element for PROP, we change it. */
|
|
1783
|
286
|
1784 void
|
965
|
1785 store_in_alist (alistptr, prop, val)
|
286
|
1786 Lisp_Object *alistptr, val;
|
965
|
1787 Lisp_Object prop;
|
286
|
1788 {
|
|
1789 register Lisp_Object tem;
|
|
1790
|
|
1791 tem = Fassq (prop, *alistptr);
|
|
1792 if (EQ (tem, Qnil))
|
|
1793 *alistptr = Fcons (Fcons (prop, val), *alistptr);
|
|
1794 else
|
|
1795 Fsetcdr (tem, val);
|
|
1796 }
|
|
1797
|
20280
|
1798 static int
|
|
1799 frame_name_fnn_p (str, len)
|
|
1800 char *str;
|
|
1801 int len;
|
|
1802 {
|
|
1803 if (len > 1 && str[0] == 'F')
|
|
1804 {
|
|
1805 char *end_ptr;
|
|
1806 long num = strtol (str + 1, &end_ptr, 10);
|
|
1807
|
|
1808 if (end_ptr == str + len)
|
|
1809 return 1;
|
|
1810 }
|
|
1811 return 0;
|
|
1812 }
|
|
1813
|
|
1814 /* Set the name of the terminal frame. Also used by MSDOS frames.
|
|
1815 Modeled after x_set_name which is used for WINDOW frames. */
|
|
1816
|
|
1817 void
|
|
1818 set_term_frame_name (f, name)
|
|
1819 struct frame *f;
|
|
1820 Lisp_Object name;
|
|
1821 {
|
|
1822 f->explicit_name = ! NILP (name);
|
|
1823
|
|
1824 /* If NAME is nil, set the name to F<num>. */
|
|
1825 if (NILP (name))
|
|
1826 {
|
|
1827 char namebuf[20];
|
|
1828
|
|
1829 /* Check for no change needed in this very common case
|
|
1830 before we do any consing. */
|
20622
|
1831 if (frame_name_fnn_p (XSTRING (f->name)->data,
|
21244
|
1832 STRING_BYTES (XSTRING (f->name))))
|
20280
|
1833 return;
|
|
1834
|
|
1835 terminal_frame_count++;
|
|
1836 sprintf (namebuf, "F%d", terminal_frame_count);
|
|
1837 name = build_string (namebuf);
|
|
1838 }
|
|
1839 else
|
|
1840 {
|
|
1841 CHECK_STRING (name, 0);
|
|
1842
|
|
1843 /* Don't change the name if it's already NAME. */
|
|
1844 if (! NILP (Fstring_equal (name, f->name)))
|
|
1845 return;
|
|
1846
|
|
1847 /* Don't allow the user to set the frame name to F<num>, so it
|
|
1848 doesn't clash with the names we generate for terminal frames. */
|
21244
|
1849 if (frame_name_fnn_p (XSTRING (name)->data, STRING_BYTES (XSTRING (name))))
|
20280
|
1850 error ("Frame names of the form F<num> are usurped by Emacs");
|
|
1851 }
|
|
1852
|
|
1853 f->name = name;
|
|
1854 update_mode_lines = 1;
|
|
1855 }
|
|
1856
|
286
|
1857 void
|
765
|
1858 store_frame_param (f, prop, val)
|
|
1859 struct frame *f;
|
286
|
1860 Lisp_Object prop, val;
|
|
1861 {
|
|
1862 register Lisp_Object tem;
|
|
1863
|
17221
|
1864 if (EQ (prop, Qbuffer_list))
|
|
1865 {
|
|
1866 f->buffer_list = val;
|
|
1867 return;
|
|
1868 }
|
|
1869
|
765
|
1870 tem = Fassq (prop, f->param_alist);
|
286
|
1871 if (EQ (tem, Qnil))
|
765
|
1872 f->param_alist = Fcons (Fcons (prop, val), f->param_alist);
|
286
|
1873 else
|
|
1874 Fsetcdr (tem, val);
|
539
|
1875
|
10207
|
1876 if (EQ (prop, Qbuffer_predicate))
|
|
1877 f->buffer_predicate = val;
|
|
1878
|
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
1879 if (! FRAME_WINDOW_P (f))
|
20280
|
1880 {
|
|
1881 if (EQ (prop, Qmenu_bar_lines))
|
|
1882 set_menu_bar_lines (f, val, make_number (FRAME_MENU_BAR_LINES (f)));
|
|
1883 else if (EQ (prop, Qname))
|
|
1884 set_term_frame_name (f, val);
|
|
1885 }
|
12761
|
1886
|
9127
|
1887 if (EQ (prop, Qminibuffer) && WINDOWP (val))
|
539
|
1888 {
|
|
1889 if (! MINI_WINDOW_P (XWINDOW (val)))
|
|
1890 error ("Surrogate minibuffer windows must be minibuffer windows.");
|
|
1891
|
16371
|
1892 if (FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f)
|
|
1893 && !EQ (val, f->minibuffer_window))
|
|
1894 error ("Can't change the surrogate minibuffer of a frame with its own minibuffer");
|
539
|
1895
|
|
1896 /* Install the chosen minibuffer window, with proper buffer. */
|
765
|
1897 f->minibuffer_window = val;
|
539
|
1898 }
|
286
|
1899 }
|
|
1900
|
765
|
1901 DEFUN ("frame-parameters", Fframe_parameters, Sframe_parameters, 0, 1, 0,
|
|
1902 "Return the parameters-alist of frame FRAME.\n\
|
286
|
1903 It is a list of elements of the form (PARM . VALUE), where PARM is a symbol.\n\
|
777
|
1904 The meaningful PARMs depend on the kind of frame.\n\
|
|
1905 If FRAME is omitted, return information on the currently selected frame.")
|
765
|
1906 (frame)
|
|
1907 Lisp_Object frame;
|
286
|
1908 {
|
|
1909 Lisp_Object alist;
|
7162
|
1910 FRAME_PTR f;
|
15062
|
1911 int height, width;
|
286
|
1912
|
765
|
1913 if (EQ (frame, Qnil))
|
|
1914 f = selected_frame;
|
286
|
1915 else
|
|
1916 {
|
765
|
1917 CHECK_FRAME (frame, 0);
|
|
1918 f = XFRAME (frame);
|
286
|
1919 }
|
|
1920
|
7162
|
1921 if (!FRAME_LIVE_P (f))
|
286
|
1922 return Qnil;
|
|
1923
|
765
|
1924 alist = Fcopy_alist (f->param_alist);
|
15391
|
1925 #ifdef MSDOS
|
|
1926 if (FRAME_MSDOS_P (f))
|
|
1927 {
|
|
1928 static char *colornames[16] =
|
|
1929 {
|
|
1930 "black", "blue", "green", "cyan", "red", "magenta", "brown",
|
|
1931 "lightgray", "darkgray", "lightblue", "lightgreen", "lightcyan",
|
|
1932 "lightred", "lightmagenta", "yellow", "white"
|
|
1933 };
|
|
1934 store_in_alist (&alist, intern ("foreground-color"),
|
|
1935 build_string (colornames[FRAME_FOREGROUND_PIXEL (f)]));
|
|
1936 store_in_alist (&alist, intern ("background-color"),
|
|
1937 build_string (colornames[FRAME_BACKGROUND_PIXEL (f)]));
|
|
1938 }
|
|
1939 store_in_alist (&alist, intern ("font"), build_string ("default"));
|
|
1940 #endif
|
965
|
1941 store_in_alist (&alist, Qname, f->name);
|
15062
|
1942 height = (FRAME_NEW_HEIGHT (f) ? FRAME_NEW_HEIGHT (f) : FRAME_HEIGHT (f));
|
|
1943 store_in_alist (&alist, Qheight, make_number (height));
|
|
1944 width = (FRAME_NEW_WIDTH (f) ? FRAME_NEW_WIDTH (f) : FRAME_WIDTH (f));
|
|
1945 store_in_alist (&alist, Qwidth, make_number (width));
|
7162
|
1946 store_in_alist (&alist, Qmodeline, (FRAME_WANTS_MODELINE_P (f) ? Qt : Qnil));
|
965
|
1947 store_in_alist (&alist, Qminibuffer,
|
1870
|
1948 (! FRAME_HAS_MINIBUF_P (f) ? Qnil
|
7162
|
1949 : FRAME_MINIBUF_ONLY_P (f) ? Qonly
|
|
1950 : FRAME_MINIBUF_WINDOW (f)));
|
|
1951 store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil));
|
22188
|
1952 store_in_alist (&alist, Qbuffer_list,
|
|
1953 frame_buffer_list (Fselected_frame ()));
|
286
|
1954
|
1821
|
1955 /* I think this should be done with a hook. */
|
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
1956 #ifdef HAVE_WINDOW_SYSTEM
|
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
1957 if (FRAME_WINDOW_P (f))
|
765
|
1958 x_report_frame_params (f, &alist);
|
8244
|
1959 else
|
965
|
1960 #endif
|
8904
|
1961 {
|
|
1962 /* This ought to be correct in f->param_alist for an X frame. */
|
|
1963 Lisp_Object lines;
|
9309
27370f65dfa1
(make_frame, Fframe_parameters, Fselected_frame, syms_of_frame): Don't use
Karl Heuer <kwzh@gnu.org>
diff
changeset
|
1964 XSETFASTINT (lines, FRAME_MENU_BAR_LINES (f));
|
8904
|
1965 store_in_alist (&alist, Qmenu_bar_lines, lines);
|
|
1966 }
|
286
|
1967 return alist;
|
|
1968 }
|
|
1969
|
765
|
1970 DEFUN ("modify-frame-parameters", Fmodify_frame_parameters,
|
|
1971 Smodify_frame_parameters, 2, 2, 0,
|
|
1972 "Modify the parameters of frame FRAME according to ALIST.\n\
|
286
|
1973 ALIST is an alist of parameters to change and their new values.\n\
|
|
1974 Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.\n\
|
16536
|
1975 The meaningful PARMs depend on the kind of frame.\n\
|
|
1976 Undefined PARMs are ignored, but stored in the frame's parameter list\n\
|
|
1977 so that `frame-parameters' will return them.")
|
765
|
1978 (frame, alist)
|
|
1979 Lisp_Object frame, alist;
|
286
|
1980 {
|
965
|
1981 FRAME_PTR f;
|
286
|
1982 register Lisp_Object tail, elt, prop, val;
|
|
1983
|
765
|
1984 if (EQ (frame, Qnil))
|
|
1985 f = selected_frame;
|
286
|
1986 else
|
|
1987 {
|
765
|
1988 CHECK_LIVE_FRAME (frame, 0);
|
|
1989 f = XFRAME (frame);
|
286
|
1990 }
|
|
1991
|
1821
|
1992 /* I think this should be done with a hook. */
|
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
1993 #ifdef HAVE_WINDOW_SYSTEM
|
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
1994 if (FRAME_WINDOW_P (f))
|
965
|
1995 x_set_frame_parameters (f, alist);
|
10207
|
1996 else
|
|
1997 #endif
|
15391
|
1998 #ifdef MSDOS
|
|
1999 if (FRAME_MSDOS_P (f))
|
|
2000 IT_set_frame_parameters (f, alist);
|
|
2001 else
|
|
2002 #endif
|
16568
|
2003 {
|
|
2004 int length = XINT (Flength (alist));
|
|
2005 int i;
|
|
2006 Lisp_Object *parms
|
|
2007 = (Lisp_Object *) alloca (length * sizeof (Lisp_Object));
|
|
2008 Lisp_Object *values
|
|
2009 = (Lisp_Object *) alloca (length * sizeof (Lisp_Object));
|
|
2010
|
|
2011 /* Extract parm names and values into those vectors. */
|
|
2012
|
|
2013 i = 0;
|
|
2014 for (tail = alist; CONSP (tail); tail = Fcdr (tail))
|
|
2015 {
|
|
2016 Lisp_Object elt, prop, val;
|
|
2017
|
|
2018 elt = Fcar (tail);
|
|
2019 parms[i] = Fcar (elt);
|
|
2020 values[i] = Fcdr (elt);
|
|
2021 i++;
|
|
2022 }
|
|
2023
|
|
2024 /* Now process them in reverse of specified order. */
|
|
2025 for (i--; i >= 0; i--)
|
|
2026 {
|
|
2027 prop = parms[i];
|
|
2028 val = values[i];
|
|
2029 store_frame_param (f, prop, val);
|
|
2030 }
|
|
2031 }
|
286
|
2032
|
|
2033 return Qnil;
|
|
2034 }
|
|
2035
|
2068
|
2036 DEFUN ("frame-char-height", Fframe_char_height, Sframe_char_height,
|
|
2037 0, 1, 0,
|
|
2038 "Height in pixels of a line in the font in frame FRAME.\n\
|
|
2039 If FRAME is omitted, the selected frame is used.\n\
|
|
2040 For a terminal frame, the value is always 1.")
|
|
2041 (frame)
|
|
2042 Lisp_Object frame;
|
|
2043 {
|
|
2044 struct frame *f;
|
286
|
2045
|
2068
|
2046 if (NILP (frame))
|
|
2047 f = selected_frame;
|
|
2048 else
|
|
2049 {
|
|
2050 CHECK_FRAME (frame, 0);
|
|
2051 f = XFRAME (frame);
|
|
2052 }
|
777
|
2053
|
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
2054 #ifdef HAVE_WINDOW_SYSTEM
|
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
2055 if (FRAME_WINDOW_P (f))
|
2068
|
2056 return make_number (x_char_height (f));
|
|
2057 else
|
|
2058 #endif
|
|
2059 return make_number (1);
|
|
2060 }
|
|
2061
|
|
2062
|
|
2063 DEFUN ("frame-char-width", Fframe_char_width, Sframe_char_width,
|
|
2064 0, 1, 0,
|
|
2065 "Width in pixels of characters in the font in frame FRAME.\n\
|
|
2066 If FRAME is omitted, the selected frame is used.\n\
|
|
2067 The width is the same for all characters, because\n\
|
|
2068 currently Emacs supports only fixed-width fonts.\n\
|
|
2069 For a terminal screen, the value is always 1.")
|
765
|
2070 (frame)
|
|
2071 Lisp_Object frame;
|
286
|
2072 {
|
2068
|
2073 struct frame *f;
|
286
|
2074
|
2068
|
2075 if (NILP (frame))
|
|
2076 f = selected_frame;
|
|
2077 else
|
|
2078 {
|
|
2079 CHECK_FRAME (frame, 0);
|
|
2080 f = XFRAME (frame);
|
|
2081 }
|
|
2082
|
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
2083 #ifdef HAVE_WINDOW_SYSTEM
|
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
2084 if (FRAME_WINDOW_P (f))
|
2068
|
2085 return make_number (x_char_width (f));
|
|
2086 else
|
777
|
2087 #endif
|
2068
|
2088 return make_number (1);
|
286
|
2089 }
|
|
2090
|
2068
|
2091 DEFUN ("frame-pixel-height", Fframe_pixel_height,
|
|
2092 Sframe_pixel_height, 0, 1, 0,
|
3676
|
2093 "Return a FRAME's height in pixels.\n\
|
19532
|
2094 This counts only the height available for text lines,\n\
|
|
2095 not menu bars on window-system Emacs frames.\n\
|
3676
|
2096 For a terminal frame, the result really gives the height in characters.\n\
|
2068
|
2097 If FRAME is omitted, the selected frame is used.")
|
|
2098 (frame)
|
|
2099 Lisp_Object frame;
|
286
|
2100 {
|
2068
|
2101 struct frame *f;
|
|
2102
|
|
2103 if (NILP (frame))
|
|
2104 f = selected_frame;
|
|
2105 else
|
|
2106 {
|
|
2107 CHECK_FRAME (frame, 0);
|
|
2108 f = XFRAME (frame);
|
|
2109 }
|
|
2110
|
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
2111 #ifdef HAVE_WINDOW_SYSTEM
|
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
2112 if (FRAME_WINDOW_P (f))
|
2068
|
2113 return make_number (x_pixel_height (f));
|
|
2114 else
|
|
2115 #endif
|
|
2116 return make_number (FRAME_HEIGHT (f));
|
286
|
2117 }
|
2068
|
2118
|
|
2119 DEFUN ("frame-pixel-width", Fframe_pixel_width,
|
|
2120 Sframe_pixel_width, 0, 1, 0,
|
|
2121 "Return FRAME's width in pixels.\n\
|
3676
|
2122 For a terminal frame, the result really gives the width in characters.\n\
|
2068
|
2123 If FRAME is omitted, the selected frame is used.")
|
|
2124 (frame)
|
|
2125 Lisp_Object frame;
|
|
2126 {
|
|
2127 struct frame *f;
|
|
2128
|
|
2129 if (NILP (frame))
|
|
2130 f = selected_frame;
|
|
2131 else
|
|
2132 {
|
|
2133 CHECK_FRAME (frame, 0);
|
|
2134 f = XFRAME (frame);
|
|
2135 }
|
|
2136
|
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
2137 #ifdef HAVE_WINDOW_SYSTEM
|
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
2138 if (FRAME_WINDOW_P (f))
|
2068
|
2139 return make_number (x_pixel_width (f));
|
|
2140 else
|
777
|
2141 #endif
|
2068
|
2142 return make_number (FRAME_WIDTH (f));
|
|
2143 }
|
|
2144
|
765
|
2145 DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0,
|
|
2146 "Specify that the frame FRAME has LINES lines.\n\
|
286
|
2147 Optional third arg non-nil means that redisplay should use LINES lines\n\
|
765
|
2148 but that the idea of the actual height of the frame should not be changed.")
|
14077
|
2149 (frame, lines, pretend)
|
|
2150 Lisp_Object frame, lines, pretend;
|
286
|
2151 {
|
765
|
2152 register struct frame *f;
|
286
|
2153
|
14077
|
2154 CHECK_NUMBER (lines, 0);
|
765
|
2155 if (NILP (frame))
|
|
2156 f = selected_frame;
|
286
|
2157 else
|
|
2158 {
|
765
|
2159 CHECK_LIVE_FRAME (frame, 0);
|
|
2160 f = XFRAME (frame);
|
286
|
2161 }
|
|
2162
|
1821
|
2163 /* I think this should be done with a hook. */
|
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
2164 #ifdef HAVE_WINDOW_SYSTEM
|
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
2165 if (FRAME_WINDOW_P (f))
|
286
|
2166 {
|
14077
|
2167 if (XINT (lines) != f->height)
|
|
2168 x_set_window_size (f, 1, f->width, XINT (lines));
|
286
|
2169 }
|
|
2170 else
|
965
|
2171 #endif
|
14077
|
2172 change_frame_size (f, XINT (lines), 0, !NILP (pretend), 0);
|
286
|
2173 return Qnil;
|
|
2174 }
|
|
2175
|
765
|
2176 DEFUN ("set-frame-width", Fset_frame_width, Sset_frame_width, 2, 3, 0,
|
|
2177 "Specify that the frame FRAME has COLS columns.\n\
|
286
|
2178 Optional third arg non-nil means that redisplay should use COLS columns\n\
|
765
|
2179 but that the idea of the actual width of the frame should not be changed.")
|
|
2180 (frame, cols, pretend)
|
965
|
2181 Lisp_Object frame, cols, pretend;
|
286
|
2182 {
|
765
|
2183 register struct frame *f;
|
286
|
2184 CHECK_NUMBER (cols, 0);
|
765
|
2185 if (NILP (frame))
|
|
2186 f = selected_frame;
|
286
|
2187 else
|
|
2188 {
|
765
|
2189 CHECK_LIVE_FRAME (frame, 0);
|
|
2190 f = XFRAME (frame);
|
286
|
2191 }
|
|
2192
|
1821
|
2193 /* I think this should be done with a hook. */
|
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
2194 #ifdef HAVE_WINDOW_SYSTEM
|
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
2195 if (FRAME_WINDOW_P (f))
|
286
|
2196 {
|
765
|
2197 if (XINT (cols) != f->width)
|
5925
|
2198 x_set_window_size (f, 1, XINT (cols), f->height);
|
286
|
2199 }
|
|
2200 else
|
965
|
2201 #endif
|
|
2202 change_frame_size (f, 0, XINT (cols), !NILP (pretend), 0);
|
286
|
2203 return Qnil;
|
|
2204 }
|
|
2205
|
765
|
2206 DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 3, 0,
|
|
2207 "Sets size of FRAME to COLS by ROWS, measured in characters.")
|
|
2208 (frame, cols, rows)
|
|
2209 Lisp_Object frame, cols, rows;
|
286
|
2210 {
|
765
|
2211 register struct frame *f;
|
286
|
2212 int mask;
|
|
2213
|
765
|
2214 CHECK_LIVE_FRAME (frame, 0);
|
286
|
2215 CHECK_NUMBER (cols, 2);
|
|
2216 CHECK_NUMBER (rows, 1);
|
765
|
2217 f = XFRAME (frame);
|
286
|
2218
|
1821
|
2219 /* I think this should be done with a hook. */
|
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
2220 #ifdef HAVE_WINDOW_SYSTEM
|
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
2221 if (FRAME_WINDOW_P (f))
|
286
|
2222 {
|
14966
|
2223 if (XINT (rows) != f->height || XINT (cols) != f->width
|
|
2224 || FRAME_NEW_HEIGHT (f) || FRAME_NEW_WIDTH (f))
|
5925
|
2225 x_set_window_size (f, 1, XINT (cols), XINT (rows));
|
286
|
2226 }
|
|
2227 else
|
965
|
2228 #endif
|
|
2229 change_frame_size (f, XINT (rows), XINT (cols), 0, 0);
|
286
|
2230
|
|
2231 return Qnil;
|
|
2232 }
|
|
2233
|
765
|
2234 DEFUN ("set-frame-position", Fset_frame_position,
|
|
2235 Sset_frame_position, 3, 3, 0,
|
|
2236 "Sets position of FRAME in pixels to XOFFSET by YOFFSET.\n\
|
4341
d07ef5ea3b58
(Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
2237 This is actually the position of the upper left corner of the frame.\n\
|
d07ef5ea3b58
(Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
2238 Negative values for XOFFSET or YOFFSET are interpreted relative to\n\
|
4412
|
2239 the rightmost or bottommost possible position (that stays within the screen).")
|
765
|
2240 (frame, xoffset, yoffset)
|
|
2241 Lisp_Object frame, xoffset, yoffset;
|
286
|
2242 {
|
765
|
2243 register struct frame *f;
|
286
|
2244 int mask;
|
|
2245
|
765
|
2246 CHECK_LIVE_FRAME (frame, 0);
|
286
|
2247 CHECK_NUMBER (xoffset, 1);
|
|
2248 CHECK_NUMBER (yoffset, 2);
|
765
|
2249 f = XFRAME (frame);
|
286
|
2250
|
1821
|
2251 /* I think this should be done with a hook. */
|
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
2252 #ifdef HAVE_WINDOW_SYSTEM
|
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
diff
changeset
|
2253 if (FRAME_WINDOW_P (f))
|
6921
|
2254 x_set_offset (f, XINT (xoffset), XINT (yoffset), 1);
|
965
|
2255 #endif
|
286
|
2256
|
|
2257 return Qt;
|
|
2258 }
|
777
|
2259
|
286
|
2260
|
21514
|
2261 void
|
765
|
2262 syms_of_frame ()
|
286
|
2263 {
|
12761
|
2264 syms_of_frame_1 ();
|
286
|
2265
|
765
|
2266 staticpro (&Vframe_list);
|
286
|
2267
|
765
|
2268 DEFVAR_LISP ("terminal-frame", &Vterminal_frame,
|
|
2269 "The initial frame-object, which represents Emacs's stdout.");
|
286
|
2270
|
|
2271 DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified,
|
765
|
2272 "Non-nil if all of emacs is iconified and frame updates are not needed.");
|
286
|
2273 Vemacs_iconified = Qnil;
|
|
2274
|
11779
|
2275 DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,
|
765
|
2276 "Minibufferless frames use this frame's minibuffer.\n\
|
454
|
2277 \n\
|
765
|
2278 Emacs cannot create minibufferless frames unless this is set to an\n\
|
454
|
2279 appropriate surrogate.\n\
|
|
2280 \n\
|
|
2281 Emacs consults this variable only when creating minibufferless\n\
|
765
|
2282 frames; once the frame is created, it sticks with its assigned\n\
|
454
|
2283 minibuffer, no matter what this variable is set to. This means that\n\
|
|
2284 this variable doesn't necessarily say anything meaningful about the\n\
|
765
|
2285 current set of frames, or where the minibuffer is currently being\n\
|
454
|
2286 displayed.");
|
286
|
2287
|
11169
|
2288 defsubr (&Sactive_minibuffer_window);
|
765
|
2289 defsubr (&Sframep);
|
1821
|
2290 defsubr (&Sframe_live_p);
|
10768
|
2291 defsubr (&Smake_terminal_frame);
|
2298
|
2292 defsubr (&Shandle_switch_frame);
|
12283
|
2293 defsubr (&Signore_event);
|
765
|
2294 defsubr (&Sselect_frame);
|
|
2295 defsubr (&Sselected_frame);
|
|
2296 defsubr (&Swindow_frame);
|
|
2297 defsubr (&Sframe_root_window);
|
7570
|
2298 defsubr (&Sframe_first_window);
|
765
|
2299 defsubr (&Sframe_selected_window);
|
7055
|
2300 defsubr (&Sset_frame_selected_window);
|
765
|
2301 defsubr (&Sframe_list);
|
|
2302 defsubr (&Snext_frame);
|
4424
|
2303 defsubr (&Sprevious_frame);
|
765
|
2304 defsubr (&Sdelete_frame);
|
454
|
2305 defsubr (&Smouse_position);
|
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
2306 defsubr (&Smouse_pixel_position);
|
286
|
2307 defsubr (&Sset_mouse_position);
|
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
2308 defsubr (&Sset_mouse_pixel_position);
|
286
|
2309 #if 0
|
765
|
2310 defsubr (&Sframe_configuration);
|
|
2311 defsubr (&Srestore_frame_configuration);
|
286
|
2312 #endif
|
765
|
2313 defsubr (&Smake_frame_visible);
|
|
2314 defsubr (&Smake_frame_invisible);
|
|
2315 defsubr (&Siconify_frame);
|
|
2316 defsubr (&Sframe_visible_p);
|
|
2317 defsubr (&Svisible_frame_list);
|
2282
|
2318 defsubr (&Sraise_frame);
|
|
2319 defsubr (&Slower_frame);
|
765
|
2320 defsubr (&Sredirect_frame_focus);
|
|
2321 defsubr (&Sframe_focus);
|
|
2322 defsubr (&Sframe_parameters);
|
|
2323 defsubr (&Smodify_frame_parameters);
|
2068
|
2324 defsubr (&Sframe_char_height);
|
|
2325 defsubr (&Sframe_char_width);
|
|
2326 defsubr (&Sframe_pixel_height);
|
|
2327 defsubr (&Sframe_pixel_width);
|
765
|
2328 defsubr (&Sset_frame_height);
|
|
2329 defsubr (&Sset_frame_width);
|
|
2330 defsubr (&Sset_frame_size);
|
|
2331 defsubr (&Sset_frame_position);
|
286
|
2332 }
|
732
|
2333
|
21514
|
2334 void
|
1385
|
2335 keys_of_frame ()
|
|
2336 {
|
2298
|
2337 initial_define_lispy_key (global_map, "switch-frame", "handle-switch-frame");
|
9214
|
2338 initial_define_lispy_key (global_map, "delete-frame", "handle-delete-frame");
|
12283
|
2339 initial_define_lispy_key (global_map, "iconify-frame", "ignore-event");
|
|
2340 initial_define_lispy_key (global_map, "make-frame-visible", "ignore-event");
|
1385
|
2341 }
|