Mercurial > emacs
annotate src/frame.c @ 1680:ea9f3949f153
* frame.c (Fdelete_frame): Delete all the windows in the frame's
window tree, using delete_all_subwindows.
* window.c (delete_all_subwindows): Don't make this static
anymore.
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Sat, 12 Dec 1992 15:34:44 +0000 |
parents | 93497cd89204 |
children | 357b58c8c858 |
rev | line source |
---|---|
765 | 1 /* Generic frame functions. |
708 | 2 Copyright (C) 1989, 1992 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 | |
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
19 | |
363 | 20 #include <stdio.h> |
21 | |
286 | 22 #include "config.h" |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
23 #include "lisp.h" |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
24 #include "frame.h" |
732 | 25 |
765 | 26 #ifdef MULTI_FRAME |
732 | 27 |
1514
ceaecac6bf2e
* frame.c: #include buffer.h.
Jim Blandy <jimb@redhat.com>
parents:
1437
diff
changeset
|
28 #include "buffer.h" |
286 | 29 #include "window.h" |
363 | 30 #include "termhooks.h" |
286 | 31 |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
32 /* These help us bind and responding to switch-frame events. */ |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
33 #include "commands.h" |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
34 #include "keyboard.h" |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
35 |
286 | 36 Lisp_Object Vemacs_iconified; |
765 | 37 Lisp_Object Vframe_list; |
38 Lisp_Object Vterminal_frame; | |
39 Lisp_Object Vdefault_minibuffer_frame; | |
40 Lisp_Object Vdefault_frame_alist; | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
41 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
42 /* Evaluate this expression to rebuild the section of syms_of_frame |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
43 that initializes and staticpros the symbols declared below. Note |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
44 that Emacs 18 has a bug that keeps C-x C-e from being able to |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
45 evaluate this expression. |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
46 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
47 (progn |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
48 ;; Accumulate a list of the symbols we want to initialize from the |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
49 ;; declarations at the top of the file. |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
50 (goto-char (point-min)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
51 (search-forward "/\*&&& symbols declared here &&&*\/\n") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
52 (let (symbol-list) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
53 (while (looking-at "Lisp_Object \\(Q[a-z_]+\\)") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
54 (setq symbol-list |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
55 (cons (buffer-substring (match-beginning 1) (match-end 1)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
56 symbol-list)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
57 (forward-line 1)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
58 (setq symbol-list (nreverse symbol-list)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
59 ;; Delete the section of syms_of_... where we initialize the symbols. |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
60 (search-forward "\n /\*&&& init symbols here &&&*\/\n") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
61 (let ((start (point))) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
62 (while (looking-at "^ Q") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
63 (forward-line 2)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
64 (kill-region start (point))) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
65 ;; Write a new symbol initialization section. |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
66 (while symbol-list |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
67 (insert (format " %s = intern (\"" (car symbol-list))) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
68 (let ((start (point))) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
69 (insert (substring (car symbol-list) 1)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
70 (subst-char-in-region start (point) ?_ ?-)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
71 (insert (format "\");\n staticpro (&%s);\n" (car symbol-list))) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
72 (setq symbol-list (cdr symbol-list))))) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
73 */ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
74 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
75 /*&&& symbols declared here &&&*/ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
76 Lisp_Object Qframep; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
77 Lisp_Object Qlive_frame_p; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
78 Lisp_Object Qheight; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
79 Lisp_Object Qicon; |
539 | 80 Lisp_Object Qminibuffer; |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
81 Lisp_Object Qmodeline; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
82 Lisp_Object Qname; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
83 Lisp_Object Qnone; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
84 Lisp_Object Qonly; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
85 Lisp_Object Qunsplittable; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
86 Lisp_Object Qwidth; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
87 Lisp_Object Qx; |
286 | 88 |
89 extern Lisp_Object Vminibuffer_list; | |
90 extern Lisp_Object get_minibuffer (); | |
91 | |
765 | 92 DEFUN ("framep", Fframep, Sframep, 1, 1, 0, |
93 "Return non-nil if OBJECT is a frame.\n\ | |
94 Value is t for a termcap frame (a character-only terminal),\n\ | |
95 `x' for an Emacs frame that is really an X window.\n\ | |
96 Also see `live-frame-p'.") | |
454 | 97 (object) |
98 Lisp_Object object; | |
286 | 99 { |
765 | 100 if (XTYPE (object) != Lisp_Frame) |
286 | 101 return Qnil; |
765 | 102 switch (XFRAME (object)->output_method) |
286 | 103 { |
104 case output_termcap: | |
105 return Qt; | |
106 case output_x_window: | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
107 return Qx; |
286 | 108 default: |
109 abort (); | |
110 } | |
111 } | |
112 | |
765 | 113 DEFUN ("live-frame-p", Flive_frame_p, Slive_frame_p, 1, 1, 0, |
114 "Return non-nil if OBJECT is a frame which has not been deleted.\n\ | |
115 Value is nil if OBJECT is not a live frame. If object is a live\n\ | |
116 frame, the return value indicates what sort of output device it is\n\ | |
117 displayed on. Value is t for a termcap frame (a character-only\n\ | |
118 terminal), `x' for an Emacs frame being displayed in an X window.") | |
454 | 119 (object) |
120 Lisp_Object object; | |
121 { | |
765 | 122 return ((FRAMEP (object) |
123 && FRAME_LIVE_P (XFRAME (object))) | |
124 ? Fframep (object) | |
454 | 125 : Qnil); |
126 } | |
127 | |
765 | 128 struct frame * |
129 make_frame (mini_p) | |
286 | 130 int mini_p; |
131 { | |
765 | 132 Lisp_Object frame; |
133 register struct frame *f; | |
286 | 134 register Lisp_Object root_window; |
135 register Lisp_Object mini_window; | |
136 | |
765 | 137 frame = Fmake_vector (((sizeof (struct frame) - (sizeof (Lisp_Vector) |
363 | 138 - sizeof (Lisp_Object))) |
139 / sizeof (Lisp_Object)), | |
286 | 140 make_number (0)); |
765 | 141 XSETTYPE (frame, Lisp_Frame); |
142 f = XFRAME (frame); | |
286 | 143 |
765 | 144 f->cursor_x = 0; |
145 f->cursor_y = 0; | |
146 f->current_glyphs = 0; | |
147 f->desired_glyphs = 0; | |
148 f->visible = 0; | |
1652
93497cd89204
* frame.c (make_frame): Initialize async_visible and
Jim Blandy <jimb@redhat.com>
parents:
1514
diff
changeset
|
149 f->async_visible = 0; |
765 | 150 f->display.nothing = 0; |
151 f->iconified = 0; | |
1652
93497cd89204
* frame.c (make_frame): Initialize async_visible and
Jim Blandy <jimb@redhat.com>
parents:
1514
diff
changeset
|
152 f->async_iconified = 0; |
765 | 153 f->wants_modeline = 1; |
154 f->auto_raise = 0; | |
155 f->auto_lower = 0; | |
156 f->no_split = 0; | |
157 f->garbaged = 0; | |
158 f->has_minibuffer = mini_p; | |
159 f->focus_frame = frame; | |
1006
a13ee72d74a2
* frame.c (make_frame): Clear the explicit_name member of the new
Jim Blandy <jimb@redhat.com>
parents:
987
diff
changeset
|
160 f->explicit_name = 0; |
286 | 161 |
765 | 162 f->param_alist = Qnil; |
286 | 163 |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
164 root_window = make_window (); |
286 | 165 if (mini_p) |
166 { | |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
167 mini_window = make_window (); |
286 | 168 XWINDOW (root_window)->next = mini_window; |
169 XWINDOW (mini_window)->prev = root_window; | |
170 XWINDOW (mini_window)->mini_p = Qt; | |
765 | 171 XWINDOW (mini_window)->frame = frame; |
172 f->minibuffer_window = mini_window; | |
286 | 173 } |
174 else | |
175 { | |
176 mini_window = Qnil; | |
177 XWINDOW (root_window)->next = Qnil; | |
765 | 178 f->minibuffer_window = Qnil; |
286 | 179 } |
180 | |
765 | 181 XWINDOW (root_window)->frame = frame; |
286 | 182 |
183 /* 10 is arbitrary, | |
184 just so that there is "something there." | |
765 | 185 Correct size will be set up later with change_frame_size. */ |
286 | 186 |
765 | 187 f->width = 10; |
188 f->height = 10; | |
286 | 189 |
190 XFASTINT (XWINDOW (root_window)->width) = 10; | |
191 XFASTINT (XWINDOW (root_window)->height) = (mini_p ? 9 : 10); | |
192 | |
193 if (mini_p) | |
194 { | |
195 XFASTINT (XWINDOW (mini_window)->width) = 10; | |
196 XFASTINT (XWINDOW (mini_window)->top) = 9; | |
197 XFASTINT (XWINDOW (mini_window)->height) = 1; | |
198 } | |
199 | |
765 | 200 /* Choose a buffer for the frame's root window. */ |
386 | 201 { |
202 Lisp_Object buf; | |
203 | |
204 XWINDOW (root_window)->buffer = Qt; | |
205 buf = Fcurrent_buffer (); | |
206 /* If buf is a 'hidden' buffer (i.e. one whose name starts with | |
207 a space), try to find another one. */ | |
208 if (XSTRING (Fbuffer_name (buf))->data[0] == ' ') | |
1346
5e27c3e71a78
(make_frame): Pass 2nd arg to Fother_buffer.
Richard M. Stallman <rms@gnu.org>
parents:
1260
diff
changeset
|
209 buf = Fother_buffer (buf, Qnil); |
386 | 210 Fset_window_buffer (root_window, buf); |
211 } | |
212 | |
286 | 213 if (mini_p) |
214 { | |
215 XWINDOW (mini_window)->buffer = Qt; | |
216 Fset_window_buffer (mini_window, | |
485 | 217 (NILP (Vminibuffer_list) |
286 | 218 ? get_minibuffer (0) |
219 : Fcar (Vminibuffer_list))); | |
220 } | |
221 | |
765 | 222 f->root_window = root_window; |
223 f->selected_window = root_window; | |
363 | 224 /* Make sure this window seems more recently used than |
225 a newly-created, never-selected window. */ | |
765 | 226 XFASTINT (XWINDOW (f->selected_window)->use_time) = ++window_select_count; |
286 | 227 |
765 | 228 Vframe_list = Fcons (frame, Vframe_list); |
286 | 229 |
765 | 230 return f; |
286 | 231 } |
232 | |
765 | 233 /* Make a frame using a separate minibuffer window on another frame. |
286 | 234 MINI_WINDOW is the minibuffer window to use. nil means use the |
235 default (the global minibuffer). */ | |
236 | |
765 | 237 struct frame * |
238 make_frame_without_minibuffer (mini_window) | |
286 | 239 register Lisp_Object mini_window; |
240 { | |
765 | 241 register struct frame *f; |
286 | 242 |
243 /* Choose the minibuffer window to use. */ | |
485 | 244 if (NILP (mini_window)) |
286 | 245 { |
765 | 246 if (XTYPE (Vdefault_minibuffer_frame) != Lisp_Frame) |
247 error ("default-minibuffer-frame must be set when creating minibufferless frames"); | |
248 if (! FRAME_LIVE_P (XFRAME (Vdefault_minibuffer_frame))) | |
249 error ("default-minibuffer-frame must be a live frame"); | |
250 mini_window = XFRAME (Vdefault_minibuffer_frame)->minibuffer_window; | |
286 | 251 } |
252 else | |
253 { | |
1437
36ef55ecb265
* frame.c (make_frame_without_minibuffer, Fwindow_frame): Use
Jim Blandy <jimb@redhat.com>
parents:
1385
diff
changeset
|
254 CHECK_LIVE_WINDOW (mini_window, 0); |
286 | 255 } |
256 | |
765 | 257 /* Make a frame containing just a root window. */ |
258 f = make_frame (0); | |
286 | 259 |
260 /* Install the chosen minibuffer window, with proper buffer. */ | |
765 | 261 f->minibuffer_window = mini_window; |
286 | 262 Fset_window_buffer (mini_window, |
485 | 263 (NILP (Vminibuffer_list) |
286 | 264 ? get_minibuffer (0) |
265 : Fcar (Vminibuffer_list))); | |
765 | 266 return f; |
286 | 267 } |
268 | |
765 | 269 /* Make a frame containing only a minibuffer window. */ |
286 | 270 |
765 | 271 struct frame * |
272 make_minibuffer_frame () | |
286 | 273 { |
765 | 274 /* First make a frame containing just a root window, no minibuffer. */ |
286 | 275 |
765 | 276 register struct frame *f = make_frame (0); |
286 | 277 register Lisp_Object mini_window; |
765 | 278 register Lisp_Object frame; |
286 | 279 |
765 | 280 XSET (frame, Lisp_Frame, f); |
286 | 281 |
1006
a13ee72d74a2
* frame.c (make_frame): Clear the explicit_name member of the new
Jim Blandy <jimb@redhat.com>
parents:
987
diff
changeset
|
282 f->auto_raise = 0; |
765 | 283 f->auto_lower = 0; |
284 f->no_split = 1; | |
285 f->wants_modeline = 0; | |
286 f->has_minibuffer = 1; | |
286 | 287 |
288 /* Now label the root window as also being the minibuffer. | |
289 Avoid infinite looping on the window chain by marking next pointer | |
290 as nil. */ | |
291 | |
765 | 292 mini_window = f->minibuffer_window = f->root_window; |
286 | 293 XWINDOW (mini_window)->mini_p = Qt; |
294 XWINDOW (mini_window)->next = Qnil; | |
1006
a13ee72d74a2
* frame.c (make_frame): Clear the explicit_name member of the new
Jim Blandy <jimb@redhat.com>
parents:
987
diff
changeset
|
295 XWINDOW (mini_window)->prev = Qnil; |
765 | 296 XWINDOW (mini_window)->frame = frame; |
286 | 297 |
298 /* Put the proper buffer in that window. */ | |
299 | |
300 Fset_window_buffer (mini_window, | |
485 | 301 (NILP (Vminibuffer_list) |
286 | 302 ? get_minibuffer (0) |
303 : Fcar (Vminibuffer_list))); | |
765 | 304 return f; |
286 | 305 } |
306 | |
765 | 307 /* Construct a frame that refers to the terminal (stdin and stdout). */ |
286 | 308 |
765 | 309 struct frame * |
310 make_terminal_frame () | |
286 | 311 { |
765 | 312 register struct frame *f; |
286 | 313 |
765 | 314 Vframe_list = Qnil; |
315 f = make_frame (1); | |
316 f->name = build_string ("terminal"); | |
317 f->visible = 1; | |
318 f->display.nothing = 1; /* Nonzero means frame isn't deleted. */ | |
319 XSET (Vterminal_frame, Lisp_Frame, f); | |
320 return f; | |
286 | 321 } |
322 | |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
323 DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 2, "e", |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
324 "Select the frame FRAME. FRAME's selected window becomes \"the\"\n\ |
363 | 325 selected window. If the optional parameter NO-ENTER is non-nil, don't\n\ |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
326 focus on that frame.\n\ |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
327 \n\ |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
328 This function is interactive, and may be bound to the ``switch-frame''\n\ |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
329 event; when invoked this way, it switches to the frame named in the\n\ |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
330 event. When called from lisp, FRAME may be a ``switch-frame'' event;\n\ |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
331 if it is, select the frame named in the event.") |
765 | 332 (frame, no_enter) |
333 Lisp_Object frame, no_enter; | |
286 | 334 { |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
335 /* If FRAME is a switch-frame event, extract the frame we should |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
336 switch to. */ |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
337 if (CONSP (frame) |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
338 && EQ (XCONS (frame)->car, Qswitch_frame) |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
339 && CONSP (XCONS (frame)->cdr)) |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
340 frame = XCONS (XCONS (frame)->cdr)->car; |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
341 |
765 | 342 CHECK_LIVE_FRAME (frame, 0); |
286 | 343 |
765 | 344 if (selected_frame == XFRAME (frame)) |
345 return frame; | |
286 | 346 |
765 | 347 selected_frame = XFRAME (frame); |
348 if (! FRAME_MINIBUF_ONLY_P (selected_frame)) | |
349 last_nonminibuf_frame = selected_frame; | |
363 | 350 |
765 | 351 Fselect_window (XFRAME (frame)->selected_window); |
286 | 352 |
353 #ifdef HAVE_X_WINDOWS | |
765 | 354 #ifdef MULTI_FRAME |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
355 if (FRAME_X_P (XFRAME (frame)) |
485 | 356 && NILP (no_enter)) |
286 | 357 { |
765 | 358 Ffocus_frame (frame); |
286 | 359 } |
360 #endif | |
361 #endif | |
765 | 362 choose_minibuf_frame (); |
286 | 363 |
765 | 364 return frame; |
286 | 365 } |
366 | |
765 | 367 DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0, |
368 "Return the frame that is now selected.") | |
286 | 369 () |
370 { | |
371 Lisp_Object tem; | |
765 | 372 XSET (tem, Lisp_Frame, selected_frame); |
286 | 373 return tem; |
374 } | |
375 | |
765 | 376 DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0, |
377 "Return the frame object that window WINDOW is on.") | |
286 | 378 (window) |
379 Lisp_Object window; | |
380 { | |
1437
36ef55ecb265
* frame.c (make_frame_without_minibuffer, Fwindow_frame): Use
Jim Blandy <jimb@redhat.com>
parents:
1385
diff
changeset
|
381 CHECK_LIVE_WINDOW (window, 0); |
765 | 382 return XWINDOW (window)->frame; |
286 | 383 } |
384 | |
765 | 385 DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0, |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
386 "Returns the root-window of FRAME.\n\ |
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
387 If omitted, FRAME defaults to the currently selected frame.") |
765 | 388 (frame) |
389 Lisp_Object frame; | |
286 | 390 { |
765 | 391 if (NILP (frame)) |
392 XSET (frame, Lisp_Frame, selected_frame); | |
454 | 393 else |
765 | 394 CHECK_LIVE_FRAME (frame, 0); |
286 | 395 |
765 | 396 return XFRAME (frame)->root_window; |
286 | 397 } |
398 | |
765 | 399 DEFUN ("frame-selected-window", Fframe_selected_window, |
400 Sframe_selected_window, 0, 1, 0, | |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
401 "Return the selected window of frame object FRAME.\n\ |
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
402 If omitted, FRAME defaults to the currently selected frame.") |
765 | 403 (frame) |
404 Lisp_Object frame; | |
286 | 405 { |
765 | 406 if (NILP (frame)) |
407 XSET (frame, Lisp_Frame, selected_frame); | |
454 | 408 else |
765 | 409 CHECK_LIVE_FRAME (frame, 0); |
286 | 410 |
765 | 411 return XFRAME (frame)->selected_window; |
286 | 412 } |
413 | |
765 | 414 DEFUN ("frame-list", Fframe_list, Sframe_list, |
286 | 415 0, 0, 0, |
765 | 416 "Return a list of all frames.") |
286 | 417 () |
418 { | |
765 | 419 return Fcopy_sequence (Vframe_list); |
286 | 420 } |
421 | |
765 | 422 #ifdef MULTI_FRAME |
454 | 423 |
765 | 424 /* Return the next frame in the frame list after FRAME. |
425 If MINIBUF is nil, exclude minibuffer-only frames. | |
426 If MINIBUF is a window, include only frames using that window for | |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
427 their minibuffer. |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
428 If MINIBUF is non-nil, and not a window, include all frames. */ |
286 | 429 Lisp_Object |
765 | 430 next_frame (frame, minibuf) |
431 Lisp_Object frame; | |
454 | 432 Lisp_Object minibuf; |
286 | 433 { |
434 Lisp_Object tail; | |
435 int passed = 0; | |
436 | |
765 | 437 /* There must always be at least one frame in Vframe_list. */ |
438 if (! CONSP (Vframe_list)) | |
454 | 439 abort (); |
440 | |
286 | 441 while (1) |
765 | 442 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr) |
286 | 443 { |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
444 Lisp_Object f = XCONS (tail)->car; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
445 |
286 | 446 if (passed) |
363 | 447 { |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
448 /* Decide whether this frame is eligible to be returned. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
449 |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
450 /* If we've looped all the way around without finding any |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
451 eligible frames, return the original frame. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
452 if (EQ (f, frame)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
453 return f; |
335 | 454 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
455 /* Let minibuf decide if this frame is acceptable. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
456 if (NILP (minibuf)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
457 { |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
458 if (! FRAME_MINIBUF_ONLY_P (XFRAME (f))) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
459 return f; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
460 } |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
461 else if (XTYPE (minibuf) == Lisp_Window) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
462 { |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
463 if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
464 return f; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
465 } |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
466 else |
765 | 467 return f; |
363 | 468 } |
286 | 469 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
470 if (EQ (frame, f)) |
286 | 471 passed++; |
472 } | |
473 } | |
474 | |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
475 #if 0 |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
476 /* Nobody seems to be using this code right now. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
477 |
765 | 478 /* Return the previous frame in the frame list before FRAME. |
479 If MINIBUF is nil, exclude minibuffer-only frames. | |
480 If MINIBUF is a window, include only frames using that window for | |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
481 their minibuffer. |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
482 If MINIBUF is non-nil and not a window, include all frames. */ |
286 | 483 Lisp_Object |
765 | 484 prev_frame (frame, minibuf) |
485 Lisp_Object frame; | |
454 | 486 Lisp_Object minibuf; |
286 | 487 { |
488 Lisp_Object tail; | |
489 Lisp_Object prev; | |
490 | |
765 | 491 /* There must always be at least one frame in Vframe_list. */ |
492 if (! CONSP (Vframe_list)) | |
454 | 493 abort (); |
494 | |
286 | 495 prev = Qnil; |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
496 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr) |
454 | 497 { |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
498 Lisp_Object f = XCONS (tail)->car; |
454 | 499 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
500 if (XTYPE (f) != Lisp_Frame) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
501 abort (); |
454 | 502 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
503 if (EQ (frame, f) && !NILP (prev)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
504 return prev; |
454 | 505 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
506 /* Decide whether this frame is eligible to be returned, |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
507 according to minibuf. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
508 if (NILP (minibuf)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
509 { |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
510 if (! FRAME_MINIBUF_ONLY_P (XFRAME (f))) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
511 prev = f; |
454 | 512 } |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
513 else if (XTYPE (minibuf) == Lisp_Window) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
514 { |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
515 if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
516 prev = f; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
517 } |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
518 else |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
519 prev = f; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
520 } |
454 | 521 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
522 /* We've scanned the entire list. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
523 if (NILP (prev)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
524 /* We went through the whole frame list without finding a single |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
525 acceptable frame. Return the original frame. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
526 return frame; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
527 else |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
528 /* There were no acceptable frames in the list before FRAME; otherwise, |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
529 we would have returned directly from the loop. Since PREV is the last |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
530 acceptable frame in the list, return it. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
531 return prev; |
286 | 532 } |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
533 #endif |
286 | 534 |
765 | 535 DEFUN ("next-frame", Fnext_frame, Snext_frame, 0, 2, 0, |
536 "Return the next frame in the frame list after FRAME.\n\ | |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
537 By default, skip minibuffer-only frames. |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
538 If omitted, FRAME defaults to the selected frame.\n\ |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
539 If optional argument MINIFRAME is non-nil, include minibuffer-only frames.\n\ |
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
540 If MINIFRAME is a window, include only frames using that window for their\n\ |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
541 minibuffer.\n\ |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
542 If MINIFRAME is non-nil and not a window, include all frames.") |
765 | 543 (frame, miniframe) |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
544 Lisp_Object frame, miniframe; |
286 | 545 { |
546 Lisp_Object tail; | |
547 | |
765 | 548 if (NILP (frame)) |
549 XSET (frame, Lisp_Frame, selected_frame); | |
454 | 550 else |
765 | 551 CHECK_LIVE_FRAME (frame, 0); |
286 | 552 |
765 | 553 return next_frame (frame, miniframe); |
286 | 554 } |
765 | 555 #endif /* MULTI_FRAME */ |
286 | 556 |
765 | 557 DEFUN ("delete-frame", Fdelete_frame, Sdelete_frame, 0, 1, "", |
558 "Delete FRAME, permanently eliminating it from use.\n\ | |
559 If omitted, FRAME defaults to the selected frame.\n\ | |
560 A frame may not be deleted if its minibuffer is used by other frames.") | |
561 (frame) | |
562 Lisp_Object frame; | |
286 | 563 { |
765 | 564 struct frame *f; |
286 | 565 union display displ; |
566 | |
765 | 567 if (EQ (frame, Qnil)) |
286 | 568 { |
765 | 569 f = selected_frame; |
570 XSET (frame, Lisp_Frame, f); | |
286 | 571 } |
572 else | |
573 { | |
765 | 574 CHECK_FRAME (frame, 0); |
575 f = XFRAME (frame); | |
286 | 576 } |
577 | |
765 | 578 if (! FRAME_LIVE_P (f)) |
454 | 579 return; |
580 | |
765 | 581 /* Are there any other frames besides this one? */ |
582 if (f == selected_frame && EQ (next_frame (frame, Qt), frame)) | |
583 error ("Attempt to delete the only frame"); | |
286 | 584 |
765 | 585 /* Does this frame have a minibuffer, and is it the surrogate |
586 minibuffer for any other frame? */ | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
587 if (FRAME_HAS_MINIBUF_P (XFRAME (frame))) |
363 | 588 { |
765 | 589 Lisp_Object frames; |
708 | 590 |
765 | 591 for (frames = Vframe_list; |
592 CONSP (frames); | |
593 frames = XCONS (frames)->cdr) | |
708 | 594 { |
765 | 595 Lisp_Object this = XCONS (frames)->car; |
363 | 596 |
765 | 597 if (! EQ (this, frame) |
598 && EQ (frame, | |
599 (WINDOW_FRAME | |
708 | 600 (XWINDOW |
765 | 601 (FRAME_MINIBUF_WINDOW |
602 (XFRAME (this))))))) | |
603 error ("Attempt to delete a surrogate minibuffer frame"); | |
708 | 604 } |
286 | 605 } |
606 | |
765 | 607 /* Don't let the frame remain selected. */ |
608 if (f == selected_frame) | |
1260
a2d017a57391
* frame.c (Fdelete_frame): Call Fselect_frame with the appropriate
Jim Blandy <jimb@redhat.com>
parents:
1251
diff
changeset
|
609 Fselect_frame (next_frame (frame, Qt), Qnil); |
286 | 610 |
765 | 611 /* Don't allow minibuf_window to remain on a deleted frame. */ |
612 if (EQ (f->minibuffer_window, minibuf_window)) | |
286 | 613 { |
765 | 614 Fset_window_buffer (selected_frame->minibuffer_window, |
286 | 615 XWINDOW (minibuf_window)->buffer); |
765 | 616 minibuf_window = selected_frame->minibuffer_window; |
286 | 617 } |
618 | |
1680
ea9f3949f153
* frame.c (Fdelete_frame): Delete all the windows in the frame's
Jim Blandy <jimb@redhat.com>
parents:
1652
diff
changeset
|
619 /* Mark all the windows that used to be on FRAME as deleted, and then |
ea9f3949f153
* frame.c (Fdelete_frame): Delete all the windows in the frame's
Jim Blandy <jimb@redhat.com>
parents:
1652
diff
changeset
|
620 remove the reference to them. */ |
ea9f3949f153
* frame.c (Fdelete_frame): Delete all the windows in the frame's
Jim Blandy <jimb@redhat.com>
parents:
1652
diff
changeset
|
621 delete_all_subwindows (XWINDOW (f->root_window)); |
ea9f3949f153
* frame.c (Fdelete_frame): Delete all the windows in the frame's
Jim Blandy <jimb@redhat.com>
parents:
1652
diff
changeset
|
622 f->root_window = Qnil; |
ea9f3949f153
* frame.c (Fdelete_frame): Delete all the windows in the frame's
Jim Blandy <jimb@redhat.com>
parents:
1652
diff
changeset
|
623 |
765 | 624 Vframe_list = Fdelq (frame, Vframe_list); |
625 f->visible = 0; | |
626 displ = f->display; | |
627 f->display.nothing = 0; | |
286 | 628 |
363 | 629 #ifdef HAVE_X_WINDOWS |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
630 if (FRAME_X_P (f)) |
765 | 631 x_destroy_window (f, displ); |
363 | 632 #endif |
633 | |
765 | 634 /* If we've deleted the last_nonminibuf_frame, then try to find |
363 | 635 another one. */ |
765 | 636 if (f == last_nonminibuf_frame) |
363 | 637 { |
765 | 638 Lisp_Object frames; |
708 | 639 |
765 | 640 last_nonminibuf_frame = 0; |
363 | 641 |
765 | 642 for (frames = Vframe_list; |
643 CONSP (frames); | |
644 frames = XCONS (frames)->cdr) | |
363 | 645 { |
765 | 646 f = XFRAME (XCONS (frames)->car); |
647 if (!FRAME_MINIBUF_ONLY_P (f)) | |
363 | 648 { |
765 | 649 last_nonminibuf_frame = f; |
363 | 650 break; |
651 } | |
652 } | |
653 } | |
286 | 654 |
765 | 655 /* If we've deleted Vdefault_minibuffer_frame, try to find another |
656 one. Prefer minibuffer-only frames, but also notice frames | |
708 | 657 with other windows. */ |
765 | 658 if (EQ (frame, Vdefault_minibuffer_frame)) |
708 | 659 { |
765 | 660 Lisp_Object frames; |
708 | 661 |
765 | 662 /* The last frame we saw with a minibuffer, minibuffer-only or not. */ |
663 Lisp_Object frame_with_minibuf = Qnil; | |
708 | 664 |
765 | 665 for (frames = Vframe_list; |
666 CONSP (frames); | |
667 frames = XCONS (frames)->cdr) | |
708 | 668 { |
765 | 669 Lisp_Object this = XCONS (frames)->car; |
708 | 670 |
765 | 671 if (XTYPE (this) != Lisp_Frame) |
708 | 672 abort (); |
765 | 673 f = XFRAME (this); |
708 | 674 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
675 if (FRAME_HAS_MINIBUF_P (f)) |
708 | 676 { |
765 | 677 frame_with_minibuf = this; |
678 if (FRAME_MINIBUF_ONLY_P (f)) | |
708 | 679 break; |
680 } | |
681 } | |
682 | |
765 | 683 /* We know that there must be some frame with a minibuffer out |
684 there. If this were not true, all of the frames present | |
708 | 685 would have to be minibufferless, which implies that at some |
765 | 686 point their minibuffer frames must have been deleted, but |
708 | 687 that is prohibited at the top; you can't delete surrogate |
765 | 688 minibuffer frames. */ |
689 if (NILP (frame_with_minibuf)) | |
708 | 690 abort (); |
691 | |
765 | 692 Vdefault_minibuffer_frame = frame_with_minibuf; |
708 | 693 } |
694 | |
286 | 695 return Qnil; |
696 } | |
697 | |
698 /* Return mouse position in character cell units. */ | |
699 | |
454 | 700 DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0, |
765 | 701 "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\ |
454 | 702 If Emacs is running on a mouseless terminal or hasn't been programmed\n\ |
765 | 703 to read the mouse position, it returns the selected frame for FRAME\n\ |
454 | 704 and nil for X and Y.") |
705 () | |
286 | 706 { |
454 | 707 Lisp_Object x, y, dummy; |
765 | 708 FRAME_PTR f; |
286 | 709 |
454 | 710 if (mouse_position_hook) |
765 | 711 (*mouse_position_hook) (&f, &x, &y, &dummy); |
454 | 712 else |
713 { | |
765 | 714 f = selected_frame; |
454 | 715 x = y = Qnil; |
716 } | |
286 | 717 |
765 | 718 XSET (dummy, Lisp_Frame, f); |
454 | 719 return Fcons (dummy, Fcons (make_number (x), make_number (y))); |
286 | 720 } |
721 | |
722 DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0, | |
765 | 723 "Move the mouse pointer to the center of cell (X,Y) in FRAME.\n\ |
724 WARNING: If you use this under X, you should do `unfocus-frame' afterwards.") | |
725 (frame, x, y) | |
726 Lisp_Object frame, x, y; | |
286 | 727 { |
765 | 728 CHECK_LIVE_FRAME (frame, 0); |
286 | 729 CHECK_NUMBER (x, 2); |
730 CHECK_NUMBER (y, 1); | |
731 | |
732 #ifdef HAVE_X_WINDOWS | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
733 if (FRAME_X_P (XFRAME (frame))) |
286 | 734 /* Warping the mouse will cause enternotify and focus events. */ |
765 | 735 x_set_mouse_position (XFRAME (frame), x, y); |
286 | 736 #endif |
737 | |
738 return Qnil; | |
739 } | |
740 | |
741 #if 0 | |
742 /* ??? Can this be replaced with a Lisp function? | |
756 | 743 It is used in minibuf.c. Can we get rid of that? |
744 Yes. All uses in minibuf.c are gone, and parallels to these | |
765 | 745 functions have been defined in frame.el. */ |
286 | 746 |
765 | 747 DEFUN ("frame-configuration", Fframe_configuration, Sframe_configuration, |
286 | 748 0, 0, 0, |
765 | 749 "Return object describing current frame configuration.\n\ |
750 The frame configuration is the current mouse position and selected frame.\n\ | |
751 This object can be given to `restore-frame-configuration'\n\ | |
752 to restore this frame configuration.") | |
286 | 753 () |
754 { | |
454 | 755 Lisp_Object c, time; |
286 | 756 |
454 | 757 c = Fmake_vector (make_number(4), Qnil); |
765 | 758 XVECTOR (c)->contents[0] = Fselected_frame(); |
454 | 759 if (mouse_position_hook) |
760 (*mouse_position_hook) (&XVECTOR (c)->contents[1] | |
761 &XVECTOR (c)->contents[2], | |
762 &XVECTOR (c)->contents[3], | |
763 &time); | |
286 | 764 return c; |
765 } | |
766 | |
765 | 767 DEFUN ("restore-frame-configuration", Frestore_frame_configuration, |
768 Srestore_frame_configuration, | |
286 | 769 1, 1, 0, |
765 | 770 "Restores frame configuration CONFIGURATION.") |
286 | 771 (config) |
772 Lisp_Object config; | |
773 { | |
765 | 774 Lisp_Object x_pos, y_pos, frame; |
286 | 775 |
776 CHECK_VECTOR (config, 0); | |
777 if (XVECTOR (config)->size != 3) | |
778 { | |
765 | 779 error ("Wrong size vector passed to restore-frame-configuration"); |
286 | 780 } |
765 | 781 frame = XVECTOR (config)->contents[0]; |
782 CHECK_LIVE_FRAME (frame, 0); | |
286 | 783 |
765 | 784 Fselect_frame (frame, Qnil); |
286 | 785 |
786 #if 0 | |
765 | 787 /* This seems to interfere with the frame selection mechanism. jla */ |
454 | 788 x_pos = XVECTOR (config)->contents[2]; |
789 y_pos = XVECTOR (config)->contents[3]; | |
765 | 790 set_mouse_position (frame, XINT (x_pos), XINT (y_pos)); |
286 | 791 #endif |
792 | |
765 | 793 return frame; |
286 | 794 } |
795 #endif | |
796 | |
765 | 797 DEFUN ("make-frame-visible", Fmake_frame_visible, Smake_frame_visible, |
872 | 798 0, 1, 0, |
765 | 799 "Make the frame FRAME visible (assuming it is an X-window).\n\ |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
800 Also raises the frame so that nothing obscures it.\n\ |
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
801 If omitted, FRAME defaults to the currently selected frame.") |
765 | 802 (frame) |
803 Lisp_Object frame; | |
286 | 804 { |
872 | 805 if (NILP (frame)) |
886 | 806 XSET (frame, Lisp_Frame, selected_frame); |
872 | 807 |
765 | 808 CHECK_LIVE_FRAME (frame, 0); |
286 | 809 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
810 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
811 if (FRAME_X_P (XFRAME (frame))) |
765 | 812 x_make_frame_visible (XFRAME (frame)); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
813 #endif |
286 | 814 |
765 | 815 return frame; |
286 | 816 } |
817 | |
765 | 818 DEFUN ("make-frame-invisible", Fmake_frame_invisible, Smake_frame_invisible, |
872 | 819 0, 1, "", |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
820 "Make the frame FRAME invisible (assuming it is an X-window).\n\ |
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
821 If omitted, FRAME defaults to the currently selected frame.") |
765 | 822 (frame) |
823 Lisp_Object frame; | |
286 | 824 { |
872 | 825 if (NILP (frame)) |
886 | 826 XSET (frame, Lisp_Frame, selected_frame); |
872 | 827 |
765 | 828 CHECK_LIVE_FRAME (frame, 0); |
286 | 829 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
830 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
831 if (FRAME_X_P (XFRAME (frame))) |
765 | 832 x_make_frame_invisible (XFRAME (frame)); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
833 #endif |
286 | 834 |
835 return Qnil; | |
836 } | |
837 | |
765 | 838 DEFUN ("iconify-frame", Ficonify_frame, Siconify_frame, |
872 | 839 0, 1, "", |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
840 "Make the frame FRAME into an icon.\n\ |
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
841 If omitted, FRAME defaults to the currently selected frame.") |
765 | 842 (frame) |
843 Lisp_Object frame; | |
286 | 844 { |
872 | 845 if (NILP (frame)) |
886 | 846 XSET (frame, Lisp_Frame, selected_frame); |
872 | 847 |
765 | 848 CHECK_LIVE_FRAME (frame, 0); |
286 | 849 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
850 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
851 if (FRAME_X_P (XFRAME (frame))) |
765 | 852 x_iconify_frame (XFRAME (frame)); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
853 #endif |
286 | 854 |
855 return Qnil; | |
856 } | |
857 | |
765 | 858 DEFUN ("frame-visible-p", Fframe_visible_p, Sframe_visible_p, |
286 | 859 1, 1, 0, |
765 | 860 "Return t if FRAME is now \"visible\" (actually in use for display).\n\ |
861 A frame that is not \"visible\" is not updated and, if it works through\n\ | |
286 | 862 a window system, it may not show at all.\n\ |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
863 Return the symbol `icon' if frame is visible only as an icon.") |
765 | 864 (frame) |
865 Lisp_Object frame; | |
286 | 866 { |
765 | 867 CHECK_LIVE_FRAME (frame, 0); |
286 | 868 |
765 | 869 if (XFRAME (frame)->visible) |
286 | 870 return Qt; |
765 | 871 if (XFRAME (frame)->iconified) |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
872 return Qicon; |
286 | 873 return Qnil; |
874 } | |
875 | |
765 | 876 DEFUN ("visible-frame-list", Fvisible_frame_list, Svisible_frame_list, |
286 | 877 0, 0, 0, |
765 | 878 "Return a list of all frames now \"visible\" (being updated).") |
286 | 879 () |
880 { | |
765 | 881 Lisp_Object tail, frame; |
882 struct frame *f; | |
286 | 883 Lisp_Object value; |
884 | |
885 value = Qnil; | |
765 | 886 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr) |
286 | 887 { |
765 | 888 frame = XCONS (tail)->car; |
889 if (XTYPE (frame) != Lisp_Frame) | |
286 | 890 continue; |
765 | 891 f = XFRAME (frame); |
892 if (f->visible) | |
893 value = Fcons (frame, value); | |
286 | 894 } |
895 return value; | |
896 } | |
363 | 897 |
898 | |
899 | |
765 | 900 DEFUN ("redirect-frame-focus", Fredirect_frame_focus, Sredirect_frame_focus, |
363 | 901 1, 2, 0, |
765 | 902 "Arrange for keystrokes typed at FRAME to be sent to FOCUS-FRAME.\n\ |
903 This means that, after reading a keystroke typed at FRAME,\n\ | |
904 `last-event-frame' will be FOCUS-FRAME.\n\ | |
363 | 905 \n\ |
765 | 906 If FOCUS-FRAME is omitted or eq to FRAME, any existing redirection is\n\ |
907 cancelled, and the frame again receives its own keystrokes.\n\ | |
363 | 908 \n\ |
765 | 909 The redirection lasts until the next call to `redirect-frame-focus'\n\ |
910 or `select-frame'.\n\ | |
363 | 911 \n\ |
912 This is useful for temporarily redirecting keystrokes to the minibuffer\n\ | |
765 | 913 window when a frame doesn't have its own minibuffer.") |
914 (frame, focus_frame) | |
915 Lisp_Object frame, focus_frame; | |
363 | 916 { |
765 | 917 CHECK_LIVE_FRAME (frame, 0); |
454 | 918 |
765 | 919 if (NILP (focus_frame)) |
920 focus_frame = frame; | |
363 | 921 else |
765 | 922 CHECK_LIVE_FRAME (focus_frame, 1); |
363 | 923 |
765 | 924 XFRAME (frame)->focus_frame = focus_frame; |
363 | 925 |
765 | 926 if (frame_rehighlight_hook) |
927 (*frame_rehighlight_hook) (); | |
363 | 928 |
929 return Qnil; | |
930 } | |
931 | |
932 | |
765 | 933 DEFUN ("frame-focus", Fframe_focus, Sframe_focus, 1, 1, 0, |
934 "Return the frame to which FRAME's keystrokes are currently being sent.\n\ | |
935 See `redirect-frame-focus'.") | |
936 (frame) | |
937 Lisp_Object frame; | |
363 | 938 { |
765 | 939 CHECK_LIVE_FRAME (frame, 0); |
940 return FRAME_FOCUS_FRAME (XFRAME (frame)); | |
363 | 941 } |
942 | |
943 | |
286 | 944 |
945 Lisp_Object | |
765 | 946 get_frame_param (frame, prop) |
947 register struct frame *frame; | |
286 | 948 Lisp_Object prop; |
949 { | |
950 register Lisp_Object tem; | |
951 | |
765 | 952 tem = Fassq (prop, frame->param_alist); |
286 | 953 if (EQ (tem, Qnil)) |
954 return tem; | |
955 return Fcdr (tem); | |
956 } | |
957 | |
958 void | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
959 store_in_alist (alistptr, prop, val) |
286 | 960 Lisp_Object *alistptr, val; |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
961 Lisp_Object prop; |
286 | 962 { |
963 register Lisp_Object tem; | |
964 | |
965 tem = Fassq (prop, *alistptr); | |
966 if (EQ (tem, Qnil)) | |
967 *alistptr = Fcons (Fcons (prop, val), *alistptr); | |
968 else | |
969 Fsetcdr (tem, val); | |
970 } | |
971 | |
972 void | |
765 | 973 store_frame_param (f, prop, val) |
974 struct frame *f; | |
286 | 975 Lisp_Object prop, val; |
976 { | |
977 register Lisp_Object tem; | |
978 | |
765 | 979 tem = Fassq (prop, f->param_alist); |
286 | 980 if (EQ (tem, Qnil)) |
765 | 981 f->param_alist = Fcons (Fcons (prop, val), f->param_alist); |
286 | 982 else |
983 Fsetcdr (tem, val); | |
539 | 984 |
985 if (EQ (prop, Qminibuffer) | |
986 && XTYPE (val) == Lisp_Window) | |
987 { | |
988 if (! MINI_WINDOW_P (XWINDOW (val))) | |
989 error ("Surrogate minibuffer windows must be minibuffer windows."); | |
990 | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
991 if (FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f)) |
765 | 992 error ("Can't change the surrogate minibuffer of a frame with its own minibuffer."); |
539 | 993 |
994 /* Install the chosen minibuffer window, with proper buffer. */ | |
765 | 995 f->minibuffer_window = val; |
539 | 996 } |
286 | 997 } |
998 | |
765 | 999 DEFUN ("frame-parameters", Fframe_parameters, Sframe_parameters, 0, 1, 0, |
1000 "Return the parameters-alist of frame FRAME.\n\ | |
286 | 1001 It is a list of elements of the form (PARM . VALUE), where PARM is a symbol.\n\ |
777 | 1002 The meaningful PARMs depend on the kind of frame.\n\ |
1003 If FRAME is omitted, return information on the currently selected frame.") | |
765 | 1004 (frame) |
1005 Lisp_Object frame; | |
286 | 1006 { |
1007 Lisp_Object alist; | |
765 | 1008 struct frame *f; |
286 | 1009 |
765 | 1010 if (EQ (frame, Qnil)) |
1011 f = selected_frame; | |
286 | 1012 else |
1013 { | |
765 | 1014 CHECK_FRAME (frame, 0); |
1015 f = XFRAME (frame); | |
286 | 1016 } |
1017 | |
765 | 1018 if (f->display.nothing == 0) |
286 | 1019 return Qnil; |
1020 | |
765 | 1021 alist = Fcopy_alist (f->param_alist); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1022 store_in_alist (&alist, Qname, f->name); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1023 store_in_alist (&alist, Qheight, make_number (f->height)); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1024 store_in_alist (&alist, Qwidth, make_number (f->width)); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1025 store_in_alist (&alist, Qmodeline, (f->wants_modeline ? Qt : Qnil)); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1026 store_in_alist (&alist, Qminibuffer, |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1027 (! FRAME_HAS_MINIBUF_P (f) ? Qnone |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1028 : (FRAME_MINIBUF_ONLY_P (f) ? Qonly |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1029 : FRAME_MINIBUF_WINDOW (f)))); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1030 store_in_alist (&alist, Qunsplittable, (f->no_split ? Qt : Qnil)); |
286 | 1031 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1032 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1033 if (FRAME_X_P (f)) |
765 | 1034 x_report_frame_params (f, &alist); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1035 #endif |
286 | 1036 return alist; |
1037 } | |
1038 | |
765 | 1039 DEFUN ("modify-frame-parameters", Fmodify_frame_parameters, |
1040 Smodify_frame_parameters, 2, 2, 0, | |
1041 "Modify the parameters of frame FRAME according to ALIST.\n\ | |
286 | 1042 ALIST is an alist of parameters to change and their new values.\n\ |
1043 Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.\n\ | |
765 | 1044 The meaningful PARMs depend on the kind of frame; undefined PARMs are ignored.") |
1045 (frame, alist) | |
1046 Lisp_Object frame, alist; | |
286 | 1047 { |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1048 FRAME_PTR f; |
286 | 1049 register Lisp_Object tail, elt, prop, val; |
1050 | |
765 | 1051 if (EQ (frame, Qnil)) |
1052 f = selected_frame; | |
286 | 1053 else |
1054 { | |
765 | 1055 CHECK_LIVE_FRAME (frame, 0); |
1056 f = XFRAME (frame); | |
286 | 1057 } |
1058 | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1059 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1060 if (FRAME_X_P (f)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1061 #if 1 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1062 x_set_frame_parameters (f, alist); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1063 #else |
286 | 1064 for (tail = alist; !EQ (tail, Qnil); tail = Fcdr (tail)) |
1065 { | |
1066 elt = Fcar (tail); | |
1067 prop = Fcar (elt); | |
1068 val = Fcdr (elt); | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1069 x_set_frame_param (f, prop, val, get_frame_param (f, prop)); |
765 | 1070 store_frame_param (f, prop, val); |
286 | 1071 } |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1072 #endif |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1073 #endif |
286 | 1074 |
1075 return Qnil; | |
1076 } | |
1077 | |
1078 | |
777 | 1079 #if 0 |
1080 /* This function isn't useful enough by itself to include; we need to | |
1081 add functions to allow the user to find the size of a font before | |
1082 this is actually useful. */ | |
1083 | |
765 | 1084 DEFUN ("frame-pixel-size", Fframe_pixel_size, |
1085 Sframe_pixel_size, 1, 1, 0, | |
1086 "Return a cons (width . height) of FRAME's size in pixels.") | |
1087 (frame) | |
1088 Lisp_Object frame; | |
286 | 1089 { |
765 | 1090 register struct frame *f; |
286 | 1091 int width, height; |
1092 | |
765 | 1093 CHECK_LIVE_FRAME (frame, 0); |
1094 f = XFRAME (frame); | |
286 | 1095 |
765 | 1096 return Fcons (make_number (x_pixel_width (f)), |
1097 make_number (x_pixel_height (f))); | |
286 | 1098 } |
777 | 1099 #endif |
1100 | |
1101 #if 0 | |
1102 /* These functions have no C callers, and can be written nicely in lisp. */ | |
286 | 1103 |
765 | 1104 DEFUN ("frame-height", Fframe_height, Sframe_height, 0, 0, 0, |
1105 "Return number of lines available for display on selected frame.") | |
286 | 1106 () |
1107 { | |
765 | 1108 return make_number (FRAME_HEIGHT (selected_frame)); |
286 | 1109 } |
1110 | |
765 | 1111 DEFUN ("frame-width", Fframe_width, Sframe_width, 0, 0, 0, |
1112 "Return number of columns available for display on selected frame.") | |
286 | 1113 () |
1114 { | |
765 | 1115 return make_number (FRAME_WIDTH (selected_frame)); |
286 | 1116 } |
777 | 1117 #endif |
286 | 1118 |
765 | 1119 DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0, |
1120 "Specify that the frame FRAME has LINES lines.\n\ | |
286 | 1121 Optional third arg non-nil means that redisplay should use LINES lines\n\ |
765 | 1122 but that the idea of the actual height of the frame should not be changed.") |
1123 (frame, rows, pretend) | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1124 Lisp_Object frame, rows, pretend; |
286 | 1125 { |
765 | 1126 register struct frame *f; |
286 | 1127 |
1128 CHECK_NUMBER (rows, 0); | |
765 | 1129 if (NILP (frame)) |
1130 f = selected_frame; | |
286 | 1131 else |
1132 { | |
765 | 1133 CHECK_LIVE_FRAME (frame, 0); |
1134 f = XFRAME (frame); | |
286 | 1135 } |
1136 | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1137 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1138 if (FRAME_X_P (f)) |
286 | 1139 { |
765 | 1140 if (XINT (rows) != f->width) |
1141 x_set_window_size (f, f->width, XINT (rows)); | |
286 | 1142 } |
1143 else | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1144 #endif |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1145 change_frame_size (f, XINT (rows), 0, !NILP (pretend), 0); |
286 | 1146 return Qnil; |
1147 } | |
1148 | |
765 | 1149 DEFUN ("set-frame-width", Fset_frame_width, Sset_frame_width, 2, 3, 0, |
1150 "Specify that the frame FRAME has COLS columns.\n\ | |
286 | 1151 Optional third arg non-nil means that redisplay should use COLS columns\n\ |
765 | 1152 but that the idea of the actual width of the frame should not be changed.") |
1153 (frame, cols, pretend) | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1154 Lisp_Object frame, cols, pretend; |
286 | 1155 { |
765 | 1156 register struct frame *f; |
286 | 1157 CHECK_NUMBER (cols, 0); |
765 | 1158 if (NILP (frame)) |
1159 f = selected_frame; | |
286 | 1160 else |
1161 { | |
765 | 1162 CHECK_LIVE_FRAME (frame, 0); |
1163 f = XFRAME (frame); | |
286 | 1164 } |
1165 | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1166 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1167 if (FRAME_X_P (f)) |
286 | 1168 { |
765 | 1169 if (XINT (cols) != f->width) |
1170 x_set_window_size (f, XINT (cols), f->height); | |
286 | 1171 } |
1172 else | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1173 #endif |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1174 change_frame_size (f, 0, XINT (cols), !NILP (pretend), 0); |
286 | 1175 return Qnil; |
1176 } | |
1177 | |
765 | 1178 DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 3, 0, |
1179 "Sets size of FRAME to COLS by ROWS, measured in characters.") | |
1180 (frame, cols, rows) | |
1181 Lisp_Object frame, cols, rows; | |
286 | 1182 { |
765 | 1183 register struct frame *f; |
286 | 1184 int mask; |
1185 | |
765 | 1186 CHECK_LIVE_FRAME (frame, 0); |
286 | 1187 CHECK_NUMBER (cols, 2); |
1188 CHECK_NUMBER (rows, 1); | |
765 | 1189 f = XFRAME (frame); |
286 | 1190 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1191 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1192 if (FRAME_X_P (f)) |
286 | 1193 { |
765 | 1194 if (XINT (rows) != f->height || XINT (cols) != f->width) |
1195 x_set_window_size (f, XINT (cols), XINT (rows)); | |
286 | 1196 } |
1197 else | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1198 #endif |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1199 change_frame_size (f, XINT (rows), XINT (cols), 0, 0); |
286 | 1200 |
1201 return Qnil; | |
1202 } | |
1203 | |
765 | 1204 DEFUN ("set-frame-position", Fset_frame_position, |
1205 Sset_frame_position, 3, 3, 0, | |
1206 "Sets position of FRAME in pixels to XOFFSET by YOFFSET.\n\ | |
454 | 1207 If XOFFSET or YOFFSET are negative, they are interpreted relative to\n\ |
765 | 1208 the leftmost or bottommost position FRAME could occupy without going\n\ |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1209 off the screen.") |
765 | 1210 (frame, xoffset, yoffset) |
1211 Lisp_Object frame, xoffset, yoffset; | |
286 | 1212 { |
765 | 1213 register struct frame *f; |
286 | 1214 int mask; |
1215 | |
765 | 1216 CHECK_LIVE_FRAME (frame, 0); |
286 | 1217 CHECK_NUMBER (xoffset, 1); |
1218 CHECK_NUMBER (yoffset, 2); | |
765 | 1219 f = XFRAME (frame); |
286 | 1220 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1221 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1222 if (FRAME_X_P (f)) |
765 | 1223 x_set_offset (f, XINT (xoffset), XINT (yoffset)); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1224 #endif |
286 | 1225 |
1226 return Qt; | |
1227 } | |
777 | 1228 |
286 | 1229 |
1230 #ifndef HAVE_X11 | |
1231 DEFUN ("rubber-band-rectangle", Frubber_band_rectangle, Srubber_band_rectangle, | |
1232 3, 3, "", | |
765 | 1233 "Ask user to specify a window position and size on FRAME with the mouse.\n\ |
1234 Arguments are FRAME, NAME and GEO. NAME is a name to be displayed as\n\ | |
286 | 1235 the purpose of this rectangle. GEO is an X-windows size spec that can\n\ |
1236 specify defaults for some sizes/positions. If GEO specifies everything,\n\ | |
1237 the mouse is not used.\n\ | |
765 | 1238 Returns a list of five values: (FRAME LEFT TOP WIDTH HEIGHT).") |
1239 (frame, name, geo) | |
1240 Lisp_Object frame; | |
286 | 1241 Lisp_Object name; |
1242 Lisp_Object geo; | |
1243 { | |
1244 int vals[4]; | |
1245 Lisp_Object nums[4]; | |
1246 int i; | |
1247 | |
765 | 1248 CHECK_FRAME (frame, 0); |
286 | 1249 CHECK_STRING (name, 1); |
1250 CHECK_STRING (geo, 2); | |
1251 | |
765 | 1252 switch (XFRAME (frame)->output_method) |
286 | 1253 { |
1254 case output_x_window: | |
765 | 1255 x_rubber_band (XFRAME (frame), &vals[0], &vals[1], &vals[2], &vals[3], |
286 | 1256 XSTRING (geo)->data, XSTRING (name)->data); |
1257 break; | |
1258 | |
1259 default: | |
1260 return Qnil; | |
1261 } | |
1262 | |
1263 for (i = 0; i < 4; i++) | |
1264 XFASTINT (nums[i]) = vals[i]; | |
765 | 1265 return Fcons (frame, Flist (4, nums)); |
286 | 1266 return Qnil; |
1267 } | |
1268 #endif /* not HAVE_X11 */ | |
1269 | |
765 | 1270 choose_minibuf_frame () |
286 | 1271 { |
765 | 1272 /* For lowest-level minibuf, put it on currently selected frame |
1273 if frame has a minibuffer. */ | |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1274 |
286 | 1275 if (minibuf_level == 0 |
765 | 1276 && selected_frame != 0 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1277 && !EQ (minibuf_window, selected_frame->minibuffer_window)) |
286 | 1278 { |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1279 /* I don't think that any frames may validly have a null minibuffer |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1280 window anymore. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1281 if (NILP (selected_frame->minibuffer_window)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1282 abort (); |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1283 |
765 | 1284 Fset_window_buffer (selected_frame->minibuffer_window, |
286 | 1285 XWINDOW (minibuf_window)->buffer); |
765 | 1286 minibuf_window = selected_frame->minibuffer_window; |
286 | 1287 } |
1288 } | |
1289 | |
765 | 1290 syms_of_frame () |
286 | 1291 { |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1292 /*&&& init symbols here &&&*/ |
765 | 1293 Qframep = intern ("framep"); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1294 staticpro (&Qframep); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1295 Qlive_frame_p = intern ("live-frame-p"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1296 staticpro (&Qlive_frame_p); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1297 Qheight = intern ("height"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1298 staticpro (&Qheight); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1299 Qicon = intern ("icon"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1300 staticpro (&Qicon); |
539 | 1301 Qminibuffer = intern ("minibuffer"); |
1302 staticpro (&Qminibuffer); | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1303 Qmodeline = intern ("modeline"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1304 staticpro (&Qmodeline); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1305 Qname = intern ("name"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1306 staticpro (&Qname); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1307 Qnone = intern ("none"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1308 staticpro (&Qnone); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1309 Qonly = intern ("only"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1310 staticpro (&Qonly); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1311 Qunsplittable = intern ("unsplittable"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1312 staticpro (&Qunsplittable); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1313 Qwidth = intern ("width"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1314 staticpro (&Qwidth); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1315 Qx = intern ("x"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1316 staticpro (&Qx); |
286 | 1317 |
765 | 1318 staticpro (&Vframe_list); |
286 | 1319 |
765 | 1320 DEFVAR_LISP ("terminal-frame", &Vterminal_frame, |
1321 "The initial frame-object, which represents Emacs's stdout."); | |
286 | 1322 |
1323 DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified, | |
765 | 1324 "Non-nil if all of emacs is iconified and frame updates are not needed."); |
286 | 1325 Vemacs_iconified = Qnil; |
1326 | |
765 | 1327 DEFVAR_LISP ("default-minibuffer-frame", &Vdefault_minibuffer_frame, |
1328 "Minibufferless frames use this frame's minibuffer.\n\ | |
454 | 1329 \n\ |
765 | 1330 Emacs cannot create minibufferless frames unless this is set to an\n\ |
454 | 1331 appropriate surrogate.\n\ |
1332 \n\ | |
1333 Emacs consults this variable only when creating minibufferless\n\ | |
765 | 1334 frames; once the frame is created, it sticks with its assigned\n\ |
454 | 1335 minibuffer, no matter what this variable is set to. This means that\n\ |
1336 this variable doesn't necessarily say anything meaningful about the\n\ | |
765 | 1337 current set of frames, or where the minibuffer is currently being\n\ |
454 | 1338 displayed."); |
765 | 1339 Vdefault_minibuffer_frame = Qnil; |
286 | 1340 |
765 | 1341 DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist, |
1342 "Alist of default values for frame creation.\n\ | |
386 | 1343 These may be set in your init file, like this:\n\ |
765 | 1344 (setq default-frame-alist '((width . 80) (height . 55)))\n\ |
386 | 1345 These override values given in window system configuration data, like\n\ |
1346 X Windows' defaults database.\n\ | |
765 | 1347 For values specific to the first Emacs frame, see `initial-frame-alist'.\n\ |
1348 For values specific to the separate minibuffer frame, see\n\ | |
1349 `minibuffer-frame-alist'."); | |
1350 Vdefault_frame_alist = Qnil; | |
386 | 1351 |
765 | 1352 defsubr (&Sframep); |
1353 defsubr (&Slive_frame_p); | |
1354 defsubr (&Sselect_frame); | |
1355 defsubr (&Sselected_frame); | |
1356 defsubr (&Swindow_frame); | |
1357 defsubr (&Sframe_root_window); | |
1358 defsubr (&Sframe_selected_window); | |
1359 defsubr (&Sframe_list); | |
1360 defsubr (&Snext_frame); | |
1361 defsubr (&Sdelete_frame); | |
454 | 1362 defsubr (&Smouse_position); |
286 | 1363 defsubr (&Sset_mouse_position); |
1364 #if 0 | |
765 | 1365 defsubr (&Sframe_configuration); |
1366 defsubr (&Srestore_frame_configuration); | |
286 | 1367 #endif |
765 | 1368 defsubr (&Smake_frame_visible); |
1369 defsubr (&Smake_frame_invisible); | |
1370 defsubr (&Siconify_frame); | |
1371 defsubr (&Sframe_visible_p); | |
1372 defsubr (&Svisible_frame_list); | |
1373 defsubr (&Sredirect_frame_focus); | |
1374 defsubr (&Sframe_focus); | |
1375 defsubr (&Sframe_parameters); | |
1376 defsubr (&Smodify_frame_parameters); | |
785 | 1377 #if 0 |
765 | 1378 defsubr (&Sframe_pixel_size); |
1379 defsubr (&Sframe_height); | |
1380 defsubr (&Sframe_width); | |
785 | 1381 #endif |
765 | 1382 defsubr (&Sset_frame_height); |
1383 defsubr (&Sset_frame_width); | |
1384 defsubr (&Sset_frame_size); | |
1385 defsubr (&Sset_frame_position); | |
286 | 1386 #ifndef HAVE_X11 |
1387 defsubr (&Srubber_band_rectangle); | |
1388 #endif /* HAVE_X11 */ | |
1389 } | |
732 | 1390 |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1391 keys_of_frame () |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1392 { |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1393 initial_define_lispy_key (global_map, "switch-frame", "select-frame"); |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1394 } |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1395 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1396 #else /* not MULTI_FRAME */ |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1397 |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1398 /* If we're not using multi-frame stuff, we still need to provide some |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1399 support functions. */ |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1400 |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1401 /* Unless this function is defined, providing set-frame-height and |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1402 set-frame-width doesn't help compatibility any, since they both |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1403 want this as their first argument. */ |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1404 DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0, |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1405 "Return the frame that is now selected.") |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1406 () |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1407 { |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1408 Lisp_Object tem; |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1409 XFASTINT (tem) = 0; |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1410 return tem; |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1411 } |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1412 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1413 DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0, |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1414 "Specify that the frame FRAME has LINES lines.\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1415 Optional third arg non-nil means that redisplay should use LINES lines\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1416 but that the idea of the actual height of the frame should not be changed.") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1417 (frame, rows, pretend) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1418 Lisp_Object frame, rows, pretend; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1419 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1420 CHECK_NUMBER (rows, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1421 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1422 change_frame_size (0, XINT (rows), 0, !NILP (pretend), 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1423 return Qnil; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1424 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1425 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1426 DEFUN ("set-frame-width", Fset_frame_width, Sset_frame_width, 2, 3, 0, |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1427 "Specify that the frame FRAME has COLS columns.\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1428 Optional third arg non-nil means that redisplay should use COLS columns\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1429 but that the idea of the actual width of the frame should not be changed.") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1430 (frame, cols, pretend) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1431 Lisp_Object frame, cols, pretend; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1432 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1433 CHECK_NUMBER (cols, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1434 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1435 change_frame_size (0, 0, XINT (cols), !NILP (pretend), 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1436 return Qnil; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1437 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1438 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1439 DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 3, 0, |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1440 "Sets size of FRAME to COLS by ROWS, measured in characters.") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1441 (frame, cols, rows) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1442 Lisp_Object frame, cols, rows; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1443 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1444 CHECK_NUMBER (cols, 2); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1445 CHECK_NUMBER (rows, 1); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1446 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1447 change_frame_size (0, XINT (rows), XINT (cols), 0, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1448 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1449 return Qnil; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1450 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1451 |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1452 DEFUN ("frame-height", Fframe_height, Sframe_height, 0, 0, 0, |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1453 "Return number of lines available for display on selected frame.") |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1454 () |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1455 { |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1456 return make_number (FRAME_HEIGHT (selected_frame)); |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1457 } |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1458 |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1459 DEFUN ("frame-width", Fframe_width, Sframe_width, 0, 0, 0, |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1460 "Return number of columns available for display on selected frame.") |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1461 () |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1462 { |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1463 return make_number (FRAME_WIDTH (selected_frame)); |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1464 } |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1465 |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1466 /* These are for backward compatibility with Emacs 18. */ |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1467 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1468 DEFUN ("set-screen-height", Fset_screen_height, Sset_screen_height, 1, 2, 0, |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1469 "Tell redisplay that the screen has LINES lines.\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1470 Optional second arg non-nil means that redisplay should use LINES lines\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1471 but that the idea of the actual height of the screen should not be changed.") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1472 (lines, pretend) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1473 Lisp_Object lines, pretend; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1474 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1475 CHECK_NUMBER (lines, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1476 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1477 change_frame_size (0, XINT (lines), 0, !NILP (pretend), 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1478 return Qnil; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1479 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1480 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1481 DEFUN ("set-screen-width", Fset_screen_width, Sset_screen_width, 1, 2, 0, |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1482 "Tell redisplay that the screen has COLS columns.\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1483 Optional second arg non-nil means that redisplay should use COLS columns\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1484 but that the idea of the actual width of the screen should not be changed.") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1485 (cols, pretend) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1486 Lisp_Object cols, pretend; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1487 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1488 CHECK_NUMBER (cols, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1489 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1490 change_frame_size (0, 0, XINT (cols), !NILP (pretend), 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1491 return Qnil; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1492 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1493 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1494 syms_of_frame () |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1495 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1496 defsubr (&Sset_frame_height); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1497 defsubr (&Sset_frame_width); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1498 defsubr (&Sset_frame_size); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1499 defsubr (&Sset_screen_height); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1500 defsubr (&Sset_screen_width); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1501 defsubr (&Sframe_height); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1502 Ffset (intern ("screen-height"), intern ("frame-height")); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1503 defsubr (&Sframe_width); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1504 Ffset (intern ("screen-width"), intern ("frame-width")); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1505 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1506 |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1507 keys_of_frame () |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1508 { |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1509 } |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1510 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1511 #endif /* not MULTI_FRAME */ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1512 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1513 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1514 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1515 |