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