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