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