Mercurial > emacs
annotate src/frame.c @ 1693:4b2f399dbea2
(Fcall_interactively): For `s', use Fread_string.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 21 Dec 1992 05:38:25 +0000 |
parents | 357b58c8c858 |
children | b86b3237e017 |
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"); | |
1691
357b58c8c858
* frame.c (make_terminal_frame): Don't forget to set the
Jim Blandy <jimb@redhat.com>
parents:
1680
diff
changeset
|
317 f->async_visible = 1; |
765 | 318 f->visible = 1; |
319 f->display.nothing = 1; /* Nonzero means frame isn't deleted. */ | |
320 XSET (Vterminal_frame, Lisp_Frame, f); | |
321 return f; | |
286 | 322 } |
323 | |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
324 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
|
325 "Select the frame FRAME. FRAME's selected window becomes \"the\"\n\ |
363 | 326 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
|
327 focus on that frame.\n\ |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
328 \n\ |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
329 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
|
330 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
|
331 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
|
332 if it is, select the frame named in the event.") |
765 | 333 (frame, no_enter) |
334 Lisp_Object frame, no_enter; | |
286 | 335 { |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
336 /* 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
|
337 switch to. */ |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
338 if (CONSP (frame) |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
339 && EQ (XCONS (frame)->car, Qswitch_frame) |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
340 && CONSP (XCONS (frame)->cdr)) |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
341 frame = XCONS (XCONS (frame)->cdr)->car; |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
342 |
765 | 343 CHECK_LIVE_FRAME (frame, 0); |
286 | 344 |
765 | 345 if (selected_frame == XFRAME (frame)) |
346 return frame; | |
286 | 347 |
765 | 348 selected_frame = XFRAME (frame); |
349 if (! FRAME_MINIBUF_ONLY_P (selected_frame)) | |
350 last_nonminibuf_frame = selected_frame; | |
363 | 351 |
765 | 352 Fselect_window (XFRAME (frame)->selected_window); |
286 | 353 |
354 #ifdef HAVE_X_WINDOWS | |
765 | 355 #ifdef MULTI_FRAME |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
356 if (FRAME_X_P (XFRAME (frame)) |
485 | 357 && NILP (no_enter)) |
286 | 358 { |
765 | 359 Ffocus_frame (frame); |
286 | 360 } |
361 #endif | |
362 #endif | |
765 | 363 choose_minibuf_frame (); |
286 | 364 |
765 | 365 return frame; |
286 | 366 } |
367 | |
765 | 368 DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0, |
369 "Return the frame that is now selected.") | |
286 | 370 () |
371 { | |
372 Lisp_Object tem; | |
765 | 373 XSET (tem, Lisp_Frame, selected_frame); |
286 | 374 return tem; |
375 } | |
376 | |
765 | 377 DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0, |
378 "Return the frame object that window WINDOW is on.") | |
286 | 379 (window) |
380 Lisp_Object window; | |
381 { | |
1437
36ef55ecb265
* frame.c (make_frame_without_minibuffer, Fwindow_frame): Use
Jim Blandy <jimb@redhat.com>
parents:
1385
diff
changeset
|
382 CHECK_LIVE_WINDOW (window, 0); |
765 | 383 return XWINDOW (window)->frame; |
286 | 384 } |
385 | |
765 | 386 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
|
387 "Returns the root-window of FRAME.\n\ |
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
388 If omitted, FRAME defaults to the currently selected frame.") |
765 | 389 (frame) |
390 Lisp_Object frame; | |
286 | 391 { |
765 | 392 if (NILP (frame)) |
393 XSET (frame, Lisp_Frame, selected_frame); | |
454 | 394 else |
765 | 395 CHECK_LIVE_FRAME (frame, 0); |
286 | 396 |
765 | 397 return XFRAME (frame)->root_window; |
286 | 398 } |
399 | |
765 | 400 DEFUN ("frame-selected-window", Fframe_selected_window, |
401 Sframe_selected_window, 0, 1, 0, | |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
402 "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
|
403 If omitted, FRAME defaults to the currently selected frame.") |
765 | 404 (frame) |
405 Lisp_Object frame; | |
286 | 406 { |
765 | 407 if (NILP (frame)) |
408 XSET (frame, Lisp_Frame, selected_frame); | |
454 | 409 else |
765 | 410 CHECK_LIVE_FRAME (frame, 0); |
286 | 411 |
765 | 412 return XFRAME (frame)->selected_window; |
286 | 413 } |
414 | |
765 | 415 DEFUN ("frame-list", Fframe_list, Sframe_list, |
286 | 416 0, 0, 0, |
765 | 417 "Return a list of all frames.") |
286 | 418 () |
419 { | |
765 | 420 return Fcopy_sequence (Vframe_list); |
286 | 421 } |
422 | |
765 | 423 #ifdef MULTI_FRAME |
454 | 424 |
765 | 425 /* Return the next frame in the frame list after FRAME. |
426 If MINIBUF is nil, exclude minibuffer-only frames. | |
427 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
|
428 their minibuffer. |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
429 If MINIBUF is non-nil, and not a window, include all frames. */ |
286 | 430 Lisp_Object |
765 | 431 next_frame (frame, minibuf) |
432 Lisp_Object frame; | |
454 | 433 Lisp_Object minibuf; |
286 | 434 { |
435 Lisp_Object tail; | |
436 int passed = 0; | |
437 | |
765 | 438 /* There must always be at least one frame in Vframe_list. */ |
439 if (! CONSP (Vframe_list)) | |
454 | 440 abort (); |
441 | |
286 | 442 while (1) |
765 | 443 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr) |
286 | 444 { |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
445 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
|
446 |
286 | 447 if (passed) |
363 | 448 { |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
449 /* 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
|
450 |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
451 /* 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
|
452 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
|
453 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
|
454 return f; |
335 | 455 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
456 /* 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
|
457 if (NILP (minibuf)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
458 { |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
459 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
|
460 return f; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
461 } |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
462 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
|
463 { |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
464 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
|
465 return f; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
466 } |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
467 else |
765 | 468 return f; |
363 | 469 } |
286 | 470 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
471 if (EQ (frame, f)) |
286 | 472 passed++; |
473 } | |
474 } | |
475 | |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
476 #if 0 |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
477 /* 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
|
478 |
765 | 479 /* Return the previous frame in the frame list before FRAME. |
480 If MINIBUF is nil, exclude minibuffer-only frames. | |
481 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
|
482 their minibuffer. |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
483 If MINIBUF is non-nil and not a window, include all frames. */ |
286 | 484 Lisp_Object |
765 | 485 prev_frame (frame, minibuf) |
486 Lisp_Object frame; | |
454 | 487 Lisp_Object minibuf; |
286 | 488 { |
489 Lisp_Object tail; | |
490 Lisp_Object prev; | |
491 | |
765 | 492 /* There must always be at least one frame in Vframe_list. */ |
493 if (! CONSP (Vframe_list)) | |
454 | 494 abort (); |
495 | |
286 | 496 prev = Qnil; |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
497 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr) |
454 | 498 { |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
499 Lisp_Object f = XCONS (tail)->car; |
454 | 500 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
501 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
|
502 abort (); |
454 | 503 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
504 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
|
505 return prev; |
454 | 506 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
507 /* 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
|
508 according to minibuf. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
509 if (NILP (minibuf)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
510 { |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
511 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
|
512 prev = f; |
454 | 513 } |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
514 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
|
515 { |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
516 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
|
517 prev = f; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
518 } |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
519 else |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
520 prev = f; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
521 } |
454 | 522 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
523 /* 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
|
524 if (NILP (prev)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
525 /* 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
|
526 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
|
527 return frame; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
528 else |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
529 /* 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
|
530 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
|
531 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
|
532 return prev; |
286 | 533 } |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
534 #endif |
286 | 535 |
765 | 536 DEFUN ("next-frame", Fnext_frame, Snext_frame, 0, 2, 0, |
537 "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
|
538 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
|
539 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
|
540 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
|
541 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
|
542 minibuffer.\n\ |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
543 If MINIFRAME is non-nil and not a window, include all frames.") |
765 | 544 (frame, miniframe) |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
545 Lisp_Object frame, miniframe; |
286 | 546 { |
547 Lisp_Object tail; | |
548 | |
765 | 549 if (NILP (frame)) |
550 XSET (frame, Lisp_Frame, selected_frame); | |
454 | 551 else |
765 | 552 CHECK_LIVE_FRAME (frame, 0); |
286 | 553 |
765 | 554 return next_frame (frame, miniframe); |
286 | 555 } |
765 | 556 #endif /* MULTI_FRAME */ |
286 | 557 |
765 | 558 DEFUN ("delete-frame", Fdelete_frame, Sdelete_frame, 0, 1, "", |
559 "Delete FRAME, permanently eliminating it from use.\n\ | |
560 If omitted, FRAME defaults to the selected frame.\n\ | |
561 A frame may not be deleted if its minibuffer is used by other frames.") | |
562 (frame) | |
563 Lisp_Object frame; | |
286 | 564 { |
765 | 565 struct frame *f; |
286 | 566 union display displ; |
567 | |
765 | 568 if (EQ (frame, Qnil)) |
286 | 569 { |
765 | 570 f = selected_frame; |
571 XSET (frame, Lisp_Frame, f); | |
286 | 572 } |
573 else | |
574 { | |
765 | 575 CHECK_FRAME (frame, 0); |
576 f = XFRAME (frame); | |
286 | 577 } |
578 | |
765 | 579 if (! FRAME_LIVE_P (f)) |
454 | 580 return; |
581 | |
765 | 582 /* Are there any other frames besides this one? */ |
583 if (f == selected_frame && EQ (next_frame (frame, Qt), frame)) | |
584 error ("Attempt to delete the only frame"); | |
286 | 585 |
765 | 586 /* Does this frame have a minibuffer, and is it the surrogate |
587 minibuffer for any other frame? */ | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
588 if (FRAME_HAS_MINIBUF_P (XFRAME (frame))) |
363 | 589 { |
765 | 590 Lisp_Object frames; |
708 | 591 |
765 | 592 for (frames = Vframe_list; |
593 CONSP (frames); | |
594 frames = XCONS (frames)->cdr) | |
708 | 595 { |
765 | 596 Lisp_Object this = XCONS (frames)->car; |
363 | 597 |
765 | 598 if (! EQ (this, frame) |
599 && EQ (frame, | |
600 (WINDOW_FRAME | |
708 | 601 (XWINDOW |
765 | 602 (FRAME_MINIBUF_WINDOW |
603 (XFRAME (this))))))) | |
604 error ("Attempt to delete a surrogate minibuffer frame"); | |
708 | 605 } |
286 | 606 } |
607 | |
765 | 608 /* Don't let the frame remain selected. */ |
609 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
|
610 Fselect_frame (next_frame (frame, Qt), Qnil); |
286 | 611 |
765 | 612 /* Don't allow minibuf_window to remain on a deleted frame. */ |
613 if (EQ (f->minibuffer_window, minibuf_window)) | |
286 | 614 { |
765 | 615 Fset_window_buffer (selected_frame->minibuffer_window, |
286 | 616 XWINDOW (minibuf_window)->buffer); |
765 | 617 minibuf_window = selected_frame->minibuffer_window; |
286 | 618 } |
619 | |
1680
ea9f3949f153
* frame.c (Fdelete_frame): Delete all the windows in the frame's
Jim Blandy <jimb@redhat.com>
parents:
1652
diff
changeset
|
620 /* 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
|
621 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
|
622 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
|
623 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
|
624 |
765 | 625 Vframe_list = Fdelq (frame, Vframe_list); |
626 f->visible = 0; | |
627 displ = f->display; | |
628 f->display.nothing = 0; | |
286 | 629 |
363 | 630 #ifdef HAVE_X_WINDOWS |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
631 if (FRAME_X_P (f)) |
765 | 632 x_destroy_window (f, displ); |
363 | 633 #endif |
634 | |
765 | 635 /* If we've deleted the last_nonminibuf_frame, then try to find |
363 | 636 another one. */ |
765 | 637 if (f == last_nonminibuf_frame) |
363 | 638 { |
765 | 639 Lisp_Object frames; |
708 | 640 |
765 | 641 last_nonminibuf_frame = 0; |
363 | 642 |
765 | 643 for (frames = Vframe_list; |
644 CONSP (frames); | |
645 frames = XCONS (frames)->cdr) | |
363 | 646 { |
765 | 647 f = XFRAME (XCONS (frames)->car); |
648 if (!FRAME_MINIBUF_ONLY_P (f)) | |
363 | 649 { |
765 | 650 last_nonminibuf_frame = f; |
363 | 651 break; |
652 } | |
653 } | |
654 } | |
286 | 655 |
765 | 656 /* If we've deleted Vdefault_minibuffer_frame, try to find another |
657 one. Prefer minibuffer-only frames, but also notice frames | |
708 | 658 with other windows. */ |
765 | 659 if (EQ (frame, Vdefault_minibuffer_frame)) |
708 | 660 { |
765 | 661 Lisp_Object frames; |
708 | 662 |
765 | 663 /* The last frame we saw with a minibuffer, minibuffer-only or not. */ |
664 Lisp_Object frame_with_minibuf = Qnil; | |
708 | 665 |
765 | 666 for (frames = Vframe_list; |
667 CONSP (frames); | |
668 frames = XCONS (frames)->cdr) | |
708 | 669 { |
765 | 670 Lisp_Object this = XCONS (frames)->car; |
708 | 671 |
765 | 672 if (XTYPE (this) != Lisp_Frame) |
708 | 673 abort (); |
765 | 674 f = XFRAME (this); |
708 | 675 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
676 if (FRAME_HAS_MINIBUF_P (f)) |
708 | 677 { |
765 | 678 frame_with_minibuf = this; |
679 if (FRAME_MINIBUF_ONLY_P (f)) | |
708 | 680 break; |
681 } | |
682 } | |
683 | |
765 | 684 /* We know that there must be some frame with a minibuffer out |
685 there. If this were not true, all of the frames present | |
708 | 686 would have to be minibufferless, which implies that at some |
765 | 687 point their minibuffer frames must have been deleted, but |
708 | 688 that is prohibited at the top; you can't delete surrogate |
765 | 689 minibuffer frames. */ |
690 if (NILP (frame_with_minibuf)) | |
708 | 691 abort (); |
692 | |
765 | 693 Vdefault_minibuffer_frame = frame_with_minibuf; |
708 | 694 } |
695 | |
286 | 696 return Qnil; |
697 } | |
698 | |
699 /* Return mouse position in character cell units. */ | |
700 | |
454 | 701 DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0, |
765 | 702 "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\ |
454 | 703 If Emacs is running on a mouseless terminal or hasn't been programmed\n\ |
765 | 704 to read the mouse position, it returns the selected frame for FRAME\n\ |
454 | 705 and nil for X and Y.") |
706 () | |
286 | 707 { |
454 | 708 Lisp_Object x, y, dummy; |
765 | 709 FRAME_PTR f; |
286 | 710 |
454 | 711 if (mouse_position_hook) |
765 | 712 (*mouse_position_hook) (&f, &x, &y, &dummy); |
454 | 713 else |
714 { | |
765 | 715 f = selected_frame; |
454 | 716 x = y = Qnil; |
717 } | |
286 | 718 |
765 | 719 XSET (dummy, Lisp_Frame, f); |
454 | 720 return Fcons (dummy, Fcons (make_number (x), make_number (y))); |
286 | 721 } |
722 | |
723 DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0, | |
765 | 724 "Move the mouse pointer to the center of cell (X,Y) in FRAME.\n\ |
725 WARNING: If you use this under X, you should do `unfocus-frame' afterwards.") | |
726 (frame, x, y) | |
727 Lisp_Object frame, x, y; | |
286 | 728 { |
765 | 729 CHECK_LIVE_FRAME (frame, 0); |
286 | 730 CHECK_NUMBER (x, 2); |
731 CHECK_NUMBER (y, 1); | |
732 | |
733 #ifdef HAVE_X_WINDOWS | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
734 if (FRAME_X_P (XFRAME (frame))) |
286 | 735 /* Warping the mouse will cause enternotify and focus events. */ |
765 | 736 x_set_mouse_position (XFRAME (frame), x, y); |
286 | 737 #endif |
738 | |
739 return Qnil; | |
740 } | |
741 | |
742 #if 0 | |
743 /* ??? Can this be replaced with a Lisp function? | |
756 | 744 It is used in minibuf.c. Can we get rid of that? |
745 Yes. All uses in minibuf.c are gone, and parallels to these | |
765 | 746 functions have been defined in frame.el. */ |
286 | 747 |
765 | 748 DEFUN ("frame-configuration", Fframe_configuration, Sframe_configuration, |
286 | 749 0, 0, 0, |
765 | 750 "Return object describing current frame configuration.\n\ |
751 The frame configuration is the current mouse position and selected frame.\n\ | |
752 This object can be given to `restore-frame-configuration'\n\ | |
753 to restore this frame configuration.") | |
286 | 754 () |
755 { | |
454 | 756 Lisp_Object c, time; |
286 | 757 |
454 | 758 c = Fmake_vector (make_number(4), Qnil); |
765 | 759 XVECTOR (c)->contents[0] = Fselected_frame(); |
454 | 760 if (mouse_position_hook) |
761 (*mouse_position_hook) (&XVECTOR (c)->contents[1] | |
762 &XVECTOR (c)->contents[2], | |
763 &XVECTOR (c)->contents[3], | |
764 &time); | |
286 | 765 return c; |
766 } | |
767 | |
765 | 768 DEFUN ("restore-frame-configuration", Frestore_frame_configuration, |
769 Srestore_frame_configuration, | |
286 | 770 1, 1, 0, |
765 | 771 "Restores frame configuration CONFIGURATION.") |
286 | 772 (config) |
773 Lisp_Object config; | |
774 { | |
765 | 775 Lisp_Object x_pos, y_pos, frame; |
286 | 776 |
777 CHECK_VECTOR (config, 0); | |
778 if (XVECTOR (config)->size != 3) | |
779 { | |
765 | 780 error ("Wrong size vector passed to restore-frame-configuration"); |
286 | 781 } |
765 | 782 frame = XVECTOR (config)->contents[0]; |
783 CHECK_LIVE_FRAME (frame, 0); | |
286 | 784 |
765 | 785 Fselect_frame (frame, Qnil); |
286 | 786 |
787 #if 0 | |
765 | 788 /* This seems to interfere with the frame selection mechanism. jla */ |
454 | 789 x_pos = XVECTOR (config)->contents[2]; |
790 y_pos = XVECTOR (config)->contents[3]; | |
765 | 791 set_mouse_position (frame, XINT (x_pos), XINT (y_pos)); |
286 | 792 #endif |
793 | |
765 | 794 return frame; |
286 | 795 } |
796 #endif | |
797 | |
765 | 798 DEFUN ("make-frame-visible", Fmake_frame_visible, Smake_frame_visible, |
872 | 799 0, 1, 0, |
765 | 800 "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
|
801 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
|
802 If omitted, FRAME defaults to the currently selected frame.") |
765 | 803 (frame) |
804 Lisp_Object frame; | |
286 | 805 { |
872 | 806 if (NILP (frame)) |
886 | 807 XSET (frame, Lisp_Frame, selected_frame); |
872 | 808 |
765 | 809 CHECK_LIVE_FRAME (frame, 0); |
286 | 810 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
811 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
812 if (FRAME_X_P (XFRAME (frame))) |
765 | 813 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
|
814 #endif |
286 | 815 |
765 | 816 return frame; |
286 | 817 } |
818 | |
765 | 819 DEFUN ("make-frame-invisible", Fmake_frame_invisible, Smake_frame_invisible, |
872 | 820 0, 1, "", |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
821 "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
|
822 If omitted, FRAME defaults to the currently selected frame.") |
765 | 823 (frame) |
824 Lisp_Object frame; | |
286 | 825 { |
872 | 826 if (NILP (frame)) |
886 | 827 XSET (frame, Lisp_Frame, selected_frame); |
872 | 828 |
765 | 829 CHECK_LIVE_FRAME (frame, 0); |
286 | 830 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
831 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
832 if (FRAME_X_P (XFRAME (frame))) |
765 | 833 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
|
834 #endif |
286 | 835 |
836 return Qnil; | |
837 } | |
838 | |
765 | 839 DEFUN ("iconify-frame", Ficonify_frame, Siconify_frame, |
872 | 840 0, 1, "", |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
841 "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
|
842 If omitted, FRAME defaults to the currently selected frame.") |
765 | 843 (frame) |
844 Lisp_Object frame; | |
286 | 845 { |
872 | 846 if (NILP (frame)) |
886 | 847 XSET (frame, Lisp_Frame, selected_frame); |
872 | 848 |
765 | 849 CHECK_LIVE_FRAME (frame, 0); |
286 | 850 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
851 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
852 if (FRAME_X_P (XFRAME (frame))) |
765 | 853 x_iconify_frame (XFRAME (frame)); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
854 #endif |
286 | 855 |
856 return Qnil; | |
857 } | |
858 | |
765 | 859 DEFUN ("frame-visible-p", Fframe_visible_p, Sframe_visible_p, |
286 | 860 1, 1, 0, |
765 | 861 "Return t if FRAME is now \"visible\" (actually in use for display).\n\ |
862 A frame that is not \"visible\" is not updated and, if it works through\n\ | |
286 | 863 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
|
864 Return the symbol `icon' if frame is visible only as an icon.") |
765 | 865 (frame) |
866 Lisp_Object frame; | |
286 | 867 { |
765 | 868 CHECK_LIVE_FRAME (frame, 0); |
286 | 869 |
765 | 870 if (XFRAME (frame)->visible) |
286 | 871 return Qt; |
765 | 872 if (XFRAME (frame)->iconified) |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
873 return Qicon; |
286 | 874 return Qnil; |
875 } | |
876 | |
765 | 877 DEFUN ("visible-frame-list", Fvisible_frame_list, Svisible_frame_list, |
286 | 878 0, 0, 0, |
765 | 879 "Return a list of all frames now \"visible\" (being updated).") |
286 | 880 () |
881 { | |
765 | 882 Lisp_Object tail, frame; |
883 struct frame *f; | |
286 | 884 Lisp_Object value; |
885 | |
886 value = Qnil; | |
765 | 887 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr) |
286 | 888 { |
765 | 889 frame = XCONS (tail)->car; |
890 if (XTYPE (frame) != Lisp_Frame) | |
286 | 891 continue; |
765 | 892 f = XFRAME (frame); |
893 if (f->visible) | |
894 value = Fcons (frame, value); | |
286 | 895 } |
896 return value; | |
897 } | |
363 | 898 |
899 | |
900 | |
765 | 901 DEFUN ("redirect-frame-focus", Fredirect_frame_focus, Sredirect_frame_focus, |
363 | 902 1, 2, 0, |
765 | 903 "Arrange for keystrokes typed at FRAME to be sent to FOCUS-FRAME.\n\ |
904 This means that, after reading a keystroke typed at FRAME,\n\ | |
905 `last-event-frame' will be FOCUS-FRAME.\n\ | |
363 | 906 \n\ |
765 | 907 If FOCUS-FRAME is omitted or eq to FRAME, any existing redirection is\n\ |
908 cancelled, and the frame again receives its own keystrokes.\n\ | |
363 | 909 \n\ |
765 | 910 The redirection lasts until the next call to `redirect-frame-focus'\n\ |
911 or `select-frame'.\n\ | |
363 | 912 \n\ |
913 This is useful for temporarily redirecting keystrokes to the minibuffer\n\ | |
765 | 914 window when a frame doesn't have its own minibuffer.") |
915 (frame, focus_frame) | |
916 Lisp_Object frame, focus_frame; | |
363 | 917 { |
765 | 918 CHECK_LIVE_FRAME (frame, 0); |
454 | 919 |
765 | 920 if (NILP (focus_frame)) |
921 focus_frame = frame; | |
363 | 922 else |
765 | 923 CHECK_LIVE_FRAME (focus_frame, 1); |
363 | 924 |
765 | 925 XFRAME (frame)->focus_frame = focus_frame; |
363 | 926 |
765 | 927 if (frame_rehighlight_hook) |
928 (*frame_rehighlight_hook) (); | |
363 | 929 |
930 return Qnil; | |
931 } | |
932 | |
933 | |
765 | 934 DEFUN ("frame-focus", Fframe_focus, Sframe_focus, 1, 1, 0, |
935 "Return the frame to which FRAME's keystrokes are currently being sent.\n\ | |
936 See `redirect-frame-focus'.") | |
937 (frame) | |
938 Lisp_Object frame; | |
363 | 939 { |
765 | 940 CHECK_LIVE_FRAME (frame, 0); |
941 return FRAME_FOCUS_FRAME (XFRAME (frame)); | |
363 | 942 } |
943 | |
944 | |
286 | 945 |
946 Lisp_Object | |
765 | 947 get_frame_param (frame, prop) |
948 register struct frame *frame; | |
286 | 949 Lisp_Object prop; |
950 { | |
951 register Lisp_Object tem; | |
952 | |
765 | 953 tem = Fassq (prop, frame->param_alist); |
286 | 954 if (EQ (tem, Qnil)) |
955 return tem; | |
956 return Fcdr (tem); | |
957 } | |
958 | |
959 void | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
960 store_in_alist (alistptr, prop, val) |
286 | 961 Lisp_Object *alistptr, val; |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
962 Lisp_Object prop; |
286 | 963 { |
964 register Lisp_Object tem; | |
965 | |
966 tem = Fassq (prop, *alistptr); | |
967 if (EQ (tem, Qnil)) | |
968 *alistptr = Fcons (Fcons (prop, val), *alistptr); | |
969 else | |
970 Fsetcdr (tem, val); | |
971 } | |
972 | |
973 void | |
765 | 974 store_frame_param (f, prop, val) |
975 struct frame *f; | |
286 | 976 Lisp_Object prop, val; |
977 { | |
978 register Lisp_Object tem; | |
979 | |
765 | 980 tem = Fassq (prop, f->param_alist); |
286 | 981 if (EQ (tem, Qnil)) |
765 | 982 f->param_alist = Fcons (Fcons (prop, val), f->param_alist); |
286 | 983 else |
984 Fsetcdr (tem, val); | |
539 | 985 |
986 if (EQ (prop, Qminibuffer) | |
987 && XTYPE (val) == Lisp_Window) | |
988 { | |
989 if (! MINI_WINDOW_P (XWINDOW (val))) | |
990 error ("Surrogate minibuffer windows must be minibuffer windows."); | |
991 | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
992 if (FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f)) |
765 | 993 error ("Can't change the surrogate minibuffer of a frame with its own minibuffer."); |
539 | 994 |
995 /* Install the chosen minibuffer window, with proper buffer. */ | |
765 | 996 f->minibuffer_window = val; |
539 | 997 } |
286 | 998 } |
999 | |
765 | 1000 DEFUN ("frame-parameters", Fframe_parameters, Sframe_parameters, 0, 1, 0, |
1001 "Return the parameters-alist of frame FRAME.\n\ | |
286 | 1002 It is a list of elements of the form (PARM . VALUE), where PARM is a symbol.\n\ |
777 | 1003 The meaningful PARMs depend on the kind of frame.\n\ |
1004 If FRAME is omitted, return information on the currently selected frame.") | |
765 | 1005 (frame) |
1006 Lisp_Object frame; | |
286 | 1007 { |
1008 Lisp_Object alist; | |
765 | 1009 struct frame *f; |
286 | 1010 |
765 | 1011 if (EQ (frame, Qnil)) |
1012 f = selected_frame; | |
286 | 1013 else |
1014 { | |
765 | 1015 CHECK_FRAME (frame, 0); |
1016 f = XFRAME (frame); | |
286 | 1017 } |
1018 | |
765 | 1019 if (f->display.nothing == 0) |
286 | 1020 return Qnil; |
1021 | |
765 | 1022 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
|
1023 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
|
1024 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
|
1025 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
|
1026 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
|
1027 store_in_alist (&alist, Qminibuffer, |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1028 (! FRAME_HAS_MINIBUF_P (f) ? Qnone |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1029 : (FRAME_MINIBUF_ONLY_P (f) ? Qonly |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1030 : FRAME_MINIBUF_WINDOW (f)))); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1031 store_in_alist (&alist, Qunsplittable, (f->no_split ? Qt : Qnil)); |
286 | 1032 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1033 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1034 if (FRAME_X_P (f)) |
765 | 1035 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
|
1036 #endif |
286 | 1037 return alist; |
1038 } | |
1039 | |
765 | 1040 DEFUN ("modify-frame-parameters", Fmodify_frame_parameters, |
1041 Smodify_frame_parameters, 2, 2, 0, | |
1042 "Modify the parameters of frame FRAME according to ALIST.\n\ | |
286 | 1043 ALIST is an alist of parameters to change and their new values.\n\ |
1044 Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.\n\ | |
765 | 1045 The meaningful PARMs depend on the kind of frame; undefined PARMs are ignored.") |
1046 (frame, alist) | |
1047 Lisp_Object frame, alist; | |
286 | 1048 { |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1049 FRAME_PTR f; |
286 | 1050 register Lisp_Object tail, elt, prop, val; |
1051 | |
765 | 1052 if (EQ (frame, Qnil)) |
1053 f = selected_frame; | |
286 | 1054 else |
1055 { | |
765 | 1056 CHECK_LIVE_FRAME (frame, 0); |
1057 f = XFRAME (frame); | |
286 | 1058 } |
1059 | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1060 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1061 if (FRAME_X_P (f)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1062 #if 1 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1063 x_set_frame_parameters (f, alist); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1064 #else |
286 | 1065 for (tail = alist; !EQ (tail, Qnil); tail = Fcdr (tail)) |
1066 { | |
1067 elt = Fcar (tail); | |
1068 prop = Fcar (elt); | |
1069 val = Fcdr (elt); | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1070 x_set_frame_param (f, prop, val, get_frame_param (f, prop)); |
765 | 1071 store_frame_param (f, prop, val); |
286 | 1072 } |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1073 #endif |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1074 #endif |
286 | 1075 |
1076 return Qnil; | |
1077 } | |
1078 | |
1079 | |
777 | 1080 #if 0 |
1081 /* This function isn't useful enough by itself to include; we need to | |
1082 add functions to allow the user to find the size of a font before | |
1083 this is actually useful. */ | |
1084 | |
765 | 1085 DEFUN ("frame-pixel-size", Fframe_pixel_size, |
1086 Sframe_pixel_size, 1, 1, 0, | |
1087 "Return a cons (width . height) of FRAME's size in pixels.") | |
1088 (frame) | |
1089 Lisp_Object frame; | |
286 | 1090 { |
765 | 1091 register struct frame *f; |
286 | 1092 int width, height; |
1093 | |
765 | 1094 CHECK_LIVE_FRAME (frame, 0); |
1095 f = XFRAME (frame); | |
286 | 1096 |
765 | 1097 return Fcons (make_number (x_pixel_width (f)), |
1098 make_number (x_pixel_height (f))); | |
286 | 1099 } |
777 | 1100 #endif |
1101 | |
1102 #if 0 | |
1103 /* These functions have no C callers, and can be written nicely in lisp. */ | |
286 | 1104 |
765 | 1105 DEFUN ("frame-height", Fframe_height, Sframe_height, 0, 0, 0, |
1106 "Return number of lines available for display on selected frame.") | |
286 | 1107 () |
1108 { | |
765 | 1109 return make_number (FRAME_HEIGHT (selected_frame)); |
286 | 1110 } |
1111 | |
765 | 1112 DEFUN ("frame-width", Fframe_width, Sframe_width, 0, 0, 0, |
1113 "Return number of columns available for display on selected frame.") | |
286 | 1114 () |
1115 { | |
765 | 1116 return make_number (FRAME_WIDTH (selected_frame)); |
286 | 1117 } |
777 | 1118 #endif |
286 | 1119 |
765 | 1120 DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0, |
1121 "Specify that the frame FRAME has LINES lines.\n\ | |
286 | 1122 Optional third arg non-nil means that redisplay should use LINES lines\n\ |
765 | 1123 but that the idea of the actual height of the frame should not be changed.") |
1124 (frame, rows, pretend) | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1125 Lisp_Object frame, rows, pretend; |
286 | 1126 { |
765 | 1127 register struct frame *f; |
286 | 1128 |
1129 CHECK_NUMBER (rows, 0); | |
765 | 1130 if (NILP (frame)) |
1131 f = selected_frame; | |
286 | 1132 else |
1133 { | |
765 | 1134 CHECK_LIVE_FRAME (frame, 0); |
1135 f = XFRAME (frame); | |
286 | 1136 } |
1137 | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1138 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1139 if (FRAME_X_P (f)) |
286 | 1140 { |
765 | 1141 if (XINT (rows) != f->width) |
1142 x_set_window_size (f, f->width, XINT (rows)); | |
286 | 1143 } |
1144 else | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1145 #endif |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1146 change_frame_size (f, XINT (rows), 0, !NILP (pretend), 0); |
286 | 1147 return Qnil; |
1148 } | |
1149 | |
765 | 1150 DEFUN ("set-frame-width", Fset_frame_width, Sset_frame_width, 2, 3, 0, |
1151 "Specify that the frame FRAME has COLS columns.\n\ | |
286 | 1152 Optional third arg non-nil means that redisplay should use COLS columns\n\ |
765 | 1153 but that the idea of the actual width of the frame should not be changed.") |
1154 (frame, cols, pretend) | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1155 Lisp_Object frame, cols, pretend; |
286 | 1156 { |
765 | 1157 register struct frame *f; |
286 | 1158 CHECK_NUMBER (cols, 0); |
765 | 1159 if (NILP (frame)) |
1160 f = selected_frame; | |
286 | 1161 else |
1162 { | |
765 | 1163 CHECK_LIVE_FRAME (frame, 0); |
1164 f = XFRAME (frame); | |
286 | 1165 } |
1166 | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1167 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1168 if (FRAME_X_P (f)) |
286 | 1169 { |
765 | 1170 if (XINT (cols) != f->width) |
1171 x_set_window_size (f, XINT (cols), f->height); | |
286 | 1172 } |
1173 else | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1174 #endif |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1175 change_frame_size (f, 0, XINT (cols), !NILP (pretend), 0); |
286 | 1176 return Qnil; |
1177 } | |
1178 | |
765 | 1179 DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 3, 0, |
1180 "Sets size of FRAME to COLS by ROWS, measured in characters.") | |
1181 (frame, cols, rows) | |
1182 Lisp_Object frame, cols, rows; | |
286 | 1183 { |
765 | 1184 register struct frame *f; |
286 | 1185 int mask; |
1186 | |
765 | 1187 CHECK_LIVE_FRAME (frame, 0); |
286 | 1188 CHECK_NUMBER (cols, 2); |
1189 CHECK_NUMBER (rows, 1); | |
765 | 1190 f = XFRAME (frame); |
286 | 1191 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1192 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1193 if (FRAME_X_P (f)) |
286 | 1194 { |
765 | 1195 if (XINT (rows) != f->height || XINT (cols) != f->width) |
1196 x_set_window_size (f, XINT (cols), XINT (rows)); | |
286 | 1197 } |
1198 else | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1199 #endif |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1200 change_frame_size (f, XINT (rows), XINT (cols), 0, 0); |
286 | 1201 |
1202 return Qnil; | |
1203 } | |
1204 | |
765 | 1205 DEFUN ("set-frame-position", Fset_frame_position, |
1206 Sset_frame_position, 3, 3, 0, | |
1207 "Sets position of FRAME in pixels to XOFFSET by YOFFSET.\n\ | |
454 | 1208 If XOFFSET or YOFFSET are negative, they are interpreted relative to\n\ |
765 | 1209 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
|
1210 off the screen.") |
765 | 1211 (frame, xoffset, yoffset) |
1212 Lisp_Object frame, xoffset, yoffset; | |
286 | 1213 { |
765 | 1214 register struct frame *f; |
286 | 1215 int mask; |
1216 | |
765 | 1217 CHECK_LIVE_FRAME (frame, 0); |
286 | 1218 CHECK_NUMBER (xoffset, 1); |
1219 CHECK_NUMBER (yoffset, 2); | |
765 | 1220 f = XFRAME (frame); |
286 | 1221 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1222 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1223 if (FRAME_X_P (f)) |
765 | 1224 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
|
1225 #endif |
286 | 1226 |
1227 return Qt; | |
1228 } | |
777 | 1229 |
286 | 1230 |
1231 #ifndef HAVE_X11 | |
1232 DEFUN ("rubber-band-rectangle", Frubber_band_rectangle, Srubber_band_rectangle, | |
1233 3, 3, "", | |
765 | 1234 "Ask user to specify a window position and size on FRAME with the mouse.\n\ |
1235 Arguments are FRAME, NAME and GEO. NAME is a name to be displayed as\n\ | |
286 | 1236 the purpose of this rectangle. GEO is an X-windows size spec that can\n\ |
1237 specify defaults for some sizes/positions. If GEO specifies everything,\n\ | |
1238 the mouse is not used.\n\ | |
765 | 1239 Returns a list of five values: (FRAME LEFT TOP WIDTH HEIGHT).") |
1240 (frame, name, geo) | |
1241 Lisp_Object frame; | |
286 | 1242 Lisp_Object name; |
1243 Lisp_Object geo; | |
1244 { | |
1245 int vals[4]; | |
1246 Lisp_Object nums[4]; | |
1247 int i; | |
1248 | |
765 | 1249 CHECK_FRAME (frame, 0); |
286 | 1250 CHECK_STRING (name, 1); |
1251 CHECK_STRING (geo, 2); | |
1252 | |
765 | 1253 switch (XFRAME (frame)->output_method) |
286 | 1254 { |
1255 case output_x_window: | |
765 | 1256 x_rubber_band (XFRAME (frame), &vals[0], &vals[1], &vals[2], &vals[3], |
286 | 1257 XSTRING (geo)->data, XSTRING (name)->data); |
1258 break; | |
1259 | |
1260 default: | |
1261 return Qnil; | |
1262 } | |
1263 | |
1264 for (i = 0; i < 4; i++) | |
1265 XFASTINT (nums[i]) = vals[i]; | |
765 | 1266 return Fcons (frame, Flist (4, nums)); |
286 | 1267 return Qnil; |
1268 } | |
1269 #endif /* not HAVE_X11 */ | |
1270 | |
765 | 1271 choose_minibuf_frame () |
286 | 1272 { |
765 | 1273 /* For lowest-level minibuf, put it on currently selected frame |
1274 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
|
1275 |
286 | 1276 if (minibuf_level == 0 |
765 | 1277 && 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
|
1278 && !EQ (minibuf_window, selected_frame->minibuffer_window)) |
286 | 1279 { |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1280 /* 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
|
1281 window anymore. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1282 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
|
1283 abort (); |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1284 |
765 | 1285 Fset_window_buffer (selected_frame->minibuffer_window, |
286 | 1286 XWINDOW (minibuf_window)->buffer); |
765 | 1287 minibuf_window = selected_frame->minibuffer_window; |
286 | 1288 } |
1289 } | |
1290 | |
765 | 1291 syms_of_frame () |
286 | 1292 { |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1293 /*&&& init symbols here &&&*/ |
765 | 1294 Qframep = intern ("framep"); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1295 staticpro (&Qframep); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1296 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
|
1297 staticpro (&Qlive_frame_p); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1298 Qheight = intern ("height"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1299 staticpro (&Qheight); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1300 Qicon = intern ("icon"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1301 staticpro (&Qicon); |
539 | 1302 Qminibuffer = intern ("minibuffer"); |
1303 staticpro (&Qminibuffer); | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1304 Qmodeline = intern ("modeline"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1305 staticpro (&Qmodeline); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1306 Qname = intern ("name"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1307 staticpro (&Qname); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1308 Qnone = intern ("none"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1309 staticpro (&Qnone); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1310 Qonly = intern ("only"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1311 staticpro (&Qonly); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1312 Qunsplittable = intern ("unsplittable"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1313 staticpro (&Qunsplittable); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1314 Qwidth = intern ("width"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1315 staticpro (&Qwidth); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1316 Qx = intern ("x"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1317 staticpro (&Qx); |
286 | 1318 |
765 | 1319 staticpro (&Vframe_list); |
286 | 1320 |
765 | 1321 DEFVAR_LISP ("terminal-frame", &Vterminal_frame, |
1322 "The initial frame-object, which represents Emacs's stdout."); | |
286 | 1323 |
1324 DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified, | |
765 | 1325 "Non-nil if all of emacs is iconified and frame updates are not needed."); |
286 | 1326 Vemacs_iconified = Qnil; |
1327 | |
765 | 1328 DEFVAR_LISP ("default-minibuffer-frame", &Vdefault_minibuffer_frame, |
1329 "Minibufferless frames use this frame's minibuffer.\n\ | |
454 | 1330 \n\ |
765 | 1331 Emacs cannot create minibufferless frames unless this is set to an\n\ |
454 | 1332 appropriate surrogate.\n\ |
1333 \n\ | |
1334 Emacs consults this variable only when creating minibufferless\n\ | |
765 | 1335 frames; once the frame is created, it sticks with its assigned\n\ |
454 | 1336 minibuffer, no matter what this variable is set to. This means that\n\ |
1337 this variable doesn't necessarily say anything meaningful about the\n\ | |
765 | 1338 current set of frames, or where the minibuffer is currently being\n\ |
454 | 1339 displayed."); |
765 | 1340 Vdefault_minibuffer_frame = Qnil; |
286 | 1341 |
765 | 1342 DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist, |
1343 "Alist of default values for frame creation.\n\ | |
386 | 1344 These may be set in your init file, like this:\n\ |
765 | 1345 (setq default-frame-alist '((width . 80) (height . 55)))\n\ |
386 | 1346 These override values given in window system configuration data, like\n\ |
1347 X Windows' defaults database.\n\ | |
765 | 1348 For values specific to the first Emacs frame, see `initial-frame-alist'.\n\ |
1349 For values specific to the separate minibuffer frame, see\n\ | |
1350 `minibuffer-frame-alist'."); | |
1351 Vdefault_frame_alist = Qnil; | |
386 | 1352 |
765 | 1353 defsubr (&Sframep); |
1354 defsubr (&Slive_frame_p); | |
1355 defsubr (&Sselect_frame); | |
1356 defsubr (&Sselected_frame); | |
1357 defsubr (&Swindow_frame); | |
1358 defsubr (&Sframe_root_window); | |
1359 defsubr (&Sframe_selected_window); | |
1360 defsubr (&Sframe_list); | |
1361 defsubr (&Snext_frame); | |
1362 defsubr (&Sdelete_frame); | |
454 | 1363 defsubr (&Smouse_position); |
286 | 1364 defsubr (&Sset_mouse_position); |
1365 #if 0 | |
765 | 1366 defsubr (&Sframe_configuration); |
1367 defsubr (&Srestore_frame_configuration); | |
286 | 1368 #endif |
765 | 1369 defsubr (&Smake_frame_visible); |
1370 defsubr (&Smake_frame_invisible); | |
1371 defsubr (&Siconify_frame); | |
1372 defsubr (&Sframe_visible_p); | |
1373 defsubr (&Svisible_frame_list); | |
1374 defsubr (&Sredirect_frame_focus); | |
1375 defsubr (&Sframe_focus); | |
1376 defsubr (&Sframe_parameters); | |
1377 defsubr (&Smodify_frame_parameters); | |
785 | 1378 #if 0 |
765 | 1379 defsubr (&Sframe_pixel_size); |
1380 defsubr (&Sframe_height); | |
1381 defsubr (&Sframe_width); | |
785 | 1382 #endif |
765 | 1383 defsubr (&Sset_frame_height); |
1384 defsubr (&Sset_frame_width); | |
1385 defsubr (&Sset_frame_size); | |
1386 defsubr (&Sset_frame_position); | |
286 | 1387 #ifndef HAVE_X11 |
1388 defsubr (&Srubber_band_rectangle); | |
1389 #endif /* HAVE_X11 */ | |
1390 } | |
732 | 1391 |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1392 keys_of_frame () |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1393 { |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1394 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
|
1395 } |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1396 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1397 #else /* not MULTI_FRAME */ |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1398 |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1399 /* 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
|
1400 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
|
1401 |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1402 /* 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
|
1403 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
|
1404 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
|
1405 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
|
1406 "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
|
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 { |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1409 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
|
1410 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
|
1411 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
|
1412 } |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1413 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1414 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
|
1415 "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
|
1416 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
|
1417 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
|
1418 (frame, rows, pretend) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1419 Lisp_Object frame, rows, pretend; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1420 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1421 CHECK_NUMBER (rows, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1422 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1423 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
|
1424 return Qnil; |
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 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1427 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
|
1428 "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
|
1429 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
|
1430 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
|
1431 (frame, cols, pretend) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1432 Lisp_Object frame, cols, pretend; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1433 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1434 CHECK_NUMBER (cols, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1435 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1436 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
|
1437 return Qnil; |
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 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1440 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
|
1441 "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
|
1442 (frame, cols, rows) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1443 Lisp_Object frame, cols, rows; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1444 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1445 CHECK_NUMBER (cols, 2); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1446 CHECK_NUMBER (rows, 1); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1447 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1448 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
|
1449 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1450 return Qnil; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1451 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1452 |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1453 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
|
1454 "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
|
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 { |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1457 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
|
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 |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1460 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
|
1461 "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
|
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 { |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1464 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
|
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 |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1467 /* 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
|
1468 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1469 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
|
1470 "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
|
1471 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
|
1472 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
|
1473 (lines, pretend) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1474 Lisp_Object lines, pretend; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1475 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1476 CHECK_NUMBER (lines, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1477 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1478 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
|
1479 return Qnil; |
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 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1482 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
|
1483 "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
|
1484 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
|
1485 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
|
1486 (cols, pretend) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1487 Lisp_Object cols, pretend; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1488 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1489 CHECK_NUMBER (cols, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1490 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1491 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
|
1492 return Qnil; |
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 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1495 syms_of_frame () |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1496 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1497 defsubr (&Sset_frame_height); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1498 defsubr (&Sset_frame_width); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1499 defsubr (&Sset_frame_size); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1500 defsubr (&Sset_screen_height); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1501 defsubr (&Sset_screen_width); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1502 defsubr (&Sframe_height); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1503 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
|
1504 defsubr (&Sframe_width); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1505 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
|
1506 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1507 |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1508 keys_of_frame () |
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 } |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1511 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1512 #endif /* not MULTI_FRAME */ |
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 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1516 |