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