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