Mercurial > emacs
annotate lisp/frame.el @ 11263:56feeecbb05a
(Fformat): Cast int to pointer by way of EMACS_INT.
(Fformat_time_string): Use emacs_strftime. Doc fix.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 07 Apr 1995 18:49:03 +0000 |
parents | c9e2537da847 |
children | 72becffa4b21 |
rev | line source |
---|---|
777 | 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 |
7300 | 3 ;;;; Copyright (C) 1993, 1994 Free Software Foundation, Inc. |
846
20674ae6bf52
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
827
diff
changeset
|
4 |
793
6fb68a1460a6
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
777
diff
changeset
|
5 ;; Maintainer: FSF |
811
e694e0879463
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
806
diff
changeset
|
6 ;; Keywords: internal |
793
6fb68a1460a6
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
777
diff
changeset
|
7 |
394 | 8 ;;; This file is part of GNU Emacs. |
9 ;;; | |
10 ;;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;;; it under the terms of the GNU General Public License as published by | |
806 | 12 ;;; the Free Software Foundation; either version 2, or (at your option) |
394 | 13 ;;; any later version. |
14 ;;; | |
15 ;;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;;; GNU General Public License for more details. | |
19 ;;; | |
20 ;;; You should have received a copy of the GNU General Public License | |
21 ;;; along with GNU Emacs; see the file COPYING. If not, write to | |
22 ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
23 | |
793
6fb68a1460a6
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
777
diff
changeset
|
24 ;;; Code: |
6fb68a1460a6
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
777
diff
changeset
|
25 |
777 | 26 (defvar frame-creation-function nil |
27 "Window-system dependent function to call to create a new frame. | |
28 The window system startup file should set this to its frame creation | |
394 | 29 function, which should take an alist of parameters as its argument.") |
30 | |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
31 ;;; The initial value given here for this must ask for a minibuffer. |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
32 ;;; There must always exist a frame with a minibuffer, and after we |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
33 ;;; delete the terminal frame, this will be the only frame. |
958 | 34 (defvar initial-frame-alist '((minibuffer . t)) |
1974
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
35 "Alist of frame parameters for creating the initial X window frame. |
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
36 You can set this in your `.emacs' file; for example, |
777 | 37 (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
|
38 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
|
39 |
aa25c6ea397d
(initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
8072
diff
changeset
|
40 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
|
41 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
|
42 `minibuffer-frame-alist'. |
8129
aa25c6ea397d
(initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
8072
diff
changeset
|
43 |
aa25c6ea397d
(initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
8072
diff
changeset
|
44 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
|
45 by setting this variable in your `.emacs' file; however, they won't |
10557 | 46 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
|
47 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
|
48 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
|
49 * 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
|
50 * 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
|
51 don't affect subsequent frames. |
aa25c6ea397d
(initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
8072
diff
changeset
|
52 * Set `initial-frame-alist' in a way that matches the X resources, |
aa25c6ea397d
(initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
8072
diff
changeset
|
53 to override what you put in `default-frame-alist'.") |
394 | 54 |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
55 (defvar minibuffer-frame-alist '((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
|
56 "Alist of frame parameters for initially creating a minibuffer frame. |
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
57 You can set this in your `.emacs' file; for example, |
777 | 58 (setq minibuffer-frame-alist |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
59 '((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
|
60 Parameters specified here supersede the values given in |
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
61 `default-frame-alist'.") |
394 | 62 |
777 | 63 (defvar pop-up-frame-alist nil |
1974
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
64 "Alist of frame parameters used when creating pop-up frames. |
777 | 65 Pop-up frames are used for completions, help, and the like. |
394 | 66 This variable can be set in your init file, like this: |
777 | 67 (setq pop-up-frame-alist '((width . 80) (height . 20))) |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3554
diff
changeset
|
68 These supersede the values given in `default-frame-alist'.") |
394 | 69 |
777 | 70 (setq pop-up-frame-function |
394 | 71 (function (lambda () |
7322
1f3536445289
(frame-notice-user-settings): Discard `reverse' when
Richard M. Stallman <rms@gnu.org>
parents:
7309
diff
changeset
|
72 (make-frame pop-up-frame-alist)))) |
394 | 73 |
10557 | 74 (defvar special-display-frame-alist |
7057
7102dd374da4
(special-display-frame-alist): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7020
diff
changeset
|
75 '((height . 14) (width . 80) (unsplittable . t)) |
7102dd374da4
(special-display-frame-alist): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7020
diff
changeset
|
76 "*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
|
77 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
|
78 `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
|
79 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
|
80 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
|
81 (setq special-display-frame-alist '((width . 80) (height . 20))) |
7102dd374da4
(special-display-frame-alist): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7020
diff
changeset
|
82 These supersede the values given in `default-frame-alist'.") |
7102dd374da4
(special-display-frame-alist): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7020
diff
changeset
|
83 |
7102dd374da4
(special-display-frame-alist): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7020
diff
changeset
|
84 ;; Display BUFFER in its own frame, reusing an existing window if any. |
7102dd374da4
(special-display-frame-alist): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7020
diff
changeset
|
85 ;; Return the window chosen. |
7102dd374da4
(special-display-frame-alist): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7020
diff
changeset
|
86 ;; Currently we do not insist on selecting the window within its frame. |
8993
c6572fa27df3
(special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents:
8990
diff
changeset
|
87 ;; If ARGS is an alist, use it as a list of frame parameter specs. |
10557 | 88 ;; If ARGS is a list whose car is a symbol, |
8993
c6572fa27df3
(special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents:
8990
diff
changeset
|
89 ;; use (car ARGS) as a function to do the work. |
c6572fa27df3
(special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents:
8990
diff
changeset
|
90 ;; Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args. |
c6572fa27df3
(special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents:
8990
diff
changeset
|
91 (defun special-display-popup-frame (buffer &optional args) |
c6572fa27df3
(special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents:
8990
diff
changeset
|
92 (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
|
93 (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
|
94 (let ((window (get-buffer-window buffer t))) |
c6572fa27df3
(special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents:
8990
diff
changeset
|
95 (if window |
c6572fa27df3
(special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents:
8990
diff
changeset
|
96 ;; If we have a window already, make it visible. |
c6572fa27df3
(special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents:
8990
diff
changeset
|
97 (let ((frame (window-frame window))) |
c6572fa27df3
(special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents:
8990
diff
changeset
|
98 (make-frame-visible frame) |
c6572fa27df3
(special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents:
8990
diff
changeset
|
99 (raise-frame frame) |
c6572fa27df3
(special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents:
8990
diff
changeset
|
100 window) |
c6572fa27df3
(special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents:
8990
diff
changeset
|
101 ;; If no window yet, make one in a new frame. |
c6572fa27df3
(special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents:
8990
diff
changeset
|
102 (let ((frame (make-frame (append args special-display-frame-alist)))) |
c6572fa27df3
(special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents:
8990
diff
changeset
|
103 (set-window-buffer (frame-selected-window frame) buffer) |
c6572fa27df3
(special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents:
8990
diff
changeset
|
104 (set-window-dedicated-p (frame-selected-window frame) t) |
c6572fa27df3
(special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents:
8990
diff
changeset
|
105 (frame-selected-window frame)))))) |
7057
7102dd374da4
(special-display-frame-alist): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7020
diff
changeset
|
106 |
9175
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
107 ;; Handle delete-frame events from the X server. |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
108 (defun handle-delete-frame (event) |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
109 (interactive "e") |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
110 (let ((frame (posn-window (event-start event))) |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
111 (i 0) |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
112 (tail (frame-list))) |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
113 (while tail |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
114 (and (frame-visible-p (car tail)) |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
115 (not (eq (car tail) frame)) |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
116 (setq i (1+ i))) |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
117 (setq tail (cdr tail))) |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
118 (if (> i 0) |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
119 (delete-frame frame t) |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
120 (kill-emacs)))) |
394 | 121 |
777 | 122 ;;;; Arrangement of frames at startup |
394 | 123 |
124 ;;; 1) Load the window system startup file from the lisp library and read the | |
125 ;;; high-priority arguments (-q and the like). The window system startup | |
777 | 126 ;;; file should create any frames specified in the window system defaults. |
10557 | 127 ;;; |
777 | 128 ;;; 2) If no frames have been opened, we open an initial text frame. |
394 | 129 ;;; |
130 ;;; 3) Once the init file is done, we apply any newly set parameters | |
777 | 131 ;;; in initial-frame-alist to the frame. |
394 | 132 |
10557 | 133 ;; 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
|
134 ;; 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
|
135 ;; 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
|
136 ;; (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
|
137 ;; (add-hook 'window-setup-hook 'frame-notice-user-settings) |
394 | 138 |
777 | 139 ;;; If we create the initial frame, this is it. |
140 (defvar frame-initial-frame nil) | |
394 | 141 |
4305
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
142 ;; 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
|
143 (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
|
144 |
7343
81f9ad98c323
(frame-notice-user-settings): When replacing the first
Richard M. Stallman <rms@gnu.org>
parents:
7322
diff
changeset
|
145 (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
|
146 |
394 | 147 ;;; startup.el calls this function before loading the user's init |
777 | 148 ;;; file - if there is no frame with a minibuffer open now, create |
394 | 149 ;;; one to display messages while loading the init file. |
777 | 150 (defun frame-initialize () |
10557 | 151 |
394 | 152 ;; Are we actually running under a window system at all? |
153 (if (and window-system (not noninteractive)) | |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
154 (progn |
9737
1368ece6ec04
(frame-initialize): Set special-display-function here,
Richard M. Stallman <rms@gnu.org>
parents:
9687
diff
changeset
|
155 ;; 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
|
156 (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
|
157 |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
158 ;; 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
|
159 ;; 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
|
160 ;; 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
|
161 ;; minibuffer spec. |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
162 (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
|
163 (progn |
4305
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
164 (setq frame-initial-frame-alist |
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
165 (append initial-frame-alist default-frame-alist)) |
7660
d47966265080
(frame-initialize): Record in frame-initial-frame-alist
Richard M. Stallman <rms@gnu.org>
parents:
7436
diff
changeset
|
166 ;; Record these with their default values |
d47966265080
(frame-initialize): Record in frame-initial-frame-alist
Richard M. Stallman <rms@gnu.org>
parents:
7436
diff
changeset
|
167 ;; if they don't have any values explicitly. |
d47966265080
(frame-initialize): Record in frame-initial-frame-alist
Richard M. Stallman <rms@gnu.org>
parents:
7436
diff
changeset
|
168 (or (assq 'vertical-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
|
169 (setq frame-initial-frame-alist |
d47966265080
(frame-initialize): Record in frame-initial-frame-alist
Richard M. Stallman <rms@gnu.org>
parents:
7436
diff
changeset
|
170 (cons '(vertical-scroll-bars . t) |
d47966265080
(frame-initialize): Record in frame-initial-frame-alist
Richard M. Stallman <rms@gnu.org>
parents:
7436
diff
changeset
|
171 frame-initial-frame-alist))) |
d47966265080
(frame-initialize): Record in frame-initial-frame-alist
Richard M. Stallman <rms@gnu.org>
parents:
7436
diff
changeset
|
172 (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
|
173 (setq frame-initial-frame-alist |
d47966265080
(frame-initialize): Record in frame-initial-frame-alist
Richard M. Stallman <rms@gnu.org>
parents:
7436
diff
changeset
|
174 (cons '(horizontal-scroll-bars . t) |
d47966265080
(frame-initialize): Record in frame-initial-frame-alist
Richard M. Stallman <rms@gnu.org>
parents:
7436
diff
changeset
|
175 frame-initial-frame-alist))) |
3050
8e2472cd4409
(frame-initialize): Handle `reverse' as parameter.
Richard M. Stallman <rms@gnu.org>
parents:
2870
diff
changeset
|
176 (setq default-minibuffer-frame |
8e2472cd4409
(frame-initialize): Handle `reverse' as parameter.
Richard M. Stallman <rms@gnu.org>
parents:
2870
diff
changeset
|
177 (setq frame-initial-frame |
7322
1f3536445289
(frame-notice-user-settings): Discard `reverse' when
Richard M. Stallman <rms@gnu.org>
parents:
7309
diff
changeset
|
178 (make-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
|
179 ;; 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
|
180 ;; 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
|
181 ;; 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
|
182 ;; 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
|
183 (setq initial-frame-alist |
7309
beb9070c6fec
(frame-initialize): Delete the code for reverse-video.
Richard M. Stallman <rms@gnu.org>
parents:
7300
diff
changeset
|
184 (frame-remove-geometry-params initial-frame-alist)))) |
10557 | 185 ;; At this point, we know that we have a frame open, so we |
777 | 186 ;; can delete the terminal frame. |
187 (delete-frame terminal-frame) | |
188 (setq terminal-frame nil)) | |
10557 | 189 |
11038
f93c3156e05a
(frame-initialize): Set frame-creation-function to `make-terminal-frame' if
Karl Heuer <kwzh@gnu.org>
parents:
10601
diff
changeset
|
190 ;; No, we're not running a window system. Use make-terminal-frame if |
f93c3156e05a
(frame-initialize): Set frame-creation-function to `make-terminal-frame' if
Karl Heuer <kwzh@gnu.org>
parents:
10601
diff
changeset
|
191 ;; we support that feature, otherwise arrange to cause errors. |
777 | 192 (setq frame-creation-function |
11038
f93c3156e05a
(frame-initialize): Set frame-creation-function to `make-terminal-frame' if
Karl Heuer <kwzh@gnu.org>
parents:
10601
diff
changeset
|
193 (if (fboundp 'make-terminal-frame) |
f93c3156e05a
(frame-initialize): Set frame-creation-function to `make-terminal-frame' if
Karl Heuer <kwzh@gnu.org>
parents:
10601
diff
changeset
|
194 'make-terminal-frame |
f93c3156e05a
(frame-initialize): Set frame-creation-function to `make-terminal-frame' if
Karl Heuer <kwzh@gnu.org>
parents:
10601
diff
changeset
|
195 (function |
f93c3156e05a
(frame-initialize): Set frame-creation-function to `make-terminal-frame' if
Karl Heuer <kwzh@gnu.org>
parents:
10601
diff
changeset
|
196 (lambda (parameters) |
f93c3156e05a
(frame-initialize): Set frame-creation-function to `make-terminal-frame' if
Karl Heuer <kwzh@gnu.org>
parents:
10601
diff
changeset
|
197 (error |
f93c3156e05a
(frame-initialize): Set frame-creation-function to `make-terminal-frame' if
Karl Heuer <kwzh@gnu.org>
parents:
10601
diff
changeset
|
198 "Can't create multiple frames without a window system"))))))) |
10557 | 199 |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
200 ;;; startup.el calls this function after loading the user's init |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
201 ;;; file. Now default-frame-alist and initial-frame-alist contain |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
202 ;;; information to which we must react; do what needs to be done. |
777 | 203 (defun frame-notice-user-settings () |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
204 |
8056
1c5fd2cdfb36
(frame-notice-user-settings): Make menu-bar-mode
Richard M. Stallman <rms@gnu.org>
parents:
7712
diff
changeset
|
205 ;; Make menu-bar-mode and default-frame-alist consistent. |
11039
c9e2537da847
(other-frame): Don't try to unfocus in a termcap frame.
Karl Heuer <kwzh@gnu.org>
parents:
11038
diff
changeset
|
206 (if (boundp 'menu-bar-mode) |
c9e2537da847
(other-frame): Don't try to unfocus in a termcap frame.
Karl Heuer <kwzh@gnu.org>
parents:
11038
diff
changeset
|
207 (let ((default (assq 'menu-bar-lines default-frame-alist))) |
c9e2537da847
(other-frame): Don't try to unfocus in a termcap frame.
Karl Heuer <kwzh@gnu.org>
parents:
11038
diff
changeset
|
208 (if default |
c9e2537da847
(other-frame): Don't try to unfocus in a termcap frame.
Karl Heuer <kwzh@gnu.org>
parents:
11038
diff
changeset
|
209 (setq menu-bar-mode (not (eq (cdr default) 0))) |
c9e2537da847
(other-frame): Don't try to unfocus in a termcap frame.
Karl Heuer <kwzh@gnu.org>
parents:
11038
diff
changeset
|
210 (setq default-frame-alist |
c9e2537da847
(other-frame): Don't try to unfocus in a termcap frame.
Karl Heuer <kwzh@gnu.org>
parents:
11038
diff
changeset
|
211 (cons (cons 'menu-bar-lines (if menu-bar-mode 1 0)) |
c9e2537da847
(other-frame): Don't try to unfocus in a termcap frame.
Karl Heuer <kwzh@gnu.org>
parents:
11038
diff
changeset
|
212 default-frame-alist))))) |
8056
1c5fd2cdfb36
(frame-notice-user-settings): Make menu-bar-mode
Richard M. Stallman <rms@gnu.org>
parents:
7712
diff
changeset
|
213 |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
214 ;; 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
|
215 ;; 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
|
216 ;; 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
|
217 ;; 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
|
218 ;; window is the minibuffer. |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
219 (let ((old-buffer (current-buffer))) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
220 |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
221 ;; 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
|
222 ;; and default-frame-alist to it. |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
223 (if (frame-live-p frame-initial-frame) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
224 |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
225 ;; The initial frame we create above always has a minibuffer. |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
226 ;; If the user wants to remove it, or make it a minibuffer-only |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
227 ;; frame, then we'll have to delete the current frame and make a |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
228 ;; new one; you can't remove or add a root window to/from an |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
229 ;; existing frame. |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
230 ;; |
1113 | 231 ;; NOTE: default-frame-alist was nil when we created the |
232 ;; existing frame. We need to explicitly include | |
233 ;; default-frame-alist in the parameters of the screen we | |
234 ;; create here, so that its new value, gleaned from the user's | |
235 ;; .emacs file, will be applied to the existing screen. | |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
236 (if (not (eq (cdr (or (assq 'minibuffer initial-frame-alist) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
237 (assq 'minibuffer default-frame-alist) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
238 '(minibuffer . t))) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
239 t)) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
240 ;; Create the new frame. |
7357
cebaa850212d
(frame-notice-user-settings): Wait till frame becomes
Richard M. Stallman <rms@gnu.org>
parents:
7344
diff
changeset
|
241 (let (parms new) |
cebaa850212d
(frame-notice-user-settings): Wait till frame becomes
Richard M. Stallman <rms@gnu.org>
parents:
7344
diff
changeset
|
242 ;; If the frame isn't visible yet, wait till it is. |
cebaa850212d
(frame-notice-user-settings): Wait till frame becomes
Richard M. Stallman <rms@gnu.org>
parents:
7344
diff
changeset
|
243 ;; If the user has to position the window, |
cebaa850212d
(frame-notice-user-settings): Wait till frame becomes
Richard M. Stallman <rms@gnu.org>
parents:
7344
diff
changeset
|
244 ;; Emacs doesn't know its real position until |
cebaa850212d
(frame-notice-user-settings): Wait till frame becomes
Richard M. Stallman <rms@gnu.org>
parents:
7344
diff
changeset
|
245 ;; the frame is seen to be visible. |
cebaa850212d
(frame-notice-user-settings): Wait till frame becomes
Richard M. Stallman <rms@gnu.org>
parents:
7344
diff
changeset
|
246 (while (not (cdr (assq 'visibility |
cebaa850212d
(frame-notice-user-settings): Wait till frame becomes
Richard M. Stallman <rms@gnu.org>
parents:
7344
diff
changeset
|
247 (frame-parameters frame-initial-frame)))) |
cebaa850212d
(frame-notice-user-settings): Wait till frame becomes
Richard M. Stallman <rms@gnu.org>
parents:
7344
diff
changeset
|
248 (sleep-for 1)) |
cebaa850212d
(frame-notice-user-settings): Wait till frame becomes
Richard M. Stallman <rms@gnu.org>
parents:
7344
diff
changeset
|
249 (setq parms (append initial-frame-alist |
7322
1f3536445289
(frame-notice-user-settings): Discard `reverse' when
Richard M. Stallman <rms@gnu.org>
parents:
7309
diff
changeset
|
250 default-frame-alist |
1f3536445289
(frame-notice-user-settings): Discard `reverse' when
Richard M. Stallman <rms@gnu.org>
parents:
7309
diff
changeset
|
251 (frame-parameters frame-initial-frame) |
1f3536445289
(frame-notice-user-settings): Discard `reverse' when
Richard M. Stallman <rms@gnu.org>
parents:
7309
diff
changeset
|
252 nil)) |
7344
17a251bf595b
(frame-notice-user-settings): Use geometry parms from frame
Richard M. Stallman <rms@gnu.org>
parents:
7343
diff
changeset
|
253 ;; Get rid of `reverse', because that was handled |
17a251bf595b
(frame-notice-user-settings): Use geometry parms from frame
Richard M. Stallman <rms@gnu.org>
parents:
7343
diff
changeset
|
254 ;; when we first made the frame. |
17a251bf595b
(frame-notice-user-settings): Use geometry parms from frame
Richard M. Stallman <rms@gnu.org>
parents:
7343
diff
changeset
|
255 (setq parms (cons '(reverse) (delq (assq 'reverse parms) parms))) |
17a251bf595b
(frame-notice-user-settings): Use geometry parms from frame
Richard M. Stallman <rms@gnu.org>
parents:
7343
diff
changeset
|
256 (if (assq 'height frame-initial-geometry-arguments) |
8424
af4e01d24892
(frame-delete-all): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8129
diff
changeset
|
257 (setq parms (frame-delete-all 'height parms))) |
7344
17a251bf595b
(frame-notice-user-settings): Use geometry parms from frame
Richard M. Stallman <rms@gnu.org>
parents:
7343
diff
changeset
|
258 (if (assq 'width frame-initial-geometry-arguments) |
8424
af4e01d24892
(frame-delete-all): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8129
diff
changeset
|
259 (setq parms (frame-delete-all 'width parms))) |
7344
17a251bf595b
(frame-notice-user-settings): Use geometry parms from frame
Richard M. Stallman <rms@gnu.org>
parents:
7343
diff
changeset
|
260 (if (assq 'left frame-initial-geometry-arguments) |
8424
af4e01d24892
(frame-delete-all): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8129
diff
changeset
|
261 (setq parms (frame-delete-all 'left parms))) |
7344
17a251bf595b
(frame-notice-user-settings): Use geometry parms from frame
Richard M. Stallman <rms@gnu.org>
parents:
7343
diff
changeset
|
262 (if (assq 'top frame-initial-geometry-arguments) |
8424
af4e01d24892
(frame-delete-all): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8129
diff
changeset
|
263 (setq parms (frame-delete-all 'top parms))) |
7344
17a251bf595b
(frame-notice-user-settings): Use geometry parms from frame
Richard M. Stallman <rms@gnu.org>
parents:
7343
diff
changeset
|
264 (setq new |
17a251bf595b
(frame-notice-user-settings): Use geometry parms from frame
Richard M. Stallman <rms@gnu.org>
parents:
7343
diff
changeset
|
265 (make-frame |
17a251bf595b
(frame-notice-user-settings): Use geometry parms from frame
Richard M. Stallman <rms@gnu.org>
parents:
7343
diff
changeset
|
266 ;; Use the geometry args that created the existing |
17a251bf595b
(frame-notice-user-settings): Use geometry parms from frame
Richard M. Stallman <rms@gnu.org>
parents:
7343
diff
changeset
|
267 ;; frame, rather than the parms we get for it. |
10601
b357feae0096
(frame-notice-user-settings): Avoid having the window manager re-prompt for
Karl Heuer <kwzh@gnu.org>
parents:
10574
diff
changeset
|
268 (append frame-initial-geometry-arguments |
b357feae0096
(frame-notice-user-settings): Avoid having the window manager re-prompt for
Karl Heuer <kwzh@gnu.org>
parents:
10574
diff
changeset
|
269 '((user-size . t) (user-position . t)) |
b357feae0096
(frame-notice-user-settings): Avoid having the window manager re-prompt for
Karl Heuer <kwzh@gnu.org>
parents:
10574
diff
changeset
|
270 parms))) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
271 ;; The initial frame, which we are about to delete, may be |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
272 ;; the only frame with a minibuffer. If it is, create a |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
273 ;; new one. |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
274 (or (delq frame-initial-frame (minibuffer-frame-list)) |
7322
1f3536445289
(frame-notice-user-settings): Discard `reverse' when
Richard M. Stallman <rms@gnu.org>
parents:
7309
diff
changeset
|
275 (make-frame (append minibuffer-frame-alist |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
276 '((minibuffer . only))))) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
277 |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
278 ;; If the initial frame is serving as a surrogate |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
279 ;; minibuffer frame for any frames, we need to wean them |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
280 ;; onto a new frame. The default-minibuffer-frame |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
281 ;; variable must be handled similarly. |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
282 (let ((users-of-initial |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
283 (filtered-frame-list |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
284 (function (lambda (frame) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
285 (and (not (eq frame frame-initial-frame)) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
286 (eq (window-frame |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
287 (minibuffer-window frame)) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
288 frame-initial-frame))))))) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
289 (if (or users-of-initial |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
290 (eq default-minibuffer-frame frame-initial-frame)) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
291 |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
292 ;; Choose an appropriate frame. Prefer frames which |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
293 ;; are only minibuffers. |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
294 (let* ((new-surrogate |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
295 (car |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
296 (or (filtered-frame-list |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
297 (function |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
298 (lambda (frame) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
299 (eq (cdr (assq 'minibuffer |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
300 (frame-parameters frame))) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
301 'only)))) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
302 (minibuffer-frame-list)))) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
303 (new-minibuffer (minibuffer-window new-surrogate))) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
304 |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
305 (if (eq default-minibuffer-frame frame-initial-frame) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
306 (setq default-minibuffer-frame new-surrogate)) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
307 |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
308 ;; Wean the frames using frame-initial-frame as |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
309 ;; their minibuffer frame. |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
310 (mapcar |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
311 (function |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
312 (lambda (frame) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
313 (modify-frame-parameters |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
314 frame (list (cons 'minibuffer new-minibuffer))))) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
315 users-of-initial)))) |
1113 | 316 |
317 ;; Redirect events enqueued at this frame to the new frame. | |
318 ;; Is this a good idea? | |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
319 (redirect-frame-focus frame-initial-frame new) |
1113 | 320 |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
321 ;; Finally, get rid of the old frame. |
4360
ea004f01b2d8
* frame.el (frame-notice-user-settings): If we had to create a new
Jim Blandy <jimb@redhat.com>
parents:
4305
diff
changeset
|
322 (delete-frame frame-initial-frame t)) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
323 |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
324 ;; Otherwise, we don't need all that rigamarole; just apply |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
325 ;; the new parameters. |
4305
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
326 (let (newparms allparms tail) |
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
327 (setq allparms (append initial-frame-alist |
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
328 default-frame-alist)) |
8424
af4e01d24892
(frame-delete-all): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8129
diff
changeset
|
329 (if (assq 'height frame-initial-geometry-arguments) |
af4e01d24892
(frame-delete-all): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8129
diff
changeset
|
330 (setq allparms (frame-delete-all 'height allparms))) |
af4e01d24892
(frame-delete-all): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8129
diff
changeset
|
331 (if (assq 'width frame-initial-geometry-arguments) |
af4e01d24892
(frame-delete-all): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8129
diff
changeset
|
332 (setq allparms (frame-delete-all 'width allparms))) |
af4e01d24892
(frame-delete-all): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8129
diff
changeset
|
333 (if (assq 'left frame-initial-geometry-arguments) |
af4e01d24892
(frame-delete-all): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8129
diff
changeset
|
334 (setq allparms (frame-delete-all 'left allparms))) |
af4e01d24892
(frame-delete-all): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8129
diff
changeset
|
335 (if (assq 'top frame-initial-geometry-arguments) |
af4e01d24892
(frame-delete-all): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8129
diff
changeset
|
336 (setq allparms (frame-delete-all 'top allparms))) |
4305
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
337 (setq tail allparms) |
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
338 ;; Find just the parms that have changed since we first |
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
339 ;; made this frame. Those are the ones actually set by |
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
340 ;; the init file. For those parms whose values we already knew |
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
341 ;; (such as those spec'd by command line options) |
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
342 ;; it is undesirable to specify the parm again |
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
343 ;; once the user has seen the frame and been able to alter it |
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
344 ;; manually. |
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
345 (while tail |
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
346 (let (newval oldval) |
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
347 (setq oldval (cdr (assq (car (car tail)) |
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
348 frame-initial-frame-alist))) |
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
349 (setq newval (cdr (assq (car (car tail)) allparms))) |
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
350 (or (eq oldval newval) |
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
351 (setq newparms |
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
352 (cons (cons (car (car tail)) newval) newparms)))) |
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
353 (setq tail (cdr tail))) |
8521
340ebdb14a0e
(frame-notice-user-settings): If we change the frame's font,
Richard M. Stallman <rms@gnu.org>
parents:
8453
diff
changeset
|
354 (setq newparms (nreverse newparms)) |
4305
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
355 (modify-frame-parameters frame-initial-frame |
8521
340ebdb14a0e
(frame-notice-user-settings): If we change the frame's font,
Richard M. Stallman <rms@gnu.org>
parents:
8453
diff
changeset
|
356 newparms) |
340ebdb14a0e
(frame-notice-user-settings): If we change the frame's font,
Richard M. Stallman <rms@gnu.org>
parents:
8453
diff
changeset
|
357 (if (assq 'font newparms) |
340ebdb14a0e
(frame-notice-user-settings): If we change the frame's font,
Richard M. Stallman <rms@gnu.org>
parents:
8453
diff
changeset
|
358 (frame-update-faces frame-initial-frame))))) |
394 | 359 |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
360 ;; Restore the original buffer. |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
361 (set-buffer old-buffer) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
362 |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
363 ;; 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
|
364 ;; Make sure frame-notice-user-settings does nothing if called twice. |
cd270fa53052
* frame.el (frame-notice-user-settings): Don't make
Jim Blandy <jimb@redhat.com>
parents:
2846
diff
changeset
|
365 (setq frame-initial-frame nil))) |
394 | 366 |
8424
af4e01d24892
(frame-delete-all): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8129
diff
changeset
|
367 ;; Delete from ALIST all elements whose car is KEY. |
af4e01d24892
(frame-delete-all): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8129
diff
changeset
|
368 ;; Return the modified alist. |
af4e01d24892
(frame-delete-all): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8129
diff
changeset
|
369 (defun frame-delete-all (key alist) |
8453
32880f6bd87a
(frame-delete-all): Copy the whole alist first.
Richard M. Stallman <rms@gnu.org>
parents:
8424
diff
changeset
|
370 (setq alist (copy-sequence alist)) |
8424
af4e01d24892
(frame-delete-all): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8129
diff
changeset
|
371 (let ((tail alist)) |
af4e01d24892
(frame-delete-all): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8129
diff
changeset
|
372 (while tail |
af4e01d24892
(frame-delete-all): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8129
diff
changeset
|
373 (if (eq (car (car tail)) key) |
af4e01d24892
(frame-delete-all): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8129
diff
changeset
|
374 (setq alist (delq (car tail) alist))) |
af4e01d24892
(frame-delete-all): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8129
diff
changeset
|
375 (setq tail (cdr tail))) |
af4e01d24892
(frame-delete-all): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8129
diff
changeset
|
376 alist)) |
394 | 377 |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
378 ;;;; Creation of additional frames, and other frame miscellanea |
394 | 379 |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
380 ;;; Return some frame other than the current frame, creating one if |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3554
diff
changeset
|
381 ;;; necessary. Note that the minibuffer frame, if separate, is not |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
382 ;;; considered (see next-frame). |
827 | 383 (defun get-other-frame () |
777 | 384 (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
|
385 (make-frame) |
777 | 386 (next-frame (selected-frame))))) |
394 | 387 s)) |
388 | |
777 | 389 (defun next-multiframe-window () |
390 "Select the next window, regardless of which frame it is on." | |
394 | 391 (interactive) |
392 (select-window (next-window (selected-window) | |
393 (> (minibuffer-depth) 0) | |
394 t))) | |
395 | |
777 | 396 (defun previous-multiframe-window () |
397 "Select the previous window, regardless of which frame it is on." | |
394 | 398 (interactive) |
399 (select-window (previous-window (selected-window) | |
400 (> (minibuffer-depth) 0) | |
401 t))) | |
402 | |
9687
1048e2d032e6
(make-frame-on-display): New function.
Richard M. Stallman <rms@gnu.org>
parents:
9175
diff
changeset
|
403 (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
|
404 "Make a frame on display DISPLAY. |
1048e2d032e6
(make-frame-on-display): New function.
Richard M. Stallman <rms@gnu.org>
parents:
9175
diff
changeset
|
405 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
|
406 (interactive "sMake frame on display: ") |
1048e2d032e6
(make-frame-on-display): New function.
Richard M. Stallman <rms@gnu.org>
parents:
9175
diff
changeset
|
407 (make-frame (cons (cons 'display display) parameters))) |
1048e2d032e6
(make-frame-on-display): New function.
Richard M. Stallman <rms@gnu.org>
parents:
9175
diff
changeset
|
408 |
2246
1f0d48f7e583
(make-frame): Renamed from new-frame.
Richard M. Stallman <rms@gnu.org>
parents:
2202
diff
changeset
|
409 ;; Alias, kept temporarily. |
2571
b65cf676a09b
All fsets changed to defaliases.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2246
diff
changeset
|
410 (defalias 'new-frame 'make-frame) |
2246
1f0d48f7e583
(make-frame): Renamed from new-frame.
Richard M. Stallman <rms@gnu.org>
parents:
2202
diff
changeset
|
411 (defun make-frame (&optional parameters) |
777 | 412 "Create a new frame, displaying the current buffer. |
539 | 413 |
542 | 414 Optional argument PARAMETERS is an alist of parameters for the new |
10574 | 415 frame. Specifically, PARAMETERS is a list of pairs, each having |
416 the form (NAME . VALUE). | |
417 | |
418 Here are some of the parameters allowed (not a complete list): | |
542 | 419 |
1974
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
420 \(name . STRING) - The frame should be named STRING. |
542 | 421 |
1974
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
422 \(height . NUMBER) - The frame should be NUMBER text lines high. If |
542 | 423 this parameter is present, the width parameter must also be |
424 given. | |
425 | |
1974
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
426 \(width . NUMBER) - The frame should be NUMBER characters in width. |
542 | 427 If this parameter is present, the height parameter must also |
428 be given. | |
429 | |
1974
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
430 \(minibuffer . t) - the frame should have a minibuffer |
1977
ca6059bb1d6f
* frame.el (new-frame): Doc fix.
Jim Blandy <jimb@redhat.com>
parents:
1974
diff
changeset
|
431 \(minibuffer . nil) - the frame should have no minibuffer |
1974
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
432 \(minibuffer . only) - the frame should contain only a minibuffer |
7712 | 433 \(minibuffer . WINDOW) - the frame should use WINDOW as its minibuffer window." |
394 | 434 (interactive) |
4875
78a52ca82a71
(make-frame): Use before-make-frame-hook and after-make-frame-hook.
Richard M. Stallman <rms@gnu.org>
parents:
4784
diff
changeset
|
435 (let ((nframe)) |
78a52ca82a71
(make-frame): Use before-make-frame-hook and after-make-frame-hook.
Richard M. Stallman <rms@gnu.org>
parents:
4784
diff
changeset
|
436 (run-hooks 'before-make-frame-hook) |
78a52ca82a71
(make-frame): Use before-make-frame-hook and after-make-frame-hook.
Richard M. Stallman <rms@gnu.org>
parents:
4784
diff
changeset
|
437 (setq nframe (funcall frame-creation-function parameters)) |
78a52ca82a71
(make-frame): Use before-make-frame-hook and after-make-frame-hook.
Richard M. Stallman <rms@gnu.org>
parents:
4784
diff
changeset
|
438 (run-hooks 'after-make-frame-hook) |
78a52ca82a71
(make-frame): Use before-make-frame-hook and after-make-frame-hook.
Richard M. Stallman <rms@gnu.org>
parents:
4784
diff
changeset
|
439 nframe)) |
394 | 440 |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
441 (defun filtered-frame-list (predicate) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
442 "Return a list of all live frames which satisfy PREDICATE." |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
443 (let ((frames (frame-list)) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
444 good-frames) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
445 (while (consp frames) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
446 (if (funcall predicate (car frames)) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
447 (setq good-frames (cons (car frames) good-frames))) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
448 (setq frames (cdr frames))) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
449 good-frames)) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
450 |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
451 (defun minibuffer-frame-list () |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
452 "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
|
453 (filtered-frame-list |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
454 (function (lambda (frame) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
455 (eq frame (window-frame (minibuffer-window frame))))))) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
456 |
3971
6e7afc0a7fbc
* frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
457 (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
|
458 "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
|
459 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
|
460 `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
|
461 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
|
462 the user during startup." |
6e7afc0a7fbc
* frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
463 (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
|
464 (let ((tail param-list)) |
6e7afc0a7fbc
* frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
465 (while (consp (cdr tail)) |
6e7afc0a7fbc
* frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
466 (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
|
467 (memq (car (car (cdr tail))) |
81f9ad98c323
(frame-notice-user-settings): When replacing the first
Richard M. Stallman <rms@gnu.org>
parents:
7322
diff
changeset
|
468 '(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
|
469 (progn |
81f9ad98c323
(frame-notice-user-settings): When replacing the first
Richard M. Stallman <rms@gnu.org>
parents:
7322
diff
changeset
|
470 (setq frame-initial-geometry-arguments |
81f9ad98c323
(frame-notice-user-settings): When replacing the first
Richard M. Stallman <rms@gnu.org>
parents:
7322
diff
changeset
|
471 (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
|
472 (setcdr tail (cdr (cdr tail)))) |
3971
6e7afc0a7fbc
* frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
473 (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
|
474 (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
|
475 (nreverse frame-initial-geometry-arguments)) |
3971
6e7afc0a7fbc
* frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
476 (cdr param-list)) |
6e7afc0a7fbc
* frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
477 |
6e7afc0a7fbc
* frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
478 |
4425
1b48826df9cb
(other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents:
4360
diff
changeset
|
479 (defun other-frame (arg) |
4431
2fe6adb8a82f
(other-frame): Skip iconified and invisible frames.
Roland McGrath <roland@gnu.org>
parents:
4425
diff
changeset
|
480 "Select the ARG'th different visible frame, and raise it. |
4425
1b48826df9cb
(other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents:
4360
diff
changeset
|
481 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
|
482 This command selects the frame ARG steps away in that order. |
1b48826df9cb
(other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents:
4360
diff
changeset
|
483 A negative ARG moves in the opposite order." |
1b48826df9cb
(other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents:
4360
diff
changeset
|
484 (interactive "p") |
1b48826df9cb
(other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents:
4360
diff
changeset
|
485 (let ((frame (selected-frame))) |
1b48826df9cb
(other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents:
4360
diff
changeset
|
486 (while (> arg 0) |
4431
2fe6adb8a82f
(other-frame): Skip iconified and invisible frames.
Roland McGrath <roland@gnu.org>
parents:
4425
diff
changeset
|
487 (setq frame (next-frame frame)) |
2fe6adb8a82f
(other-frame): Skip iconified and invisible frames.
Roland McGrath <roland@gnu.org>
parents:
4425
diff
changeset
|
488 (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
|
489 (setq frame (next-frame frame))) |
2fe6adb8a82f
(other-frame): Skip iconified and invisible frames.
Roland McGrath <roland@gnu.org>
parents:
4425
diff
changeset
|
490 (setq arg (1- arg))) |
4425
1b48826df9cb
(other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents:
4360
diff
changeset
|
491 (while (< arg 0) |
4431
2fe6adb8a82f
(other-frame): Skip iconified and invisible frames.
Roland McGrath <roland@gnu.org>
parents:
4425
diff
changeset
|
492 (setq frame (previous-frame frame)) |
2fe6adb8a82f
(other-frame): Skip iconified and invisible frames.
Roland McGrath <roland@gnu.org>
parents:
4425
diff
changeset
|
493 (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
|
494 (setq frame (previous-frame frame))) |
4553
ceb140c16ad2
(other-frame): Fix error in loop counting.
Richard M. Stallman <rms@gnu.org>
parents:
4431
diff
changeset
|
495 (setq arg (1+ arg))) |
4425
1b48826df9cb
(other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents:
4360
diff
changeset
|
496 (raise-frame frame) |
4784
8878c40bc7bd
(other-frame): Warp the mouse so that the other
Richard M. Stallman <rms@gnu.org>
parents:
4670
diff
changeset
|
497 (select-frame frame) |
4911
bc4636cdaf01
(other-frame): Subtract 1 from hpos for new mouse position.
Richard M. Stallman <rms@gnu.org>
parents:
4875
diff
changeset
|
498 (set-mouse-position (selected-frame) (1- (frame-width)) 0) |
11039
c9e2537da847
(other-frame): Don't try to unfocus in a termcap frame.
Karl Heuer <kwzh@gnu.org>
parents:
11038
diff
changeset
|
499 (if (fboundp 'unfocus-frame) |
c9e2537da847
(other-frame): Don't try to unfocus in a termcap frame.
Karl Heuer <kwzh@gnu.org>
parents:
11038
diff
changeset
|
500 (unfocus-frame)))) |
394 | 501 |
777 | 502 ;;;; Frame configurations |
756 | 503 |
777 | 504 (defun current-frame-configuration () |
505 "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
|
506 Its car is `frame-configuration'. |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
507 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
|
508 where |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
509 FRAME is a frame object, |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
510 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
|
511 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
|
512 (cons 'frame-configuration |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
513 (mapcar (function |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
514 (lambda (frame) |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
515 (list frame |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
516 (frame-parameters frame) |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
517 (current-window-configuration frame)))) |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
518 (frame-list)))) |
756 | 519 |
4670
e39967101d8b
(set-frame-configuration): Take new optional arg NODELETE; if non-nil,
Roland McGrath <roland@gnu.org>
parents:
4625
diff
changeset
|
520 (defun set-frame-configuration (configuration &optional nodelete) |
777 | 521 "Restore the frames to the state described by CONFIGURATION. |
522 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
|
523 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
|
524 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
|
525 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
|
526 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
|
527 (or (frame-configuration-p configuration) |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
528 (signal 'wrong-type-argument |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
529 (list 'frame-configuration-p configuration))) |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
530 (let ((config-alist (cdr configuration)) |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
531 frames-to-delete) |
756 | 532 (mapcar (function |
777 | 533 (lambda (frame) |
2202
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
534 (let ((parameters (assq frame config-alist))) |
756 | 535 (if parameters |
536 (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
|
537 (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
|
538 frame |
10557 | 539 ;; 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
|
540 ;; 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
|
541 (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
|
542 (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
|
543 (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
|
544 parms)) |
756 | 545 (set-window-configuration (nth 2 parameters))) |
777 | 546 (setq frames-to-delete (cons frame frames-to-delete)))))) |
547 (frame-list)) | |
4919
3963d8a9f342
(set-frame-configuration): If NODELETE, make the unwanted frames invisible.
Richard M. Stallman <rms@gnu.org>
parents:
4911
diff
changeset
|
548 (if nodelete |
4930
04dee67f86cf
(set-frame-configuration): Iconify frames
Richard M. Stallman <rms@gnu.org>
parents:
4919
diff
changeset
|
549 ;; Note: making frames invisible here was tried |
04dee67f86cf
(set-frame-configuration): Iconify frames
Richard M. Stallman <rms@gnu.org>
parents:
4919
diff
changeset
|
550 ;; 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
|
551 ;; 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
|
552 ;; for where to put it. |
04dee67f86cf
(set-frame-configuration): Iconify frames
Richard M. Stallman <rms@gnu.org>
parents:
4919
diff
changeset
|
553 (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
|
554 (mapcar 'delete-frame frames-to-delete)))) |
394 | 555 |
2202
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
556 (defun frame-configuration-p (object) |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
557 "Return non-nil if OBJECT seems to be a frame configuration. |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
558 Any list whose car is `frame-configuration' is assumed to be a frame |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
559 configuration." |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
560 (and (consp object) |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
561 (eq (car object) 'frame-configuration))) |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
562 |
394 | 563 |
777 | 564 ;;;; Convenience functions for accessing and interactively changing |
565 ;;;; frame parameters. | |
394 | 566 |
826 | 567 (defun frame-height (&optional frame) |
777 | 568 "Return number of lines available for display on FRAME. |
569 If FRAME is omitted, describe the currently selected frame." | |
826 | 570 (cdr (assq 'height (frame-parameters frame)))) |
777 | 571 |
572 (defun frame-width (&optional frame) | |
573 "Return number of columns available for display on FRAME. | |
574 If FRAME is omitted, describe the currently selected frame." | |
826 | 575 (cdr (assq 'width (frame-parameters frame)))) |
777 | 576 |
394 | 577 (defun set-default-font (font-name) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
578 "Set the font of the selected frame to FONT. |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
579 When called interactively, prompt for the name of the font to use." |
394 | 580 (interactive "sFont name: ") |
777 | 581 (modify-frame-parameters (selected-frame) |
7020
c7525f1cfaba
(set-default-font): Call frame-update-faces.
Richard M. Stallman <rms@gnu.org>
parents:
4930
diff
changeset
|
582 (list (cons 'font font-name))) |
c7525f1cfaba
(set-default-font): Call frame-update-faces.
Richard M. Stallman <rms@gnu.org>
parents:
4930
diff
changeset
|
583 ;; Update faces that want a bold or italic version of the default font. |
c7525f1cfaba
(set-default-font): Call frame-update-faces.
Richard M. Stallman <rms@gnu.org>
parents:
4930
diff
changeset
|
584 (frame-update-faces (selected-frame))) |
394 | 585 |
1881
436edc3e74f6
(frame-initialize): Fix error syntax.
Richard M. Stallman <rms@gnu.org>
parents:
1863
diff
changeset
|
586 (defun set-background-color (color-name) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
587 "Set the background color of the selected frame to COLOR. |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
588 When called interactively, prompt for the name of the color to use." |
394 | 589 (interactive "sColor: ") |
777 | 590 (modify-frame-parameters (selected-frame) |
10192
dd28f1cd68d2
(set-background-color, set-foreground-color):
Richard M. Stallman <rms@gnu.org>
parents:
9737
diff
changeset
|
591 (list (cons 'background-color color-name))) |
dd28f1cd68d2
(set-background-color, set-foreground-color):
Richard M. Stallman <rms@gnu.org>
parents:
9737
diff
changeset
|
592 (frame-update-face-colors (selected-frame))) |
394 | 593 |
1881
436edc3e74f6
(frame-initialize): Fix error syntax.
Richard M. Stallman <rms@gnu.org>
parents:
1863
diff
changeset
|
594 (defun set-foreground-color (color-name) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
595 "Set the foreground color of the selected frame to COLOR. |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
596 When called interactively, prompt for the name of the color to use." |
394 | 597 (interactive "sColor: ") |
777 | 598 (modify-frame-parameters (selected-frame) |
10192
dd28f1cd68d2
(set-background-color, set-foreground-color):
Richard M. Stallman <rms@gnu.org>
parents:
9737
diff
changeset
|
599 (list (cons 'foreground-color color-name))) |
dd28f1cd68d2
(set-background-color, set-foreground-color):
Richard M. Stallman <rms@gnu.org>
parents:
9737
diff
changeset
|
600 (frame-update-face-colors (selected-frame))) |
394 | 601 |
602 (defun set-cursor-color (color-name) | |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
603 "Set the text cursor color of the selected frame to COLOR. |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
604 When called interactively, prompt for the name of the color to use." |
394 | 605 (interactive "sColor: ") |
777 | 606 (modify-frame-parameters (selected-frame) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
607 (list (cons 'cursor-color color-name)))) |
394 | 608 |
1974
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
609 (defun set-mouse-color (color-name) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
610 "Set the color of the mouse pointer of the selected frame to COLOR. |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
611 When called interactively, prompt for the name of the color to use." |
394 | 612 (interactive "sColor: ") |
777 | 613 (modify-frame-parameters (selected-frame) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
614 (list (cons 'mouse-color color-name)))) |
394 | 615 |
1974
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
616 (defun set-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
|
617 "Set the color of the border of the selected frame to COLOR. |
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
618 When called interactively, prompt for the name of the color to use." |
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
619 (interactive "sColor: ") |
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
620 (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
|
621 (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
|
622 |
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
623 (defun auto-raise-mode (arg) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
624 "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
|
625 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
|
626 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
|
627 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
|
628 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
|
629 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
|
630 (interactive "P") |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
631 (if (null arg) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
632 (setq arg |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
633 (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
|
634 -1 1))) |
777 | 635 (modify-frame-parameters (selected-frame) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
636 (list (cons 'auto-raise (> arg 0))))) |
394 | 637 |
1974
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
638 (defun auto-lower-mode (arg) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
639 "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
|
640 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
|
641 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
|
642 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
|
643 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
|
644 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
|
645 (interactive "P") |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
646 (if (null arg) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
647 (setq arg |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
648 (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
|
649 -1 1))) |
777 | 650 (modify-frame-parameters (selected-frame) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
651 (list (cons 'auto-lower (> arg 0))))) |
394 | 652 |
2846
c36e7ad524d3
(toggle-scroll-bar): Renamed from toggle-vertical-scroll...
Richard M. Stallman <rms@gnu.org>
parents:
2763
diff
changeset
|
653 (defun toggle-scroll-bar (arg) |
1977
ca6059bb1d6f
* frame.el (new-frame): Doc fix.
Jim Blandy <jimb@redhat.com>
parents:
1974
diff
changeset
|
654 "Toggle whether or not the selected frame has vertical scroll bars. |
ca6059bb1d6f
* frame.el (new-frame): Doc fix.
Jim Blandy <jimb@redhat.com>
parents:
1974
diff
changeset
|
655 With arg, turn vertical scroll bars on if and only if arg is positive." |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
656 (interactive "P") |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
657 (if (null arg) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
658 (setq arg |
1977
ca6059bb1d6f
* frame.el (new-frame): Doc fix.
Jim Blandy <jimb@redhat.com>
parents:
1974
diff
changeset
|
659 (if (cdr (assq 'vertical-scroll-bars |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
660 (frame-parameters (selected-frame)))) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
661 -1 1))) |
777 | 662 (modify-frame-parameters (selected-frame) |
1977
ca6059bb1d6f
* frame.el (new-frame): Doc fix.
Jim Blandy <jimb@redhat.com>
parents:
1974
diff
changeset
|
663 (list (cons 'vertical-scroll-bars (> arg 0))))) |
394 | 664 |
1881
436edc3e74f6
(frame-initialize): Fix error syntax.
Richard M. Stallman <rms@gnu.org>
parents:
1863
diff
changeset
|
665 (defun toggle-horizontal-scroll-bar (arg) |
1977
ca6059bb1d6f
* frame.el (new-frame): Doc fix.
Jim Blandy <jimb@redhat.com>
parents:
1974
diff
changeset
|
666 "Toggle whether or not the selected frame has horizontal scroll bars. |
ca6059bb1d6f
* frame.el (new-frame): Doc fix.
Jim Blandy <jimb@redhat.com>
parents:
1974
diff
changeset
|
667 With arg, turn horizontal scroll bars on if and only if arg is positive. |
ca6059bb1d6f
* frame.el (new-frame): Doc fix.
Jim Blandy <jimb@redhat.com>
parents:
1974
diff
changeset
|
668 Horizontal scroll bars aren't implemented yet." |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
669 (interactive "P") |
1881
436edc3e74f6
(frame-initialize): Fix error syntax.
Richard M. Stallman <rms@gnu.org>
parents:
1863
diff
changeset
|
670 (error "Horizontal scroll bars aren't implemented yet")) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
671 |
394 | 672 |
777 | 673 ;;;; 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
|
674 (defalias 'screen-height 'frame-height) |
b65cf676a09b
All fsets changed to defaliases.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2246
diff
changeset
|
675 (defalias 'screen-width 'frame-width) |
958 | 676 |
677 (defun set-screen-width (cols &optional pretend) | |
678 "Obsolete function to change the size of the screen to COLS columns.\n\ | |
679 Optional second arg non-nil means that redisplay should use COLS columns\n\ | |
680 but that the idea of the actual width of the frame should not be changed.\n\ | |
681 This function is provided only for compatibility with Emacs 18; new code\n\ | |
1475 | 682 should use `set-frame-width instead'." |
958 | 683 (set-frame-width (selected-frame) cols pretend)) |
684 | |
685 (defun set-screen-height (lines &optional pretend) | |
686 "Obsolete function to change the height of the screen to LINES lines.\n\ | |
687 Optional second arg non-nil means that redisplay should use LINES lines\n\ | |
688 but that the idea of the actual height of the screen should not be changed.\n\ | |
689 This function is provided only for compatibility with Emacs 18; new code\n\ | |
1475 | 690 should use `set-frame-width' instead." |
958 | 691 (set-frame-height (selected-frame) lines pretend)) |
692 | |
693 (make-obsolete 'screen-height 'frame-height) | |
694 (make-obsolete 'screen-width 'frame-width) | |
695 (make-obsolete 'set-screen-width 'set-frame-width) | |
696 (make-obsolete 'set-screen-height 'set-frame-height) | |
777 | 697 |
698 | |
394 | 699 ;;;; Key bindings |
727 | 700 (defvar ctl-x-5-map (make-sparse-keymap) |
777 | 701 "Keymap for frame commands.") |
2571
b65cf676a09b
All fsets changed to defaliases.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2246
diff
changeset
|
702 (defalias 'ctl-x-5-prefix ctl-x-5-map) |
727 | 703 (define-key ctl-x-map "5" 'ctl-x-5-prefix) |
394 | 704 |
7322
1f3536445289
(frame-notice-user-settings): Discard `reverse' when
Richard M. Stallman <rms@gnu.org>
parents:
7309
diff
changeset
|
705 (define-key ctl-x-5-map "2" 'make-frame) |
777 | 706 (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
|
707 (define-key ctl-x-5-map "o" 'other-frame) |
584 | 708 |
777 | 709 (provide 'frame) |
658
7cbd4fcd8b0f
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
584
diff
changeset
|
710 |
777 | 711 ;;; frame.el ends here |