Mercurial > emacs
annotate src/frame.c @ 5177:367adcd3c4fb
(HAVE_FTIME): Deleted (autoconf does it).
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 25 Nov 1993 11:48:28 +0000 |
parents | 9aa201005b16 |
children | 6646271e8d32 |
rev | line source |
---|---|
765 | 1 /* Generic frame functions. |
2961 | 2 Copyright (C) 1993 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 | |
4696
1fc792473491
Include <config.h> instead of "config.h".
Roland McGrath <roland@gnu.org>
parents:
4587
diff
changeset
|
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; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
77 Lisp_Object Qframe_live_p; |
965
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 Qonly; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
84 Lisp_Object Qunsplittable; |
2131
468df2d7e371
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2068
diff
changeset
|
85 Lisp_Object Qmenu_bar_lines; |
965
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 (); | |
5172
9aa201005b16
(Fhandle_switch_frame, Fredirect_frame_focus): Declared.
Richard M. Stallman <rms@gnu.org>
parents:
5105
diff
changeset
|
91 extern Lisp_Object Fhandle_switch_frame (); |
9aa201005b16
(Fhandle_switch_frame, Fredirect_frame_focus): Declared.
Richard M. Stallman <rms@gnu.org>
parents:
5105
diff
changeset
|
92 extern Lisp_Object Fredirect_frame_focus (); |
286 | 93 |
765 | 94 DEFUN ("framep", Fframep, Sframep, 1, 1, 0, |
95 "Return non-nil if OBJECT is a frame.\n\ | |
96 Value is t for a termcap frame (a character-only terminal),\n\ | |
97 `x' for an Emacs frame that is really an X window.\n\ | |
98 Also see `live-frame-p'.") | |
454 | 99 (object) |
100 Lisp_Object object; | |
286 | 101 { |
765 | 102 if (XTYPE (object) != Lisp_Frame) |
286 | 103 return Qnil; |
765 | 104 switch (XFRAME (object)->output_method) |
286 | 105 { |
106 case output_termcap: | |
107 return Qt; | |
108 case output_x_window: | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
109 return Qx; |
286 | 110 default: |
111 abort (); | |
112 } | |
113 } | |
114 | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
115 DEFUN ("frame-live-p", Fframe_live_p, Sframe_live_p, 1, 1, 0, |
765 | 116 "Return non-nil if OBJECT is a frame which has not been deleted.\n\ |
117 Value is nil if OBJECT is not a live frame. If object is a live\n\ | |
118 frame, the return value indicates what sort of output device it is\n\ | |
119 displayed on. Value is t for a termcap frame (a character-only\n\ | |
120 terminal), `x' for an Emacs frame being displayed in an X window.") | |
454 | 121 (object) |
122 Lisp_Object object; | |
123 { | |
765 | 124 return ((FRAMEP (object) |
125 && FRAME_LIVE_P (XFRAME (object))) | |
126 ? Fframep (object) | |
454 | 127 : Qnil); |
128 } | |
129 | |
765 | 130 struct frame * |
131 make_frame (mini_p) | |
286 | 132 int mini_p; |
133 { | |
765 | 134 Lisp_Object frame; |
135 register struct frame *f; | |
286 | 136 register Lisp_Object root_window; |
137 register Lisp_Object mini_window; | |
138 | |
765 | 139 frame = Fmake_vector (((sizeof (struct frame) - (sizeof (Lisp_Vector) |
363 | 140 - sizeof (Lisp_Object))) |
141 / sizeof (Lisp_Object)), | |
286 | 142 make_number (0)); |
765 | 143 XSETTYPE (frame, Lisp_Frame); |
144 f = XFRAME (frame); | |
286 | 145 |
765 | 146 f->cursor_x = 0; |
147 f->cursor_y = 0; | |
148 f->current_glyphs = 0; | |
149 f->desired_glyphs = 0; | |
150 f->visible = 0; | |
1652
93497cd89204
* frame.c (make_frame): Initialize async_visible and
Jim Blandy <jimb@redhat.com>
parents:
1514
diff
changeset
|
151 f->async_visible = 0; |
765 | 152 f->display.nothing = 0; |
153 f->iconified = 0; | |
1652
93497cd89204
* frame.c (make_frame): Initialize async_visible and
Jim Blandy <jimb@redhat.com>
parents:
1514
diff
changeset
|
154 f->async_iconified = 0; |
765 | 155 f->wants_modeline = 1; |
156 f->auto_raise = 0; | |
157 f->auto_lower = 0; | |
158 f->no_split = 0; | |
159 f->garbaged = 0; | |
160 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
|
161 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
|
162 f->explicit_name = 0; |
1989
b1c1ab20f810
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1920
diff
changeset
|
163 f->can_have_scroll_bars = 0; |
b1c1ab20f810
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1920
diff
changeset
|
164 f->has_vertical_scroll_bars = 0; |
765 | 165 f->param_alist = Qnil; |
1989
b1c1ab20f810
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1920
diff
changeset
|
166 f->scroll_bars = Qnil; |
b1c1ab20f810
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1920
diff
changeset
|
167 f->condemned_scroll_bars = Qnil; |
2417
8c07933beed9
(make_frame): Init face_alist field.
Richard M. Stallman <rms@gnu.org>
parents:
2298
diff
changeset
|
168 f->face_alist = Qnil; |
286 | 169 |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
170 root_window = make_window (); |
286 | 171 if (mini_p) |
172 { | |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
173 mini_window = make_window (); |
286 | 174 XWINDOW (root_window)->next = mini_window; |
175 XWINDOW (mini_window)->prev = root_window; | |
176 XWINDOW (mini_window)->mini_p = Qt; | |
765 | 177 XWINDOW (mini_window)->frame = frame; |
178 f->minibuffer_window = mini_window; | |
286 | 179 } |
180 else | |
181 { | |
182 mini_window = Qnil; | |
183 XWINDOW (root_window)->next = Qnil; | |
765 | 184 f->minibuffer_window = Qnil; |
286 | 185 } |
186 | |
765 | 187 XWINDOW (root_window)->frame = frame; |
286 | 188 |
189 /* 10 is arbitrary, | |
190 just so that there is "something there." | |
765 | 191 Correct size will be set up later with change_frame_size. */ |
286 | 192 |
765 | 193 f->width = 10; |
194 f->height = 10; | |
286 | 195 |
196 XFASTINT (XWINDOW (root_window)->width) = 10; | |
197 XFASTINT (XWINDOW (root_window)->height) = (mini_p ? 9 : 10); | |
198 | |
199 if (mini_p) | |
200 { | |
201 XFASTINT (XWINDOW (mini_window)->width) = 10; | |
202 XFASTINT (XWINDOW (mini_window)->top) = 9; | |
203 XFASTINT (XWINDOW (mini_window)->height) = 1; | |
204 } | |
205 | |
765 | 206 /* Choose a buffer for the frame's root window. */ |
386 | 207 { |
208 Lisp_Object buf; | |
209 | |
210 XWINDOW (root_window)->buffer = Qt; | |
211 buf = Fcurrent_buffer (); | |
212 /* If buf is a 'hidden' buffer (i.e. one whose name starts with | |
213 a space), try to find another one. */ | |
214 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
|
215 buf = Fother_buffer (buf, Qnil); |
386 | 216 Fset_window_buffer (root_window, buf); |
217 } | |
218 | |
286 | 219 if (mini_p) |
220 { | |
221 XWINDOW (mini_window)->buffer = Qt; | |
222 Fset_window_buffer (mini_window, | |
485 | 223 (NILP (Vminibuffer_list) |
286 | 224 ? get_minibuffer (0) |
225 : Fcar (Vminibuffer_list))); | |
226 } | |
227 | |
765 | 228 f->root_window = root_window; |
229 f->selected_window = root_window; | |
363 | 230 /* Make sure this window seems more recently used than |
231 a newly-created, never-selected window. */ | |
765 | 232 XFASTINT (XWINDOW (f->selected_window)->use_time) = ++window_select_count; |
286 | 233 |
765 | 234 Vframe_list = Fcons (frame, Vframe_list); |
286 | 235 |
765 | 236 return f; |
286 | 237 } |
238 | |
765 | 239 /* Make a frame using a separate minibuffer window on another frame. |
286 | 240 MINI_WINDOW is the minibuffer window to use. nil means use the |
241 default (the global minibuffer). */ | |
242 | |
765 | 243 struct frame * |
244 make_frame_without_minibuffer (mini_window) | |
286 | 245 register Lisp_Object mini_window; |
246 { | |
765 | 247 register struct frame *f; |
286 | 248 |
249 /* Choose the minibuffer window to use. */ | |
485 | 250 if (NILP (mini_window)) |
286 | 251 { |
765 | 252 if (XTYPE (Vdefault_minibuffer_frame) != Lisp_Frame) |
253 error ("default-minibuffer-frame must be set when creating minibufferless frames"); | |
254 if (! FRAME_LIVE_P (XFRAME (Vdefault_minibuffer_frame))) | |
255 error ("default-minibuffer-frame must be a live frame"); | |
256 mini_window = XFRAME (Vdefault_minibuffer_frame)->minibuffer_window; | |
286 | 257 } |
258 else | |
259 { | |
1437
36ef55ecb265
* frame.c (make_frame_without_minibuffer, Fwindow_frame): Use
Jim Blandy <jimb@redhat.com>
parents:
1385
diff
changeset
|
260 CHECK_LIVE_WINDOW (mini_window, 0); |
286 | 261 } |
262 | |
765 | 263 /* Make a frame containing just a root window. */ |
264 f = make_frame (0); | |
286 | 265 |
266 /* Install the chosen minibuffer window, with proper buffer. */ | |
765 | 267 f->minibuffer_window = mini_window; |
286 | 268 Fset_window_buffer (mini_window, |
485 | 269 (NILP (Vminibuffer_list) |
286 | 270 ? get_minibuffer (0) |
271 : Fcar (Vminibuffer_list))); | |
765 | 272 return f; |
286 | 273 } |
274 | |
765 | 275 /* Make a frame containing only a minibuffer window. */ |
286 | 276 |
765 | 277 struct frame * |
278 make_minibuffer_frame () | |
286 | 279 { |
765 | 280 /* First make a frame containing just a root window, no minibuffer. */ |
286 | 281 |
765 | 282 register struct frame *f = make_frame (0); |
286 | 283 register Lisp_Object mini_window; |
765 | 284 register Lisp_Object frame; |
286 | 285 |
765 | 286 XSET (frame, Lisp_Frame, f); |
286 | 287 |
1006
a13ee72d74a2
* frame.c (make_frame): Clear the explicit_name member of the new
Jim Blandy <jimb@redhat.com>
parents:
987
diff
changeset
|
288 f->auto_raise = 0; |
765 | 289 f->auto_lower = 0; |
290 f->no_split = 1; | |
291 f->wants_modeline = 0; | |
292 f->has_minibuffer = 1; | |
286 | 293 |
294 /* Now label the root window as also being the minibuffer. | |
295 Avoid infinite looping on the window chain by marking next pointer | |
296 as nil. */ | |
297 | |
765 | 298 mini_window = f->minibuffer_window = f->root_window; |
286 | 299 XWINDOW (mini_window)->mini_p = Qt; |
300 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
|
301 XWINDOW (mini_window)->prev = Qnil; |
765 | 302 XWINDOW (mini_window)->frame = frame; |
286 | 303 |
304 /* Put the proper buffer in that window. */ | |
305 | |
306 Fset_window_buffer (mini_window, | |
485 | 307 (NILP (Vminibuffer_list) |
286 | 308 ? get_minibuffer (0) |
309 : Fcar (Vminibuffer_list))); | |
765 | 310 return f; |
286 | 311 } |
312 | |
765 | 313 /* Construct a frame that refers to the terminal (stdin and stdout). */ |
286 | 314 |
765 | 315 struct frame * |
316 make_terminal_frame () | |
286 | 317 { |
765 | 318 register struct frame *f; |
286 | 319 |
765 | 320 Vframe_list = Qnil; |
321 f = make_frame (1); | |
322 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
|
323 FRAME_SET_VISIBLE (f, 1); |
765 | 324 f->display.nothing = 1; /* Nonzero means frame isn't deleted. */ |
325 XSET (Vterminal_frame, Lisp_Frame, f); | |
326 return f; | |
286 | 327 } |
328 | |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
329 DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 2, "e", |
2298
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
330 "Select the frame FRAME.\n\ |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3497
diff
changeset
|
331 Subsequent editing commands apply to its selected window.\n\ |
2298
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
332 The selection of FRAME lasts until the next time the user does\n\ |
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
333 something to select a different frame, or until the next time this\n\ |
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
334 function is called.") |
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
335 (frame, no_enter) |
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
336 Lisp_Object frame, no_enter; |
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
337 { |
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
338 return Fhandle_switch_frame (frame, no_enter); |
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
339 } |
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
340 |
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
341 |
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
342 DEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 2, "e", |
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
343 "Handle a switch-frame event EVENT.\n\ |
4798 | 344 Switch-frame events are usually bound to this function.\n\ |
2298
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
345 A switch-frame event tells Emacs that the window manager has requested\n\ |
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
346 that the user's events be directed to the frame mentioned in the event.\n\ |
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
347 This function selects the selected window of the frame of EVENT.\n\ |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
348 \n\ |
2298
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
349 If EVENT is frame object, handle it as if it were a switch-frame event\n\ |
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
350 to that frame.") |
765 | 351 (frame, no_enter) |
352 Lisp_Object frame, no_enter; | |
286 | 353 { |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
354 /* 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
|
355 switch to. */ |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
356 if (CONSP (frame) |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
357 && EQ (XCONS (frame)->car, Qswitch_frame) |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
358 && CONSP (XCONS (frame)->cdr)) |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
359 frame = XCONS (XCONS (frame)->cdr)->car; |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
360 |
765 | 361 CHECK_LIVE_FRAME (frame, 0); |
286 | 362 |
765 | 363 if (selected_frame == XFRAME (frame)) |
364 return frame; | |
286 | 365 |
1709
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
366 /* 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
|
367 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
|
368 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
|
369 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
|
370 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
|
371 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
|
372 around. */ |
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
373 { |
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
374 Lisp_Object tail; |
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 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
|
377 { |
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
378 Lisp_Object focus; |
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
379 |
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
380 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
|
381 abort (); |
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
382 |
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
383 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
|
384 |
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
385 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
|
386 && XFRAME (focus) == selected_frame) |
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
387 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
|
388 } |
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
389 } |
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
390 |
765 | 391 selected_frame = XFRAME (frame); |
392 if (! FRAME_MINIBUF_ONLY_P (selected_frame)) | |
393 last_nonminibuf_frame = selected_frame; | |
363 | 394 |
765 | 395 Fselect_window (XFRAME (frame)->selected_window); |
396 choose_minibuf_frame (); | |
286 | 397 |
1920
ac5e559a819a
* frame.c (Fselect_frame): Set Vlast_event_frame to Qnil after
Jim Blandy <jimb@redhat.com>
parents:
1870
diff
changeset
|
398 /* We want to make sure that the next event generates a frame-switch |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3497
diff
changeset
|
399 event to the appropriate frame. This seems kludgy to me, but |
1920
ac5e559a819a
* frame.c (Fselect_frame): Set Vlast_event_frame to Qnil after
Jim Blandy <jimb@redhat.com>
parents:
1870
diff
changeset
|
400 before you take it out, make sure that evaluating something like |
ac5e559a819a
* frame.c (Fselect_frame): Set Vlast_event_frame to Qnil after
Jim Blandy <jimb@redhat.com>
parents:
1870
diff
changeset
|
401 (select-window (frame-root-window (new-frame))) doesn't end up |
ac5e559a819a
* frame.c (Fselect_frame): Set Vlast_event_frame to Qnil after
Jim Blandy <jimb@redhat.com>
parents:
1870
diff
changeset
|
402 with your typing being interpreted in the new frame instead of |
ac5e559a819a
* frame.c (Fselect_frame): Set Vlast_event_frame to Qnil after
Jim Blandy <jimb@redhat.com>
parents:
1870
diff
changeset
|
403 the one you're actually typing in. */ |
1989
b1c1ab20f810
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1920
diff
changeset
|
404 internal_last_event_frame = Qnil; |
1920
ac5e559a819a
* frame.c (Fselect_frame): Set Vlast_event_frame to Qnil after
Jim Blandy <jimb@redhat.com>
parents:
1870
diff
changeset
|
405 |
765 | 406 return frame; |
286 | 407 } |
408 | |
765 | 409 DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0, |
410 "Return the frame that is now selected.") | |
286 | 411 () |
412 { | |
413 Lisp_Object tem; | |
765 | 414 XSET (tem, Lisp_Frame, selected_frame); |
286 | 415 return tem; |
416 } | |
417 | |
765 | 418 DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0, |
419 "Return the frame object that window WINDOW is on.") | |
286 | 420 (window) |
421 Lisp_Object window; | |
422 { | |
1437
36ef55ecb265
* frame.c (make_frame_without_minibuffer, Fwindow_frame): Use
Jim Blandy <jimb@redhat.com>
parents:
1385
diff
changeset
|
423 CHECK_LIVE_WINDOW (window, 0); |
765 | 424 return XWINDOW (window)->frame; |
286 | 425 } |
426 | |
765 | 427 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
|
428 "Returns the root-window of FRAME.\n\ |
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
429 If omitted, FRAME defaults to the currently selected frame.") |
765 | 430 (frame) |
431 Lisp_Object frame; | |
286 | 432 { |
765 | 433 if (NILP (frame)) |
434 XSET (frame, Lisp_Frame, selected_frame); | |
454 | 435 else |
765 | 436 CHECK_LIVE_FRAME (frame, 0); |
286 | 437 |
765 | 438 return XFRAME (frame)->root_window; |
286 | 439 } |
440 | |
765 | 441 DEFUN ("frame-selected-window", Fframe_selected_window, |
442 Sframe_selected_window, 0, 1, 0, | |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
443 "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
|
444 If omitted, FRAME defaults to the currently selected frame.") |
765 | 445 (frame) |
446 Lisp_Object frame; | |
286 | 447 { |
765 | 448 if (NILP (frame)) |
449 XSET (frame, Lisp_Frame, selected_frame); | |
454 | 450 else |
765 | 451 CHECK_LIVE_FRAME (frame, 0); |
286 | 452 |
765 | 453 return XFRAME (frame)->selected_window; |
286 | 454 } |
455 | |
765 | 456 DEFUN ("frame-list", Fframe_list, Sframe_list, |
286 | 457 0, 0, 0, |
765 | 458 "Return a list of all frames.") |
286 | 459 () |
460 { | |
765 | 461 return Fcopy_sequence (Vframe_list); |
286 | 462 } |
463 | |
765 | 464 /* Return the next frame in the frame list after FRAME. |
465 If MINIBUF is nil, exclude minibuffer-only frames. | |
466 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
|
467 their minibuffer. |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
468 If MINIBUF is non-nil, and not a window, include all frames. */ |
286 | 469 Lisp_Object |
765 | 470 next_frame (frame, minibuf) |
471 Lisp_Object frame; | |
454 | 472 Lisp_Object minibuf; |
286 | 473 { |
474 Lisp_Object tail; | |
475 int passed = 0; | |
476 | |
765 | 477 /* There must always be at least one frame in Vframe_list. */ |
478 if (! CONSP (Vframe_list)) | |
454 | 479 abort (); |
480 | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
481 /* If this frame is dead, it won't be in Vframe_list, and we'll loop |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
482 forever. Forestall that. */ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
483 CHECK_LIVE_FRAME (frame, 0); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
484 |
286 | 485 while (1) |
765 | 486 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr) |
286 | 487 { |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
488 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
|
489 |
286 | 490 if (passed) |
363 | 491 { |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
492 /* 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
|
493 |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
494 /* 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
|
495 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
|
496 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
|
497 return f; |
335 | 498 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
499 /* 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
|
500 if (NILP (minibuf)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
501 { |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
502 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
|
503 return f; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
504 } |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
505 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
|
506 { |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
507 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
|
508 return f; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
509 } |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
510 else |
765 | 511 return f; |
363 | 512 } |
286 | 513 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
514 if (EQ (frame, f)) |
286 | 515 passed++; |
516 } | |
517 } | |
518 | |
765 | 519 /* Return the previous frame in the frame list before FRAME. |
520 If MINIBUF is nil, exclude minibuffer-only frames. | |
521 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
|
522 their minibuffer. |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
523 If MINIBUF is non-nil and not a window, include all frames. */ |
286 | 524 Lisp_Object |
765 | 525 prev_frame (frame, minibuf) |
526 Lisp_Object frame; | |
454 | 527 Lisp_Object minibuf; |
286 | 528 { |
529 Lisp_Object tail; | |
530 Lisp_Object prev; | |
531 | |
765 | 532 /* There must always be at least one frame in Vframe_list. */ |
533 if (! CONSP (Vframe_list)) | |
454 | 534 abort (); |
535 | |
286 | 536 prev = Qnil; |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
537 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr) |
454 | 538 { |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
539 Lisp_Object f = XCONS (tail)->car; |
454 | 540 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
541 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
|
542 abort (); |
454 | 543 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
544 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
|
545 return prev; |
454 | 546 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
547 /* 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
|
548 according to minibuf. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
549 if (NILP (minibuf)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
550 { |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
551 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
|
552 prev = f; |
454 | 553 } |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
554 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
|
555 { |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
556 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
|
557 prev = f; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
558 } |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
559 else |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
560 prev = f; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
561 } |
454 | 562 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
563 /* 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
|
564 if (NILP (prev)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
565 /* 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
|
566 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
|
567 return frame; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
568 else |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
569 /* 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
|
570 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
|
571 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
|
572 return prev; |
286 | 573 } |
574 | |
4424
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
575 |
765 | 576 DEFUN ("next-frame", Fnext_frame, Snext_frame, 0, 2, 0, |
577 "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
|
578 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
|
579 If omitted, FRAME defaults to the selected frame.\n\ |
4227
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
580 If optional argument MINIFRAME is nil, exclude minibuffer-only frames.\n\ |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
581 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
|
582 minibuffer.\n\ |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
583 If MINIFRAME is non-nil and not a window, include all frames.") |
765 | 584 (frame, miniframe) |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
585 Lisp_Object frame, miniframe; |
286 | 586 { |
587 Lisp_Object tail; | |
588 | |
765 | 589 if (NILP (frame)) |
590 XSET (frame, Lisp_Frame, selected_frame); | |
454 | 591 else |
765 | 592 CHECK_LIVE_FRAME (frame, 0); |
286 | 593 |
765 | 594 return next_frame (frame, miniframe); |
286 | 595 } |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
596 |
4424
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
597 DEFUN ("previous-frame", Fprevious_frame, Sprevious_frame, 0, 2, 0, |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
598 "Return the previous frame in the frame list before FRAME.\n\ |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
599 By default, skip minibuffer-only frames.\n\ |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
600 If omitted, FRAME defaults to the selected frame.\n\ |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
601 If optional argument MINIFRAME is nil, exclude minibuffer-only frames.\n\ |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
602 If MINIFRAME is a window, include only frames using that window for their\n\ |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
603 minibuffer.\n\ |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
604 If MINIFRAME is non-nil and not a window, include all frames.") |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
605 (frame, miniframe) |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
606 Lisp_Object frame, miniframe; |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
607 { |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
608 Lisp_Object tail; |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
609 |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
610 if (NILP (frame)) |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
611 XSET (frame, Lisp_Frame, selected_frame); |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
612 else |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
613 CHECK_LIVE_FRAME (frame, 0); |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
614 |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
615 return prev_frame (frame, miniframe); |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
616 } |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
617 |
286 | 618 |
4341
d07ef5ea3b58
(Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents:
4227
diff
changeset
|
619 DEFUN ("delete-frame", Fdelete_frame, Sdelete_frame, 0, 2, "", |
765 | 620 "Delete FRAME, permanently eliminating it from use.\n\ |
621 If omitted, FRAME defaults to the selected frame.\n\ | |
4341
d07ef5ea3b58
(Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents:
4227
diff
changeset
|
622 A frame may not be deleted if its minibuffer is used by other frames.\n\ |
d07ef5ea3b58
(Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents:
4227
diff
changeset
|
623 Normally, you may not delete a frame if all other frames are invisible,\n\ |
d07ef5ea3b58
(Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents:
4227
diff
changeset
|
624 but if the second optional argument FORCE is non-nil, you may do so.") |
d07ef5ea3b58
(Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents:
4227
diff
changeset
|
625 (frame, force) |
d07ef5ea3b58
(Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents:
4227
diff
changeset
|
626 Lisp_Object frame, force; |
286 | 627 { |
765 | 628 struct frame *f; |
286 | 629 |
765 | 630 if (EQ (frame, Qnil)) |
286 | 631 { |
765 | 632 f = selected_frame; |
633 XSET (frame, Lisp_Frame, f); | |
286 | 634 } |
635 else | |
636 { | |
765 | 637 CHECK_FRAME (frame, 0); |
638 f = XFRAME (frame); | |
286 | 639 } |
640 | |
765 | 641 if (! FRAME_LIVE_P (f)) |
1920
ac5e559a819a
* frame.c (Fselect_frame): Set Vlast_event_frame to Qnil after
Jim Blandy <jimb@redhat.com>
parents:
1870
diff
changeset
|
642 return Qnil; |
454 | 643 |
4227
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
644 /* If all other frames are invisible, refuse to delete. |
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
645 (Exception: allow deleting the terminal frame when using X.) */ |
4341
d07ef5ea3b58
(Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents:
4227
diff
changeset
|
646 if (f == selected_frame && NILP (force)) |
4227
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
647 { |
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
648 Lisp_Object frames; |
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
649 int count = 0; |
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
650 |
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
651 for (frames = Vframe_list; |
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
652 CONSP (frames); |
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
653 frames = XCONS (frames)->cdr) |
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
654 { |
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
655 Lisp_Object this = XCONS (frames)->car; |
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
656 |
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
657 if (FRAME_VISIBLE_P (XFRAME (this)) |
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
658 || FRAME_ICONIFIED_P (XFRAME (this)) |
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
659 /* Allow deleting the terminal frame when at least |
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
660 one X frame exists! */ |
4587
3c67dd995bc5
(Fdelete_frame): Add parens for clarity.
Richard M. Stallman <rms@gnu.org>
parents:
4424
diff
changeset
|
661 || (FRAME_X_P (XFRAME (this)) && !FRAME_X_P (f))) |
4227
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
662 count++; |
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
663 } |
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
664 if (count == 1) |
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
665 error ("Attempt to delete the only frame"); |
b283670201b4
(Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents:
3970
diff
changeset
|
666 } |
286 | 667 |
765 | 668 /* Does this frame have a minibuffer, and is it the surrogate |
669 minibuffer for any other frame? */ | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
670 if (FRAME_HAS_MINIBUF_P (XFRAME (frame))) |
363 | 671 { |
765 | 672 Lisp_Object frames; |
708 | 673 |
765 | 674 for (frames = Vframe_list; |
675 CONSP (frames); | |
676 frames = XCONS (frames)->cdr) | |
708 | 677 { |
765 | 678 Lisp_Object this = XCONS (frames)->car; |
363 | 679 |
765 | 680 if (! EQ (this, frame) |
681 && EQ (frame, | |
682 (WINDOW_FRAME | |
708 | 683 (XWINDOW |
765 | 684 (FRAME_MINIBUF_WINDOW |
685 (XFRAME (this))))))) | |
686 error ("Attempt to delete a surrogate minibuffer frame"); | |
708 | 687 } |
286 | 688 } |
689 | |
765 | 690 /* Don't let the frame remain selected. */ |
691 if (f == selected_frame) | |
2298
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
692 Fhandle_switch_frame (next_frame (frame, Qt), Qnil); |
286 | 693 |
765 | 694 /* Don't allow minibuf_window to remain on a deleted frame. */ |
695 if (EQ (f->minibuffer_window, minibuf_window)) | |
286 | 696 { |
765 | 697 Fset_window_buffer (selected_frame->minibuffer_window, |
286 | 698 XWINDOW (minibuf_window)->buffer); |
765 | 699 minibuf_window = selected_frame->minibuffer_window; |
286 | 700 } |
701 | |
1680
ea9f3949f153
* frame.c (Fdelete_frame): Delete all the windows in the frame's
Jim Blandy <jimb@redhat.com>
parents:
1652
diff
changeset
|
702 /* 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
|
703 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
|
704 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
|
705 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
|
706 |
765 | 707 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
|
708 FRAME_SET_VISIBLE (f, 0); |
286 | 709 |
1809
69b3ee873a9b
* frame.c (Fdelete_frame): Clear the frame's display after calling
Jim Blandy <jimb@redhat.com>
parents:
1784
diff
changeset
|
710 /* Since some events are handled at the interrupt level, we may get |
69b3ee873a9b
* frame.c (Fdelete_frame): Clear the frame's display after calling
Jim Blandy <jimb@redhat.com>
parents:
1784
diff
changeset
|
711 an event for f at any time; if we zero out the frame's display |
69b3ee873a9b
* frame.c (Fdelete_frame): Clear the frame's display after calling
Jim Blandy <jimb@redhat.com>
parents:
1784
diff
changeset
|
712 now, then we may trip up the event-handling code. Instead, we'll |
69b3ee873a9b
* frame.c (Fdelete_frame): Clear the frame's display after calling
Jim Blandy <jimb@redhat.com>
parents:
1784
diff
changeset
|
713 promise that the display of the frame must be valid until we have |
69b3ee873a9b
* frame.c (Fdelete_frame): Clear the frame's display after calling
Jim Blandy <jimb@redhat.com>
parents:
1784
diff
changeset
|
714 called the window-system-dependent frame destruction routine. */ |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
715 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
716 /* I think this should be done with a hook. */ |
363 | 717 #ifdef HAVE_X_WINDOWS |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
718 if (FRAME_X_P (f)) |
1809
69b3ee873a9b
* frame.c (Fdelete_frame): Clear the frame's display after calling
Jim Blandy <jimb@redhat.com>
parents:
1784
diff
changeset
|
719 x_destroy_window (f); |
363 | 720 #endif |
721 | |
1809
69b3ee873a9b
* frame.c (Fdelete_frame): Clear the frame's display after calling
Jim Blandy <jimb@redhat.com>
parents:
1784
diff
changeset
|
722 f->display.nothing = 0; |
69b3ee873a9b
* frame.c (Fdelete_frame): Clear the frame's display after calling
Jim Blandy <jimb@redhat.com>
parents:
1784
diff
changeset
|
723 |
765 | 724 /* If we've deleted the last_nonminibuf_frame, then try to find |
363 | 725 another one. */ |
765 | 726 if (f == last_nonminibuf_frame) |
363 | 727 { |
765 | 728 Lisp_Object frames; |
708 | 729 |
765 | 730 last_nonminibuf_frame = 0; |
363 | 731 |
765 | 732 for (frames = Vframe_list; |
733 CONSP (frames); | |
734 frames = XCONS (frames)->cdr) | |
363 | 735 { |
765 | 736 f = XFRAME (XCONS (frames)->car); |
737 if (!FRAME_MINIBUF_ONLY_P (f)) | |
363 | 738 { |
765 | 739 last_nonminibuf_frame = f; |
363 | 740 break; |
741 } | |
742 } | |
743 } | |
286 | 744 |
765 | 745 /* If we've deleted Vdefault_minibuffer_frame, try to find another |
746 one. Prefer minibuffer-only frames, but also notice frames | |
708 | 747 with other windows. */ |
765 | 748 if (EQ (frame, Vdefault_minibuffer_frame)) |
708 | 749 { |
765 | 750 Lisp_Object frames; |
708 | 751 |
765 | 752 /* The last frame we saw with a minibuffer, minibuffer-only or not. */ |
753 Lisp_Object frame_with_minibuf = Qnil; | |
708 | 754 |
765 | 755 for (frames = Vframe_list; |
756 CONSP (frames); | |
757 frames = XCONS (frames)->cdr) | |
708 | 758 { |
765 | 759 Lisp_Object this = XCONS (frames)->car; |
708 | 760 |
765 | 761 if (XTYPE (this) != Lisp_Frame) |
708 | 762 abort (); |
765 | 763 f = XFRAME (this); |
708 | 764 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
765 if (FRAME_HAS_MINIBUF_P (f)) |
708 | 766 { |
765 | 767 frame_with_minibuf = this; |
768 if (FRAME_MINIBUF_ONLY_P (f)) | |
708 | 769 break; |
770 } | |
771 } | |
772 | |
765 | 773 /* We know that there must be some frame with a minibuffer out |
774 there. If this were not true, all of the frames present | |
708 | 775 would have to be minibufferless, which implies that at some |
765 | 776 point their minibuffer frames must have been deleted, but |
708 | 777 that is prohibited at the top; you can't delete surrogate |
765 | 778 minibuffer frames. */ |
779 if (NILP (frame_with_minibuf)) | |
708 | 780 abort (); |
781 | |
765 | 782 Vdefault_minibuffer_frame = frame_with_minibuf; |
708 | 783 } |
784 | |
286 | 785 return Qnil; |
786 } | |
787 | |
788 /* Return mouse position in character cell units. */ | |
789 | |
454 | 790 DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0, |
765 | 791 "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\ |
3693
8e83f20d0e39
* frame.c (Fmouse_position): Doc fix.
Jim Blandy <jimb@redhat.com>
parents:
3676
diff
changeset
|
792 The position is given in character cells, where (0, 0) is the\n\ |
8e83f20d0e39
* frame.c (Fmouse_position): Doc fix.
Jim Blandy <jimb@redhat.com>
parents:
3676
diff
changeset
|
793 upper-left corner.\n\ |
454 | 794 If Emacs is running on a mouseless terminal or hasn't been programmed\n\ |
765 | 795 to read the mouse position, it returns the selected frame for FRAME\n\ |
454 | 796 and nil for X and Y.") |
797 () | |
286 | 798 { |
765 | 799 FRAME_PTR f; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
800 Lisp_Object lispy_dummy; |
1989
b1c1ab20f810
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1920
diff
changeset
|
801 enum scroll_bar_part party_dummy; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
802 Lisp_Object x, y; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
803 unsigned long long_dummy; |
286 | 804 |
3658
c2831d419bec
(Fmouse_position): Set up defaults before calling the hook.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
805 f = selected_frame; |
c2831d419bec
(Fmouse_position): Set up defaults before calling the hook.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
806 x = y = Qnil; |
c2831d419bec
(Fmouse_position): Set up defaults before calling the hook.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
807 |
c2831d419bec
(Fmouse_position): Set up defaults before calling the hook.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
808 /* It's okay for the hook to refrain from storing anything. */ |
454 | 809 if (mouse_position_hook) |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
810 (*mouse_position_hook) (&f, |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
811 &lispy_dummy, &party_dummy, |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
812 &x, &y, |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
813 &long_dummy); |
286 | 814 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
815 XSET (lispy_dummy, Lisp_Frame, f); |
3658
c2831d419bec
(Fmouse_position): Set up defaults before calling the hook.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
816 return Fcons (lispy_dummy, Fcons (x, y)); |
286 | 817 } |
818 | |
819 DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0, | |
3694 | 820 "Move the mouse pointer to the center of character cell (X,Y) in FRAME.\n\ |
765 | 821 WARNING: If you use this under X, you should do `unfocus-frame' afterwards.") |
822 (frame, x, y) | |
823 Lisp_Object frame, x, y; | |
286 | 824 { |
765 | 825 CHECK_LIVE_FRAME (frame, 0); |
286 | 826 CHECK_NUMBER (x, 2); |
827 CHECK_NUMBER (y, 1); | |
828 | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
829 /* I think this should be done with a hook. */ |
286 | 830 #ifdef HAVE_X_WINDOWS |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
831 if (FRAME_X_P (XFRAME (frame))) |
286 | 832 /* Warping the mouse will cause enternotify and focus events. */ |
765 | 833 x_set_mouse_position (XFRAME (frame), x, y); |
286 | 834 #endif |
835 | |
836 return Qnil; | |
837 } | |
838 | |
765 | 839 DEFUN ("make-frame-visible", Fmake_frame_visible, Smake_frame_visible, |
3834
1b2144b795aa
* frame.c (Fmake_frame_visible): Make this interactively callable;
Jim Blandy <jimb@redhat.com>
parents:
3763
diff
changeset
|
840 0, 1, "", |
765 | 841 "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
|
842 If omitted, FRAME defaults to the currently selected frame.") |
765 | 843 (frame) |
844 Lisp_Object frame; | |
286 | 845 { |
872 | 846 if (NILP (frame)) |
886 | 847 XSET (frame, Lisp_Frame, selected_frame); |
872 | 848 |
765 | 849 CHECK_LIVE_FRAME (frame, 0); |
286 | 850 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
851 /* I think this should be done with a hook. */ |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
852 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
853 if (FRAME_X_P (XFRAME (frame))) |
5105
9b41ddf1b5f7
(Fmake_frame_visible): Use FRAME_SAMPLE_VISIBILITY. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
4961
diff
changeset
|
854 { |
9b41ddf1b5f7
(Fmake_frame_visible): Use FRAME_SAMPLE_VISIBILITY. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
4961
diff
changeset
|
855 FRAME_SAMPLE_VISIBILITY (XFRAME (frame)); |
9b41ddf1b5f7
(Fmake_frame_visible): Use FRAME_SAMPLE_VISIBILITY. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
4961
diff
changeset
|
856 x_make_frame_visible (XFRAME (frame)); |
9b41ddf1b5f7
(Fmake_frame_visible): Use FRAME_SAMPLE_VISIBILITY. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
4961
diff
changeset
|
857 } |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
858 #endif |
286 | 859 |
765 | 860 return frame; |
286 | 861 } |
862 | |
765 | 863 DEFUN ("make-frame-invisible", Fmake_frame_invisible, Smake_frame_invisible, |
872 | 864 0, 1, "", |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
865 "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
|
866 If omitted, FRAME defaults to the currently selected frame.") |
765 | 867 (frame) |
868 Lisp_Object frame; | |
286 | 869 { |
872 | 870 if (NILP (frame)) |
886 | 871 XSET (frame, Lisp_Frame, selected_frame); |
872 | 872 |
765 | 873 CHECK_LIVE_FRAME (frame, 0); |
286 | 874 |
3283
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
875 /* Don't let the frame remain selected. */ |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
876 if (XFRAME (frame) == selected_frame) |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
877 Fhandle_switch_frame (next_frame (frame, Qt), Qnil); |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
878 |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
879 /* Don't allow minibuf_window to remain on a deleted frame. */ |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
880 if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window)) |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
881 { |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
882 Fset_window_buffer (selected_frame->minibuffer_window, |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
883 XWINDOW (minibuf_window)->buffer); |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
884 minibuf_window = selected_frame->minibuffer_window; |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
885 } |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
886 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
887 /* I think this should be done with a hook. */ |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
888 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
889 if (FRAME_X_P (XFRAME (frame))) |
765 | 890 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
|
891 #endif |
286 | 892 |
893 return Qnil; | |
894 } | |
895 | |
765 | 896 DEFUN ("iconify-frame", Ficonify_frame, Siconify_frame, |
872 | 897 0, 1, "", |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
898 "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
|
899 If omitted, FRAME defaults to the currently selected frame.") |
765 | 900 (frame) |
901 Lisp_Object frame; | |
286 | 902 { |
872 | 903 if (NILP (frame)) |
886 | 904 XSET (frame, Lisp_Frame, selected_frame); |
872 | 905 |
765 | 906 CHECK_LIVE_FRAME (frame, 0); |
286 | 907 |
3283
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
908 /* Don't let the frame remain selected. */ |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
909 if (XFRAME (frame) == selected_frame) |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
910 Fhandle_switch_frame (next_frame (frame, Qt), Qnil); |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
911 |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
912 /* Don't allow minibuf_window to remain on a deleted frame. */ |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
913 if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window)) |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
914 { |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
915 Fset_window_buffer (selected_frame->minibuffer_window, |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
916 XWINDOW (minibuf_window)->buffer); |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
917 minibuf_window = selected_frame->minibuffer_window; |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
918 } |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
919 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
920 /* I think this should be done with a hook. */ |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
921 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
922 if (FRAME_X_P (XFRAME (frame))) |
765 | 923 x_iconify_frame (XFRAME (frame)); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
924 #endif |
286 | 925 |
926 return Qnil; | |
927 } | |
928 | |
765 | 929 DEFUN ("frame-visible-p", Fframe_visible_p, Sframe_visible_p, |
286 | 930 1, 1, 0, |
765 | 931 "Return t if FRAME is now \"visible\" (actually in use for display).\n\ |
932 A frame that is not \"visible\" is not updated and, if it works through\n\ | |
286 | 933 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
|
934 Return the symbol `icon' if frame is visible only as an icon.") |
765 | 935 (frame) |
936 Lisp_Object frame; | |
286 | 937 { |
765 | 938 CHECK_LIVE_FRAME (frame, 0); |
286 | 939 |
1709
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
940 if (FRAME_VISIBLE_P (XFRAME (frame))) |
286 | 941 return Qt; |
1709
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
942 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
|
943 return Qicon; |
286 | 944 return Qnil; |
945 } | |
946 | |
765 | 947 DEFUN ("visible-frame-list", Fvisible_frame_list, Svisible_frame_list, |
286 | 948 0, 0, 0, |
765 | 949 "Return a list of all frames now \"visible\" (being updated).") |
286 | 950 () |
951 { | |
765 | 952 Lisp_Object tail, frame; |
953 struct frame *f; | |
286 | 954 Lisp_Object value; |
955 | |
956 value = Qnil; | |
765 | 957 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr) |
286 | 958 { |
765 | 959 frame = XCONS (tail)->car; |
960 if (XTYPE (frame) != Lisp_Frame) | |
286 | 961 continue; |
765 | 962 f = XFRAME (frame); |
1709
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
963 if (FRAME_VISIBLE_P (f)) |
765 | 964 value = Fcons (frame, value); |
286 | 965 } |
966 return value; | |
967 } | |
363 | 968 |
969 | |
2282
f727944c11aa
* frame.c (Fraise_frame, Flower_frame): Renamed from
Jim Blandy <jimb@redhat.com>
parents:
2207
diff
changeset
|
970 DEFUN ("raise-frame", Fraise_frame, Sraise_frame, 1, 1, 0, |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
971 "Bring FRAME to the front, so it occludes any frames it overlaps.\n\ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
972 If FRAME is invisible, make it visible.\n\ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
973 If Emacs is displaying on an ordinary terminal or some other device which\n\ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
974 doesn't support multiple overlapping frames, this function does nothing.") |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
975 (frame) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
976 Lisp_Object frame; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
977 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
978 CHECK_LIVE_FRAME (frame, 0); |
4961
dd67510308ae
(Fraise_frame): Do like the documentation says, and make
Richard M. Stallman <rms@gnu.org>
parents:
4798
diff
changeset
|
979 |
dd67510308ae
(Fraise_frame): Do like the documentation says, and make
Richard M. Stallman <rms@gnu.org>
parents:
4798
diff
changeset
|
980 /* Do like the documentation says. */ |
dd67510308ae
(Fraise_frame): Do like the documentation says, and make
Richard M. Stallman <rms@gnu.org>
parents:
4798
diff
changeset
|
981 Fmake_frame_visible (frame); |
dd67510308ae
(Fraise_frame): Do like the documentation says, and make
Richard M. Stallman <rms@gnu.org>
parents:
4798
diff
changeset
|
982 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
983 if (frame_raise_lower_hook) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
984 (*frame_raise_lower_hook) (XFRAME (frame), 1); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
985 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
986 return Qnil; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
987 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
988 |
2282
f727944c11aa
* frame.c (Fraise_frame, Flower_frame): Renamed from
Jim Blandy <jimb@redhat.com>
parents:
2207
diff
changeset
|
989 /* Should we have a corresponding function called Flower_Power? */ |
f727944c11aa
* frame.c (Fraise_frame, Flower_frame): Renamed from
Jim Blandy <jimb@redhat.com>
parents:
2207
diff
changeset
|
990 DEFUN ("lower-frame", Flower_frame, Slower_frame, 1, 1, 0, |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
991 "Send FRAME to the back, so it is occluded by any frames that overlap it.\n\ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
992 If Emacs is displaying on an ordinary terminal or some other device which\n\ |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
993 doesn't support multiple overlapping frames, this function does nothing.") |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
994 (frame) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
995 Lisp_Object frame; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
996 { |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
997 CHECK_LIVE_FRAME (frame, 0); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
998 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
999 if (frame_raise_lower_hook) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1000 (*frame_raise_lower_hook) (XFRAME (frame), 0); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1001 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1002 return Qnil; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1003 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1004 |
363 | 1005 |
765 | 1006 DEFUN ("redirect-frame-focus", Fredirect_frame_focus, Sredirect_frame_focus, |
363 | 1007 1, 2, 0, |
765 | 1008 "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
|
1009 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
|
1010 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
|
1011 FOCUS-FRAME after reading an event typed at FRAME.\n\ |
363 | 1012 \n\ |
1709
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
1013 If FOCUS-FRAME is omitted or nil, any existing redirection is\n\ |
765 | 1014 cancelled, and the frame again receives its own keystrokes.\n\ |
363 | 1015 \n\ |
1709
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
1016 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
|
1017 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
|
1018 minibuffer window.\n\ |
363 | 1019 \n\ |
1709
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
1020 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
|
1021 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
|
1022 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
|
1023 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
|
1024 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
|
1025 \n\ |
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
1026 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
|
1027 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
|
1028 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
|
1029 \n\ |
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
1030 The redirection lasts until `redirect-frame-focus' is called to change it.") |
765 | 1031 (frame, focus_frame) |
1032 Lisp_Object frame, focus_frame; | |
363 | 1033 { |
3970
020fe391d5c1
* frame.c (Fredirect_frame_focus): Allow redirection of focus of
Jim Blandy <jimb@redhat.com>
parents:
3834
diff
changeset
|
1034 /* Note that we don't check for a live frame here. It's reasonable |
020fe391d5c1
* frame.c (Fredirect_frame_focus): Allow redirection of focus of
Jim Blandy <jimb@redhat.com>
parents:
3834
diff
changeset
|
1035 to redirect the focus of a frame you're about to delete, if you |
020fe391d5c1
* frame.c (Fredirect_frame_focus): Allow redirection of focus of
Jim Blandy <jimb@redhat.com>
parents:
3834
diff
changeset
|
1036 know what other frame should receive those keystrokes. */ |
020fe391d5c1
* frame.c (Fredirect_frame_focus): Allow redirection of focus of
Jim Blandy <jimb@redhat.com>
parents:
3834
diff
changeset
|
1037 CHECK_FRAME (frame, 0); |
454 | 1038 |
1709
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
1039 if (! NILP (focus_frame)) |
765 | 1040 CHECK_LIVE_FRAME (focus_frame, 1); |
363 | 1041 |
765 | 1042 XFRAME (frame)->focus_frame = focus_frame; |
363 | 1043 |
3283
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1044 /* I think this should be done with a hook. */ |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1045 #ifdef HAVE_X_WINDOWS |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1046 if (!NILP (focus_frame) && ! EQ (focus_frame, frame) |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1047 && FRAME_X_P (XFRAME (focus_frame))) |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1048 Ffocus_frame (focus_frame); |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1049 #endif |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1050 |
765 | 1051 if (frame_rehighlight_hook) |
1052 (*frame_rehighlight_hook) (); | |
363 | 1053 |
1054 return Qnil; | |
1055 } | |
1056 | |
1057 | |
765 | 1058 DEFUN ("frame-focus", Fframe_focus, Sframe_focus, 1, 1, 0, |
1059 "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
|
1060 This returns nil if FRAME's focus is not redirected.\n\ |
765 | 1061 See `redirect-frame-focus'.") |
1062 (frame) | |
1063 Lisp_Object frame; | |
363 | 1064 { |
765 | 1065 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
|
1066 |
765 | 1067 return FRAME_FOCUS_FRAME (XFRAME (frame)); |
363 | 1068 } |
1069 | |
1070 | |
286 | 1071 |
1072 Lisp_Object | |
765 | 1073 get_frame_param (frame, prop) |
1074 register struct frame *frame; | |
286 | 1075 Lisp_Object prop; |
1076 { | |
1077 register Lisp_Object tem; | |
1078 | |
765 | 1079 tem = Fassq (prop, frame->param_alist); |
286 | 1080 if (EQ (tem, Qnil)) |
1081 return tem; | |
1082 return Fcdr (tem); | |
1083 } | |
1084 | |
1085 void | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1086 store_in_alist (alistptr, prop, val) |
286 | 1087 Lisp_Object *alistptr, val; |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1088 Lisp_Object prop; |
286 | 1089 { |
1090 register Lisp_Object tem; | |
1091 | |
1092 tem = Fassq (prop, *alistptr); | |
1093 if (EQ (tem, Qnil)) | |
1094 *alistptr = Fcons (Fcons (prop, val), *alistptr); | |
1095 else | |
1096 Fsetcdr (tem, val); | |
1097 } | |
1098 | |
1099 void | |
765 | 1100 store_frame_param (f, prop, val) |
1101 struct frame *f; | |
286 | 1102 Lisp_Object prop, val; |
1103 { | |
1104 register Lisp_Object tem; | |
1105 | |
765 | 1106 tem = Fassq (prop, f->param_alist); |
286 | 1107 if (EQ (tem, Qnil)) |
765 | 1108 f->param_alist = Fcons (Fcons (prop, val), f->param_alist); |
286 | 1109 else |
1110 Fsetcdr (tem, val); | |
539 | 1111 |
1112 if (EQ (prop, Qminibuffer) | |
1113 && XTYPE (val) == Lisp_Window) | |
1114 { | |
1115 if (! MINI_WINDOW_P (XWINDOW (val))) | |
1116 error ("Surrogate minibuffer windows must be minibuffer windows."); | |
1117 | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1118 if (FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f)) |
3763
c58fb240170d
* frame.c (store_frame_param): Fix error message punctuation.
Jim Blandy <jimb@redhat.com>
parents:
3694
diff
changeset
|
1119 error ("can't change the surrogate minibuffer of a frame with its own minibuffer"); |
539 | 1120 |
1121 /* Install the chosen minibuffer window, with proper buffer. */ | |
765 | 1122 f->minibuffer_window = val; |
539 | 1123 } |
286 | 1124 } |
1125 | |
765 | 1126 DEFUN ("frame-parameters", Fframe_parameters, Sframe_parameters, 0, 1, 0, |
1127 "Return the parameters-alist of frame FRAME.\n\ | |
286 | 1128 It is a list of elements of the form (PARM . VALUE), where PARM is a symbol.\n\ |
777 | 1129 The meaningful PARMs depend on the kind of frame.\n\ |
1130 If FRAME is omitted, return information on the currently selected frame.") | |
765 | 1131 (frame) |
1132 Lisp_Object frame; | |
286 | 1133 { |
1134 Lisp_Object alist; | |
765 | 1135 struct frame *f; |
286 | 1136 |
765 | 1137 if (EQ (frame, Qnil)) |
1138 f = selected_frame; | |
286 | 1139 else |
1140 { | |
765 | 1141 CHECK_FRAME (frame, 0); |
1142 f = XFRAME (frame); | |
286 | 1143 } |
1144 | |
765 | 1145 if (f->display.nothing == 0) |
286 | 1146 return Qnil; |
1147 | |
765 | 1148 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
|
1149 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
|
1150 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
|
1151 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
|
1152 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
|
1153 store_in_alist (&alist, Qminibuffer, |
1870
d90e9fecad48
* frame.c (Fframe_parameters): Report the `minibuffer' parameter of
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
1154 (! FRAME_HAS_MINIBUF_P (f) ? Qnil |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1155 : (FRAME_MINIBUF_ONLY_P (f) ? Qonly |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1156 : FRAME_MINIBUF_WINDOW (f)))); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1157 store_in_alist (&alist, Qunsplittable, (f->no_split ? Qt : Qnil)); |
2131
468df2d7e371
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2068
diff
changeset
|
1158 store_in_alist (&alist, Qmenu_bar_lines, (FRAME_MENU_BAR_LINES (f))); |
286 | 1159 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1160 /* I think this should be done with a hook. */ |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1161 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1162 if (FRAME_X_P (f)) |
765 | 1163 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
|
1164 #endif |
286 | 1165 return alist; |
1166 } | |
1167 | |
765 | 1168 DEFUN ("modify-frame-parameters", Fmodify_frame_parameters, |
1169 Smodify_frame_parameters, 2, 2, 0, | |
1170 "Modify the parameters of frame FRAME according to ALIST.\n\ | |
286 | 1171 ALIST is an alist of parameters to change and their new values.\n\ |
1172 Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.\n\ | |
765 | 1173 The meaningful PARMs depend on the kind of frame; undefined PARMs are ignored.") |
1174 (frame, alist) | |
1175 Lisp_Object frame, alist; | |
286 | 1176 { |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1177 FRAME_PTR f; |
286 | 1178 register Lisp_Object tail, elt, prop, val; |
1179 | |
765 | 1180 if (EQ (frame, Qnil)) |
1181 f = selected_frame; | |
286 | 1182 else |
1183 { | |
765 | 1184 CHECK_LIVE_FRAME (frame, 0); |
1185 f = XFRAME (frame); | |
286 | 1186 } |
1187 | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1188 /* I think this should be done with a hook. */ |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1189 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1190 if (FRAME_X_P (f)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1191 #if 1 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1192 x_set_frame_parameters (f, alist); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1193 #else |
286 | 1194 for (tail = alist; !EQ (tail, Qnil); tail = Fcdr (tail)) |
1195 { | |
1196 elt = Fcar (tail); | |
1197 prop = Fcar (elt); | |
1198 val = Fcdr (elt); | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1199 x_set_frame_param (f, prop, val, get_frame_param (f, prop)); |
765 | 1200 store_frame_param (f, prop, val); |
286 | 1201 } |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1202 #endif |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1203 #endif |
286 | 1204 |
1205 return Qnil; | |
1206 } | |
1207 | |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1208 DEFUN ("frame-char-height", Fframe_char_height, Sframe_char_height, |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1209 0, 1, 0, |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1210 "Height in pixels of a line in the font in frame FRAME.\n\ |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1211 If FRAME is omitted, the selected frame is used.\n\ |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1212 For a terminal frame, the value is always 1.") |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1213 (frame) |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1214 Lisp_Object frame; |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1215 { |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1216 struct frame *f; |
286 | 1217 |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1218 if (NILP (frame)) |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1219 f = selected_frame; |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1220 else |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1221 { |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1222 CHECK_FRAME (frame, 0); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1223 f = XFRAME (frame); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1224 } |
777 | 1225 |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1226 #ifdef HAVE_X_WINDOWS |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1227 if (FRAME_X_P (f)) |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1228 return make_number (x_char_height (f)); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1229 else |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1230 #endif |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1231 return make_number (1); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1232 } |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1233 |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1234 |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1235 DEFUN ("frame-char-width", Fframe_char_width, Sframe_char_width, |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1236 0, 1, 0, |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1237 "Width in pixels of characters in the font in frame FRAME.\n\ |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1238 If FRAME is omitted, the selected frame is used.\n\ |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1239 The width is the same for all characters, because\n\ |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1240 currently Emacs supports only fixed-width fonts.\n\ |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1241 For a terminal screen, the value is always 1.") |
765 | 1242 (frame) |
1243 Lisp_Object frame; | |
286 | 1244 { |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1245 struct frame *f; |
286 | 1246 |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1247 if (NILP (frame)) |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1248 f = selected_frame; |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1249 else |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1250 { |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1251 CHECK_FRAME (frame, 0); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1252 f = XFRAME (frame); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1253 } |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1254 |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1255 #ifdef HAVE_X_WINDOWS |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1256 if (FRAME_X_P (f)) |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1257 return make_number (x_char_width (f)); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1258 else |
777 | 1259 #endif |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1260 return make_number (1); |
286 | 1261 } |
1262 | |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1263 DEFUN ("frame-pixel-height", Fframe_pixel_height, |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1264 Sframe_pixel_height, 0, 1, 0, |
3676 | 1265 "Return a FRAME's height in pixels.\n\ |
1266 For a terminal frame, the result really gives the height in characters.\n\ | |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1267 If FRAME is omitted, the selected frame is used.") |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1268 (frame) |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1269 Lisp_Object frame; |
286 | 1270 { |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1271 struct frame *f; |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1272 |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1273 if (NILP (frame)) |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1274 f = selected_frame; |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1275 else |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1276 { |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1277 CHECK_FRAME (frame, 0); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1278 f = XFRAME (frame); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1279 } |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1280 |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1281 #ifdef HAVE_X_WINDOWS |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1282 if (FRAME_X_P (f)) |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1283 return make_number (x_pixel_height (f)); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1284 else |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1285 #endif |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1286 return make_number (FRAME_HEIGHT (f)); |
286 | 1287 } |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1288 |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1289 DEFUN ("frame-pixel-width", Fframe_pixel_width, |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1290 Sframe_pixel_width, 0, 1, 0, |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1291 "Return FRAME's width in pixels.\n\ |
3676 | 1292 For a terminal frame, the result really gives the width in characters.\n\ |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1293 If FRAME is omitted, the selected frame is used.") |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1294 (frame) |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1295 Lisp_Object frame; |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1296 { |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1297 struct frame *f; |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1298 |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1299 if (NILP (frame)) |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1300 f = selected_frame; |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1301 else |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1302 { |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1303 CHECK_FRAME (frame, 0); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1304 f = XFRAME (frame); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1305 } |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1306 |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1307 #ifdef HAVE_X_WINDOWS |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1308 if (FRAME_X_P (f)) |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1309 return make_number (x_pixel_width (f)); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1310 else |
777 | 1311 #endif |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1312 return make_number (FRAME_WIDTH (f)); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1313 } |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1314 |
765 | 1315 DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0, |
1316 "Specify that the frame FRAME has LINES lines.\n\ | |
286 | 1317 Optional third arg non-nil means that redisplay should use LINES lines\n\ |
765 | 1318 but that the idea of the actual height of the frame should not be changed.") |
1319 (frame, rows, pretend) | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1320 Lisp_Object frame, rows, pretend; |
286 | 1321 { |
765 | 1322 register struct frame *f; |
286 | 1323 |
1324 CHECK_NUMBER (rows, 0); | |
765 | 1325 if (NILP (frame)) |
1326 f = selected_frame; | |
286 | 1327 else |
1328 { | |
765 | 1329 CHECK_LIVE_FRAME (frame, 0); |
1330 f = XFRAME (frame); | |
286 | 1331 } |
1332 | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1333 /* I think this should be done with a hook. */ |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1334 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1335 if (FRAME_X_P (f)) |
286 | 1336 { |
765 | 1337 if (XINT (rows) != f->width) |
1338 x_set_window_size (f, f->width, XINT (rows)); | |
286 | 1339 } |
1340 else | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1341 #endif |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1342 change_frame_size (f, XINT (rows), 0, !NILP (pretend), 0); |
286 | 1343 return Qnil; |
1344 } | |
1345 | |
765 | 1346 DEFUN ("set-frame-width", Fset_frame_width, Sset_frame_width, 2, 3, 0, |
1347 "Specify that the frame FRAME has COLS columns.\n\ | |
286 | 1348 Optional third arg non-nil means that redisplay should use COLS columns\n\ |
765 | 1349 but that the idea of the actual width of the frame should not be changed.") |
1350 (frame, cols, pretend) | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1351 Lisp_Object frame, cols, pretend; |
286 | 1352 { |
765 | 1353 register struct frame *f; |
286 | 1354 CHECK_NUMBER (cols, 0); |
765 | 1355 if (NILP (frame)) |
1356 f = selected_frame; | |
286 | 1357 else |
1358 { | |
765 | 1359 CHECK_LIVE_FRAME (frame, 0); |
1360 f = XFRAME (frame); | |
286 | 1361 } |
1362 | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1363 /* I think this should be done with a hook. */ |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1364 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1365 if (FRAME_X_P (f)) |
286 | 1366 { |
765 | 1367 if (XINT (cols) != f->width) |
1368 x_set_window_size (f, XINT (cols), f->height); | |
286 | 1369 } |
1370 else | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1371 #endif |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1372 change_frame_size (f, 0, XINT (cols), !NILP (pretend), 0); |
286 | 1373 return Qnil; |
1374 } | |
1375 | |
765 | 1376 DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 3, 0, |
1377 "Sets size of FRAME to COLS by ROWS, measured in characters.") | |
1378 (frame, cols, rows) | |
1379 Lisp_Object frame, cols, rows; | |
286 | 1380 { |
765 | 1381 register struct frame *f; |
286 | 1382 int mask; |
1383 | |
765 | 1384 CHECK_LIVE_FRAME (frame, 0); |
286 | 1385 CHECK_NUMBER (cols, 2); |
1386 CHECK_NUMBER (rows, 1); | |
765 | 1387 f = XFRAME (frame); |
286 | 1388 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1389 /* I think this should be done with a hook. */ |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1390 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1391 if (FRAME_X_P (f)) |
286 | 1392 { |
765 | 1393 if (XINT (rows) != f->height || XINT (cols) != f->width) |
1394 x_set_window_size (f, XINT (cols), XINT (rows)); | |
286 | 1395 } |
1396 else | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1397 #endif |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1398 change_frame_size (f, XINT (rows), XINT (cols), 0, 0); |
286 | 1399 |
1400 return Qnil; | |
1401 } | |
1402 | |
765 | 1403 DEFUN ("set-frame-position", Fset_frame_position, |
1404 Sset_frame_position, 3, 3, 0, | |
1405 "Sets position of FRAME in pixels to XOFFSET by YOFFSET.\n\ | |
4341
d07ef5ea3b58
(Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents:
4227
diff
changeset
|
1406 This is actually the position of the upper left corner of the frame.\n\ |
d07ef5ea3b58
(Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents:
4227
diff
changeset
|
1407 Negative values for XOFFSET or YOFFSET are interpreted relative to\n\ |
4412
12c4e5b53463
(Fset_frame_position): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
4341
diff
changeset
|
1408 the rightmost or bottommost possible position (that stays within the screen).") |
765 | 1409 (frame, xoffset, yoffset) |
1410 Lisp_Object frame, xoffset, yoffset; | |
286 | 1411 { |
765 | 1412 register struct frame *f; |
286 | 1413 int mask; |
1414 | |
765 | 1415 CHECK_LIVE_FRAME (frame, 0); |
286 | 1416 CHECK_NUMBER (xoffset, 1); |
1417 CHECK_NUMBER (yoffset, 2); | |
765 | 1418 f = XFRAME (frame); |
286 | 1419 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1420 /* I think this should be done with a hook. */ |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1421 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1422 if (FRAME_X_P (f)) |
765 | 1423 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
|
1424 #endif |
286 | 1425 |
1426 return Qt; | |
1427 } | |
777 | 1428 |
286 | 1429 |
765 | 1430 choose_minibuf_frame () |
286 | 1431 { |
765 | 1432 /* For lowest-level minibuf, put it on currently selected frame |
1433 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
|
1434 |
286 | 1435 if (minibuf_level == 0 |
765 | 1436 && 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
|
1437 && !EQ (minibuf_window, selected_frame->minibuffer_window)) |
286 | 1438 { |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1439 /* 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
|
1440 window anymore. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1441 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
|
1442 abort (); |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1443 |
765 | 1444 Fset_window_buffer (selected_frame->minibuffer_window, |
286 | 1445 XWINDOW (minibuf_window)->buffer); |
765 | 1446 minibuf_window = selected_frame->minibuffer_window; |
286 | 1447 } |
1448 } | |
1449 | |
765 | 1450 syms_of_frame () |
286 | 1451 { |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1452 /*&&& init symbols here &&&*/ |
765 | 1453 Qframep = intern ("framep"); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1454 staticpro (&Qframep); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1455 Qframe_live_p = intern ("frame-live-p"); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1456 staticpro (&Qframe_live_p); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1457 Qheight = intern ("height"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1458 staticpro (&Qheight); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1459 Qicon = intern ("icon"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1460 staticpro (&Qicon); |
539 | 1461 Qminibuffer = intern ("minibuffer"); |
1462 staticpro (&Qminibuffer); | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1463 Qmodeline = intern ("modeline"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1464 staticpro (&Qmodeline); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1465 Qname = intern ("name"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1466 staticpro (&Qname); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1467 Qonly = intern ("only"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1468 staticpro (&Qonly); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1469 Qunsplittable = intern ("unsplittable"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1470 staticpro (&Qunsplittable); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1471 Qwidth = intern ("width"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1472 staticpro (&Qwidth); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1473 Qx = intern ("x"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1474 staticpro (&Qx); |
2131
468df2d7e371
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2068
diff
changeset
|
1475 Qmenu_bar_lines = intern ("menu-bar-lines"); |
468df2d7e371
(x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents:
2068
diff
changeset
|
1476 staticpro (&Qmenu_bar_lines); |
286 | 1477 |
765 | 1478 staticpro (&Vframe_list); |
286 | 1479 |
765 | 1480 DEFVAR_LISP ("terminal-frame", &Vterminal_frame, |
1481 "The initial frame-object, which represents Emacs's stdout."); | |
286 | 1482 |
1483 DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified, | |
765 | 1484 "Non-nil if all of emacs is iconified and frame updates are not needed."); |
286 | 1485 Vemacs_iconified = Qnil; |
1486 | |
765 | 1487 DEFVAR_LISP ("default-minibuffer-frame", &Vdefault_minibuffer_frame, |
1488 "Minibufferless frames use this frame's minibuffer.\n\ | |
454 | 1489 \n\ |
765 | 1490 Emacs cannot create minibufferless frames unless this is set to an\n\ |
454 | 1491 appropriate surrogate.\n\ |
1492 \n\ | |
1493 Emacs consults this variable only when creating minibufferless\n\ | |
765 | 1494 frames; once the frame is created, it sticks with its assigned\n\ |
454 | 1495 minibuffer, no matter what this variable is set to. This means that\n\ |
1496 this variable doesn't necessarily say anything meaningful about the\n\ | |
765 | 1497 current set of frames, or where the minibuffer is currently being\n\ |
454 | 1498 displayed."); |
765 | 1499 Vdefault_minibuffer_frame = Qnil; |
286 | 1500 |
765 | 1501 DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist, |
1502 "Alist of default values for frame creation.\n\ | |
386 | 1503 These may be set in your init file, like this:\n\ |
765 | 1504 (setq default-frame-alist '((width . 80) (height . 55)))\n\ |
386 | 1505 These override values given in window system configuration data, like\n\ |
1506 X Windows' defaults database.\n\ | |
765 | 1507 For values specific to the first Emacs frame, see `initial-frame-alist'.\n\ |
1508 For values specific to the separate minibuffer frame, see\n\ | |
1509 `minibuffer-frame-alist'."); | |
1510 Vdefault_frame_alist = Qnil; | |
386 | 1511 |
765 | 1512 defsubr (&Sframep); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1513 defsubr (&Sframe_live_p); |
2298
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
1514 defsubr (&Shandle_switch_frame); |
765 | 1515 defsubr (&Sselect_frame); |
1516 defsubr (&Sselected_frame); | |
1517 defsubr (&Swindow_frame); | |
1518 defsubr (&Sframe_root_window); | |
1519 defsubr (&Sframe_selected_window); | |
1520 defsubr (&Sframe_list); | |
1521 defsubr (&Snext_frame); | |
4424
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
1522 defsubr (&Sprevious_frame); |
765 | 1523 defsubr (&Sdelete_frame); |
454 | 1524 defsubr (&Smouse_position); |
286 | 1525 defsubr (&Sset_mouse_position); |
1526 #if 0 | |
765 | 1527 defsubr (&Sframe_configuration); |
1528 defsubr (&Srestore_frame_configuration); | |
286 | 1529 #endif |
765 | 1530 defsubr (&Smake_frame_visible); |
1531 defsubr (&Smake_frame_invisible); | |
1532 defsubr (&Siconify_frame); | |
1533 defsubr (&Sframe_visible_p); | |
1534 defsubr (&Svisible_frame_list); | |
2282
f727944c11aa
* frame.c (Fraise_frame, Flower_frame): Renamed from
Jim Blandy <jimb@redhat.com>
parents:
2207
diff
changeset
|
1535 defsubr (&Sraise_frame); |
f727944c11aa
* frame.c (Fraise_frame, Flower_frame): Renamed from
Jim Blandy <jimb@redhat.com>
parents:
2207
diff
changeset
|
1536 defsubr (&Slower_frame); |
765 | 1537 defsubr (&Sredirect_frame_focus); |
1538 defsubr (&Sframe_focus); | |
1539 defsubr (&Sframe_parameters); | |
1540 defsubr (&Smodify_frame_parameters); | |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1541 defsubr (&Sframe_char_height); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1542 defsubr (&Sframe_char_width); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1543 defsubr (&Sframe_pixel_height); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1544 defsubr (&Sframe_pixel_width); |
765 | 1545 defsubr (&Sset_frame_height); |
1546 defsubr (&Sset_frame_width); | |
1547 defsubr (&Sset_frame_size); | |
1548 defsubr (&Sset_frame_position); | |
286 | 1549 } |
732 | 1550 |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1551 keys_of_frame () |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1552 { |
2298
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
1553 initial_define_lispy_key (global_map, "switch-frame", "handle-switch-frame"); |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1554 } |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1555 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1556 #else /* not MULTI_FRAME */ |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1557 |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1558 /* 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
|
1559 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
|
1560 |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1561 /* 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
|
1562 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
|
1563 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
|
1564 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
|
1565 "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
|
1566 () |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1567 { |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1568 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
|
1569 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
|
1570 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
|
1571 } |
3482
ff3960b885c9
[!MULTI_FRAME] (Fframep): New dummy definition.
Richard M. Stallman <rms@gnu.org>
parents:
3283
diff
changeset
|
1572 DEFUN ("framep", Fframep, Sframep, 1, 1, 0, |
ff3960b885c9
[!MULTI_FRAME] (Fframep): New dummy definition.
Richard M. Stallman <rms@gnu.org>
parents:
3283
diff
changeset
|
1573 "Return non-nil if OBJECT is a frame.\n\ |
ff3960b885c9
[!MULTI_FRAME] (Fframep): New dummy definition.
Richard M. Stallman <rms@gnu.org>
parents:
3283
diff
changeset
|
1574 Value is t for a termcap frame (a character-only terminal),\n\ |
ff3960b885c9
[!MULTI_FRAME] (Fframep): New dummy definition.
Richard M. Stallman <rms@gnu.org>
parents:
3283
diff
changeset
|
1575 `x' for an Emacs frame that is really an X window.\n\ |
ff3960b885c9
[!MULTI_FRAME] (Fframep): New dummy definition.
Richard M. Stallman <rms@gnu.org>
parents:
3283
diff
changeset
|
1576 Also see `live-frame-p'.") |
ff3960b885c9
[!MULTI_FRAME] (Fframep): New dummy definition.
Richard M. Stallman <rms@gnu.org>
parents:
3283
diff
changeset
|
1577 (object) |
ff3960b885c9
[!MULTI_FRAME] (Fframep): New dummy definition.
Richard M. Stallman <rms@gnu.org>
parents:
3283
diff
changeset
|
1578 Lisp_Object object; |
ff3960b885c9
[!MULTI_FRAME] (Fframep): New dummy definition.
Richard M. Stallman <rms@gnu.org>
parents:
3283
diff
changeset
|
1579 { |
ff3960b885c9
[!MULTI_FRAME] (Fframep): New dummy definition.
Richard M. Stallman <rms@gnu.org>
parents:
3283
diff
changeset
|
1580 return Qnil; |
ff3960b885c9
[!MULTI_FRAME] (Fframep): New dummy definition.
Richard M. Stallman <rms@gnu.org>
parents:
3283
diff
changeset
|
1581 } |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1582 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1583 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
|
1584 "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
|
1585 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
|
1586 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
|
1587 (frame, rows, pretend) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1588 Lisp_Object frame, rows, pretend; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1589 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1590 CHECK_NUMBER (rows, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1591 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1592 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
|
1593 return Qnil; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1594 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1595 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1596 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
|
1597 "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
|
1598 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
|
1599 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
|
1600 (frame, cols, pretend) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1601 Lisp_Object frame, cols, pretend; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1602 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1603 CHECK_NUMBER (cols, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1604 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1605 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
|
1606 return Qnil; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1607 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1608 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1609 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
|
1610 "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
|
1611 (frame, cols, rows) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1612 Lisp_Object frame, cols, rows; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1613 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1614 CHECK_NUMBER (cols, 2); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1615 CHECK_NUMBER (rows, 1); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1616 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1617 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
|
1618 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1619 return Qnil; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1620 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1621 |
2207
d3eca6fffc5c
* frame.c (Fframe_height, Fframe_width): Fix doc strings to match
Jim Blandy <jimb@redhat.com>
parents:
2131
diff
changeset
|
1622 DEFUN ("frame-height", Fframe_height, Sframe_height, 0, 1, 0, |
d3eca6fffc5c
* frame.c (Fframe_height, Fframe_width): Fix doc strings to match
Jim Blandy <jimb@redhat.com>
parents:
2131
diff
changeset
|
1623 "Return number of lines available for display on FRAME.\n\ |
d3eca6fffc5c
* frame.c (Fframe_height, Fframe_width): Fix doc strings to match
Jim Blandy <jimb@redhat.com>
parents:
2131
diff
changeset
|
1624 If FRAME is omitted, describe the currently selected frame.") |
d3eca6fffc5c
* frame.c (Fframe_height, Fframe_width): Fix doc strings to match
Jim Blandy <jimb@redhat.com>
parents:
2131
diff
changeset
|
1625 (frame) |
d3eca6fffc5c
* frame.c (Fframe_height, Fframe_width): Fix doc strings to match
Jim Blandy <jimb@redhat.com>
parents:
2131
diff
changeset
|
1626 Lisp_Object frame; |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1627 { |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1628 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
|
1629 } |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1630 |
2207
d3eca6fffc5c
* frame.c (Fframe_height, Fframe_width): Fix doc strings to match
Jim Blandy <jimb@redhat.com>
parents:
2131
diff
changeset
|
1631 DEFUN ("frame-width", Fframe_width, Sframe_width, 0, 1, 0, |
d3eca6fffc5c
* frame.c (Fframe_height, Fframe_width): Fix doc strings to match
Jim Blandy <jimb@redhat.com>
parents:
2131
diff
changeset
|
1632 "Return number of columns available for display on FRAME.\n\ |
d3eca6fffc5c
* frame.c (Fframe_height, Fframe_width): Fix doc strings to match
Jim Blandy <jimb@redhat.com>
parents:
2131
diff
changeset
|
1633 If FRAME is omitted, describe the currently selected frame.") |
d3eca6fffc5c
* frame.c (Fframe_height, Fframe_width): Fix doc strings to match
Jim Blandy <jimb@redhat.com>
parents:
2131
diff
changeset
|
1634 (frame) |
d3eca6fffc5c
* frame.c (Fframe_height, Fframe_width): Fix doc strings to match
Jim Blandy <jimb@redhat.com>
parents:
2131
diff
changeset
|
1635 Lisp_Object frame; |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1636 { |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1637 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
|
1638 } |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1639 |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1640 DEFUN ("frame-char-height", Fframe_char_height, Sframe_char_height, |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1641 0, 1, 0, |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1642 "Height in pixels of a line in the font in frame FRAME.\n\ |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1643 If FRAME is omitted, the selected frame is used.\n\ |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1644 For a terminal frame, the value is always 1.") |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1645 (frame) |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1646 Lisp_Object frame; |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1647 { |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1648 return make_number (1); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1649 } |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1650 |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1651 |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1652 DEFUN ("frame-char-width", Fframe_char_width, Sframe_char_width, |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1653 0, 1, 0, |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1654 "Width in pixels of characters in the font in frame FRAME.\n\ |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1655 If FRAME is omitted, the selected frame is used.\n\ |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1656 The width is the same for all characters, because\n\ |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1657 currently Emacs supports only fixed-width fonts.\n\ |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1658 For a terminal screen, the value is always 1.") |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1659 (frame) |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1660 Lisp_Object frame; |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1661 { |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1662 return make_number (1); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1663 } |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1664 |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1665 DEFUN ("frame-pixel-height", Fframe_pixel_height, |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1666 Sframe_pixel_height, 0, 1, 0, |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1667 "Return FRAME's height in pixels.\n\ |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1668 For a terminal frame, the result really gives the height in characters.\n\ |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1669 If FRAME is omitted, the selected frame is used.") |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1670 (frame) |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1671 Lisp_Object frame; |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1672 { |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1673 return make_number (FRAME_HEIGHT (f)); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1674 } |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1675 |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1676 DEFUN ("frame-pixel-width", Fframe_pixel_width, |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1677 Sframe_pixel_width, 0, 1, 0, |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1678 "Return FRAME's width in pixels.\n\ |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1679 For a terminal frame, the result really gives the width in characters.\n\ |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1680 If FRAME is omitted, the selected frame is used.") |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1681 (frame) |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1682 Lisp_Object frame; |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1683 { |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1684 return make_number (FRAME_WIDTH (f)); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1685 } |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1686 |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1687 /* 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
|
1688 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1689 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
|
1690 "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
|
1691 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
|
1692 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
|
1693 (lines, pretend) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1694 Lisp_Object lines, pretend; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1695 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1696 CHECK_NUMBER (lines, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1697 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1698 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
|
1699 return Qnil; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1700 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1701 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1702 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
|
1703 "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
|
1704 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
|
1705 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
|
1706 (cols, pretend) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1707 Lisp_Object cols, pretend; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1708 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1709 CHECK_NUMBER (cols, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1710 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1711 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
|
1712 return Qnil; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1713 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1714 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1715 syms_of_frame () |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1716 { |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1717 defsubr (&Sselected_frame); |
3482
ff3960b885c9
[!MULTI_FRAME] (Fframep): New dummy definition.
Richard M. Stallman <rms@gnu.org>
parents:
3283
diff
changeset
|
1718 defsubr (&Sframep); |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1719 defsubr (&Sframe_char_height); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1720 defsubr (&Sframe_char_width); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1721 defsubr (&Sframe_pixel_height); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
1722 defsubr (&Sframe_pixel_width); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1723 defsubr (&Sset_frame_height); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1724 defsubr (&Sset_frame_width); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1725 defsubr (&Sset_frame_size); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1726 defsubr (&Sset_screen_height); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1727 defsubr (&Sset_screen_width); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1728 defsubr (&Sframe_height); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1729 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
|
1730 defsubr (&Sframe_width); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1731 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
|
1732 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1733 |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1734 keys_of_frame () |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1735 { |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1736 } |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1737 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1738 #endif /* not MULTI_FRAME */ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1739 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1740 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1741 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1742 |