annotate src/frame.c @ 19164:3187940bd6b2

(gud): Fix defgroup doc.
author Richard M. Stallman <rms@gnu.org>
date Tue, 05 Aug 1997 08:10:20 +0000
parents 7f491075707a
children 9dcee56b2966
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1 /* Generic frame functions.
17221
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
2 Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation.
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4 This file is part of GNU Emacs.
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6 GNU Emacs is free software; you can redistribute it and/or modify
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
8 the Free Software Foundation; either version 2, or (at your option)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9 any later version.
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11 GNU Emacs is distributed in the hope that it will be useful,
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 GNU General Public License for more details.
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 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
18 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
19 Boston, MA 02111-1307, USA. */
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20
7900
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
21 #include <config.h>
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
22
7900
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
23 #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
24 #include "lisp.h"
17032
814257735e7d Include "charset.h"
Karl Heuer <kwzh@gnu.org>
parents: 16588
diff changeset
25 #include "charset.h"
814257735e7d Include "charset.h"
Karl Heuer <kwzh@gnu.org>
parents: 16588
diff changeset
26 #ifdef HAVE_WINDOW_SYSTEM
814257735e7d Include "charset.h"
Karl Heuer <kwzh@gnu.org>
parents: 16588
diff changeset
27 #include "fontset.h"
814257735e7d Include "charset.h"
Karl Heuer <kwzh@gnu.org>
parents: 16588
diff changeset
28 #endif
987
afb21e974ed2 * frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents: 965
diff changeset
29 #include "frame.h"
5392
d8d5844c3ba6 Always include termhooks.h.
Richard M. Stallman <rms@gnu.org>
parents: 5231
diff changeset
30 #include "termhooks.h"
7162
06a13bf36a8c (Fframe_parameters) [!MULTI_FRAME]: Unstub it again.
Karl Heuer <kwzh@gnu.org>
parents: 7134
diff changeset
31 #include "window.h"
9572
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 9309
diff changeset
32 #ifdef MSDOS
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 9309
diff changeset
33 #include "msdos.h"
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 9309
diff changeset
34 #endif
732
a8d94735277e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 714
diff changeset
35
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
36 /* Evaluate this expression to rebuild the section of syms_of_frame
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
37 that initializes and staticpros the symbols declared below. Note
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
38 that Emacs 18 has a bug that keeps C-x C-e from being able to
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
39 evaluate this expression.
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
40
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
41 (progn
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
42 ;; Accumulate a list of the symbols we want to initialize from the
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
43 ;; declarations at the top of the file.
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
44 (goto-char (point-min))
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
45 (search-forward "/\*&&& symbols declared here &&&*\/\n")
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
46 (let (symbol-list)
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
47 (while (looking-at "Lisp_Object \\(Q[a-z_]+\\)")
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
48 (setq symbol-list
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
49 (cons (buffer-substring (match-beginning 1) (match-end 1))
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
50 symbol-list))
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
51 (forward-line 1))
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
52 (setq symbol-list (nreverse symbol-list))
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
53 ;; Delete the section of syms_of_... where we initialize the symbols.
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
54 (search-forward "\n /\*&&& init symbols here &&&*\/\n")
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
55 (let ((start (point)))
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
56 (while (looking-at "^ Q")
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
57 (forward-line 2))
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
58 (kill-region start (point)))
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
59 ;; Write a new symbol initialization section.
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
60 (while symbol-list
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
61 (insert (format " %s = intern (\"" (car symbol-list)))
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
62 (let ((start (point)))
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
63 (insert (substring (car symbol-list) 1))
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
64 (subst-char-in-region start (point) ?_ ?-))
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
65 (insert (format "\");\n staticpro (&%s);\n" (car symbol-list)))
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
66 (setq symbol-list (cdr symbol-list)))))
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
67 */
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
68
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
69 /*&&& symbols declared here &&&*/
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
70 Lisp_Object Qframep;
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
71 Lisp_Object Qframe_live_p;
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
72 Lisp_Object Qheight;
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
73 Lisp_Object Qicon;
539
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
74 Lisp_Object Qminibuffer;
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
75 Lisp_Object Qmodeline;
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
76 Lisp_Object Qname;
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
77 Lisp_Object Qonly;
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
78 Lisp_Object Qunsplittable;
2131
468df2d7e371 (x_frame_parms): Add elts for visibility and menu-bar-lines.
Richard M. Stallman <rms@gnu.org>
parents: 2068
diff changeset
79 Lisp_Object Qmenu_bar_lines;
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
80 Lisp_Object Qwidth;
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
81 Lisp_Object Qx;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16568
diff changeset
82 Lisp_Object Qw32;
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
83 Lisp_Object Qpc;
6246
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
84 Lisp_Object Qvisible;
10207
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
85 Lisp_Object Qbuffer_predicate;
17221
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
86 Lisp_Object Qbuffer_list;
14217
673d1913844b (syms_of_frame_1): Initialize Qtitle.
Richard M. Stallman <rms@gnu.org>
parents: 14186
diff changeset
87 Lisp_Object Qtitle;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
88
12761
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
89 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
90 Lisp_Object Vdefault_frame_alist;
12761
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
91
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
92 static void
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
93 syms_of_frame_1 ()
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
94 {
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
95 /*&&& init symbols here &&&*/
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
96 Qframep = intern ("framep");
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
97 staticpro (&Qframep);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
98 Qframe_live_p = intern ("frame-live-p");
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
99 staticpro (&Qframe_live_p);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
100 Qheight = intern ("height");
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
101 staticpro (&Qheight);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
102 Qicon = intern ("icon");
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
103 staticpro (&Qicon);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
104 Qminibuffer = intern ("minibuffer");
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
105 staticpro (&Qminibuffer);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
106 Qmodeline = intern ("modeline");
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
107 staticpro (&Qmodeline);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
108 Qname = intern ("name");
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
109 staticpro (&Qname);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
110 Qonly = intern ("only");
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
111 staticpro (&Qonly);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
112 Qunsplittable = intern ("unsplittable");
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
113 staticpro (&Qunsplittable);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
114 Qmenu_bar_lines = intern ("menu-bar-lines");
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
115 staticpro (&Qmenu_bar_lines);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
116 Qwidth = intern ("width");
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
117 staticpro (&Qwidth);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
118 Qx = intern ("x");
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
119 staticpro (&Qx);
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16568
diff changeset
120 Qw32 = intern ("w32");
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16568
diff changeset
121 staticpro (&Qw32);
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
122 Qpc = intern ("pc");
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
123 staticpro (&Qpc);
12761
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
124 Qvisible = intern ("visible");
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
125 staticpro (&Qvisible);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
126 Qbuffer_predicate = intern ("buffer-predicate");
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
127 staticpro (&Qbuffer_predicate);
17221
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
128 Qbuffer_list = intern ("buffer-list");
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
129 staticpro (&Qbuffer_list);
14217
673d1913844b (syms_of_frame_1): Initialize Qtitle.
Richard M. Stallman <rms@gnu.org>
parents: 14186
diff changeset
130 Qtitle = intern ("title");
673d1913844b (syms_of_frame_1): Initialize Qtitle.
Richard M. Stallman <rms@gnu.org>
parents: 14186
diff changeset
131 staticpro (&Qtitle);
13106
22011e724596 (Qmouse_leave_buffer_hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 12987
diff changeset
132
13522
6a97ea1245b5 (syms_of_frame_1): Set up Vdefault_frame_alist here.
Richard M. Stallman <rms@gnu.org>
parents: 13498
diff changeset
133 DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist,
6a97ea1245b5 (syms_of_frame_1): Set up Vdefault_frame_alist here.
Richard M. Stallman <rms@gnu.org>
parents: 13498
diff changeset
134 "Alist of default values for frame creation.\n\
6a97ea1245b5 (syms_of_frame_1): Set up Vdefault_frame_alist here.
Richard M. Stallman <rms@gnu.org>
parents: 13498
diff changeset
135 These may be set in your init file, like this:\n\
6a97ea1245b5 (syms_of_frame_1): Set up Vdefault_frame_alist here.
Richard M. Stallman <rms@gnu.org>
parents: 13498
diff changeset
136 (setq default-frame-alist '((width . 80) (height . 55) (menu-bar-lines . 1))\n\
6a97ea1245b5 (syms_of_frame_1): Set up Vdefault_frame_alist here.
Richard M. Stallman <rms@gnu.org>
parents: 13498
diff changeset
137 These override values given in window system configuration data,\n\
6a97ea1245b5 (syms_of_frame_1): Set up Vdefault_frame_alist here.
Richard M. Stallman <rms@gnu.org>
parents: 13498
diff changeset
138 including X Windows' defaults database.\n\
6a97ea1245b5 (syms_of_frame_1): Set up Vdefault_frame_alist here.
Richard M. Stallman <rms@gnu.org>
parents: 13498
diff changeset
139 For values specific to the first Emacs frame, see `initial-frame-alist'.\n\
6a97ea1245b5 (syms_of_frame_1): Set up Vdefault_frame_alist here.
Richard M. Stallman <rms@gnu.org>
parents: 13498
diff changeset
140 For values specific to the separate minibuffer frame, see\n\
6a97ea1245b5 (syms_of_frame_1): Set up Vdefault_frame_alist here.
Richard M. Stallman <rms@gnu.org>
parents: 13498
diff changeset
141 `minibuffer-frame-alist'.\n\
6a97ea1245b5 (syms_of_frame_1): Set up Vdefault_frame_alist here.
Richard M. Stallman <rms@gnu.org>
parents: 13498
diff changeset
142 The `menu-bar-lines' element of the list controls whether new frames\n\
6a97ea1245b5 (syms_of_frame_1): Set up Vdefault_frame_alist here.
Richard M. Stallman <rms@gnu.org>
parents: 13498
diff changeset
143 have menu bars; `menu-bar-mode' works by altering this element.");
6a97ea1245b5 (syms_of_frame_1): Set up Vdefault_frame_alist here.
Richard M. Stallman <rms@gnu.org>
parents: 13498
diff changeset
144 Vdefault_frame_alist = Qnil;
12761
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
145 }
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 static void
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
148 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
149 Lisp_Object window;
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
150 int n;
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
151 {
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
152 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
153
13498
c10046894834 (set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
parents: 13412
diff changeset
154 XSETFASTINT (w->last_modified, 0);
12761
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
155 XSETFASTINT (w->top, XFASTINT (w->top) + n);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
156 XSETFASTINT (w->height, XFASTINT (w->height) - n);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
157
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
158 /* 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
159 if (!NILP (w->vchild))
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
160 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
161
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
162 /* 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
163 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
164 {
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
165 w = XWINDOW (window);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
166 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
167 }
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
168 }
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
169
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
170 static void
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
171 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
172 struct frame *f;
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
173 Lisp_Object value, oldval;
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
174 {
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
175 int nlines;
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
176 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
177
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
178 /* 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
179 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
180 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
181 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
182 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
183 return;
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
184
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
185 if (INTEGERP (value))
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
186 nlines = XINT (value);
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
187 else
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
188 nlines = 0;
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
189
13498
c10046894834 (set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
parents: 13412
diff changeset
190 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
191 {
c10046894834 (set_menu_bar_lines): Record the fact that the window configuration changes.
Richard M. Stallman <rms@gnu.org>
parents: 13412
diff changeset
192 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
193 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
194 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
195 set_menu_bar_lines_1 (f->root_window, 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
196 }
12761
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
197 }
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
198
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
199 #include "buffer.h"
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
200
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
201 /* These help us bind and responding to switch-frame events. */
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
202 #include "commands.h"
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
203 #include "keyboard.h"
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
204
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
205 Lisp_Object Vemacs_iconified;
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
206 Lisp_Object Vframe_list;
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
207
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
208 extern Lisp_Object Vminibuffer_list;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
209 extern Lisp_Object get_minibuffer ();
5172
9aa201005b16 (Fhandle_switch_frame, Fredirect_frame_focus): Declared.
Richard M. Stallman <rms@gnu.org>
parents: 5105
diff changeset
210 extern Lisp_Object Fhandle_switch_frame ();
9aa201005b16 (Fhandle_switch_frame, Fredirect_frame_focus): Declared.
Richard M. Stallman <rms@gnu.org>
parents: 5105
diff changeset
211 extern Lisp_Object Fredirect_frame_focus ();
12005
4a722a97c8d3 Declare x_get_focus_frame.
Karl Heuer <kwzh@gnu.org>
parents: 11906
diff changeset
212 extern Lisp_Object x_get_focus_frame ();
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
213
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
214 DEFUN ("framep", Fframep, Sframep, 1, 1, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
215 "Return non-nil if OBJECT is a frame.\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
216 Value is t for a termcap frame (a character-only terminal),\n\
9572
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 9309
diff changeset
217 `x' for an Emacs frame that is really an X window,\n\
b36d5e88cccc *** empty log message ***
Morten Welinder <terra@diku.dk>
parents: 9309
diff changeset
218 `pc' for a direct-write MS-DOS frame.\n\
10851
8064f933eed7 (Fframep): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 10783
diff changeset
219 See also `frame-live-p'.")
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
220 (object)
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
221 Lisp_Object object;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
222 {
9127
0b4836daa8e1 (Fframep, make_frame_without_minibuffer, do_switch_frame, prev_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9032
diff changeset
223 if (!FRAMEP (object))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
224 return Qnil;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
225 switch (XFRAME (object)->output_method)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
226 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
227 case output_termcap:
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
228 return Qt;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
229 case output_x_window:
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
230 return Qx;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16568
diff changeset
231 case output_w32:
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16568
diff changeset
232 return Qw32;
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
233 case output_msdos_raw:
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
234 return Qpc;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
235 default:
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
236 abort ();
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
237 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
238 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
239
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
240 DEFUN ("frame-live-p", Fframe_live_p, Sframe_live_p, 1, 1, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
241 "Return non-nil if OBJECT is a frame which has not been deleted.\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
242 Value is nil if OBJECT is not a live frame. If object is a live\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
243 frame, the return value indicates what sort of output device it is\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
244 displayed on. Value is t for a termcap frame (a character-only\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
245 terminal), `x' for an Emacs frame being displayed in an X window.")
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
246 (object)
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
247 Lisp_Object object;
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
248 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
249 return ((FRAMEP (object)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
250 && FRAME_LIVE_P (XFRAME (object)))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
251 ? Fframep (object)
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
252 : Qnil);
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
253 }
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
254
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
255 struct frame *
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
256 make_frame (mini_p)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
257 int mini_p;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
258 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
259 Lisp_Object frame;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
260 register struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
261 register Lisp_Object root_window;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
262 register Lisp_Object mini_window;
9972
92b33538b36a (make_frame): Use allocate_vectorlike and VECSIZE.
Karl Heuer <kwzh@gnu.org>
parents: 9901
diff changeset
263 register struct Lisp_Vector *vec;
92b33538b36a (make_frame): Use allocate_vectorlike and VECSIZE.
Karl Heuer <kwzh@gnu.org>
parents: 9901
diff changeset
264 int i;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
265
9972
92b33538b36a (make_frame): Use allocate_vectorlike and VECSIZE.
Karl Heuer <kwzh@gnu.org>
parents: 9901
diff changeset
266 vec = allocate_vectorlike ((EMACS_INT) VECSIZE (struct frame));
92b33538b36a (make_frame): Use allocate_vectorlike and VECSIZE.
Karl Heuer <kwzh@gnu.org>
parents: 9901
diff changeset
267 for (i = 0; i < VECSIZE (struct frame); i++)
92b33538b36a (make_frame): Use allocate_vectorlike and VECSIZE.
Karl Heuer <kwzh@gnu.org>
parents: 9901
diff changeset
268 XSETFASTINT (vec->contents[i], 0);
92b33538b36a (make_frame): Use allocate_vectorlike and VECSIZE.
Karl Heuer <kwzh@gnu.org>
parents: 9901
diff changeset
269 vec->size = VECSIZE (struct frame);
92b33538b36a (make_frame): Use allocate_vectorlike and VECSIZE.
Karl Heuer <kwzh@gnu.org>
parents: 9901
diff changeset
270 f = (struct frame *)vec;
92b33538b36a (make_frame): Use allocate_vectorlike and VECSIZE.
Karl Heuer <kwzh@gnu.org>
parents: 9901
diff changeset
271 XSETFRAME (frame, f);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
272
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
273 f->cursor_x = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
274 f->cursor_y = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
275 f->current_glyphs = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
276 f->desired_glyphs = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
277 f->visible = 0;
1652
93497cd89204 * frame.c (make_frame): Initialize async_visible and
Jim Blandy <jimb@redhat.com>
parents: 1514
diff changeset
278 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
279 f->output_data.nothing = 0;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
280 f->iconified = 0;
1652
93497cd89204 * frame.c (make_frame): Initialize async_visible and
Jim Blandy <jimb@redhat.com>
parents: 1514
diff changeset
281 f->async_iconified = 0;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
282 f->wants_modeline = 1;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
283 f->auto_raise = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
284 f->auto_lower = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
285 f->no_split = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
286 f->garbaged = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
287 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
288 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
289 f->explicit_name = 0;
1989
b1c1ab20f810 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1920
diff changeset
290 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
291 f->vertical_scroll_bar_type = vertical_scroll_bar_none;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
292 f->param_alist = Qnil;
1989
b1c1ab20f810 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1920
diff changeset
293 f->scroll_bars = Qnil;
b1c1ab20f810 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1920
diff changeset
294 f->condemned_scroll_bars = Qnil;
2417
8c07933beed9 (make_frame): Init face_alist field.
Richard M. Stallman <rms@gnu.org>
parents: 2298
diff changeset
295 f->face_alist = Qnil;
6130
d4e5878462cb (make_frame): Init menu_bar_items field to 0.
Richard M. Stallman <rms@gnu.org>
parents: 6054
diff changeset
296 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
297 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
298 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
299 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
300 f->buffer_list = Qnil;
11017
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
301 #ifdef MULTI_KBOARD
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
302 f->kboard = initial_kboard;
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
303 #endif
14303
48e3ee5005cd (make_frame): Initialize title parameter to Qnil.
Karl Heuer <kwzh@gnu.org>
parents: 14223
diff changeset
304 f->namebuf = 0;
14223
596bb10704dd (make_frame): Initialize frame title field to nil.
Erik Naggum <erik@naggum.no>
parents: 14217
diff changeset
305 f->title = Qnil;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
306
987
afb21e974ed2 * frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents: 965
diff changeset
307 root_window = make_window ();
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
308 if (mini_p)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
309 {
987
afb21e974ed2 * frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents: 965
diff changeset
310 mini_window = make_window ();
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
311 XWINDOW (root_window)->next = mini_window;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
312 XWINDOW (mini_window)->prev = root_window;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
313 XWINDOW (mini_window)->mini_p = Qt;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
314 XWINDOW (mini_window)->frame = frame;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
315 f->minibuffer_window = mini_window;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
316 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
317 else
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
318 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
319 mini_window = Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
320 XWINDOW (root_window)->next = Qnil;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
321 f->minibuffer_window = Qnil;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
322 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
323
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
324 XWINDOW (root_window)->frame = frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
325
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
326 /* 10 is arbitrary,
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
327 just so that there is "something there."
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
328 Correct size will be set up later with change_frame_size. */
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
329
16263
a369af16e836 (make_frame): Switch from boolean `has_vertical_scrollbars' integer to
Richard M. Stallman <rms@gnu.org>
parents: 16184
diff changeset
330 SET_FRAME_WIDTH (f, 10);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
331 f->height = 10;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
332
9309
27370f65dfa1 (make_frame, Fframe_parameters, Fselected_frame, syms_of_frame): Don't use
Karl Heuer <kwzh@gnu.org>
parents: 9268
diff changeset
333 XSETFASTINT (XWINDOW (root_window)->width, 10);
27370f65dfa1 (make_frame, Fframe_parameters, Fselected_frame, syms_of_frame): Don't use
Karl Heuer <kwzh@gnu.org>
parents: 9268
diff changeset
334 XSETFASTINT (XWINDOW (root_window)->height, (mini_p ? 9 : 10));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
335
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
336 if (mini_p)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
337 {
9309
27370f65dfa1 (make_frame, Fframe_parameters, Fselected_frame, syms_of_frame): Don't use
Karl Heuer <kwzh@gnu.org>
parents: 9268
diff changeset
338 XSETFASTINT (XWINDOW (mini_window)->width, 10);
27370f65dfa1 (make_frame, Fframe_parameters, Fselected_frame, syms_of_frame): Don't use
Karl Heuer <kwzh@gnu.org>
parents: 9268
diff changeset
339 XSETFASTINT (XWINDOW (mini_window)->top, 9);
27370f65dfa1 (make_frame, Fframe_parameters, Fselected_frame, syms_of_frame): Don't use
Karl Heuer <kwzh@gnu.org>
parents: 9268
diff changeset
340 XSETFASTINT (XWINDOW (mini_window)->height, 1);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
341 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
342
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
343 /* Choose a buffer for the frame's root window. */
386
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
344 {
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
345 Lisp_Object buf;
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
346
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
347 XWINDOW (root_window)->buffer = Qt;
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
348 buf = Fcurrent_buffer ();
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
349 /* If buf is a 'hidden' buffer (i.e. one whose name starts with
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
350 a space), try to find another one. */
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
351 if (XSTRING (Fbuffer_name (buf))->data[0] == ' ')
1346
5e27c3e71a78 (make_frame): Pass 2nd arg to Fother_buffer.
Richard M. Stallman <rms@gnu.org>
parents: 1260
diff changeset
352 buf = Fother_buffer (buf, Qnil);
386
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
353 Fset_window_buffer (root_window, buf);
17221
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
354
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
355 f->buffer_list = Fcons (buf, Qnil);
386
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
356 }
6acd2a203aa8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 363
diff changeset
357
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
358 if (mini_p)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
359 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
360 XWINDOW (mini_window)->buffer = Qt;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
361 Fset_window_buffer (mini_window,
485
8c615e453683 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 454
diff changeset
362 (NILP (Vminibuffer_list)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
363 ? get_minibuffer (0)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
364 : Fcar (Vminibuffer_list)));
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
365 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
366
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
367 f->root_window = root_window;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
368 f->selected_window = root_window;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
369 /* Make sure this window seems more recently used than
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
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
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
372
17032
814257735e7d Include "charset.h"
Karl Heuer <kwzh@gnu.org>
parents: 16588
diff changeset
373 #ifdef HAVE_WINDOW_SYSTEM
814257735e7d Include "charset.h"
Karl Heuer <kwzh@gnu.org>
parents: 16588
diff changeset
374 f->fontset_data = alloc_fontset_data ();
814257735e7d Include "charset.h"
Karl Heuer <kwzh@gnu.org>
parents: 16588
diff changeset
375 #endif
814257735e7d Include "charset.h"
Karl Heuer <kwzh@gnu.org>
parents: 16588
diff changeset
376
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
377 return f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
378 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
379
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
380 /* Make a frame using a separate minibuffer window on another frame.
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
381 MINI_WINDOW is the minibuffer window to use. nil means use the
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
382 default (the global minibuffer). */
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
383
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
384 struct frame *
12010
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
385 make_frame_without_minibuffer (mini_window, kb, display)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
386 register Lisp_Object mini_window;
11775
fe7852953b75 (make_frame_without_minibuffer): New arg KB.
Karl Heuer <kwzh@gnu.org>
parents: 11773
diff changeset
387 KBOARD *kb;
12010
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
388 Lisp_Object display;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
389 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
390 register struct frame *f;
15555
5ceed3aa6a1c (make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents: 15396
diff changeset
391 struct gcpro gcpro1;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
392
12010
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
393 if (!NILP (mini_window))
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
394 CHECK_LIVE_WINDOW (mini_window, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
395
11775
fe7852953b75 (make_frame_without_minibuffer): New arg KB.
Karl Heuer <kwzh@gnu.org>
parents: 11773
diff changeset
396 #ifdef MULTI_KBOARD
12010
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
397 if (!NILP (mini_window)
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
398 && 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
399 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
400 #endif
fe7852953b75 (make_frame_without_minibuffer): New arg KB.
Karl Heuer <kwzh@gnu.org>
parents: 11773
diff changeset
401
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
402 /* Make a frame containing just a root window. */
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
403 f = make_frame (0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
404
12010
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
405 if (NILP (mini_window))
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
406 {
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
407 /* Use default-minibuffer-frame if possible. */
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
408 if (!FRAMEP (kb->Vdefault_minibuffer_frame)
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
409 || ! 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
410 {
15555
5ceed3aa6a1c (make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents: 15396
diff changeset
411 Lisp_Object frame_dummy;
5ceed3aa6a1c (make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents: 15396
diff changeset
412
5ceed3aa6a1c (make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents: 15396
diff changeset
413 XSETFRAME (frame_dummy, f);
5ceed3aa6a1c (make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents: 15396
diff changeset
414 GCPRO1 (frame_dummy);
12010
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
415 /* 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
416 kb->Vdefault_minibuffer_frame =
5ceed3aa6a1c (make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents: 15396
diff changeset
417 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
418 UNGCPRO;
12010
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
419 }
15555
5ceed3aa6a1c (make_frame_without_minibuffer): GCPRO the frame f.
Richard M. Stallman <rms@gnu.org>
parents: 15396
diff changeset
420
12010
57eb365d32f0 (make_frame_without_minibuffer): New arg DISPLAY.
Karl Heuer <kwzh@gnu.org>
parents: 12006
diff changeset
421 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
422 }
15001
c74ce6421d04 (make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents: 14966
diff changeset
423
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
424 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
425
c74ce6421d04 (make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents: 14966
diff changeset
426 /* 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
427 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
428 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
429 Fset_window_buffer (mini_window,
c74ce6421d04 (make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents: 14966
diff changeset
430 (NILP (Vminibuffer_list)
c74ce6421d04 (make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents: 14966
diff changeset
431 ? get_minibuffer (0)
c74ce6421d04 (make_frame_without_minibuffer): Don't change the
Richard M. Stallman <rms@gnu.org>
parents: 14966
diff changeset
432 : Fcar (Vminibuffer_list)));
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
433 return f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
434 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
435
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
436 /* Make a frame containing only a minibuffer window. */
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
437
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
438 struct frame *
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
439 make_minibuffer_frame ()
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
440 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
441 /* First make a frame containing just a root window, no minibuffer. */
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
442
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
443 register struct frame *f = make_frame (0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
444 register Lisp_Object mini_window;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
445 register Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
446
9268
cb55d0155265 (make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9214
diff changeset
447 XSETFRAME (frame, f);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
448
1006
a13ee72d74a2 * frame.c (make_frame): Clear the explicit_name member of the new
Jim Blandy <jimb@redhat.com>
parents: 987
diff changeset
449 f->auto_raise = 0;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
450 f->auto_lower = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
451 f->no_split = 1;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
452 f->wants_modeline = 0;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
453 f->has_minibuffer = 1;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
454
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
455 /* Now label the root window as also being the minibuffer.
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
456 Avoid infinite looping on the window chain by marking next pointer
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
457 as nil. */
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
458
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
459 mini_window = f->minibuffer_window = f->root_window;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
460 XWINDOW (mini_window)->mini_p = Qt;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
461 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
462 XWINDOW (mini_window)->prev = Qnil;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
463 XWINDOW (mini_window)->frame = frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
464
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
465 /* Put the proper buffer in that window. */
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
466
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
467 Fset_window_buffer (mini_window,
485
8c615e453683 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 454
diff changeset
468 (NILP (Vminibuffer_list)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
469 ? get_minibuffer (0)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
470 : Fcar (Vminibuffer_list)));
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
471 return f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
472 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
473
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
474 /* Construct a frame that refers to the terminal (stdin and stdout). */
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
475
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
476 static int terminal_frame_count;
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
477
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
478 struct frame *
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
479 make_terminal_frame ()
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
480 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
481 register struct frame *f;
5231
6646271e8d32 (make_terminal_frame): Add frame to Vframe_list.
Richard M. Stallman <rms@gnu.org>
parents: 5172
diff changeset
482 Lisp_Object frame;
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
483 char name[20];
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
484
11017
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
485 #ifdef MULTI_KBOARD
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
486 if (!initial_kboard)
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
487 {
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
488 initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
489 init_kboard (initial_kboard);
11364
9c609a5bd245 (make_terminal_frame): all_kboards means initial_kboard too.
Karl Heuer <kwzh@gnu.org>
parents: 11355
diff changeset
490 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
491 all_kboards = initial_kboard;
11017
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
492 }
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
493 #endif
f7c4ece024d5 (make_frame): Initialize kboard member.
Karl Heuer <kwzh@gnu.org>
parents: 10853
diff changeset
494
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
495 /* The first call must initialize Vframe_list. */
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
496 if (! (NILP (Vframe_list) || CONSP (Vframe_list)))
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
497 Vframe_list = Qnil;
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
498
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
499 f = make_frame (1);
5231
6646271e8d32 (make_terminal_frame): Add frame to Vframe_list.
Richard M. Stallman <rms@gnu.org>
parents: 5172
diff changeset
500
9268
cb55d0155265 (make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9214
diff changeset
501 XSETFRAME (frame, f);
5231
6646271e8d32 (make_terminal_frame): Add frame to Vframe_list.
Richard M. Stallman <rms@gnu.org>
parents: 5172
diff changeset
502 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
503
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
504 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
505 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
506 f->name = build_string (name);
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
507
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
508 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
509 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
510 #ifdef MSDOS
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
511 f->output_data.x = &the_only_x_display;
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
512 f->output_method = output_msdos_raw;
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
513 init_frame_faces (f);
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
514 #else /* not MSDOS */
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12630
diff changeset
515 f->output_data.nothing = 1; /* Nonzero means frame isn't deleted. */
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
516 #endif
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
517 return f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
518 }
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
519
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
520 DEFUN ("make-terminal-frame", Fmake_terminal_frame, Smake_terminal_frame,
10783
bb2d929daaa3 (Fmake_terminal_frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 10768
diff changeset
521 1, 1, 0, "Create an additional terminal frame.\n\
bb2d929daaa3 (Fmake_terminal_frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 10768
diff changeset
522 You can create multiple frames on a text-only terminal in this way.\n\
bb2d929daaa3 (Fmake_terminal_frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 10768
diff changeset
523 Only the selected terminal frame is actually displayed.\n\
bb2d929daaa3 (Fmake_terminal_frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 10768
diff changeset
524 This function takes one argument, an alist specifying frame parameters.\n\
bb2d929daaa3 (Fmake_terminal_frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 10768
diff changeset
525 In practice, generally you don't need to specify any parameters.\n\
bb2d929daaa3 (Fmake_terminal_frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 10768
diff changeset
526 Note that changing the size of one terminal frame automatically affects all.")
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
527 (parms)
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
528 Lisp_Object parms;
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
529 {
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
530 struct frame *f;
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
531 Lisp_Object frame;
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
532
15392
ac7e878c5526 (Fmake_terminal_frame): Test MSDOS, not __MSDOS__.
Richard M. Stallman <rms@gnu.org>
parents: 15391
diff changeset
533 #ifdef MSDOS
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
534 if (selected_frame->output_method != output_msdos_raw)
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
535 abort ();
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
536 #else
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
537 if (selected_frame->output_method != output_termcap)
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
538 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
539 #endif
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
540
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
541 f = make_terminal_frame ();
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
542 change_frame_size (f, FRAME_HEIGHT (selected_frame),
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
543 FRAME_WIDTH (selected_frame), 0, 0);
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
544 remake_frame_glyphs (f);
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
545 calculate_costs (f);
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
546 XSETFRAME (frame, f);
16184
ca018789eb73 (Fmake_terminal_frame): Use Vdefault_frame_alist.
Richard M. Stallman <rms@gnu.org>
parents: 16112
diff changeset
547 Fmodify_frame_parameters (frame, Vdefault_frame_alist);
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
548 Fmodify_frame_parameters (frame, parms);
12722
ed5de994fa90 (Fmake_terminal_frame): Copy face_alist from selected frame.
Richard M. Stallman <rms@gnu.org>
parents: 12667
diff changeset
549 f->face_alist = selected_frame->face_alist;
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
550 return frame;
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
551 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
552
12286
723569a0028c (Fdelete_frame): Use do_switch_frame directly.
Richard M. Stallman <rms@gnu.org>
parents: 12283
diff changeset
553 Lisp_Object
6486
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
554 do_switch_frame (frame, no_enter, track)
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
555 Lisp_Object frame, 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
556 int track;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
557 {
1385
a4a205bdd2c1 * frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents: 1346
diff changeset
558 /* 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
559 switch to. */
a4a205bdd2c1 * frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents: 1346
diff changeset
560 if (CONSP (frame)
a4a205bdd2c1 * frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents: 1346
diff changeset
561 && EQ (XCONS (frame)->car, Qswitch_frame)
a4a205bdd2c1 * frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents: 1346
diff changeset
562 && CONSP (XCONS (frame)->cdr))
a4a205bdd2c1 * frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents: 1346
diff changeset
563 frame = XCONS (XCONS (frame)->cdr)->car;
a4a205bdd2c1 * frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents: 1346
diff changeset
564
6352
6f48bd9145f9 (Fhandle_switch_frame): Ignore switch to dead frame.
Karl Heuer <kwzh@gnu.org>
parents: 6346
diff changeset
565 /* 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
566 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
567 especially when deleting the initial frame during startup. */
6f48bd9145f9 (Fhandle_switch_frame): Ignore switch to dead frame.
Karl Heuer <kwzh@gnu.org>
parents: 6346
diff changeset
568 CHECK_FRAME (frame, 0);
6f48bd9145f9 (Fhandle_switch_frame): Ignore switch to dead frame.
Karl Heuer <kwzh@gnu.org>
parents: 6346
diff changeset
569 if (! FRAME_LIVE_P (XFRAME (frame)))
6f48bd9145f9 (Fhandle_switch_frame): Ignore switch to dead frame.
Karl Heuer <kwzh@gnu.org>
parents: 6346
diff changeset
570 return Qnil;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
571
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
572 if (selected_frame == XFRAME (frame))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
573 return frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
574
6486
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
575 /* 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
576 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
577 #if 0
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
578 /* 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
579 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
580 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
581 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
582 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
583 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
584 around. */
6486
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
585 if (track)
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
586 {
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
587 Lisp_Object tail;
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
588
6486
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
589 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
590 {
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
591 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
592
9127
0b4836daa8e1 (Fframep, make_frame_without_minibuffer, do_switch_frame, prev_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9032
diff changeset
593 if (!FRAMEP (XCONS (tail)->car))
6486
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
594 abort ();
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
595
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
596 focus = FRAME_FOCUS_FRAME (XFRAME (XCONS (tail)->car));
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
597
9127
0b4836daa8e1 (Fframep, make_frame_without_minibuffer, do_switch_frame, prev_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9032
diff changeset
598 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
599 Fredirect_frame_focus (XCONS (tail)->car, frame);
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
600 }
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
601 }
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
602 #else /* ! 0 */
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
603 /* 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
604 #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
605 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
606 {
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
607 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
608
11529
5beffe62d4ef (do_switch_frame): x_get_focus_frame needs an arg.
Karl Heuer <kwzh@gnu.org>
parents: 11495
diff changeset
609 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
610 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
611 {
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
612 focus = FRAME_FOCUS_FRAME (XFRAME (xfocus));
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
613 if (FRAMEP (focus) && XFRAME (focus) == selected_frame)
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
614 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
615 }
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
616 }
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
617 #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
618 #endif /* ! 0 */
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
619
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
620 selected_frame = XFRAME (frame);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
621 if (! FRAME_MINIBUF_ONLY_P (selected_frame))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
622 last_nonminibuf_frame = selected_frame;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
623
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
624 Fselect_window (XFRAME (frame)->selected_window);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
625
1920
ac5e559a819a * frame.c (Fselect_frame): Set Vlast_event_frame to Qnil after
Jim Blandy <jimb@redhat.com>
parents: 1870
diff changeset
626 /* 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
627 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
628 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
629 (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
630 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
631 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
632 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
633
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
634 return frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
635 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
636
6486
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
637 DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 2, "e",
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
638 "Select the frame FRAME.\n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
639 Subsequent editing commands apply to its selected window.\n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
640 The selection of FRAME lasts until the next time the user does\n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
641 something to select a different frame, or until the next time this\n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
642 function is called.")
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
643 (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
644 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
645 {
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
646 return do_switch_frame (frame, no_enter, 1);
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
647 }
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
648
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
649
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
650 DEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 2, "e",
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
651 "Handle a switch-frame event EVENT.\n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
652 Switch-frame events are usually bound to this function.\n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
653 A switch-frame event tells Emacs that the window manager has requested\n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
654 that the user's events be directed to the frame mentioned in the event.\n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
655 This function selects the selected window of the frame of EVENT.\n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
656 \n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
657 If EVENT is frame object, handle it as if it were a switch-frame event\n\
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
658 to that frame.")
14077
a6d3ce4a2f8e (Fhandle_switch_frame, Fset_frame_height): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents: 13748
diff changeset
659 (event, no_enter)
a6d3ce4a2f8e (Fhandle_switch_frame, Fset_frame_height): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents: 13748
diff changeset
660 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
661 {
12255
41083bd094ac (Fhandle_switch_frame): Preserve prefix arg.
Karl Heuer <kwzh@gnu.org>
parents: 12222
diff changeset
662 /* 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
663 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
664 call1 (Vrun_hooks, Qmouse_leave_buffer_hook);
14077
a6d3ce4a2f8e (Fhandle_switch_frame, Fset_frame_height): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents: 13748
diff changeset
665 return do_switch_frame (event, no_enter, 0);
6486
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
666 }
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
667
12283
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
668 DEFUN ("ignore-event", Fignore_event, Signore_event, 0, 0, "",
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
669 "Do nothing, but preserve any prefix argument already specified.\n\
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
670 This is a suitable binding for iconify-frame and make-frame-visible.")
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
671 ()
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
672 {
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
673 current_kboard->Vprefix_arg = Vcurrent_prefix_arg;
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
674 return Qnil;
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
675 }
6486
5012ae9c6075 (do_switch_frame): Common code for Fselect_frame and handle_switch_frame.
Karl Heuer <kwzh@gnu.org>
parents: 6355
diff changeset
676
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
677 DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
678 "Return the frame that is now selected.")
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
679 ()
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
680 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
681 Lisp_Object tem;
9268
cb55d0155265 (make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9214
diff changeset
682 XSETFRAME (tem, selected_frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
683 return tem;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
684 }
7055
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
685
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
686 DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
687 "Return the frame object that window WINDOW is on.")
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
688 (window)
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
689 Lisp_Object window;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
690 {
1437
36ef55ecb265 * frame.c (make_frame_without_minibuffer, Fwindow_frame): Use
Jim Blandy <jimb@redhat.com>
parents: 1385
diff changeset
691 CHECK_LIVE_WINDOW (window, 0);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
692 return XWINDOW (window)->frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
693 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
694
6527
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
695 DEFUN ("frame-first-window", Fframe_first_window, Sframe_first_window, 0, 1, 0,
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
696 "Returns the topmost, leftmost window of FRAME.\n\
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
697 If omitted, FRAME defaults to the currently selected frame.")
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
698 (frame)
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
699 Lisp_Object frame;
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
700 {
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
701 Lisp_Object w;
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
702
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
703 if (NILP (frame))
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
704 w = selected_frame->root_window;
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
705 else
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
706 {
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
707 CHECK_LIVE_FRAME (frame, 0);
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
708 w = XFRAME (frame)->root_window;
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
709 }
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
710 while (NILP (XWINDOW (w)->buffer))
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
711 {
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
712 if (! NILP (XWINDOW (w)->hchild))
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
713 w = XWINDOW (w)->hchild;
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
714 else if (! NILP (XWINDOW (w)->vchild))
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
715 w = XWINDOW (w)->vchild;
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
716 else
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
717 abort ();
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
718 }
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
719 return w;
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
720 }
ab9f20a3f502 (Fframe_first_window): New function.
Karl Heuer <kwzh@gnu.org>
parents: 6500
diff changeset
721
11169
d0550c056e5b [MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 11126
diff changeset
722 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
723 Sactive_minibuffer_window, 0, 0, 0,
d0550c056e5b [MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 11126
diff changeset
724 "Return the currently active minibuffer window, or nil if none.")
d0550c056e5b [MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 11126
diff changeset
725 ()
d0550c056e5b [MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 11126
diff changeset
726 {
d0550c056e5b [MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 11126
diff changeset
727 return minibuf_level ? minibuf_window : Qnil;
d0550c056e5b [MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 11126
diff changeset
728 }
d0550c056e5b [MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 11126
diff changeset
729
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
730 DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0,
1251
4e556fda7a4d * frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents: 1118
diff changeset
731 "Returns the root-window of FRAME.\n\
4e556fda7a4d * frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents: 1118
diff changeset
732 If omitted, FRAME defaults to the currently selected frame.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
733 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
734 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
735 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
736 if (NILP (frame))
9268
cb55d0155265 (make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9214
diff changeset
737 XSETFRAME (frame, selected_frame);
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
738 else
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
739 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
740
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
741 return XFRAME (frame)->root_window;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
742 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
743
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
744 DEFUN ("frame-selected-window", Fframe_selected_window,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
745 Sframe_selected_window, 0, 1, 0,
1251
4e556fda7a4d * frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents: 1118
diff changeset
746 "Return the selected window of frame object FRAME.\n\
4e556fda7a4d * frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents: 1118
diff changeset
747 If omitted, FRAME defaults to the currently selected frame.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
748 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
749 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
750 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
751 if (NILP (frame))
9268
cb55d0155265 (make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9214
diff changeset
752 XSETFRAME (frame, selected_frame);
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
753 else
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
754 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
755
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
756 return XFRAME (frame)->selected_window;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
757 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
758
7055
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
759 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
760 Sset_frame_selected_window, 2, 2, 0,
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
761 "Set the selected window of frame object FRAME to WINDOW.\n\
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
762 If FRAME is nil, the selected frame is used.\n\
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
763 If FRAME is the selected frame, this makes WINDOW the selected window.")
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
764 (frame, window)
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
765 Lisp_Object frame, window;
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
766 {
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
767 if (NILP (frame))
9268
cb55d0155265 (make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9214
diff changeset
768 XSETFRAME (frame, selected_frame);
7055
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
769 else
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
770 CHECK_LIVE_FRAME (frame, 0);
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
771
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
772 CHECK_LIVE_WINDOW (window, 1);
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
773
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
774 if (! EQ (frame, WINDOW_FRAME (XWINDOW (window))))
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
775 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
776
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
777 if (XFRAME (frame) == selected_frame)
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
778 return Fselect_window (window);
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
779
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
780 return XFRAME (frame)->selected_window = window;
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
781 }
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
782
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
783 DEFUN ("frame-list", Fframe_list, Sframe_list,
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
784 0, 0, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
785 "Return a list of all frames.")
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
786 ()
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
787 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
788 return Fcopy_sequence (Vframe_list);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
789 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
790
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
791 /* Return the next frame in the frame list after FRAME.
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
792 If MINIBUF is nil, exclude minibuffer-only frames.
8168
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
793 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
794 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
795 If MINIBUF is `visible', include all visible frames.
8168
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
796 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
797 Otherwise, include all frames. */
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
798
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
799 Lisp_Object
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
800 next_frame (frame, minibuf)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
801 Lisp_Object frame;
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
802 Lisp_Object minibuf;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
803 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
804 Lisp_Object tail;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
805 int passed = 0;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
806
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
807 /* There must always be at least one frame in Vframe_list. */
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
808 if (! CONSP (Vframe_list))
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
809 abort ();
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
810
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
811 /* 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
812 forever. Forestall that. */
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
813 CHECK_LIVE_FRAME (frame, 0);
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
814
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
815 while (1)
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
816 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
817 {
6500
551bff5cffde (next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
parents: 6486
diff changeset
818 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
819
6500
551bff5cffde (next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
parents: 6486
diff changeset
820 f = XCONS (tail)->car;
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
821
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
822 if (passed
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
823 && FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame)))
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
824 {
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
825 /* 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
826
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
827 /* 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
828 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
829 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
830 return f;
335
33aa13a3f279 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 286
diff changeset
831
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
832 /* 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
833 if (NILP (minibuf))
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
834 {
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
835 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
836 return f;
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
837 }
6246
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
838 else if (EQ (minibuf, Qvisible))
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
839 {
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
840 FRAME_SAMPLE_VISIBILITY (XFRAME (f));
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
841 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
842 return f;
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
843 }
8168
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
844 else if (XFASTINT (minibuf) == 0)
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
845 {
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
846 FRAME_SAMPLE_VISIBILITY (XFRAME (f));
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
847 if (FRAME_VISIBLE_P (XFRAME (f))
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
848 || FRAME_ICONIFIED_P (XFRAME (f)))
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
849 return f;
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
850 }
6246
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
851 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
852 {
8168
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
853 if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf)
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
854 /* Check that F either is, or has forwarded its focus to,
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
855 MINIBUF's frame. */
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
856 && (EQ (WINDOW_FRAME (XWINDOW (minibuf)), f)
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
857 || EQ (WINDOW_FRAME (XWINDOW (minibuf)),
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
858 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
859 return f;
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
860 }
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
861 else
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
862 return f;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
863 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
864
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
865 if (EQ (frame, f))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
866 passed++;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
867 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
868 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
869
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
870 /* Return the previous frame in the frame list before FRAME.
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
871 If MINIBUF is nil, exclude minibuffer-only frames.
8168
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
872 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
873 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
874 If MINIBUF is `visible', include all visible frames.
8168
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
875 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
876 Otherwise, include all frames. */
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
877
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
878 Lisp_Object
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
879 prev_frame (frame, minibuf)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
880 Lisp_Object frame;
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
881 Lisp_Object minibuf;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
882 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
883 Lisp_Object tail;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
884 Lisp_Object prev;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
885
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
886 /* There must always be at least one frame in Vframe_list. */
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
887 if (! CONSP (Vframe_list))
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
888 abort ();
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
889
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
890 prev = Qnil;
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
891 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
892 {
6500
551bff5cffde (next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
parents: 6486
diff changeset
893 Lisp_Object f;
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
894
6500
551bff5cffde (next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
parents: 6486
diff changeset
895 f = XCONS (tail)->car;
9127
0b4836daa8e1 (Fframep, make_frame_without_minibuffer, do_switch_frame, prev_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9032
diff changeset
896 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
897 abort ();
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
898
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
899 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
900 return prev;
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
901
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
902 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
903 {
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
904 /* 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
905 according to minibuf. */
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
906 if (NILP (minibuf))
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
907 {
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
908 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
909 prev = f;
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
910 }
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
911 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
912 {
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
913 if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf)
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
914 /* Check that F either is, or has forwarded its focus to,
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
915 MINIBUF's frame. */
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
916 && (EQ (WINDOW_FRAME (XWINDOW (minibuf)), f)
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
917 || EQ (WINDOW_FRAME (XWINDOW (minibuf)),
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
918 FRAME_FOCUS_FRAME (XFRAME (f)))))
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
919 prev = f;
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
920 }
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
921 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
922 {
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
923 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
924 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
925 prev = f;
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
926 }
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
927 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
928 {
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
929 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
930 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
931 || 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
932 prev = f;
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
933 }
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
934 else
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
935 prev = f;
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
936 }
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
937 }
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
938
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
939 /* 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
940 if (NILP (prev))
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
941 /* 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
942 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
943 return frame;
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
944 else
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
945 /* 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
946 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
947 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
948 return prev;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
949 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
950
4424
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
951
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
952 DEFUN ("next-frame", Fnext_frame, Snext_frame, 0, 2, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
953 "Return the next frame in the frame list after FRAME.\n\
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
954 It considers only frames on the same terminal as FRAME.\n\
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
955 By default, skip minibuffer-only frames.\n\
1118
a43d53261506 * frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents: 1006
diff changeset
956 If omitted, FRAME defaults to the selected frame.\n\
4227
b283670201b4 (Fdelete_frame): Allow deletion if there is some other
Richard M. Stallman <rms@gnu.org>
parents: 3970
diff changeset
957 If optional argument MINIFRAME is nil, exclude minibuffer-only frames.\n\
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
958 If MINIFRAME is a window, include only its own frame\n\
8168
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
959 and any frame now using that window as the minibuffer.\n\
6246
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
960 If MINIFRAME is `visible', include all visible frames.\n\
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
961 If MINIFRAME is 0, include all visible and iconified frames.\n\
6246
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
962 Otherwise, include all frames.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
963 (frame, miniframe)
1251
4e556fda7a4d * frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents: 1118
diff changeset
964 Lisp_Object frame, miniframe;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
965 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
966 Lisp_Object tail;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
967
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
968 if (NILP (frame))
9268
cb55d0155265 (make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9214
diff changeset
969 XSETFRAME (frame, selected_frame);
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
970 else
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
971 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
972
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
973 return next_frame (frame, miniframe);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
974 }
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
975
4424
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
976 DEFUN ("previous-frame", Fprevious_frame, Sprevious_frame, 0, 2, 0,
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
977 "Return the previous frame in the frame list before FRAME.\n\
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
978 It considers only frames on the same terminal as FRAME.\n\
4424
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
979 By default, skip minibuffer-only frames.\n\
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
980 If omitted, FRAME defaults to the selected frame.\n\
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
981 If optional argument MINIFRAME is nil, exclude minibuffer-only frames.\n\
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
982 If MINIFRAME is a window, include only its own frame\n\
8168
32fbb27091d4 (next_frame, prev_frame):
Richard M. Stallman <rms@gnu.org>
parents: 8099
diff changeset
983 and any frame now using that window as the minibuffer.\n\
6246
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
984 If MINIFRAME is `visible', include all visible frames.\n\
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
985 If MINIFRAME is 0, include all visible and iconified frames.\n\
6246
128dc040e121 (next_frame, prev_frame): If MINIBUF is `visible',
Richard M. Stallman <rms@gnu.org>
parents: 6157
diff changeset
986 Otherwise, include all frames.")
4424
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
987 (frame, miniframe)
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
988 Lisp_Object frame, miniframe;
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
989 {
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
990 Lisp_Object tail;
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
991
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
992 if (NILP (frame))
9268
cb55d0155265 (make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9214
diff changeset
993 XSETFRAME (frame, selected_frame);
4424
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
994 else
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
995 CHECK_LIVE_FRAME (frame, 0);
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
996
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
997 return prev_frame (frame, miniframe);
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
998 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
999
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1000 /* 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
1001 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
1002 (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
1003
7646
de2c4334fad4 (other_visible_frames): No longer static.
Richard M. Stallman <rms@gnu.org>
parents: 7570
diff changeset
1004 int
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1005 other_visible_frames (f)
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1006 FRAME_PTR f;
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1007 {
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1008 /* 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
1009 so if F is some other frame, it can't be the sole visible one. */
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1010 if (f == selected_frame)
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1011 {
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1012 Lisp_Object frames;
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1013 int count = 0;
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1014
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1015 for (frames = Vframe_list;
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1016 CONSP (frames);
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1017 frames = XCONS (frames)->cdr)
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1018 {
6500
551bff5cffde (next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
parents: 6486
diff changeset
1019 Lisp_Object this;
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1020
6500
551bff5cffde (next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
parents: 6486
diff changeset
1021 this = XCONS (frames)->car;
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1022 /* 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
1023 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
1024 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
1025 #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
1026 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
1027 {
9648
14b1481b7c6d (other_visible_frames): Pass a frame ptr to x_sync.
Richard M. Stallman <rms@gnu.org>
parents: 9572
diff changeset
1028 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
1029 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
1030 }
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1031 #endif
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1032
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1033 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
1034 || 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
1035 /* 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
1036 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
1037 || (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
1038 count++;
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1039 }
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1040 return count > 1;
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1041 }
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1042 return 1;
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1043 }
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1044
4341
d07ef5ea3b58 (Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents: 4227
diff changeset
1045 DEFUN ("delete-frame", Fdelete_frame, Sdelete_frame, 0, 2, "",
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1046 "Delete FRAME, permanently eliminating it from use.\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1047 If omitted, FRAME defaults to the selected frame.\n\
4341
d07ef5ea3b58 (Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents: 4227
diff changeset
1048 A frame may not be deleted if its minibuffer is used by other frames.\n\
d07ef5ea3b58 (Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents: 4227
diff changeset
1049 Normally, you may not delete a frame if all other frames are invisible,\n\
d07ef5ea3b58 (Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents: 4227
diff changeset
1050 but if the second optional argument FORCE is non-nil, you may do so.")
d07ef5ea3b58 (Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents: 4227
diff changeset
1051 (frame, force)
d07ef5ea3b58 (Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents: 4227
diff changeset
1052 Lisp_Object frame, force;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1053 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1054 struct frame *f;
12222
7286ed64badd (Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
parents: 12010
diff changeset
1055 int minibuffer_selected;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1056
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1057 if (EQ (frame, Qnil))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1058 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1059 f = selected_frame;
9268
cb55d0155265 (make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9214
diff changeset
1060 XSETFRAME (frame, f);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1061 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1062 else
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1063 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1064 CHECK_FRAME (frame, 0);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1065 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1066 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1067
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1068 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
1069 return Qnil;
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
1070
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1071 if (NILP (force) && !other_visible_frames (f))
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1072 error ("Attempt to delete the sole visible or iconified frame");
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1073
18945
7f491075707a (Fdelete_frame): Undo previous change.
Richard M. Stallman <rms@gnu.org>
parents: 18698
diff changeset
1074 #if 0
7f491075707a (Fdelete_frame): Undo previous change.
Richard M. Stallman <rms@gnu.org>
parents: 18698
diff changeset
1075 /* 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
1076 to delete the last frame, if it is gone. */
18698
52271ad26a1d (Fdelete_frame): Always err for deleting the only frame.
Richard M. Stallman <rms@gnu.org>
parents: 18380
diff changeset
1077 if (NILP (XCONS (Vframe_list)->cdr))
52271ad26a1d (Fdelete_frame): Always err for deleting the only frame.
Richard M. Stallman <rms@gnu.org>
parents: 18380
diff changeset
1078 error ("Attempt to delete the only frame");
18945
7f491075707a (Fdelete_frame): Undo previous change.
Richard M. Stallman <rms@gnu.org>
parents: 18698
diff changeset
1079 #endif
18698
52271ad26a1d (Fdelete_frame): Always err for deleting the only frame.
Richard M. Stallman <rms@gnu.org>
parents: 18380
diff changeset
1080
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1081 /* Does this frame have a minibuffer, and is it the surrogate
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1082 minibuffer for any other frame? */
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
1083 if (FRAME_HAS_MINIBUF_P (XFRAME (frame)))
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1084 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1085 Lisp_Object frames;
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1086
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1087 for (frames = Vframe_list;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1088 CONSP (frames);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1089 frames = XCONS (frames)->cdr)
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1090 {
6157
9422e430f067 (Fdelete_frame): Don't initialize a Lisp_Object.
Richard M. Stallman <rms@gnu.org>
parents: 6130
diff changeset
1091 Lisp_Object this;
9422e430f067 (Fdelete_frame): Don't initialize a Lisp_Object.
Richard M. Stallman <rms@gnu.org>
parents: 6130
diff changeset
1092 this = XCONS (frames)->car;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1093
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1094 if (! EQ (this, frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1095 && EQ (frame,
6157
9422e430f067 (Fdelete_frame): Don't initialize a Lisp_Object.
Richard M. Stallman <rms@gnu.org>
parents: 6130
diff changeset
1096 WINDOW_FRAME (XWINDOW
9422e430f067 (Fdelete_frame): Don't initialize a Lisp_Object.
Richard M. Stallman <rms@gnu.org>
parents: 6130
diff changeset
1097 (FRAME_MINIBUF_WINDOW (XFRAME (this))))))
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1098 error ("Attempt to delete a surrogate minibuffer frame");
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1099 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1100 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1101
12222
7286ed64badd (Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
parents: 12010
diff changeset
1102 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
1103
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1104 /* Don't let the frame remain selected. */
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1105 if (f == selected_frame)
12379
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1106 {
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1107 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
1108
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1109 /* 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
1110 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
1111
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1112 /* 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
1113 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
1114 {
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1115 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
1116 {
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1117 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
1118 break;
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1119 }
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1120 }
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1121
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1122 do_switch_frame (frame1, Qnil, 0);
7149fc03ea56 (next_frame, prev_frame): Consider only frames on same kbd.
Richard M. Stallman <rms@gnu.org>
parents: 12286
diff changeset
1123 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1124
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1125 /* Don't allow minibuf_window to remain on a deleted frame. */
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1126 if (EQ (f->minibuffer_window, minibuf_window))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1127 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1128 Fset_window_buffer (selected_frame->minibuffer_window,
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1129 XWINDOW (minibuf_window)->buffer);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1130 minibuf_window = selected_frame->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
1131
7286ed64badd (Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
parents: 12010
diff changeset
1132 /* 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
1133 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
1134 if (minibuffer_selected)
7286ed64badd (Fdelete_frame): If the minibuf window was selected, make that remain so.
Richard M. Stallman <rms@gnu.org>
parents: 12010
diff changeset
1135 Fselect_window (minibuf_window);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1136 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1137
8099
a06382fd175d (Fdelete_frame): Call x_clear_frame_selections.
Richard M. Stallman <rms@gnu.org>
parents: 8054
diff changeset
1138 /* 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
1139 #ifdef HAVE_X_WINDOWS
a06382fd175d (Fdelete_frame): Call x_clear_frame_selections.
Richard M. Stallman <rms@gnu.org>
parents: 8054
diff changeset
1140 if (FRAME_X_P (f))
a06382fd175d (Fdelete_frame): Call x_clear_frame_selections.
Richard M. Stallman <rms@gnu.org>
parents: 8054
diff changeset
1141 x_clear_frame_selections (f);
a06382fd175d (Fdelete_frame): Call x_clear_frame_selections.
Richard M. Stallman <rms@gnu.org>
parents: 8054
diff changeset
1142 #endif
a06382fd175d (Fdelete_frame): Call x_clear_frame_selections.
Richard M. Stallman <rms@gnu.org>
parents: 8054
diff changeset
1143
1680
ea9f3949f153 * frame.c (Fdelete_frame): Delete all the windows in the frame's
Jim Blandy <jimb@redhat.com>
parents: 1652
diff changeset
1144 /* 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
1145 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
1146 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
1147 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
1148
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1149 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
1150 FRAME_SET_VISIBLE (f, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1151
18380
d515bf202434 (Fdelete_frame): Clear echo_area_glyphs if it was in this frame.
Richard M. Stallman <rms@gnu.org>
parents: 17857
diff changeset
1152 if (echo_area_glyphs == FRAME_MESSAGE_BUF (f))
d515bf202434 (Fdelete_frame): Clear echo_area_glyphs if it was in this frame.
Richard M. Stallman <rms@gnu.org>
parents: 17857
diff changeset
1153 {
d515bf202434 (Fdelete_frame): Clear echo_area_glyphs if it was in this frame.
Richard M. Stallman <rms@gnu.org>
parents: 17857
diff changeset
1154 echo_area_glyphs = 0;
d515bf202434 (Fdelete_frame): Clear echo_area_glyphs if it was in this frame.
Richard M. Stallman <rms@gnu.org>
parents: 17857
diff changeset
1155 previous_echo_glyphs = 0;
d515bf202434 (Fdelete_frame): Clear echo_area_glyphs if it was in this frame.
Richard M. Stallman <rms@gnu.org>
parents: 17857
diff changeset
1156 }
d515bf202434 (Fdelete_frame): Clear echo_area_glyphs if it was in this frame.
Richard M. Stallman <rms@gnu.org>
parents: 17857
diff changeset
1157
11495
da1a40d86231 (Fdelete_frame): Free f->namebuf.
Karl Heuer <kwzh@gnu.org>
parents: 11494
diff changeset
1158 if (f->namebuf)
da1a40d86231 (Fdelete_frame): Free f->namebuf.
Karl Heuer <kwzh@gnu.org>
parents: 11494
diff changeset
1159 free (f->namebuf);
8666
844edbc22875 (Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents: 8586
diff changeset
1160 if (FRAME_CURRENT_GLYPHS (f))
844edbc22875 (Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents: 8586
diff changeset
1161 free_frame_glyphs (f, FRAME_CURRENT_GLYPHS (f));
844edbc22875 (Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents: 8586
diff changeset
1162 if (FRAME_DESIRED_GLYPHS (f))
844edbc22875 (Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents: 8586
diff changeset
1163 free_frame_glyphs (f, FRAME_DESIRED_GLYPHS (f));
844edbc22875 (Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents: 8586
diff changeset
1164 if (FRAME_TEMP_GLYPHS (f))
844edbc22875 (Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents: 8586
diff changeset
1165 free_frame_glyphs (f, FRAME_TEMP_GLYPHS (f));
844edbc22875 (Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents: 8586
diff changeset
1166 if (FRAME_INSERT_COST (f))
844edbc22875 (Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents: 8586
diff changeset
1167 free (FRAME_INSERT_COST (f));
844edbc22875 (Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents: 8586
diff changeset
1168 if (FRAME_DELETEN_COST (f))
8685
5952e691b975 (Fdelete_frame): Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 8666
diff changeset
1169 free (FRAME_DELETEN_COST (f));
8666
844edbc22875 (Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents: 8586
diff changeset
1170 if (FRAME_INSERTN_COST (f))
8685
5952e691b975 (Fdelete_frame): Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 8666
diff changeset
1171 free (FRAME_INSERTN_COST (f));
8666
844edbc22875 (Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents: 8586
diff changeset
1172 if (FRAME_DELETE_COST (f))
8685
5952e691b975 (Fdelete_frame): Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 8666
diff changeset
1173 free (FRAME_DELETE_COST (f));
17573
bfd86808adcc (Fdelete_frame): Free FRAME_MESSAGE_BUF.
Richard M. Stallman <rms@gnu.org>
parents: 17235
diff changeset
1174 if (FRAME_MESSAGE_BUF (f))
bfd86808adcc (Fdelete_frame): Free FRAME_MESSAGE_BUF.
Richard M. Stallman <rms@gnu.org>
parents: 17235
diff changeset
1175 free (FRAME_MESSAGE_BUF (f));
8666
844edbc22875 (Fdelete_frame): Free the frame's glyphs arrays.
Richard M. Stallman <rms@gnu.org>
parents: 8586
diff changeset
1176
17032
814257735e7d Include "charset.h"
Karl Heuer <kwzh@gnu.org>
parents: 16588
diff changeset
1177 #ifdef HAVE_WINDOW_SYSTEM
814257735e7d Include "charset.h"
Karl Heuer <kwzh@gnu.org>
parents: 16588
diff changeset
1178 /* Free all fontset data. */
814257735e7d Include "charset.h"
Karl Heuer <kwzh@gnu.org>
parents: 16588
diff changeset
1179 free_fontset_data (FRAME_FONTSET_DATA (f));
814257735e7d Include "charset.h"
Karl Heuer <kwzh@gnu.org>
parents: 16588
diff changeset
1180 #endif
814257735e7d Include "charset.h"
Karl Heuer <kwzh@gnu.org>
parents: 16588
diff changeset
1181
1809
69b3ee873a9b * frame.c (Fdelete_frame): Clear the frame's display after calling
Jim Blandy <jimb@redhat.com>
parents: 1784
diff changeset
1182 /* 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
1183 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
1184 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
1185 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
1186 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
1187
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1188 /* I think this should be done with a hook. */
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
1189 #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
1190 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
1191 x_destroy_window (f);
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1192 #endif
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1193
12667
a3466dad7d6d Renamings: frame->display => frame->output, struct x_display -> sruct x_output.
Richard M. Stallman <rms@gnu.org>
parents: 12630
diff changeset
1194 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
1195
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1196 /* If we've deleted the last_nonminibuf_frame, then try to find
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1197 another one. */
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1198 if (f == last_nonminibuf_frame)
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1199 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1200 Lisp_Object frames;
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1201
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1202 last_nonminibuf_frame = 0;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1203
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1204 for (frames = Vframe_list;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1205 CONSP (frames);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1206 frames = XCONS (frames)->cdr)
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1207 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1208 f = XFRAME (XCONS (frames)->car);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1209 if (!FRAME_MINIBUF_ONLY_P (f))
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1210 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1211 last_nonminibuf_frame = f;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1212 break;
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1213 }
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1214 }
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1215 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1216
11906
3ca56969ba07 (Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents: 11794
diff changeset
1217 /* 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
1218 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
1219 frames with other windows. */
11779
6234b3610a6f Vdefault_minibuffer_frame is now part of KBOARD instead
Karl Heuer <kwzh@gnu.org>
parents: 11775
diff changeset
1220 if (EQ (frame, FRAME_KBOARD (f)->Vdefault_minibuffer_frame))
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1221 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1222 Lisp_Object frames;
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1223
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1224 /* 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
1225 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
1226 /* 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
1227 Lisp_Object frame_on_same_kboard;
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1228
12380
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1229 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
1230 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
1231
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1232 for (frames = Vframe_list;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1233 CONSP (frames);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1234 frames = XCONS (frames)->cdr)
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1235 {
6500
551bff5cffde (next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
parents: 6486
diff changeset
1236 Lisp_Object this;
11906
3ca56969ba07 (Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents: 11794
diff changeset
1237 struct frame *f1;
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1238
6500
551bff5cffde (next_frame, prev_frame, other_visible_frames, Fdelete_frame): Use assignment,
Karl Heuer <kwzh@gnu.org>
parents: 6486
diff changeset
1239 this = XCONS (frames)->car;
9127
0b4836daa8e1 (Fframep, make_frame_without_minibuffer, do_switch_frame, prev_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9032
diff changeset
1240 if (!FRAMEP (this))
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1241 abort ();
11906
3ca56969ba07 (Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents: 11794
diff changeset
1242 f1 = XFRAME (this);
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1243
11906
3ca56969ba07 (Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents: 11794
diff changeset
1244 /* Consider only frames on the same kboard
3ca56969ba07 (Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents: 11794
diff changeset
1245 and only those with minibuffers. */
3ca56969ba07 (Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents: 11794
diff changeset
1246 if (FRAME_KBOARD (f) == FRAME_KBOARD (f1)
3ca56969ba07 (Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents: 11794
diff changeset
1247 && FRAME_HAS_MINIBUF_P (f1))
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1248 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1249 frame_with_minibuf = this;
11906
3ca56969ba07 (Fdelete_frame): When updating Vdefault_minibuffer_frame,
Karl Heuer <kwzh@gnu.org>
parents: 11794
diff changeset
1250 if (FRAME_MINIBUF_ONLY_P (f1))
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1251 break;
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1252 }
12380
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1253
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1254 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
1255 frame_on_same_kboard = this;
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1256 }
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1257
12380
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1258 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
1259 {
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1260 /* 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
1261 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
1262 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
1263 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
1264 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
1265 minibuffer frames. */
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1266 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
1267 abort ();
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1268
12380
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1269 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
1270 }
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1271 else
2c09b3adbb90 (Fdelete_frame): It's ok to have no minibuffer left on
Richard M. Stallman <rms@gnu.org>
parents: 12379
diff changeset
1272 /* 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
1273 FRAME_KBOARD (f)->Vdefault_minibuffer_frame = Qnil;
708
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1274 }
030fb4635335 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 699
diff changeset
1275
16280
f4833d0bfaaa (Fdelete_frame): Set update_mode_lines.
Richard M. Stallman <rms@gnu.org>
parents: 16263
diff changeset
1276 /* 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
1277 update_mode_lines = 1;
f4833d0bfaaa (Fdelete_frame): Set update_mode_lines.
Richard M. Stallman <rms@gnu.org>
parents: 16263
diff changeset
1278
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1279 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1280 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1281
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1282 /* Return mouse position in character cell units. */
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1283
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
1284 DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1285 "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\
3693
8e83f20d0e39 * frame.c (Fmouse_position): Doc fix.
Jim Blandy <jimb@redhat.com>
parents: 3676
diff changeset
1286 The position is given in character cells, where (0, 0) is the\n\
8e83f20d0e39 * frame.c (Fmouse_position): Doc fix.
Jim Blandy <jimb@redhat.com>
parents: 3676
diff changeset
1287 upper-left corner.\n\
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
1288 If Emacs is running on a mouseless terminal or hasn't been programmed\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1289 to read the mouse position, it returns the selected frame for FRAME\n\
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
1290 and nil for X and Y.")
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
1291 ()
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1292 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1293 FRAME_PTR f;
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1294 Lisp_Object lispy_dummy;
1989
b1c1ab20f810 Use the term `scroll bar', instead of `scrollbar'.
Jim Blandy <jimb@redhat.com>
parents: 1920
diff changeset
1295 enum scroll_bar_part party_dummy;
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1296 Lisp_Object x, y;
6054
24ffc4bc4067 (Fmouse_position): Convert to glyph units.
Richard M. Stallman <rms@gnu.org>
parents: 6012
diff changeset
1297 int col, row;
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1298 unsigned long long_dummy;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1299
3658
c2831d419bec (Fmouse_position): Set up defaults before calling the hook.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1300 f = selected_frame;
c2831d419bec (Fmouse_position): Set up defaults before calling the hook.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1301 x = y = Qnil;
c2831d419bec (Fmouse_position): Set up defaults before calling the hook.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1302
11025
6c5aef697fbe (Fmouse_position): Do work only if HAVE_MOUSE.
Karl Heuer <kwzh@gnu.org>
parents: 11017
diff changeset
1303 #ifdef HAVE_MOUSE
3658
c2831d419bec (Fmouse_position): Set up defaults before calling the hook.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1304 /* It's okay for the hook to refrain from storing anything. */
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
1305 if (mouse_position_hook)
11126
786f1c82a38e (Fmouse_position--both definitions): Pass 0 for `insist'.
Richard M. Stallman <rms@gnu.org>
parents: 11025
diff changeset
1306 (*mouse_position_hook) (&f, 0,
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1307 &lispy_dummy, &party_dummy,
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1308 &x, &y,
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1309 &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
1310 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
1311 {
c976ac5d85ec (Fmouse_position) [MULTI_FRAME]: Use pixel_to_glyph, not glyph_to_pixel. Skip
Karl Heuer <kwzh@gnu.org>
parents: 6806
diff changeset
1312 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
1313 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
1314 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
1315 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
1316 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
1317 }
11025
6c5aef697fbe (Fmouse_position): Do work only if HAVE_MOUSE.
Karl Heuer <kwzh@gnu.org>
parents: 11017
diff changeset
1318 #endif
9268
cb55d0155265 (make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9214
diff changeset
1319 XSETFRAME (lispy_dummy, f);
3658
c2831d419bec (Fmouse_position): Set up defaults before calling the hook.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1320 return Fcons (lispy_dummy, Fcons (x, y));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1321 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1322
7025
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1323 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
1324 Smouse_pixel_position, 0, 0, 0,
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1325 "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1326 The position is given in pixel units, where (0, 0) is the\n\
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1327 upper-left corner.\n\
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1328 If Emacs is running on a mouseless terminal or hasn't been programmed\n\
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1329 to read the mouse position, it returns the selected frame for FRAME\n\
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1330 and nil for X and Y.")
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1331 ()
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1332 {
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1333 FRAME_PTR f;
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1334 Lisp_Object lispy_dummy;
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1335 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
1336 Lisp_Object x, y;
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1337 int col, row;
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1338 unsigned long long_dummy;
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1339
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1340 f = selected_frame;
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1341 x = y = Qnil;
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1342
11126
786f1c82a38e (Fmouse_position--both definitions): Pass 0 for `insist'.
Richard M. Stallman <rms@gnu.org>
parents: 11025
diff changeset
1343 #ifdef HAVE_MOUSE
7025
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1344 /* 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
1345 if (mouse_position_hook)
11126
786f1c82a38e (Fmouse_position--both definitions): Pass 0 for `insist'.
Richard M. Stallman <rms@gnu.org>
parents: 11025
diff changeset
1346 (*mouse_position_hook) (&f, 0,
7025
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1347 &lispy_dummy, &party_dummy,
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1348 &x, &y,
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1349 &long_dummy);
11126
786f1c82a38e (Fmouse_position--both definitions): Pass 0 for `insist'.
Richard M. Stallman <rms@gnu.org>
parents: 11025
diff changeset
1350 #endif
9268
cb55d0155265 (make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9214
diff changeset
1351 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
1352 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
1353 }
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1354
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1355 DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0,
3694
f0e305fceb86 Doc fix.
Jim Blandy <jimb@redhat.com>
parents: 3693
diff changeset
1356 "Move the mouse pointer to the center of character cell (X,Y) in FRAME.\n\
12774
9b17b06bc9cd (Fset_mouse_position, Fset_mouse_pixel_position): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 12761
diff changeset
1357 Note, this is a no-op for an X frame that is not visible.\n\
9b17b06bc9cd (Fset_mouse_position, Fset_mouse_pixel_position): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 12761
diff changeset
1358 If you have just created a frame, you must wait for it to become visible\n\
9b17b06bc9cd (Fset_mouse_position, Fset_mouse_pixel_position): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 12761
diff changeset
1359 before calling this function on it, like this.\n\
9b17b06bc9cd (Fset_mouse_position, Fset_mouse_pixel_position): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 12761
diff changeset
1360 (while (not (frame-visible-p frame)) (sleep-for .5))")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1361 (frame, x, y)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1362 Lisp_Object frame, x, y;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1363 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1364 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1365 CHECK_NUMBER (x, 2);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1366 CHECK_NUMBER (y, 1);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1367
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1368 /* 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
1369 #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
1370 if (FRAME_WINDOW_P (XFRAME (frame)))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1371 /* Warping the mouse will cause enternotify and focus events. */
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1372 x_set_mouse_position (XFRAME (frame), x, y);
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1373 #else
15396
fbecc317220d Whitespace changes.
Richard M. Stallman <rms@gnu.org>
parents: 15392
diff changeset
1374 #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
1375 if (FRAME_MSDOS_P (XFRAME (frame)))
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1376 {
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1377 Fselect_frame (frame, Qnil);
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1378 mouse_moveto (XINT (x), XINT (y));
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1379 }
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1380 #endif
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1381 #endif
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1382
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1383 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1384 }
7025
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1385
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1386 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
1387 Sset_mouse_pixel_position, 3, 3, 0,
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1388 "Move the mouse pointer to pixel position (X,Y) in FRAME.\n\
12774
9b17b06bc9cd (Fset_mouse_position, Fset_mouse_pixel_position): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 12761
diff changeset
1389 Note, this is a no-op for an X frame that is not visible.\n\
9b17b06bc9cd (Fset_mouse_position, Fset_mouse_pixel_position): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 12761
diff changeset
1390 If you have just created a frame, you must wait for it to become visible\n\
9b17b06bc9cd (Fset_mouse_position, Fset_mouse_pixel_position): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 12761
diff changeset
1391 before calling this function on it, like this.\n\
9b17b06bc9cd (Fset_mouse_position, Fset_mouse_pixel_position): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 12761
diff changeset
1392 (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
1393 (frame, x, y)
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1394 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
1395 {
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1396 CHECK_LIVE_FRAME (frame, 0);
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1397 CHECK_NUMBER (x, 2);
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1398 CHECK_NUMBER (y, 1);
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1399
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1400 /* 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
1401 #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
1402 if (FRAME_WINDOW_P (XFRAME (frame)))
7025
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1403 /* Warping the mouse will cause enternotify and focus events. */
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1404 x_set_mouse_pixel_position (XFRAME (frame), x, y);
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1405 #else
15396
fbecc317220d Whitespace changes.
Richard M. Stallman <rms@gnu.org>
parents: 15392
diff changeset
1406 #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
1407 if (FRAME_MSDOS_P (XFRAME (frame)))
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1408 {
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1409 Fselect_frame (frame, Qnil);
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1410 mouse_moveto (XINT (x), XINT (y));
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1411 }
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1412 #endif
7025
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1413 #endif
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1414
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1415 return Qnil;
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
1416 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1417
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1418 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
1419 0, 1, "",
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1420 "Make the frame FRAME visible (assuming it is an X-window).\n\
1251
4e556fda7a4d * frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents: 1118
diff changeset
1421 If omitted, FRAME defaults to the currently selected frame.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1422 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1423 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1424 {
872
336ffe2bd537 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 785
diff changeset
1425 if (NILP (frame))
9268
cb55d0155265 (make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9214
diff changeset
1426 XSETFRAME (frame, selected_frame);
872
336ffe2bd537 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 785
diff changeset
1427
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1428 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1429
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1430 /* 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
1431 #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
1432 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
1433 {
9b41ddf1b5f7 (Fmake_frame_visible): Use FRAME_SAMPLE_VISIBILITY. Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 4961
diff changeset
1434 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
1435 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
1436 }
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
1437 #endif
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1438
7900
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
1439 /* Make menu bar update for the Buffers and Frams menus. */
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
1440 windows_or_buffers_changed++;
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
1441
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1442 return frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1443 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1444
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1445 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
1446 0, 2, "",
1251
4e556fda7a4d * frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents: 1118
diff changeset
1447 "Make the frame FRAME invisible (assuming it is an X-window).\n\
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1448 If omitted, FRAME defaults to the currently selected frame.\n\
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1449 Normally you may not make FRAME invisible if all other frames are invisible,\n\
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1450 but if the second optional argument FORCE is non-nil, you may do so.")
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1451 (frame, force)
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1452 Lisp_Object frame, force;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1453 {
872
336ffe2bd537 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 785
diff changeset
1454 if (NILP (frame))
9268
cb55d0155265 (make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9214
diff changeset
1455 XSETFRAME (frame, selected_frame);
872
336ffe2bd537 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 785
diff changeset
1456
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1457 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1458
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
1459 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
1460 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
1461
8586
c78654909acf (Fmake_frame_invisible, Ficonify_frame): Don't switch frames.
Karl Heuer <kwzh@gnu.org>
parents: 8264
diff changeset
1462 #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
1463 /* Don't let the frame remain selected. */
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1464 if (XFRAME (frame) == selected_frame)
12286
723569a0028c (Fdelete_frame): Use do_switch_frame directly.
Richard M. Stallman <rms@gnu.org>
parents: 12283
diff changeset
1465 do_switch_frame (next_frame (frame, Qt), Qnil, 0)
8586
c78654909acf (Fmake_frame_invisible, Ficonify_frame): Don't switch frames.
Karl Heuer <kwzh@gnu.org>
parents: 8264
diff changeset
1466 #endif
3283
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1467
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1468 /* 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
1469 if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window))
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1470 {
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1471 Fset_window_buffer (selected_frame->minibuffer_window,
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1472 XWINDOW (minibuf_window)->buffer);
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1473 minibuf_window = selected_frame->minibuffer_window;
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1474 }
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1475
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1476 /* I think this should be done with a hook. */
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
1477 #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
1478 if (FRAME_WINDOW_P (XFRAME (frame)))
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1479 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
1480 #endif
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1481
7900
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
1482 /* Make menu bar update for the Buffers and Frams menus. */
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
1483 windows_or_buffers_changed++;
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
1484
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1485 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1486 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1487
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1488 DEFUN ("iconify-frame", Ficonify_frame, Siconify_frame,
872
336ffe2bd537 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 785
diff changeset
1489 0, 1, "",
1251
4e556fda7a4d * frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents: 1118
diff changeset
1490 "Make the frame FRAME into an icon.\n\
4e556fda7a4d * frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents: 1118
diff changeset
1491 If omitted, FRAME defaults to the currently selected frame.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1492 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1493 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1494 {
872
336ffe2bd537 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 785
diff changeset
1495 if (NILP (frame))
9268
cb55d0155265 (make_minibuffer_frame, make_terminal_frame, Fselected_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9214
diff changeset
1496 XSETFRAME (frame, selected_frame);
872
336ffe2bd537 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 785
diff changeset
1497
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1498 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1499
8586
c78654909acf (Fmake_frame_invisible, Ficonify_frame): Don't switch frames.
Karl Heuer <kwzh@gnu.org>
parents: 8264
diff changeset
1500 #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
1501 /* Don't let the frame remain selected. */
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1502 if (XFRAME (frame) == selected_frame)
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1503 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
1504 #endif
3283
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1505
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1506 /* 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
1507 if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window))
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1508 {
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1509 Fset_window_buffer (selected_frame->minibuffer_window,
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1510 XWINDOW (minibuf_window)->buffer);
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1511 minibuf_window = selected_frame->minibuffer_window;
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1512 }
e2a40a3baa4b (Ficonify_frame, Fmake_frame_invisible):
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
1513
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1514 /* 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
1515 #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
1516 if (FRAME_WINDOW_P (XFRAME (frame)))
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1517 x_iconify_frame (XFRAME (frame));
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
1518 #endif
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1519
7900
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
1520 /* Make menu bar update for the Buffers and Frams menus. */
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
1521 windows_or_buffers_changed++;
60795e826dad Put stdio.h after config.h.
Richard M. Stallman <rms@gnu.org>
parents: 7646
diff changeset
1522
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1523 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1524 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1525
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1526 DEFUN ("frame-visible-p", Fframe_visible_p, Sframe_visible_p,
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1527 1, 1, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1528 "Return t if FRAME is now \"visible\" (actually in use for display).\n\
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1529 A frame that is not \"visible\" is not updated and, if it works through\n\
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1530 a window system, it may not show at all.\n\
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
1531 Return the symbol `icon' if frame is visible only as an icon.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1532 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1533 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1534 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1535 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1536
6012
650c0f231d17 (Fframe_visible_p): Do FRAME_SAMPLE_VISIBILITY first.
Richard M. Stallman <rms@gnu.org>
parents: 5925
diff changeset
1537 FRAME_SAMPLE_VISIBILITY (XFRAME (frame));
650c0f231d17 (Fframe_visible_p): Do FRAME_SAMPLE_VISIBILITY first.
Richard M. Stallman <rms@gnu.org>
parents: 5925
diff changeset
1538
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1539 if (FRAME_VISIBLE_P (XFRAME (frame)))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1540 return Qt;
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1541 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
1542 return Qicon;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1543 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1544 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1545
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1546 DEFUN ("visible-frame-list", Fvisible_frame_list, Svisible_frame_list,
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1547 0, 0, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1548 "Return a list of all frames now \"visible\" (being updated).")
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1549 ()
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1550 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1551 Lisp_Object tail, frame;
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1552 struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1553 Lisp_Object value;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1554
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1555 value = Qnil;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1556 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1557 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1558 frame = XCONS (tail)->car;
9127
0b4836daa8e1 (Fframep, make_frame_without_minibuffer, do_switch_frame, prev_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9032
diff changeset
1559 if (!FRAMEP (frame))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1560 continue;
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1561 f = XFRAME (frame);
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1562 if (FRAME_VISIBLE_P (f))
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1563 value = Fcons (frame, value);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1564 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1565 return value;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1566 }
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1567
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1568
11754
7691dbfc7571 (Fraise_frame, Flower_frame): Make arg FRAME optional.
Richard M. Stallman <rms@gnu.org>
parents: 11535
diff changeset
1569 DEFUN ("raise-frame", Fraise_frame, Sraise_frame, 0, 1, "",
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1570 "Bring FRAME to the front, so it occludes any frames it overlaps.\n\
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1571 If FRAME is invisible, make it visible.\n\
11211
2f9a24a4c9eb (Fraise_frame, Flower_frame): Now interactive.
Richard M. Stallman <rms@gnu.org>
parents: 11169
diff changeset
1572 If you don't specify a frame, the selected frame is used.\n\
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1573 If Emacs is displaying on an ordinary terminal or some other device which\n\
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1574 doesn't support multiple overlapping frames, this function does nothing.")
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1575 (frame)
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1576 Lisp_Object frame;
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1577 {
11211
2f9a24a4c9eb (Fraise_frame, Flower_frame): Now interactive.
Richard M. Stallman <rms@gnu.org>
parents: 11169
diff changeset
1578 if (NILP (frame))
2f9a24a4c9eb (Fraise_frame, Flower_frame): Now interactive.
Richard M. Stallman <rms@gnu.org>
parents: 11169
diff changeset
1579 XSETFRAME (frame, selected_frame);
2f9a24a4c9eb (Fraise_frame, Flower_frame): Now interactive.
Richard M. Stallman <rms@gnu.org>
parents: 11169
diff changeset
1580
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1581 CHECK_LIVE_FRAME (frame, 0);
4961
dd67510308ae (Fraise_frame): Do like the documentation says, and make
Richard M. Stallman <rms@gnu.org>
parents: 4798
diff changeset
1582
dd67510308ae (Fraise_frame): Do like the documentation says, and make
Richard M. Stallman <rms@gnu.org>
parents: 4798
diff changeset
1583 /* 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
1584 Fmake_frame_visible (frame);
dd67510308ae (Fraise_frame): Do like the documentation says, and make
Richard M. Stallman <rms@gnu.org>
parents: 4798
diff changeset
1585
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1586 if (frame_raise_lower_hook)
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1587 (*frame_raise_lower_hook) (XFRAME (frame), 1);
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1588
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1589 return Qnil;
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1590 }
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1591
2282
f727944c11aa * frame.c (Fraise_frame, Flower_frame): Renamed from
Jim Blandy <jimb@redhat.com>
parents: 2207
diff changeset
1592 /* 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
1593 DEFUN ("lower-frame", Flower_frame, Slower_frame, 0, 1, "",
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1594 "Send FRAME to the back, so it is occluded by any frames that overlap it.\n\
11211
2f9a24a4c9eb (Fraise_frame, Flower_frame): Now interactive.
Richard M. Stallman <rms@gnu.org>
parents: 11169
diff changeset
1595 If you don't specify a frame, the selected frame is used.\n\
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1596 If Emacs is displaying on an ordinary terminal or some other device which\n\
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1597 doesn't support multiple overlapping frames, this function does nothing.")
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1598 (frame)
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1599 Lisp_Object frame;
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1600 {
11211
2f9a24a4c9eb (Fraise_frame, Flower_frame): Now interactive.
Richard M. Stallman <rms@gnu.org>
parents: 11169
diff changeset
1601 if (NILP (frame))
2f9a24a4c9eb (Fraise_frame, Flower_frame): Now interactive.
Richard M. Stallman <rms@gnu.org>
parents: 11169
diff changeset
1602 XSETFRAME (frame, selected_frame);
2f9a24a4c9eb (Fraise_frame, Flower_frame): Now interactive.
Richard M. Stallman <rms@gnu.org>
parents: 11169
diff changeset
1603
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1604 CHECK_LIVE_FRAME (frame, 0);
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1605
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1606 if (frame_raise_lower_hook)
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1607 (*frame_raise_lower_hook) (XFRAME (frame), 0);
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1608
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1609 return Qnil;
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1610 }
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1611
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1612
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1613 DEFUN ("redirect-frame-focus", Fredirect_frame_focus, Sredirect_frame_focus,
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1614 1, 2, 0,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1615 "Arrange for keystrokes typed at FRAME to be sent to FOCUS-FRAME.\n\
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1616 In other words, switch-frame events caused by events in FRAME will\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1617 request a switch to FOCUS-FRAME, and `last-event-frame' will be\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1618 FOCUS-FRAME after reading an event typed at FRAME.\n\
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1619 \n\
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1620 If FOCUS-FRAME is omitted or nil, any existing redirection is\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1621 cancelled, and the frame again receives its own keystrokes.\n\
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1622 \n\
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1623 Focus redirection is useful for temporarily redirecting keystrokes to\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1624 a surrogate minibuffer frame when a frame doesn't have its own\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1625 minibuffer window.\n\
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1626 \n\
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1627 A frame's focus redirection can be changed by select-frame. If frame\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1628 FOO is selected, and then a different frame BAR is selected, any\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1629 frames redirecting their focus to FOO are shifted to redirect their\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1630 focus to BAR. This allows focus redirection to work properly when the\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1631 user switches from one frame to another using `select-window'.\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1632 \n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1633 This means that a frame whose focus is redirected to itself is treated\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1634 differently from a frame whose focus is redirected to nil; the former\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1635 is affected by select-frame, while the latter is not.\n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1636 \n\
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1637 The redirection lasts until `redirect-frame-focus' is called to change it.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1638 (frame, focus_frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1639 Lisp_Object frame, focus_frame;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1640 {
3970
020fe391d5c1 * frame.c (Fredirect_frame_focus): Allow redirection of focus of
Jim Blandy <jimb@redhat.com>
parents: 3834
diff changeset
1641 /* 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
1642 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
1643 know what other frame should receive those keystrokes. */
020fe391d5c1 * frame.c (Fredirect_frame_focus): Allow redirection of focus of
Jim Blandy <jimb@redhat.com>
parents: 3834
diff changeset
1644 CHECK_FRAME (frame, 0);
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
1645
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1646 if (! NILP (focus_frame))
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1647 CHECK_LIVE_FRAME (focus_frame, 1);
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1648
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1649 XFRAME (frame)->focus_frame = focus_frame;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1650
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1651 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
1652 (*frame_rehighlight_hook) (XFRAME (frame));
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1653
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1654 return Qnil;
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1655 }
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1656
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1657
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1658 DEFUN ("frame-focus", Fframe_focus, Sframe_focus, 1, 1, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1659 "Return the frame to which FRAME's keystrokes are currently being sent.\n\
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1660 This returns nil if FRAME's focus is not redirected.\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1661 See `redirect-frame-focus'.")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1662 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1663 Lisp_Object frame;
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1664 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1665 CHECK_LIVE_FRAME (frame, 0);
1709
b86b3237e017 * frame.h (struct frame): New fields `can_have_scrollbars' and
Jim Blandy <jimb@redhat.com>
parents: 1691
diff changeset
1666
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1667 return FRAME_FOCUS_FRAME (XFRAME (frame));
363
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1668 }
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1669
f4f9b557d934 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 335
diff changeset
1670
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1671
10207
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1672 /* 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
1673
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1674 Lisp_Object
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1675 get_frame_param (frame, prop)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1676 register struct frame *frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1677 Lisp_Object prop;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1678 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1679 register Lisp_Object tem;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1680
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1681 tem = Fassq (prop, frame->param_alist);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1682 if (EQ (tem, Qnil))
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1683 return tem;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1684 return Fcdr (tem);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1685 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1686
10207
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1687 /* 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
1688
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1689 Lisp_Object
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1690 frame_buffer_predicate ()
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1691 {
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1692 return selected_frame->buffer_predicate;
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1693 }
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1694
17221
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1695 /* 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
1696
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1697 Lisp_Object
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1698 frame_buffer_list ()
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1699 {
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1700 return selected_frame->buffer_list;
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1701 }
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1702
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1703 /* 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
1704
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1705 void
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1706 set_frame_buffer_list (list)
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1707 Lisp_Object list;
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1708 {
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1709 selected_frame->buffer_list = list;
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1710 }
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1711
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1712 /* 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
1713
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1714 void
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1715 frames_discard_buffer (buffer)
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1716 Lisp_Object buffer;
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1717 {
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1718 Lisp_Object frame, tail;
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1719
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1720 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
1721 {
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1722 XFRAME (frame)->buffer_list
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1723 = 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
1724 }
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1725 }
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1726
17235
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1727 /* Move BUFFER to the end of the buffer-list of each frame. */
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1728
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1729 void
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1730 frames_bury_buffer (buffer)
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1731 Lisp_Object buffer;
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1732 {
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1733 Lisp_Object frame, tail;
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1734
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1735 FOR_EACH_FRAME (tail, frame)
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1736 {
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1737 XFRAME (frame)->buffer_list
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1738 = nconc2 (Fdelq (buffer, XFRAME (frame)->buffer_list),
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1739 Fcons (buffer, Qnil));
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1740 }
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1741 }
5905b103d7ea (frames_bury_buffer): New function.
Richard M. Stallman <rms@gnu.org>
parents: 17221
diff changeset
1742
10207
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1743 /* 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
1744 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
1745
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1746 void
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
1747 store_in_alist (alistptr, prop, val)
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1748 Lisp_Object *alistptr, val;
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
1749 Lisp_Object prop;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1750 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1751 register Lisp_Object tem;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1752
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1753 tem = Fassq (prop, *alistptr);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1754 if (EQ (tem, Qnil))
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1755 *alistptr = Fcons (Fcons (prop, val), *alistptr);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1756 else
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1757 Fsetcdr (tem, val);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1758 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1759
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1760 void
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1761 store_frame_param (f, prop, val)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1762 struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1763 Lisp_Object prop, val;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1764 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1765 register Lisp_Object tem;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1766
17221
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1767 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
1768 {
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1769 f->buffer_list = val;
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1770 return;
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1771 }
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1772
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1773 tem = Fassq (prop, f->param_alist);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1774 if (EQ (tem, Qnil))
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1775 f->param_alist = Fcons (Fcons (prop, val), f->param_alist);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1776 else
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1777 Fsetcdr (tem, val);
539
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
1778
10207
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1779 if (EQ (prop, Qbuffer_predicate))
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1780 f->buffer_predicate = val;
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1781
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
1782 if (! FRAME_WINDOW_P (f))
12841
639f9d12f0f8 (store_frame_param): Don't call set_menu_bar_lines if X.
Richard M. Stallman <rms@gnu.org>
parents: 12774
diff changeset
1783 if (EQ (prop, Qmenu_bar_lines))
639f9d12f0f8 (store_frame_param): Don't call set_menu_bar_lines if X.
Richard M. Stallman <rms@gnu.org>
parents: 12774
diff changeset
1784 set_menu_bar_lines (f, val, make_number (FRAME_MENU_BAR_LINES (f)));
12761
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
1785
9127
0b4836daa8e1 (Fframep, make_frame_without_minibuffer, do_switch_frame, prev_frame,
Karl Heuer <kwzh@gnu.org>
parents: 9032
diff changeset
1786 if (EQ (prop, Qminibuffer) && WINDOWP (val))
539
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
1787 {
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
1788 if (! MINI_WINDOW_P (XWINDOW (val)))
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
1789 error ("Surrogate minibuffer windows must be minibuffer windows.");
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
1790
16371
906cef1d36bd (store_frame_param): Allow setting a frame's minibuffer
Karl Heuer <kwzh@gnu.org>
parents: 16280
diff changeset
1791 if (FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f)
906cef1d36bd (store_frame_param): Allow setting a frame's minibuffer
Karl Heuer <kwzh@gnu.org>
parents: 16280
diff changeset
1792 && !EQ (val, f->minibuffer_window))
906cef1d36bd (store_frame_param): Allow setting a frame's minibuffer
Karl Heuer <kwzh@gnu.org>
parents: 16280
diff changeset
1793 error ("Can't change the surrogate minibuffer of a frame with its own minibuffer");
539
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
1794
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
1795 /* Install the chosen minibuffer window, with proper buffer. */
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1796 f->minibuffer_window = val;
539
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 485
diff changeset
1797 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1798 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1799
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1800 DEFUN ("frame-parameters", Fframe_parameters, Sframe_parameters, 0, 1, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1801 "Return the parameters-alist of frame FRAME.\n\
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1802 It is a list of elements of the form (PARM . VALUE), where PARM is a symbol.\n\
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
1803 The meaningful PARMs depend on the kind of frame.\n\
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
1804 If FRAME is omitted, return information on the currently selected frame.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1805 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1806 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1807 {
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1808 Lisp_Object alist;
7162
06a13bf36a8c (Fframe_parameters) [!MULTI_FRAME]: Unstub it again.
Karl Heuer <kwzh@gnu.org>
parents: 7134
diff changeset
1809 FRAME_PTR f;
15062
de7528327c39 (Fframe_parameters, both definitions):
Richard M. Stallman <rms@gnu.org>
parents: 15001
diff changeset
1810 int height, width;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1811
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1812 if (EQ (frame, Qnil))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1813 f = selected_frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1814 else
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1815 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1816 CHECK_FRAME (frame, 0);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1817 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1818 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1819
7162
06a13bf36a8c (Fframe_parameters) [!MULTI_FRAME]: Unstub it again.
Karl Heuer <kwzh@gnu.org>
parents: 7134
diff changeset
1820 if (!FRAME_LIVE_P (f))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1821 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1822
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1823 alist = Fcopy_alist (f->param_alist);
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1824 #ifdef MSDOS
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1825 if (FRAME_MSDOS_P (f))
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1826 {
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1827 static char *colornames[16] =
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1828 {
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1829 "black", "blue", "green", "cyan", "red", "magenta", "brown",
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1830 "lightgray", "darkgray", "lightblue", "lightgreen", "lightcyan",
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1831 "lightred", "lightmagenta", "yellow", "white"
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1832 };
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1833 store_in_alist (&alist, intern ("foreground-color"),
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1834 build_string (colornames[FRAME_FOREGROUND_PIXEL (f)]));
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1835 store_in_alist (&alist, intern ("background-color"),
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1836 build_string (colornames[FRAME_BACKGROUND_PIXEL (f)]));
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1837 }
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1838 store_in_alist (&alist, intern ("font"), build_string ("default"));
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1839 #endif
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
1840 store_in_alist (&alist, Qname, f->name);
15062
de7528327c39 (Fframe_parameters, both definitions):
Richard M. Stallman <rms@gnu.org>
parents: 15001
diff changeset
1841 height = (FRAME_NEW_HEIGHT (f) ? FRAME_NEW_HEIGHT (f) : FRAME_HEIGHT (f));
de7528327c39 (Fframe_parameters, both definitions):
Richard M. Stallman <rms@gnu.org>
parents: 15001
diff changeset
1842 store_in_alist (&alist, Qheight, make_number (height));
de7528327c39 (Fframe_parameters, both definitions):
Richard M. Stallman <rms@gnu.org>
parents: 15001
diff changeset
1843 width = (FRAME_NEW_WIDTH (f) ? FRAME_NEW_WIDTH (f) : FRAME_WIDTH (f));
de7528327c39 (Fframe_parameters, both definitions):
Richard M. Stallman <rms@gnu.org>
parents: 15001
diff changeset
1844 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
1845 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
1846 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
1847 (! FRAME_HAS_MINIBUF_P (f) ? Qnil
7162
06a13bf36a8c (Fframe_parameters) [!MULTI_FRAME]: Unstub it again.
Karl Heuer <kwzh@gnu.org>
parents: 7134
diff changeset
1848 : FRAME_MINIBUF_ONLY_P (f) ? Qonly
06a13bf36a8c (Fframe_parameters) [!MULTI_FRAME]: Unstub it again.
Karl Heuer <kwzh@gnu.org>
parents: 7134
diff changeset
1849 : FRAME_MINIBUF_WINDOW (f)));
06a13bf36a8c (Fframe_parameters) [!MULTI_FRAME]: Unstub it again.
Karl Heuer <kwzh@gnu.org>
parents: 7134
diff changeset
1850 store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil));
17221
0530a375eb21 (frame_buffer_list, set_frame_buffer_list): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 17032
diff changeset
1851 store_in_alist (&alist, Qbuffer_list, frame_buffer_list ());
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1852
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1853 /* 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
1854 #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
1855 if (FRAME_WINDOW_P (f))
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1856 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
1857 else
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
1858 #endif
8904
af3ff2dbaddd (Fframe_parameters): Fix Lisp_Object vs. int problems.
Karl Heuer <kwzh@gnu.org>
parents: 8685
diff changeset
1859 {
af3ff2dbaddd (Fframe_parameters): Fix Lisp_Object vs. int problems.
Karl Heuer <kwzh@gnu.org>
parents: 8685
diff changeset
1860 /* 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
1861 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
1862 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
1863 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
1864 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1865 return alist;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1866 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1867
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1868 DEFUN ("modify-frame-parameters", Fmodify_frame_parameters,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1869 Smodify_frame_parameters, 2, 2, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1870 "Modify the parameters of frame FRAME according to ALIST.\n\
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1871 ALIST is an alist of parameters to change and their new values.\n\
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1872 Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.\n\
16536
a144fa66d84b (Fmodify_frame_parameters): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 16371
diff changeset
1873 The meaningful PARMs depend on the kind of frame.\n\
a144fa66d84b (Fmodify_frame_parameters): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 16371
diff changeset
1874 Undefined PARMs are ignored, but stored in the frame's parameter list\n\
a144fa66d84b (Fmodify_frame_parameters): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 16371
diff changeset
1875 so that `frame-parameters' will return them.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1876 (frame, alist)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1877 Lisp_Object frame, alist;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1878 {
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
1879 FRAME_PTR f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1880 register Lisp_Object tail, elt, prop, val;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1881
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1882 if (EQ (frame, Qnil))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1883 f = selected_frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1884 else
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1885 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1886 CHECK_LIVE_FRAME (frame, 0);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1887 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1888 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1889
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
1890 /* 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
1891 #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
1892 if (FRAME_WINDOW_P (f))
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
1893 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
1894 else
e6618f52efe9 (Fmodify_frame_parameters): For non-X frames,
Richard M. Stallman <rms@gnu.org>
parents: 9972
diff changeset
1895 #endif
15391
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1896 #ifdef MSDOS
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1897 if (FRAME_MSDOS_P (f))
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1898 IT_set_frame_parameters (f, alist);
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1899 else
d4cec5d7566d (Fset_mouse_position): Remove the DOS-specific
Richard M. Stallman <rms@gnu.org>
parents: 15062
diff changeset
1900 #endif
16568
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1901 {
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1902 int length = XINT (Flength (alist));
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1903 int i;
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1904 Lisp_Object *parms
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1905 = (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
1906 Lisp_Object *values
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1907 = (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
1908
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1909 /* 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
1910
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1911 i = 0;
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1912 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
1913 {
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1914 Lisp_Object elt, prop, val;
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1915
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1916 elt = Fcar (tail);
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1917 parms[i] = Fcar (elt);
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1918 values[i] = Fcdr (elt);
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1919 i++;
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1920 }
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1921
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1922 /* 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
1923 for (i--; i >= 0; i--)
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1924 {
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1925 prop = parms[i];
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1926 val = values[i];
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1927 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
1928 }
cc6d85f9df0f (Fmodify_frame_parameters): Use alist in reverse order.
Richard M. Stallman <rms@gnu.org>
parents: 16536
diff changeset
1929 }
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1930
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1931 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1932 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1933
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1934 DEFUN ("frame-char-height", Fframe_char_height, Sframe_char_height,
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1935 0, 1, 0,
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1936 "Height in pixels of a line in the font in frame FRAME.\n\
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1937 If FRAME is omitted, the selected frame is used.\n\
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1938 For a terminal frame, the value is always 1.")
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1939 (frame)
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1940 Lisp_Object frame;
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1941 {
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1942 struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1943
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1944 if (NILP (frame))
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1945 f = selected_frame;
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1946 else
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1947 {
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1948 CHECK_FRAME (frame, 0);
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1949 f = XFRAME (frame);
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1950 }
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
1951
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
1952 #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
1953 if (FRAME_WINDOW_P (f))
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1954 return make_number (x_char_height (f));
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1955 else
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1956 #endif
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1957 return make_number (1);
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1958 }
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1959
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1960
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1961 DEFUN ("frame-char-width", Fframe_char_width, Sframe_char_width,
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1962 0, 1, 0,
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1963 "Width in pixels of characters in the font in frame FRAME.\n\
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1964 If FRAME is omitted, the selected frame is used.\n\
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1965 The width is the same for all characters, because\n\
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1966 currently Emacs supports only fixed-width fonts.\n\
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1967 For a terminal screen, the value is always 1.")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1968 (frame)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1969 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1970 {
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1971 struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1972
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1973 if (NILP (frame))
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1974 f = selected_frame;
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1975 else
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1976 {
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1977 CHECK_FRAME (frame, 0);
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1978 f = XFRAME (frame);
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1979 }
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1980
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
1981 #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
1982 if (FRAME_WINDOW_P (f))
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1983 return make_number (x_char_width (f));
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1984 else
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
1985 #endif
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1986 return make_number (1);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1987 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1988
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1989 DEFUN ("frame-pixel-height", Fframe_pixel_height,
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1990 Sframe_pixel_height, 0, 1, 0,
3676
5160a6967f80 Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 3658
diff changeset
1991 "Return a FRAME's height in pixels.\n\
5160a6967f80 Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 3658
diff changeset
1992 For a terminal frame, the result really gives the height in characters.\n\
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1993 If FRAME is omitted, the selected frame is used.")
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1994 (frame)
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1995 Lisp_Object frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1996 {
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1997 struct frame *f;
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1998
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
1999 if (NILP (frame))
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2000 f = selected_frame;
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2001 else
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2002 {
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2003 CHECK_FRAME (frame, 0);
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2004 f = XFRAME (frame);
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2005 }
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2006
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
2007 #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
2008 if (FRAME_WINDOW_P (f))
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2009 return make_number (x_pixel_height (f));
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2010 else
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2011 #endif
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2012 return make_number (FRAME_HEIGHT (f));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2013 }
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2014
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2015 DEFUN ("frame-pixel-width", Fframe_pixel_width,
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2016 Sframe_pixel_width, 0, 1, 0,
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2017 "Return FRAME's width in pixels.\n\
3676
5160a6967f80 Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 3658
diff changeset
2018 For a terminal frame, the result really gives the width in characters.\n\
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2019 If FRAME is omitted, the selected frame is used.")
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2020 (frame)
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2021 Lisp_Object frame;
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2022 {
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2023 struct frame *f;
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2024
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2025 if (NILP (frame))
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2026 f = selected_frame;
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2027 else
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2028 {
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2029 CHECK_FRAME (frame, 0);
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2030 f = XFRAME (frame);
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2031 }
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2032
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
2033 #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
2034 if (FRAME_WINDOW_P (f))
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2035 return make_number (x_pixel_width (f));
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2036 else
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
2037 #endif
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2038 return make_number (FRAME_WIDTH (f));
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2039 }
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2040
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2041 DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2042 "Specify that the frame FRAME has LINES lines.\n\
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2043 Optional third arg non-nil means that redisplay should use LINES lines\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2044 but that the idea of the actual height of the frame should not be changed.")
14077
a6d3ce4a2f8e (Fhandle_switch_frame, Fset_frame_height): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents: 13748
diff changeset
2045 (frame, lines, pretend)
a6d3ce4a2f8e (Fhandle_switch_frame, Fset_frame_height): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents: 13748
diff changeset
2046 Lisp_Object frame, lines, pretend;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2047 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2048 register struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2049
14077
a6d3ce4a2f8e (Fhandle_switch_frame, Fset_frame_height): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents: 13748
diff changeset
2050 CHECK_NUMBER (lines, 0);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2051 if (NILP (frame))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2052 f = selected_frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2053 else
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2054 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2055 CHECK_LIVE_FRAME (frame, 0);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2056 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2057 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2058
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
2059 /* 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
2060 #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
2061 if (FRAME_WINDOW_P (f))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2062 {
14077
a6d3ce4a2f8e (Fhandle_switch_frame, Fset_frame_height): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents: 13748
diff changeset
2063 if (XINT (lines) != f->height)
a6d3ce4a2f8e (Fhandle_switch_frame, Fset_frame_height): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents: 13748
diff changeset
2064 x_set_window_size (f, 1, f->width, XINT (lines));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2065 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2066 else
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
2067 #endif
14077
a6d3ce4a2f8e (Fhandle_switch_frame, Fset_frame_height): Harmonize arguments with
Erik Naggum <erik@naggum.no>
parents: 13748
diff changeset
2068 change_frame_size (f, XINT (lines), 0, !NILP (pretend), 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2069 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2070 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2071
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2072 DEFUN ("set-frame-width", Fset_frame_width, Sset_frame_width, 2, 3, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2073 "Specify that the frame FRAME has COLS columns.\n\
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2074 Optional third arg non-nil means that redisplay should use COLS columns\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2075 but that the idea of the actual width of the frame should not be changed.")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2076 (frame, cols, pretend)
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
2077 Lisp_Object frame, cols, pretend;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2078 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2079 register struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2080 CHECK_NUMBER (cols, 0);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2081 if (NILP (frame))
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2082 f = selected_frame;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2083 else
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2084 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2085 CHECK_LIVE_FRAME (frame, 0);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2086 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2087 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2088
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
2089 /* 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
2090 #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
2091 if (FRAME_WINDOW_P (f))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2092 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2093 if (XINT (cols) != f->width)
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
2094 x_set_window_size (f, 1, XINT (cols), f->height);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2095 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2096 else
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
2097 #endif
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
2098 change_frame_size (f, 0, XINT (cols), !NILP (pretend), 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2099 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2100 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2101
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2102 DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 3, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2103 "Sets size of FRAME to COLS by ROWS, measured in characters.")
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2104 (frame, cols, rows)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2105 Lisp_Object frame, cols, rows;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2106 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2107 register struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2108 int mask;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2109
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2110 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2111 CHECK_NUMBER (cols, 2);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2112 CHECK_NUMBER (rows, 1);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2113 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2114
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
2115 /* 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
2116 #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
2117 if (FRAME_WINDOW_P (f))
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2118 {
14966
a8d71d222bb7 (Fset_frame_size): Do call Fset_frame_size
Richard M. Stallman <rms@gnu.org>
parents: 14303
diff changeset
2119 if (XINT (rows) != f->height || XINT (cols) != f->width
a8d71d222bb7 (Fset_frame_size): Do call Fset_frame_size
Richard M. Stallman <rms@gnu.org>
parents: 14303
diff changeset
2120 || FRAME_NEW_HEIGHT (f) || FRAME_NEW_WIDTH (f))
5925
806e876cacb4 (Fset_frame_height, Fset_frame_width, Fset_frame_size):
Richard M. Stallman <rms@gnu.org>
parents: 5552
diff changeset
2121 x_set_window_size (f, 1, XINT (cols), XINT (rows));
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2122 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2123 else
965
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
2124 #endif
0eb68c6c452a * frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents: 886
diff changeset
2125 change_frame_size (f, XINT (rows), XINT (cols), 0, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2126
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2127 return Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2128 }
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2129
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2130 DEFUN ("set-frame-position", Fset_frame_position,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2131 Sset_frame_position, 3, 3, 0,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2132 "Sets position of FRAME in pixels to XOFFSET by YOFFSET.\n\
4341
d07ef5ea3b58 (Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents: 4227
diff changeset
2133 This is actually the position of the upper left corner of the frame.\n\
d07ef5ea3b58 (Fdelete_frame): New arg FORCE allows deletion of last non-invisible frame.
Richard M. Stallman <rms@gnu.org>
parents: 4227
diff changeset
2134 Negative values for XOFFSET or YOFFSET are interpreted relative to\n\
4412
12c4e5b53463 (Fset_frame_position): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 4341
diff changeset
2135 the rightmost or bottommost possible position (that stays within the screen).")
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2136 (frame, xoffset, yoffset)
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2137 Lisp_Object frame, xoffset, yoffset;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2138 {
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2139 register struct frame *f;
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2140 int mask;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2141
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2142 CHECK_LIVE_FRAME (frame, 0);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2143 CHECK_NUMBER (xoffset, 1);
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2144 CHECK_NUMBER (yoffset, 2);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2145 f = XFRAME (frame);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2146
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
2147 /* 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
2148 #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
2149 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
2150 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
2151 #endif
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2152
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2153 return Qt;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2154 }
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 765
diff changeset
2155
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2156
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2157 syms_of_frame ()
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2158 {
12761
bffb5ea6fb43 Move various Q... vars to top of file, unconditional.
Richard M. Stallman <rms@gnu.org>
parents: 12742
diff changeset
2159 syms_of_frame_1 ();
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2160
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2161 staticpro (&Vframe_list);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2162
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2163 DEFVAR_LISP ("terminal-frame", &Vterminal_frame,
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2164 "The initial frame-object, which represents Emacs's stdout.");
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2165
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2166 DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2167 "Non-nil if all of emacs is iconified and frame updates are not needed.");
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2168 Vemacs_iconified = Qnil;
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2169
11779
6234b3610a6f Vdefault_minibuffer_frame is now part of KBOARD instead
Karl Heuer <kwzh@gnu.org>
parents: 11775
diff changeset
2170 DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2171 "Minibufferless frames use this frame's minibuffer.\n\
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
2172 \n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2173 Emacs cannot create minibufferless frames unless this is set to an\n\
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
2174 appropriate surrogate.\n\
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
2175 \n\
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
2176 Emacs consults this variable only when creating minibufferless\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2177 frames; once the frame is created, it sticks with its assigned\n\
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
2178 minibuffer, no matter what this variable is set to. This means that\n\
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
2179 this variable doesn't necessarily say anything meaningful about the\n\
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2180 current set of frames, or where the minibuffer is currently being\n\
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
2181 displayed.");
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2182
11169
d0550c056e5b [MULTI_FRAME] (Factive_minibuffer_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 11126
diff changeset
2183 defsubr (&Sactive_minibuffer_window);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2184 defsubr (&Sframep);
1821
04fb1d3d6992 JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents: 1809
diff changeset
2185 defsubr (&Sframe_live_p);
10768
938451cf1b10 (Fmake_terminal_frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 10676
diff changeset
2186 defsubr (&Smake_terminal_frame);
2298
872a3a2c3fed * frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents: 2282
diff changeset
2187 defsubr (&Shandle_switch_frame);
12283
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
2188 defsubr (&Signore_event);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2189 defsubr (&Sselect_frame);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2190 defsubr (&Sselected_frame);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2191 defsubr (&Swindow_frame);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2192 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
2193 defsubr (&Sframe_first_window);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2194 defsubr (&Sframe_selected_window);
7055
5e4906d964b8 (Fset_frame_selected_window): New function.
Richard M. Stallman <rms@gnu.org>
parents: 7025
diff changeset
2195 defsubr (&Sset_frame_selected_window);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2196 defsubr (&Sframe_list);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2197 defsubr (&Snext_frame);
4424
027d3affb2f8 (Fprevious_frame): New function, for parity with Fnext_frame.
Roland McGrath <roland@gnu.org>
parents: 4412
diff changeset
2198 defsubr (&Sprevious_frame);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2199 defsubr (&Sdelete_frame);
454
ca410e0b4797 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 386
diff changeset
2200 defsubr (&Smouse_position);
7025
24e759919770 (Fmouse_pixel_position, Fset_mouse_pixel_position): New functions.
Richard M. Stallman <rms@gnu.org>
parents: 6986
diff changeset
2201 defsubr (&Smouse_pixel_position);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2202 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
2203 defsubr (&Sset_mouse_pixel_position);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2204 #if 0
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2205 defsubr (&Sframe_configuration);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2206 defsubr (&Srestore_frame_configuration);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2207 #endif
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2208 defsubr (&Smake_frame_visible);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2209 defsubr (&Smake_frame_invisible);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2210 defsubr (&Siconify_frame);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2211 defsubr (&Sframe_visible_p);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2212 defsubr (&Svisible_frame_list);
2282
f727944c11aa * frame.c (Fraise_frame, Flower_frame): Renamed from
Jim Blandy <jimb@redhat.com>
parents: 2207
diff changeset
2213 defsubr (&Sraise_frame);
f727944c11aa * frame.c (Fraise_frame, Flower_frame): Renamed from
Jim Blandy <jimb@redhat.com>
parents: 2207
diff changeset
2214 defsubr (&Slower_frame);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2215 defsubr (&Sredirect_frame_focus);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2216 defsubr (&Sframe_focus);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2217 defsubr (&Sframe_parameters);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2218 defsubr (&Smodify_frame_parameters);
2068
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2219 defsubr (&Sframe_char_height);
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2220 defsubr (&Sframe_char_width);
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2221 defsubr (&Sframe_pixel_height);
6357ea40643c (Fframe_char_height, Fframe_char_width):
Richard M. Stallman <rms@gnu.org>
parents: 1989
diff changeset
2222 defsubr (&Sframe_pixel_width);
765
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2223 defsubr (&Sset_frame_height);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2224 defsubr (&Sset_frame_width);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2225 defsubr (&Sset_frame_size);
e4093444f9f8 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
2226 defsubr (&Sset_frame_position);
286
8a40ab4a424f Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2227 }
732
a8d94735277e *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 714
diff changeset
2228
1385
a4a205bdd2c1 * frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents: 1346
diff changeset
2229 keys_of_frame ()
a4a205bdd2c1 * frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents: 1346
diff changeset
2230 {
2298
872a3a2c3fed * frame.c (Fhandle_switch_frame): Renamed from Fselect_frame.
Jim Blandy <jimb@redhat.com>
parents: 2282
diff changeset
2231 initial_define_lispy_key (global_map, "switch-frame", "handle-switch-frame");
9214
a31be7afcc83 (keys_of_frame): Make binding for delete-frame.
Richard M. Stallman <rms@gnu.org>
parents: 9127
diff changeset
2232 initial_define_lispy_key (global_map, "delete-frame", "handle-delete-frame");
12283
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
2233 initial_define_lispy_key (global_map, "iconify-frame", "ignore-event");
fd9043d15414 [MULTI_FRAME] (Fignore_event): New function.
Karl Heuer <kwzh@gnu.org>
parents: 12255
diff changeset
2234 initial_define_lispy_key (global_map, "make-frame-visible", "ignore-event");
1385
a4a205bdd2c1 * frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents: 1346
diff changeset
2235 }