annotate lisp/frame.el @ 83023:6ce586a7243e

Set the keyboard of the initial frame correctly. src/dispnew.c (init_display)[MULTI_KBOARD]: Change the kboard of the initial frame to that of the tty. (Fixes --eval bug reported by Romain Francoise.) git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-63
author Karoly Lorentey <lorentey@elte.hu>
date Sat, 24 Jan 2004 19:32:29 +0000
parents 1465425fe2d3
children a871be7b26a5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38412
253f761ad37b Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents: 37823
diff changeset
1 ;;; frame.el --- multi-frame management independent of window systems
658
7cbd4fcd8b0f *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 584
diff changeset
2
51507
e4e1e9a6becf (set-frame-font): Default to frame's current default font.
Miles Bader <miles@gnu.org>
parents: 51180
diff changeset
3 ;; Copyright (C) 1993, 1994, 1996, 1997, 2000, 2001, 2003
36257
620c4b282fce (display-hourglass): Renamed from busy-cursor.
Gerd Moellmann <gerd@gnu.org>
parents: 35856
diff changeset
4 ;; Free Software Foundation, Inc.
846
20674ae6bf52 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 827
diff changeset
5
793
6fb68a1460a6 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 777
diff changeset
6 ;; Maintainer: FSF
811
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 806
diff changeset
7 ;; Keywords: internal
793
6fb68a1460a6 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 777
diff changeset
8
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 12220
diff changeset
9 ;; This file is part of GNU Emacs.
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 12220
diff changeset
10
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 12220
diff changeset
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 12220
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 12220
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 12220
diff changeset
14 ;; any later version.
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 12220
diff changeset
15
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 12220
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 12220
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 12220
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 12220
diff changeset
19 ;; GNU General Public License for more details.
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 12220
diff changeset
20
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 12220
diff changeset
21 ;; You should have received a copy of the GNU General Public License
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 12220
diff changeset
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 12220
diff changeset
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 12220
diff changeset
24 ;; Boston, MA 02111-1307, USA.
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
25
38412
253f761ad37b Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents: 37823
diff changeset
26 ;;; Commentary:
253f761ad37b Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents: 37823
diff changeset
27
793
6fb68a1460a6 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 777
diff changeset
28 ;;; Code:
6fb68a1460a6 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 777
diff changeset
29
83014
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
30 (defvar frame-creation-function-alist
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
31 (list (cons nil
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
32 (if (fboundp 'tty-create-frame-with-faces)
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
33 'tty-create-frame-with-faces
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
34 (function
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
35 (lambda (parameters)
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
36 (error "Can't create multiple frames without a window system"))))))
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
37 "Alist of window-system dependent functions to call to create a new frame.
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
38 The window system startup file should add its frame creation
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
39 function to this list, which should take an alist of parameters
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
40 as its argument.")
83009
b2b37c85b00a Numerous bugfixes and small improvements.
Karoly Lorentey <lorentey@elte.hu>
parents: 83008
diff changeset
41
39846
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
42 ;; The initial value given here used to ask for a minibuffer.
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
43 ;; But that's not necessary, because the default is to have one.
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
44 ;; By not specifying it here, we let an X resource specify it.
23745
43927e2a5899 (initial-frame-alist): Add defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 22232
diff changeset
45 (defcustom initial-frame-alist nil
24926
4cb7e7beea27 (minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24207
diff changeset
46 "*Alist of frame parameters for creating the initial X window frame.
1974
94e4f619080b These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents: 1881
diff changeset
47 You can set this in your `.emacs' file; for example,
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
48 (setq initial-frame-alist '((top . 1) (left . 1) (width . 80) (height . 55)))
8129
aa25c6ea397d (initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 8072
diff changeset
49 Parameters specified here supersede the values given in `default-frame-alist'.
aa25c6ea397d (initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 8072
diff changeset
50
aa25c6ea397d (initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 8072
diff changeset
51 If the value calls for a frame without a minibuffer, and you have not created
aa25c6ea397d (initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 8072
diff changeset
52 a minibuffer frame on your own, one is created according to
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
53 `minibuffer-frame-alist'.
8129
aa25c6ea397d (initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 8072
diff changeset
54
aa25c6ea397d (initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 8072
diff changeset
55 You can specify geometry-related options for just the initial frame
aa25c6ea397d (initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 8072
diff changeset
56 by setting this variable in your `.emacs' file; however, they won't
10557
87b3ab910738 Fix typos.
Karl Heuer <kwzh@gnu.org>
parents: 10192
diff changeset
57 take effect until Emacs reads `.emacs', which happens after first creating
8129
aa25c6ea397d (initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 8072
diff changeset
58 the frame. If you want the frame to have the proper geometry as soon
aa25c6ea397d (initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 8072
diff changeset
59 as it appears, you need to use this three-step process:
aa25c6ea397d (initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 8072
diff changeset
60 * Specify X resources to give the geometry you want.
aa25c6ea397d (initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 8072
diff changeset
61 * Set `default-frame-alist' to override these options so that they
aa25c6ea397d (initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 8072
diff changeset
62 don't affect subsequent frames.
aa25c6ea397d (initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 8072
diff changeset
63 * Set `initial-frame-alist' in a way that matches the X resources,
23745
43927e2a5899 (initial-frame-alist): Add defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 22232
diff changeset
64 to override what you put in `default-frame-alist'."
43927e2a5899 (initial-frame-alist): Add defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 22232
diff changeset
65 :type '(repeat (cons :format "%v"
43927e2a5899 (initial-frame-alist): Add defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 22232
diff changeset
66 (symbol :tag "Parameter")
43927e2a5899 (initial-frame-alist): Add defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 22232
diff changeset
67 (sexp :tag "Value")))
43927e2a5899 (initial-frame-alist): Add defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 22232
diff changeset
68 :group 'frames)
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
69
24926
4cb7e7beea27 (minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24207
diff changeset
70 (defcustom minibuffer-frame-alist '((width . 80) (height . 2))
4cb7e7beea27 (minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24207
diff changeset
71 "*Alist of frame parameters for initially creating a minibuffer frame.
1974
94e4f619080b These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents: 1881
diff changeset
72 You can set this in your `.emacs' file; for example,
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
73 (setq minibuffer-frame-alist
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
74 '((top . 1) (left . 1) (width . 80) (height . 2)))
1974
94e4f619080b These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents: 1881
diff changeset
75 Parameters specified here supersede the values given in
24926
4cb7e7beea27 (minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24207
diff changeset
76 `default-frame-alist', for a minibuffer frame."
4cb7e7beea27 (minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24207
diff changeset
77 :type '(repeat (cons :format "%v"
4cb7e7beea27 (minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24207
diff changeset
78 (symbol :tag "Parameter")
4cb7e7beea27 (minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24207
diff changeset
79 (sexp :tag "Value")))
4cb7e7beea27 (minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24207
diff changeset
80 :group 'frames)
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
81
24926
4cb7e7beea27 (minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24207
diff changeset
82 (defcustom pop-up-frame-alist nil
4cb7e7beea27 (minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24207
diff changeset
83 "*Alist of frame parameters used when creating pop-up frames.
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
84 Pop-up frames are used for completions, help, and the like.
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
85 This variable can be set in your init file, like this:
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
86 (setq pop-up-frame-alist '((width . 80) (height . 20)))
24926
4cb7e7beea27 (minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24207
diff changeset
87 These supersede the values given in `default-frame-alist',
4cb7e7beea27 (minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24207
diff changeset
88 for pop-up frames."
4cb7e7beea27 (minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24207
diff changeset
89 :type '(repeat (cons :format "%v"
4cb7e7beea27 (minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24207
diff changeset
90 (symbol :tag "Parameter")
4cb7e7beea27 (minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24207
diff changeset
91 (sexp :tag "Value")))
4cb7e7beea27 (minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 24207
diff changeset
92 :group 'frames)
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
93
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
94 (setq pop-up-frame-function
53406
45cc6f8abd8d (pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents: 52614
diff changeset
95 ;; Using `function' here caused some sort of problem.
45cc6f8abd8d (pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents: 52614
diff changeset
96 '(lambda ()
45cc6f8abd8d (pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents: 52614
diff changeset
97 (make-frame pop-up-frame-alist)))
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
98
17665
b11021ca3525 Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17523
diff changeset
99 (defcustom special-display-frame-alist
7057
7102dd374da4 (special-display-frame-alist): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 7020
diff changeset
100 '((height . 14) (width . 80) (unsplittable . t))
7102dd374da4 (special-display-frame-alist): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 7020
diff changeset
101 "*Alist of frame parameters used when creating special frames.
7102dd374da4 (special-display-frame-alist): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 7020
diff changeset
102 Special frames are used for buffers whose names are in
7102dd374da4 (special-display-frame-alist): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 7020
diff changeset
103 `special-display-buffer-names' and for buffers whose names match
7102dd374da4 (special-display-frame-alist): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 7020
diff changeset
104 one of the regular expressions in `special-display-regexps'.
7102dd374da4 (special-display-frame-alist): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 7020
diff changeset
105 This variable can be set in your init file, like this:
7102dd374da4 (special-display-frame-alist): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 7020
diff changeset
106 (setq special-display-frame-alist '((width . 80) (height . 20)))
17665
b11021ca3525 Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17523
diff changeset
107 These supersede the values given in `default-frame-alist'."
b11021ca3525 Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17523
diff changeset
108 :type '(repeat (cons :format "%v"
b11021ca3525 Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17523
diff changeset
109 (symbol :tag "Parameter")
b11021ca3525 Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17523
diff changeset
110 (sexp :tag "Value")))
b11021ca3525 Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 17523
diff changeset
111 :group 'frames)
7057
7102dd374da4 (special-display-frame-alist): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 7020
diff changeset
112
8993
c6572fa27df3 (special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents: 8990
diff changeset
113 (defun special-display-popup-frame (buffer &optional args)
25139
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
114 "Display BUFFER in its own frame, reusing an existing window if any.
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
115 Return the window chosen.
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
116 Currently we do not insist on selecting the window within its frame.
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
117 If ARGS is an alist, use it as a list of frame parameter specs.
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
118 If ARGS is a list whose car is a symbol,
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
119 use (car ARGS) as a function to do the work.
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
120 Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args."
8993
c6572fa27df3 (special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents: 8990
diff changeset
121 (if (and args (symbolp (car args)))
c6572fa27df3 (special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents: 8990
diff changeset
122 (apply (car args) buffer (cdr args))
c6572fa27df3 (special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents: 8990
diff changeset
123 (let ((window (get-buffer-window buffer t)))
39846
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
124 (or
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
125 ;; If we have a window already, make it visible.
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
126 (when window
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
127 (let ((frame (window-frame window)))
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
128 (make-frame-visible frame)
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
129 (raise-frame frame)
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
130 window))
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
131 ;; Reuse the current window if the user requested it.
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
132 (when (cdr (assq 'same-window args))
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
133 (condition-case nil
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
134 (progn (switch-to-buffer buffer) (selected-window))
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
135 (error nil)))
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
136 ;; Stay on the same frame if requested.
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
137 (when (or (cdr (assq 'same-frame args)) (cdr (assq 'same-window args)))
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
138 (let* ((pop-up-frames nil) (pop-up-windows t)
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
139 special-display-regexps special-display-buffer-names
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
140 (window (display-buffer buffer)))
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
141 ;; (set-window-dedicated-p window t)
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
142 window))
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
143 ;; If no window yet, make one in a new frame.
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
144 (let ((frame (make-frame (append args special-display-frame-alist))))
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
145 (set-window-buffer (frame-selected-window frame) buffer)
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
146 (set-window-dedicated-p (frame-selected-window frame) t)
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
147 (frame-selected-window frame))))))
7057
7102dd374da4 (special-display-frame-alist): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 7020
diff changeset
148
9175
df2f1773aa06 (handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8993
diff changeset
149 (defun handle-delete-frame (event)
25139
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
150 "Handle delete-frame events from the X server."
9175
df2f1773aa06 (handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8993
diff changeset
151 (interactive "e")
df2f1773aa06 (handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8993
diff changeset
152 (let ((frame (posn-window (event-start event)))
df2f1773aa06 (handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8993
diff changeset
153 (i 0)
df2f1773aa06 (handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8993
diff changeset
154 (tail (frame-list)))
df2f1773aa06 (handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8993
diff changeset
155 (while tail
df2f1773aa06 (handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8993
diff changeset
156 (and (frame-visible-p (car tail))
df2f1773aa06 (handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8993
diff changeset
157 (not (eq (car tail) frame))
df2f1773aa06 (handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8993
diff changeset
158 (setq i (1+ i)))
df2f1773aa06 (handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8993
diff changeset
159 (setq tail (cdr tail)))
df2f1773aa06 (handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8993
diff changeset
160 (if (> i 0)
df2f1773aa06 (handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents: 8993
diff changeset
161 (delete-frame frame t)
14701
ea592092c43c (handle-delete-frame): Use save-buffers-kill-emacs.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
162 ;; Gildea@x.org says it is ok to ask questions before terminating.
ea592092c43c (handle-delete-frame): Use save-buffers-kill-emacs.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
163 (save-buffers-kill-emacs))))
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
164
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
165 ;;;; Arrangement of frames at startup
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
166
39846
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
167 ;; 1) Load the window system startup file from the lisp library and read the
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
168 ;; high-priority arguments (-q and the like). The window system startup
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
169 ;; file should create any frames specified in the window system defaults.
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
170 ;;
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
171 ;; 2) If no frames have been opened, we open an initial text frame.
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
172 ;;
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
173 ;; 3) Once the init file is done, we apply any newly set parameters
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
174 ;; in initial-frame-alist to the frame.
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
175
10557
87b3ab910738 Fix typos.
Karl Heuer <kwzh@gnu.org>
parents: 10192
diff changeset
176 ;; These are now called explicitly at the proper times,
2763
a93e407bf41c Don't put frame-initialize and frame-notice-user-settings on hooks.
Richard M. Stallman <rms@gnu.org>
parents: 2571
diff changeset
177 ;; since that is easier to understand.
a93e407bf41c Don't put frame-initialize and frame-notice-user-settings on hooks.
Richard M. Stallman <rms@gnu.org>
parents: 2571
diff changeset
178 ;; Actually using hooks within Emacs is bad for future maintenance. --rms.
a93e407bf41c Don't put frame-initialize and frame-notice-user-settings on hooks.
Richard M. Stallman <rms@gnu.org>
parents: 2571
diff changeset
179 ;; (add-hook 'before-init-hook 'frame-initialize)
a93e407bf41c Don't put frame-initialize and frame-notice-user-settings on hooks.
Richard M. Stallman <rms@gnu.org>
parents: 2571
diff changeset
180 ;; (add-hook 'window-setup-hook 'frame-notice-user-settings)
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
181
39846
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
182 ;; If we create the initial frame, this is it.
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
183 (defvar frame-initial-frame nil)
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
184
4305
a39dcf68a29c (frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents: 3971
diff changeset
185 ;; Record the parameters used in frame-initialize to make the initial frame.
a39dcf68a29c (frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents: 3971
diff changeset
186 (defvar frame-initial-frame-alist)
a39dcf68a29c (frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents: 3971
diff changeset
187
7343
81f9ad98c323 (frame-notice-user-settings): When replacing the first
Richard M. Stallman <rms@gnu.org>
parents: 7322
diff changeset
188 (defvar frame-initial-geometry-arguments nil)
81f9ad98c323 (frame-notice-user-settings): When replacing the first
Richard M. Stallman <rms@gnu.org>
parents: 7322
diff changeset
189
39846
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
190 ;; startup.el calls this function before loading the user's init
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
191 ;; file - if there is no frame with a minibuffer open now, create
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
192 ;; one to display messages while loading the init file.
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
193 (defun frame-initialize ()
35697
6f48576daf85 (frame-initialize): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 35512
diff changeset
194 "Create an initial frame if necessary."
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
195 ;; Are we actually running under a window system at all?
83014
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
196 (if (and initial-window-system
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
197 (not noninteractive)
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
198 (not (eq initial-window-system 'pc)))
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
199 (progn
9737
1368ece6ec04 (frame-initialize): Set special-display-function here,
Richard M. Stallman <rms@gnu.org>
parents: 9687
diff changeset
200 ;; Turn on special-display processing only if there's a window system.
1368ece6ec04 (frame-initialize): Set special-display-function here,
Richard M. Stallman <rms@gnu.org>
parents: 9687
diff changeset
201 (setq special-display-function 'special-display-popup-frame)
1368ece6ec04 (frame-initialize): Set special-display-function here,
Richard M. Stallman <rms@gnu.org>
parents: 9687
diff changeset
202
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
203 ;; If there is no frame with a minibuffer besides the terminal
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
204 ;; frame, then we need to create the opening frame. Make sure
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
205 ;; it has a minibuffer, but let initial-frame-alist omit the
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
206 ;; minibuffer spec.
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
207 (or (delq terminal-frame (minibuffer-frame-list))
3050
8e2472cd4409 (frame-initialize): Handle `reverse' as parameter.
Richard M. Stallman <rms@gnu.org>
parents: 2870
diff changeset
208 (progn
4305
a39dcf68a29c (frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents: 3971
diff changeset
209 (setq frame-initial-frame-alist
35735
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
210 (append initial-frame-alist default-frame-alist nil))
7660
d47966265080 (frame-initialize): Record in frame-initial-frame-alist
Richard M. Stallman <rms@gnu.org>
parents: 7436
diff changeset
211 (or (assq 'horizontal-scroll-bars frame-initial-frame-alist)
d47966265080 (frame-initialize): Record in frame-initial-frame-alist
Richard M. Stallman <rms@gnu.org>
parents: 7436
diff changeset
212 (setq frame-initial-frame-alist
d47966265080 (frame-initialize): Record in frame-initial-frame-alist
Richard M. Stallman <rms@gnu.org>
parents: 7436
diff changeset
213 (cons '(horizontal-scroll-bars . t)
d47966265080 (frame-initialize): Record in frame-initial-frame-alist
Richard M. Stallman <rms@gnu.org>
parents: 7436
diff changeset
214 frame-initial-frame-alist)))
83014
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
215 (setq frame-initial-frame-alist
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
216 (cons (cons 'window-system initial-window-system)
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
217 frame-initial-frame-alist))
3050
8e2472cd4409 (frame-initialize): Handle `reverse' as parameter.
Richard M. Stallman <rms@gnu.org>
parents: 2870
diff changeset
218 (setq default-minibuffer-frame
8e2472cd4409 (frame-initialize): Handle `reverse' as parameter.
Richard M. Stallman <rms@gnu.org>
parents: 2870
diff changeset
219 (setq frame-initial-frame
18892
fb7337970b45 (frame-initialize): Don't alter vertical-scroll-bars
Richard M. Stallman <rms@gnu.org>
parents: 18481
diff changeset
220 (make-frame frame-initial-frame-alist)))
3433
2f5a9b79edf7 (frame-initialize): Delete geometry parms from initial-frame-alist.
Richard M. Stallman <rms@gnu.org>
parents: 3183
diff changeset
221 ;; Delete any specifications for window geometry parameters
2f5a9b79edf7 (frame-initialize): Delete geometry parms from initial-frame-alist.
Richard M. Stallman <rms@gnu.org>
parents: 3183
diff changeset
222 ;; so that we won't reapply them in frame-notice-user-settings.
2f5a9b79edf7 (frame-initialize): Delete geometry parms from initial-frame-alist.
Richard M. Stallman <rms@gnu.org>
parents: 3183
diff changeset
223 ;; It would be wrong to reapply them then,
2f5a9b79edf7 (frame-initialize): Delete geometry parms from initial-frame-alist.
Richard M. Stallman <rms@gnu.org>
parents: 3183
diff changeset
224 ;; because that would override explicit user resizing.
3971
6e7afc0a7fbc * frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
225 (setq initial-frame-alist
7309
beb9070c6fec (frame-initialize): Delete the code for reverse-video.
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
226 (frame-remove-geometry-params initial-frame-alist))))
10557
87b3ab910738 Fix typos.
Karl Heuer <kwzh@gnu.org>
parents: 10192
diff changeset
227 ;; At this point, we know that we have a frame open, so we
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
228 ;; can delete the terminal frame.
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
229 (delete-frame terminal-frame)
83014
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
230 (setq terminal-frame nil))))
10557
87b3ab910738 Fix typos.
Karl Heuer <kwzh@gnu.org>
parents: 10192
diff changeset
231
27319
a896ba4a496b (frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 26332
diff changeset
232 (defvar frame-notice-user-settings t
a896ba4a496b (frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 26332
diff changeset
233 "Non-nil means function `frame-notice-user-settings' wasn't run yet.")
a896ba4a496b (frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 26332
diff changeset
234
39846
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
235 ;; startup.el calls this function after loading the user's init
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
236 ;; file. Now default-frame-alist and initial-frame-alist contain
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
237 ;; information to which we must react; do what needs to be done.
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
238 (defun frame-notice-user-settings ()
25139
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
239 "Act on user's init file settings of frame parameters.
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
240 React to settings of `default-frame-alist', `initial-frame-alist' there."
8056
1c5fd2cdfb36 (frame-notice-user-settings): Make menu-bar-mode
Richard M. Stallman <rms@gnu.org>
parents: 7712
diff changeset
241 ;; Make menu-bar-mode and default-frame-alist consistent.
31899
ce212cd0463f (frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents: 31771
diff changeset
242 (when (boundp 'menu-bar-mode)
ce212cd0463f (frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents: 31771
diff changeset
243 (let ((default (assq 'menu-bar-lines default-frame-alist)))
ce212cd0463f (frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents: 31771
diff changeset
244 (if default
ce212cd0463f (frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents: 31771
diff changeset
245 (setq menu-bar-mode (not (eq (cdr default) 0)))
ce212cd0463f (frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents: 31771
diff changeset
246 (setq default-frame-alist
ce212cd0463f (frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents: 31771
diff changeset
247 (cons (cons 'menu-bar-lines (if menu-bar-mode 1 0))
ce212cd0463f (frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents: 31771
diff changeset
248 default-frame-alist)))))
41579
bab6e8eba0e1 comments indented properly
Sam Steingold <sds@gnu.org>
parents: 40673
diff changeset
249
31910
b54fba72959b (frame-notice-user-settings): Don't add a
Gerd Moellmann <gerd@gnu.org>
parents: 31899
diff changeset
250 ;; Make tool-bar-mode and default-frame-alist consistent. Don't do
b54fba72959b (frame-notice-user-settings): Don't add a
Gerd Moellmann <gerd@gnu.org>
parents: 31899
diff changeset
251 ;; it in batch mode since that would leave a tool-bar-lines
b54fba72959b (frame-notice-user-settings): Don't add a
Gerd Moellmann <gerd@gnu.org>
parents: 31899
diff changeset
252 ;; parameter in default-frame-alist in a dumped Emacs, which is not
35735
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
253 ;; what we want.
31910
b54fba72959b (frame-notice-user-settings): Don't add a
Gerd Moellmann <gerd@gnu.org>
parents: 31899
diff changeset
254 (when (and (boundp 'tool-bar-mode)
b54fba72959b (frame-notice-user-settings): Don't add a
Gerd Moellmann <gerd@gnu.org>
parents: 31899
diff changeset
255 (not noninteractive))
31899
ce212cd0463f (frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents: 31771
diff changeset
256 (let ((default (assq 'tool-bar-lines default-frame-alist)))
ce212cd0463f (frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents: 31771
diff changeset
257 (if default
ce212cd0463f (frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents: 31771
diff changeset
258 (setq tool-bar-mode (not (eq (cdr default) 0)))
ce212cd0463f (frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents: 31771
diff changeset
259 (setq default-frame-alist
ce212cd0463f (frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents: 31771
diff changeset
260 (cons (cons 'tool-bar-lines (if tool-bar-mode 1 0))
ce212cd0463f (frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents: 31771
diff changeset
261 default-frame-alist)))))
8056
1c5fd2cdfb36 (frame-notice-user-settings): Make menu-bar-mode
Richard M. Stallman <rms@gnu.org>
parents: 7712
diff changeset
262
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
263 ;; Creating and deleting frames may shift the selected frame around,
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
264 ;; and thus the current buffer. Protect against that. We don't
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
265 ;; want to use save-excursion here, because that may also try to set
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
266 ;; the buffer of the selected window, which fails when the selected
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
267 ;; window is the minibuffer.
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
268 (let ((old-buffer (current-buffer)))
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
269
27319
a896ba4a496b (frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 26332
diff changeset
270 (when (and frame-notice-user-settings
a896ba4a496b (frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 26332
diff changeset
271 (null frame-initial-frame))
33009
e7cb49941cb1 (frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents: 32752
diff changeset
272 ;; This case happens when we don't have a window system, and
e7cb49941cb1 (frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents: 32752
diff changeset
273 ;; also for MS-DOS frames.
27319
a896ba4a496b (frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 26332
diff changeset
274 (let ((parms (frame-parameters frame-initial-frame)))
a896ba4a496b (frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 26332
diff changeset
275 ;; Don't change the frame names.
a896ba4a496b (frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 26332
diff changeset
276 (setq parms (delq (assq 'name parms) parms))
a896ba4a496b (frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 26332
diff changeset
277 ;; Can't modify the minibuffer parameter, so don't try.
a896ba4a496b (frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 26332
diff changeset
278 (setq parms (delq (assq 'minibuffer parms) parms))
a896ba4a496b (frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 26332
diff changeset
279 (modify-frame-parameters nil
83014
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
280 (if (null initial-window-system)
33009
e7cb49941cb1 (frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents: 32752
diff changeset
281 (append initial-frame-alist
e7cb49941cb1 (frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents: 32752
diff changeset
282 default-frame-alist
e7cb49941cb1 (frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents: 32752
diff changeset
283 parms
e7cb49941cb1 (frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents: 32752
diff changeset
284 nil)
e7cb49941cb1 (frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents: 32752
diff changeset
285 ;; initial-frame-alist and
e7cb49941cb1 (frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents: 32752
diff changeset
286 ;; default-frame-alist were already
e7cb49941cb1 (frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents: 32752
diff changeset
287 ;; applied in pc-win.el.
e7cb49941cb1 (frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents: 32752
diff changeset
288 parms))
83014
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
289 (if (null initial-window-system) ;; MS-DOS does this differently in pc-win.el
33009
e7cb49941cb1 (frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents: 32752
diff changeset
290 (let ((newparms (frame-parameters))
e7cb49941cb1 (frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents: 32752
diff changeset
291 (frame (selected-frame)))
e7cb49941cb1 (frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents: 32752
diff changeset
292 (tty-handle-reverse-video frame newparms)
e7cb49941cb1 (frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents: 32752
diff changeset
293 ;; If we changed the background color, we need to update
e7cb49941cb1 (frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents: 32752
diff changeset
294 ;; the background-mode parameter, and maybe some faces,
e7cb49941cb1 (frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents: 32752
diff changeset
295 ;; too.
e7cb49941cb1 (frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents: 32752
diff changeset
296 (when (assq 'background-color newparms)
e7cb49941cb1 (frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents: 32752
diff changeset
297 (unless (or (assq 'background-mode initial-frame-alist)
e7cb49941cb1 (frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents: 32752
diff changeset
298 (assq 'background-mode default-frame-alist))
e7cb49941cb1 (frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents: 32752
diff changeset
299 (frame-set-background-mode frame))
e7cb49941cb1 (frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents: 32752
diff changeset
300 (face-set-after-frame-default frame))))))
27319
a896ba4a496b (frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 26332
diff changeset
301
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
302 ;; If the initial frame is still around, apply initial-frame-alist
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
303 ;; and default-frame-alist to it.
35735
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
304 (when (frame-live-p frame-initial-frame)
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
305
35735
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
306 ;; When tool-bar has been switched off, correct the frame size
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
307 ;; by the lines added in x-create-frame for the tool-bar and
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
308 ;; switch `tool-bar-mode' off.
35856
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
309 (when (display-graphic-p)
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
310 (let ((tool-bar-lines (or (assq 'tool-bar-lines initial-frame-alist)
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
311 (assq 'tool-bar-lines default-frame-alist))))
36317
34ffe86aeeae (frame-notice-user-settings): Only adjust frame height
Jason Rumney <jasonr@gnu.org>
parents: 36257
diff changeset
312 (when (and tool-bar-originally-present
34ffe86aeeae (frame-notice-user-settings): Only adjust frame height
Jason Rumney <jasonr@gnu.org>
parents: 36257
diff changeset
313 (or (null tool-bar-lines)
34ffe86aeeae (frame-notice-user-settings): Only adjust frame height
Jason Rumney <jasonr@gnu.org>
parents: 36257
diff changeset
314 (null (cdr tool-bar-lines))
34ffe86aeeae (frame-notice-user-settings): Only adjust frame height
Jason Rumney <jasonr@gnu.org>
parents: 36257
diff changeset
315 (eq 0 (cdr tool-bar-lines))))
35856
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
316 (let* ((char-height (frame-char-height frame-initial-frame))
36317
34ffe86aeeae (frame-notice-user-settings): Only adjust frame height
Jason Rumney <jasonr@gnu.org>
parents: 36257
diff changeset
317 (image-height tool-bar-images-pixel-height)
35856
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
318 (margin (cond ((and (consp tool-bar-button-margin)
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
319 (integerp (cdr tool-bar-button-margin))
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
320 (> tool-bar-button-margin 0))
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
321 (cdr tool-bar-button-margin))
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
322 ((and (integerp tool-bar-button-margin)
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
323 (> tool-bar-button-margin 0))
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
324 tool-bar-button-margin)
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
325 (t 0)))
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
326 (relief (if (and (integerp tool-bar-button-relief)
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
327 (> tool-bar-button-relief 0))
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
328 tool-bar-button-relief 3))
41579
bab6e8eba0e1 comments indented properly
Sam Steingold <sds@gnu.org>
parents: 40673
diff changeset
329 (lines (/ (+ image-height
35856
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
330 (* 2 margin)
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
331 (* 2 relief)
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
332 (1- char-height))
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
333 char-height))
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
334 (height (frame-parameter frame-initial-frame 'height))
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
335 (newparms (list (cons 'height (- height lines))))
41579
bab6e8eba0e1 comments indented properly
Sam Steingold <sds@gnu.org>
parents: 40673
diff changeset
336 (initial-top (cdr (assq 'top
35856
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
337 frame-initial-geometry-arguments)))
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
338 (top (frame-parameter frame-initial-frame 'top)))
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
339 (when (and (consp initial-top) (eq '- (car initial-top)))
53406
45cc6f8abd8d (pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents: 52614
diff changeset
340 (let ((adjusted-top
45cc6f8abd8d (pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents: 52614
diff changeset
341 (cond ((and (consp top)
45cc6f8abd8d (pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents: 52614
diff changeset
342 (eq '+ (car top)))
45cc6f8abd8d (pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents: 52614
diff changeset
343 (list '+
45cc6f8abd8d (pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents: 52614
diff changeset
344 (+ (cadr top)
45cc6f8abd8d (pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents: 52614
diff changeset
345 (* lines char-height))))
45cc6f8abd8d (pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents: 52614
diff changeset
346 ((and (consp top)
45cc6f8abd8d (pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents: 52614
diff changeset
347 (eq '- (car top)))
45cc6f8abd8d (pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents: 52614
diff changeset
348 (list '-
45cc6f8abd8d (pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents: 52614
diff changeset
349 (- (cadr top)
45cc6f8abd8d (pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents: 52614
diff changeset
350 (* lines char-height))))
45cc6f8abd8d (pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents: 52614
diff changeset
351 (t (+ top (* lines char-height))))))
45cc6f8abd8d (pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents: 52614
diff changeset
352 (setq newparms
45cc6f8abd8d (pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents: 52614
diff changeset
353 (append newparms
45cc6f8abd8d (pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents: 52614
diff changeset
354 `((top . ,adjusted-top))
45cc6f8abd8d (pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents: 52614
diff changeset
355 nil))))
35856
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
356 (modify-frame-parameters frame-initial-frame newparms)
41652bd90468 (frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents: 35738
diff changeset
357 (tool-bar-mode -1)))))
35735
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
358
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
359 ;; The initial frame we create above always has a minibuffer.
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
360 ;; If the user wants to remove it, or make it a minibuffer-only
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
361 ;; frame, then we'll have to delete the current frame and make a
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
362 ;; new one; you can't remove or add a root window to/from an
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
363 ;; existing frame.
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
364 ;;
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
365 ;; NOTE: default-frame-alist was nil when we created the
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
366 ;; existing frame. We need to explicitly include
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
367 ;; default-frame-alist in the parameters of the screen we
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
368 ;; create here, so that its new value, gleaned from the user's
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
369 ;; .emacs file, will be applied to the existing screen.
35738
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
370 (if (not (eq (cdr (or (assq 'minibuffer initial-frame-alist)
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
371 (assq 'minibuffer default-frame-alist)
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
372 '(minibuffer . t)))
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
373 t))
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
374 ;; Create the new frame.
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
375 (let (parms new)
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
376 ;; If the frame isn't visible yet, wait till it is.
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
377 ;; If the user has to position the window,
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
378 ;; Emacs doesn't know its real position until
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
379 ;; the frame is seen to be visible.
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
380 (while (not (cdr (assq 'visibility
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
381 (frame-parameters frame-initial-frame))))
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
382 (sleep-for 1))
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
383 (setq parms (frame-parameters frame-initial-frame))
35735
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
384
41579
bab6e8eba0e1 comments indented properly
Sam Steingold <sds@gnu.org>
parents: 40673
diff changeset
385 ;; Get rid of `name' unless it was specified explicitly before.
35738
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
386 (or (assq 'name frame-initial-frame-alist)
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
387 (setq parms (delq (assq 'name parms) parms)))
35735
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
388
35738
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
389 (setq parms (append initial-frame-alist
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
390 default-frame-alist
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
391 parms
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
392 nil))
35735
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
393
35738
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
394 ;; Get rid of `reverse', because that was handled
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
395 ;; when we first made the frame.
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
396 (setq parms (cons '(reverse) (delq (assq 'reverse parms) parms)))
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
397
35738
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
398 (if (assq 'height frame-initial-geometry-arguments)
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
399 (setq parms (assq-delete-all 'height parms)))
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
400 (if (assq 'width frame-initial-geometry-arguments)
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
401 (setq parms (assq-delete-all 'width parms)))
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
402 (if (assq 'left frame-initial-geometry-arguments)
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
403 (setq parms (assq-delete-all 'left parms)))
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
404 (if (assq 'top frame-initial-geometry-arguments)
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
405 (setq parms (assq-delete-all 'top parms)))
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
406 (setq new
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
407 (make-frame
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
408 ;; Use the geometry args that created the existing
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
409 ;; frame, rather than the parms we get for it.
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
410 (append frame-initial-geometry-arguments
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
411 '((user-size . t) (user-position . t))
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
412 parms)))
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
413 ;; The initial frame, which we are about to delete, may be
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
414 ;; the only frame with a minibuffer. If it is, create a
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
415 ;; new one.
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
416 (or (delq frame-initial-frame (minibuffer-frame-list))
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
417 (make-initial-minibuffer-frame nil))
35735
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
418
35738
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
419 ;; If the initial frame is serving as a surrogate
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
420 ;; minibuffer frame for any frames, we need to wean them
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
421 ;; onto a new frame. The default-minibuffer-frame
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
422 ;; variable must be handled similarly.
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
423 (let ((users-of-initial
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
424 (filtered-frame-list
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
425 (function (lambda (frame)
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
426 (and (not (eq frame frame-initial-frame))
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
427 (eq (window-frame
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
428 (minibuffer-window frame))
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
429 frame-initial-frame)))))))
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
430 (if (or users-of-initial
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
431 (eq default-minibuffer-frame frame-initial-frame))
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
432
35738
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
433 ;; Choose an appropriate frame. Prefer frames which
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
434 ;; are only minibuffers.
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
435 (let* ((new-surrogate
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
436 (car
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
437 (or (filtered-frame-list
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
438 (function
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
439 (lambda (frame)
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
440 (eq (cdr (assq 'minibuffer
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
441 (frame-parameters frame)))
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
442 'only))))
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
443 (minibuffer-frame-list))))
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
444 (new-minibuffer (minibuffer-window new-surrogate)))
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
445
35738
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
446 (if (eq default-minibuffer-frame frame-initial-frame)
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
447 (setq default-minibuffer-frame new-surrogate))
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
448
35738
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
449 ;; Wean the frames using frame-initial-frame as
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
450 ;; their minibuffer frame.
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
451 (mapcar
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
452 (function
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
453 (lambda (frame)
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
454 (modify-frame-parameters
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
455 frame (list (cons 'minibuffer new-minibuffer)))))
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
456 users-of-initial))))
1113
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 958
diff changeset
457
35738
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
458 ;; Redirect events enqueued at this frame to the new frame.
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
459 ;; Is this a good idea?
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
460 (redirect-frame-focus frame-initial-frame new)
1113
0ffcf74fb8ad entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 958
diff changeset
461
35738
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
462 ;; Finally, get rid of the old frame.
7b487e845547 (frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents: 35735
diff changeset
463 (delete-frame frame-initial-frame t))
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
464
35735
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
465 ;; Otherwise, we don't need all that rigamarole; just apply
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
466 ;; the new parameters.
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
467 (let (newparms allparms tail)
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
468 (setq allparms (append initial-frame-alist
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
469 default-frame-alist nil))
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
470 (if (assq 'height frame-initial-geometry-arguments)
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
471 (setq allparms (assq-delete-all 'height allparms)))
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
472 (if (assq 'width frame-initial-geometry-arguments)
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
473 (setq allparms (assq-delete-all 'width allparms)))
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
474 (if (assq 'left frame-initial-geometry-arguments)
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
475 (setq allparms (assq-delete-all 'left allparms)))
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
476 (if (assq 'top frame-initial-geometry-arguments)
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
477 (setq allparms (assq-delete-all 'top allparms)))
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
478 (setq tail allparms)
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
479 ;; Find just the parms that have changed since we first
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
480 ;; made this frame. Those are the ones actually set by
41579
bab6e8eba0e1 comments indented properly
Sam Steingold <sds@gnu.org>
parents: 40673
diff changeset
481 ;; the init file. For those parms whose values we already knew
35735
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
482 ;; (such as those spec'd by command line options)
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
483 ;; it is undesirable to specify the parm again
41579
bab6e8eba0e1 comments indented properly
Sam Steingold <sds@gnu.org>
parents: 40673
diff changeset
484 ;; once the user has seen the frame and been able to alter it
35735
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
485 ;; manually.
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
486 (while tail
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
487 (let (newval oldval)
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
488 (setq oldval (assq (car (car tail))
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
489 frame-initial-frame-alist))
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
490 (setq newval (cdr (assq (car (car tail)) allparms)))
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
491 (or (and oldval (eq (cdr oldval) newval))
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
492 (setq newparms
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
493 (cons (cons (car (car tail)) newval) newparms))))
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
494 (setq tail (cdr tail)))
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
495 (setq newparms (nreverse newparms))
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
496 (modify-frame-parameters frame-initial-frame
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
497 newparms)
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
498 ;; If we changed the background color,
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
499 ;; we need to update the background-mode parameter
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
500 ;; and maybe some faces too.
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
501 (when (assq 'background-color newparms)
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
502 (unless (assq 'background-mode newparms)
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
503 (frame-set-background-mode frame-initial-frame))
e20f7bc75418 (frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents: 35697
diff changeset
504 (face-set-after-frame-default frame-initial-frame)))))
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
505
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
506 ;; Restore the original buffer.
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
507 (set-buffer old-buffer)
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
508
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
509 ;; Make sure the initial frame can be GC'd if it is ever deleted.
2870
cd270fa53052 * frame.el (frame-notice-user-settings): Don't make
Jim Blandy <jimb@redhat.com>
parents: 2846
diff changeset
510 ;; Make sure frame-notice-user-settings does nothing if called twice.
27319
a896ba4a496b (frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 26332
diff changeset
511 (setq frame-notice-user-settings nil)
2870
cd270fa53052 * frame.el (frame-notice-user-settings): Don't make
Jim Blandy <jimb@redhat.com>
parents: 2846
diff changeset
512 (setq frame-initial-frame nil)))
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
513
12012
26aeed5ef544 (make-initial-minibuffer-frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11485
diff changeset
514 (defun make-initial-minibuffer-frame (display)
26aeed5ef544 (make-initial-minibuffer-frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11485
diff changeset
515 (let ((parms (append minibuffer-frame-alist '((minibuffer . only)))))
26aeed5ef544 (make-initial-minibuffer-frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11485
diff changeset
516 (if display
26aeed5ef544 (make-initial-minibuffer-frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11485
diff changeset
517 (make-frame-on-display display parms)
26aeed5ef544 (make-initial-minibuffer-frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11485
diff changeset
518 (make-frame parms))))
26aeed5ef544 (make-initial-minibuffer-frame): New function.
Karl Heuer <kwzh@gnu.org>
parents: 11485
diff changeset
519
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
520 ;;;; Creation of additional frames, and other frame miscellanea
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
521
51901
48f24a9d5a64 (modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents: 51507
diff changeset
522 (defun modify-all-frames-parameters (alist)
48f24a9d5a64 (modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents: 51507
diff changeset
523 "modify all current and future frames parameters according to ALIST.
48f24a9d5a64 (modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents: 51507
diff changeset
524 This changes `default-frame-alist' and possibly `initial-frame-alist'.
48f24a9d5a64 (modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents: 51507
diff changeset
525 See help of `modify-frame-parameters' for more information."
48f24a9d5a64 (modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents: 51507
diff changeset
526 (let (element) ;; temp
48f24a9d5a64 (modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents: 51507
diff changeset
527 (dolist (frame (frame-list))
48f24a9d5a64 (modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents: 51507
diff changeset
528 (modify-frame-parameters frame alist))
48f24a9d5a64 (modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents: 51507
diff changeset
529
48f24a9d5a64 (modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents: 51507
diff changeset
530 (dolist (pair alist) ;; conses to add/replace
48f24a9d5a64 (modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents: 51507
diff changeset
531 ;; initial-frame-alist needs setting only when
48f24a9d5a64 (modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents: 51507
diff changeset
532 ;; frame-notice-user-settings is true
48f24a9d5a64 (modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents: 51507
diff changeset
533 (and frame-notice-user-settings
48f24a9d5a64 (modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents: 51507
diff changeset
534 (setq element (assoc (car pair) initial-frame-alist))
48f24a9d5a64 (modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents: 51507
diff changeset
535 (setq initial-frame-alist (delq element initial-frame-alist)))
48f24a9d5a64 (modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents: 51507
diff changeset
536 (and (setq element (assoc (car pair) default-frame-alist))
48f24a9d5a64 (modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents: 51507
diff changeset
537 (setq default-frame-alist (delq element default-frame-alist)))))
48f24a9d5a64 (modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents: 51507
diff changeset
538 (and frame-notice-user-settings
48f24a9d5a64 (modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents: 51507
diff changeset
539 (setq initial-frame-alist (append initial-frame-alist alist)))
48f24a9d5a64 (modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents: 51507
diff changeset
540 (setq default-frame-alist (append default-frame-alist alist)))
48f24a9d5a64 (modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents: 51507
diff changeset
541
827
731cb9bcbad0 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 826
diff changeset
542 (defun get-other-frame ()
25139
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
543 "Return some frame other than the current frame.
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
544 Create one if necessary. Note that the minibuffer frame, if separate,
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
545 is not considered (see `next-frame')."
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
546 (let ((s (if (equal (next-frame (selected-frame)) (selected-frame))
7322
1f3536445289 (frame-notice-user-settings): Discard `reverse' when
Richard M. Stallman <rms@gnu.org>
parents: 7309
diff changeset
547 (make-frame)
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
548 (next-frame (selected-frame)))))
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
549 s))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
550
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
551 (defun next-multiframe-window ()
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
552 "Select the next window, regardless of which frame it is on."
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
553 (interactive)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
554 (select-window (next-window (selected-window)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
555 (> (minibuffer-depth) 0)
38781
c20b98060a6d (select-frame-set-input-focus): New function
Gerd Moellmann <gerd@gnu.org>
parents: 38469
diff changeset
556 t))
c20b98060a6d (select-frame-set-input-focus): New function
Gerd Moellmann <gerd@gnu.org>
parents: 38469
diff changeset
557 (select-frame-set-input-focus (selected-frame)))
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
558
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
559 (defun previous-multiframe-window ()
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
560 "Select the previous window, regardless of which frame it is on."
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
561 (interactive)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
562 (select-window (previous-window (selected-window)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
563 (> (minibuffer-depth) 0)
38781
c20b98060a6d (select-frame-set-input-focus): New function
Gerd Moellmann <gerd@gnu.org>
parents: 38469
diff changeset
564 t))
c20b98060a6d (select-frame-set-input-focus): New function
Gerd Moellmann <gerd@gnu.org>
parents: 38469
diff changeset
565 (select-frame-set-input-focus (selected-frame)))
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
566
9687
1048e2d032e6 (make-frame-on-display): New function.
Richard M. Stallman <rms@gnu.org>
parents: 9175
diff changeset
567 (defun make-frame-on-display (display &optional parameters)
1048e2d032e6 (make-frame-on-display): New function.
Richard M. Stallman <rms@gnu.org>
parents: 9175
diff changeset
568 "Make a frame on display DISPLAY.
1048e2d032e6 (make-frame-on-display): New function.
Richard M. Stallman <rms@gnu.org>
parents: 9175
diff changeset
569 The optional second argument PARAMETERS specifies additional frame parameters."
1048e2d032e6 (make-frame-on-display): New function.
Richard M. Stallman <rms@gnu.org>
parents: 9175
diff changeset
570 (interactive "sMake frame on display: ")
22232
96217e8a9b7f (make-frame-on-display): Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 22224
diff changeset
571 (or (string-match "\\`[^:]*:[0-9]+\\(\\.[0-9]+\\)?\\'" display)
96217e8a9b7f (make-frame-on-display): Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 22224
diff changeset
572 (error "Invalid display, not HOST:SERVER or HOST:SERVER.SCREEN"))
83018
1465425fe2d3 Romain Francoise's and Ami Fischman's bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents: 83016
diff changeset
573 (unless x-initialized
1465425fe2d3 Romain Francoise's and Ami Fischman's bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents: 83016
diff changeset
574 (setq x-display-name display)
1465425fe2d3 Romain Francoise's and Ami Fischman's bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents: 83016
diff changeset
575 (x-initialize-window-system))
83014
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
576 (make-frame `((window-system . x) (display . ,display) . ,parameters)))
9687
1048e2d032e6 (make-frame-on-display): New function.
Richard M. Stallman <rms@gnu.org>
parents: 9175
diff changeset
577
53233
fe9b37bee5f7 Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents: 52614
diff changeset
578 (defun make-frame-on-tty (device type &optional parameters)
fe9b37bee5f7 Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents: 52614
diff changeset
579 "Make a frame on terminal DEVICE which is of type TYPE (e.g., \"xterm\").
83014
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
580 The optional third argument PARAMETERS specifies additional frame parameters."
83004
7900111db01c Converted display hooks to be display-local. Plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents: 82990
diff changeset
581 (interactive "fOpen frame on tty device: \nsTerminal type of %s: ")
53233
fe9b37bee5f7 Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents: 52614
diff changeset
582 (unless device
fe9b37bee5f7 Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents: 52614
diff changeset
583 (error "Invalid terminal device"))
fe9b37bee5f7 Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents: 52614
diff changeset
584 (unless type
fe9b37bee5f7 Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents: 52614
diff changeset
585 (error "Invalid terminal type"))
83014
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
586 (make-frame `((window-system . nil) (tty . ,device) (tty-type . ,type) . ,parameters)))
53233
fe9b37bee5f7 Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents: 52614
diff changeset
587
15347
3885819ed860 (make-frame-command): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14701
diff changeset
588 (defun make-frame-command ()
3885819ed860 (make-frame-command): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14701
diff changeset
589 "Make a new frame, and select it if the terminal displays only one frame."
3885819ed860 (make-frame-command): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14701
diff changeset
590 (interactive)
15364
a4e1db62f693 (make-frame-command): Treat msdos like no window system.
Richard M. Stallman <rms@gnu.org>
parents: 15347
diff changeset
591 (if (and window-system (not (eq window-system 'pc)))
15347
3885819ed860 (make-frame-command): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14701
diff changeset
592 (make-frame)
3885819ed860 (make-frame-command): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14701
diff changeset
593 (select-frame (make-frame))))
3885819ed860 (make-frame-command): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14701
diff changeset
594
17163
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
595 (defvar before-make-frame-hook nil
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
596 "Functions to run before a frame is created.")
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
597
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
598 (defvar after-make-frame-functions nil
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
599 "Functions to run after a frame is created.
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
600 The functions are run with one arg, the newly created frame.")
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
601
33186
c63d52fc1eb7 (after-setting-font-hook): Rename hooks -> hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 33009
diff changeset
602 (defvar after-setting-font-hook nil
24982
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
603 "Functions to run after a frame's font has been changed.")
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
604
2246
1f0d48f7e583 (make-frame): Renamed from new-frame.
Richard M. Stallman <rms@gnu.org>
parents: 2202
diff changeset
605 ;; Alias, kept temporarily.
2571
b65cf676a09b All fsets changed to defaliases.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2246
diff changeset
606 (defalias 'new-frame 'make-frame)
50524
83d571fb0009 (new-frame): Add obsolescence declaration.
Juanma Barranquero <lekktu@gmail.com>
parents: 50523
diff changeset
607 (make-obsolete 'new-frame 'make-frame "21.4")
17163
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
608
2246
1f0d48f7e583 (make-frame): Renamed from new-frame.
Richard M. Stallman <rms@gnu.org>
parents: 2202
diff changeset
609 (defun make-frame (&optional parameters)
17163
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
610 "Return a newly created frame displaying the current buffer.
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
611 Optional argument PARAMETERS is an alist of parameters for the new frame.
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
612 Each element of PARAMETERS should have the form (NAME . VALUE), for example:
10574
132a846eba8e (make-frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 10557
diff changeset
613
17163
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
614 (name . STRING) The frame should be named STRING.
542
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
615
17163
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
616 (width . NUMBER) The frame should be NUMBER characters in width.
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
617 (height . NUMBER) The frame should be NUMBER text lines high.
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
618
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
619 You cannot specify either `width' or `height', you must use neither or both.
542
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
620
17163
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
621 (minibuffer . t) The frame should have a minibuffer.
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
622 (minibuffer . nil) The frame should have no minibuffer.
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
623 (minibuffer . only) The frame should contain only a minibuffer.
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
624 (minibuffer . WINDOW) The frame should use WINDOW as its minibuffer window.
542
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
625
83014
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
626 (window-system . nil) The frame should be displayed on a terminal device.
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
627 (window-system . x) The frame should be displayed in an X window.
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
628
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
629 Before the frame is created (via `frame-creation-function-alist'), functions on the
17163
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
630 hook `before-make-frame-hook' are run. After the frame is created, functions
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
631 on `after-make-frame-functions' are run with one arg, the newly created frame."
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
632 (interactive)
83014
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
633 (let* ((w (if (assq 'window-system parameters)
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
634 (cdr (assq 'window-system parameters))
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
635 window-system))
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
636 (frame-creation-function (cdr (assq w frame-creation-function-alist)))
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
637 frame)
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
638 (unless frame-creation-function
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
639 (error "Don't know how to create a frame on window system %s" w))
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
640 (run-hooks 'before-make-frame-hook)
83016
1d7467694692 Fix initialization of the window-system variable.
Karoly Lorentey <lorentey@elte.hu>
parents: 83014
diff changeset
641 (setq frame (funcall frame-creation-function parameters))
17163
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
642 (run-hook-with-args 'after-make-frame-functions frame)
a63a326604ae defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents: 16963
diff changeset
643 frame))
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
644
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
645 (defun filtered-frame-list (predicate)
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
646 "Return a list of all live frames which satisfy PREDICATE."
31450
82556406aa45 (filtered-frame-list): Reduce consing.
Gerd Moellmann <gerd@gnu.org>
parents: 31400
diff changeset
647 (let* ((frames (frame-list))
82556406aa45 (filtered-frame-list): Reduce consing.
Gerd Moellmann <gerd@gnu.org>
parents: 31400
diff changeset
648 (list frames))
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
649 (while (consp frames)
31450
82556406aa45 (filtered-frame-list): Reduce consing.
Gerd Moellmann <gerd@gnu.org>
parents: 31400
diff changeset
650 (unless (funcall predicate (car frames))
82556406aa45 (filtered-frame-list): Reduce consing.
Gerd Moellmann <gerd@gnu.org>
parents: 31400
diff changeset
651 (setcar frames nil))
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
652 (setq frames (cdr frames)))
31450
82556406aa45 (filtered-frame-list): Reduce consing.
Gerd Moellmann <gerd@gnu.org>
parents: 31400
diff changeset
653 (delq nil list)))
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
654
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
655 (defun minibuffer-frame-list ()
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
656 "Return a list of all frames with their own minibuffers."
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
657 (filtered-frame-list
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
658 (function (lambda (frame)
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
659 (eq frame (window-frame (minibuffer-window frame)))))))
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
660
27570
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
661 (defun frames-on-display-list (&optional display)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
662 "Return a list of all frames on DISPLAY.
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
663 DISPLAY is a name of a display, a string of the form HOST:SERVER.SCREEN.
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
664 If DISPLAY is omitted or nil, it defaults to the selected frame's display."
31450
82556406aa45 (filtered-frame-list): Reduce consing.
Gerd Moellmann <gerd@gnu.org>
parents: 31400
diff changeset
665 (let* ((display (or display (frame-parameter nil 'display)))
82556406aa45 (filtered-frame-list): Reduce consing.
Gerd Moellmann <gerd@gnu.org>
parents: 31400
diff changeset
666 (func #'(lambda (frame)
44547
923e4481a0b2 (frames-on-display-list): Use `equal' to compare the
Eli Zaretskii <eliz@gnu.org>
parents: 44049
diff changeset
667 (equal (frame-parameter frame 'display) display))))
27570
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
668 (filtered-frame-list func)))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
669
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
670 (defun framep-on-display (&optional display)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
671 "Return the type of frames on DISPLAY.
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
672 DISPLAY may be a display name or a frame. If it is a frame, its type is
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
673 returned.
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
674 If DISPLAY is omitted or nil, it defaults to the selected frame's display.
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
675 All frames on a given display are of the same type."
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
676 (or (framep display)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
677 (framep (car (frames-on-display-list display)))))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
678
3971
6e7afc0a7fbc * frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
679 (defun frame-remove-geometry-params (param-list)
6e7afc0a7fbc * frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
680 "Return the parameter list PARAM-LIST, but with geometry specs removed.
6e7afc0a7fbc * frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
681 This deletes all bindings in PARAM-LIST for `top', `left', `width',
7343
81f9ad98c323 (frame-notice-user-settings): When replacing the first
Richard M. Stallman <rms@gnu.org>
parents: 7322
diff changeset
682 `height', `user-size' and `user-position' parameters.
3971
6e7afc0a7fbc * frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
683 Emacs uses this to avoid overriding explicit moves and resizings from
6e7afc0a7fbc * frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
684 the user during startup."
6e7afc0a7fbc * frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
685 (setq param-list (cons nil param-list))
6e7afc0a7fbc * frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
686 (let ((tail param-list))
6e7afc0a7fbc * frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
687 (while (consp (cdr tail))
6e7afc0a7fbc * frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
688 (if (and (consp (car (cdr tail)))
7343
81f9ad98c323 (frame-notice-user-settings): When replacing the first
Richard M. Stallman <rms@gnu.org>
parents: 7322
diff changeset
689 (memq (car (car (cdr tail)))
81f9ad98c323 (frame-notice-user-settings): When replacing the first
Richard M. Stallman <rms@gnu.org>
parents: 7322
diff changeset
690 '(height width top left user-position user-size)))
81f9ad98c323 (frame-notice-user-settings): When replacing the first
Richard M. Stallman <rms@gnu.org>
parents: 7322
diff changeset
691 (progn
81f9ad98c323 (frame-notice-user-settings): When replacing the first
Richard M. Stallman <rms@gnu.org>
parents: 7322
diff changeset
692 (setq frame-initial-geometry-arguments
81f9ad98c323 (frame-notice-user-settings): When replacing the first
Richard M. Stallman <rms@gnu.org>
parents: 7322
diff changeset
693 (cons (car (cdr tail)) frame-initial-geometry-arguments))
81f9ad98c323 (frame-notice-user-settings): When replacing the first
Richard M. Stallman <rms@gnu.org>
parents: 7322
diff changeset
694 (setcdr tail (cdr (cdr tail))))
3971
6e7afc0a7fbc * frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
695 (setq tail (cdr tail)))))
7436
b20221c93fbb (frame-remove-geometry-params): Reverse the computed list, to preserve the
Karl Heuer <kwzh@gnu.org>
parents: 7357
diff changeset
696 (setq frame-initial-geometry-arguments
b20221c93fbb (frame-remove-geometry-params): Reverse the computed list, to preserve the
Karl Heuer <kwzh@gnu.org>
parents: 7357
diff changeset
697 (nreverse frame-initial-geometry-arguments))
3971
6e7afc0a7fbc * frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
698 (cdr param-list))
6e7afc0a7fbc * frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents: 3966
diff changeset
699
21215
2702850b72d6 (focus-follows-mouse): Make it defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 21214
diff changeset
700 (defcustom focus-follows-mouse t
43545
731c6d3cea6c (focus-follows-mouse): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 43434
diff changeset
701 "*Non-nil if window system changes focus when you move the mouse.
731c6d3cea6c (focus-follows-mouse): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 43434
diff changeset
702 You should set this variable to tell Emacs how your window manager
731c6d3cea6c (focus-follows-mouse): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 43434
diff changeset
703 handles focus, since there is no way in general for Emacs to find out
731c6d3cea6c (focus-follows-mouse): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 43434
diff changeset
704 automatically."
21215
2702850b72d6 (focus-follows-mouse): Make it defcustom.
Richard M. Stallman <rms@gnu.org>
parents: 21214
diff changeset
705 :type 'boolean
21669
9861518505cb *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21216
diff changeset
706 :group 'frames
9861518505cb *** empty log message ***
Dan Nicolaescu <done@ece.arizona.edu>
parents: 21216
diff changeset
707 :version "20.3")
21214
7a873226ee07 (focus-follows-mouse): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 20386
diff changeset
708
38781
c20b98060a6d (select-frame-set-input-focus): New function
Gerd Moellmann <gerd@gnu.org>
parents: 38469
diff changeset
709 (defun select-frame-set-input-focus (frame)
c20b98060a6d (select-frame-set-input-focus): New function
Gerd Moellmann <gerd@gnu.org>
parents: 38469
diff changeset
710 "Select FRAME, raise it, and set input focus, if possible."
c20b98060a6d (select-frame-set-input-focus): New function
Gerd Moellmann <gerd@gnu.org>
parents: 38469
diff changeset
711 (select-frame frame)
c20b98060a6d (select-frame-set-input-focus): New function
Gerd Moellmann <gerd@gnu.org>
parents: 38469
diff changeset
712 (raise-frame frame)
c20b98060a6d (select-frame-set-input-focus): New function
Gerd Moellmann <gerd@gnu.org>
parents: 38469
diff changeset
713 ;; Ensure, if possible, that frame gets input focus.
83009
b2b37c85b00a Numerous bugfixes and small improvements.
Karoly Lorentey <lorentey@elte.hu>
parents: 83008
diff changeset
714 (cond ((eq (window-system frame) 'x)
47016
876e9026e464 (select-frame-by-name, select-frame-set-input-focus):
Richard M. Stallman <rms@gnu.org>
parents: 44547
diff changeset
715 (x-focus-frame frame))
83009
b2b37c85b00a Numerous bugfixes and small improvements.
Karoly Lorentey <lorentey@elte.hu>
parents: 83008
diff changeset
716 ((eq (window-system frame) 'w32)
47016
876e9026e464 (select-frame-by-name, select-frame-set-input-focus):
Richard M. Stallman <rms@gnu.org>
parents: 44547
diff changeset
717 (w32-focus-frame frame)))
38781
c20b98060a6d (select-frame-set-input-focus): New function
Gerd Moellmann <gerd@gnu.org>
parents: 38469
diff changeset
718 (cond (focus-follows-mouse
47016
876e9026e464 (select-frame-by-name, select-frame-set-input-focus):
Richard M. Stallman <rms@gnu.org>
parents: 44547
diff changeset
719 (set-mouse-position (selected-frame) (1- (frame-width)) 0))))
38781
c20b98060a6d (select-frame-set-input-focus): New function
Gerd Moellmann <gerd@gnu.org>
parents: 38469
diff changeset
720
4425
1b48826df9cb (other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents: 4360
diff changeset
721 (defun other-frame (arg)
39505
b7d5e9ab6f93 (select-frame-by-name, other-frame): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 38812
diff changeset
722 "Select the ARG'th different visible frame on current display, and raise it.
4425
1b48826df9cb (other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents: 4360
diff changeset
723 All frames are arranged in a cyclic order.
1b48826df9cb (other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents: 4360
diff changeset
724 This command selects the frame ARG steps away in that order.
43434
d1a09152b7b5 (other-frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 42952
diff changeset
725 A negative ARG moves in the opposite order.
d1a09152b7b5 (other-frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 42952
diff changeset
726
d1a09152b7b5 (other-frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 42952
diff changeset
727 To make this command work properly, you must tell Emacs
d1a09152b7b5 (other-frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 42952
diff changeset
728 how the system (or the window manager) generally handles
d1a09152b7b5 (other-frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 42952
diff changeset
729 focus-switching between windows. If moving the mouse onto a window
d1a09152b7b5 (other-frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 42952
diff changeset
730 selects it (gives it focus), set `focus-follows-mouse' to t.
d1a09152b7b5 (other-frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 42952
diff changeset
731 Otherwise, that variable should be nil."
4425
1b48826df9cb (other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents: 4360
diff changeset
732 (interactive "p")
1b48826df9cb (other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents: 4360
diff changeset
733 (let ((frame (selected-frame)))
1b48826df9cb (other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents: 4360
diff changeset
734 (while (> arg 0)
4431
2fe6adb8a82f (other-frame): Skip iconified and invisible frames.
Roland McGrath <roland@gnu.org>
parents: 4425
diff changeset
735 (setq frame (next-frame frame))
2fe6adb8a82f (other-frame): Skip iconified and invisible frames.
Roland McGrath <roland@gnu.org>
parents: 4425
diff changeset
736 (while (not (eq (frame-visible-p frame) t))
2fe6adb8a82f (other-frame): Skip iconified and invisible frames.
Roland McGrath <roland@gnu.org>
parents: 4425
diff changeset
737 (setq frame (next-frame frame)))
2fe6adb8a82f (other-frame): Skip iconified and invisible frames.
Roland McGrath <roland@gnu.org>
parents: 4425
diff changeset
738 (setq arg (1- arg)))
4425
1b48826df9cb (other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents: 4360
diff changeset
739 (while (< arg 0)
4431
2fe6adb8a82f (other-frame): Skip iconified and invisible frames.
Roland McGrath <roland@gnu.org>
parents: 4425
diff changeset
740 (setq frame (previous-frame frame))
2fe6adb8a82f (other-frame): Skip iconified and invisible frames.
Roland McGrath <roland@gnu.org>
parents: 4425
diff changeset
741 (while (not (eq (frame-visible-p frame) t))
2fe6adb8a82f (other-frame): Skip iconified and invisible frames.
Roland McGrath <roland@gnu.org>
parents: 4425
diff changeset
742 (setq frame (previous-frame frame)))
4553
ceb140c16ad2 (other-frame): Fix error in loop counting.
Richard M. Stallman <rms@gnu.org>
parents: 4431
diff changeset
743 (setq arg (1+ arg)))
38781
c20b98060a6d (select-frame-set-input-focus): New function
Gerd Moellmann <gerd@gnu.org>
parents: 38469
diff changeset
744 (select-frame-set-input-focus frame)))
20386
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
745
51180
8444fb4d51cf (iconify-or-deiconify-frame): Move from term/x-win.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50533
diff changeset
746 (defun iconify-or-deiconify-frame ()
8444fb4d51cf (iconify-or-deiconify-frame): Move from term/x-win.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50533
diff changeset
747 "Iconify the selected frame, or deiconify if it's currently an icon."
8444fb4d51cf (iconify-or-deiconify-frame): Move from term/x-win.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50533
diff changeset
748 (interactive)
8444fb4d51cf (iconify-or-deiconify-frame): Move from term/x-win.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50533
diff changeset
749 (if (eq (cdr (assq 'visibility (frame-parameters))) t)
8444fb4d51cf (iconify-or-deiconify-frame): Move from term/x-win.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50533
diff changeset
750 (iconify-frame)
8444fb4d51cf (iconify-or-deiconify-frame): Move from term/x-win.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50533
diff changeset
751 (make-frame-visible)))
8444fb4d51cf (iconify-or-deiconify-frame): Move from term/x-win.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 50533
diff changeset
752
20386
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
753 (defun make-frame-names-alist ()
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
754 (let* ((current-frame (selected-frame))
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
755 (falist
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
756 (cons
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
757 (cons (frame-parameter current-frame 'name) current-frame) nil))
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
758 (frame (next-frame nil t)))
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
759 (while (not (eq frame current-frame))
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
760 (progn
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
761 (setq falist (cons (cons (frame-parameter frame 'name) frame) falist))
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
762 (setq frame (next-frame frame t))))
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
763 falist))
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
764
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
765 (defvar frame-name-history nil)
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
766 (defun select-frame-by-name (name)
39505
b7d5e9ab6f93 (select-frame-by-name, other-frame): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 38812
diff changeset
767 "Select the frame on the current terminal whose name is NAME and raise it.
20386
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
768 If there is no frame by that name, signal an error."
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
769 (interactive
21730
efa1c31f068c (frame-name-alist): Remove this variable.
Richard M. Stallman <rms@gnu.org>
parents: 21669
diff changeset
770 (let* ((frame-names-alist (make-frame-names-alist))
efa1c31f068c (frame-name-alist): Remove this variable.
Richard M. Stallman <rms@gnu.org>
parents: 21669
diff changeset
771 (default (car (car frame-names-alist)))
efa1c31f068c (frame-name-alist): Remove this variable.
Richard M. Stallman <rms@gnu.org>
parents: 21669
diff changeset
772 (input (completing-read
efa1c31f068c (frame-name-alist): Remove this variable.
Richard M. Stallman <rms@gnu.org>
parents: 21669
diff changeset
773 (format "Select Frame (default %s): " default)
efa1c31f068c (frame-name-alist): Remove this variable.
Richard M. Stallman <rms@gnu.org>
parents: 21669
diff changeset
774 frame-names-alist nil t nil 'frame-name-history)))
20386
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
775 (if (= (length input) 0)
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
776 (list default)
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
777 (list input))))
21730
efa1c31f068c (frame-name-alist): Remove this variable.
Richard M. Stallman <rms@gnu.org>
parents: 21669
diff changeset
778 (let* ((frame-names-alist (make-frame-names-alist))
efa1c31f068c (frame-name-alist): Remove this variable.
Richard M. Stallman <rms@gnu.org>
parents: 21669
diff changeset
779 (frame (cdr (assoc name frame-names-alist))))
20386
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
780 (or frame
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
781 (error "There is no frame named `%s'" name))
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
782 (make-frame-visible frame)
25ca60b3ca09 (make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents: 20281
diff changeset
783 (raise-frame frame)
24207
69b4c339845d (select-frame-by-name): Obey focus-follows-mouse.
Andrew Innes <andrewi@gnu.org>
parents: 23763
diff changeset
784 (select-frame frame)
69b4c339845d (select-frame-by-name): Obey focus-follows-mouse.
Andrew Innes <andrewi@gnu.org>
parents: 23763
diff changeset
785 ;; Ensure, if possible, that frame gets input focus.
83014
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
786 (cond ((eq (window-system frame) 'x)
47016
876e9026e464 (select-frame-by-name, select-frame-set-input-focus):
Richard M. Stallman <rms@gnu.org>
parents: 44547
diff changeset
787 (x-focus-frame frame))
83014
f5cadabb36dd Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents: 83009
diff changeset
788 ((eq (window-system frame) 'w32)
47016
876e9026e464 (select-frame-by-name, select-frame-set-input-focus):
Richard M. Stallman <rms@gnu.org>
parents: 44547
diff changeset
789 (w32-focus-frame frame)))
876e9026e464 (select-frame-by-name, select-frame-set-input-focus):
Richard M. Stallman <rms@gnu.org>
parents: 44547
diff changeset
790 (when focus-follows-mouse
876e9026e464 (select-frame-by-name, select-frame-set-input-focus):
Richard M. Stallman <rms@gnu.org>
parents: 44547
diff changeset
791 (set-mouse-position frame (1- (frame-width frame)) 0))))
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
792
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
793 ;;;; Frame configurations
756
0276f8eb306f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
794
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
795 (defun current-frame-configuration ()
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
796 "Return a list describing the positions and states of all frames.
2202
081afcef5e85 Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents: 2069
diff changeset
797 Its car is `frame-configuration'.
081afcef5e85 Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents: 2069
diff changeset
798 Each element of the cdr is a list of the form (FRAME ALIST WINDOW-CONFIG),
081afcef5e85 Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents: 2069
diff changeset
799 where
081afcef5e85 Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents: 2069
diff changeset
800 FRAME is a frame object,
081afcef5e85 Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents: 2069
diff changeset
801 ALIST is an association list specifying some of FRAME's parameters, and
081afcef5e85 Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents: 2069
diff changeset
802 WINDOW-CONFIG is a window configuration object for FRAME."
081afcef5e85 Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents: 2069
diff changeset
803 (cons 'frame-configuration
081afcef5e85 Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents: 2069
diff changeset
804 (mapcar (function
081afcef5e85 Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents: 2069
diff changeset
805 (lambda (frame)
081afcef5e85 Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents: 2069
diff changeset
806 (list frame
081afcef5e85 Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents: 2069
diff changeset
807 (frame-parameters frame)
081afcef5e85 Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents: 2069
diff changeset
808 (current-window-configuration frame))))
081afcef5e85 Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents: 2069
diff changeset
809 (frame-list))))
756
0276f8eb306f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
810
4670
e39967101d8b (set-frame-configuration): Take new optional arg NODELETE; if non-nil,
Roland McGrath <roland@gnu.org>
parents: 4625
diff changeset
811 (defun set-frame-configuration (configuration &optional nodelete)
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
812 "Restore the frames to the state described by CONFIGURATION.
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
813 Each frame listed in CONFIGURATION has its position, size, window
4670
e39967101d8b (set-frame-configuration): Take new optional arg NODELETE; if non-nil,
Roland McGrath <roland@gnu.org>
parents: 4625
diff changeset
814 configuration, and other parameters set as specified in CONFIGURATION.
4919
3963d8a9f342 (set-frame-configuration): If NODELETE, make the unwanted frames invisible.
Richard M. Stallman <rms@gnu.org>
parents: 4911
diff changeset
815 Ordinarily, this function deletes all existing frames not
3963d8a9f342 (set-frame-configuration): If NODELETE, make the unwanted frames invisible.
Richard M. Stallman <rms@gnu.org>
parents: 4911
diff changeset
816 listed in CONFIGURATION. But if optional second argument NODELETE
4930
04dee67f86cf (set-frame-configuration): Iconify frames
Richard M. Stallman <rms@gnu.org>
parents: 4919
diff changeset
817 is given and non-nil, the unwanted frames are iconified instead."
2202
081afcef5e85 Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents: 2069
diff changeset
818 (or (frame-configuration-p configuration)
081afcef5e85 Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents: 2069
diff changeset
819 (signal 'wrong-type-argument
081afcef5e85 Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents: 2069
diff changeset
820 (list 'frame-configuration-p configuration)))
081afcef5e85 Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents: 2069
diff changeset
821 (let ((config-alist (cdr configuration))
081afcef5e85 Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents: 2069
diff changeset
822 frames-to-delete)
756
0276f8eb306f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
823 (mapcar (function
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
824 (lambda (frame)
2202
081afcef5e85 Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents: 2069
diff changeset
825 (let ((parameters (assq frame config-alist)))
756
0276f8eb306f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
826 (if parameters
0276f8eb306f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
827 (progn
3764
d965878f294f * frame.el (set-frame-configuration): Don't try to set a frame's
Jim Blandy <jimb@redhat.com>
parents: 3647
diff changeset
828 (modify-frame-parameters
d965878f294f * frame.el (set-frame-configuration): Don't try to set a frame's
Jim Blandy <jimb@redhat.com>
parents: 3647
diff changeset
829 frame
10557
87b3ab910738 Fix typos.
Karl Heuer <kwzh@gnu.org>
parents: 10192
diff changeset
830 ;; Since we can't set a frame's minibuffer status,
3764
d965878f294f * frame.el (set-frame-configuration): Don't try to set a frame's
Jim Blandy <jimb@redhat.com>
parents: 3647
diff changeset
831 ;; we might as well omit the parameter altogether.
d965878f294f * frame.el (set-frame-configuration): Don't try to set a frame's
Jim Blandy <jimb@redhat.com>
parents: 3647
diff changeset
832 (let* ((parms (nth 1 parameters))
d965878f294f * frame.el (set-frame-configuration): Don't try to set a frame's
Jim Blandy <jimb@redhat.com>
parents: 3647
diff changeset
833 (mini (assq 'minibuffer parms)))
d965878f294f * frame.el (set-frame-configuration): Don't try to set a frame's
Jim Blandy <jimb@redhat.com>
parents: 3647
diff changeset
834 (if mini (setq parms (delq mini parms)))
d965878f294f * frame.el (set-frame-configuration): Don't try to set a frame's
Jim Blandy <jimb@redhat.com>
parents: 3647
diff changeset
835 parms))
756
0276f8eb306f *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 727
diff changeset
836 (set-window-configuration (nth 2 parameters)))
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
837 (setq frames-to-delete (cons frame frames-to-delete))))))
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
838 (frame-list))
4919
3963d8a9f342 (set-frame-configuration): If NODELETE, make the unwanted frames invisible.
Richard M. Stallman <rms@gnu.org>
parents: 4911
diff changeset
839 (if nodelete
4930
04dee67f86cf (set-frame-configuration): Iconify frames
Richard M. Stallman <rms@gnu.org>
parents: 4919
diff changeset
840 ;; Note: making frames invisible here was tried
04dee67f86cf (set-frame-configuration): Iconify frames
Richard M. Stallman <rms@gnu.org>
parents: 4919
diff changeset
841 ;; but led to some strange behavior--each time the frame
04dee67f86cf (set-frame-configuration): Iconify frames
Richard M. Stallman <rms@gnu.org>
parents: 4919
diff changeset
842 ;; was made visible again, the window manager asked afresh
04dee67f86cf (set-frame-configuration): Iconify frames
Richard M. Stallman <rms@gnu.org>
parents: 4919
diff changeset
843 ;; for where to put it.
04dee67f86cf (set-frame-configuration): Iconify frames
Richard M. Stallman <rms@gnu.org>
parents: 4919
diff changeset
844 (mapcar 'iconify-frame frames-to-delete)
4919
3963d8a9f342 (set-frame-configuration): If NODELETE, make the unwanted frames invisible.
Richard M. Stallman <rms@gnu.org>
parents: 4911
diff changeset
845 (mapcar 'delete-frame frames-to-delete))))
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
846
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
847 ;;;; Convenience functions for accessing and interactively changing
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
848 ;;;; frame parameters.
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
849
826
e9b9a1cff2c9 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 811
diff changeset
850 (defun frame-height (&optional frame)
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
851 "Return number of lines available for display on FRAME.
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
852 If FRAME is omitted, describe the currently selected frame."
826
e9b9a1cff2c9 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 811
diff changeset
853 (cdr (assq 'height (frame-parameters frame))))
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
854
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
855 (defun frame-width (&optional frame)
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
856 "Return number of columns available for display on FRAME.
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
857 If FRAME is omitted, describe the currently selected frame."
826
e9b9a1cff2c9 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 811
diff changeset
858 (cdr (assq 'width (frame-parameters frame))))
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
859
16963
7daaf9702c47 (set-frame-font): Renamed from set-default-font,
Richard M. Stallman <rms@gnu.org>
parents: 16516
diff changeset
860 (defalias 'set-default-font 'set-frame-font)
50522
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
861 (defun set-frame-font (font-name &optional keep-size)
25139
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
862 "Set the font of the selected frame to FONT-NAME.
16047
182b9268dbad Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15399
diff changeset
863 When called interactively, prompt for the name of the font to use.
50522
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
864 To get the frame's current default font, use `frame-parameters'.
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
865
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
866 The default behavior is to keep the numbers of lines and columns in
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
867 the frame, thus may change its pixel size. If optional KEEP-SIZE is
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
868 non-nil (interactively, prefix argument) the current frame size (in
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
869 pixels) is kept by adjusting the numbers of the lines and columns."
41579
bab6e8eba0e1 comments indented properly
Sam Steingold <sds@gnu.org>
parents: 40673
diff changeset
870 (interactive
50522
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
871 (let* ((completion-ignore-case t)
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
872 (font (completing-read "Font name: "
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
873 (mapcar #'list
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
874 ;; x-list-fonts will fail with an error
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
875 ;; if this frame doesn't support fonts.
51507
e4e1e9a6becf (set-frame-font): Default to frame's current default font.
Miles Bader <miles@gnu.org>
parents: 51180
diff changeset
876 (x-list-fonts "*" nil (selected-frame)))
e4e1e9a6becf (set-frame-font): Default to frame's current default font.
Miles Bader <miles@gnu.org>
parents: 51180
diff changeset
877 nil nil nil nil
e4e1e9a6becf (set-frame-font): Default to frame's current default font.
Miles Bader <miles@gnu.org>
parents: 51180
diff changeset
878 (frame-parameter nil 'font))))
50522
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
879 (list font current-prefix-arg)))
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
880 (let (fht fwd)
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
881 (if keep-size
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
882 (setq fht (* (frame-parameter nil 'height) (frame-char-height))
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
883 fwd (* (frame-parameter nil 'width) (frame-char-width))))
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
884 (modify-frame-parameters (selected-frame)
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
885 (list (cons 'font font-name)))
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
886 (if keep-size
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
887 (modify-frame-parameters
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
888 (selected-frame)
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
889 (list (cons 'height (round fht (frame-char-height)))
ac9f1c53789e (set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents: 47738
diff changeset
890 (cons 'width (round fwd (frame-char-width)))))))
33186
c63d52fc1eb7 (after-setting-font-hook): Rename hooks -> hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 33009
diff changeset
891 (run-hooks 'after-setting-font-hook 'after-setting-font-hooks))
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
892
39846
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
893 (defun set-frame-parameter (frame parameter value)
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
894 (modify-frame-parameters frame (list (cons parameter value))))
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
895
1881
436edc3e74f6 (frame-initialize): Fix error syntax.
Richard M. Stallman <rms@gnu.org>
parents: 1863
diff changeset
896 (defun set-background-color (color-name)
25139
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
897 "Set the background color of the selected frame to COLOR-NAME.
16047
182b9268dbad Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15399
diff changeset
898 When called interactively, prompt for the name of the color to use.
182b9268dbad Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15399
diff changeset
899 To get the frame's current background color, use `frame-parameters'."
25139
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
900 (interactive (list (facemenu-read-color)))
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
901 (modify-frame-parameters (selected-frame)
40673
377344c6e1f1 (set-background-color, set-foreground-color): Call
Eli Zaretskii <eliz@gnu.org>
parents: 40467
diff changeset
902 (list (cons 'background-color color-name)))
377344c6e1f1 (set-background-color, set-foreground-color): Call
Eli Zaretskii <eliz@gnu.org>
parents: 40467
diff changeset
903 (or window-system
377344c6e1f1 (set-background-color, set-foreground-color): Call
Eli Zaretskii <eliz@gnu.org>
parents: 40467
diff changeset
904 (face-set-after-frame-default (selected-frame))))
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
905
1881
436edc3e74f6 (frame-initialize): Fix error syntax.
Richard M. Stallman <rms@gnu.org>
parents: 1863
diff changeset
906 (defun set-foreground-color (color-name)
25139
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
907 "Set the foreground color of the selected frame to COLOR-NAME.
16047
182b9268dbad Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15399
diff changeset
908 When called interactively, prompt for the name of the color to use.
182b9268dbad Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15399
diff changeset
909 To get the frame's current foreground color, use `frame-parameters'."
25139
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
910 (interactive (list (facemenu-read-color)))
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
911 (modify-frame-parameters (selected-frame)
40673
377344c6e1f1 (set-background-color, set-foreground-color): Call
Eli Zaretskii <eliz@gnu.org>
parents: 40467
diff changeset
912 (list (cons 'foreground-color color-name)))
377344c6e1f1 (set-background-color, set-foreground-color): Call
Eli Zaretskii <eliz@gnu.org>
parents: 40467
diff changeset
913 (or window-system
377344c6e1f1 (set-background-color, set-foreground-color): Call
Eli Zaretskii <eliz@gnu.org>
parents: 40467
diff changeset
914 (face-set-after-frame-default (selected-frame))))
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
915
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
916 (defun set-cursor-color (color-name)
25139
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
917 "Set the text cursor color of the selected frame to COLOR-NAME.
16047
182b9268dbad Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15399
diff changeset
918 When called interactively, prompt for the name of the color to use.
182b9268dbad Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15399
diff changeset
919 To get the frame's current cursor color, use `frame-parameters'."
25139
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
920 (interactive (list (facemenu-read-color)))
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
921 (modify-frame-parameters (selected-frame)
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
922 (list (cons 'cursor-color color-name))))
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
923
1974
94e4f619080b These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents: 1881
diff changeset
924 (defun set-mouse-color (color-name)
25139
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
925 "Set the color of the mouse pointer of the selected frame to COLOR-NAME.
16047
182b9268dbad Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15399
diff changeset
926 When called interactively, prompt for the name of the color to use.
182b9268dbad Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15399
diff changeset
927 To get the frame's current mouse color, use `frame-parameters'."
25139
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
928 (interactive (list (facemenu-read-color)))
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
929 (modify-frame-parameters (selected-frame)
25074
2eca330f89d7 (set-mouse-color): If new color is nil,
Karl Heuer <kwzh@gnu.org>
parents: 24982
diff changeset
930 (list (cons 'mouse-color
2eca330f89d7 (set-mouse-color): If new color is nil,
Karl Heuer <kwzh@gnu.org>
parents: 24982
diff changeset
931 (or color-name
2eca330f89d7 (set-mouse-color): If new color is nil,
Karl Heuer <kwzh@gnu.org>
parents: 24982
diff changeset
932 (cdr (assq 'mouse-color
2eca330f89d7 (set-mouse-color): If new color is nil,
Karl Heuer <kwzh@gnu.org>
parents: 24982
diff changeset
933 (frame-parameters))))))))
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
934
1974
94e4f619080b These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents: 1881
diff changeset
935 (defun set-border-color (color-name)
25139
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
936 "Set the color of the border of the selected frame to COLOR-NAME.
16047
182b9268dbad Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15399
diff changeset
937 When called interactively, prompt for the name of the color to use.
182b9268dbad Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 15399
diff changeset
938 To get the frame's current border color, use `frame-parameters'."
25139
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
939 (interactive (list (facemenu-read-color)))
1974
94e4f619080b These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents: 1881
diff changeset
940 (modify-frame-parameters (selected-frame)
94e4f619080b These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents: 1881
diff changeset
941 (list (cons 'border-color color-name))))
94e4f619080b These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents: 1881
diff changeset
942
94e4f619080b These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents: 1881
diff changeset
943 (defun auto-raise-mode (arg)
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
944 "Toggle whether or not the selected frame should auto-raise.
8072
48c81a052cea (auto-lower-mode, auto-raise-mode): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8056
diff changeset
945 With arg, turn auto-raise mode on if and only if arg is positive.
48c81a052cea (auto-lower-mode, auto-raise-mode): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8056
diff changeset
946 Note that this controls Emacs's own auto-raise feature.
48c81a052cea (auto-lower-mode, auto-raise-mode): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8056
diff changeset
947 Some window managers allow you to enable auto-raise for certain windows.
48c81a052cea (auto-lower-mode, auto-raise-mode): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8056
diff changeset
948 You can use that for Emacs windows if you wish, but if you do,
48c81a052cea (auto-lower-mode, auto-raise-mode): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8056
diff changeset
949 that is beyond the control of Emacs and this command has no effect on it."
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
950 (interactive "P")
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
951 (if (null arg)
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
952 (setq arg
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
953 (if (cdr (assq 'auto-raise (frame-parameters (selected-frame))))
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
954 -1 1)))
26166
312839b8086d (auto-raise-mode): When enabling the mode,
Gerd Moellmann <gerd@gnu.org>
parents: 25266
diff changeset
955 (if (> arg 0)
312839b8086d (auto-raise-mode): When enabling the mode,
Gerd Moellmann <gerd@gnu.org>
parents: 25266
diff changeset
956 (raise-frame (selected-frame)))
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
957 (modify-frame-parameters (selected-frame)
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
958 (list (cons 'auto-raise (> arg 0)))))
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
959
1974
94e4f619080b These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents: 1881
diff changeset
960 (defun auto-lower-mode (arg)
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
961 "Toggle whether or not the selected frame should auto-lower.
8072
48c81a052cea (auto-lower-mode, auto-raise-mode): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8056
diff changeset
962 With arg, turn auto-lower mode on if and only if arg is positive.
48c81a052cea (auto-lower-mode, auto-raise-mode): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8056
diff changeset
963 Note that this controls Emacs's own auto-lower feature.
48c81a052cea (auto-lower-mode, auto-raise-mode): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8056
diff changeset
964 Some window managers allow you to enable auto-lower for certain windows.
48c81a052cea (auto-lower-mode, auto-raise-mode): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8056
diff changeset
965 You can use that for Emacs windows if you wish, but if you do,
48c81a052cea (auto-lower-mode, auto-raise-mode): Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8056
diff changeset
966 that is beyond the control of Emacs and this command has no effect on it."
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
967 (interactive "P")
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
968 (if (null arg)
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
969 (setq arg
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
970 (if (cdr (assq 'auto-lower (frame-parameters (selected-frame))))
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
971 -1 1)))
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
972 (modify-frame-parameters (selected-frame)
1863
6f55c76b5789 * frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents: 1821
diff changeset
973 (list (cons 'auto-lower (> arg 0)))))
20281
799de2d79c64 (set-frame-name): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 19681
diff changeset
974 (defun set-frame-name (name)
799de2d79c64 (set-frame-name): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 19681
diff changeset
975 "Set the name of the selected frame to NAME.
799de2d79c64 (set-frame-name): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 19681
diff changeset
976 When called interactively, prompt for the name of the frame.
799de2d79c64 (set-frame-name): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 19681
diff changeset
977 The frame name is displayed on the modeline if the terminal displays only
799de2d79c64 (set-frame-name): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 19681
diff changeset
978 one frame, otherwise the name is displayed on the frame's caption bar."
799de2d79c64 (set-frame-name): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 19681
diff changeset
979 (interactive "sFrame name: ")
799de2d79c64 (set-frame-name): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 19681
diff changeset
980 (modify-frame-parameters (selected-frame)
799de2d79c64 (set-frame-name): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 19681
diff changeset
981 (list (cons 'name name))))
52614
a77e35d5d0c2 (frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents: 52401
diff changeset
982
a77e35d5d0c2 (frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents: 52401
diff changeset
983 (defun frame-current-scroll-bars (&optional frame)
a77e35d5d0c2 (frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents: 52401
diff changeset
984 "Return the current scroll-bar settings in frame FRAME.
a77e35d5d0c2 (frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents: 52401
diff changeset
985 Value is a cons (VERTICAL . HORISONTAL) where VERTICAL specifies the
a77e35d5d0c2 (frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents: 52401
diff changeset
986 current location of the vertical scroll-bars (left, right, or nil),
a77e35d5d0c2 (frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents: 52401
diff changeset
987 and HORISONTAL specifies the current location of the horisontal scroll
a77e35d5d0c2 (frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents: 52401
diff changeset
988 bars (top, bottom, or nil)."
a77e35d5d0c2 (frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents: 52401
diff changeset
989 (let ((vert (frame-parameter frame 'vertical-scroll-bars))
a77e35d5d0c2 (frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents: 52401
diff changeset
990 (hor nil))
a77e35d5d0c2 (frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents: 52401
diff changeset
991 (unless (memq vert '(left right nil))
a77e35d5d0c2 (frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents: 52401
diff changeset
992 (setq vert default-frame-scroll-bars))
a77e35d5d0c2 (frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents: 52401
diff changeset
993 (cons vert hor)))
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
994
27570
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
995 ;;;; Frame/display capabilities.
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
996 (defun display-mouse-p (&optional display)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
997 "Return non-nil if DISPLAY has a mouse available.
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
998 DISPLAY can be a display name, a frame, or nil (meaning the selected
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
999 frame's display)."
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1000 (let ((frame-type (framep-on-display display)))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1001 (cond
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1002 ((eq frame-type 'pc)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1003 (msdos-mouse-p))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1004 ((eq system-type 'windows-nt)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1005 (> w32-num-mouse-buttons 0))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1006 ((memq frame-type '(x mac))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1007 t) ;; We assume X and Mac *always* have a pointing device
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1008 (t
27774
097c2dd9367a (display-mouse-p): Use variable xterm-mouse-mode and check for t-mouse
Dave Love <fx@gnu.org>
parents: 27570
diff changeset
1009 (or (and (featurep 'xt-mouse)
097c2dd9367a (display-mouse-p): Use variable xterm-mouse-mode and check for t-mouse
Dave Love <fx@gnu.org>
parents: 27570
diff changeset
1010 xterm-mouse-mode)
097c2dd9367a (display-mouse-p): Use variable xterm-mouse-mode and check for t-mouse
Dave Love <fx@gnu.org>
parents: 27570
diff changeset
1011 ;; t-mouse is distributed with the GPM package. It doesn't have
097c2dd9367a (display-mouse-p): Use variable xterm-mouse-mode and check for t-mouse
Dave Love <fx@gnu.org>
parents: 27570
diff changeset
1012 ;; a toggle.
097c2dd9367a (display-mouse-p): Use variable xterm-mouse-mode and check for t-mouse
Dave Love <fx@gnu.org>
parents: 27570
diff changeset
1013 (featurep 't-mouse))))))
27570
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1014
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1015 (defun display-popup-menus-p (&optional display)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1016 "Return non-nil if popup menus are supported on DISPLAY.
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1017 DISPLAY can be a display name, a frame, or nil (meaning the selected
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1018 frame's display).
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1019 Support for popup menus requires that the mouse be available."
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1020 (and
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1021 (let ((frame-type (framep-on-display display)))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1022 (memq frame-type '(x w32 pc mac)))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1023 (display-mouse-p display)))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1024
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1025 (defun display-graphic-p (&optional display)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1026 "Return non-nil if DISPLAY is a graphic display.
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1027 Graphical displays are those which are capable of displaying several
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1028 frames and several different fonts at once. This is true for displays
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1029 that use a window system such as X, and false for text-only terminals.
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1030 DISPLAY can be a display name, a frame, or nil (meaning the selected
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1031 frame's display)."
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1032 (not (null (memq (framep-on-display display) '(x w32 mac)))))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1033
38469
38c0279a4af4 (display-images-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 38412
diff changeset
1034 (defun display-images-p (&optional display)
38c0279a4af4 (display-images-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 38412
diff changeset
1035 "Return non-nil if DISPLAY can display images.
38c0279a4af4 (display-images-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 38412
diff changeset
1036
38c0279a4af4 (display-images-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 38412
diff changeset
1037 DISPLAY can be a display name, a frame, or nil (meaning the selected
38c0279a4af4 (display-images-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 38412
diff changeset
1038 frame's display)."
38c0279a4af4 (display-images-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 38412
diff changeset
1039 (and (display-graphic-p display)
38c0279a4af4 (display-images-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 38412
diff changeset
1040 (fboundp 'image-mask-p)
44049
770a1adcce3e (display-images-p): Do not explicitly check display type.
Jason Rumney <jasonr@gnu.org>
parents: 43661
diff changeset
1041 (fboundp 'image-size)))
38469
38c0279a4af4 (display-images-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 38412
diff changeset
1042
29614
356975f21b18 (display-multi-frame-p, display-multi-font-p): New
Eli Zaretskii <eliz@gnu.org>
parents: 29354
diff changeset
1043 (defalias 'display-multi-frame-p 'display-graphic-p)
356975f21b18 (display-multi-frame-p, display-multi-font-p): New
Eli Zaretskii <eliz@gnu.org>
parents: 29354
diff changeset
1044 (defalias 'display-multi-font-p 'display-graphic-p)
356975f21b18 (display-multi-frame-p, display-multi-font-p): New
Eli Zaretskii <eliz@gnu.org>
parents: 29354
diff changeset
1045
27570
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1046 (defun display-selections-p (&optional display)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1047 "Return non-nil if DISPLAY supports selections.
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1048 A selection is a way to transfer text or other data between programs
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1049 via special system buffers called `selection' or `cut buffer' or
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1050 `clipboard'.
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1051 DISPLAY can be a display name, a frame, or nil (meaning the selected
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1052 frame's display)."
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1053 (let ((frame-type (framep-on-display display)))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1054 (cond
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1055 ((eq frame-type 'pc)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1056 ;; MS-DOG frames support selections when Emacs runs inside
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1057 ;; the Windows' DOS Box.
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1058 (not (null dos-windows-version)))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1059 ((memq frame-type '(x w32 mac))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1060 t) ;; FIXME?
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1061 (t
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1062 nil))))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1063
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1064 (defun display-screens (&optional display)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1065 "Return the number of screens associated with DISPLAY."
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1066 (let ((frame-type (framep-on-display display)))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1067 (cond
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1068 ((memq frame-type '(x w32))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1069 (x-display-screens display))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1070 (t ;; FIXME: is this correct for the Mac?
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1071 1))))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1072
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1073 (defun display-pixel-height (&optional display)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1074 "Return the height of DISPLAY's screen in pixels.
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1075 For character terminals, each character counts as a single pixel."
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1076 (let ((frame-type (framep-on-display display)))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1077 (cond
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1078 ((memq frame-type '(x w32 mac))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1079 (x-display-pixel-height display))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1080 (t
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1081 (frame-height (if (framep display) display (selected-frame)))))))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1082
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1083 (defun display-pixel-width (&optional display)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1084 "Return the width of DISPLAY's screen in pixels.
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1085 For character terminals, each character counts as a single pixel."
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1086 (let ((frame-type (framep-on-display display)))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1087 (cond
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1088 ((memq frame-type '(x w32 mac))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1089 (x-display-pixel-width display))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1090 (t
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1091 (frame-width (if (framep display) display (selected-frame)))))))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1092
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1093 (defun display-mm-height (&optional display)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1094 "Return the height of DISPLAY's screen in millimeters.
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1095 If the information is unavailable, value is nil."
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1096 (and (memq (framep-on-display display) '(x w32 mac))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1097 (x-display-mm-height display)))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1098
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1099 (defun display-mm-width (&optional display)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1100 "Return the width of DISPLAY's screen in millimeters.
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1101 If the information is unavailable, value is nil."
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1102 (and (memq (framep-on-display display) '(x w32 mac))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1103 (x-display-mm-width display)))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1104
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1105 (defun display-backing-store (&optional display)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1106 "Return the backing store capability of DISPLAY's screen.
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1107 The value may be `always', `when-mapped', `not-useful', or nil if
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1108 the question is inapplicable to a certain kind of display."
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1109 (let ((frame-type (framep-on-display display)))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1110 (cond
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1111 ((memq frame-type '(x w32 mac))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1112 (x-display-backing-store display))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1113 (t
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1114 'not-useful))))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1115
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1116 (defun display-save-under (&optional display)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1117 "Return non-nil if DISPLAY's screen supports the SaveUnder feature."
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1118 (let ((frame-type (framep-on-display display)))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1119 (cond
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1120 ((memq frame-type '(x w32 mac))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1121 (x-display-save-under display))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1122 (t
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1123 'not-useful))))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1124
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1125 (defun display-planes (&optional display)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1126 "Return the number of planes supported by DISPLAY."
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1127 (let ((frame-type (framep-on-display display)))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1128 (cond
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1129 ((memq frame-type '(x w32 mac))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1130 (x-display-planes display))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1131 ((eq frame-type 'pc)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1132 4)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1133 (t
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1134 (truncate (log (length (tty-color-alist)) 2))))))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1135
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1136 (defun display-color-cells (&optional display)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1137 "Return the number of color cells supported by DISPLAY."
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1138 (let ((frame-type (framep-on-display display)))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1139 (cond
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1140 ((memq frame-type '(x w32 mac))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1141 (x-display-color-cells display))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1142 ((eq frame-type 'pc)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1143 16)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1144 (t
83008
040dd41ed7d0 Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents: 83004
diff changeset
1145 (tty-display-color-cells display)))))
27570
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1146
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1147 (defun display-visual-class (&optional display)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1148 "Returns the visual class of DISPLAY.
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1149 The value is one of the symbols `static-gray', `gray-scale',
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1150 `static-color', `pseudo-color', `true-color', or `direct-color'."
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1151 (let ((frame-type (framep-on-display display)))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1152 (cond
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1153 ((memq frame-type '(x w32 mac))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1154 (x-display-visual-class display))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1155 ((and (memq frame-type '(pc t))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1156 (tty-display-color-p display))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1157 'static-color)
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1158 (t
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1159 'static-gray))))
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1160
33c77685f4a2 (frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents: 27471
diff changeset
1161
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1162 ;;;; Aliases for backward compatibility with Emacs 18.
2571
b65cf676a09b All fsets changed to defaliases.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2246
diff changeset
1163 (defalias 'screen-height 'frame-height)
b65cf676a09b All fsets changed to defaliases.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2246
diff changeset
1164 (defalias 'screen-width 'frame-width)
958
cc82116a8f1c *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 950
diff changeset
1165
cc82116a8f1c *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 950
diff changeset
1166 (defun set-screen-width (cols &optional pretend)
25139
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
1167 "Obsolete function to change the size of the screen to COLS columns.
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
1168 Optional second arg non-nil means that redisplay should use COLS columns
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
1169 but that the idea of the actual width of the frame should not be changed.
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
1170 This function is provided only for compatibility with Emacs 18; new code
1475
2596132752ff Doc fix.
Christopher Zaborsky <rogue@erratum.com>
parents: 1113
diff changeset
1171 should use `set-frame-width instead'."
958
cc82116a8f1c *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 950
diff changeset
1172 (set-frame-width (selected-frame) cols pretend))
cc82116a8f1c *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 950
diff changeset
1173
cc82116a8f1c *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 950
diff changeset
1174 (defun set-screen-height (lines &optional pretend)
25139
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
1175 "Obsolete function to change the height of the screen to LINES lines.
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
1176 Optional second arg non-nil means that redisplay should use LINES lines
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
1177 but that the idea of the actual height of the screen should not be changed.
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
1178 This function is provided only for compatibility with Emacs 18; new code
17239
368bfa70d822 (set-screen-height): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 17163
diff changeset
1179 should use `set-frame-height' instead."
958
cc82116a8f1c *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 950
diff changeset
1180 (set-frame-height (selected-frame) lines pretend))
cc82116a8f1c *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 950
diff changeset
1181
27471
c64b8825af55 (delete-other-frames): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 27319
diff changeset
1182 (defun delete-other-frames (&optional frame)
c64b8825af55 (delete-other-frames): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 27319
diff changeset
1183 "Delete all frames except FRAME.
37360
7bee98ffa33b (delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents: 37132
diff changeset
1184 If FRAME uses another frame's minibuffer, the minibuffer frame is
7bee98ffa33b (delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents: 37132
diff changeset
1185 left untouched. FRAME nil or omitted means use the selected frame."
27471
c64b8825af55 (delete-other-frames): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 27319
diff changeset
1186 (interactive)
c64b8825af55 (delete-other-frames): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 27319
diff changeset
1187 (unless frame
c64b8825af55 (delete-other-frames): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 27319
diff changeset
1188 (setq frame (selected-frame)))
37360
7bee98ffa33b (delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents: 37132
diff changeset
1189 (let* ((mini-frame (window-frame (minibuffer-window frame)))
7bee98ffa33b (delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents: 37132
diff changeset
1190 (frames (delq mini-frame (delq frame (frame-list)))))
7bee98ffa33b (delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents: 37132
diff changeset
1191 ;; Delete mon-minibuffer-only frames first, because `delete-frame'
7bee98ffa33b (delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents: 37132
diff changeset
1192 ;; signals an error when trying to delete a mini-frame that's
7bee98ffa33b (delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents: 37132
diff changeset
1193 ;; still in use by another frame.
7bee98ffa33b (delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents: 37132
diff changeset
1194 (dolist (frame frames)
7bee98ffa33b (delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents: 37132
diff changeset
1195 (unless (eq (frame-parameter frame 'minibuffer) 'only)
7bee98ffa33b (delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents: 37132
diff changeset
1196 (delete-frame frame)))
7bee98ffa33b (delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents: 37132
diff changeset
1197 ;; Delete minibuffer-only frames.
7bee98ffa33b (delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents: 37132
diff changeset
1198 (dolist (frame frames)
7bee98ffa33b (delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents: 37132
diff changeset
1199 (when (eq (frame-parameter frame 'minibuffer) 'only)
7bee98ffa33b (delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents: 37132
diff changeset
1200 (delete-frame frame)))))
27471
c64b8825af55 (delete-other-frames): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 27319
diff changeset
1201
29354
4ed4a700358b Update calls to make-obsolete with a WHEN argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28856
diff changeset
1202 (make-obsolete 'screen-height 'frame-height) ;before 19.15
4ed4a700358b Update calls to make-obsolete with a WHEN argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28856
diff changeset
1203 (make-obsolete 'screen-width 'frame-width) ;before 19.15
4ed4a700358b Update calls to make-obsolete with a WHEN argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28856
diff changeset
1204 (make-obsolete 'set-screen-width 'set-frame-width) ;before 19.15
4ed4a700358b Update calls to make-obsolete with a WHEN argument.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28856
diff changeset
1205 (make-obsolete 'set-screen-height 'set-frame-height) ;before 19.15
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1206
47738
f75902c4cbb5 (delete-frame-hook): Variable alias for
John Paul Wallington <jpw@pobox.com>
parents: 47016
diff changeset
1207 ;; miscellaneous obsolescence declarations
f75902c4cbb5 (delete-frame-hook): Variable alias for
John Paul Wallington <jpw@pobox.com>
parents: 47016
diff changeset
1208 (defvaralias 'delete-frame-hook 'delete-frame-functions)
f75902c4cbb5 (delete-frame-hook): Variable alias for
John Paul Wallington <jpw@pobox.com>
parents: 47016
diff changeset
1209 (make-obsolete-variable 'delete-frame-hook 'delete-frame-functions "21.4")
f75902c4cbb5 (delete-frame-hook): Variable alias for
John Paul Wallington <jpw@pobox.com>
parents: 47016
diff changeset
1210
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1211
39846
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
1212 ;; Highlighting trailing whitespace.
24982
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1213
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1214 (make-variable-buffer-local 'show-trailing-whitespace)
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1215
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1216 (defcustom show-trailing-whitespace nil
38812
3ddaeeda30c5 (show-trailing-whitespace): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 38781
diff changeset
1217 "*Non-nil means highlight trailing whitespace in face `trailing-whitespace'.
3ddaeeda30c5 (show-trailing-whitespace): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 38781
diff changeset
1218
3ddaeeda30c5 (show-trailing-whitespace): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 38781
diff changeset
1219 Setting this variable makes it local to the current buffer."
24982
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1220 :tag "Highlight trailing whitespace."
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1221 :type 'boolean
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1222 :group 'font-lock)
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1223
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1224
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1225
39846
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
1226 ;; Scrolling
28693
062f88e62612 (scrolling): New group.
Gerd Moellmann <gerd@gnu.org>
parents: 28182
diff changeset
1227
062f88e62612 (scrolling): New group.
Gerd Moellmann <gerd@gnu.org>
parents: 28182
diff changeset
1228 (defgroup scrolling nil
062f88e62612 (scrolling): New group.
Gerd Moellmann <gerd@gnu.org>
parents: 28182
diff changeset
1229 "Scrolling windows."
062f88e62612 (scrolling): New group.
Gerd Moellmann <gerd@gnu.org>
parents: 28182
diff changeset
1230 :version "21.1"
062f88e62612 (scrolling): New group.
Gerd Moellmann <gerd@gnu.org>
parents: 28182
diff changeset
1231 :group 'frames)
062f88e62612 (scrolling): New group.
Gerd Moellmann <gerd@gnu.org>
parents: 28182
diff changeset
1232
43661
9f8ac5084298 (auto-hscroll-mode): Renamed from automatic-hscrolling.
Eli Zaretskii <eliz@gnu.org>
parents: 43545
diff changeset
1233 (defcustom auto-hscroll-mode t
37823
7d2b56f9f9b4 (automatic-hscrolling): Fix a typo. From Pavel Janik <Pavel@Janik.cz>.
Eli Zaretskii <eliz@gnu.org>
parents: 37360
diff changeset
1234 "*Allow or disallow automatic scrolling windows horizontally.
28856
20f840aa2301 (automatic-hscrolling): Typo.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 28693
diff changeset
1235 If non-nil, windows are automatically scrolled horizontally to make
28693
062f88e62612 (scrolling): New group.
Gerd Moellmann <gerd@gnu.org>
parents: 28182
diff changeset
1236 point visible."
062f88e62612 (scrolling): New group.
Gerd Moellmann <gerd@gnu.org>
parents: 28182
diff changeset
1237 :version "21.1"
062f88e62612 (scrolling): New group.
Gerd Moellmann <gerd@gnu.org>
parents: 28182
diff changeset
1238 :type 'boolean
062f88e62612 (scrolling): New group.
Gerd Moellmann <gerd@gnu.org>
parents: 28182
diff changeset
1239 :group 'scrolling)
43661
9f8ac5084298 (auto-hscroll-mode): Renamed from automatic-hscrolling.
Eli Zaretskii <eliz@gnu.org>
parents: 43545
diff changeset
1240 (defvaralias 'automatic-hscrolling 'auto-hscroll-mode)
28693
062f88e62612 (scrolling): New group.
Gerd Moellmann <gerd@gnu.org>
parents: 28182
diff changeset
1241
062f88e62612 (scrolling): New group.
Gerd Moellmann <gerd@gnu.org>
parents: 28182
diff changeset
1242
39846
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
1243 ;; Blinking cursor
24982
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1244
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1245 (defgroup cursor nil
26284
6de035f92990 Many doc fixes.
Gerd Moellmann <gerd@gnu.org>
parents: 26278
diff changeset
1246 "Displaying text cursors."
25139
fde300f58ed8 Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents: 25134
diff changeset
1247 :version "21.1"
24982
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1248 :group 'frames)
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1249
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1250 (defcustom blink-cursor-delay 0.5
26284
6de035f92990 Many doc fixes.
Gerd Moellmann <gerd@gnu.org>
parents: 26278
diff changeset
1251 "*Seconds of idle time after which cursor starts to blink."
24982
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1252 :tag "Delay in seconds."
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1253 :type 'number
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1254 :group 'cursor)
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1255
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1256 (defcustom blink-cursor-interval 0.5
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1257 "*Length of cursor blink interval in seconds."
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1258 :tag "Blink interval in seconds."
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1259 :type 'number
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1260 :group 'cursor)
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1261
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1262 (defvar blink-cursor-idle-timer nil
26284
6de035f92990 Many doc fixes.
Gerd Moellmann <gerd@gnu.org>
parents: 26278
diff changeset
1263 "Timer started after `blink-cursor-delay' seconds of Emacs idle time.
6de035f92990 Many doc fixes.
Gerd Moellmann <gerd@gnu.org>
parents: 26278
diff changeset
1264 The function `blink-cursor-start' is called when the timer fires.")
24982
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1265
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1266 (defvar blink-cursor-timer nil
26284
6de035f92990 Many doc fixes.
Gerd Moellmann <gerd@gnu.org>
parents: 26278
diff changeset
1267 "Timer started from `blink-cursor-start'.
6de035f92990 Many doc fixes.
Gerd Moellmann <gerd@gnu.org>
parents: 26278
diff changeset
1268 This timer calls `blink-cursor' every `blink-cursor-interval' seconds.")
24982
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1269
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1270 (defvar blink-cursor-mode nil
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1271 "Non-nil means blinking cursor is active.")
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1272
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1273 (defun blink-cursor-mode (arg)
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1274 "Toggle blinking cursor mode.
34002
698d4ae0484c (blink-cursor-mode): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 33784
diff changeset
1275 With a numeric argument, turn blinking cursor mode on iff ARG is positive.
24982
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1276 When blinking cursor mode is enabled, the cursor of the selected
40467
e9c66842eb07 (blink-cursor-mode): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 39846
diff changeset
1277 window blinks.
e9c66842eb07 (blink-cursor-mode): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 39846
diff changeset
1278
e9c66842eb07 (blink-cursor-mode): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 39846
diff changeset
1279 Note that this command is effective only when Emacs
e9c66842eb07 (blink-cursor-mode): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 39846
diff changeset
1280 displays through a window system, because then Emacs does its own
e9c66842eb07 (blink-cursor-mode): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 39846
diff changeset
1281 cursor display. On a text-only terminal, this is not implemented."
24982
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1282 (interactive "P")
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1283 (let ((on-p (if (null arg)
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1284 (not blink-cursor-mode)
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1285 (> (prefix-numeric-value arg) 0))))
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1286 (if blink-cursor-idle-timer
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1287 (cancel-timer blink-cursor-idle-timer))
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1288 (if blink-cursor-timer
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1289 (cancel-timer blink-cursor-timer))
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1290 (setq blink-cursor-idle-timer nil
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1291 blink-cursor-timer nil
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1292 blink-cursor-mode nil)
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1293 (if on-p
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1294 (progn
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1295 ;; Hide the cursor.
30015
7ab1a3106972 (blink-cursor-mode): Don't hide cursor initially.
Gerd Moellmann <gerd@gnu.org>
parents: 30013
diff changeset
1296 ;(internal-show-cursor nil nil)
24982
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1297 (setq blink-cursor-idle-timer
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1298 (run-with-idle-timer blink-cursor-delay
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1299 blink-cursor-delay
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1300 'blink-cursor-start))
27946
e27fde0193ef (blink-cursor-mode): Switch cursor on when turning
Gerd Moellmann <gerd@gnu.org>
parents: 27916
diff changeset
1301 (setq blink-cursor-mode t))
e27fde0193ef (blink-cursor-mode): Switch cursor on when turning
Gerd Moellmann <gerd@gnu.org>
parents: 27916
diff changeset
1302 (internal-show-cursor nil t))))
24982
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1303
30015
7ab1a3106972 (blink-cursor-mode): Don't hide cursor initially.
Gerd Moellmann <gerd@gnu.org>
parents: 30013
diff changeset
1304 ;; Note that this is really initialized from startup.el before
7ab1a3106972 (blink-cursor-mode): Don't hide cursor initially.
Gerd Moellmann <gerd@gnu.org>
parents: 30013
diff changeset
1305 ;; the init-file is read.
7ab1a3106972 (blink-cursor-mode): Don't hide cursor initially.
Gerd Moellmann <gerd@gnu.org>
parents: 30013
diff changeset
1306
7ab1a3106972 (blink-cursor-mode): Don't hide cursor initially.
Gerd Moellmann <gerd@gnu.org>
parents: 30013
diff changeset
1307 (defcustom blink-cursor nil
26284
6de035f92990 Many doc fixes.
Gerd Moellmann <gerd@gnu.org>
parents: 26278
diff changeset
1308 "*Non-nil means blinking cursor mode is active."
30015
7ab1a3106972 (blink-cursor-mode): Don't hide cursor initially.
Gerd Moellmann <gerd@gnu.org>
parents: 30013
diff changeset
1309 :group 'cursor
24982
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1310 :tag "Blinking cursor"
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1311 :type 'boolean
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1312 :set #'(lambda (symbol value)
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1313 (set-default symbol value)
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1314 (blink-cursor-mode (or value 0))))
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1315
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1316 (defun blink-cursor-start ()
26284
6de035f92990 Many doc fixes.
Gerd Moellmann <gerd@gnu.org>
parents: 26278
diff changeset
1317 "Timer function called from the timer `blink-cursor-idle-timer'.
6de035f92990 Many doc fixes.
Gerd Moellmann <gerd@gnu.org>
parents: 26278
diff changeset
1318 This starts the timer `blink-cursor-timer', which makes the cursor blink
6de035f92990 Many doc fixes.
Gerd Moellmann <gerd@gnu.org>
parents: 26278
diff changeset
1319 if appropriate. It also arranges to cancel that timer when the next
6de035f92990 Many doc fixes.
Gerd Moellmann <gerd@gnu.org>
parents: 26278
diff changeset
1320 command starts, by installing a pre-command hook."
24982
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1321 (when (null blink-cursor-timer)
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1322 (add-hook 'pre-command-hook 'blink-cursor-end)
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1323 (setq blink-cursor-timer
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1324 (run-with-timer blink-cursor-interval blink-cursor-interval
26332
37f66ea5d1a1 * frame.el (blink-cursor-mode, blink-cursor-end): Use
Gerd Moellmann <gerd@gnu.org>
parents: 26284
diff changeset
1325 'blink-cursor-timer-function))))
37f66ea5d1a1 * frame.el (blink-cursor-mode, blink-cursor-end): Use
Gerd Moellmann <gerd@gnu.org>
parents: 26284
diff changeset
1326
37f66ea5d1a1 * frame.el (blink-cursor-mode, blink-cursor-end): Use
Gerd Moellmann <gerd@gnu.org>
parents: 26284
diff changeset
1327 (defun blink-cursor-timer-function ()
37f66ea5d1a1 * frame.el (blink-cursor-mode, blink-cursor-end): Use
Gerd Moellmann <gerd@gnu.org>
parents: 26284
diff changeset
1328 "Timer function of timer `blink-cursor-timer'."
37f66ea5d1a1 * frame.el (blink-cursor-mode, blink-cursor-end): Use
Gerd Moellmann <gerd@gnu.org>
parents: 26284
diff changeset
1329 (internal-show-cursor nil (not (internal-show-cursor-p))))
24982
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1330
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1331 (defun blink-cursor-end ()
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1332 "Stop cursor blinking.
26284
6de035f92990 Many doc fixes.
Gerd Moellmann <gerd@gnu.org>
parents: 26278
diff changeset
1333 This is installed as a pre-command hook by `blink-cursor-start'.
41579
bab6e8eba0e1 comments indented properly
Sam Steingold <sds@gnu.org>
parents: 40673
diff changeset
1334 When run, it cancels the timer `blink-cursor-timer' and removes
26284
6de035f92990 Many doc fixes.
Gerd Moellmann <gerd@gnu.org>
parents: 26278
diff changeset
1335 itself as a pre-command hook."
24982
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1336 (remove-hook 'pre-command-hook 'blink-cursor-end)
26332
37f66ea5d1a1 * frame.el (blink-cursor-mode, blink-cursor-end): Use
Gerd Moellmann <gerd@gnu.org>
parents: 26284
diff changeset
1337 (internal-show-cursor nil t)
24982
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1338 (cancel-timer blink-cursor-timer)
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1339 (setq blink-cursor-timer nil))
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1340
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1341
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1342
39846
2e4007551cfd (special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 39505
diff changeset
1343 ;; Hourglass pointer
24982
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1344
36257
620c4b282fce (display-hourglass): Renamed from busy-cursor.
Gerd Moellmann <gerd@gnu.org>
parents: 35856
diff changeset
1345 (defcustom display-hourglass t
620c4b282fce (display-hourglass): Renamed from busy-cursor.
Gerd Moellmann <gerd@gnu.org>
parents: 35856
diff changeset
1346 "*Non-nil means show an hourglass pointer when running under a window system."
620c4b282fce (display-hourglass): Renamed from busy-cursor.
Gerd Moellmann <gerd@gnu.org>
parents: 35856
diff changeset
1347 :tag "Hourglass pointer"
24982
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1348 :type 'boolean
36257
620c4b282fce (display-hourglass): Renamed from busy-cursor.
Gerd Moellmann <gerd@gnu.org>
parents: 35856
diff changeset
1349 :group 'cursor)
24982
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1350
36257
620c4b282fce (display-hourglass): Renamed from busy-cursor.
Gerd Moellmann <gerd@gnu.org>
parents: 35856
diff changeset
1351 (defcustom hourglass-delay 1
620c4b282fce (display-hourglass): Renamed from busy-cursor.
Gerd Moellmann <gerd@gnu.org>
parents: 35856
diff changeset
1352 "*Seconds to wait before displaying an hourglass pointer."
620c4b282fce (display-hourglass): Renamed from busy-cursor.
Gerd Moellmann <gerd@gnu.org>
parents: 35856
diff changeset
1353 :tag "Hourglass delay"
27916
3288a7cd4796 (busy-cursor-delay-seconds): Change type to `number'.
Gerd Moellmann <gerd@gnu.org>
parents: 27909
diff changeset
1354 :type 'number
36257
620c4b282fce (display-hourglass): Renamed from busy-cursor.
Gerd Moellmann <gerd@gnu.org>
parents: 35856
diff changeset
1355 :group 'cursor)
27865
490743da8567 (show-cursor-in-non-selected-windows): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 27846
diff changeset
1356
27846
1ef6cae16192 (show-cursor-in-non-selected-windows): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 27774
diff changeset
1357
37132
7d4fab575208 (cursor-in-non-selected-windows): Replaces
Gerd Moellmann <gerd@gnu.org>
parents: 36317
diff changeset
1358 (defcustom cursor-in-non-selected-windows t
27846
1ef6cae16192 (show-cursor-in-non-selected-windows): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 27774
diff changeset
1359 "*Non-nil means show a hollow box cursor in non-selected-windows.
33784
086c757fef3e (show-cursor-in-non-selected-windows): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 33186
diff changeset
1360 If nil, don't show a cursor except in the selected window.
41579
bab6e8eba0e1 comments indented properly
Sam Steingold <sds@gnu.org>
parents: 40673
diff changeset
1361 Use Custom to set this variable to get the display updated."
27846
1ef6cae16192 (show-cursor-in-non-selected-windows): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 27774
diff changeset
1362 :tag "Cursor in non-selected windows"
1ef6cae16192 (show-cursor-in-non-selected-windows): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 27774
diff changeset
1363 :type 'boolean
1ef6cae16192 (show-cursor-in-non-selected-windows): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 27774
diff changeset
1364 :group 'cursor
1ef6cae16192 (show-cursor-in-non-selected-windows): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 27774
diff changeset
1365 :set #'(lambda (symbol value)
1ef6cae16192 (show-cursor-in-non-selected-windows): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 27774
diff changeset
1366 (set-default symbol value)
1ef6cae16192 (show-cursor-in-non-selected-windows): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 27774
diff changeset
1367 (force-mode-line-update t)))
41579
bab6e8eba0e1 comments indented properly
Sam Steingold <sds@gnu.org>
parents: 40673
diff changeset
1368
24982
c81447275ea3 (after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents: 24926
diff changeset
1369
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1370 ;;;; Key bindings
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1371
15347
3885819ed860 (make-frame-command): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14701
diff changeset
1372 (define-key ctl-x-5-map "2" 'make-frame-command)
27471
c64b8825af55 (delete-other-frames): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 27319
diff changeset
1373 (define-key ctl-x-5-map "1" 'delete-other-frames)
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1374 (define-key ctl-x-5-map "0" 'delete-frame)
4425
1b48826df9cb (other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents: 4360
diff changeset
1375 (define-key ctl-x-5-map "o" 'other-frame)
584
4cd7543be581 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 542
diff changeset
1376
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1377 (provide 'frame)
658
7cbd4fcd8b0f *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 584
diff changeset
1378
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 51901
diff changeset
1379 ;;; arch-tag: 82979c70-b8f2-4306-b2ad-ddbd6b328b56
777
c99faf9381bb *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 756
diff changeset
1380 ;;; frame.el ends here