Mercurial > emacs
annotate src/frame.c @ 51194:a873867ba3d2
Make (many) trivial substitutions for renamed and
new macros in dispextern.h, frame.h and window.h.
(make_frame): Initialize left_fringe_width, right_fringe_width,
fringe_cols, scroll_bar_actual_width, border_width,
internal_border_width, column_width, line_height, x_pixels_diff,
y_pixels_diff, want_fullscreen, size_hint_flags, and win_gravity
members with values suitable for a non-window frames.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Sat, 24 May 2003 21:57:45 +0000 |
parents | 178720d9eaff |
children | 695efa86354b |
rev | line source |
---|---|
765 | 1 /* Generic frame functions. |
51048
7ac9c3bea5ea
(Fselect_window): Add optional arg `norecord'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50390
diff
changeset
|
2 Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2003 |
36433
20b42ba5a623
(make_frame): Use allocate_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
35817
diff
changeset
|
3 Free Software Foundation. |
286 | 4 |
5 This file is part of GNU Emacs. | |
6 | |
7 GNU Emacs is free software; you can redistribute it and/or modify | |
8 it under the terms of the GNU General Public License as published by | |
708 | 9 the Free Software Foundation; either version 2, or (at your option) |
286 | 10 any later version. |
11 | |
12 GNU Emacs is distributed in the hope that it will be useful, | |
13 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 GNU General Public License for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
18 along with GNU Emacs; see the file COPYING. If not, write to | |
14186
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
14077
diff
changeset
|
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
14077
diff
changeset
|
20 Boston, MA 02111-1307, USA. */ |
286 | 21 |
7900
60795e826dad
Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents:
7646
diff
changeset
|
22 #include <config.h> |
363 | 23 |
7900
60795e826dad
Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents:
7646
diff
changeset
|
24 #include <stdio.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
|
25 #include "lisp.h" |
17032 | 26 #include "charset.h" |
21825
697991d2a2c4
Conditionally include xterm.h using HAVE_X_WINDOWS.
Geoff Voelker <voelker@cs.washington.edu>
parents:
21524
diff
changeset
|
27 #ifdef HAVE_X_WINDOWS |
21514 | 28 #include "xterm.h" |
17032 | 29 #endif |
27633
ab6c81c6edf8
[WINDOWSNT]: Include w32term.h.
Andrew Innes <andrewi@gnu.org>
parents:
27575
diff
changeset
|
30 #ifdef WINDOWSNT |
ab6c81c6edf8
[WINDOWSNT]: Include w32term.h.
Andrew Innes <andrewi@gnu.org>
parents:
27575
diff
changeset
|
31 #include "w32term.h" |
ab6c81c6edf8
[WINDOWSNT]: Include w32term.h.
Andrew Innes <andrewi@gnu.org>
parents:
27575
diff
changeset
|
32 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
43717
diff
changeset
|
33 #ifdef MAC_OS |
32752
923b8d6d8277
Initial check-in: changes for building Emacs under Mac OS.
Andrew Choi <akochoi@shaw.ca>
parents:
32545
diff
changeset
|
34 #include "macterm.h" |
923b8d6d8277
Initial check-in: changes for building Emacs under Mac OS.
Andrew Choi <akochoi@shaw.ca>
parents:
32545
diff
changeset
|
35 #endif |
31102
6a0caa788013
Include keyboard.h before frame.h.
Andrew Innes <andrewi@gnu.org>
parents:
29995
diff
changeset
|
36 #include "buffer.h" |
6a0caa788013
Include keyboard.h before frame.h.
Andrew Innes <andrewi@gnu.org>
parents:
29995
diff
changeset
|
37 /* These help us bind and responding to switch-frame events. */ |
6a0caa788013
Include keyboard.h before frame.h.
Andrew Innes <andrewi@gnu.org>
parents:
29995
diff
changeset
|
38 #include "commands.h" |
6a0caa788013
Include keyboard.h before frame.h.
Andrew Innes <andrewi@gnu.org>
parents:
29995
diff
changeset
|
39 #include "keyboard.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
|
40 #include "frame.h" |
23515
1e52542fb338
Include frame.h before fontset.h.
Kenichi Handa <handa@m17n.org>
parents:
22188
diff
changeset
|
41 #ifdef HAVE_WINDOW_SYSTEM |
1e52542fb338
Include frame.h before fontset.h.
Kenichi Handa <handa@m17n.org>
parents:
22188
diff
changeset
|
42 #include "fontset.h" |
1e52542fb338
Include frame.h before fontset.h.
Kenichi Handa <handa@m17n.org>
parents:
22188
diff
changeset
|
43 #endif |
50357 | 44 #include "blockinput.h" |
5392
d8d5844c3ba6
Always include termhooks.h.
Richard M. Stallman <rms@gnu.org>
parents:
5231
diff
changeset
|
45 #include "termhooks.h" |
21514 | 46 #include "dispextern.h" |
7162
06a13bf36a8c
(Fframe_parameters) [!MULTI_FRAME]: Unstub it again.
Karl Heuer <kwzh@gnu.org>
parents:
7134
diff
changeset
|
47 #include "window.h" |
9572 | 48 #ifdef MSDOS |
49 #include "msdos.h" | |
25117
f6f34f0bc1af
(make_terminal_frame) [MSDOS]: Don't call
Eli Zaretskii <eliz@gnu.org>
parents:
25030
diff
changeset
|
50 #include "dosfns.h" |
9572 | 51 #endif |
732 | 52 |
50357 | 53 |
50373
6defa3317421
Fix compilation for --with-x=no.
Kim F. Storm <storm@cua.dk>
parents:
50357
diff
changeset
|
54 #ifdef HAVE_WINDOW_SYSTEM |
6defa3317421
Fix compilation for --with-x=no.
Kim F. Storm <storm@cua.dk>
parents:
50357
diff
changeset
|
55 |
50357 | 56 /* The name we're using in resource queries. Most often "emacs". */ |
57 | |
58 Lisp_Object Vx_resource_name; | |
59 | |
60 /* The application class we're using in resource queries. | |
61 Normally "Emacs". */ | |
62 | |
63 Lisp_Object Vx_resource_class; | |
64 | |
50373
6defa3317421
Fix compilation for --with-x=no.
Kim F. Storm <storm@cua.dk>
parents:
50357
diff
changeset
|
65 #endif |
50357 | 66 |
67 Lisp_Object Qframep, Qframe_live_p; | |
68 Lisp_Object Qicon, Qmodeline; | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
69 Lisp_Object Qonly; |
50357 | 70 Lisp_Object Qx, Qw32, Qmac, Qpc; |
6246
128dc040e121
(next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents:
6157
diff
changeset
|
71 Lisp_Object Qvisible; |
31399
db831ffcd565
(Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31102
diff
changeset
|
72 Lisp_Object Qdisplay_type; |
31448
70b366918608
(Fframe_parameter): Handle `name' and `background-mode'
Gerd Moellmann <gerd@gnu.org>
parents:
31442
diff
changeset
|
73 Lisp_Object Qbackground_mode; |
33509
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
74 Lisp_Object Qinhibit_default_face_x_resources; |
50357 | 75 |
76 Lisp_Object Qx_frame_parameter; | |
77 Lisp_Object Qx_resource_name; | |
78 | |
79 /* Frame parameters (set or reported). */ | |
80 | |
81 Lisp_Object Qauto_raise, Qauto_lower; | |
82 Lisp_Object Qborder_color, Qborder_width; | |
83 Lisp_Object Qcursor_color, Qcursor_type; | |
84 Lisp_Object Qgeometry; /* Not used */ | |
85 Lisp_Object Qheight, Qwidth; | |
86 Lisp_Object Qleft, Qright; | |
87 Lisp_Object Qicon_left, Qicon_top, Qicon_type, Qicon_name; | |
88 Lisp_Object Qinternal_border_width; | |
89 Lisp_Object Qmouse_color; | |
90 Lisp_Object Qminibuffer; | |
91 Lisp_Object Qscroll_bar_width, Qvertical_scroll_bars; | |
92 Lisp_Object Qvisibility; | |
93 Lisp_Object Qscroll_bar_foreground, Qscroll_bar_background; | |
94 Lisp_Object Qscreen_gamma; | |
95 Lisp_Object Qline_spacing; | |
96 Lisp_Object Quser_position, Quser_size; | |
97 Lisp_Object Qwait_for_wm; | |
98 Lisp_Object Qwindow_id; | |
99 #ifdef HAVE_X_WINDOWS | |
100 Lisp_Object Qouter_window_id; | |
101 #endif | |
102 Lisp_Object Qparent_id; | |
103 Lisp_Object Qtitle, Qname; | |
104 Lisp_Object Qunsplittable; | |
105 Lisp_Object Qmenu_bar_lines, Qtool_bar_lines; | |
106 Lisp_Object Qleft_fringe, Qright_fringe; | |
107 Lisp_Object Qbuffer_predicate, Qbuffer_list; | |
42743
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
108 Lisp_Object Qtty_color_mode; |
286 | 109 |
50357 | 110 Lisp_Object Qfullscreen, Qfullwidth, Qfullheight, Qfullboth; |
111 | |
112 Lisp_Object Qface_set_after_frame_default; | |
113 | |
114 | |
12761
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
115 Lisp_Object Vterminal_frame; |
13522
6a97ea1245b5
(syms_of_frame_1): Set up Vdefault_frame_alist here.
Richard M. Stallman <rms@gnu.org>
parents:
13498
diff
changeset
|
116 Lisp_Object Vdefault_frame_alist; |
27795
83292274bbd4
(Vmouse_position_function): New variable.
Dave Love <fx@gnu.org>
parents:
27725
diff
changeset
|
117 Lisp_Object Vmouse_position_function; |
43366
512ab477b395
(Vmouse_highlight): New variable.
Kim F. Storm <storm@cua.dk>
parents:
42743
diff
changeset
|
118 Lisp_Object Vmouse_highlight; |
47731
755c4233cfba
* frame.c (Vdelete_frame_functions): New variable.
John Paul Wallington <jpw@pobox.com>
parents:
47036
diff
changeset
|
119 Lisp_Object Vdelete_frame_functions; |
12761
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
120 |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
121 static void |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
122 set_menu_bar_lines_1 (window, n) |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
123 Lisp_Object window; |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
124 int n; |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
125 { |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
126 struct window *w = XWINDOW (window); |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
127 |
13498
c10046894834
(set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
parents:
13412
diff
changeset
|
128 XSETFASTINT (w->last_modified, 0); |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
129 XSETFASTINT (w->top_line, XFASTINT (w->top_line) + n); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
130 XSETFASTINT (w->total_lines, XFASTINT (w->total_lines) - n); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
131 |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
132 if (INTEGERP (w->orig_top_line)) |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
133 XSETFASTINT (w->orig_top_line, XFASTINT (w->orig_top_line) + n); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
134 if (INTEGERP (w->orig_total_lines)) |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
135 XSETFASTINT (w->orig_total_lines, XFASTINT (w->orig_total_lines) - n); |
12761
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
136 |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
137 /* Handle just the top child in a vertical split. */ |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
138 if (!NILP (w->vchild)) |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
139 set_menu_bar_lines_1 (w->vchild, n); |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
140 |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
141 /* Adjust all children in a horizontal split. */ |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
142 for (window = w->hchild; !NILP (window); window = w->next) |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
143 { |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
144 w = XWINDOW (window); |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
145 set_menu_bar_lines_1 (window, n); |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
146 } |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
147 } |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
148 |
20038
bb460edc7187
(set_menu_bar_lines): Make the function external instead
Eli Zaretskii <eliz@gnu.org>
parents:
19532
diff
changeset
|
149 void |
12761
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
150 set_menu_bar_lines (f, value, oldval) |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
151 struct frame *f; |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
152 Lisp_Object value, oldval; |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
153 { |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
154 int nlines; |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
155 int olines = FRAME_MENU_BAR_LINES (f); |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
156 |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
157 /* Right now, menu bars don't work properly in minibuf-only frames; |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
158 most of the commands try to apply themselves to the minibuffer |
16051
ccf489f8596e
Removed support for !MULTI_FRAME.
Karl Heuer <kwzh@gnu.org>
parents:
15696
diff
changeset
|
159 frame itself, and get an error because you can't switch buffers |
12761
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
160 in or split the minibuffer window. */ |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
161 if (FRAME_MINIBUF_ONLY_P (f)) |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
162 return; |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
163 |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
164 if (INTEGERP (value)) |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
165 nlines = XINT (value); |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
166 else |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
167 nlines = 0; |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
168 |
13498
c10046894834
(set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
parents:
13412
diff
changeset
|
169 if (nlines != olines) |
c10046894834
(set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
parents:
13412
diff
changeset
|
170 { |
c10046894834
(set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
parents:
13412
diff
changeset
|
171 windows_or_buffers_changed++; |
c10046894834
(set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
parents:
13412
diff
changeset
|
172 FRAME_WINDOW_SIZES_CHANGED (f) = 1; |
c10046894834
(set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
parents:
13412
diff
changeset
|
173 FRAME_MENU_BAR_LINES (f) = nlines; |
c10046894834
(set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
parents:
13412
diff
changeset
|
174 set_menu_bar_lines_1 (f->root_window, nlines - olines); |
25030
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
175 adjust_glyphs (f); |
13498
c10046894834
(set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
parents:
13412
diff
changeset
|
176 } |
12761
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
177 } |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
178 |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
179 Lisp_Object Vemacs_iconified; |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
180 Lisp_Object Vframe_list; |
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
181 |
26729
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26164
diff
changeset
|
182 struct x_output tty_display; |
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26164
diff
changeset
|
183 |
286 | 184 extern Lisp_Object Vminibuffer_list; |
185 extern Lisp_Object get_minibuffer (); | |
5172
9aa201005b16
(Fhandle_switch_frame, Fredirect_frame_focus): Declared.
Richard M. Stallman <rms@gnu.org>
parents:
5105
diff
changeset
|
186 extern Lisp_Object Fhandle_switch_frame (); |
9aa201005b16
(Fhandle_switch_frame, Fredirect_frame_focus): Declared.
Richard M. Stallman <rms@gnu.org>
parents:
5105
diff
changeset
|
187 extern Lisp_Object Fredirect_frame_focus (); |
12005 | 188 extern Lisp_Object x_get_focus_frame (); |
286 | 189 |
765 | 190 DEFUN ("framep", Fframep, Sframep, 1, 1, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
191 doc: /* Return non-nil if OBJECT is a frame. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
192 Value is t for a termcap frame (a character-only terminal), |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
193 `x' for an Emacs frame that is really an X window, |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
194 `w32' for an Emacs frame that is a window on MS-Windows display, |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
195 `mac' for an Emacs frame on a Macintosh display, |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
196 `pc' for a direct-write MS-DOS frame. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
197 See also `frame-live-p'. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
198 (object) |
454 | 199 Lisp_Object object; |
286 | 200 { |
9127
0b4836daa8e1
(Fframep, make_frame_without_minibuffer, do_switch_frame, prev_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9032
diff
changeset
|
201 if (!FRAMEP (object)) |
286 | 202 return Qnil; |
765 | 203 switch (XFRAME (object)->output_method) |
286 | 204 { |
205 case output_termcap: | |
206 return Qt; | |
207 case output_x_window: | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
208 return Qx; |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16568
diff
changeset
|
209 case output_w32: |
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16568
diff
changeset
|
210 return Qw32; |
15391
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
211 case output_msdos_raw: |
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
212 return Qpc; |
25523
9e9eeb68482e
(Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents:
25350
diff
changeset
|
213 case output_mac: |
9e9eeb68482e
(Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents:
25350
diff
changeset
|
214 return Qmac; |
286 | 215 default: |
216 abort (); | |
217 } | |
218 } | |
219 | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
220 DEFUN ("frame-live-p", Fframe_live_p, Sframe_live_p, 1, 1, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
221 doc: /* Return non-nil if OBJECT is a frame which has not been deleted. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
222 Value is nil if OBJECT is not a live frame. If object is a live |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
223 frame, the return value indicates what sort of output device it is |
41239 | 224 displayed on. See the documentation of `framep' for possible |
40568 | 225 return values. */) |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
226 (object) |
454 | 227 Lisp_Object object; |
228 { | |
765 | 229 return ((FRAMEP (object) |
230 && FRAME_LIVE_P (XFRAME (object))) | |
231 ? Fframep (object) | |
454 | 232 : Qnil); |
233 } | |
234 | |
765 | 235 struct frame * |
236 make_frame (mini_p) | |
286 | 237 int mini_p; |
238 { | |
765 | 239 Lisp_Object frame; |
240 register struct frame *f; | |
286 | 241 register Lisp_Object root_window; |
242 register Lisp_Object mini_window; | |
243 | |
36433
20b42ba5a623
(make_frame): Use allocate_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
35817
diff
changeset
|
244 f = allocate_frame (); |
9972
92b33538b36a
(make_frame): Use allocate_vectorlike and VECSIZE.
Karl Heuer <kwzh@gnu.org>
parents:
9901
diff
changeset
|
245 XSETFRAME (frame, f); |
286 | 246 |
25030
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
247 f->desired_matrix = 0; |
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
248 f->current_matrix = 0; |
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
249 f->desired_pool = 0; |
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
250 f->current_pool = 0; |
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
251 f->glyphs_initialized_p = 0; |
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
252 f->decode_mode_spec_buffer = 0; |
765 | 253 f->visible = 0; |
1652
93497cd89204
* frame.c (make_frame): Initialize async_visible and
Jim Blandy <jimb@redhat.com>
parents:
1514
diff
changeset
|
254 f->async_visible = 0; |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12630
diff
changeset
|
255 f->output_data.nothing = 0; |
765 | 256 f->iconified = 0; |
1652
93497cd89204
* frame.c (make_frame): Initialize async_visible and
Jim Blandy <jimb@redhat.com>
parents:
1514
diff
changeset
|
257 f->async_iconified = 0; |
765 | 258 f->wants_modeline = 1; |
259 f->auto_raise = 0; | |
260 f->auto_lower = 0; | |
261 f->no_split = 0; | |
27725
fb13a4706619
(make_frame): Set frame initiallly to `garbaged'.
Gerd Moellmann <gerd@gnu.org>
parents:
27633
diff
changeset
|
262 f->garbaged = 1; |
765 | 263 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
|
264 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
|
265 f->explicit_name = 0; |
1989
b1c1ab20f810
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1920
diff
changeset
|
266 f->can_have_scroll_bars = 0; |
16263
a369af16e836
(make_frame): Switch from boolean `has_vertical_scrollbars' integer to
Richard M. Stallman <rms@gnu.org>
parents:
16184
diff
changeset
|
267 f->vertical_scroll_bar_type = vertical_scroll_bar_none; |
765 | 268 f->param_alist = Qnil; |
1989
b1c1ab20f810
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1920
diff
changeset
|
269 f->scroll_bars = Qnil; |
b1c1ab20f810
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1920
diff
changeset
|
270 f->condemned_scroll_bars = Qnil; |
2417
8c07933beed9
(make_frame): Init face_alist field.
Richard M. Stallman <rms@gnu.org>
parents:
2298
diff
changeset
|
271 f->face_alist = Qnil; |
25030
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
272 f->face_cache = NULL; |
6130
d4e5878462cb
(make_frame): Init menu_bar_items field to 0.
Richard M. Stallman <rms@gnu.org>
parents:
6054
diff
changeset
|
273 f->menu_bar_items = Qnil; |
7095
098b87bde5a7
(make_frame): Initialize fields menu_bar_vector and menu_bar_items_used.
Richard M. Stallman <rms@gnu.org>
parents:
7055
diff
changeset
|
274 f->menu_bar_vector = Qnil; |
098b87bde5a7
(make_frame): Initialize fields menu_bar_vector and menu_bar_items_used.
Richard M. Stallman <rms@gnu.org>
parents:
7055
diff
changeset
|
275 f->menu_bar_items_used = 0; |
10207
e6618f52efe9
(Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents:
9972
diff
changeset
|
276 f->buffer_predicate = Qnil; |
17221
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
277 f->buffer_list = Qnil; |
11017
f7c4ece024d5
(make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents:
10853
diff
changeset
|
278 #ifdef MULTI_KBOARD |
f7c4ece024d5
(make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents:
10853
diff
changeset
|
279 f->kboard = initial_kboard; |
f7c4ece024d5
(make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents:
10853
diff
changeset
|
280 #endif |
14303
48e3ee5005cd
(make_frame): Initialize title parameter to Qnil.
Karl Heuer <kwzh@gnu.org>
parents:
14223
diff
changeset
|
281 f->namebuf = 0; |
14223
596bb10704dd
(make_frame): Initialize frame title field to nil.
Erik Naggum <erik@naggum.no>
parents:
14217
diff
changeset
|
282 f->title = Qnil; |
25030
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
283 f->menu_bar_window = Qnil; |
25544
693ca9ba497a
Change spelling of `toolbar' to `tool_bar' or `tool-bar'.
Gerd Moellmann <gerd@gnu.org>
parents:
25523
diff
changeset
|
284 f->tool_bar_window = Qnil; |
33760
22dc6e2e7410
(make_frame): Change initialization of tool bar
Gerd Moellmann <gerd@gnu.org>
parents:
33512
diff
changeset
|
285 f->tool_bar_items = Qnil; |
25544
693ca9ba497a
Change spelling of `toolbar' to `tool_bar' or `tool-bar'.
Gerd Moellmann <gerd@gnu.org>
parents:
25523
diff
changeset
|
286 f->desired_tool_bar_string = f->current_tool_bar_string = Qnil; |
33760
22dc6e2e7410
(make_frame): Change initialization of tool bar
Gerd Moellmann <gerd@gnu.org>
parents:
33512
diff
changeset
|
287 f->n_tool_bar_items = 0; |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
288 f->left_fringe_width = f->right_fringe_width = 0; |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
289 f->fringe_cols = 0; |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
290 f->scroll_bar_actual_width = 0; |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
291 f->border_width = 0; |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
292 f->internal_border_width = 0; |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
293 f->column_width = 1; /* !FRAME_WINDOW_P value */ |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
294 f->line_height = 1; /* !FRAME_WINDOW_P value */ |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
295 f->x_pixels_diff = f->y_pixels_diff = 0; |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
296 f->want_fullscreen = FULLSCREEN_NONE; |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
297 f->size_hint_flags = 0; |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
298 f->win_gravity = 0; |
286 | 299 |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
300 root_window = make_window (); |
286 | 301 if (mini_p) |
302 { | |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
303 mini_window = make_window (); |
286 | 304 XWINDOW (root_window)->next = mini_window; |
305 XWINDOW (mini_window)->prev = root_window; | |
306 XWINDOW (mini_window)->mini_p = Qt; | |
765 | 307 XWINDOW (mini_window)->frame = frame; |
308 f->minibuffer_window = mini_window; | |
286 | 309 } |
310 else | |
311 { | |
312 mini_window = Qnil; | |
313 XWINDOW (root_window)->next = Qnil; | |
765 | 314 f->minibuffer_window = Qnil; |
286 | 315 } |
316 | |
765 | 317 XWINDOW (root_window)->frame = frame; |
286 | 318 |
319 /* 10 is arbitrary, | |
320 just so that there is "something there." | |
765 | 321 Correct size will be set up later with change_frame_size. */ |
286 | 322 |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
323 SET_FRAME_COLS (f, 10); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
324 FRAME_LINES (f) = 10; |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
325 |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
326 XSETFASTINT (XWINDOW (root_window)->total_cols, 10); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
327 XSETFASTINT (XWINDOW (root_window)->total_lines, (mini_p ? 9 : 10)); |
286 | 328 |
329 if (mini_p) | |
330 { | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
331 XSETFASTINT (XWINDOW (mini_window)->total_cols, 10); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
332 XSETFASTINT (XWINDOW (mini_window)->top_line, 9); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
333 XSETFASTINT (XWINDOW (mini_window)->total_lines, 1); |
286 | 334 } |
335 | |
765 | 336 /* Choose a buffer for the frame's root window. */ |
386 | 337 { |
338 Lisp_Object buf; | |
339 | |
340 XWINDOW (root_window)->buffer = Qt; | |
341 buf = Fcurrent_buffer (); | |
342 /* If buf is a 'hidden' buffer (i.e. one whose name starts with | |
343 a space), try to find another one. */ | |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46285
diff
changeset
|
344 if (SREF (Fbuffer_name (buf), 0) == ' ') |
22188
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
345 buf = Fother_buffer (buf, Qnil, Qnil); |
17221
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
346 |
25030
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
347 /* Use set_window_buffer, not Fset_window_buffer, and don't let |
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
348 hooks be run by it. The reason is that the whole frame/window |
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
349 arrangement is not yet fully intialized at this point. Windows |
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
350 don't have the right size, glyph matrices aren't initialized |
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
351 etc. Running Lisp functions at this point surely ends in a |
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
352 SEGV. */ |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
353 set_window_buffer (root_window, buf, 0, 0); |
17221
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
354 f->buffer_list = Fcons (buf, Qnil); |
386 | 355 } |
356 | |
286 | 357 if (mini_p) |
358 { | |
359 XWINDOW (mini_window)->buffer = Qt; | |
25030
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
360 set_window_buffer (mini_window, |
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
361 (NILP (Vminibuffer_list) |
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
362 ? get_minibuffer (0) |
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
363 : Fcar (Vminibuffer_list)), |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
364 0, 0); |
286 | 365 } |
366 | |
765 | 367 f->root_window = root_window; |
368 f->selected_window = root_window; | |
363 | 369 /* Make sure this window seems more recently used than |
370 a newly-created, never-selected window. */ | |
9309
27370f65dfa1
(make_frame, Fframe_parameters, Fselected_frame, syms_of_frame): Don't use
Karl Heuer <kwzh@gnu.org>
parents:
9268
diff
changeset
|
371 XSETFASTINT (XWINDOW (f->selected_window)->use_time, ++window_select_count); |
286 | 372 |
765 | 373 return f; |
286 | 374 } |
375 | |
21359
f66e706fc9d6
(make_frame_without_minibuffer): Conditionalize on HAVE_WINDOW_SYSTEM.
Richard M. Stallman <rms@gnu.org>
parents:
21244
diff
changeset
|
376 #ifdef HAVE_WINDOW_SYSTEM |
765 | 377 /* Make a frame using a separate minibuffer window on another frame. |
286 | 378 MINI_WINDOW is the minibuffer window to use. nil means use the |
379 default (the global minibuffer). */ | |
380 | |
765 | 381 struct frame * |
12010
57eb365d32f0
(make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents:
12006
diff
changeset
|
382 make_frame_without_minibuffer (mini_window, kb, display) |
286 | 383 register Lisp_Object mini_window; |
11775
fe7852953b75
(make_frame_without_minibuffer): New arg KB.
Karl Heuer <kwzh@gnu.org>
parents:
11773
diff
changeset
|
384 KBOARD *kb; |
12010
57eb365d32f0
(make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents:
12006
diff
changeset
|
385 Lisp_Object display; |
286 | 386 { |
765 | 387 register struct frame *f; |
15555
5ceed3aa6a1c
(make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents:
15396
diff
changeset
|
388 struct gcpro gcpro1; |
286 | 389 |
12010
57eb365d32f0
(make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents:
12006
diff
changeset
|
390 if (!NILP (mini_window)) |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
391 CHECK_LIVE_WINDOW (mini_window); |
286 | 392 |
11775
fe7852953b75
(make_frame_without_minibuffer): New arg KB.
Karl Heuer <kwzh@gnu.org>
parents:
11773
diff
changeset
|
393 #ifdef MULTI_KBOARD |
12010
57eb365d32f0
(make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents:
12006
diff
changeset
|
394 if (!NILP (mini_window) |
57eb365d32f0
(make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents:
12006
diff
changeset
|
395 && XFRAME (XWINDOW (mini_window)->frame)->kboard != kb) |
11775
fe7852953b75
(make_frame_without_minibuffer): New arg KB.
Karl Heuer <kwzh@gnu.org>
parents:
11773
diff
changeset
|
396 error ("frame and minibuffer must be on the same display"); |
fe7852953b75
(make_frame_without_minibuffer): New arg KB.
Karl Heuer <kwzh@gnu.org>
parents:
11773
diff
changeset
|
397 #endif |
fe7852953b75
(make_frame_without_minibuffer): New arg KB.
Karl Heuer <kwzh@gnu.org>
parents:
11773
diff
changeset
|
398 |
765 | 399 /* Make a frame containing just a root window. */ |
400 f = make_frame (0); | |
286 | 401 |
12010
57eb365d32f0
(make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents:
12006
diff
changeset
|
402 if (NILP (mini_window)) |
57eb365d32f0
(make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents:
12006
diff
changeset
|
403 { |
57eb365d32f0
(make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents:
12006
diff
changeset
|
404 /* Use default-minibuffer-frame if possible. */ |
57eb365d32f0
(make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents:
12006
diff
changeset
|
405 if (!FRAMEP (kb->Vdefault_minibuffer_frame) |
57eb365d32f0
(make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents:
12006
diff
changeset
|
406 || ! FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame))) |
57eb365d32f0
(make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents:
12006
diff
changeset
|
407 { |
15555
5ceed3aa6a1c
(make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents:
15396
diff
changeset
|
408 Lisp_Object frame_dummy; |
5ceed3aa6a1c
(make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents:
15396
diff
changeset
|
409 |
5ceed3aa6a1c
(make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents:
15396
diff
changeset
|
410 XSETFRAME (frame_dummy, f); |
5ceed3aa6a1c
(make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents:
15396
diff
changeset
|
411 GCPRO1 (frame_dummy); |
12010
57eb365d32f0
(make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents:
12006
diff
changeset
|
412 /* If there's no minibuffer frame to use, create one. */ |
15555
5ceed3aa6a1c
(make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents:
15396
diff
changeset
|
413 kb->Vdefault_minibuffer_frame = |
5ceed3aa6a1c
(make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents:
15396
diff
changeset
|
414 call1 (intern ("make-initial-minibuffer-frame"), display); |
5ceed3aa6a1c
(make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents:
15396
diff
changeset
|
415 UNGCPRO; |
12010
57eb365d32f0
(make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents:
12006
diff
changeset
|
416 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
417 |
12010
57eb365d32f0
(make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents:
12006
diff
changeset
|
418 mini_window = XFRAME (kb->Vdefault_minibuffer_frame)->minibuffer_window; |
57eb365d32f0
(make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents:
12006
diff
changeset
|
419 } |
15001
c74ce6421d04
(make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents:
14966
diff
changeset
|
420 |
765 | 421 f->minibuffer_window = mini_window; |
15001
c74ce6421d04
(make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents:
14966
diff
changeset
|
422 |
c74ce6421d04
(make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents:
14966
diff
changeset
|
423 /* Make the chosen minibuffer window display the proper minibuffer, |
c74ce6421d04
(make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents:
14966
diff
changeset
|
424 unless it is already showing a minibuffer. */ |
c74ce6421d04
(make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents:
14966
diff
changeset
|
425 if (NILP (Fmemq (XWINDOW (mini_window)->buffer, Vminibuffer_list))) |
c74ce6421d04
(make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents:
14966
diff
changeset
|
426 Fset_window_buffer (mini_window, |
c74ce6421d04
(make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents:
14966
diff
changeset
|
427 (NILP (Vminibuffer_list) |
c74ce6421d04
(make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents:
14966
diff
changeset
|
428 ? get_minibuffer (0) |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
429 : Fcar (Vminibuffer_list)), Qnil); |
765 | 430 return f; |
286 | 431 } |
432 | |
765 | 433 /* Make a frame containing only a minibuffer window. */ |
286 | 434 |
765 | 435 struct frame * |
436 make_minibuffer_frame () | |
286 | 437 { |
765 | 438 /* First make a frame containing just a root window, no minibuffer. */ |
286 | 439 |
765 | 440 register struct frame *f = make_frame (0); |
286 | 441 register Lisp_Object mini_window; |
765 | 442 register Lisp_Object frame; |
286 | 443 |
9268
cb55d0155265
(make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9214
diff
changeset
|
444 XSETFRAME (frame, f); |
286 | 445 |
1006
a13ee72d74a2
* frame.c (make_frame): Clear the explicit_name member of the new
Jim Blandy <jimb@redhat.com>
parents:
987
diff
changeset
|
446 f->auto_raise = 0; |
765 | 447 f->auto_lower = 0; |
448 f->no_split = 1; | |
449 f->wants_modeline = 0; | |
450 f->has_minibuffer = 1; | |
286 | 451 |
452 /* Now label the root window as also being the minibuffer. | |
453 Avoid infinite looping on the window chain by marking next pointer | |
454 as nil. */ | |
455 | |
765 | 456 mini_window = f->minibuffer_window = f->root_window; |
286 | 457 XWINDOW (mini_window)->mini_p = Qt; |
458 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
|
459 XWINDOW (mini_window)->prev = Qnil; |
765 | 460 XWINDOW (mini_window)->frame = frame; |
286 | 461 |
462 /* Put the proper buffer in that window. */ | |
463 | |
464 Fset_window_buffer (mini_window, | |
485 | 465 (NILP (Vminibuffer_list) |
286 | 466 ? get_minibuffer (0) |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
467 : Fcar (Vminibuffer_list)), Qnil); |
765 | 468 return f; |
286 | 469 } |
21359
f66e706fc9d6
(make_frame_without_minibuffer): Conditionalize on HAVE_WINDOW_SYSTEM.
Richard M. Stallman <rms@gnu.org>
parents:
21244
diff
changeset
|
470 #endif /* HAVE_WINDOW_SYSTEM */ |
286 | 471 |
765 | 472 /* Construct a frame that refers to the terminal (stdin and stdout). */ |
286 | 473 |
10768
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
474 static int terminal_frame_count; |
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
475 |
765 | 476 struct frame * |
477 make_terminal_frame () | |
286 | 478 { |
765 | 479 register struct frame *f; |
5231
6646271e8d32
(make_terminal_frame): Add frame to Vframe_list.
Richard M. Stallman <rms@gnu.org>
parents:
5172
diff
changeset
|
480 Lisp_Object frame; |
10768
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
481 char name[20]; |
286 | 482 |
11017
f7c4ece024d5
(make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents:
10853
diff
changeset
|
483 #ifdef MULTI_KBOARD |
f7c4ece024d5
(make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents:
10853
diff
changeset
|
484 if (!initial_kboard) |
f7c4ece024d5
(make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents:
10853
diff
changeset
|
485 { |
f7c4ece024d5
(make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents:
10853
diff
changeset
|
486 initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); |
f7c4ece024d5
(make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents:
10853
diff
changeset
|
487 init_kboard (initial_kboard); |
11364
9c609a5bd245
(make_terminal_frame): all_kboards means initial_kboard too.
Karl Heuer <kwzh@gnu.org>
parents:
11355
diff
changeset
|
488 initial_kboard->next_kboard = all_kboards; |
9c609a5bd245
(make_terminal_frame): all_kboards means initial_kboard too.
Karl Heuer <kwzh@gnu.org>
parents:
11355
diff
changeset
|
489 all_kboards = initial_kboard; |
11017
f7c4ece024d5
(make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents:
10853
diff
changeset
|
490 } |
f7c4ece024d5
(make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents:
10853
diff
changeset
|
491 #endif |
f7c4ece024d5
(make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents:
10853
diff
changeset
|
492 |
10768
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
493 /* The first call must initialize Vframe_list. */ |
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
494 if (! (NILP (Vframe_list) || CONSP (Vframe_list))) |
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
495 Vframe_list = Qnil; |
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
496 |
765 | 497 f = make_frame (1); |
5231
6646271e8d32
(make_terminal_frame): Add frame to Vframe_list.
Richard M. Stallman <rms@gnu.org>
parents:
5172
diff
changeset
|
498 |
9268
cb55d0155265
(make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9214
diff
changeset
|
499 XSETFRAME (frame, f); |
5231
6646271e8d32
(make_terminal_frame): Add frame to Vframe_list.
Richard M. Stallman <rms@gnu.org>
parents:
5172
diff
changeset
|
500 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
|
501 |
10768
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
502 terminal_frame_count++; |
17857
c39f34ef5d76
(make_terminal_frame): Don't add `Emacs' to frame name.
Richard M. Stallman <rms@gnu.org>
parents:
17573
diff
changeset
|
503 sprintf (name, "F%d", terminal_frame_count); |
c39f34ef5d76
(make_terminal_frame): Don't add `Emacs' to frame name.
Richard M. Stallman <rms@gnu.org>
parents:
17573
diff
changeset
|
504 f->name = build_string (name); |
10768
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
505 |
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
506 f->visible = 1; /* FRAME_SET_VISIBLE wd set frame_garbaged. */ |
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
507 f->async_visible = 1; /* Don't let visible be cleared later. */ |
15391
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
508 #ifdef MSDOS |
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
509 f->output_data.x = &the_only_x_display; |
26729
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26164
diff
changeset
|
510 if (!inhibit_window_system |
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26164
diff
changeset
|
511 && (!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame)) |
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26164
diff
changeset
|
512 || XFRAME (selected_frame)->output_method == output_msdos_raw)) |
31470
2e399023961d
(make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents:
31448
diff
changeset
|
513 { |
2e399023961d
(make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents:
31448
diff
changeset
|
514 f->output_method = output_msdos_raw; |
2e399023961d
(make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents:
31448
diff
changeset
|
515 /* This initialization of foreground and background pixels is |
2e399023961d
(make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents:
31448
diff
changeset
|
516 only important for the initial frame created in temacs. If |
2e399023961d
(make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents:
31448
diff
changeset
|
517 we don't do that, we get black background and foreground in |
2e399023961d
(make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents:
31448
diff
changeset
|
518 the dumped Emacs because the_only_x_display is a static |
2e399023961d
(make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents:
31448
diff
changeset
|
519 variable, hence it is born all-zeroes, and zero is the code |
2e399023961d
(make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents:
31448
diff
changeset
|
520 for the black color. Other frames all inherit their pixels |
2e399023961d
(make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents:
31448
diff
changeset
|
521 from what's already in the_only_x_display. */ |
2e399023961d
(make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents:
31448
diff
changeset
|
522 if ((!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame))) |
2e399023961d
(make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents:
31448
diff
changeset
|
523 && f->output_data.x->background_pixel == 0 |
2e399023961d
(make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents:
31448
diff
changeset
|
524 && f->output_data.x->foreground_pixel == 0) |
2e399023961d
(make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents:
31448
diff
changeset
|
525 { |
2e399023961d
(make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents:
31448
diff
changeset
|
526 f->output_data.x->background_pixel = FACE_TTY_DEFAULT_BG_COLOR; |
2e399023961d
(make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents:
31448
diff
changeset
|
527 f->output_data.x->foreground_pixel = FACE_TTY_DEFAULT_FG_COLOR; |
2e399023961d
(make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents:
31448
diff
changeset
|
528 } |
2e399023961d
(make_terminal_frame): Initialize frame foreground and
Eli Zaretskii <eliz@gnu.org>
parents:
31448
diff
changeset
|
529 } |
26729
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26164
diff
changeset
|
530 else |
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26164
diff
changeset
|
531 f->output_method = output_termcap; |
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26164
diff
changeset
|
532 #else |
35003
c6726a1e70ce
(make_terminal_frame) [WINDOWSNT]: Make terminal frames
Andrew Innes <andrewi@gnu.org>
parents:
33760
diff
changeset
|
533 #ifdef WINDOWSNT |
35447
c6cb860208d8
(Qw32_console): Remove variable.
Andrew Innes <andrewi@gnu.org>
parents:
35003
diff
changeset
|
534 f->output_method = output_termcap; |
35003
c6726a1e70ce
(make_terminal_frame) [WINDOWSNT]: Make terminal frames
Andrew Innes <andrewi@gnu.org>
parents:
33760
diff
changeset
|
535 f->output_data.x = &tty_display; |
c6726a1e70ce
(make_terminal_frame) [WINDOWSNT]: Make terminal frames
Andrew Innes <andrewi@gnu.org>
parents:
33760
diff
changeset
|
536 #else |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
43717
diff
changeset
|
537 #ifdef MAC_OS8 |
32752
923b8d6d8277
Initial check-in: changes for building Emacs under Mac OS.
Andrew Choi <akochoi@shaw.ca>
parents:
32545
diff
changeset
|
538 make_mac_terminal_frame (f); |
923b8d6d8277
Initial check-in: changes for building Emacs under Mac OS.
Andrew Choi <akochoi@shaw.ca>
parents:
32545
diff
changeset
|
539 #else |
26729
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26164
diff
changeset
|
540 f->output_data.x = &tty_display; |
47036
9d848dcc4b5d
(make_terminal_frame) [CANNOT_DUMP]: Initialize
Kim F. Storm <storm@cua.dk>
parents:
46467
diff
changeset
|
541 #ifdef CANNOT_DUMP |
9d848dcc4b5d
(make_terminal_frame) [CANNOT_DUMP]: Initialize
Kim F. Storm <storm@cua.dk>
parents:
46467
diff
changeset
|
542 FRAME_FOREGROUND_PIXEL(f) = FACE_TTY_DEFAULT_FG_COLOR; |
9d848dcc4b5d
(make_terminal_frame) [CANNOT_DUMP]: Initialize
Kim F. Storm <storm@cua.dk>
parents:
46467
diff
changeset
|
543 FRAME_BACKGROUND_PIXEL(f) = FACE_TTY_DEFAULT_BG_COLOR; |
9d848dcc4b5d
(make_terminal_frame) [CANNOT_DUMP]: Initialize
Kim F. Storm <storm@cua.dk>
parents:
46467
diff
changeset
|
544 #endif |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
43717
diff
changeset
|
545 #endif /* MAC_OS8 */ |
35003
c6726a1e70ce
(make_terminal_frame) [WINDOWSNT]: Make terminal frames
Andrew Innes <andrewi@gnu.org>
parents:
33760
diff
changeset
|
546 #endif /* WINDOWSNT */ |
26729
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26164
diff
changeset
|
547 #endif /* MSDOS */ |
25523
9e9eeb68482e
(Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents:
25350
diff
changeset
|
548 |
25117
f6f34f0bc1af
(make_terminal_frame) [MSDOS]: Don't call
Eli Zaretskii <eliz@gnu.org>
parents:
25030
diff
changeset
|
549 if (!noninteractive) |
f6f34f0bc1af
(make_terminal_frame) [MSDOS]: Don't call
Eli Zaretskii <eliz@gnu.org>
parents:
25030
diff
changeset
|
550 init_frame_faces (f); |
32752
923b8d6d8277
Initial check-in: changes for building Emacs under Mac OS.
Andrew Choi <akochoi@shaw.ca>
parents:
32545
diff
changeset
|
551 |
765 | 552 return f; |
286 | 553 } |
10768
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
554 |
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
555 DEFUN ("make-terminal-frame", Fmake_terminal_frame, Smake_terminal_frame, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
556 1, 1, 0, |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
557 doc: /* Create an additional terminal frame. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
558 You can create multiple frames on a text-only terminal in this way. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
559 Only the selected terminal frame is actually displayed. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
560 This function takes one argument, an alist specifying frame parameters. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
561 In practice, generally you don't need to specify any parameters. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
562 Note that changing the size of one terminal frame automatically affects all. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
563 (parms) |
10768
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
564 Lisp_Object parms; |
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
565 { |
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
566 struct frame *f; |
25523
9e9eeb68482e
(Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents:
25350
diff
changeset
|
567 Lisp_Object frame, tem; |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
568 struct frame *sf = SELECTED_FRAME (); |
10768
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
569 |
15392
ac7e878c5526
(Fmake_terminal_frame): Test MSDOS, not __MSDOS__.
Richard M. Stallman <rms@gnu.org>
parents:
15391
diff
changeset
|
570 #ifdef MSDOS |
26729
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26164
diff
changeset
|
571 if (sf->output_method != output_msdos_raw |
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26164
diff
changeset
|
572 && sf->output_method != output_termcap) |
15391
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
573 abort (); |
25523
9e9eeb68482e
(Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents:
25350
diff
changeset
|
574 #else /* not MSDOS */ |
9e9eeb68482e
(Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents:
25350
diff
changeset
|
575 |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
43717
diff
changeset
|
576 #ifdef MAC_OS |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
577 if (sf->output_method != output_mac) |
25523
9e9eeb68482e
(Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents:
25350
diff
changeset
|
578 error ("Not running on a Macintosh screen; cannot make a new Macintosh frame"); |
15391
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
579 #else |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
580 if (sf->output_method != output_termcap) |
10768
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
581 error ("Not using an ASCII terminal now; cannot make a new ASCII frame"); |
15391
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
582 #endif |
25523
9e9eeb68482e
(Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents:
25350
diff
changeset
|
583 #endif /* not MSDOS */ |
10768
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
584 |
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
585 f = make_terminal_frame (); |
25523
9e9eeb68482e
(Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents:
25350
diff
changeset
|
586 |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
587 change_frame_size (f, FRAME_LINES (sf), |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
588 FRAME_COLS (sf), 0, 0, 0); |
25030
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
589 adjust_glyphs (f); |
10768
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
590 calculate_costs (f); |
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
591 XSETFRAME (frame, f); |
16184
ca018789eb73
(Fmake_terminal_frame): Use Vdefault_frame_alist.
Richard M. Stallman <rms@gnu.org>
parents:
16112
diff
changeset
|
592 Fmodify_frame_parameters (frame, Vdefault_frame_alist); |
10768
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
593 Fmodify_frame_parameters (frame, parms); |
25209
eea9647c8246
(Fframe_parameters): Swap foreground and background
Eli Zaretskii <eliz@gnu.org>
parents:
25158
diff
changeset
|
594 |
eea9647c8246
(Fframe_parameters): Swap foreground and background
Eli Zaretskii <eliz@gnu.org>
parents:
25158
diff
changeset
|
595 /* Make the frame face alist be frame-specific, so that each |
eea9647c8246
(Fframe_parameters): Swap foreground and background
Eli Zaretskii <eliz@gnu.org>
parents:
25158
diff
changeset
|
596 frame could change its face definitions independently. */ |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
597 f->face_alist = Fcopy_alist (sf->face_alist); |
25209
eea9647c8246
(Fframe_parameters): Swap foreground and background
Eli Zaretskii <eliz@gnu.org>
parents:
25158
diff
changeset
|
598 /* Simple Fcopy_alist isn't enough, because we need the contents of |
eea9647c8246
(Fframe_parameters): Swap foreground and background
Eli Zaretskii <eliz@gnu.org>
parents:
25158
diff
changeset
|
599 the vectors which are the CDRs of associations in face_alist to |
eea9647c8246
(Fframe_parameters): Swap foreground and background
Eli Zaretskii <eliz@gnu.org>
parents:
25158
diff
changeset
|
600 be copied as well. */ |
eea9647c8246
(Fframe_parameters): Swap foreground and background
Eli Zaretskii <eliz@gnu.org>
parents:
25158
diff
changeset
|
601 for (tem = f->face_alist; CONSP (tem); tem = XCDR (tem)) |
39973
579177964efa
Avoid (most) uses of XCAR/XCDR as lvalues, for flexibility in experimenting
Ken Raeburn <raeburn@raeburn.org>
parents:
39918
diff
changeset
|
602 XSETCDR (XCAR (tem), Fcopy_sequence (XCDR (XCAR (tem)))); |
10768
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
603 return frame; |
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
604 } |
36810
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
605 |
286 | 606 |
36810
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
607 /* Perform the switch to frame FRAME. |
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
608 |
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
609 If FRAME is a switch-frame event `(switch-frame FRAME1)', use |
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
610 FRAME1 as frame. |
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
611 |
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
612 If TRACK is non-zero and the frame that currently has the focus |
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
613 redirects its focus to the selected frame, redirect that focused |
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
614 frame's focus to FRAME instead. |
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
615 |
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
616 FOR_DELETION non-zero means that the selected frame is being |
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
617 deleted, which includes the possibility that the frame's display |
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
618 is dead. */ |
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
619 |
12286
723569a0028c
(Fdelete_frame): Use do_switch_frame directly.
Richard M. Stallman <rms@gnu.org>
parents:
12283
diff
changeset
|
620 Lisp_Object |
36810
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
621 do_switch_frame (frame, track, for_deletion) |
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
622 Lisp_Object frame; |
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
623 int track, for_deletion; |
286 | 624 { |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
625 struct frame *sf = SELECTED_FRAME (); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
626 |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
627 /* 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
|
628 switch to. */ |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
629 if (CONSP (frame) |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
630 && EQ (XCAR (frame), Qswitch_frame) |
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
631 && CONSP (XCDR (frame))) |
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
632 frame = XCAR (XCDR (frame)); |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
633 |
6352
6f48bd9145f9
(Fhandle_switch_frame): Ignore switch to dead frame.
Karl Heuer <kwzh@gnu.org>
parents:
6346
diff
changeset
|
634 /* This used to say CHECK_LIVE_FRAME, but apparently it's possible for |
6f48bd9145f9
(Fhandle_switch_frame): Ignore switch to dead frame.
Karl Heuer <kwzh@gnu.org>
parents:
6346
diff
changeset
|
635 a switch-frame event to arrive after a frame is no longer live, |
6f48bd9145f9
(Fhandle_switch_frame): Ignore switch to dead frame.
Karl Heuer <kwzh@gnu.org>
parents:
6346
diff
changeset
|
636 especially when deleting the initial frame during startup. */ |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
637 CHECK_FRAME (frame); |
6352
6f48bd9145f9
(Fhandle_switch_frame): Ignore switch to dead frame.
Karl Heuer <kwzh@gnu.org>
parents:
6346
diff
changeset
|
638 if (! FRAME_LIVE_P (XFRAME (frame))) |
6f48bd9145f9
(Fhandle_switch_frame): Ignore switch to dead frame.
Karl Heuer <kwzh@gnu.org>
parents:
6346
diff
changeset
|
639 return Qnil; |
286 | 640 |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
641 if (sf == XFRAME (frame)) |
765 | 642 return frame; |
286 | 643 |
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
644 /* This is too greedy; it causes inappropriate focus redirection |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
645 that's hard to get rid of. */ |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
646 #if 0 |
1709
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
647 /* 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
|
648 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
|
649 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
|
650 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
|
651 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
|
652 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
|
653 around. */ |
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
654 if (track) |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
655 { |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
656 Lisp_Object tail; |
1709
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
657 |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
658 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)) |
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
659 { |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
660 Lisp_Object focus; |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
661 |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
662 if (!FRAMEP (XCAR (tail))) |
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
663 abort (); |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
664 |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
665 focus = FRAME_FOCUS_FRAME (XFRAME (XCAR (tail))); |
1709
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
666 |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
667 if (FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ()) |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
668 Fredirect_frame_focus (XCAR (tail), frame); |
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
669 } |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
670 } |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
671 #else /* ! 0 */ |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
672 /* Instead, apply it only to the frame we're pointing to. */ |
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
673 #ifdef HAVE_WINDOW_SYSTEM |
36810
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
674 if (track && FRAME_WINDOW_P (XFRAME (frame))) |
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
675 { |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
676 Lisp_Object focus, xfocus; |
1709
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
677 |
11529
5beffe62d4ef
(do_switch_frame): x_get_focus_frame needs an arg.
Karl Heuer <kwzh@gnu.org>
parents:
11495
diff
changeset
|
678 xfocus = x_get_focus_frame (XFRAME (frame)); |
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
679 if (FRAMEP (xfocus)) |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
680 { |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
681 focus = FRAME_FOCUS_FRAME (XFRAME (xfocus)); |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
682 if (FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ()) |
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
683 Fredirect_frame_focus (xfocus, frame); |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
684 } |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
685 } |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
686 #endif /* HAVE_X_WINDOWS */ |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
687 #endif /* ! 0 */ |
1709
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
688 |
36810
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
689 if (!for_deletion && FRAME_HAS_MINIBUF_P (sf)) |
35611
3e7efd5ea1da
(do_switch_frame): If selected frame has a mini-window,
Gerd Moellmann <gerd@gnu.org>
parents:
35447
diff
changeset
|
690 resize_mini_window (XWINDOW (FRAME_MINIBUF_WINDOW (sf)), 1); |
3e7efd5ea1da
(do_switch_frame): If selected frame has a mini-window,
Gerd Moellmann <gerd@gnu.org>
parents:
35447
diff
changeset
|
691 |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
692 selected_frame = frame; |
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
693 if (! FRAME_MINIBUF_ONLY_P (XFRAME (selected_frame))) |
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
694 last_nonminibuf_frame = XFRAME (selected_frame); |
363 | 695 |
51048
7ac9c3bea5ea
(Fselect_window): Add optional arg `norecord'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50390
diff
changeset
|
696 Fselect_window (XFRAME (frame)->selected_window, Qnil); |
286 | 697 |
42743
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
698 #ifndef WINDOWSNT |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
699 /* Make sure to switch the tty color mode to that of the newly |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
700 selected frame. */ |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
701 sf = SELECTED_FRAME (); |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
702 if (FRAME_TERMCAP_P (sf)) |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
703 { |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
704 Lisp_Object color_mode_spec, color_mode; |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
705 |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
706 color_mode_spec = assq_no_quit (Qtty_color_mode, sf->param_alist); |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
707 if (CONSP (color_mode_spec)) |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
708 color_mode = XCDR (color_mode_spec); |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
709 else |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
710 color_mode = make_number (0); |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
711 set_tty_color_mode (sf, color_mode); |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
712 } |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
713 #endif /* !WINDOWSNT */ |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
714 |
1920
ac5e559a819a
* frame.c (Fselect_frame): Set Vlast_event_frame to Qnil after
Jim Blandy <jimb@redhat.com>
parents:
1870
diff
changeset
|
715 /* 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
|
716 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
|
717 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
|
718 (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
|
719 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
|
720 the one you're actually typing in. */ |
10853
3db086133785
(do_switch_frame): Undo Feb 6 change.
Karl Heuer <kwzh@gnu.org>
parents:
10851
diff
changeset
|
721 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
|
722 |
765 | 723 return frame; |
286 | 724 } |
725 | |
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
726 DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 2, "e", |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
727 doc: /* Select the frame FRAME. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
728 Subsequent editing commands apply to its selected window. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
729 The selection of FRAME lasts until the next time the user does |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
730 something to select a different frame, or until the next time this |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
731 function is called. */) |
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
732 (frame, no_enter) |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
733 Lisp_Object frame, no_enter; |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
734 { |
36810
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
735 return do_switch_frame (frame, 1, 0); |
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
736 } |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
737 |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
738 |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
739 DEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 2, "e", |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
740 doc: /* Handle a switch-frame event EVENT. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
741 Switch-frame events are usually bound to this function. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
742 A switch-frame event tells Emacs that the window manager has requested |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
743 that the user's events be directed to the frame mentioned in the event. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
744 This function selects the selected window of the frame of EVENT. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
745 |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
746 If EVENT is frame object, handle it as if it were a switch-frame event |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
747 to that frame. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
748 (event, no_enter) |
14077
a6d3ce4a2f8e
(Fhandle_switch_frame, Fset_frame_height): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents:
13748
diff
changeset
|
749 Lisp_Object event, no_enter; |
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
750 { |
12255
41083bd094ac
(Fhandle_switch_frame): Preserve prefix arg.
Karl Heuer <kwzh@gnu.org>
parents:
12222
diff
changeset
|
751 /* Preserve prefix arg that the command loop just cleared. */ |
41083bd094ac
(Fhandle_switch_frame): Preserve prefix arg.
Karl Heuer <kwzh@gnu.org>
parents:
12222
diff
changeset
|
752 current_kboard->Vprefix_arg = Vcurrent_prefix_arg; |
13106
22011e724596
(Qmouse_leave_buffer_hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
12987
diff
changeset
|
753 call1 (Vrun_hooks, Qmouse_leave_buffer_hook); |
36810
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
754 return do_switch_frame (event, 0, 0); |
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
755 } |
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
756 |
12283
fd9043d15414
[MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12255
diff
changeset
|
757 DEFUN ("ignore-event", Fignore_event, Signore_event, 0, 0, "", |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
758 doc: /* Do nothing, but preserve any prefix argument already specified. |
51091
178720d9eaff
(Fignore_event): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
51048
diff
changeset
|
759 This is a suitable binding for `iconify-frame' and `make-frame-visible'. */) |
12283
fd9043d15414
[MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12255
diff
changeset
|
760 () |
fd9043d15414
[MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12255
diff
changeset
|
761 { |
fd9043d15414
[MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12255
diff
changeset
|
762 current_kboard->Vprefix_arg = Vcurrent_prefix_arg; |
fd9043d15414
[MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12255
diff
changeset
|
763 return Qnil; |
fd9043d15414
[MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12255
diff
changeset
|
764 } |
6486
5012ae9c6075
(do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents:
6355
diff
changeset
|
765 |
765 | 766 DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
767 doc: /* Return the frame that is now selected. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
768 () |
286 | 769 { |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
770 return selected_frame; |
286 | 771 } |
7055
5e4906d964b8
(Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7025
diff
changeset
|
772 |
765 | 773 DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
774 doc: /* Return the frame object that window WINDOW is on. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
775 (window) |
286 | 776 Lisp_Object window; |
777 { | |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
778 CHECK_LIVE_WINDOW (window); |
765 | 779 return XWINDOW (window)->frame; |
286 | 780 } |
781 | |
6527
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
782 DEFUN ("frame-first-window", Fframe_first_window, Sframe_first_window, 0, 1, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
783 doc: /* Returns the topmost, leftmost window of FRAME. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
784 If omitted, FRAME defaults to the currently selected frame. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
785 (frame) |
6527
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
786 Lisp_Object frame; |
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
787 { |
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
788 Lisp_Object w; |
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
789 |
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
790 if (NILP (frame)) |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
791 w = SELECTED_FRAME ()->root_window; |
6527
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
792 else |
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
793 { |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
794 CHECK_LIVE_FRAME (frame); |
6527
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
795 w = XFRAME (frame)->root_window; |
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
796 } |
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
797 while (NILP (XWINDOW (w)->buffer)) |
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
798 { |
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
799 if (! NILP (XWINDOW (w)->hchild)) |
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
800 w = XWINDOW (w)->hchild; |
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
801 else if (! NILP (XWINDOW (w)->vchild)) |
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
802 w = XWINDOW (w)->vchild; |
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
803 else |
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
804 abort (); |
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
805 } |
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
806 return w; |
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
807 } |
ab9f20a3f502
(Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents:
6500
diff
changeset
|
808 |
11169
d0550c056e5b
[MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
11126
diff
changeset
|
809 DEFUN ("active-minibuffer-window", Factive_minibuffer_window, |
d0550c056e5b
[MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
11126
diff
changeset
|
810 Sactive_minibuffer_window, 0, 0, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
811 doc: /* Return the currently active minibuffer window, or nil if none. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
812 () |
11169
d0550c056e5b
[MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
11126
diff
changeset
|
813 { |
d0550c056e5b
[MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
11126
diff
changeset
|
814 return minibuf_level ? minibuf_window : Qnil; |
d0550c056e5b
[MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
11126
diff
changeset
|
815 } |
d0550c056e5b
[MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
11126
diff
changeset
|
816 |
765 | 817 DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
818 doc: /* Returns the root-window of FRAME. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
819 If omitted, FRAME defaults to the currently selected frame. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
820 (frame) |
765 | 821 Lisp_Object frame; |
286 | 822 { |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
823 Lisp_Object window; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
824 |
765 | 825 if (NILP (frame)) |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
826 window = SELECTED_FRAME ()->root_window; |
454 | 827 else |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
828 { |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
829 CHECK_LIVE_FRAME (frame); |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
830 window = XFRAME (frame)->root_window; |
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
831 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
832 |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
833 return window; |
286 | 834 } |
835 | |
765 | 836 DEFUN ("frame-selected-window", Fframe_selected_window, |
837 Sframe_selected_window, 0, 1, 0, | |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
838 doc: /* Return the selected window of frame object FRAME. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
839 If omitted, FRAME defaults to the currently selected frame. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
840 (frame) |
765 | 841 Lisp_Object frame; |
286 | 842 { |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
843 Lisp_Object window; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
844 |
765 | 845 if (NILP (frame)) |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
846 window = SELECTED_FRAME ()->selected_window; |
454 | 847 else |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
848 { |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
849 CHECK_LIVE_FRAME (frame); |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
850 window = XFRAME (frame)->selected_window; |
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
851 } |
286 | 852 |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
853 return window; |
286 | 854 } |
855 | |
7055
5e4906d964b8
(Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7025
diff
changeset
|
856 DEFUN ("set-frame-selected-window", Fset_frame_selected_window, |
5e4906d964b8
(Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7025
diff
changeset
|
857 Sset_frame_selected_window, 2, 2, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
858 doc: /* Set the selected window of frame object FRAME to WINDOW. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
859 If FRAME is nil, the selected frame is used. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
860 If FRAME is the selected frame, this makes WINDOW the selected window. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
861 (frame, window) |
7055
5e4906d964b8
(Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7025
diff
changeset
|
862 Lisp_Object frame, window; |
5e4906d964b8
(Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7025
diff
changeset
|
863 { |
5e4906d964b8
(Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7025
diff
changeset
|
864 if (NILP (frame)) |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
865 frame = selected_frame; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
866 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
867 CHECK_LIVE_FRAME (frame); |
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
868 CHECK_LIVE_WINDOW (window); |
7055
5e4906d964b8
(Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7025
diff
changeset
|
869 |
5e4906d964b8
(Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7025
diff
changeset
|
870 if (! EQ (frame, WINDOW_FRAME (XWINDOW (window)))) |
5e4906d964b8
(Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7025
diff
changeset
|
871 error ("In `set-frame-selected-window', WINDOW is not on FRAME"); |
5e4906d964b8
(Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7025
diff
changeset
|
872 |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
873 if (EQ (frame, selected_frame)) |
51048
7ac9c3bea5ea
(Fselect_window): Add optional arg `norecord'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50390
diff
changeset
|
874 return Fselect_window (window, Qnil); |
7055
5e4906d964b8
(Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7025
diff
changeset
|
875 |
5e4906d964b8
(Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7025
diff
changeset
|
876 return XFRAME (frame)->selected_window = window; |
5e4906d964b8
(Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7025
diff
changeset
|
877 } |
5e4906d964b8
(Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7025
diff
changeset
|
878 |
765 | 879 DEFUN ("frame-list", Fframe_list, Sframe_list, |
286 | 880 0, 0, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
881 doc: /* Return a list of all frames. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
882 () |
286 | 883 { |
36971
3819e613c7c2
(Fframe_list): Don't return a tooltip frame.
Gerd Moellmann <gerd@gnu.org>
parents:
36810
diff
changeset
|
884 Lisp_Object frames; |
3819e613c7c2
(Fframe_list): Don't return a tooltip frame.
Gerd Moellmann <gerd@gnu.org>
parents:
36810
diff
changeset
|
885 frames = Fcopy_sequence (Vframe_list); |
36984
1b91be709189
(Fframe_list): Don't reference tip_frame if HAVE_WINDOW_SYSTEM is not defined.
Eli Zaretskii <eliz@gnu.org>
parents:
36971
diff
changeset
|
886 #ifdef HAVE_WINDOW_SYSTEM |
36971
3819e613c7c2
(Fframe_list): Don't return a tooltip frame.
Gerd Moellmann <gerd@gnu.org>
parents:
36810
diff
changeset
|
887 if (FRAMEP (tip_frame)) |
3819e613c7c2
(Fframe_list): Don't return a tooltip frame.
Gerd Moellmann <gerd@gnu.org>
parents:
36810
diff
changeset
|
888 frames = Fdelq (tip_frame, frames); |
36984
1b91be709189
(Fframe_list): Don't reference tip_frame if HAVE_WINDOW_SYSTEM is not defined.
Eli Zaretskii <eliz@gnu.org>
parents:
36971
diff
changeset
|
889 #endif |
36971
3819e613c7c2
(Fframe_list): Don't return a tooltip frame.
Gerd Moellmann <gerd@gnu.org>
parents:
36810
diff
changeset
|
890 return frames; |
286 | 891 } |
892 | |
765 | 893 /* Return the next frame in the frame list after FRAME. |
894 If MINIBUF is nil, exclude minibuffer-only frames. | |
8168
32fbb27091d4
(next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents:
8099
diff
changeset
|
895 If MINIBUF is a window, include only its own frame |
32fbb27091d4
(next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents:
8099
diff
changeset
|
896 and any frame now using that window as the minibuffer. |
6246
128dc040e121
(next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents:
6157
diff
changeset
|
897 If MINIBUF is `visible', include all visible frames. |
8168
32fbb27091d4
(next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents:
8099
diff
changeset
|
898 If MINIBUF is 0, include all visible and iconified frames. |
6246
128dc040e121
(next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents:
6157
diff
changeset
|
899 Otherwise, include all frames. */ |
128dc040e121
(next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents:
6157
diff
changeset
|
900 |
286 | 901 Lisp_Object |
765 | 902 next_frame (frame, minibuf) |
903 Lisp_Object frame; | |
454 | 904 Lisp_Object minibuf; |
286 | 905 { |
906 Lisp_Object tail; | |
907 int passed = 0; | |
908 | |
765 | 909 /* There must always be at least one frame in Vframe_list. */ |
910 if (! CONSP (Vframe_list)) | |
454 | 911 abort (); |
912 | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
913 /* 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
|
914 forever. Forestall that. */ |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
915 CHECK_LIVE_FRAME (frame); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
916 |
286 | 917 while (1) |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
918 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)) |
286 | 919 { |
6500
551bff5cffde
(next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
parents:
6486
diff
changeset
|
920 Lisp_Object f; |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
921 |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
922 f = XCAR (tail); |
12379
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
923 |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
924 if (passed |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
925 && FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame))) |
363 | 926 { |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
927 /* 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
|
928 |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
929 /* 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
|
930 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
|
931 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
|
932 return f; |
335 | 933 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
934 /* 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
|
935 if (NILP (minibuf)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
936 { |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
937 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
|
938 return f; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
939 } |
6246
128dc040e121
(next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents:
6157
diff
changeset
|
940 else if (EQ (minibuf, Qvisible)) |
128dc040e121
(next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents:
6157
diff
changeset
|
941 { |
128dc040e121
(next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents:
6157
diff
changeset
|
942 FRAME_SAMPLE_VISIBILITY (XFRAME (f)); |
128dc040e121
(next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents:
6157
diff
changeset
|
943 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
|
944 return f; |
128dc040e121
(next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents:
6157
diff
changeset
|
945 } |
29987
c38afaed3dd0
(next_frame): Don't check frame-focus redirection in
Gerd Moellmann <gerd@gnu.org>
parents:
29616
diff
changeset
|
946 else if (INTEGERP (minibuf) && XINT (minibuf) == 0) |
8168
32fbb27091d4
(next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents:
8099
diff
changeset
|
947 { |
32fbb27091d4
(next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents:
8099
diff
changeset
|
948 FRAME_SAMPLE_VISIBILITY (XFRAME (f)); |
32fbb27091d4
(next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents:
8099
diff
changeset
|
949 if (FRAME_VISIBLE_P (XFRAME (f)) |
32fbb27091d4
(next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents:
8099
diff
changeset
|
950 || FRAME_ICONIFIED_P (XFRAME (f))) |
32fbb27091d4
(next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents:
8099
diff
changeset
|
951 return f; |
32fbb27091d4
(next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents:
8099
diff
changeset
|
952 } |
6246
128dc040e121
(next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents:
6157
diff
changeset
|
953 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
|
954 { |
8168
32fbb27091d4
(next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents:
8099
diff
changeset
|
955 if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf) |
29995
ec33931795c4
(next_frame, prev_frame): If MINIBUF is a window,
Gerd Moellmann <gerd@gnu.org>
parents:
29987
diff
changeset
|
956 || EQ (WINDOW_FRAME (XWINDOW (minibuf)), f) |
ec33931795c4
(next_frame, prev_frame): If MINIBUF is a window,
Gerd Moellmann <gerd@gnu.org>
parents:
29987
diff
changeset
|
957 || EQ (WINDOW_FRAME (XWINDOW (minibuf)), |
ec33931795c4
(next_frame, prev_frame): If MINIBUF is a window,
Gerd Moellmann <gerd@gnu.org>
parents:
29987
diff
changeset
|
958 FRAME_FOCUS_FRAME (XFRAME (f)))) |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
959 return f; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
960 } |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
961 else |
765 | 962 return f; |
363 | 963 } |
286 | 964 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
965 if (EQ (frame, f)) |
286 | 966 passed++; |
967 } | |
968 } | |
969 | |
765 | 970 /* Return the previous frame in the frame list before FRAME. |
971 If MINIBUF is nil, exclude minibuffer-only frames. | |
8168
32fbb27091d4
(next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents:
8099
diff
changeset
|
972 If MINIBUF is a window, include only its own frame |
32fbb27091d4
(next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents:
8099
diff
changeset
|
973 and any frame now using that window as the minibuffer. |
6246
128dc040e121
(next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents:
6157
diff
changeset
|
974 If MINIBUF is `visible', include all visible frames. |
8168
32fbb27091d4
(next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents:
8099
diff
changeset
|
975 If MINIBUF is 0, include all visible and iconified frames. |
6246
128dc040e121
(next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents:
6157
diff
changeset
|
976 Otherwise, include all frames. */ |
128dc040e121
(next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents:
6157
diff
changeset
|
977 |
286 | 978 Lisp_Object |
765 | 979 prev_frame (frame, minibuf) |
980 Lisp_Object frame; | |
454 | 981 Lisp_Object minibuf; |
286 | 982 { |
983 Lisp_Object tail; | |
984 Lisp_Object prev; | |
985 | |
765 | 986 /* There must always be at least one frame in Vframe_list. */ |
987 if (! CONSP (Vframe_list)) | |
454 | 988 abort (); |
989 | |
286 | 990 prev = Qnil; |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
991 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)) |
454 | 992 { |
6500
551bff5cffde
(next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
parents:
6486
diff
changeset
|
993 Lisp_Object f; |
454 | 994 |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
995 f = XCAR (tail); |
9127
0b4836daa8e1
(Fframep, make_frame_without_minibuffer, do_switch_frame, prev_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9032
diff
changeset
|
996 if (!FRAMEP (f)) |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
997 abort (); |
454 | 998 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
999 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
|
1000 return prev; |
454 | 1001 |
12379
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1002 if (FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame))) |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1003 { |
12379
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1004 /* Decide whether this frame is eligible to be returned, |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1005 according to minibuf. */ |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1006 if (NILP (minibuf)) |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1007 { |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1008 if (! FRAME_MINIBUF_ONLY_P (XFRAME (f))) |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1009 prev = f; |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1010 } |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1011 else if (WINDOWP (minibuf)) |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1012 { |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1013 if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf) |
29995
ec33931795c4
(next_frame, prev_frame): If MINIBUF is a window,
Gerd Moellmann <gerd@gnu.org>
parents:
29987
diff
changeset
|
1014 || EQ (WINDOW_FRAME (XWINDOW (minibuf)), f) |
ec33931795c4
(next_frame, prev_frame): If MINIBUF is a window,
Gerd Moellmann <gerd@gnu.org>
parents:
29987
diff
changeset
|
1015 || EQ (WINDOW_FRAME (XWINDOW (minibuf)), |
ec33931795c4
(next_frame, prev_frame): If MINIBUF is a window,
Gerd Moellmann <gerd@gnu.org>
parents:
29987
diff
changeset
|
1016 FRAME_FOCUS_FRAME (XFRAME (f)))) |
12379
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1017 prev = f; |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1018 } |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1019 else if (EQ (minibuf, Qvisible)) |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1020 { |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1021 FRAME_SAMPLE_VISIBILITY (XFRAME (f)); |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1022 if (FRAME_VISIBLE_P (XFRAME (f))) |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1023 prev = f; |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1024 } |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1025 else if (XFASTINT (minibuf) == 0) |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1026 { |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1027 FRAME_SAMPLE_VISIBILITY (XFRAME (f)); |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1028 if (FRAME_VISIBLE_P (XFRAME (f)) |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1029 || FRAME_ICONIFIED_P (XFRAME (f))) |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1030 prev = f; |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1031 } |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1032 else |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1033 prev = f; |
454 | 1034 } |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1035 } |
454 | 1036 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1037 /* 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
|
1038 if (NILP (prev)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1039 /* 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
|
1040 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
|
1041 return frame; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1042 else |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1043 /* 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
|
1044 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
|
1045 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
|
1046 return prev; |
286 | 1047 } |
1048 | |
4424
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
1049 |
765 | 1050 DEFUN ("next-frame", Fnext_frame, Snext_frame, 0, 2, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1051 doc: /* Return the next frame in the frame list after FRAME. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1052 It considers only frames on the same terminal as FRAME. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1053 By default, skip minibuffer-only frames. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1054 If omitted, FRAME defaults to the selected frame. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1055 If optional argument MINIFRAME is nil, exclude minibuffer-only frames. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1056 If MINIFRAME is a window, include only its own frame |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1057 and any frame now using that window as the minibuffer. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1058 If MINIFRAME is `visible', include all visible frames. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1059 If MINIFRAME is 0, include all visible and iconified frames. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1060 Otherwise, include all frames. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1061 (frame, miniframe) |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
1062 Lisp_Object frame, miniframe; |
286 | 1063 { |
765 | 1064 if (NILP (frame)) |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1065 frame = selected_frame; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
1066 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
1067 CHECK_LIVE_FRAME (frame); |
765 | 1068 return next_frame (frame, miniframe); |
286 | 1069 } |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1070 |
4424
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
1071 DEFUN ("previous-frame", Fprevious_frame, Sprevious_frame, 0, 2, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1072 doc: /* Return the previous frame in the frame list before FRAME. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1073 It considers only frames on the same terminal as FRAME. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1074 By default, skip minibuffer-only frames. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1075 If omitted, FRAME defaults to the selected frame. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1076 If optional argument MINIFRAME is nil, exclude minibuffer-only frames. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1077 If MINIFRAME is a window, include only its own frame |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1078 and any frame now using that window as the minibuffer. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1079 If MINIFRAME is `visible', include all visible frames. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1080 If MINIFRAME is 0, include all visible and iconified frames. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1081 Otherwise, include all frames. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1082 (frame, miniframe) |
4424
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
1083 Lisp_Object frame, miniframe; |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
1084 { |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
1085 if (NILP (frame)) |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1086 frame = selected_frame; |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
1087 CHECK_LIVE_FRAME (frame); |
4424
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
1088 return prev_frame (frame, miniframe); |
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
1089 } |
286 | 1090 |
5925
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1091 /* 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
|
1092 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
|
1093 (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
|
1094 |
7646
de2c4334fad4
(other_visible_frames): No longer static.
Richard M. Stallman <rms@gnu.org>
parents:
7570
diff
changeset
|
1095 int |
5925
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1096 other_visible_frames (f) |
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1097 FRAME_PTR f; |
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1098 { |
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1099 /* 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
|
1100 so if F is some other frame, it can't be the sole visible one. */ |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1101 if (f == SELECTED_FRAME ()) |
5925
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1102 { |
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1103 Lisp_Object frames; |
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1104 int count = 0; |
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1105 |
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1106 for (frames = Vframe_list; |
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1107 CONSP (frames); |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
1108 frames = XCDR (frames)) |
5925
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1109 { |
6500
551bff5cffde
(next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
parents:
6486
diff
changeset
|
1110 Lisp_Object this; |
5925
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1111 |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
1112 this = XCAR (frames); |
5925
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1113 /* 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
|
1114 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
|
1115 in visibility. */ |
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
1116 #ifdef HAVE_WINDOW_SYSTEM |
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
1117 if (FRAME_WINDOW_P (XFRAME (this))) |
5925
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1118 { |
9648
14b1481b7c6d
(other_visible_frames): Pass a frame ptr to x_sync.
Richard M. Stallman <rms@gnu.org>
parents:
9572
diff
changeset
|
1119 x_sync (XFRAME (this)); |
5925
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1120 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
|
1121 } |
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1122 #endif |
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1123 |
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1124 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
|
1125 || 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
|
1126 /* 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
|
1127 one X frame exists! */ |
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
1128 || (FRAME_WINDOW_P (XFRAME (this)) && !FRAME_WINDOW_P (f))) |
5925
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1129 count++; |
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1130 } |
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1131 return count > 1; |
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1132 } |
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1133 return 1; |
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1134 } |
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1135 |
4341
d07ef5ea3b58
(Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents:
4227
diff
changeset
|
1136 DEFUN ("delete-frame", Fdelete_frame, Sdelete_frame, 0, 2, "", |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1137 doc: /* Delete FRAME, permanently eliminating it from use. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1138 If omitted, FRAME defaults to the selected frame. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1139 A frame may not be deleted if its minibuffer is used by other frames. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1140 Normally, you may not delete a frame if all other frames are invisible, |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1141 but if the second optional argument FORCE is non-nil, you may do so. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1142 |
47731
755c4233cfba
* frame.c (Vdelete_frame_functions): New variable.
John Paul Wallington <jpw@pobox.com>
parents:
47036
diff
changeset
|
1143 This function runs `delete-frame-functions' before actually deleting the |
755c4233cfba
* frame.c (Vdelete_frame_functions): New variable.
John Paul Wallington <jpw@pobox.com>
parents:
47036
diff
changeset
|
1144 frame, unless the frame is a tooltip. |
755c4233cfba
* frame.c (Vdelete_frame_functions): New variable.
John Paul Wallington <jpw@pobox.com>
parents:
47036
diff
changeset
|
1145 The functions are run with one arg, the frame to be deleted. */) |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1146 (frame, force) |
4341
d07ef5ea3b58
(Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents:
4227
diff
changeset
|
1147 Lisp_Object frame, force; |
286 | 1148 { |
765 | 1149 struct frame *f; |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1150 struct frame *sf = SELECTED_FRAME (); |
12222
7286ed64badd
(Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
parents:
12010
diff
changeset
|
1151 int minibuffer_selected; |
286 | 1152 |
765 | 1153 if (EQ (frame, Qnil)) |
286 | 1154 { |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1155 f = sf; |
9268
cb55d0155265
(make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9214
diff
changeset
|
1156 XSETFRAME (frame, f); |
286 | 1157 } |
1158 else | |
1159 { | |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
1160 CHECK_FRAME (frame); |
765 | 1161 f = XFRAME (frame); |
286 | 1162 } |
1163 | |
765 | 1164 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
|
1165 return Qnil; |
454 | 1166 |
35660
b9366f467430
* alloc.c (allocate_string) [macintosh]: Call check_string_bytes
Andrew Choi <akochoi@shaw.ca>
parents:
35611
diff
changeset
|
1167 if (NILP (force) && !other_visible_frames (f) |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
43717
diff
changeset
|
1168 #ifdef MAC_OS8 |
35660
b9366f467430
* alloc.c (allocate_string) [macintosh]: Call check_string_bytes
Andrew Choi <akochoi@shaw.ca>
parents:
35611
diff
changeset
|
1169 /* Terminal frame deleted before any other visible frames are |
b9366f467430
* alloc.c (allocate_string) [macintosh]: Call check_string_bytes
Andrew Choi <akochoi@shaw.ca>
parents:
35611
diff
changeset
|
1170 created. */ |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46285
diff
changeset
|
1171 && strcmp (SDATA (f->name), "F1") != 0 |
35660
b9366f467430
* alloc.c (allocate_string) [macintosh]: Call check_string_bytes
Andrew Choi <akochoi@shaw.ca>
parents:
35611
diff
changeset
|
1172 #endif |
b9366f467430
* alloc.c (allocate_string) [macintosh]: Call check_string_bytes
Andrew Choi <akochoi@shaw.ca>
parents:
35611
diff
changeset
|
1173 ) |
5925
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1174 error ("Attempt to delete the sole visible or iconified frame"); |
286 | 1175 |
18945
7f491075707a
(Fdelete_frame): Undo previous change.
Richard M. Stallman <rms@gnu.org>
parents:
18698
diff
changeset
|
1176 #if 0 |
7f491075707a
(Fdelete_frame): Undo previous change.
Richard M. Stallman <rms@gnu.org>
parents:
18698
diff
changeset
|
1177 /* This is a nice idea, but x_connection_closed needs to be able |
7f491075707a
(Fdelete_frame): Undo previous change.
Richard M. Stallman <rms@gnu.org>
parents:
18698
diff
changeset
|
1178 to delete the last frame, if it is gone. */ |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
1179 if (NILP (XCDR (Vframe_list))) |
18698
52271ad26a1d
(Fdelete_frame): Always err for deleting the only frame.
Richard M. Stallman <rms@gnu.org>
parents:
18380
diff
changeset
|
1180 error ("Attempt to delete the only frame"); |
18945
7f491075707a
(Fdelete_frame): Undo previous change.
Richard M. Stallman <rms@gnu.org>
parents:
18698
diff
changeset
|
1181 #endif |
18698
52271ad26a1d
(Fdelete_frame): Always err for deleting the only frame.
Richard M. Stallman <rms@gnu.org>
parents:
18380
diff
changeset
|
1182 |
765 | 1183 /* Does this frame have a minibuffer, and is it the surrogate |
1184 minibuffer for any other frame? */ | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1185 if (FRAME_HAS_MINIBUF_P (XFRAME (frame))) |
363 | 1186 { |
765 | 1187 Lisp_Object frames; |
708 | 1188 |
765 | 1189 for (frames = Vframe_list; |
1190 CONSP (frames); | |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
1191 frames = XCDR (frames)) |
708 | 1192 { |
6157
9422e430f067
(Fdelete_frame): Don't initialize a Lisp_Object.
Richard M. Stallman <rms@gnu.org>
parents:
6130
diff
changeset
|
1193 Lisp_Object this; |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
1194 this = XCAR (frames); |
363 | 1195 |
765 | 1196 if (! EQ (this, frame) |
1197 && EQ (frame, | |
6157
9422e430f067
(Fdelete_frame): Don't initialize a Lisp_Object.
Richard M. Stallman <rms@gnu.org>
parents:
6130
diff
changeset
|
1198 WINDOW_FRAME (XWINDOW |
9422e430f067
(Fdelete_frame): Don't initialize a Lisp_Object.
Richard M. Stallman <rms@gnu.org>
parents:
6130
diff
changeset
|
1199 (FRAME_MINIBUF_WINDOW (XFRAME (this)))))) |
765 | 1200 error ("Attempt to delete a surrogate minibuffer frame"); |
708 | 1201 } |
286 | 1202 } |
1203 | |
47731
755c4233cfba
* frame.c (Vdelete_frame_functions): New variable.
John Paul Wallington <jpw@pobox.com>
parents:
47036
diff
changeset
|
1204 /* Run `delete-frame-functions' unless frame is a tooltip. */ |
755c4233cfba
* frame.c (Vdelete_frame_functions): New variable.
John Paul Wallington <jpw@pobox.com>
parents:
47036
diff
changeset
|
1205 if (!NILP (Vrun_hooks) |
755c4233cfba
* frame.c (Vdelete_frame_functions): New variable.
John Paul Wallington <jpw@pobox.com>
parents:
47036
diff
changeset
|
1206 && NILP (Fframe_parameter (frame, intern ("tooltip")))) |
32909
44cb0900a858
(Fdelete_frame): Doc fix. Move running the hook
Gerd Moellmann <gerd@gnu.org>
parents:
32907
diff
changeset
|
1207 { |
44cb0900a858
(Fdelete_frame): Doc fix. Move running the hook
Gerd Moellmann <gerd@gnu.org>
parents:
32907
diff
changeset
|
1208 Lisp_Object args[2]; |
47731
755c4233cfba
* frame.c (Vdelete_frame_functions): New variable.
John Paul Wallington <jpw@pobox.com>
parents:
47036
diff
changeset
|
1209 args[0] = intern ("delete-frame-functions"); |
32909
44cb0900a858
(Fdelete_frame): Doc fix. Move running the hook
Gerd Moellmann <gerd@gnu.org>
parents:
32907
diff
changeset
|
1210 args[1] = frame; |
44cb0900a858
(Fdelete_frame): Doc fix. Move running the hook
Gerd Moellmann <gerd@gnu.org>
parents:
32907
diff
changeset
|
1211 Frun_hook_with_args (2, args); |
44cb0900a858
(Fdelete_frame): Doc fix. Move running the hook
Gerd Moellmann <gerd@gnu.org>
parents:
32907
diff
changeset
|
1212 } |
44cb0900a858
(Fdelete_frame): Doc fix. Move running the hook
Gerd Moellmann <gerd@gnu.org>
parents:
32907
diff
changeset
|
1213 |
12222
7286ed64badd
(Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
parents:
12010
diff
changeset
|
1214 minibuffer_selected = EQ (minibuf_window, selected_window); |
7286ed64badd
(Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
parents:
12010
diff
changeset
|
1215 |
765 | 1216 /* Don't let the frame remain selected. */ |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1217 if (f == sf) |
12379
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1218 { |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1219 Lisp_Object tail, frame1; |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1220 |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1221 /* Look for another visible frame on the same terminal. */ |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1222 frame1 = next_frame (frame, Qvisible); |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1223 |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1224 /* If there is none, find *some* other frame. */ |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1225 if (NILP (frame1) || EQ (frame1, frame)) |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1226 { |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1227 FOR_EACH_FRAME (tail, frame1) |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1228 { |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1229 if (! EQ (frame, frame1)) |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1230 break; |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1231 } |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1232 } |
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1233 |
36810
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
1234 do_switch_frame (frame1, 0, 1); |
25736
84179b4e7743
(Fdelete_frame): Correct local variable pointing to
Gerd Moellmann <gerd@gnu.org>
parents:
25710
diff
changeset
|
1235 sf = SELECTED_FRAME (); |
12379
7149fc03ea56
(next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents:
12286
diff
changeset
|
1236 } |
286 | 1237 |
765 | 1238 /* Don't allow minibuf_window to remain on a deleted frame. */ |
1239 if (EQ (f->minibuffer_window, minibuf_window)) | |
286 | 1240 { |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1241 Fset_window_buffer (sf->minibuffer_window, |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
1242 XWINDOW (minibuf_window)->buffer, Qnil); |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1243 minibuf_window = sf->minibuffer_window; |
12222
7286ed64badd
(Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
parents:
12010
diff
changeset
|
1244 |
7286ed64badd
(Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
parents:
12010
diff
changeset
|
1245 /* If the dying minibuffer window was selected, |
7286ed64badd
(Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
parents:
12010
diff
changeset
|
1246 select the new one. */ |
7286ed64badd
(Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
parents:
12010
diff
changeset
|
1247 if (minibuffer_selected) |
51048
7ac9c3bea5ea
(Fselect_window): Add optional arg `norecord'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50390
diff
changeset
|
1248 Fselect_window (minibuf_window, Qnil); |
286 | 1249 } |
1250 | |
27800
403b2b833ce2
(Fdelete_frame): Don't let echo_area_window to remain on a deleted frame.
Eli Zaretskii <eliz@gnu.org>
parents:
27797
diff
changeset
|
1251 /* Don't let echo_area_window to remain on a deleted frame. */ |
403b2b833ce2
(Fdelete_frame): Don't let echo_area_window to remain on a deleted frame.
Eli Zaretskii <eliz@gnu.org>
parents:
27797
diff
changeset
|
1252 if (EQ (f->minibuffer_window, echo_area_window)) |
403b2b833ce2
(Fdelete_frame): Don't let echo_area_window to remain on a deleted frame.
Eli Zaretskii <eliz@gnu.org>
parents:
27797
diff
changeset
|
1253 echo_area_window = sf->minibuffer_window; |
403b2b833ce2
(Fdelete_frame): Don't let echo_area_window to remain on a deleted frame.
Eli Zaretskii <eliz@gnu.org>
parents:
27797
diff
changeset
|
1254 |
8099
a06382fd175d
(Fdelete_frame): Call x_clear_frame_selections.
Richard M. Stallman <rms@gnu.org>
parents:
8054
diff
changeset
|
1255 /* Clear any X selections for this frame. */ |
a06382fd175d
(Fdelete_frame): Call x_clear_frame_selections.
Richard M. Stallman <rms@gnu.org>
parents:
8054
diff
changeset
|
1256 #ifdef HAVE_X_WINDOWS |
a06382fd175d
(Fdelete_frame): Call x_clear_frame_selections.
Richard M. Stallman <rms@gnu.org>
parents:
8054
diff
changeset
|
1257 if (FRAME_X_P (f)) |
a06382fd175d
(Fdelete_frame): Call x_clear_frame_selections.
Richard M. Stallman <rms@gnu.org>
parents:
8054
diff
changeset
|
1258 x_clear_frame_selections (f); |
a06382fd175d
(Fdelete_frame): Call x_clear_frame_selections.
Richard M. Stallman <rms@gnu.org>
parents:
8054
diff
changeset
|
1259 #endif |
a06382fd175d
(Fdelete_frame): Call x_clear_frame_selections.
Richard M. Stallman <rms@gnu.org>
parents:
8054
diff
changeset
|
1260 |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
1261 /* Free glyphs. |
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
1262 This function must be called before the window tree of the |
25030
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
1263 frame is deleted because windows contain dynamically allocated |
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
1264 memory. */ |
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
1265 free_glyphs (f); |
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
1266 |
1680
ea9f3949f153
* frame.c (Fdelete_frame): Delete all the windows in the frame's
Jim Blandy <jimb@redhat.com>
parents:
1652
diff
changeset
|
1267 /* 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
|
1268 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
|
1269 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
|
1270 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
|
1271 |
765 | 1272 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
|
1273 FRAME_SET_VISIBLE (f, 0); |
286 | 1274 |
11495
da1a40d86231
(Fdelete_frame): Free f->namebuf.
Karl Heuer <kwzh@gnu.org>
parents:
11494
diff
changeset
|
1275 if (f->namebuf) |
25030
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
1276 xfree (f->namebuf); |
8666
844edbc22875
(Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents:
8586
diff
changeset
|
1277 if (FRAME_INSERT_COST (f)) |
25030
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
1278 xfree (FRAME_INSERT_COST (f)); |
8666
844edbc22875
(Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents:
8586
diff
changeset
|
1279 if (FRAME_DELETEN_COST (f)) |
25030
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
1280 xfree (FRAME_DELETEN_COST (f)); |
8666
844edbc22875
(Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents:
8586
diff
changeset
|
1281 if (FRAME_INSERTN_COST (f)) |
25030
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
1282 xfree (FRAME_INSERTN_COST (f)); |
8666
844edbc22875
(Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents:
8586
diff
changeset
|
1283 if (FRAME_DELETE_COST (f)) |
25030
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
1284 xfree (FRAME_DELETE_COST (f)); |
17573
bfd86808adcc
(Fdelete_frame): Free FRAME_MESSAGE_BUF.
Richard M. Stallman <rms@gnu.org>
parents:
17235
diff
changeset
|
1285 if (FRAME_MESSAGE_BUF (f)) |
25030
c69d9e48269b
(make_frame): Set n_current_toolbar_items to 0.
Gerd Moellmann <gerd@gnu.org>
parents:
23746
diff
changeset
|
1286 xfree (FRAME_MESSAGE_BUF (f)); |
8666
844edbc22875
(Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents:
8586
diff
changeset
|
1287 |
1809
69b3ee873a9b
* frame.c (Fdelete_frame): Clear the frame's display after calling
Jim Blandy <jimb@redhat.com>
parents:
1784
diff
changeset
|
1288 /* 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
|
1289 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
|
1290 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
|
1291 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
|
1292 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
|
1293 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1294 /* I think this should be done with a hook. */ |
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
1295 #ifdef HAVE_WINDOW_SYSTEM |
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
1296 if (FRAME_WINDOW_P (f)) |
1809
69b3ee873a9b
* frame.c (Fdelete_frame): Clear the frame's display after calling
Jim Blandy <jimb@redhat.com>
parents:
1784
diff
changeset
|
1297 x_destroy_window (f); |
363 | 1298 #endif |
1299 | |
12667
a3466dad7d6d
Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents:
12630
diff
changeset
|
1300 f->output_data.nothing = 0; |
1809
69b3ee873a9b
* frame.c (Fdelete_frame): Clear the frame's display after calling
Jim Blandy <jimb@redhat.com>
parents:
1784
diff
changeset
|
1301 |
765 | 1302 /* If we've deleted the last_nonminibuf_frame, then try to find |
363 | 1303 another one. */ |
765 | 1304 if (f == last_nonminibuf_frame) |
363 | 1305 { |
765 | 1306 Lisp_Object frames; |
708 | 1307 |
765 | 1308 last_nonminibuf_frame = 0; |
363 | 1309 |
765 | 1310 for (frames = Vframe_list; |
1311 CONSP (frames); | |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
1312 frames = XCDR (frames)) |
363 | 1313 { |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
1314 f = XFRAME (XCAR (frames)); |
765 | 1315 if (!FRAME_MINIBUF_ONLY_P (f)) |
363 | 1316 { |
765 | 1317 last_nonminibuf_frame = f; |
363 | 1318 break; |
1319 } | |
1320 } | |
1321 } | |
286 | 1322 |
11906
3ca56969ba07
(Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11794
diff
changeset
|
1323 /* If we've deleted this keyboard's default_minibuffer_frame, try to |
3ca56969ba07
(Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11794
diff
changeset
|
1324 find another one. Prefer minibuffer-only frames, but also notice |
3ca56969ba07
(Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11794
diff
changeset
|
1325 frames with other windows. */ |
11779
6234b3610a6f
Vdefault_minibuffer_frame is now part of KBOARD instead
Karl Heuer <kwzh@gnu.org>
parents:
11775
diff
changeset
|
1326 if (EQ (frame, FRAME_KBOARD (f)->Vdefault_minibuffer_frame)) |
708 | 1327 { |
765 | 1328 Lisp_Object frames; |
708 | 1329 |
765 | 1330 /* The last frame we saw with a minibuffer, minibuffer-only or not. */ |
6500
551bff5cffde
(next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
parents:
6486
diff
changeset
|
1331 Lisp_Object frame_with_minibuf; |
12380
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1332 /* Some frame we found on the same kboard, or nil if there are none. */ |
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1333 Lisp_Object frame_on_same_kboard; |
708 | 1334 |
12380
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1335 frame_on_same_kboard = Qnil; |
6500
551bff5cffde
(next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
parents:
6486
diff
changeset
|
1336 frame_with_minibuf = Qnil; |
12380
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1337 |
765 | 1338 for (frames = Vframe_list; |
1339 CONSP (frames); | |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
1340 frames = XCDR (frames)) |
708 | 1341 { |
6500
551bff5cffde
(next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
parents:
6486
diff
changeset
|
1342 Lisp_Object this; |
11906
3ca56969ba07
(Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11794
diff
changeset
|
1343 struct frame *f1; |
708 | 1344 |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
1345 this = XCAR (frames); |
9127
0b4836daa8e1
(Fframep, make_frame_without_minibuffer, do_switch_frame, prev_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9032
diff
changeset
|
1346 if (!FRAMEP (this)) |
708 | 1347 abort (); |
11906
3ca56969ba07
(Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11794
diff
changeset
|
1348 f1 = XFRAME (this); |
708 | 1349 |
11906
3ca56969ba07
(Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11794
diff
changeset
|
1350 /* Consider only frames on the same kboard |
3ca56969ba07
(Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11794
diff
changeset
|
1351 and only those with minibuffers. */ |
3ca56969ba07
(Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11794
diff
changeset
|
1352 if (FRAME_KBOARD (f) == FRAME_KBOARD (f1) |
3ca56969ba07
(Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11794
diff
changeset
|
1353 && FRAME_HAS_MINIBUF_P (f1)) |
708 | 1354 { |
765 | 1355 frame_with_minibuf = this; |
11906
3ca56969ba07
(Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents:
11794
diff
changeset
|
1356 if (FRAME_MINIBUF_ONLY_P (f1)) |
708 | 1357 break; |
1358 } | |
12380
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1359 |
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1360 if (FRAME_KBOARD (f) == FRAME_KBOARD (f1)) |
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1361 frame_on_same_kboard = this; |
708 | 1362 } |
1363 | |
12380
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1364 if (!NILP (frame_on_same_kboard)) |
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1365 { |
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1366 /* We know that there must be some frame with a minibuffer out |
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1367 there. If this were not true, all of the frames present |
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1368 would have to be minibufferless, which implies that at some |
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1369 point their minibuffer frames must have been deleted, but |
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1370 that is prohibited at the top; you can't delete surrogate |
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1371 minibuffer frames. */ |
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1372 if (NILP (frame_with_minibuf)) |
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1373 abort (); |
708 | 1374 |
12380
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1375 FRAME_KBOARD (f)->Vdefault_minibuffer_frame = frame_with_minibuf; |
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1376 } |
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1377 else |
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1378 /* No frames left on this kboard--say no minibuffer either. */ |
2c09b3adbb90
(Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents:
12379
diff
changeset
|
1379 FRAME_KBOARD (f)->Vdefault_minibuffer_frame = Qnil; |
708 | 1380 } |
1381 | |
16280
f4833d0bfaaa
(Fdelete_frame): Set update_mode_lines.
Richard M. Stallman <rms@gnu.org>
parents:
16263
diff
changeset
|
1382 /* Cause frame titles to update--necessary if we now have just one frame. */ |
f4833d0bfaaa
(Fdelete_frame): Set update_mode_lines.
Richard M. Stallman <rms@gnu.org>
parents:
16263
diff
changeset
|
1383 update_mode_lines = 1; |
f4833d0bfaaa
(Fdelete_frame): Set update_mode_lines.
Richard M. Stallman <rms@gnu.org>
parents:
16263
diff
changeset
|
1384 |
286 | 1385 return Qnil; |
1386 } | |
1387 | |
1388 /* Return mouse position in character cell units. */ | |
1389 | |
454 | 1390 DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1391 doc: /* Return a list (FRAME X . Y) giving the current mouse frame and position. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1392 The position is given in character cells, where (0, 0) is the |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1393 upper-left corner. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1394 If Emacs is running on a mouseless terminal or hasn't been programmed |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1395 to read the mouse position, it returns the selected frame for FRAME |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1396 and nil for X and Y. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1397 If `mouse-position-function' is non-nil, `mouse-position' calls it, |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1398 passing the normal return value to that function as an argument, |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1399 and returns whatever that function returns. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1400 () |
286 | 1401 { |
765 | 1402 FRAME_PTR f; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1403 Lisp_Object lispy_dummy; |
1989
b1c1ab20f810
Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents:
1920
diff
changeset
|
1404 enum scroll_bar_part party_dummy; |
27795
83292274bbd4
(Vmouse_position_function): New variable.
Dave Love <fx@gnu.org>
parents:
27725
diff
changeset
|
1405 Lisp_Object x, y, retval; |
6054
24ffc4bc4067
(Fmouse_position): Convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents:
6012
diff
changeset
|
1406 int col, row; |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1407 unsigned long long_dummy; |
27797
da774b48eb7f
(Fmouse_position): GCPRO retval instead of x and y.
Gerd Moellmann <gerd@gnu.org>
parents:
27795
diff
changeset
|
1408 struct gcpro gcpro1; |
286 | 1409 |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1410 f = SELECTED_FRAME (); |
3658
c2831d419bec
(Fmouse_position): Set up defaults before calling the hook.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1411 x = y = Qnil; |
c2831d419bec
(Fmouse_position): Set up defaults before calling the hook.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1412 |
11025
6c5aef697fbe
(Fmouse_position): Do work only if HAVE_MOUSE.
Karl Heuer <kwzh@gnu.org>
parents:
11017
diff
changeset
|
1413 #ifdef HAVE_MOUSE |
3658
c2831d419bec
(Fmouse_position): Set up defaults before calling the hook.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1414 /* It's okay for the hook to refrain from storing anything. */ |
454 | 1415 if (mouse_position_hook) |
20178
fb9facb8fda0
(Fmouse_pixel_position, Fmouse_position):
Karl Heuer <kwzh@gnu.org>
parents:
20038
diff
changeset
|
1416 (*mouse_position_hook) (&f, -1, |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1417 &lispy_dummy, &party_dummy, |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1418 &x, &y, |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1419 &long_dummy); |
6854
c976ac5d85ec
(Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
parents:
6806
diff
changeset
|
1420 if (! NILP (x)) |
c976ac5d85ec
(Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
parents:
6806
diff
changeset
|
1421 { |
c976ac5d85ec
(Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
parents:
6806
diff
changeset
|
1422 col = XINT (x); |
c976ac5d85ec
(Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
parents:
6806
diff
changeset
|
1423 row = XINT (y); |
12006
3e9db7cb1d05
(Fmouse_position): Use NULL, not 0, as arg of pixel_to_glyph_coords.
Karl Heuer <kwzh@gnu.org>
parents:
12005
diff
changeset
|
1424 pixel_to_glyph_coords (f, col, row, &col, &row, NULL, 1); |
6854
c976ac5d85ec
(Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
parents:
6806
diff
changeset
|
1425 XSETINT (x, col); |
c976ac5d85ec
(Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
parents:
6806
diff
changeset
|
1426 XSETINT (y, row); |
c976ac5d85ec
(Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
parents:
6806
diff
changeset
|
1427 } |
11025
6c5aef697fbe
(Fmouse_position): Do work only if HAVE_MOUSE.
Karl Heuer <kwzh@gnu.org>
parents:
11017
diff
changeset
|
1428 #endif |
9268
cb55d0155265
(make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9214
diff
changeset
|
1429 XSETFRAME (lispy_dummy, f); |
27795
83292274bbd4
(Vmouse_position_function): New variable.
Dave Love <fx@gnu.org>
parents:
27725
diff
changeset
|
1430 retval = Fcons (lispy_dummy, Fcons (x, y)); |
27797
da774b48eb7f
(Fmouse_position): GCPRO retval instead of x and y.
Gerd Moellmann <gerd@gnu.org>
parents:
27795
diff
changeset
|
1431 GCPRO1 (retval); |
27795
83292274bbd4
(Vmouse_position_function): New variable.
Dave Love <fx@gnu.org>
parents:
27725
diff
changeset
|
1432 if (!NILP (Vmouse_position_function)) |
27797
da774b48eb7f
(Fmouse_position): GCPRO retval instead of x and y.
Gerd Moellmann <gerd@gnu.org>
parents:
27795
diff
changeset
|
1433 retval = call1 (Vmouse_position_function, retval); |
da774b48eb7f
(Fmouse_position): GCPRO retval instead of x and y.
Gerd Moellmann <gerd@gnu.org>
parents:
27795
diff
changeset
|
1434 RETURN_UNGCPRO (retval); |
286 | 1435 } |
1436 | |
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1437 DEFUN ("mouse-pixel-position", Fmouse_pixel_position, |
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1438 Smouse_pixel_position, 0, 0, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1439 doc: /* Return a list (FRAME X . Y) giving the current mouse frame and position. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1440 The position is given in pixel units, where (0, 0) is the |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1441 upper-left corner. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1442 If Emacs is running on a mouseless terminal or hasn't been programmed |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1443 to read the mouse position, it returns the selected frame for FRAME |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1444 and nil for X and Y. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1445 () |
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1446 { |
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1447 FRAME_PTR f; |
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1448 Lisp_Object lispy_dummy; |
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1449 enum scroll_bar_part party_dummy; |
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1450 Lisp_Object x, y; |
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1451 unsigned long long_dummy; |
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1452 |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1453 f = SELECTED_FRAME (); |
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1454 x = y = Qnil; |
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1455 |
11126
786f1c82a38e
(Fmouse_position--both definitions): Pass 0 for `insist'.
Richard M. Stallman <rms@gnu.org>
parents:
11025
diff
changeset
|
1456 #ifdef HAVE_MOUSE |
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1457 /* It's okay for the hook to refrain from storing anything. */ |
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1458 if (mouse_position_hook) |
20178
fb9facb8fda0
(Fmouse_pixel_position, Fmouse_position):
Karl Heuer <kwzh@gnu.org>
parents:
20038
diff
changeset
|
1459 (*mouse_position_hook) (&f, -1, |
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1460 &lispy_dummy, &party_dummy, |
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1461 &x, &y, |
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1462 &long_dummy); |
11126
786f1c82a38e
(Fmouse_position--both definitions): Pass 0 for `insist'.
Richard M. Stallman <rms@gnu.org>
parents:
11025
diff
changeset
|
1463 #endif |
9268
cb55d0155265
(make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9214
diff
changeset
|
1464 XSETFRAME (lispy_dummy, f); |
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1465 return Fcons (lispy_dummy, Fcons (x, y)); |
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1466 } |
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1467 |
286 | 1468 DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1469 doc: /* Move the mouse pointer to the center of character cell (X,Y) in FRAME. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1470 Coordinates are relative to the frame, not a window, |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1471 so the coordinates of the top left character in the frame |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1472 may be nonzero due to left-hand scroll bars or the menu bar. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1473 |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1474 This function is a no-op for an X frame that is not visible. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1475 If you have just created a frame, you must wait for it to become visible |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1476 before calling this function on it, like this. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1477 (while (not (frame-visible-p frame)) (sleep-for .5)) */) |
765 | 1478 (frame, x, y) |
1479 Lisp_Object frame, x, y; | |
286 | 1480 { |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
1481 CHECK_LIVE_FRAME (frame); |
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
1482 CHECK_NUMBER (x); |
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
1483 CHECK_NUMBER (y); |
286 | 1484 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1485 /* I think this should be done with a hook. */ |
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
1486 #ifdef HAVE_WINDOW_SYSTEM |
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
1487 if (FRAME_WINDOW_P (XFRAME (frame))) |
39918
fa0407ac162f
(Fset_mouse_position): Improve style of comment to follow other comments.
Pavel Janík <Pavel@Janik.cz>
parents:
39748
diff
changeset
|
1488 /* Warping the mouse will cause enternotify and focus events. */ |
21524
e4ab93e19658
(Fset_mouse_position, Fset_mouse_pixel_position): Fix
Andreas Schwab <schwab@suse.de>
parents:
21514
diff
changeset
|
1489 x_set_mouse_position (XFRAME (frame), XINT (x), XINT (y)); |
15391
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
1490 #else |
15396 | 1491 #if defined (MSDOS) && defined (HAVE_MOUSE) |
15391
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
1492 if (FRAME_MSDOS_P (XFRAME (frame))) |
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
1493 { |
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
1494 Fselect_frame (frame, Qnil); |
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
1495 mouse_moveto (XINT (x), XINT (y)); |
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
1496 } |
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
1497 #endif |
286 | 1498 #endif |
1499 | |
1500 return Qnil; | |
1501 } | |
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1502 |
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1503 DEFUN ("set-mouse-pixel-position", Fset_mouse_pixel_position, |
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1504 Sset_mouse_pixel_position, 3, 3, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1505 doc: /* Move the mouse pointer to pixel position (X,Y) in FRAME. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1506 Note, this is a no-op for an X frame that is not visible. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1507 If you have just created a frame, you must wait for it to become visible |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1508 before calling this function on it, like this. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1509 (while (not (frame-visible-p frame)) (sleep-for .5)) */) |
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1510 (frame, x, y) |
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1511 Lisp_Object frame, x, y; |
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1512 { |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
1513 CHECK_LIVE_FRAME (frame); |
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
1514 CHECK_NUMBER (x); |
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
1515 CHECK_NUMBER (y); |
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1516 |
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1517 /* I think this should be done with a hook. */ |
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
1518 #ifdef HAVE_WINDOW_SYSTEM |
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
1519 if (FRAME_WINDOW_P (XFRAME (frame))) |
39918
fa0407ac162f
(Fset_mouse_position): Improve style of comment to follow other comments.
Pavel Janík <Pavel@Janik.cz>
parents:
39748
diff
changeset
|
1520 /* Warping the mouse will cause enternotify and focus events. */ |
21524
e4ab93e19658
(Fset_mouse_position, Fset_mouse_pixel_position): Fix
Andreas Schwab <schwab@suse.de>
parents:
21514
diff
changeset
|
1521 x_set_mouse_pixel_position (XFRAME (frame), XINT (x), XINT (y)); |
15391
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
1522 #else |
15396 | 1523 #if defined (MSDOS) && defined (HAVE_MOUSE) |
15391
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
1524 if (FRAME_MSDOS_P (XFRAME (frame))) |
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
1525 { |
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
1526 Fselect_frame (frame, Qnil); |
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
1527 mouse_moveto (XINT (x), XINT (y)); |
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
1528 } |
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
1529 #endif |
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1530 #endif |
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1531 |
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1532 return Qnil; |
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
1533 } |
286 | 1534 |
22188
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1535 static void make_frame_visible_1 P_ ((Lisp_Object)); |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1536 |
765 | 1537 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
|
1538 0, 1, "", |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1539 doc: /* Make the frame FRAME visible (assuming it is an X window). |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1540 If omitted, FRAME defaults to the currently selected frame. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1541 (frame) |
765 | 1542 Lisp_Object frame; |
286 | 1543 { |
872 | 1544 if (NILP (frame)) |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1545 frame = selected_frame; |
872 | 1546 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
1547 CHECK_LIVE_FRAME (frame); |
286 | 1548 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1549 /* I think this should be done with a hook. */ |
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
1550 #ifdef HAVE_WINDOW_SYSTEM |
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
1551 if (FRAME_WINDOW_P (XFRAME (frame))) |
5105
9b41ddf1b5f7
(Fmake_frame_visible): Use FRAME_SAMPLE_VISIBILITY. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
4961
diff
changeset
|
1552 { |
9b41ddf1b5f7
(Fmake_frame_visible): Use FRAME_SAMPLE_VISIBILITY. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
4961
diff
changeset
|
1553 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
|
1554 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
|
1555 } |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1556 #endif |
286 | 1557 |
22188
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1558 make_frame_visible_1 (XFRAME (frame)->root_window); |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1559 |
39918
fa0407ac162f
(Fset_mouse_position): Improve style of comment to follow other comments.
Pavel Janík <Pavel@Janik.cz>
parents:
39748
diff
changeset
|
1560 /* Make menu bar update for the Buffers and Frames menus. */ |
7900
60795e826dad
Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents:
7646
diff
changeset
|
1561 windows_or_buffers_changed++; |
60795e826dad
Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents:
7646
diff
changeset
|
1562 |
765 | 1563 return frame; |
286 | 1564 } |
1565 | |
22188
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1566 /* Update the display_time slot of the buffers shown in WINDOW |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1567 and all its descendents. */ |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1568 |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1569 static void |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1570 make_frame_visible_1 (window) |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1571 Lisp_Object window; |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1572 { |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1573 struct window *w; |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1574 |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1575 for (;!NILP (window); window = w->next) |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1576 { |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1577 w = XWINDOW (window); |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1578 |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1579 if (!NILP (w->buffer)) |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1580 XBUFFER (w->buffer)->display_time = Fcurrent_time (); |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1581 |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1582 if (!NILP (w->vchild)) |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1583 make_frame_visible_1 (w->vchild); |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1584 if (!NILP (w->hchild)) |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1585 make_frame_visible_1 (w->hchild); |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1586 } |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1587 } |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1588 |
765 | 1589 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
|
1590 0, 2, "", |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1591 doc: /* Make the frame FRAME invisible (assuming it is an X window). |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1592 If omitted, FRAME defaults to the currently selected frame. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1593 Normally you may not make FRAME invisible if all other frames are invisible, |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1594 but if the second optional argument FORCE is non-nil, you may do so. */) |
5925
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1595 (frame, force) |
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1596 Lisp_Object frame, force; |
286 | 1597 { |
872 | 1598 if (NILP (frame)) |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1599 frame = selected_frame; |
872 | 1600 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
1601 CHECK_LIVE_FRAME (frame); |
286 | 1602 |
5925
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
1603 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
|
1604 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
|
1605 |
8586
c78654909acf
(Fmake_frame_invisible, Ficonify_frame): Don't switch frames.
Karl Heuer <kwzh@gnu.org>
parents:
8264
diff
changeset
|
1606 #if 0 /* This isn't logically necessary, and it can do GC. */ |
3283
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1607 /* Don't let the frame remain selected. */ |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1608 if (EQ (frame, selected_frame)) |
36810
a9485f8e43d6
(do_switch_frame): Remove unused parameter NO_EVENT, add
Gerd Moellmann <gerd@gnu.org>
parents:
36804
diff
changeset
|
1609 do_switch_frame (next_frame (frame, Qt), 0, 0) |
8586
c78654909acf
(Fmake_frame_invisible, Ficonify_frame): Don't switch frames.
Karl Heuer <kwzh@gnu.org>
parents:
8264
diff
changeset
|
1610 #endif |
3283
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1611 |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1612 /* 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
|
1613 if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window)) |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1614 { |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1615 struct frame *sf = XFRAME (selected_frame); |
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1616 Fset_window_buffer (sf->minibuffer_window, |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
1617 XWINDOW (minibuf_window)->buffer, Qnil); |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1618 minibuf_window = sf->minibuffer_window; |
3283
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1619 } |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1620 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1621 /* I think this should be done with a hook. */ |
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
1622 #ifdef HAVE_WINDOW_SYSTEM |
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
1623 if (FRAME_WINDOW_P (XFRAME (frame))) |
765 | 1624 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
|
1625 #endif |
286 | 1626 |
39918
fa0407ac162f
(Fset_mouse_position): Improve style of comment to follow other comments.
Pavel Janík <Pavel@Janik.cz>
parents:
39748
diff
changeset
|
1627 /* Make menu bar update for the Buffers and Frames menus. */ |
7900
60795e826dad
Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents:
7646
diff
changeset
|
1628 windows_or_buffers_changed++; |
60795e826dad
Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents:
7646
diff
changeset
|
1629 |
286 | 1630 return Qnil; |
1631 } | |
1632 | |
765 | 1633 DEFUN ("iconify-frame", Ficonify_frame, Siconify_frame, |
872 | 1634 0, 1, "", |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1635 doc: /* Make the frame FRAME into an icon. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1636 If omitted, FRAME defaults to the currently selected frame. */) |
765 | 1637 (frame) |
1638 Lisp_Object frame; | |
286 | 1639 { |
872 | 1640 if (NILP (frame)) |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1641 frame = selected_frame; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
1642 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
1643 CHECK_LIVE_FRAME (frame); |
286 | 1644 |
8586
c78654909acf
(Fmake_frame_invisible, Ficonify_frame): Don't switch frames.
Karl Heuer <kwzh@gnu.org>
parents:
8264
diff
changeset
|
1645 #if 0 /* This isn't logically necessary, and it can do GC. */ |
3283
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1646 /* Don't let the frame remain selected. */ |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1647 if (EQ (frame, selected_frame)) |
3283
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1648 Fhandle_switch_frame (next_frame (frame, Qt), Qnil); |
8586
c78654909acf
(Fmake_frame_invisible, Ficonify_frame): Don't switch frames.
Karl Heuer <kwzh@gnu.org>
parents:
8264
diff
changeset
|
1649 #endif |
3283
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1650 |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1651 /* 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
|
1652 if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window)) |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1653 { |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1654 struct frame *sf = XFRAME (selected_frame); |
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1655 Fset_window_buffer (sf->minibuffer_window, |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
1656 XWINDOW (minibuf_window)->buffer, Qnil); |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1657 minibuf_window = sf->minibuffer_window; |
3283
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1658 } |
e2a40a3baa4b
(Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents:
2961
diff
changeset
|
1659 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1660 /* I think this should be done with a hook. */ |
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
1661 #ifdef HAVE_WINDOW_SYSTEM |
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
1662 if (FRAME_WINDOW_P (XFRAME (frame))) |
765 | 1663 x_iconify_frame (XFRAME (frame)); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1664 #endif |
286 | 1665 |
39918
fa0407ac162f
(Fset_mouse_position): Improve style of comment to follow other comments.
Pavel Janík <Pavel@Janik.cz>
parents:
39748
diff
changeset
|
1666 /* Make menu bar update for the Buffers and Frames menus. */ |
7900
60795e826dad
Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents:
7646
diff
changeset
|
1667 windows_or_buffers_changed++; |
60795e826dad
Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents:
7646
diff
changeset
|
1668 |
286 | 1669 return Qnil; |
1670 } | |
1671 | |
765 | 1672 DEFUN ("frame-visible-p", Fframe_visible_p, Sframe_visible_p, |
286 | 1673 1, 1, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1674 doc: /* Return t if FRAME is now \"visible\" (actually in use for display). |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1675 A frame that is not \"visible\" is not updated and, if it works through |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1676 a window system, it may not show at all. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1677 Return the symbol `icon' if frame is visible only as an icon. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1678 (frame) |
765 | 1679 Lisp_Object frame; |
286 | 1680 { |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
1681 CHECK_LIVE_FRAME (frame); |
286 | 1682 |
6012
650c0f231d17
(Fframe_visible_p): Do FRAME_SAMPLE_VISIBILITY first.
Richard M. Stallman <rms@gnu.org>
parents:
5925
diff
changeset
|
1683 FRAME_SAMPLE_VISIBILITY (XFRAME (frame)); |
650c0f231d17
(Fframe_visible_p): Do FRAME_SAMPLE_VISIBILITY first.
Richard M. Stallman <rms@gnu.org>
parents:
5925
diff
changeset
|
1684 |
1709
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
1685 if (FRAME_VISIBLE_P (XFRAME (frame))) |
286 | 1686 return Qt; |
1709
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
1687 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
|
1688 return Qicon; |
286 | 1689 return Qnil; |
1690 } | |
1691 | |
765 | 1692 DEFUN ("visible-frame-list", Fvisible_frame_list, Svisible_frame_list, |
286 | 1693 0, 0, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1694 doc: /* Return a list of all frames now \"visible\" (being updated). */) |
286 | 1695 () |
1696 { | |
765 | 1697 Lisp_Object tail, frame; |
1698 struct frame *f; | |
286 | 1699 Lisp_Object value; |
1700 | |
1701 value = Qnil; | |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
1702 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)) |
286 | 1703 { |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
26088
diff
changeset
|
1704 frame = XCAR (tail); |
9127
0b4836daa8e1
(Fframep, make_frame_without_minibuffer, do_switch_frame, prev_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9032
diff
changeset
|
1705 if (!FRAMEP (frame)) |
286 | 1706 continue; |
765 | 1707 f = XFRAME (frame); |
1709
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
1708 if (FRAME_VISIBLE_P (f)) |
765 | 1709 value = Fcons (frame, value); |
286 | 1710 } |
1711 return value; | |
1712 } | |
363 | 1713 |
1714 | |
11754
7691dbfc7571
(Fraise_frame, Flower_frame): Make arg FRAME optional.
Richard M. Stallman <rms@gnu.org>
parents:
11535
diff
changeset
|
1715 DEFUN ("raise-frame", Fraise_frame, Sraise_frame, 0, 1, "", |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1716 doc: /* Bring FRAME to the front, so it occludes any frames it overlaps. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1717 If FRAME is invisible, make it visible. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1718 If you don't specify a frame, the selected frame is used. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1719 If Emacs is displaying on an ordinary terminal or some other device which |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1720 doesn't support multiple overlapping frames, this function does nothing. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1721 (frame) |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1722 Lisp_Object frame; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1723 { |
11211
2f9a24a4c9eb
(Fraise_frame, Flower_frame): Now interactive.
Richard M. Stallman <rms@gnu.org>
parents:
11169
diff
changeset
|
1724 if (NILP (frame)) |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1725 frame = selected_frame; |
11211
2f9a24a4c9eb
(Fraise_frame, Flower_frame): Now interactive.
Richard M. Stallman <rms@gnu.org>
parents:
11169
diff
changeset
|
1726 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
1727 CHECK_LIVE_FRAME (frame); |
4961
dd67510308ae
(Fraise_frame): Do like the documentation says, and make
Richard M. Stallman <rms@gnu.org>
parents:
4798
diff
changeset
|
1728 |
dd67510308ae
(Fraise_frame): Do like the documentation says, and make
Richard M. Stallman <rms@gnu.org>
parents:
4798
diff
changeset
|
1729 /* 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
|
1730 Fmake_frame_visible (frame); |
dd67510308ae
(Fraise_frame): Do like the documentation says, and make
Richard M. Stallman <rms@gnu.org>
parents:
4798
diff
changeset
|
1731 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1732 if (frame_raise_lower_hook) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1733 (*frame_raise_lower_hook) (XFRAME (frame), 1); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1734 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1735 return Qnil; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1736 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1737 |
2282
f727944c11aa
* frame.c (Fraise_frame, Flower_frame): Renamed from
Jim Blandy <jimb@redhat.com>
parents:
2207
diff
changeset
|
1738 /* Should we have a corresponding function called Flower_Power? */ |
11754
7691dbfc7571
(Fraise_frame, Flower_frame): Make arg FRAME optional.
Richard M. Stallman <rms@gnu.org>
parents:
11535
diff
changeset
|
1739 DEFUN ("lower-frame", Flower_frame, Slower_frame, 0, 1, "", |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1740 doc: /* Send FRAME to the back, so it is occluded by any frames that overlap it. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1741 If you don't specify a frame, the selected frame is used. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1742 If Emacs is displaying on an ordinary terminal or some other device which |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1743 doesn't support multiple overlapping frames, this function does nothing. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1744 (frame) |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1745 Lisp_Object frame; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1746 { |
11211
2f9a24a4c9eb
(Fraise_frame, Flower_frame): Now interactive.
Richard M. Stallman <rms@gnu.org>
parents:
11169
diff
changeset
|
1747 if (NILP (frame)) |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
1748 frame = selected_frame; |
11211
2f9a24a4c9eb
(Fraise_frame, Flower_frame): Now interactive.
Richard M. Stallman <rms@gnu.org>
parents:
11169
diff
changeset
|
1749 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
1750 CHECK_LIVE_FRAME (frame); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
1751 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1752 if (frame_raise_lower_hook) |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1753 (*frame_raise_lower_hook) (XFRAME (frame), 0); |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1754 |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1755 return Qnil; |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1756 } |
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
1757 |
363 | 1758 |
765 | 1759 DEFUN ("redirect-frame-focus", Fredirect_frame_focus, Sredirect_frame_focus, |
363 | 1760 1, 2, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1761 doc: /* Arrange for keystrokes typed at FRAME to be sent to FOCUS-FRAME. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1762 In other words, switch-frame events caused by events in FRAME will |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1763 request a switch to FOCUS-FRAME, and `last-event-frame' will be |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1764 FOCUS-FRAME after reading an event typed at FRAME. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1765 |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1766 If FOCUS-FRAME is omitted or nil, any existing redirection is |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1767 cancelled, and the frame again receives its own keystrokes. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1768 |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1769 Focus redirection is useful for temporarily redirecting keystrokes to |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1770 a surrogate minibuffer frame when a frame doesn't have its own |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1771 minibuffer window. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1772 |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1773 A frame's focus redirection can be changed by select-frame. If frame |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1774 FOO is selected, and then a different frame BAR is selected, any |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1775 frames redirecting their focus to FOO are shifted to redirect their |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1776 focus to BAR. This allows focus redirection to work properly when the |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1777 user switches from one frame to another using `select-window'. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1778 |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1779 This means that a frame whose focus is redirected to itself is treated |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1780 differently from a frame whose focus is redirected to nil; the former |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1781 is affected by select-frame, while the latter is not. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1782 |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1783 The redirection lasts until `redirect-frame-focus' is called to change it. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1784 (frame, focus_frame) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1785 Lisp_Object frame, focus_frame; |
363 | 1786 { |
3970
020fe391d5c1
* frame.c (Fredirect_frame_focus): Allow redirection of focus of
Jim Blandy <jimb@redhat.com>
parents:
3834
diff
changeset
|
1787 /* 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
|
1788 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
|
1789 know what other frame should receive those keystrokes. */ |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
1790 CHECK_FRAME (frame); |
454 | 1791 |
1709
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
1792 if (! NILP (focus_frame)) |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
1793 CHECK_LIVE_FRAME (focus_frame); |
363 | 1794 |
765 | 1795 XFRAME (frame)->focus_frame = focus_frame; |
363 | 1796 |
765 | 1797 if (frame_rehighlight_hook) |
11535
ae282c46aec2
(Fredirect_frame_focus): Fix earlier change; use a frame known to be non-nil.
Karl Heuer <kwzh@gnu.org>
parents:
11532
diff
changeset
|
1798 (*frame_rehighlight_hook) (XFRAME (frame)); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
1799 |
363 | 1800 return Qnil; |
1801 } | |
1802 | |
1803 | |
765 | 1804 DEFUN ("frame-focus", Fframe_focus, Sframe_focus, 1, 1, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1805 doc: /* Return the frame to which FRAME's keystrokes are currently being sent. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1806 This returns nil if FRAME's focus is not redirected. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1807 See `redirect-frame-focus'. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1808 (frame) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
1809 Lisp_Object frame; |
363 | 1810 { |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
1811 CHECK_LIVE_FRAME (frame); |
1709
b86b3237e017
* frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents:
1691
diff
changeset
|
1812 |
765 | 1813 return FRAME_FOCUS_FRAME (XFRAME (frame)); |
363 | 1814 } |
1815 | |
1816 | |
286 | 1817 |
10207
e6618f52efe9
(Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents:
9972
diff
changeset
|
1818 /* Return the value of frame parameter PROP in frame FRAME. */ |
e6618f52efe9
(Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents:
9972
diff
changeset
|
1819 |
286 | 1820 Lisp_Object |
765 | 1821 get_frame_param (frame, prop) |
1822 register struct frame *frame; | |
286 | 1823 Lisp_Object prop; |
1824 { | |
1825 register Lisp_Object tem; | |
1826 | |
765 | 1827 tem = Fassq (prop, frame->param_alist); |
286 | 1828 if (EQ (tem, Qnil)) |
1829 return tem; | |
1830 return Fcdr (tem); | |
1831 } | |
1832 | |
10207
e6618f52efe9
(Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents:
9972
diff
changeset
|
1833 /* Return the buffer-predicate of the selected frame. */ |
e6618f52efe9
(Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents:
9972
diff
changeset
|
1834 |
e6618f52efe9
(Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents:
9972
diff
changeset
|
1835 Lisp_Object |
22188
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1836 frame_buffer_predicate (frame) |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1837 Lisp_Object frame; |
10207
e6618f52efe9
(Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents:
9972
diff
changeset
|
1838 { |
22188
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1839 return XFRAME (frame)->buffer_predicate; |
10207
e6618f52efe9
(Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents:
9972
diff
changeset
|
1840 } |
e6618f52efe9
(Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents:
9972
diff
changeset
|
1841 |
17221
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1842 /* Return the buffer-list of the selected frame. */ |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1843 |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1844 Lisp_Object |
22188
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1845 frame_buffer_list (frame) |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1846 Lisp_Object frame; |
17221
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1847 { |
22188
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1848 return XFRAME (frame)->buffer_list; |
17221
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1849 } |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1850 |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1851 /* Set the buffer-list of the selected frame. */ |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1852 |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1853 void |
22188
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1854 set_frame_buffer_list (frame, list) |
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1855 Lisp_Object frame, list; |
17221
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1856 { |
22188
9fba463768ec
(frame_buffer_predicate): New arg FRAME.
Richard M. Stallman <rms@gnu.org>
parents:
21825
diff
changeset
|
1857 XFRAME (frame)->buffer_list = list; |
17221
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1858 } |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1859 |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1860 /* Discard BUFFER from the buffer-list of each frame. */ |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1861 |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1862 void |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1863 frames_discard_buffer (buffer) |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1864 Lisp_Object buffer; |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1865 { |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1866 Lisp_Object frame, tail; |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1867 |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1868 FOR_EACH_FRAME (tail, frame) |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1869 { |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1870 XFRAME (frame)->buffer_list |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1871 = Fdelq (buffer, XFRAME (frame)->buffer_list); |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1872 } |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1873 } |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1874 |
10207
e6618f52efe9
(Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents:
9972
diff
changeset
|
1875 /* Modify the alist in *ALISTPTR to associate PROP with VAL. |
e6618f52efe9
(Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents:
9972
diff
changeset
|
1876 If the alist already has an element for PROP, we change it. */ |
e6618f52efe9
(Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents:
9972
diff
changeset
|
1877 |
286 | 1878 void |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1879 store_in_alist (alistptr, prop, val) |
286 | 1880 Lisp_Object *alistptr, val; |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1881 Lisp_Object prop; |
286 | 1882 { |
1883 register Lisp_Object tem; | |
1884 | |
1885 tem = Fassq (prop, *alistptr); | |
1886 if (EQ (tem, Qnil)) | |
1887 *alistptr = Fcons (Fcons (prop, val), *alistptr); | |
1888 else | |
1889 Fsetcdr (tem, val); | |
1890 } | |
1891 | |
20280
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1892 static int |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1893 frame_name_fnn_p (str, len) |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1894 char *str; |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1895 int len; |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1896 { |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1897 if (len > 1 && str[0] == 'F') |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1898 { |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1899 char *end_ptr; |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1900 |
25789
d68642dd5bbf
(frame_name_fnn_p): Fix previous change.
Eli Zaretskii <eliz@gnu.org>
parents:
25736
diff
changeset
|
1901 strtol (str + 1, &end_ptr, 10); |
d68642dd5bbf
(frame_name_fnn_p): Fix previous change.
Eli Zaretskii <eliz@gnu.org>
parents:
25736
diff
changeset
|
1902 |
20280
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1903 if (end_ptr == str + len) |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1904 return 1; |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1905 } |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1906 return 0; |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1907 } |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1908 |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1909 /* Set the name of the terminal frame. Also used by MSDOS frames. |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1910 Modeled after x_set_name which is used for WINDOW frames. */ |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1911 |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1912 void |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1913 set_term_frame_name (f, name) |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1914 struct frame *f; |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1915 Lisp_Object name; |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1916 { |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1917 f->explicit_name = ! NILP (name); |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1918 |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1919 /* If NAME is nil, set the name to F<num>. */ |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1920 if (NILP (name)) |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1921 { |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1922 char namebuf[20]; |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1923 |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1924 /* Check for no change needed in this very common case |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1925 before we do any consing. */ |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46285
diff
changeset
|
1926 if (frame_name_fnn_p (SDATA (f->name), |
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46285
diff
changeset
|
1927 SBYTES (f->name))) |
20280
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1928 return; |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1929 |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1930 terminal_frame_count++; |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1931 sprintf (namebuf, "F%d", terminal_frame_count); |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1932 name = build_string (namebuf); |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1933 } |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1934 else |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1935 { |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
1936 CHECK_STRING (name); |
20280
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1937 |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1938 /* Don't change the name if it's already NAME. */ |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1939 if (! NILP (Fstring_equal (name, f->name))) |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1940 return; |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1941 |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1942 /* Don't allow the user to set the frame name to F<num>, so it |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1943 doesn't clash with the names we generate for terminal frames. */ |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46285
diff
changeset
|
1944 if (frame_name_fnn_p (SDATA (name), SBYTES (name))) |
20280
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1945 error ("Frame names of the form F<num> are usurped by Emacs"); |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1946 } |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1947 |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1948 f->name = name; |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1949 update_mode_lines = 1; |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1950 } |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
1951 |
286 | 1952 void |
765 | 1953 store_frame_param (f, prop, val) |
1954 struct frame *f; | |
286 | 1955 Lisp_Object prop, val; |
1956 { | |
29616
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1957 register Lisp_Object old_alist_elt; |
286 | 1958 |
29616
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1959 /* The buffer-alist parameter is stored in a special place and is |
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1960 not in the alist. */ |
17221
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1961 if (EQ (prop, Qbuffer_list)) |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1962 { |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1963 f->buffer_list = val; |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1964 return; |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1965 } |
0530a375eb21
(frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
17032
diff
changeset
|
1966 |
29616
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1967 /* If PROP is a symbol which is supposed to have frame-local values, |
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1968 and it is set up based on this frame, switch to the global |
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1969 binding. That way, we can create or alter the frame-local binding |
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1970 without messing up the symbol's status. */ |
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1971 if (SYMBOLP (prop)) |
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1972 { |
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1973 Lisp_Object valcontents; |
39581
6d9fa06012a6
Use SYMBOL_VALUE/SET_SYMBOL_VALUE macros instead of accessing
Gerd Moellmann <gerd@gnu.org>
parents:
39503
diff
changeset
|
1974 valcontents = SYMBOL_VALUE (prop); |
29616
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1975 if ((BUFFER_LOCAL_VALUEP (valcontents) |
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1976 || SOME_BUFFER_LOCAL_VALUEP (valcontents)) |
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1977 && XBUFFER_LOCAL_VALUE (valcontents)->check_frame |
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1978 && XFRAME (XBUFFER_LOCAL_VALUE (valcontents)->frame) == f) |
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1979 swap_in_global_binding (prop); |
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1980 } |
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1981 |
42743
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
1982 #ifndef WINDOWSNT |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
1983 /* The tty color mode needs to be set before the frame's parameter |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
1984 alist is updated with the new value, because set_tty_color_mode |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
1985 wants to look at the old mode. */ |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
1986 if (FRAME_TERMCAP_P (f) && EQ (prop, Qtty_color_mode)) |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
1987 set_tty_color_mode (f, val); |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
1988 #endif |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
1989 |
29616
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1990 /* Update the frame parameter alist. */ |
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1991 old_alist_elt = Fassq (prop, f->param_alist); |
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1992 if (EQ (old_alist_elt, Qnil)) |
765 | 1993 f->param_alist = Fcons (Fcons (prop, val), f->param_alist); |
286 | 1994 else |
29616
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1995 Fsetcdr (old_alist_elt, val); |
539 | 1996 |
29616
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1997 /* Update some other special parameters in their special places |
8d7a0f575a0e
(Fmodify_frame_parameters): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
28930
diff
changeset
|
1998 in addition to the alist. */ |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
1999 |
10207
e6618f52efe9
(Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents:
9972
diff
changeset
|
2000 if (EQ (prop, Qbuffer_predicate)) |
e6618f52efe9
(Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents:
9972
diff
changeset
|
2001 f->buffer_predicate = val; |
e6618f52efe9
(Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents:
9972
diff
changeset
|
2002 |
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
2003 if (! FRAME_WINDOW_P (f)) |
20280
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
2004 { |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
2005 if (EQ (prop, Qmenu_bar_lines)) |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
2006 set_menu_bar_lines (f, val, make_number (FRAME_MENU_BAR_LINES (f))); |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
2007 else if (EQ (prop, Qname)) |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
2008 set_term_frame_name (f, val); |
7916c0d8f2ae
(frame_name_fnn_p, set_term_frame_name): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
20178
diff
changeset
|
2009 } |
12761
bffb5ea6fb43
Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents:
12742
diff
changeset
|
2010 |
9127
0b4836daa8e1
(Fframep, make_frame_without_minibuffer, do_switch_frame, prev_frame,
Karl Heuer <kwzh@gnu.org>
parents:
9032
diff
changeset
|
2011 if (EQ (prop, Qminibuffer) && WINDOWP (val)) |
539 | 2012 { |
2013 if (! MINI_WINDOW_P (XWINDOW (val))) | |
2014 error ("Surrogate minibuffer windows must be minibuffer windows."); | |
2015 | |
25710
ee1da070c50f
(Fnext_frame): Remove unused variable(s).
Gerd Moellmann <gerd@gnu.org>
parents:
25669
diff
changeset
|
2016 if ((FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f)) |
16371
906cef1d36bd
(store_frame_param): Allow setting a frame's minibuffer
Karl Heuer <kwzh@gnu.org>
parents:
16280
diff
changeset
|
2017 && !EQ (val, f->minibuffer_window)) |
906cef1d36bd
(store_frame_param): Allow setting a frame's minibuffer
Karl Heuer <kwzh@gnu.org>
parents:
16280
diff
changeset
|
2018 error ("Can't change the surrogate minibuffer of a frame with its own minibuffer"); |
539 | 2019 |
2020 /* Install the chosen minibuffer window, with proper buffer. */ | |
765 | 2021 f->minibuffer_window = val; |
539 | 2022 } |
286 | 2023 } |
2024 | |
765 | 2025 DEFUN ("frame-parameters", Fframe_parameters, Sframe_parameters, 0, 1, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2026 doc: /* Return the parameters-alist of frame FRAME. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2027 It is a list of elements of the form (PARM . VALUE), where PARM is a symbol. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2028 The meaningful PARMs depend on the kind of frame. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2029 If FRAME is omitted, return information on the currently selected frame. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2030 (frame) |
765 | 2031 Lisp_Object frame; |
286 | 2032 { |
2033 Lisp_Object alist; | |
7162
06a13bf36a8c
(Fframe_parameters) [!MULTI_FRAME]: Unstub it again.
Karl Heuer <kwzh@gnu.org>
parents:
7134
diff
changeset
|
2034 FRAME_PTR f; |
15062
de7528327c39
(Fframe_parameters, both definitions):
Richard M. Stallman <rms@gnu.org>
parents:
15001
diff
changeset
|
2035 int height, width; |
27575
2344fab04513
(Fframe_parameters): Add GCPRO because tty_color_name can GC.
Gerd Moellmann <gerd@gnu.org>
parents:
26729
diff
changeset
|
2036 struct gcpro gcpro1; |
286 | 2037 |
36804
e4331ae9636d
(Fframe_parameters): In the `buffer-list' frame
Gerd Moellmann <gerd@gnu.org>
parents:
36433
diff
changeset
|
2038 if (NILP (frame)) |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
2039 frame = selected_frame; |
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
2040 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
2041 CHECK_FRAME (frame); |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
2042 f = XFRAME (frame); |
286 | 2043 |
7162
06a13bf36a8c
(Fframe_parameters) [!MULTI_FRAME]: Unstub it again.
Karl Heuer <kwzh@gnu.org>
parents:
7134
diff
changeset
|
2044 if (!FRAME_LIVE_P (f)) |
286 | 2045 return Qnil; |
2046 | |
765 | 2047 alist = Fcopy_alist (f->param_alist); |
27575
2344fab04513
(Fframe_parameters): Add GCPRO because tty_color_name can GC.
Gerd Moellmann <gerd@gnu.org>
parents:
26729
diff
changeset
|
2048 GCPRO1 (alist); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
2049 |
26729
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26164
diff
changeset
|
2050 if (!FRAME_WINDOW_P (f)) |
15391
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
2051 { |
25117
f6f34f0bc1af
(make_terminal_frame) [MSDOS]: Don't call
Eli Zaretskii <eliz@gnu.org>
parents:
25030
diff
changeset
|
2052 int fg = FRAME_FOREGROUND_PIXEL (f); |
f6f34f0bc1af
(make_terminal_frame) [MSDOS]: Don't call
Eli Zaretskii <eliz@gnu.org>
parents:
25030
diff
changeset
|
2053 int bg = FRAME_BACKGROUND_PIXEL (f); |
32545
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2054 Lisp_Object elt; |
25117
f6f34f0bc1af
(make_terminal_frame) [MSDOS]: Don't call
Eli Zaretskii <eliz@gnu.org>
parents:
25030
diff
changeset
|
2055 |
32545
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2056 /* If the frame's parameter alist says the colors are |
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2057 unspecified and reversed, take the frame's background pixel |
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2058 for foreground and vice versa. */ |
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2059 elt = Fassq (Qforeground_color, alist); |
33005
87893013088c
(Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents:
32909
diff
changeset
|
2060 if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt))) |
87893013088c
(Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents:
32909
diff
changeset
|
2061 { |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46285
diff
changeset
|
2062 if (strncmp (SDATA (XCDR (elt)), |
33005
87893013088c
(Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents:
32909
diff
changeset
|
2063 unspecified_bg, |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46285
diff
changeset
|
2064 SCHARS (XCDR (elt))) == 0) |
33005
87893013088c
(Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents:
32909
diff
changeset
|
2065 store_in_alist (&alist, Qforeground_color, tty_color_name (f, bg)); |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46285
diff
changeset
|
2066 else if (strncmp (SDATA (XCDR (elt)), |
33005
87893013088c
(Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents:
32909
diff
changeset
|
2067 unspecified_fg, |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46285
diff
changeset
|
2068 SCHARS (XCDR (elt))) == 0) |
33005
87893013088c
(Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents:
32909
diff
changeset
|
2069 store_in_alist (&alist, Qforeground_color, tty_color_name (f, fg)); |
87893013088c
(Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents:
32909
diff
changeset
|
2070 } |
32545
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2071 else |
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2072 store_in_alist (&alist, Qforeground_color, tty_color_name (f, fg)); |
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2073 elt = Fassq (Qbackground_color, alist); |
33005
87893013088c
(Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents:
32909
diff
changeset
|
2074 if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt))) |
87893013088c
(Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents:
32909
diff
changeset
|
2075 { |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46285
diff
changeset
|
2076 if (strncmp (SDATA (XCDR (elt)), |
33005
87893013088c
(Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents:
32909
diff
changeset
|
2077 unspecified_fg, |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46285
diff
changeset
|
2078 SCHARS (XCDR (elt))) == 0) |
33005
87893013088c
(Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents:
32909
diff
changeset
|
2079 store_in_alist (&alist, Qbackground_color, tty_color_name (f, fg)); |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46285
diff
changeset
|
2080 else if (strncmp (SDATA (XCDR (elt)), |
33005
87893013088c
(Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents:
32909
diff
changeset
|
2081 unspecified_bg, |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46285
diff
changeset
|
2082 SCHARS (XCDR (elt))) == 0) |
33005
87893013088c
(Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents:
32909
diff
changeset
|
2083 store_in_alist (&alist, Qbackground_color, tty_color_name (f, bg)); |
87893013088c
(Fframe_parameters): Fix the change from 2000-10-16:
Eli Zaretskii <eliz@gnu.org>
parents:
32909
diff
changeset
|
2084 } |
32545
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2085 else |
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2086 store_in_alist (&alist, Qbackground_color, tty_color_name (f, bg)); |
26729
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26164
diff
changeset
|
2087 store_in_alist (&alist, intern ("font"), |
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26164
diff
changeset
|
2088 build_string (FRAME_MSDOS_P (f) |
f5dded41adcc
Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents:
26164
diff
changeset
|
2089 ? "ms-dos" |
35003
c6726a1e70ce
(make_terminal_frame) [WINDOWSNT]: Make terminal frames
Andrew Innes <andrewi@gnu.org>
parents:
33760
diff
changeset
|
2090 : FRAME_W32_P (f) ? "w32term" |
c6726a1e70ce
(make_terminal_frame) [WINDOWSNT]: Make terminal frames
Andrew Innes <andrewi@gnu.org>
parents:
33760
diff
changeset
|
2091 :"tty")); |
15391
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
2092 } |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
2093 store_in_alist (&alist, Qname, f->name); |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2094 height = (f->new_text_lines ? f->new_text_lines : FRAME_LINES (f)); |
15062
de7528327c39
(Fframe_parameters, both definitions):
Richard M. Stallman <rms@gnu.org>
parents:
15001
diff
changeset
|
2095 store_in_alist (&alist, Qheight, make_number (height)); |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2096 width = (f->new_text_cols ? f->new_text_cols : FRAME_COLS (f)); |
15062
de7528327c39
(Fframe_parameters, both definitions):
Richard M. Stallman <rms@gnu.org>
parents:
15001
diff
changeset
|
2097 store_in_alist (&alist, Qwidth, make_number (width)); |
7162
06a13bf36a8c
(Fframe_parameters) [!MULTI_FRAME]: Unstub it again.
Karl Heuer <kwzh@gnu.org>
parents:
7134
diff
changeset
|
2098 store_in_alist (&alist, Qmodeline, (FRAME_WANTS_MODELINE_P (f) ? Qt : Qnil)); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
2099 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
|
2100 (! FRAME_HAS_MINIBUF_P (f) ? Qnil |
7162
06a13bf36a8c
(Fframe_parameters) [!MULTI_FRAME]: Unstub it again.
Karl Heuer <kwzh@gnu.org>
parents:
7134
diff
changeset
|
2101 : FRAME_MINIBUF_ONLY_P (f) ? Qonly |
06a13bf36a8c
(Fframe_parameters) [!MULTI_FRAME]: Unstub it again.
Karl Heuer <kwzh@gnu.org>
parents:
7134
diff
changeset
|
2102 : FRAME_MINIBUF_WINDOW (f))); |
06a13bf36a8c
(Fframe_parameters) [!MULTI_FRAME]: Unstub it again.
Karl Heuer <kwzh@gnu.org>
parents:
7134
diff
changeset
|
2103 store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil)); |
36804
e4331ae9636d
(Fframe_parameters): In the `buffer-list' frame
Gerd Moellmann <gerd@gnu.org>
parents:
36433
diff
changeset
|
2104 store_in_alist (&alist, Qbuffer_list, frame_buffer_list (frame)); |
286 | 2105 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
2106 /* I think this should be done with a hook. */ |
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
2107 #ifdef HAVE_WINDOW_SYSTEM |
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
2108 if (FRAME_WINDOW_P (f)) |
765 | 2109 x_report_frame_params (f, &alist); |
8244
15d4c2bd29e6
[MULTI_FRAME] (Fframe_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents:
8168
diff
changeset
|
2110 else |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
2111 #endif |
8904
af3ff2dbaddd
(Fframe_parameters): Fix Lisp_Object vs. int problems.
Karl Heuer <kwzh@gnu.org>
parents:
8685
diff
changeset
|
2112 { |
af3ff2dbaddd
(Fframe_parameters): Fix Lisp_Object vs. int problems.
Karl Heuer <kwzh@gnu.org>
parents:
8685
diff
changeset
|
2113 /* This ought to be correct in f->param_alist for an X frame. */ |
af3ff2dbaddd
(Fframe_parameters): Fix Lisp_Object vs. int problems.
Karl Heuer <kwzh@gnu.org>
parents:
8685
diff
changeset
|
2114 Lisp_Object lines; |
9309
27370f65dfa1
(make_frame, Fframe_parameters, Fselected_frame, syms_of_frame): Don't use
Karl Heuer <kwzh@gnu.org>
parents:
9268
diff
changeset
|
2115 XSETFASTINT (lines, FRAME_MENU_BAR_LINES (f)); |
8904
af3ff2dbaddd
(Fframe_parameters): Fix Lisp_Object vs. int problems.
Karl Heuer <kwzh@gnu.org>
parents:
8685
diff
changeset
|
2116 store_in_alist (&alist, Qmenu_bar_lines, lines); |
af3ff2dbaddd
(Fframe_parameters): Fix Lisp_Object vs. int problems.
Karl Heuer <kwzh@gnu.org>
parents:
8685
diff
changeset
|
2117 } |
27575
2344fab04513
(Fframe_parameters): Add GCPRO because tty_color_name can GC.
Gerd Moellmann <gerd@gnu.org>
parents:
26729
diff
changeset
|
2118 |
2344fab04513
(Fframe_parameters): Add GCPRO because tty_color_name can GC.
Gerd Moellmann <gerd@gnu.org>
parents:
26729
diff
changeset
|
2119 UNGCPRO; |
286 | 2120 return alist; |
2121 } | |
2122 | |
31399
db831ffcd565
(Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31102
diff
changeset
|
2123 |
db831ffcd565
(Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31102
diff
changeset
|
2124 DEFUN ("frame-parameter", Fframe_parameter, Sframe_parameter, 2, 2, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2125 doc: /* Return FRAME's value for parameter PARAMETER. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2126 If FRAME is nil, describe the currently selected frame. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2127 (frame, parameter) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2128 Lisp_Object frame, parameter; |
31399
db831ffcd565
(Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31102
diff
changeset
|
2129 { |
db831ffcd565
(Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31102
diff
changeset
|
2130 struct frame *f; |
db831ffcd565
(Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31102
diff
changeset
|
2131 Lisp_Object value; |
db831ffcd565
(Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31102
diff
changeset
|
2132 |
db831ffcd565
(Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31102
diff
changeset
|
2133 if (NILP (frame)) |
db831ffcd565
(Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31102
diff
changeset
|
2134 frame = selected_frame; |
db831ffcd565
(Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31102
diff
changeset
|
2135 else |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
2136 CHECK_FRAME (frame); |
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
2137 CHECK_SYMBOL (parameter); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
2138 |
31399
db831ffcd565
(Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31102
diff
changeset
|
2139 f = XFRAME (frame); |
db831ffcd565
(Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31102
diff
changeset
|
2140 value = Qnil; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
2141 |
31399
db831ffcd565
(Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31102
diff
changeset
|
2142 if (FRAME_LIVE_P (f)) |
db831ffcd565
(Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31102
diff
changeset
|
2143 { |
40319
52af99ad587f
Resurrect a comment lost in the previous commit.
Eli Zaretskii <eliz@gnu.org>
parents:
40317
diff
changeset
|
2144 /* Avoid consing in frequent cases. */ |
31442
cb166d3ac8e7
(Fframe_parameter): Handle `name' specially.
Gerd Moellmann <gerd@gnu.org>
parents:
31399
diff
changeset
|
2145 if (EQ (parameter, Qname)) |
cb166d3ac8e7
(Fframe_parameter): Handle `name' specially.
Gerd Moellmann <gerd@gnu.org>
parents:
31399
diff
changeset
|
2146 value = f->name; |
31448
70b366918608
(Fframe_parameter): Handle `name' and `background-mode'
Gerd Moellmann <gerd@gnu.org>
parents:
31442
diff
changeset
|
2147 #ifdef HAVE_X_WINDOWS |
70b366918608
(Fframe_parameter): Handle `name' and `background-mode'
Gerd Moellmann <gerd@gnu.org>
parents:
31442
diff
changeset
|
2148 else if (EQ (parameter, Qdisplay) && FRAME_X_P (f)) |
70b366918608
(Fframe_parameter): Handle `name' and `background-mode'
Gerd Moellmann <gerd@gnu.org>
parents:
31442
diff
changeset
|
2149 value = XCAR (FRAME_X_DISPLAY_INFO (f)->name_list_element); |
70b366918608
(Fframe_parameter): Handle `name' and `background-mode'
Gerd Moellmann <gerd@gnu.org>
parents:
31442
diff
changeset
|
2150 #endif /* HAVE_X_WINDOWS */ |
40313
b2ff79e90309
(Fframe_parameter): Fix a bug whereby some
Gerd Moellmann <gerd@gnu.org>
parents:
40105
diff
changeset
|
2151 else if (EQ (parameter, Qbackground_color) |
b2ff79e90309
(Fframe_parameter): Fix a bug whereby some
Gerd Moellmann <gerd@gnu.org>
parents:
40105
diff
changeset
|
2152 || EQ (parameter, Qforeground_color)) |
31442
cb166d3ac8e7
(Fframe_parameter): Handle `name' specially.
Gerd Moellmann <gerd@gnu.org>
parents:
31399
diff
changeset
|
2153 { |
cb166d3ac8e7
(Fframe_parameter): Handle `name' specially.
Gerd Moellmann <gerd@gnu.org>
parents:
31399
diff
changeset
|
2154 value = Fassq (parameter, f->param_alist); |
cb166d3ac8e7
(Fframe_parameter): Handle `name' specially.
Gerd Moellmann <gerd@gnu.org>
parents:
31399
diff
changeset
|
2155 if (CONSP (value)) |
32254
f93728883f64
(Fframe_parameter): For non-windowed frames, if
Eli Zaretskii <eliz@gnu.org>
parents:
31470
diff
changeset
|
2156 { |
f93728883f64
(Fframe_parameter): For non-windowed frames, if
Eli Zaretskii <eliz@gnu.org>
parents:
31470
diff
changeset
|
2157 value = XCDR (value); |
f93728883f64
(Fframe_parameter): For non-windowed frames, if
Eli Zaretskii <eliz@gnu.org>
parents:
31470
diff
changeset
|
2158 /* Fframe_parameters puts the actual fg/bg color names, |
f93728883f64
(Fframe_parameter): For non-windowed frames, if
Eli Zaretskii <eliz@gnu.org>
parents:
31470
diff
changeset
|
2159 even if f->param_alist says otherwise. This is |
f93728883f64
(Fframe_parameter): For non-windowed frames, if
Eli Zaretskii <eliz@gnu.org>
parents:
31470
diff
changeset
|
2160 important when param_alist's notion of colors is |
f93728883f64
(Fframe_parameter): For non-windowed frames, if
Eli Zaretskii <eliz@gnu.org>
parents:
31470
diff
changeset
|
2161 "unspecified". We need to do the same here. */ |
f93728883f64
(Fframe_parameter): For non-windowed frames, if
Eli Zaretskii <eliz@gnu.org>
parents:
31470
diff
changeset
|
2162 if (STRINGP (value) && !FRAME_WINDOW_P (f)) |
f93728883f64
(Fframe_parameter): For non-windowed frames, if
Eli Zaretskii <eliz@gnu.org>
parents:
31470
diff
changeset
|
2163 { |
46467
1a3b3b66171c
(Fframe_parameter): Use const for pointer to lisp
Ken Raeburn <raeburn@raeburn.org>
parents:
46370
diff
changeset
|
2164 const char *color_name; |
32545
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2165 EMACS_INT csz; |
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2166 |
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2167 if (EQ (parameter, Qbackground_color)) |
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2168 { |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46285
diff
changeset
|
2169 color_name = SDATA (value); |
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46285
diff
changeset
|
2170 csz = SCHARS (value); |
32545
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2171 if (strncmp (color_name, unspecified_bg, csz) == 0) |
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2172 value = tty_color_name (f, FRAME_BACKGROUND_PIXEL (f)); |
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2173 else if (strncmp (color_name, unspecified_fg, csz) == 0) |
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2174 value = tty_color_name (f, FRAME_FOREGROUND_PIXEL (f)); |
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2175 } |
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2176 else if (EQ (parameter, Qforeground_color)) |
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2177 { |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46285
diff
changeset
|
2178 color_name = SDATA (value); |
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
46285
diff
changeset
|
2179 csz = SCHARS (value); |
32545
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2180 if (strncmp (color_name, unspecified_fg, csz) == 0) |
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2181 value = tty_color_name (f, FRAME_FOREGROUND_PIXEL (f)); |
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2182 else if (strncmp (color_name, unspecified_bg, csz) == 0) |
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2183 value = tty_color_name (f, FRAME_BACKGROUND_PIXEL (f)); |
288723d38c06
(Fframe_parameters): If a tty's frame's param_alist says
Eli Zaretskii <eliz@gnu.org>
parents:
32254
diff
changeset
|
2184 } |
32254
f93728883f64
(Fframe_parameter): For non-windowed frames, if
Eli Zaretskii <eliz@gnu.org>
parents:
31470
diff
changeset
|
2185 } |
f93728883f64
(Fframe_parameter): For non-windowed frames, if
Eli Zaretskii <eliz@gnu.org>
parents:
31470
diff
changeset
|
2186 } |
40317
dfb2afb0aa8a
(Fframe_parameter): Fix last change.
Eli Zaretskii <eliz@gnu.org>
parents:
40313
diff
changeset
|
2187 else |
dfb2afb0aa8a
(Fframe_parameter): Fix last change.
Eli Zaretskii <eliz@gnu.org>
parents:
40313
diff
changeset
|
2188 value = Fcdr (Fassq (parameter, Fframe_parameters (frame))); |
31442
cb166d3ac8e7
(Fframe_parameter): Handle `name' specially.
Gerd Moellmann <gerd@gnu.org>
parents:
31399
diff
changeset
|
2189 } |
40313
b2ff79e90309
(Fframe_parameter): Fix a bug whereby some
Gerd Moellmann <gerd@gnu.org>
parents:
40105
diff
changeset
|
2190 else if (EQ (parameter, Qdisplay_type) |
b2ff79e90309
(Fframe_parameter): Fix a bug whereby some
Gerd Moellmann <gerd@gnu.org>
parents:
40105
diff
changeset
|
2191 || EQ (parameter, Qbackground_mode)) |
b2ff79e90309
(Fframe_parameter): Fix a bug whereby some
Gerd Moellmann <gerd@gnu.org>
parents:
40105
diff
changeset
|
2192 value = Fcdr (Fassq (parameter, f->param_alist)); |
b2ff79e90309
(Fframe_parameter): Fix a bug whereby some
Gerd Moellmann <gerd@gnu.org>
parents:
40105
diff
changeset
|
2193 else |
b2ff79e90309
(Fframe_parameter): Fix a bug whereby some
Gerd Moellmann <gerd@gnu.org>
parents:
40105
diff
changeset
|
2194 value = Fcdr (Fassq (parameter, Fframe_parameters (frame))); |
31399
db831ffcd565
(Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31102
diff
changeset
|
2195 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
2196 |
31399
db831ffcd565
(Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31102
diff
changeset
|
2197 return value; |
db831ffcd565
(Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31102
diff
changeset
|
2198 } |
db831ffcd565
(Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31102
diff
changeset
|
2199 |
db831ffcd565
(Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31102
diff
changeset
|
2200 |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
2201 DEFUN ("modify-frame-parameters", Fmodify_frame_parameters, |
765 | 2202 Smodify_frame_parameters, 2, 2, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2203 doc: /* Modify the parameters of frame FRAME according to ALIST. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2204 If FRAME is nil, it defaults to the selected frame. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2205 ALIST is an alist of parameters to change and their new values. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2206 Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2207 The meaningful PARMs depend on the kind of frame. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2208 Undefined PARMs are ignored, but stored in the frame's parameter list |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2209 so that `frame-parameters' will return them. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2210 |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2211 The value of frame parameter FOO can also be accessed |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2212 as a frame-local binding for the variable FOO, if you have |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2213 enabled such bindings for that variable with `make-variable-frame-local'. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2214 (frame, alist) |
765 | 2215 Lisp_Object frame, alist; |
286 | 2216 { |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
2217 FRAME_PTR f; |
25710
ee1da070c50f
(Fnext_frame): Remove unused variable(s).
Gerd Moellmann <gerd@gnu.org>
parents:
25669
diff
changeset
|
2218 register Lisp_Object tail, prop, val; |
46285
3f111801efb4
Rename BINDING_STACK_SIZE to SPECPDL_INDEX.
Juanma Barranquero <lekktu@gmail.com>
parents:
46015
diff
changeset
|
2219 int count = SPECPDL_INDEX (); |
33509
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
2220 |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
2221 /* Bind this to t to inhibit initialization of the default face from |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
2222 X resources in face-set-after-frame-default. If we don't inhibit |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
2223 this, modifying the `font' frame parameter, for example, while |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
2224 there is a `default.attributeFont' X resource, won't work, |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
2225 because `default's font is reset to the value of the X resource |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
2226 and that resets the `font' frame parameter. */ |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
2227 specbind (Qinhibit_default_face_x_resources, Qt); |
286 | 2228 |
765 | 2229 if (EQ (frame, Qnil)) |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
2230 frame = selected_frame; |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
2231 CHECK_LIVE_FRAME (frame); |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
2232 f = XFRAME (frame); |
286 | 2233 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
2234 /* I think this should be done with a hook. */ |
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
2235 #ifdef HAVE_WINDOW_SYSTEM |
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
2236 if (FRAME_WINDOW_P (f)) |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
2237 x_set_frame_parameters (f, alist); |
10207
e6618f52efe9
(Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents:
9972
diff
changeset
|
2238 else |
e6618f52efe9
(Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents:
9972
diff
changeset
|
2239 #endif |
15391
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
2240 #ifdef MSDOS |
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
2241 if (FRAME_MSDOS_P (f)) |
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
2242 IT_set_frame_parameters (f, alist); |
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
2243 else |
d4cec5d7566d
(Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents:
15062
diff
changeset
|
2244 #endif |
25523
9e9eeb68482e
(Fframep) [macintosh]: Handle mac frame type.
Richard M. Stallman <rms@gnu.org>
parents:
25350
diff
changeset
|
2245 |
16568
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2246 { |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2247 int length = XINT (Flength (alist)); |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2248 int i; |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2249 Lisp_Object *parms |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2250 = (Lisp_Object *) alloca (length * sizeof (Lisp_Object)); |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2251 Lisp_Object *values |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2252 = (Lisp_Object *) alloca (length * sizeof (Lisp_Object)); |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2253 |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2254 /* Extract parm names and values into those vectors. */ |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2255 |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2256 i = 0; |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2257 for (tail = alist; CONSP (tail); tail = Fcdr (tail)) |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2258 { |
25710
ee1da070c50f
(Fnext_frame): Remove unused variable(s).
Gerd Moellmann <gerd@gnu.org>
parents:
25669
diff
changeset
|
2259 Lisp_Object elt; |
16568
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2260 |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2261 elt = Fcar (tail); |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2262 parms[i] = Fcar (elt); |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2263 values[i] = Fcdr (elt); |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2264 i++; |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2265 } |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2266 |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2267 /* Now process them in reverse of specified order. */ |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2268 for (i--; i >= 0; i--) |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2269 { |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2270 prop = parms[i]; |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2271 val = values[i]; |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2272 store_frame_param (f, prop, val); |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2273 } |
cc6d85f9df0f
(Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents:
16536
diff
changeset
|
2274 } |
286 | 2275 |
33509
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
2276 return unbind_to (count, Qnil); |
286 | 2277 } |
2278 | |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2279 DEFUN ("frame-char-height", Fframe_char_height, Sframe_char_height, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2280 0, 1, 0, |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2281 doc: /* Height in pixels of a line in the font in frame FRAME. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2282 If FRAME is omitted, the selected frame is used. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2283 For a terminal frame, the value is always 1. */) |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2284 (frame) |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2285 Lisp_Object frame; |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2286 { |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2287 struct frame *f; |
286 | 2288 |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2289 if (NILP (frame)) |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
2290 frame = selected_frame; |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
2291 CHECK_FRAME (frame); |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
2292 f = XFRAME (frame); |
777 | 2293 |
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
2294 #ifdef HAVE_WINDOW_SYSTEM |
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
2295 if (FRAME_WINDOW_P (f)) |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2296 return make_number (x_char_height (f)); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2297 else |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2298 #endif |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2299 return make_number (1); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2300 } |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2301 |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2302 |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2303 DEFUN ("frame-char-width", Fframe_char_width, Sframe_char_width, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2304 0, 1, 0, |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2305 doc: /* Width in pixels of characters in the font in frame FRAME. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2306 If FRAME is omitted, the selected frame is used. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2307 The width is the same for all characters, because |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2308 currently Emacs supports only fixed-width fonts. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2309 For a terminal screen, the value is always 1. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2310 (frame) |
765 | 2311 Lisp_Object frame; |
286 | 2312 { |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2313 struct frame *f; |
286 | 2314 |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2315 if (NILP (frame)) |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
2316 frame = selected_frame; |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
2317 CHECK_FRAME (frame); |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
2318 f = XFRAME (frame); |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2319 |
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
2320 #ifdef HAVE_WINDOW_SYSTEM |
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
2321 if (FRAME_WINDOW_P (f)) |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2322 return make_number (x_char_width (f)); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2323 else |
777 | 2324 #endif |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2325 return make_number (1); |
286 | 2326 } |
2327 | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
2328 DEFUN ("frame-pixel-height", Fframe_pixel_height, |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2329 Sframe_pixel_height, 0, 1, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2330 doc: /* Return a FRAME's height in pixels. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2331 This counts only the height available for text lines, |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2332 not menu bars on window-system Emacs frames. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2333 For a terminal frame, the result really gives the height in characters. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2334 If FRAME is omitted, the selected frame is used. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2335 (frame) |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2336 Lisp_Object frame; |
286 | 2337 { |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2338 struct frame *f; |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2339 |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2340 if (NILP (frame)) |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
2341 frame = selected_frame; |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
2342 CHECK_FRAME (frame); |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
2343 f = XFRAME (frame); |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2344 |
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
2345 #ifdef HAVE_WINDOW_SYSTEM |
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
2346 if (FRAME_WINDOW_P (f)) |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2347 return make_number (x_pixel_height (f)); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2348 else |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2349 #endif |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2350 return make_number (FRAME_LINES (f)); |
286 | 2351 } |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2352 |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
2353 DEFUN ("frame-pixel-width", Fframe_pixel_width, |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2354 Sframe_pixel_width, 0, 1, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2355 doc: /* Return FRAME's width in pixels. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2356 For a terminal frame, the result really gives the width in characters. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2357 If FRAME is omitted, the selected frame is used. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2358 (frame) |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2359 Lisp_Object frame; |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2360 { |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2361 struct frame *f; |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2362 |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2363 if (NILP (frame)) |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
2364 frame = selected_frame; |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
2365 CHECK_FRAME (frame); |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
2366 f = XFRAME (frame); |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2367 |
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
2368 #ifdef HAVE_WINDOW_SYSTEM |
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
2369 if (FRAME_WINDOW_P (f)) |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2370 return make_number (x_pixel_width (f)); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2371 else |
777 | 2372 #endif |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2373 return make_number (FRAME_COLS (f)); |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2374 } |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
2375 |
765 | 2376 DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2377 doc: /* Specify that the frame FRAME has LINES lines. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2378 Optional third arg non-nil means that redisplay should use LINES lines |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2379 but that the idea of the actual height of the frame should not be changed. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2380 (frame, lines, pretend) |
14077
a6d3ce4a2f8e
(Fhandle_switch_frame, Fset_frame_height): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents:
13748
diff
changeset
|
2381 Lisp_Object frame, lines, pretend; |
286 | 2382 { |
765 | 2383 register struct frame *f; |
286 | 2384 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
2385 CHECK_NUMBER (lines); |
765 | 2386 if (NILP (frame)) |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
2387 frame = selected_frame; |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
2388 CHECK_LIVE_FRAME (frame); |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
2389 f = XFRAME (frame); |
286 | 2390 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
2391 /* I think this should be done with a hook. */ |
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
2392 #ifdef HAVE_WINDOW_SYSTEM |
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
2393 if (FRAME_WINDOW_P (f)) |
286 | 2394 { |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2395 if (XINT (lines) != FRAME_LINES (f)) |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2396 x_set_window_size (f, 1, FRAME_COLS (f), XINT (lines)); |
25350
f964a1e5b29c
Call change_frame_size and do_pending_window_change with
Gerd Moellmann <gerd@gnu.org>
parents:
25209
diff
changeset
|
2397 do_pending_window_change (0); |
286 | 2398 } |
2399 else | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
2400 #endif |
25350
f964a1e5b29c
Call change_frame_size and do_pending_window_change with
Gerd Moellmann <gerd@gnu.org>
parents:
25209
diff
changeset
|
2401 change_frame_size (f, XINT (lines), 0, !NILP (pretend), 0, 0); |
286 | 2402 return Qnil; |
2403 } | |
2404 | |
765 | 2405 DEFUN ("set-frame-width", Fset_frame_width, Sset_frame_width, 2, 3, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2406 doc: /* Specify that the frame FRAME has COLS columns. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2407 Optional third arg non-nil means that redisplay should use COLS columns |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2408 but that the idea of the actual width of the frame should not be changed. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2409 (frame, cols, pretend) |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
2410 Lisp_Object frame, cols, pretend; |
286 | 2411 { |
765 | 2412 register struct frame *f; |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
2413 CHECK_NUMBER (cols); |
765 | 2414 if (NILP (frame)) |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
2415 frame = selected_frame; |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
2416 CHECK_LIVE_FRAME (frame); |
25669
97d5951366cd
(Fmake_terminal_frame): Use SELECTED_FRAME.
Gerd Moellmann <gerd@gnu.org>
parents:
25544
diff
changeset
|
2417 f = XFRAME (frame); |
286 | 2418 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
2419 /* I think this should be done with a hook. */ |
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
2420 #ifdef HAVE_WINDOW_SYSTEM |
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
2421 if (FRAME_WINDOW_P (f)) |
286 | 2422 { |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2423 if (XINT (cols) != FRAME_COLS (f)) |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2424 x_set_window_size (f, 1, XINT (cols), FRAME_LINES (f)); |
25350
f964a1e5b29c
Call change_frame_size and do_pending_window_change with
Gerd Moellmann <gerd@gnu.org>
parents:
25209
diff
changeset
|
2425 do_pending_window_change (0); |
286 | 2426 } |
2427 else | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
2428 #endif |
25350
f964a1e5b29c
Call change_frame_size and do_pending_window_change with
Gerd Moellmann <gerd@gnu.org>
parents:
25209
diff
changeset
|
2429 change_frame_size (f, 0, XINT (cols), !NILP (pretend), 0, 0); |
286 | 2430 return Qnil; |
2431 } | |
2432 | |
765 | 2433 DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 3, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2434 doc: /* Sets size of FRAME to COLS by ROWS, measured in characters. */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2435 (frame, cols, rows) |
765 | 2436 Lisp_Object frame, cols, rows; |
286 | 2437 { |
765 | 2438 register struct frame *f; |
286 | 2439 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
2440 CHECK_LIVE_FRAME (frame); |
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
2441 CHECK_NUMBER (cols); |
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
2442 CHECK_NUMBER (rows); |
765 | 2443 f = XFRAME (frame); |
286 | 2444 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
2445 /* I think this should be done with a hook. */ |
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
2446 #ifdef HAVE_WINDOW_SYSTEM |
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
2447 if (FRAME_WINDOW_P (f)) |
286 | 2448 { |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2449 if (XINT (rows) != FRAME_LINES (f) |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2450 || XINT (cols) != FRAME_COLS (f) |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2451 || f->new_text_lines || f->new_text_cols) |
5925
806e876cacb4
(Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents:
5552
diff
changeset
|
2452 x_set_window_size (f, 1, XINT (cols), XINT (rows)); |
25350
f964a1e5b29c
Call change_frame_size and do_pending_window_change with
Gerd Moellmann <gerd@gnu.org>
parents:
25209
diff
changeset
|
2453 do_pending_window_change (0); |
286 | 2454 } |
2455 else | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
2456 #endif |
25350
f964a1e5b29c
Call change_frame_size and do_pending_window_change with
Gerd Moellmann <gerd@gnu.org>
parents:
25209
diff
changeset
|
2457 change_frame_size (f, XINT (rows), XINT (cols), 0, 0, 0); |
286 | 2458 |
2459 return Qnil; | |
2460 } | |
2461 | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
2462 DEFUN ("set-frame-position", Fset_frame_position, |
765 | 2463 Sset_frame_position, 3, 3, 0, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2464 doc: /* Sets position of FRAME in pixels to XOFFSET by YOFFSET. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2465 This is actually the position of the upper left corner of the frame. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2466 Negative values for XOFFSET or YOFFSET are interpreted relative to |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2467 the rightmost or bottommost possible position (that stays within the screen). */) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
2468 (frame, xoffset, yoffset) |
765 | 2469 Lisp_Object frame, xoffset, yoffset; |
286 | 2470 { |
765 | 2471 register struct frame *f; |
286 | 2472 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
2473 CHECK_LIVE_FRAME (frame); |
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
2474 CHECK_NUMBER (xoffset); |
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40568
diff
changeset
|
2475 CHECK_NUMBER (yoffset); |
765 | 2476 f = XFRAME (frame); |
286 | 2477 |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
2478 /* I think this should be done with a hook. */ |
13412
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
2479 #ifdef HAVE_WINDOW_SYSTEM |
1ed740e9aa64
[HAVE_NTGUI]: Test for a Win32 frame in procedures that test for an X frame.
Geoff Voelker <voelker@cs.washington.edu>
parents:
13396
diff
changeset
|
2480 if (FRAME_WINDOW_P (f)) |
6921
50060d486c47
(Fset_frame_position): Pass new arg to x_set_offset.
Richard M. Stallman <rms@gnu.org>
parents:
6854
diff
changeset
|
2481 x_set_offset (f, XINT (xoffset), XINT (yoffset), 1); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
2482 #endif |
286 | 2483 |
2484 return Qt; | |
2485 } | |
777 | 2486 |
286 | 2487 |
50357 | 2488 /*********************************************************************** |
2489 Frame Parameters | |
2490 ***********************************************************************/ | |
2491 | |
2492 /* Connect the frame-parameter names for X frames | |
2493 to the ways of passing the parameter values to the window system. | |
2494 | |
2495 The name of a parameter, as a Lisp symbol, | |
2496 has an `x-frame-parameter' property which is an integer in Lisp | |
2497 that is an index in this table. */ | |
2498 | |
2499 struct frame_parm_table { | |
2500 char *name; | |
2501 Lisp_Object *variable; | |
2502 }; | |
2503 | |
2504 static struct frame_parm_table frame_parms[] = | |
2505 { | |
2506 {"auto-raise", &Qauto_raise}, | |
2507 {"auto-lower", &Qauto_lower}, | |
2508 {"background-color", 0}, | |
2509 {"border-color", &Qborder_color}, | |
2510 {"border-width", &Qborder_width}, | |
2511 {"cursor-color", &Qcursor_color}, | |
2512 {"cursor-type", &Qcursor_type}, | |
2513 {"font", 0}, | |
2514 {"foreground-color", 0}, | |
2515 {"icon-name", &Qicon_name}, | |
2516 {"icon-type", &Qicon_type}, | |
2517 {"internal-border-width", &Qinternal_border_width}, | |
2518 {"menu-bar-lines", &Qmenu_bar_lines}, | |
2519 {"mouse-color", &Qmouse_color}, | |
2520 {"name", &Qname}, | |
2521 {"scroll-bar-width", &Qscroll_bar_width}, | |
2522 {"title", &Qtitle}, | |
2523 {"unsplittable", &Qunsplittable}, | |
2524 {"vertical-scroll-bars", &Qvertical_scroll_bars}, | |
2525 {"visibility", &Qvisibility}, | |
2526 {"tool-bar-lines", &Qtool_bar_lines}, | |
2527 {"scroll-bar-foreground", &Qscroll_bar_foreground}, | |
2528 {"scroll-bar-background", &Qscroll_bar_background}, | |
2529 {"screen-gamma", &Qscreen_gamma}, | |
2530 {"line-spacing", &Qline_spacing}, | |
2531 {"left-fringe", &Qleft_fringe}, | |
2532 {"right-fringe", &Qright_fringe}, | |
2533 {"wait-for-wm", &Qwait_for_wm}, | |
2534 {"fullscreen", &Qfullscreen}, | |
2535 }; | |
2536 | |
2537 #ifdef HAVE_WINDOW_SYSTEM | |
2538 | |
2539 extern Lisp_Object Qbox; | |
2540 extern Lisp_Object Qtop; | |
2541 | |
2542 /* Calculate fullscreen size. Return in *TOP_POS and *LEFT_POS the | |
2543 wanted positions of the WM window (not emacs window). | |
2544 Return in *WIDTH and *HEIGHT the wanted width and height of Emacs | |
2545 window (FRAME_X_WINDOW). | |
2546 */ | |
2547 | |
2548 void | |
2549 x_fullscreen_adjust (f, width, height, top_pos, left_pos) | |
2550 struct frame *f; | |
2551 int *width; | |
2552 int *height; | |
2553 int *top_pos; | |
2554 int *left_pos; | |
2555 { | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2556 int newwidth = FRAME_COLS (f); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2557 int newheight = FRAME_LINES (f); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2558 |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2559 *top_pos = f->top_pos; |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2560 *left_pos = f->left_pos; |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2561 |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2562 if (f->want_fullscreen & FULLSCREEN_HEIGHT) |
50357 | 2563 { |
2564 int ph; | |
2565 | |
2566 ph = FRAME_X_DISPLAY_INFO (f)->height; | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2567 newheight = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, ph); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2568 ph = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, newheight) - f->y_pixels_diff; |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2569 newheight = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, ph); |
50357 | 2570 *top_pos = 0; |
2571 } | |
2572 | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2573 if (f->want_fullscreen & FULLSCREEN_WIDTH) |
50357 | 2574 { |
2575 int pw; | |
2576 | |
2577 pw = FRAME_X_DISPLAY_INFO (f)->width; | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2578 newwidth = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pw); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2579 pw = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, newwidth) - f->x_pixels_diff; |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2580 newwidth = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pw); |
50357 | 2581 *left_pos = 0; |
2582 } | |
2583 | |
2584 *width = newwidth; | |
2585 *height = newheight; | |
2586 } | |
2587 | |
2588 | |
2589 /* Really try to move where we want to be in case of fullscreen. Some WMs | |
2590 moves the window where we tell them. Some (mwm, twm) moves the outer | |
2591 window manager window there instead. | |
2592 Try to compensate for those WM here. */ | |
2593 | |
2594 static void | |
2595 x_fullscreen_move (f, new_top, new_left) | |
2596 struct frame *f; | |
2597 int new_top; | |
2598 int new_left; | |
2599 { | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2600 if (new_top != f->top_pos || new_left != f->left_pos) |
50357 | 2601 { |
2602 int move_x = new_left; | |
2603 int move_y = new_top; | |
2604 | |
2605 #ifdef HAVE_X_WINDOWS | |
2606 move_x += FRAME_X_OUTPUT (f)->x_pixels_outer_diff; | |
2607 move_y += FRAME_X_OUTPUT (f)->y_pixels_outer_diff; | |
2608 #endif | |
2609 | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2610 f->want_fullscreen |= FULLSCREEN_MOVE_WAIT; |
50357 | 2611 x_set_offset (f, move_x, move_y, 1); |
2612 } | |
2613 } | |
2614 | |
2615 /* Change the parameters of frame F as specified by ALIST. | |
2616 If a parameter is not specially recognized, do nothing special; | |
2617 otherwise call the `x_set_...' function for that parameter. | |
2618 Except for certain geometry properties, always call store_frame_param | |
2619 to store the new value in the parameter alist. */ | |
2620 | |
2621 void | |
2622 x_set_frame_parameters (f, alist) | |
2623 FRAME_PTR f; | |
2624 Lisp_Object alist; | |
2625 { | |
2626 Lisp_Object tail; | |
2627 | |
2628 /* If both of these parameters are present, it's more efficient to | |
2629 set them both at once. So we wait until we've looked at the | |
2630 entire list before we set them. */ | |
2631 int width, height; | |
2632 | |
2633 /* Same here. */ | |
2634 Lisp_Object left, top; | |
2635 | |
2636 /* Same with these. */ | |
2637 Lisp_Object icon_left, icon_top; | |
2638 | |
2639 /* Record in these vectors all the parms specified. */ | |
2640 Lisp_Object *parms; | |
2641 Lisp_Object *values; | |
2642 int i, p; | |
2643 int left_no_change = 0, top_no_change = 0; | |
2644 int icon_left_no_change = 0, icon_top_no_change = 0; | |
2645 int fullscreen_is_being_set = 0; | |
2646 | |
2647 struct gcpro gcpro1, gcpro2; | |
2648 | |
2649 i = 0; | |
2650 for (tail = alist; CONSP (tail); tail = Fcdr (tail)) | |
2651 i++; | |
2652 | |
2653 parms = (Lisp_Object *) alloca (i * sizeof (Lisp_Object)); | |
2654 values = (Lisp_Object *) alloca (i * sizeof (Lisp_Object)); | |
2655 | |
2656 /* Extract parm names and values into those vectors. */ | |
2657 | |
2658 i = 0; | |
2659 for (tail = alist; CONSP (tail); tail = Fcdr (tail)) | |
2660 { | |
2661 Lisp_Object elt; | |
2662 | |
2663 elt = Fcar (tail); | |
2664 parms[i] = Fcar (elt); | |
2665 values[i] = Fcdr (elt); | |
2666 i++; | |
2667 } | |
2668 /* TAIL and ALIST are not used again below here. */ | |
2669 alist = tail = Qnil; | |
2670 | |
2671 GCPRO2 (*parms, *values); | |
2672 gcpro1.nvars = i; | |
2673 gcpro2.nvars = i; | |
2674 | |
2675 /* There is no need to gcpro LEFT, TOP, ICON_LEFT, or ICON_TOP, | |
2676 because their values appear in VALUES and strings are not valid. */ | |
2677 top = left = Qunbound; | |
2678 icon_left = icon_top = Qunbound; | |
2679 | |
2680 /* Provide default values for HEIGHT and WIDTH. */ | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2681 width = (f->new_text_cols ? f->new_text_cols : FRAME_COLS (f)); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2682 height = (f->new_text_lines ? f->new_text_lines : FRAME_LINES (f)); |
50357 | 2683 |
2684 /* Process foreground_color and background_color before anything else. | |
2685 They are independent of other properties, but other properties (e.g., | |
2686 cursor_color) are dependent upon them. */ | |
2687 /* Process default font as well, since fringe widths depends on it. */ | |
2688 /* Also, process fullscreen, width and height depend upon that */ | |
2689 for (p = 0; p < i; p++) | |
2690 { | |
2691 Lisp_Object prop, val; | |
2692 | |
2693 prop = parms[p]; | |
2694 val = values[p]; | |
2695 if (EQ (prop, Qforeground_color) | |
2696 || EQ (prop, Qbackground_color) | |
2697 || EQ (prop, Qfont) | |
2698 || EQ (prop, Qfullscreen)) | |
2699 { | |
2700 register Lisp_Object param_index, old_value; | |
2701 | |
2702 old_value = get_frame_param (f, prop); | |
2703 fullscreen_is_being_set |= EQ (prop, Qfullscreen); | |
2704 | |
2705 if (NILP (Fequal (val, old_value))) | |
2706 { | |
2707 store_frame_param (f, prop, val); | |
2708 | |
2709 param_index = Fget (prop, Qx_frame_parameter); | |
2710 if (NATNUMP (param_index) | |
2711 && (XFASTINT (param_index) | |
2712 < sizeof (frame_parms)/sizeof (frame_parms[0])) | |
2713 && rif->frame_parm_handlers[XINT (param_index)]) | |
2714 (*(rif->frame_parm_handlers[XINT (param_index)])) (f, val, old_value); | |
2715 } | |
2716 } | |
2717 } | |
2718 | |
2719 /* Now process them in reverse of specified order. */ | |
2720 for (i--; i >= 0; i--) | |
2721 { | |
2722 Lisp_Object prop, val; | |
2723 | |
2724 prop = parms[i]; | |
2725 val = values[i]; | |
2726 | |
2727 if (EQ (prop, Qwidth) && NUMBERP (val)) | |
2728 width = XFASTINT (val); | |
2729 else if (EQ (prop, Qheight) && NUMBERP (val)) | |
2730 height = XFASTINT (val); | |
2731 else if (EQ (prop, Qtop)) | |
2732 top = val; | |
2733 else if (EQ (prop, Qleft)) | |
2734 left = val; | |
2735 else if (EQ (prop, Qicon_top)) | |
2736 icon_top = val; | |
2737 else if (EQ (prop, Qicon_left)) | |
2738 icon_left = val; | |
2739 else if (EQ (prop, Qforeground_color) | |
2740 || EQ (prop, Qbackground_color) | |
2741 || EQ (prop, Qfont) | |
2742 || EQ (prop, Qfullscreen)) | |
2743 /* Processed above. */ | |
2744 continue; | |
2745 else | |
2746 { | |
2747 register Lisp_Object param_index, old_value; | |
2748 | |
2749 old_value = get_frame_param (f, prop); | |
2750 | |
2751 store_frame_param (f, prop, val); | |
2752 | |
2753 param_index = Fget (prop, Qx_frame_parameter); | |
2754 if (NATNUMP (param_index) | |
2755 && (XFASTINT (param_index) | |
2756 < sizeof (frame_parms)/sizeof (frame_parms[0])) | |
2757 && rif->frame_parm_handlers[XINT (param_index)]) | |
2758 (*(rif->frame_parm_handlers[XINT (param_index)])) (f, val, old_value); | |
2759 } | |
2760 } | |
2761 | |
2762 /* Don't die if just one of these was set. */ | |
2763 if (EQ (left, Qunbound)) | |
2764 { | |
2765 left_no_change = 1; | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2766 if (f->left_pos < 0) |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2767 left = Fcons (Qplus, Fcons (make_number (f->left_pos), Qnil)); |
50357 | 2768 else |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2769 XSETINT (left, f->left_pos); |
50357 | 2770 } |
2771 if (EQ (top, Qunbound)) | |
2772 { | |
2773 top_no_change = 1; | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2774 if (f->top_pos < 0) |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2775 top = Fcons (Qplus, Fcons (make_number (f->top_pos), Qnil)); |
50357 | 2776 else |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2777 XSETINT (top, f->top_pos); |
50357 | 2778 } |
2779 | |
2780 /* If one of the icon positions was not set, preserve or default it. */ | |
2781 if (EQ (icon_left, Qunbound) || ! INTEGERP (icon_left)) | |
2782 { | |
2783 icon_left_no_change = 1; | |
2784 icon_left = Fcdr (Fassq (Qicon_left, f->param_alist)); | |
2785 if (NILP (icon_left)) | |
2786 XSETINT (icon_left, 0); | |
2787 } | |
2788 if (EQ (icon_top, Qunbound) || ! INTEGERP (icon_top)) | |
2789 { | |
2790 icon_top_no_change = 1; | |
2791 icon_top = Fcdr (Fassq (Qicon_top, f->param_alist)); | |
2792 if (NILP (icon_top)) | |
2793 XSETINT (icon_top, 0); | |
2794 } | |
2795 | |
2796 #ifndef HAVE_CARBON | |
2797 /* MAC_TODO: fullscreen */ | |
2798 if (FRAME_VISIBLE_P (f) && fullscreen_is_being_set) | |
2799 { | |
2800 /* If the frame is visible already and the fullscreen parameter is | |
2801 being set, it is too late to set WM manager hints to specify | |
2802 size and position. | |
2803 Here we first get the width, height and position that applies to | |
2804 fullscreen. We then move the frame to the appropriate | |
2805 position. Resize of the frame is taken care of in the code after | |
2806 this if-statement. */ | |
2807 int new_left, new_top; | |
2808 | |
2809 x_fullscreen_adjust (f, &width, &height, &new_top, &new_left); | |
2810 x_fullscreen_move (f, new_top, new_left); | |
2811 } | |
2812 #endif | |
2813 | |
2814 /* Don't set these parameters unless they've been explicitly | |
2815 specified. The window might be mapped or resized while we're in | |
2816 this function, and we don't want to override that unless the lisp | |
2817 code has asked for it. | |
2818 | |
2819 Don't set these parameters unless they actually differ from the | |
2820 window's current parameters; the window may not actually exist | |
2821 yet. */ | |
2822 { | |
2823 Lisp_Object frame; | |
2824 | |
2825 check_frame_size (f, &height, &width); | |
2826 | |
2827 XSETFRAME (frame, f); | |
2828 | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2829 if (width != FRAME_COLS (f) |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2830 || height != FRAME_LINES (f) |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2831 || f->new_text_lines || f->new_text_cols) |
50357 | 2832 Fset_frame_size (frame, make_number (width), make_number (height)); |
2833 | |
2834 if ((!NILP (left) || !NILP (top)) | |
2835 && ! (left_no_change && top_no_change) | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2836 && ! (NUMBERP (left) && XINT (left) == f->left_pos |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2837 && NUMBERP (top) && XINT (top) == f->top_pos)) |
50357 | 2838 { |
2839 int leftpos = 0; | |
2840 int toppos = 0; | |
2841 | |
2842 /* Record the signs. */ | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2843 f->size_hint_flags &= ~ (XNegative | YNegative); |
50357 | 2844 if (EQ (left, Qminus)) |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2845 f->size_hint_flags |= XNegative; |
50357 | 2846 else if (INTEGERP (left)) |
2847 { | |
2848 leftpos = XINT (left); | |
2849 if (leftpos < 0) | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2850 f->size_hint_flags |= XNegative; |
50357 | 2851 } |
2852 else if (CONSP (left) && EQ (XCAR (left), Qminus) | |
2853 && CONSP (XCDR (left)) | |
2854 && INTEGERP (XCAR (XCDR (left)))) | |
2855 { | |
2856 leftpos = - XINT (XCAR (XCDR (left))); | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2857 f->size_hint_flags |= XNegative; |
50357 | 2858 } |
2859 else if (CONSP (left) && EQ (XCAR (left), Qplus) | |
2860 && CONSP (XCDR (left)) | |
2861 && INTEGERP (XCAR (XCDR (left)))) | |
2862 { | |
2863 leftpos = XINT (XCAR (XCDR (left))); | |
2864 } | |
2865 | |
2866 if (EQ (top, Qminus)) | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2867 f->size_hint_flags |= YNegative; |
50357 | 2868 else if (INTEGERP (top)) |
2869 { | |
2870 toppos = XINT (top); | |
2871 if (toppos < 0) | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2872 f->size_hint_flags |= YNegative; |
50357 | 2873 } |
2874 else if (CONSP (top) && EQ (XCAR (top), Qminus) | |
2875 && CONSP (XCDR (top)) | |
2876 && INTEGERP (XCAR (XCDR (top)))) | |
2877 { | |
2878 toppos = - XINT (XCAR (XCDR (top))); | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2879 f->size_hint_flags |= YNegative; |
50357 | 2880 } |
2881 else if (CONSP (top) && EQ (XCAR (top), Qplus) | |
2882 && CONSP (XCDR (top)) | |
2883 && INTEGERP (XCAR (XCDR (top)))) | |
2884 { | |
2885 toppos = XINT (XCAR (XCDR (top))); | |
2886 } | |
2887 | |
2888 | |
2889 /* Store the numeric value of the position. */ | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2890 f->top_pos = toppos; |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2891 f->left_pos = leftpos; |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2892 |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2893 f->win_gravity = NorthWestGravity; |
50357 | 2894 |
2895 /* Actually set that position, and convert to absolute. */ | |
2896 x_set_offset (f, leftpos, toppos, -1); | |
2897 } | |
2898 | |
2899 if ((!NILP (icon_left) || !NILP (icon_top)) | |
2900 && ! (icon_left_no_change && icon_top_no_change)) | |
2901 x_wm_set_icon_position (f, XINT (icon_left), XINT (icon_top)); | |
2902 } | |
2903 | |
2904 UNGCPRO; | |
2905 } | |
2906 | |
2907 | |
2908 /* Insert a description of internally-recorded parameters of frame X | |
2909 into the parameter alist *ALISTPTR that is to be given to the user. | |
2910 Only parameters that are specific to the X window system | |
2911 and whose values are not correctly recorded in the frame's | |
2912 param_alist need to be considered here. */ | |
2913 | |
2914 void | |
2915 x_report_frame_params (f, alistptr) | |
2916 struct frame *f; | |
2917 Lisp_Object *alistptr; | |
2918 { | |
2919 char buf[16]; | |
2920 Lisp_Object tem; | |
2921 | |
2922 /* Represent negative positions (off the top or left screen edge) | |
2923 in a way that Fmodify_frame_parameters will understand correctly. */ | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2924 XSETINT (tem, f->left_pos); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2925 if (f->left_pos >= 0) |
50357 | 2926 store_in_alist (alistptr, Qleft, tem); |
2927 else | |
2928 store_in_alist (alistptr, Qleft, Fcons (Qplus, Fcons (tem, Qnil))); | |
2929 | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2930 XSETINT (tem, f->top_pos); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2931 if (f->top_pos >= 0) |
50357 | 2932 store_in_alist (alistptr, Qtop, tem); |
2933 else | |
2934 store_in_alist (alistptr, Qtop, Fcons (Qplus, Fcons (tem, Qnil))); | |
2935 | |
2936 store_in_alist (alistptr, Qborder_width, | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2937 make_number (f->border_width)); |
50357 | 2938 store_in_alist (alistptr, Qinternal_border_width, |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2939 make_number (FRAME_INTERNAL_BORDER_WIDTH (f))); |
50357 | 2940 store_in_alist (alistptr, Qleft_fringe, |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2941 make_number (FRAME_LEFT_FRINGE_WIDTH (f))); |
50357 | 2942 store_in_alist (alistptr, Qright_fringe, |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2943 make_number (FRAME_RIGHT_FRINGE_WIDTH (f))); |
50357 | 2944 store_in_alist (alistptr, Qscroll_bar_width, |
2945 (! FRAME_HAS_VERTICAL_SCROLL_BARS (f) | |
2946 ? make_number (0) | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2947 : FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0 |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2948 ? make_number (FRAME_CONFIG_SCROLL_BAR_WIDTH (f)) |
50357 | 2949 /* nil means "use default width" |
2950 for non-toolkit scroll bar. | |
2951 ruler-mode.el depends on this. */ | |
2952 : Qnil)); | |
2953 sprintf (buf, "%ld", (long) FRAME_X_WINDOW (f)); | |
2954 store_in_alist (alistptr, Qwindow_id, | |
2955 build_string (buf)); | |
2956 #ifdef HAVE_X_WINDOWS | |
2957 #ifdef USE_X_TOOLKIT | |
2958 /* Tooltip frame may not have this widget. */ | |
2959 if (FRAME_X_OUTPUT (f)->widget) | |
2960 #endif | |
2961 sprintf (buf, "%ld", (long) FRAME_OUTER_WINDOW (f)); | |
2962 store_in_alist (alistptr, Qouter_window_id, | |
2963 build_string (buf)); | |
2964 #endif | |
2965 store_in_alist (alistptr, Qicon_name, f->icon_name); | |
2966 FRAME_SAMPLE_VISIBILITY (f); | |
2967 store_in_alist (alistptr, Qvisibility, | |
2968 (FRAME_VISIBLE_P (f) ? Qt | |
2969 : FRAME_ICONIFIED_P (f) ? Qicon : Qnil)); | |
2970 store_in_alist (alistptr, Qdisplay, | |
2971 XCAR (FRAME_X_DISPLAY_INFO (f)->name_list_element)); | |
2972 | |
50390
2bdbce68ec9a
Fix build on Mac OS X with Carbon.
Andrew Choi <akochoi@shaw.ca>
parents:
50375
diff
changeset
|
2973 #ifndef HAVE_CARBON |
2bdbce68ec9a
Fix build on Mac OS X with Carbon.
Andrew Choi <akochoi@shaw.ca>
parents:
50375
diff
changeset
|
2974 /* A Mac Window is identified by a struct, not an integer. */ |
50357 | 2975 if (FRAME_X_OUTPUT (f)->parent_desc == FRAME_X_DISPLAY_INFO (f)->root_window) |
2976 tem = Qnil; | |
2977 else | |
2978 XSETFASTINT (tem, FRAME_X_OUTPUT (f)->parent_desc); | |
2979 store_in_alist (alistptr, Qparent_id, tem); | |
50390
2bdbce68ec9a
Fix build on Mac OS X with Carbon.
Andrew Choi <akochoi@shaw.ca>
parents:
50375
diff
changeset
|
2980 #endif |
50357 | 2981 } |
2982 | |
2983 | |
2984 /* Change the `fullscreen' frame parameter of frame F. OLD_VALUE is | |
2985 the previous value of that parameter, NEW_VALUE is the new value. */ | |
2986 | |
2987 void | |
2988 x_set_fullscreen (f, new_value, old_value) | |
2989 struct frame *f; | |
2990 Lisp_Object new_value, old_value; | |
2991 { | |
2992 #ifndef HAVE_CARBON | |
2993 if (NILP (new_value)) | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2994 f->want_fullscreen = FULLSCREEN_NONE; |
50357 | 2995 else if (EQ (new_value, Qfullboth)) |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2996 f->want_fullscreen = FULLSCREEN_BOTH; |
50357 | 2997 else if (EQ (new_value, Qfullwidth)) |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
2998 f->want_fullscreen = FULLSCREEN_WIDTH; |
50357 | 2999 else if (EQ (new_value, Qfullheight)) |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3000 f->want_fullscreen = FULLSCREEN_HEIGHT; |
50357 | 3001 #endif |
3002 } | |
3003 | |
3004 | |
3005 /* Change the `line-spacing' frame parameter of frame F. OLD_VALUE is | |
3006 the previous value of that parameter, NEW_VALUE is the new value. */ | |
3007 | |
3008 void | |
3009 x_set_line_spacing (f, new_value, old_value) | |
3010 struct frame *f; | |
3011 Lisp_Object new_value, old_value; | |
3012 { | |
3013 if (NILP (new_value)) | |
3014 f->extra_line_spacing = 0; | |
3015 else if (NATNUMP (new_value)) | |
3016 f->extra_line_spacing = XFASTINT (new_value); | |
3017 else | |
3018 Fsignal (Qerror, Fcons (build_string ("Invalid line-spacing"), | |
3019 Fcons (new_value, Qnil))); | |
3020 if (FRAME_VISIBLE_P (f)) | |
3021 redraw_frame (f); | |
3022 } | |
3023 | |
3024 | |
3025 /* Change the `screen-gamma' frame parameter of frame F. OLD_VALUE is | |
3026 the previous value of that parameter, NEW_VALUE is the new value. */ | |
3027 | |
3028 void | |
3029 x_set_screen_gamma (f, new_value, old_value) | |
3030 struct frame *f; | |
3031 Lisp_Object new_value, old_value; | |
3032 { | |
3033 if (NILP (new_value)) | |
3034 f->gamma = 0; | |
3035 else if (NUMBERP (new_value) && XFLOATINT (new_value) > 0) | |
3036 /* The value 0.4545 is the normal viewing gamma. */ | |
3037 f->gamma = 1.0 / (0.4545 * XFLOATINT (new_value)); | |
3038 else | |
3039 Fsignal (Qerror, Fcons (build_string ("Invalid screen-gamma"), | |
3040 Fcons (new_value, Qnil))); | |
3041 | |
3042 clear_face_cache (0); | |
3043 } | |
3044 | |
3045 | |
3046 void | |
3047 x_set_font (f, arg, oldval) | |
3048 struct frame *f; | |
3049 Lisp_Object arg, oldval; | |
3050 { | |
3051 Lisp_Object result; | |
3052 Lisp_Object fontset_name; | |
3053 Lisp_Object frame; | |
3054 int old_fontset = FRAME_FONTSET(f); | |
3055 | |
3056 CHECK_STRING (arg); | |
3057 | |
3058 fontset_name = Fquery_fontset (arg, Qnil); | |
3059 | |
3060 BLOCK_INPUT; | |
3061 result = (STRINGP (fontset_name) | |
3062 ? x_new_fontset (f, SDATA (fontset_name)) | |
3063 : x_new_font (f, SDATA (arg))); | |
3064 UNBLOCK_INPUT; | |
3065 | |
3066 if (EQ (result, Qnil)) | |
3067 error ("Font `%s' is not defined", SDATA (arg)); | |
3068 else if (EQ (result, Qt)) | |
3069 error ("The characters of the given font have varying widths"); | |
3070 else if (STRINGP (result)) | |
3071 { | |
3072 if (STRINGP (fontset_name)) | |
3073 { | |
3074 /* Fontset names are built from ASCII font names, so the | |
3075 names may be equal despite there was a change. */ | |
3076 if (old_fontset == FRAME_FONTSET (f)) | |
3077 return; | |
3078 } | |
3079 else if (!NILP (Fequal (result, oldval))) | |
3080 return; | |
3081 | |
3082 store_frame_param (f, Qfont, result); | |
3083 recompute_basic_faces (f); | |
3084 } | |
3085 else | |
3086 abort (); | |
3087 | |
3088 do_pending_window_change (0); | |
3089 | |
3090 /* Don't call `face-set-after-frame-default' when faces haven't been | |
3091 initialized yet. This is the case when called from | |
3092 Fx_create_frame. In that case, the X widget or window doesn't | |
3093 exist either, and we can end up in x_report_frame_params with a | |
3094 null widget which gives a segfault. */ | |
3095 if (FRAME_FACE_CACHE (f)) | |
3096 { | |
3097 XSETFRAME (frame, f); | |
3098 call1 (Qface_set_after_frame_default, frame); | |
3099 } | |
3100 } | |
3101 | |
3102 | |
3103 void | |
3104 x_set_fringe_width (f, new_value, old_value) | |
3105 struct frame *f; | |
3106 Lisp_Object new_value, old_value; | |
3107 { | |
3108 compute_fringe_widths (f, 1); | |
3109 } | |
3110 | |
3111 void | |
3112 x_set_border_width (f, arg, oldval) | |
3113 struct frame *f; | |
3114 Lisp_Object arg, oldval; | |
3115 { | |
3116 CHECK_NUMBER (arg); | |
3117 | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3118 if (XINT (arg) == f->border_width) |
50357 | 3119 return; |
3120 | |
3121 #ifndef HAVE_CARBON | |
3122 if (FRAME_X_WINDOW (f) != 0) | |
3123 error ("Cannot change the border width of a window"); | |
3124 #endif /* MAC_TODO */ | |
3125 | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3126 f->border_width = XINT (arg); |
50357 | 3127 } |
3128 | |
3129 void | |
3130 x_set_internal_border_width (f, arg, oldval) | |
3131 struct frame *f; | |
3132 Lisp_Object arg, oldval; | |
3133 { | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3134 int old = FRAME_INTERNAL_BORDER_WIDTH (f); |
50357 | 3135 |
3136 CHECK_NUMBER (arg); | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3137 FRAME_INTERNAL_BORDER_WIDTH (f) = XINT (arg); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3138 if (FRAME_INTERNAL_BORDER_WIDTH (f) < 0) |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3139 FRAME_INTERNAL_BORDER_WIDTH (f) = 0; |
50357 | 3140 |
3141 #ifdef USE_X_TOOLKIT | |
3142 if (FRAME_X_OUTPUT (f)->edit_widget) | |
3143 widget_store_internal_border (FRAME_X_OUTPUT (f)->edit_widget); | |
3144 #endif | |
3145 | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3146 if (FRAME_INTERNAL_BORDER_WIDTH (f) == old) |
50357 | 3147 return; |
3148 | |
3149 if (FRAME_X_WINDOW (f) != 0) | |
3150 { | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3151 x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f)); |
50357 | 3152 SET_FRAME_GARBAGED (f); |
3153 do_pending_window_change (0); | |
3154 } | |
3155 else | |
3156 SET_FRAME_GARBAGED (f); | |
3157 } | |
3158 | |
3159 void | |
3160 x_set_visibility (f, value, oldval) | |
3161 struct frame *f; | |
3162 Lisp_Object value, oldval; | |
3163 { | |
3164 Lisp_Object frame; | |
3165 XSETFRAME (frame, f); | |
3166 | |
3167 if (NILP (value)) | |
3168 Fmake_frame_invisible (frame, Qt); | |
3169 else if (EQ (value, Qicon)) | |
3170 Ficonify_frame (frame); | |
3171 else | |
3172 Fmake_frame_visible (frame); | |
3173 } | |
3174 | |
3175 void | |
3176 x_set_autoraise (f, arg, oldval) | |
3177 struct frame *f; | |
3178 Lisp_Object arg, oldval; | |
3179 { | |
3180 f->auto_raise = !EQ (Qnil, arg); | |
3181 } | |
3182 | |
3183 void | |
3184 x_set_autolower (f, arg, oldval) | |
3185 struct frame *f; | |
3186 Lisp_Object arg, oldval; | |
3187 { | |
3188 f->auto_lower = !EQ (Qnil, arg); | |
3189 } | |
3190 | |
3191 void | |
3192 x_set_unsplittable (f, arg, oldval) | |
3193 struct frame *f; | |
3194 Lisp_Object arg, oldval; | |
3195 { | |
3196 f->no_split = !NILP (arg); | |
3197 } | |
3198 | |
3199 void | |
3200 x_set_vertical_scroll_bars (f, arg, oldval) | |
3201 struct frame *f; | |
3202 Lisp_Object arg, oldval; | |
3203 { | |
3204 if ((EQ (arg, Qleft) && FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f)) | |
3205 || (EQ (arg, Qright) && FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)) | |
3206 || (NILP (arg) && FRAME_HAS_VERTICAL_SCROLL_BARS (f)) | |
3207 || (!NILP (arg) && ! FRAME_HAS_VERTICAL_SCROLL_BARS (f))) | |
3208 { | |
3209 FRAME_VERTICAL_SCROLL_BAR_TYPE (f) | |
3210 = (NILP (arg) | |
3211 ? vertical_scroll_bar_none | |
3212 : EQ (Qleft, arg) | |
3213 ? vertical_scroll_bar_left | |
3214 : EQ (Qright, arg) | |
3215 ? vertical_scroll_bar_right | |
3216 #ifdef HAVE_NTGUI | |
3217 /* MS-Windows has scroll bars on the right by default. */ | |
3218 : vertical_scroll_bar_right | |
3219 #else | |
3220 : vertical_scroll_bar_left | |
3221 #endif | |
3222 ); | |
3223 | |
3224 /* We set this parameter before creating the X window for the | |
3225 frame, so we can get the geometry right from the start. | |
3226 However, if the window hasn't been created yet, we shouldn't | |
3227 call x_set_window_size. */ | |
3228 if (FRAME_X_WINDOW (f)) | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3229 x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f)); |
50357 | 3230 do_pending_window_change (0); |
3231 } | |
3232 } | |
3233 | |
3234 void | |
3235 x_set_scroll_bar_width (f, arg, oldval) | |
3236 struct frame *f; | |
3237 Lisp_Object arg, oldval; | |
3238 { | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3239 int wid = FRAME_COLUMN_WIDTH (f); |
50357 | 3240 |
3241 if (NILP (arg)) | |
3242 { | |
3243 x_set_scroll_bar_default_width (f); | |
3244 | |
3245 if (FRAME_X_WINDOW (f)) | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3246 x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f)); |
50357 | 3247 do_pending_window_change (0); |
3248 } | |
3249 else if (INTEGERP (arg) && XINT (arg) > 0 | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3250 && XFASTINT (arg) != FRAME_CONFIG_SCROLL_BAR_WIDTH (f)) |
50357 | 3251 { |
3252 if (XFASTINT (arg) <= 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM) | |
3253 XSETINT (arg, 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM + 1); | |
3254 | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3255 FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = XFASTINT (arg); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3256 FRAME_CONFIG_SCROLL_BAR_COLS (f) = (XFASTINT (arg) + wid-1) / wid; |
50357 | 3257 if (FRAME_X_WINDOW (f)) |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3258 x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f)); |
50357 | 3259 do_pending_window_change (0); |
3260 } | |
3261 | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3262 change_frame_size (f, 0, FRAME_COLS (f), 0, 0, 0); |
50357 | 3263 XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.hpos = 0; |
3264 XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.x = 0; | |
3265 } | |
3266 | |
3267 | |
3268 | |
3269 /* Return non-nil if frame F wants a bitmap icon. */ | |
3270 | |
3271 Lisp_Object | |
3272 x_icon_type (f) | |
3273 FRAME_PTR f; | |
3274 { | |
3275 Lisp_Object tem; | |
3276 | |
3277 tem = assq_no_quit (Qicon_type, f->param_alist); | |
3278 if (CONSP (tem)) | |
3279 return XCDR (tem); | |
3280 else | |
3281 return Qnil; | |
3282 } | |
3283 | |
3284 | |
3285 /* Subroutines of creating an X frame. */ | |
3286 | |
3287 /* Make sure that Vx_resource_name is set to a reasonable value. | |
3288 Fix it up, or set it to `emacs' if it is too hopeless. */ | |
3289 | |
3290 void | |
3291 validate_x_resource_name () | |
3292 { | |
3293 int len = 0; | |
3294 /* Number of valid characters in the resource name. */ | |
3295 int good_count = 0; | |
3296 /* Number of invalid characters in the resource name. */ | |
3297 int bad_count = 0; | |
3298 Lisp_Object new; | |
3299 int i; | |
3300 | |
3301 if (!STRINGP (Vx_resource_class)) | |
3302 Vx_resource_class = build_string (EMACS_CLASS); | |
3303 | |
3304 if (STRINGP (Vx_resource_name)) | |
3305 { | |
3306 unsigned char *p = SDATA (Vx_resource_name); | |
3307 int i; | |
3308 | |
3309 len = SBYTES (Vx_resource_name); | |
3310 | |
3311 /* Only letters, digits, - and _ are valid in resource names. | |
3312 Count the valid characters and count the invalid ones. */ | |
3313 for (i = 0; i < len; i++) | |
3314 { | |
3315 int c = p[i]; | |
3316 if (! ((c >= 'a' && c <= 'z') | |
3317 || (c >= 'A' && c <= 'Z') | |
3318 || (c >= '0' && c <= '9') | |
3319 || c == '-' || c == '_')) | |
3320 bad_count++; | |
3321 else | |
3322 good_count++; | |
3323 } | |
3324 } | |
3325 else | |
3326 /* Not a string => completely invalid. */ | |
3327 bad_count = 5, good_count = 0; | |
3328 | |
3329 /* If name is valid already, return. */ | |
3330 if (bad_count == 0) | |
3331 return; | |
3332 | |
3333 /* If name is entirely invalid, or nearly so, use `emacs'. */ | |
3334 if (good_count == 0 | |
3335 || (good_count == 1 && bad_count > 0)) | |
3336 { | |
3337 Vx_resource_name = build_string ("emacs"); | |
3338 return; | |
3339 } | |
3340 | |
3341 /* Name is partly valid. Copy it and replace the invalid characters | |
3342 with underscores. */ | |
3343 | |
3344 Vx_resource_name = new = Fcopy_sequence (Vx_resource_name); | |
3345 | |
3346 for (i = 0; i < len; i++) | |
3347 { | |
3348 int c = SREF (new, i); | |
3349 if (! ((c >= 'a' && c <= 'z') | |
3350 || (c >= 'A' && c <= 'Z') | |
3351 || (c >= '0' && c <= '9') | |
3352 || c == '-' || c == '_')) | |
3353 SSET (new, i, '_'); | |
3354 } | |
3355 } | |
3356 | |
3357 | |
3358 extern char *x_get_string_resource P_ ((XrmDatabase, char *, char *)); | |
3359 extern Display_Info *check_x_display_info P_ ((Lisp_Object)); | |
3360 | |
3361 | |
3362 /* Get specified attribute from resource database RDB. | |
3363 See Fx_get_resource below for other parameters. */ | |
3364 | |
3365 static Lisp_Object | |
3366 xrdb_get_resource (rdb, attribute, class, component, subclass) | |
3367 XrmDatabase rdb; | |
3368 Lisp_Object attribute, class, component, subclass; | |
3369 { | |
3370 register char *value; | |
3371 char *name_key; | |
3372 char *class_key; | |
3373 | |
3374 CHECK_STRING (attribute); | |
3375 CHECK_STRING (class); | |
3376 | |
3377 if (!NILP (component)) | |
3378 CHECK_STRING (component); | |
3379 if (!NILP (subclass)) | |
3380 CHECK_STRING (subclass); | |
3381 if (NILP (component) != NILP (subclass)) | |
3382 error ("x-get-resource: must specify both COMPONENT and SUBCLASS or neither"); | |
3383 | |
3384 validate_x_resource_name (); | |
3385 | |
3386 /* Allocate space for the components, the dots which separate them, | |
3387 and the final '\0'. Make them big enough for the worst case. */ | |
3388 name_key = (char *) alloca (SBYTES (Vx_resource_name) | |
3389 + (STRINGP (component) | |
3390 ? SBYTES (component) : 0) | |
3391 + SBYTES (attribute) | |
3392 + 3); | |
3393 | |
3394 class_key = (char *) alloca (SBYTES (Vx_resource_class) | |
3395 + SBYTES (class) | |
3396 + (STRINGP (subclass) | |
3397 ? SBYTES (subclass) : 0) | |
3398 + 3); | |
3399 | |
3400 /* Start with emacs.FRAMENAME for the name (the specific one) | |
3401 and with `Emacs' for the class key (the general one). */ | |
3402 strcpy (name_key, SDATA (Vx_resource_name)); | |
3403 strcpy (class_key, SDATA (Vx_resource_class)); | |
3404 | |
3405 strcat (class_key, "."); | |
3406 strcat (class_key, SDATA (class)); | |
3407 | |
3408 if (!NILP (component)) | |
3409 { | |
3410 strcat (class_key, "."); | |
3411 strcat (class_key, SDATA (subclass)); | |
3412 | |
3413 strcat (name_key, "."); | |
3414 strcat (name_key, SDATA (component)); | |
3415 } | |
3416 | |
3417 strcat (name_key, "."); | |
3418 strcat (name_key, SDATA (attribute)); | |
3419 | |
3420 value = x_get_string_resource (rdb, name_key, class_key); | |
3421 | |
3422 if (value != (char *) 0) | |
3423 return build_string (value); | |
3424 else | |
3425 return Qnil; | |
3426 } | |
3427 | |
3428 | |
3429 DEFUN ("x-get-resource", Fx_get_resource, Sx_get_resource, 2, 4, 0, | |
3430 doc: /* Return the value of ATTRIBUTE, of class CLASS, from the X defaults database. | |
3431 This uses `INSTANCE.ATTRIBUTE' as the key and `Emacs.CLASS' as the | |
3432 class, where INSTANCE is the name under which Emacs was invoked, or | |
3433 the name specified by the `-name' or `-rn' command-line arguments. | |
3434 | |
3435 The optional arguments COMPONENT and SUBCLASS add to the key and the | |
3436 class, respectively. You must specify both of them or neither. | |
3437 If you specify them, the key is `INSTANCE.COMPONENT.ATTRIBUTE' | |
3438 and the class is `Emacs.CLASS.SUBCLASS'. */) | |
3439 (attribute, class, component, subclass) | |
3440 Lisp_Object attribute, class, component, subclass; | |
3441 { | |
3442 #ifdef HAVE_X_WINDOWS | |
3443 check_x (); | |
3444 #endif | |
3445 | |
3446 return xrdb_get_resource (check_x_display_info (Qnil)->xrdb, | |
3447 attribute, class, component, subclass); | |
3448 } | |
3449 | |
3450 /* Get an X resource, like Fx_get_resource, but for display DPYINFO. */ | |
3451 | |
3452 Lisp_Object | |
3453 display_x_get_resource (dpyinfo, attribute, class, component, subclass) | |
50375
8be64cfd36fe
(display_x_get_resource): Use Display_Info argument, not x_display_info.
Juanma Barranquero <lekktu@gmail.com>
parents:
50373
diff
changeset
|
3454 Display_Info *dpyinfo; |
50357 | 3455 Lisp_Object attribute, class, component, subclass; |
3456 { | |
3457 return xrdb_get_resource (dpyinfo->xrdb, | |
3458 attribute, class, component, subclass); | |
3459 } | |
3460 | |
3461 /* Used when C code wants a resource value. */ | |
3462 | |
3463 char * | |
3464 x_get_resource_string (attribute, class) | |
3465 char *attribute, *class; | |
3466 { | |
3467 char *name_key; | |
3468 char *class_key; | |
3469 struct frame *sf = SELECTED_FRAME (); | |
3470 | |
3471 /* Allocate space for the components, the dots which separate them, | |
3472 and the final '\0'. */ | |
3473 name_key = (char *) alloca (SBYTES (Vinvocation_name) | |
3474 + strlen (attribute) + 2); | |
3475 class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) | |
3476 + strlen (class) + 2); | |
3477 | |
3478 sprintf (name_key, "%s.%s", SDATA (Vinvocation_name), attribute); | |
3479 sprintf (class_key, "%s.%s", EMACS_CLASS, class); | |
3480 | |
3481 return x_get_string_resource (FRAME_X_DISPLAY_INFO (sf)->xrdb, | |
3482 name_key, class_key); | |
3483 } | |
3484 | |
3485 | |
3486 /* Return the value of parameter PARAM. | |
3487 | |
3488 First search ALIST, then Vdefault_frame_alist, then the X defaults | |
3489 database, using ATTRIBUTE as the attribute name and CLASS as its class. | |
3490 | |
3491 Convert the resource to the type specified by desired_type. | |
3492 | |
3493 If no default is specified, return Qunbound. If you call | |
3494 x_get_arg, make sure you deal with Qunbound in a reasonable way, | |
3495 and don't let it get stored in any Lisp-visible variables! */ | |
3496 | |
3497 Lisp_Object | |
3498 x_get_arg (dpyinfo, alist, param, attribute, class, type) | |
3499 Display_Info *dpyinfo; | |
3500 Lisp_Object alist, param; | |
3501 char *attribute; | |
3502 char *class; | |
3503 enum resource_types type; | |
3504 { | |
3505 register Lisp_Object tem; | |
3506 | |
3507 tem = Fassq (param, alist); | |
3508 if (EQ (tem, Qnil)) | |
3509 tem = Fassq (param, Vdefault_frame_alist); | |
3510 if (EQ (tem, Qnil)) | |
3511 { | |
3512 if (attribute) | |
3513 { | |
3514 tem = display_x_get_resource (dpyinfo, | |
3515 build_string (attribute), | |
3516 build_string (class), | |
3517 Qnil, Qnil); | |
3518 | |
3519 if (NILP (tem)) | |
3520 return Qunbound; | |
3521 | |
3522 switch (type) | |
3523 { | |
3524 case RES_TYPE_NUMBER: | |
3525 return make_number (atoi (SDATA (tem))); | |
3526 | |
3527 case RES_TYPE_FLOAT: | |
3528 return make_float (atof (SDATA (tem))); | |
3529 | |
3530 case RES_TYPE_BOOLEAN: | |
3531 tem = Fdowncase (tem); | |
3532 if (!strcmp (SDATA (tem), "on") | |
3533 || !strcmp (SDATA (tem), "true")) | |
3534 return Qt; | |
3535 else | |
3536 return Qnil; | |
3537 | |
3538 case RES_TYPE_STRING: | |
3539 return tem; | |
3540 | |
3541 case RES_TYPE_SYMBOL: | |
3542 /* As a special case, we map the values `true' and `on' | |
3543 to Qt, and `false' and `off' to Qnil. */ | |
3544 { | |
3545 Lisp_Object lower; | |
3546 lower = Fdowncase (tem); | |
3547 if (!strcmp (SDATA (lower), "on") | |
3548 || !strcmp (SDATA (lower), "true")) | |
3549 return Qt; | |
3550 else if (!strcmp (SDATA (lower), "off") | |
3551 || !strcmp (SDATA (lower), "false")) | |
3552 return Qnil; | |
3553 else | |
3554 return Fintern (tem, Qnil); | |
3555 } | |
3556 | |
3557 default: | |
3558 abort (); | |
3559 } | |
3560 } | |
3561 else | |
3562 return Qunbound; | |
3563 } | |
3564 return Fcdr (tem); | |
3565 } | |
3566 | |
3567 Lisp_Object | |
3568 x_frame_get_arg (f, alist, param, attribute, class, type) | |
3569 struct frame *f; | |
3570 Lisp_Object alist, param; | |
3571 char *attribute; | |
3572 char *class; | |
3573 enum resource_types type; | |
3574 { | |
3575 return x_get_arg (FRAME_X_DISPLAY_INFO (f), | |
3576 alist, param, attribute, class, type); | |
3577 } | |
3578 | |
3579 /* Like x_frame_get_arg, but also record the value in f->param_alist. */ | |
3580 | |
3581 Lisp_Object | |
3582 x_frame_get_and_record_arg (f, alist, param, attribute, class, type) | |
3583 struct frame *f; | |
3584 Lisp_Object alist, param; | |
3585 char *attribute; | |
3586 char *class; | |
3587 enum resource_types type; | |
3588 { | |
3589 Lisp_Object value; | |
3590 | |
3591 value = x_get_arg (FRAME_X_DISPLAY_INFO (f), alist, param, | |
3592 attribute, class, type); | |
3593 if (! NILP (value)) | |
3594 store_frame_param (f, param, value); | |
3595 | |
3596 return value; | |
3597 } | |
3598 | |
3599 | |
3600 /* Record in frame F the specified or default value according to ALIST | |
3601 of the parameter named PROP (a Lisp symbol). | |
3602 If no value is specified for PROP, look for an X default for XPROP | |
3603 on the frame named NAME. | |
3604 If that is not found either, use the value DEFLT. */ | |
3605 | |
3606 Lisp_Object | |
3607 x_default_parameter (f, alist, prop, deflt, xprop, xclass, type) | |
3608 struct frame *f; | |
3609 Lisp_Object alist; | |
3610 Lisp_Object prop; | |
3611 Lisp_Object deflt; | |
3612 char *xprop; | |
3613 char *xclass; | |
3614 enum resource_types type; | |
3615 { | |
3616 Lisp_Object tem; | |
3617 | |
3618 tem = x_frame_get_arg (f, alist, prop, xprop, xclass, type); | |
3619 if (EQ (tem, Qunbound)) | |
3620 tem = deflt; | |
3621 x_set_frame_parameters (f, Fcons (Fcons (prop, tem), Qnil)); | |
3622 return tem; | |
3623 } | |
3624 | |
3625 | |
3626 | |
3627 | |
3628 DEFUN ("x-parse-geometry", Fx_parse_geometry, Sx_parse_geometry, 1, 1, 0, | |
3629 doc: /* Parse an X-style geometry string STRING. | |
3630 Returns an alist of the form ((top . TOP), (left . LEFT) ... ). | |
3631 The properties returned may include `top', `left', `height', and `width'. | |
3632 The value of `left' or `top' may be an integer, | |
3633 or a list (+ N) meaning N pixels relative to top/left corner, | |
3634 or a list (- N) meaning -N pixels relative to bottom/right corner. */) | |
3635 (string) | |
3636 Lisp_Object string; | |
3637 { | |
3638 int geometry, x, y; | |
3639 unsigned int width, height; | |
3640 Lisp_Object result; | |
3641 | |
3642 CHECK_STRING (string); | |
3643 | |
3644 geometry = XParseGeometry ((char *) SDATA (string), | |
3645 &x, &y, &width, &height); | |
3646 | |
3647 #if 0 | |
3648 if (!!(geometry & XValue) != !!(geometry & YValue)) | |
3649 error ("Must specify both x and y position, or neither"); | |
3650 #endif | |
3651 | |
3652 result = Qnil; | |
3653 if (geometry & XValue) | |
3654 { | |
3655 Lisp_Object element; | |
3656 | |
3657 if (x >= 0 && (geometry & XNegative)) | |
3658 element = Fcons (Qleft, Fcons (Qminus, Fcons (make_number (-x), Qnil))); | |
3659 else if (x < 0 && ! (geometry & XNegative)) | |
3660 element = Fcons (Qleft, Fcons (Qplus, Fcons (make_number (x), Qnil))); | |
3661 else | |
3662 element = Fcons (Qleft, make_number (x)); | |
3663 result = Fcons (element, result); | |
3664 } | |
3665 | |
3666 if (geometry & YValue) | |
3667 { | |
3668 Lisp_Object element; | |
3669 | |
3670 if (y >= 0 && (geometry & YNegative)) | |
3671 element = Fcons (Qtop, Fcons (Qminus, Fcons (make_number (-y), Qnil))); | |
3672 else if (y < 0 && ! (geometry & YNegative)) | |
3673 element = Fcons (Qtop, Fcons (Qplus, Fcons (make_number (y), Qnil))); | |
3674 else | |
3675 element = Fcons (Qtop, make_number (y)); | |
3676 result = Fcons (element, result); | |
3677 } | |
3678 | |
3679 if (geometry & WidthValue) | |
3680 result = Fcons (Fcons (Qwidth, make_number (width)), result); | |
3681 if (geometry & HeightValue) | |
3682 result = Fcons (Fcons (Qheight, make_number (height)), result); | |
3683 | |
3684 return result; | |
3685 } | |
3686 | |
3687 /* Calculate the desired size and position of frame F. | |
3688 Return the flags saying which aspects were specified. | |
3689 | |
3690 Also set the win_gravity and size_hint_flags of F. | |
3691 | |
3692 Adjust height for toolbar if TOOLBAR_P is 1. | |
3693 | |
3694 This function does not make the coordinates positive. */ | |
3695 | |
3696 #define DEFAULT_ROWS 40 | |
3697 #define DEFAULT_COLS 80 | |
3698 | |
3699 int | |
3700 x_figure_window_size (f, parms, toolbar_p) | |
3701 struct frame *f; | |
3702 Lisp_Object parms; | |
3703 int toolbar_p; | |
3704 { | |
3705 register Lisp_Object tem0, tem1, tem2; | |
3706 long window_prompting = 0; | |
3707 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | |
3708 | |
3709 /* Default values if we fall through. | |
3710 Actually, if that happens we should get | |
3711 window manager prompting. */ | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3712 SET_FRAME_COLS (f, DEFAULT_COLS); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3713 FRAME_LINES (f) = DEFAULT_ROWS; |
50357 | 3714 /* Window managers expect that if program-specified |
3715 positions are not (0,0), they're intentional, not defaults. */ | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3716 f->top_pos = 0; |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3717 f->left_pos = 0; |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3718 |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3719 /* Ensure that old new_text_cols and new_text_lines will not override the |
50357 | 3720 values set here. */ |
3721 /* ++KFS: This was specific to W32, but seems ok for all platforms */ | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3722 f->new_text_cols = f->new_text_lines = 0; |
50357 | 3723 |
3724 tem0 = x_get_arg (dpyinfo, parms, Qheight, 0, 0, RES_TYPE_NUMBER); | |
3725 tem1 = x_get_arg (dpyinfo, parms, Qwidth, 0, 0, RES_TYPE_NUMBER); | |
3726 tem2 = x_get_arg (dpyinfo, parms, Quser_size, 0, 0, RES_TYPE_NUMBER); | |
3727 if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound)) | |
3728 { | |
3729 if (!EQ (tem0, Qunbound)) | |
3730 { | |
3731 CHECK_NUMBER (tem0); | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3732 FRAME_LINES (f) = XINT (tem0); |
50357 | 3733 } |
3734 if (!EQ (tem1, Qunbound)) | |
3735 { | |
3736 CHECK_NUMBER (tem1); | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3737 SET_FRAME_COLS (f, XINT (tem1)); |
50357 | 3738 } |
3739 if (!NILP (tem2) && !EQ (tem2, Qunbound)) | |
3740 window_prompting |= USSize; | |
3741 else | |
3742 window_prompting |= PSize; | |
3743 } | |
3744 | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3745 f->scroll_bar_actual_width |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3746 = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f); |
50357 | 3747 |
3748 /* This used to be done _before_ calling x_figure_window_size, but | |
3749 since the height is reset here, this was really a no-op. I | |
3750 assume that moving it here does what Gerd intended (although he | |
3751 no longer can remember what that was... ++KFS, 2003-03-25. */ | |
3752 | |
3753 /* Add the tool-bar height to the initial frame height so that the | |
3754 user gets a text display area of the size he specified with -g or | |
3755 via .Xdefaults. Later changes of the tool-bar height don't | |
3756 change the frame size. This is done so that users can create | |
3757 tall Emacs frames without having to guess how tall the tool-bar | |
3758 will get. */ | |
3759 if (toolbar_p && FRAME_TOOL_BAR_LINES (f)) | |
3760 { | |
3761 int margin, relief, bar_height; | |
3762 | |
3763 relief = (tool_bar_button_relief >= 0 | |
3764 ? tool_bar_button_relief | |
3765 : DEFAULT_TOOL_BAR_BUTTON_RELIEF); | |
3766 | |
3767 if (INTEGERP (Vtool_bar_button_margin) | |
3768 && XINT (Vtool_bar_button_margin) > 0) | |
3769 margin = XFASTINT (Vtool_bar_button_margin); | |
3770 else if (CONSP (Vtool_bar_button_margin) | |
3771 && INTEGERP (XCDR (Vtool_bar_button_margin)) | |
3772 && XINT (XCDR (Vtool_bar_button_margin)) > 0) | |
3773 margin = XFASTINT (XCDR (Vtool_bar_button_margin)); | |
3774 else | |
3775 margin = 0; | |
3776 | |
3777 bar_height = DEFAULT_TOOL_BAR_IMAGE_HEIGHT + 2 * margin + 2 * relief; | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3778 FRAME_LINES (f) += (bar_height + FRAME_LINE_HEIGHT (f) - 1) / FRAME_LINE_HEIGHT (f); |
50357 | 3779 } |
3780 | |
3781 compute_fringe_widths (f, 0); | |
3782 | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3783 FRAME_PIXEL_WIDTH (f) = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, FRAME_COLS (f)); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3784 FRAME_PIXEL_HEIGHT (f) = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, FRAME_LINES (f)); |
50357 | 3785 |
3786 tem0 = x_get_arg (dpyinfo, parms, Qtop, 0, 0, RES_TYPE_NUMBER); | |
3787 tem1 = x_get_arg (dpyinfo, parms, Qleft, 0, 0, RES_TYPE_NUMBER); | |
3788 tem2 = x_get_arg (dpyinfo, parms, Quser_position, 0, 0, RES_TYPE_NUMBER); | |
3789 if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound)) | |
3790 { | |
3791 if (EQ (tem0, Qminus)) | |
3792 { | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3793 f->top_pos = 0; |
50357 | 3794 window_prompting |= YNegative; |
3795 } | |
3796 else if (CONSP (tem0) && EQ (XCAR (tem0), Qminus) | |
3797 && CONSP (XCDR (tem0)) | |
3798 && INTEGERP (XCAR (XCDR (tem0)))) | |
3799 { | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3800 f->top_pos = - XINT (XCAR (XCDR (tem0))); |
50357 | 3801 window_prompting |= YNegative; |
3802 } | |
3803 else if (CONSP (tem0) && EQ (XCAR (tem0), Qplus) | |
3804 && CONSP (XCDR (tem0)) | |
3805 && INTEGERP (XCAR (XCDR (tem0)))) | |
3806 { | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3807 f->top_pos = XINT (XCAR (XCDR (tem0))); |
50357 | 3808 } |
3809 else if (EQ (tem0, Qunbound)) | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3810 f->top_pos = 0; |
50357 | 3811 else |
3812 { | |
3813 CHECK_NUMBER (tem0); | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3814 f->top_pos = XINT (tem0); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3815 if (f->top_pos < 0) |
50357 | 3816 window_prompting |= YNegative; |
3817 } | |
3818 | |
3819 if (EQ (tem1, Qminus)) | |
3820 { | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3821 f->left_pos = 0; |
50357 | 3822 window_prompting |= XNegative; |
3823 } | |
3824 else if (CONSP (tem1) && EQ (XCAR (tem1), Qminus) | |
3825 && CONSP (XCDR (tem1)) | |
3826 && INTEGERP (XCAR (XCDR (tem1)))) | |
3827 { | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3828 f->left_pos = - XINT (XCAR (XCDR (tem1))); |
50357 | 3829 window_prompting |= XNegative; |
3830 } | |
3831 else if (CONSP (tem1) && EQ (XCAR (tem1), Qplus) | |
3832 && CONSP (XCDR (tem1)) | |
3833 && INTEGERP (XCAR (XCDR (tem1)))) | |
3834 { | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3835 f->left_pos = XINT (XCAR (XCDR (tem1))); |
50357 | 3836 } |
3837 else if (EQ (tem1, Qunbound)) | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3838 f->left_pos = 0; |
50357 | 3839 else |
3840 { | |
3841 CHECK_NUMBER (tem1); | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3842 f->left_pos = XINT (tem1); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3843 if (f->left_pos < 0) |
50357 | 3844 window_prompting |= XNegative; |
3845 } | |
3846 | |
3847 if (!NILP (tem2) && ! EQ (tem2, Qunbound)) | |
3848 window_prompting |= USPosition; | |
3849 else | |
3850 window_prompting |= PPosition; | |
3851 } | |
3852 | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3853 if (f->want_fullscreen != FULLSCREEN_NONE) |
50357 | 3854 { |
3855 int left, top; | |
3856 int width, height; | |
3857 | |
3858 /* It takes both for some WM:s to place it where we want */ | |
3859 window_prompting = USPosition | PPosition; | |
3860 x_fullscreen_adjust (f, &width, &height, &top, &left); | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3861 FRAME_COLS (f) = width; |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3862 FRAME_LINES (f) = height; |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3863 FRAME_PIXEL_WIDTH (f) = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3864 FRAME_PIXEL_HEIGHT (f) = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height); |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3865 f->left_pos = left; |
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3866 f->top_pos = top; |
50357 | 3867 } |
3868 | |
3869 if (window_prompting & XNegative) | |
3870 { | |
3871 if (window_prompting & YNegative) | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3872 f->win_gravity = SouthEastGravity; |
50357 | 3873 else |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3874 f->win_gravity = NorthEastGravity; |
50357 | 3875 } |
3876 else | |
3877 { | |
3878 if (window_prompting & YNegative) | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3879 f->win_gravity = SouthWestGravity; |
50357 | 3880 else |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3881 f->win_gravity = NorthWestGravity; |
50357 | 3882 } |
3883 | |
51194
a873867ba3d2
Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
51091
diff
changeset
|
3884 f->size_hint_flags = window_prompting; |
50357 | 3885 |
3886 return window_prompting; | |
3887 } | |
3888 | |
3889 | |
3890 | |
3891 #endif /* HAVE_WINDOW_SYSTEM */ | |
3892 | |
3893 | |
3894 | |
3895 /*********************************************************************** | |
3896 Initialization | |
3897 ***********************************************************************/ | |
3898 | |
21514 | 3899 void |
765 | 3900 syms_of_frame () |
286 | 3901 { |
33509
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3902 Qframep = intern ("framep"); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3903 staticpro (&Qframep); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3904 Qframe_live_p = intern ("frame-live-p"); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3905 staticpro (&Qframe_live_p); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3906 Qheight = intern ("height"); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3907 staticpro (&Qheight); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3908 Qicon = intern ("icon"); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3909 staticpro (&Qicon); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3910 Qminibuffer = intern ("minibuffer"); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3911 staticpro (&Qminibuffer); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3912 Qmodeline = intern ("modeline"); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3913 staticpro (&Qmodeline); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3914 Qonly = intern ("only"); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3915 staticpro (&Qonly); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3916 Qwidth = intern ("width"); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3917 staticpro (&Qwidth); |
50357 | 3918 Qgeometry = intern ("geometry"); |
3919 staticpro (&Qgeometry); | |
3920 Qicon_left = intern ("icon-left"); | |
3921 staticpro (&Qicon_left); | |
3922 Qicon_top = intern ("icon-top"); | |
3923 staticpro (&Qicon_top); | |
3924 Qleft = intern ("left"); | |
3925 staticpro (&Qleft); | |
3926 Qright = intern ("right"); | |
3927 staticpro (&Qright); | |
3928 Quser_position = intern ("user-position"); | |
3929 staticpro (&Quser_position); | |
3930 Quser_size = intern ("user-size"); | |
3931 staticpro (&Quser_size); | |
3932 Qwindow_id = intern ("window-id"); | |
3933 staticpro (&Qwindow_id); | |
3934 #ifdef HAVE_X_WINDOWS | |
3935 Qouter_window_id = intern ("outer-window-id"); | |
3936 staticpro (&Qouter_window_id); | |
3937 #endif | |
3938 Qparent_id = intern ("parent-id"); | |
3939 staticpro (&Qparent_id); | |
33509
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3940 Qx = intern ("x"); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3941 staticpro (&Qx); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3942 Qw32 = intern ("w32"); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3943 staticpro (&Qw32); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3944 Qpc = intern ("pc"); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3945 staticpro (&Qpc); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3946 Qmac = intern ("mac"); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3947 staticpro (&Qmac); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3948 Qvisible = intern ("visible"); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3949 staticpro (&Qvisible); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3950 Qbuffer_predicate = intern ("buffer-predicate"); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3951 staticpro (&Qbuffer_predicate); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3952 Qbuffer_list = intern ("buffer-list"); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3953 staticpro (&Qbuffer_list); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3954 Qdisplay_type = intern ("display-type"); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3955 staticpro (&Qdisplay_type); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3956 Qbackground_mode = intern ("background-mode"); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
3957 staticpro (&Qbackground_mode); |
42743
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
3958 Qtty_color_mode = intern ("tty-color-mode"); |
1e6231c9c359
(store_frame_param): Call set_tty_color_mode for termcap
Eli Zaretskii <eliz@gnu.org>
parents:
41718
diff
changeset
|
3959 staticpro (&Qtty_color_mode); |
286 | 3960 |
50357 | 3961 Qface_set_after_frame_default = intern ("face-set-after-frame-default"); |
3962 staticpro (&Qface_set_after_frame_default); | |
3963 | |
3964 Qfullwidth = intern ("fullwidth"); | |
3965 staticpro (&Qfullwidth); | |
3966 Qfullheight = intern ("fullheight"); | |
3967 staticpro (&Qfullheight); | |
3968 Qfullboth = intern ("fullboth"); | |
3969 staticpro (&Qfullboth); | |
3970 Qx_resource_name = intern ("x-resource-name"); | |
3971 staticpro (&Qx_resource_name); | |
3972 | |
3973 Qx_frame_parameter = intern ("x-frame-parameter"); | |
3974 staticpro (&Qx_frame_parameter); | |
3975 | |
3976 { | |
3977 int i; | |
3978 | |
3979 for (i = 0; i < sizeof (frame_parms) / sizeof (frame_parms[0]); i++) | |
3980 { | |
3981 Lisp_Object v = intern (frame_parms[i].name); | |
3982 if (frame_parms[i].variable) | |
3983 { | |
3984 *frame_parms[i].variable = v; | |
3985 staticpro (frame_parms[i].variable); | |
3986 } | |
3987 Fput (v, Qx_frame_parameter, make_number (i)); | |
3988 } | |
3989 } | |
3990 | |
50373
6defa3317421
Fix compilation for --with-x=no.
Kim F. Storm <storm@cua.dk>
parents:
50357
diff
changeset
|
3991 #ifdef HAVE_WINDOW_SYSTEM |
50357 | 3992 DEFVAR_LISP ("x-resource-name", &Vx_resource_name, |
3993 doc: /* The name Emacs uses to look up X resources. | |
3994 `x-get-resource' uses this as the first component of the instance name | |
3995 when requesting resource values. | |
3996 Emacs initially sets `x-resource-name' to the name under which Emacs | |
3997 was invoked, or to the value specified with the `-name' or `-rn' | |
3998 switches, if present. | |
3999 | |
4000 It may be useful to bind this variable locally around a call | |
4001 to `x-get-resource'. See also the variable `x-resource-class'. */); | |
4002 Vx_resource_name = Qnil; | |
4003 | |
4004 DEFVAR_LISP ("x-resource-class", &Vx_resource_class, | |
4005 doc: /* The class Emacs uses to look up X resources. | |
4006 `x-get-resource' uses this as the first component of the instance class | |
4007 when requesting resource values. | |
4008 | |
4009 Emacs initially sets `x-resource-class' to "Emacs". | |
4010 | |
4011 Setting this variable permanently is not a reasonable thing to do, | |
4012 but binding this variable locally around a call to `x-get-resource' | |
4013 is a reasonable practice. See also the variable `x-resource-name'. */); | |
4014 Vx_resource_class = build_string (EMACS_CLASS); | |
50373
6defa3317421
Fix compilation for --with-x=no.
Kim F. Storm <storm@cua.dk>
parents:
50357
diff
changeset
|
4015 #endif |
50357 | 4016 |
33509
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
4017 DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4018 doc: /* Alist of default values for frame creation. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4019 These may be set in your init file, like this: |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4020 (setq default-frame-alist '((width . 80) (height . 55) (menu-bar-lines . 1)) |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4021 These override values given in window system configuration data, |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4022 including X Windows' defaults database. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4023 For values specific to the first Emacs frame, see `initial-frame-alist'. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4024 For values specific to the separate minibuffer frame, see |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4025 `minibuffer-frame-alist'. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4026 The `menu-bar-lines' element of the list controls whether new frames |
43716
bb64514bd572
2002-03-05 Per Abrahamsen <abraham@dina.kvl.dk>
Per Abrahamsen <abraham@dina.kvl.dk>
parents:
43442
diff
changeset
|
4027 have menu bars; `menu-bar-mode' works by altering this element. |
43717 | 4028 Setting this variable does not affect existing frames, only new ones. */); |
33509
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
4029 Vdefault_frame_alist = Qnil; |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
4030 |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
4031 Qinhibit_default_face_x_resources |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
4032 = intern ("inhibit-default-face-x-resources"); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
4033 staticpro (&Qinhibit_default_face_x_resources); |
286 | 4034 |
765 | 4035 DEFVAR_LISP ("terminal-frame", &Vterminal_frame, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4036 doc: /* The initial frame-object, which represents Emacs's stdout. */); |
286 | 4037 |
4038 DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified, | |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4039 doc: /* Non-nil if all of emacs is iconified and frame updates are not needed. */); |
286 | 4040 Vemacs_iconified = Qnil; |
4041 | |
27795
83292274bbd4
(Vmouse_position_function): New variable.
Dave Love <fx@gnu.org>
parents:
27725
diff
changeset
|
4042 DEFVAR_LISP ("mouse-position-function", &Vmouse_position_function, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4043 doc: /* If non-nil, function to transform normal value of `mouse-position'. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4044 `mouse-position' calls this function, passing its usual return value as |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4045 argument, and returns whatever this function returns. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4046 This abnormal hook exists for the benefit of packages like `xt-mouse.el' |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4047 which need to do mouse handling at the Lisp level. */); |
27795
83292274bbd4
(Vmouse_position_function): New variable.
Dave Love <fx@gnu.org>
parents:
27725
diff
changeset
|
4048 Vmouse_position_function = Qnil; |
83292274bbd4
(Vmouse_position_function): New variable.
Dave Love <fx@gnu.org>
parents:
27725
diff
changeset
|
4049 |
43366
512ab477b395
(Vmouse_highlight): New variable.
Kim F. Storm <storm@cua.dk>
parents:
42743
diff
changeset
|
4050 DEFVAR_LISP ("mouse-highlight", &Vmouse_highlight, |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47731
diff
changeset
|
4051 doc: /* If non-nil, clickable text is highlighted when mouse is over it. |
43366
512ab477b395
(Vmouse_highlight): New variable.
Kim F. Storm <storm@cua.dk>
parents:
42743
diff
changeset
|
4052 If the value is an integer, highlighting is only shown after moving the |
512ab477b395
(Vmouse_highlight): New variable.
Kim F. Storm <storm@cua.dk>
parents:
42743
diff
changeset
|
4053 mouse, while keyboard input turns off the highlight even when the mouse |
512ab477b395
(Vmouse_highlight): New variable.
Kim F. Storm <storm@cua.dk>
parents:
42743
diff
changeset
|
4054 is over the clickable text. However, the mouse shape still indicates |
512ab477b395
(Vmouse_highlight): New variable.
Kim F. Storm <storm@cua.dk>
parents:
42743
diff
changeset
|
4055 when the mouse is over clickable text. */); |
43442
400971c52790
(syms_of_frame): Change mouse-highlight default to t.
Kim F. Storm <storm@cua.dk>
parents:
43366
diff
changeset
|
4056 Vmouse_highlight = Qt; |
43366
512ab477b395
(Vmouse_highlight): New variable.
Kim F. Storm <storm@cua.dk>
parents:
42743
diff
changeset
|
4057 |
47731
755c4233cfba
* frame.c (Vdelete_frame_functions): New variable.
John Paul Wallington <jpw@pobox.com>
parents:
47036
diff
changeset
|
4058 DEFVAR_LISP ("delete-frame-functions", &Vdelete_frame_functions, |
755c4233cfba
* frame.c (Vdelete_frame_functions): New variable.
John Paul Wallington <jpw@pobox.com>
parents:
47036
diff
changeset
|
4059 doc: /* Functions to be run before deleting a frame. |
755c4233cfba
* frame.c (Vdelete_frame_functions): New variable.
John Paul Wallington <jpw@pobox.com>
parents:
47036
diff
changeset
|
4060 The functions are run with one arg, the frame to be deleted. |
755c4233cfba
* frame.c (Vdelete_frame_functions): New variable.
John Paul Wallington <jpw@pobox.com>
parents:
47036
diff
changeset
|
4061 See `delete-frame'. */); |
755c4233cfba
* frame.c (Vdelete_frame_functions): New variable.
John Paul Wallington <jpw@pobox.com>
parents:
47036
diff
changeset
|
4062 Vdelete_frame_functions = Qnil; |
755c4233cfba
* frame.c (Vdelete_frame_functions): New variable.
John Paul Wallington <jpw@pobox.com>
parents:
47036
diff
changeset
|
4063 |
11779
6234b3610a6f
Vdefault_minibuffer_frame is now part of KBOARD instead
Karl Heuer <kwzh@gnu.org>
parents:
11775
diff
changeset
|
4064 DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame, |
40105
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4065 doc: /* Minibufferless frames use this frame's minibuffer. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4066 |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4067 Emacs cannot create minibufferless frames unless this is set to an |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4068 appropriate surrogate. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4069 |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4070 Emacs consults this variable only when creating minibufferless |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4071 frames; once the frame is created, it sticks with its assigned |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4072 minibuffer, no matter what this variable is set to. This means that |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4073 this variable doesn't necessarily say anything meaningful about the |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4074 current set of frames, or where the minibuffer is currently being |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4075 displayed. |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4076 |
bb56bafcdcc7
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
39973
diff
changeset
|
4077 This variable is local to the current terminal and cannot be buffer-local. */); |
286 | 4078 |
33509
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
4079 staticpro (&Vframe_list); |
a7d245e080d1
(syms_of_frame_1): Removed; code moved to syms_of_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
33005
diff
changeset
|
4080 |
11169
d0550c056e5b
[MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
11126
diff
changeset
|
4081 defsubr (&Sactive_minibuffer_window); |
765 | 4082 defsubr (&Sframep); |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1809
diff
changeset
|
4083 defsubr (&Sframe_live_p); |
10768
938451cf1b10
(Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
10676
diff
changeset
|
4084 defsubr (&Smake_terminal_frame); |
2298
872a3a2c3fed
* frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents:
2282
diff
changeset
|
4085 defsubr (&Shandle_switch_frame); |
12283
fd9043d15414
[MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents:
12255
diff
changeset
|
4086 defsubr (&Signore_event); |
765 | 4087 defsubr (&Sselect_frame); |
4088 defsubr (&Sselected_frame); | |
4089 defsubr (&Swindow_frame); | |
4090 defsubr (&Sframe_root_window); | |
7570
20cbb114367b
(syms_of_frame): Set up frame-first-window as Lisp fn.
Richard M. Stallman <rms@gnu.org>
parents:
7307
diff
changeset
|
4091 defsubr (&Sframe_first_window); |
765 | 4092 defsubr (&Sframe_selected_window); |
7055
5e4906d964b8
(Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents:
7025
diff
changeset
|
4093 defsubr (&Sset_frame_selected_window); |
765 | 4094 defsubr (&Sframe_list); |
4095 defsubr (&Snext_frame); | |
4424
027d3affb2f8
(Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents:
4412
diff
changeset
|
4096 defsubr (&Sprevious_frame); |
765 | 4097 defsubr (&Sdelete_frame); |
454 | 4098 defsubr (&Smouse_position); |
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
4099 defsubr (&Smouse_pixel_position); |
286 | 4100 defsubr (&Sset_mouse_position); |
7025
24e759919770
(Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents:
6986
diff
changeset
|
4101 defsubr (&Sset_mouse_pixel_position); |
286 | 4102 #if 0 |
765 | 4103 defsubr (&Sframe_configuration); |
4104 defsubr (&Srestore_frame_configuration); | |
286 | 4105 #endif |
765 | 4106 defsubr (&Smake_frame_visible); |
4107 defsubr (&Smake_frame_invisible); | |
4108 defsubr (&Siconify_frame); | |
4109 defsubr (&Sframe_visible_p); | |
4110 defsubr (&Svisible_frame_list); | |
2282
f727944c11aa
* frame.c (Fraise_frame, Flower_frame): Renamed from
Jim Blandy <jimb@redhat.com>
parents:
2207
diff
changeset
|
4111 defsubr (&Sraise_frame); |
f727944c11aa
* frame.c (Fraise_frame, Flower_frame): Renamed from
Jim Blandy <jimb@redhat.com>
parents:
2207
diff
changeset
|
4112 defsubr (&Slower_frame); |
765 | 4113 defsubr (&Sredirect_frame_focus); |
4114 defsubr (&Sframe_focus); | |
4115 defsubr (&Sframe_parameters); | |
31399
db831ffcd565
(Qdisplay_type): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
31102
diff
changeset
|
4116 defsubr (&Sframe_parameter); |
765 | 4117 defsubr (&Smodify_frame_parameters); |
2068
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
4118 defsubr (&Sframe_char_height); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
4119 defsubr (&Sframe_char_width); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
4120 defsubr (&Sframe_pixel_height); |
6357ea40643c
(Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents:
1989
diff
changeset
|
4121 defsubr (&Sframe_pixel_width); |
765 | 4122 defsubr (&Sset_frame_height); |
4123 defsubr (&Sset_frame_width); | |
4124 defsubr (&Sset_frame_size); | |
4125 defsubr (&Sset_frame_position); | |
50357 | 4126 |
4127 #ifdef HAVE_WINDOW_SYSTEM | |
4128 defsubr (&Sx_get_resource); | |
4129 defsubr (&Sx_parse_geometry); | |
4130 #endif | |
4131 | |
286 | 4132 } |