Mercurial > emacs
annotate lisp/frame.el @ 97995:eaf8630bda7d
(msdos-face-setup): Setup faces for all frames, not just for terminal-frame.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Fri, 05 Sep 2008 11:25:42 +0000 |
parents | 55bef47f5e9f |
children | 2f659932a2fb |
rev | line source |
---|---|
38412
253f761ad37b
Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents:
37823
diff
changeset
|
1 ;;; frame.el --- multi-frame management independent of window systems |
658
7cbd4fcd8b0f
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
584
diff
changeset
|
2 |
64762
41bb365f41c4
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64543
diff
changeset
|
3 ;; Copyright (C) 1993, 1994, 1996, 1997, 2000, 2001, 2002, 2003, |
79721 | 4 ;; 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
846
20674ae6bf52
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
827
diff
changeset
|
5 |
793
6fb68a1460a6
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
777
diff
changeset
|
6 ;; Maintainer: FSF |
811
e694e0879463
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
806
diff
changeset
|
7 ;; Keywords: internal |
793
6fb68a1460a6
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
777
diff
changeset
|
8 |
14169 | 9 ;; This file is part of GNU Emacs. |
10 | |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94158
diff
changeset
|
11 ;; GNU Emacs is free software: you can redistribute it and/or modify |
14169 | 12 ;; it under the terms of the GNU General Public License as published by |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94158
diff
changeset
|
13 ;; the Free Software Foundation, either version 3 of the License, or |
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94158
diff
changeset
|
14 ;; (at your option) any later version. |
14169 | 15 |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94158
diff
changeset
|
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
394 | 23 |
38412
253f761ad37b
Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents:
37823
diff
changeset
|
24 ;;; Commentary: |
253f761ad37b
Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents:
37823
diff
changeset
|
25 |
793
6fb68a1460a6
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
777
diff
changeset
|
26 ;;; Code: |
6fb68a1460a6
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
777
diff
changeset
|
27 |
83014
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
28 (defvar frame-creation-function-alist |
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
29 (list (cons nil |
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
30 (if (fboundp 'tty-create-frame-with-faces) |
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
31 'tty-create-frame-with-faces |
84699
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
32 (lambda (parameters) |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
33 (error "Can't create multiple frames without a window system"))))) |
83014
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
34 "Alist of window-system dependent functions to call to create a new frame. |
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
35 The window system startup file should add its frame creation |
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
36 function to this list, which should take an alist of parameters |
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
37 as its argument.") |
83009
b2b37c85b00a
Numerous bugfixes and small improvements.
Karoly Lorentey <lorentey@elte.hu>
parents:
83008
diff
changeset
|
38 |
83110
43581c3f182f
A simple implementation for display-local frame parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
83065
diff
changeset
|
39 (defvar window-system-default-frame-alist nil |
43581c3f182f
A simple implementation for display-local frame parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
83065
diff
changeset
|
40 "Alist of window-system dependent default frame parameters. |
83496
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
41 You can set this in your `.emacs' file; for example, |
83110
43581c3f182f
A simple implementation for display-local frame parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
83065
diff
changeset
|
42 |
43581c3f182f
A simple implementation for display-local frame parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
83065
diff
changeset
|
43 ;; Disable menubar and toolbar on the console, but enable them under X. |
43581c3f182f
A simple implementation for display-local frame parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
83065
diff
changeset
|
44 (setq window-system-default-frame-alist |
43581c3f182f
A simple implementation for display-local frame parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
83065
diff
changeset
|
45 '((x (menu-bar-lines . 1) (tool-bar-lines . 1)) |
43581c3f182f
A simple implementation for display-local frame parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
83065
diff
changeset
|
46 (nil (menu-bar-lines . 0) (tool-bar-lines . 0)))) |
43581c3f182f
A simple implementation for display-local frame parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
83065
diff
changeset
|
47 |
83496
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
48 Parameters specified here supersede the values given in `default-frame-alist'.") |
394 | 49 |
39846
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
50 ;; The initial value given here used to ask for a minibuffer. |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
51 ;; But that's not necessary, because the default is to have one. |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
52 ;; By not specifying it here, we let an X resource specify it. |
23745
43927e2a5899
(initial-frame-alist): Add defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
22232
diff
changeset
|
53 (defcustom initial-frame-alist nil |
24926
4cb7e7beea27
(minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
24207
diff
changeset
|
54 "*Alist of frame parameters for creating the initial X window frame. |
1974
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
55 You can set this in your `.emacs' file; for example, |
777 | 56 (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
|
57 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
|
58 |
aa25c6ea397d
(initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
8072
diff
changeset
|
59 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
|
60 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
|
61 `minibuffer-frame-alist'. |
8129
aa25c6ea397d
(initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
8072
diff
changeset
|
62 |
aa25c6ea397d
(initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
8072
diff
changeset
|
63 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
|
64 by setting this variable in your `.emacs' file; however, they won't |
10557 | 65 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
|
66 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
|
67 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
|
68 * 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
|
69 * 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
|
70 don't affect subsequent frames. |
aa25c6ea397d
(initial-frame-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
8072
diff
changeset
|
71 * Set `initial-frame-alist' in a way that matches the X resources, |
23745
43927e2a5899
(initial-frame-alist): Add defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
22232
diff
changeset
|
72 to override what you put in `default-frame-alist'." |
43927e2a5899
(initial-frame-alist): Add defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
22232
diff
changeset
|
73 :type '(repeat (cons :format "%v" |
43927e2a5899
(initial-frame-alist): Add defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
22232
diff
changeset
|
74 (symbol :tag "Parameter") |
43927e2a5899
(initial-frame-alist): Add defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
22232
diff
changeset
|
75 (sexp :tag "Value"))) |
43927e2a5899
(initial-frame-alist): Add defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
22232
diff
changeset
|
76 :group 'frames) |
394 | 77 |
24926
4cb7e7beea27
(minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
24207
diff
changeset
|
78 (defcustom minibuffer-frame-alist '((width . 80) (height . 2)) |
4cb7e7beea27
(minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
24207
diff
changeset
|
79 "*Alist of frame parameters for initially creating a minibuffer frame. |
1974
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
80 You can set this in your `.emacs' file; for example, |
777 | 81 (setq minibuffer-frame-alist |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
82 '((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
|
83 Parameters specified here supersede the values given in |
24926
4cb7e7beea27
(minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
24207
diff
changeset
|
84 `default-frame-alist', for a minibuffer frame." |
4cb7e7beea27
(minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
24207
diff
changeset
|
85 :type '(repeat (cons :format "%v" |
4cb7e7beea27
(minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
24207
diff
changeset
|
86 (symbol :tag "Parameter") |
4cb7e7beea27
(minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
24207
diff
changeset
|
87 (sexp :tag "Value"))) |
4cb7e7beea27
(minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
24207
diff
changeset
|
88 :group 'frames) |
394 | 89 |
24926
4cb7e7beea27
(minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
24207
diff
changeset
|
90 (defcustom pop-up-frame-alist nil |
4cb7e7beea27
(minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
24207
diff
changeset
|
91 "*Alist of frame parameters used when creating pop-up frames. |
777 | 92 Pop-up frames are used for completions, help, and the like. |
394 | 93 This variable can be set in your init file, like this: |
777 | 94 (setq pop-up-frame-alist '((width . 80) (height . 20))) |
24926
4cb7e7beea27
(minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
24207
diff
changeset
|
95 These supersede the values given in `default-frame-alist', |
4cb7e7beea27
(minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
24207
diff
changeset
|
96 for pop-up frames." |
4cb7e7beea27
(minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
24207
diff
changeset
|
97 :type '(repeat (cons :format "%v" |
4cb7e7beea27
(minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
24207
diff
changeset
|
98 (symbol :tag "Parameter") |
4cb7e7beea27
(minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
24207
diff
changeset
|
99 (sexp :tag "Value"))) |
4cb7e7beea27
(minibuffer-frame-alist): Use defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
24207
diff
changeset
|
100 :group 'frames) |
394 | 101 |
97963
55bef47f5e9f
(pop-up-frame-function): Move here from window.el to avoid
Martin Rudalics <rudalics@gmx.at>
parents:
97043
diff
changeset
|
102 (defcustom pop-up-frame-function |
55bef47f5e9f
(pop-up-frame-function): Move here from window.el to avoid
Martin Rudalics <rudalics@gmx.at>
parents:
97043
diff
changeset
|
103 (lambda () (make-frame pop-up-frame-alist)) |
55bef47f5e9f
(pop-up-frame-function): Move here from window.el to avoid
Martin Rudalics <rudalics@gmx.at>
parents:
97043
diff
changeset
|
104 "Function to call to handle automatic new frame creation. |
55bef47f5e9f
(pop-up-frame-function): Move here from window.el to avoid
Martin Rudalics <rudalics@gmx.at>
parents:
97043
diff
changeset
|
105 It is called with no arguments and should return a newly created frame." |
55bef47f5e9f
(pop-up-frame-function): Move here from window.el to avoid
Martin Rudalics <rudalics@gmx.at>
parents:
97043
diff
changeset
|
106 :type '(choice (const nil) (function :tag "function")) |
55bef47f5e9f
(pop-up-frame-function): Move here from window.el to avoid
Martin Rudalics <rudalics@gmx.at>
parents:
97043
diff
changeset
|
107 :group 'frames) |
394 | 108 |
17665 | 109 (defcustom special-display-frame-alist |
7057
7102dd374da4
(special-display-frame-alist): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7020
diff
changeset
|
110 '((height . 14) (width . 80) (unsplittable . t)) |
7102dd374da4
(special-display-frame-alist): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7020
diff
changeset
|
111 "*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
|
112 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
|
113 `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
|
114 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
|
115 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
|
116 (setq special-display-frame-alist '((width . 80) (height . 20))) |
17665 | 117 These supersede the values given in `default-frame-alist'." |
118 :type '(repeat (cons :format "%v" | |
119 (symbol :tag "Parameter") | |
120 (sexp :tag "Value"))) | |
121 :group 'frames) | |
7057
7102dd374da4
(special-display-frame-alist): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7020
diff
changeset
|
122 |
8993
c6572fa27df3
(special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents:
8990
diff
changeset
|
123 (defun special-display-popup-frame (buffer &optional args) |
25139
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
124 "Display BUFFER in its own frame, reusing an existing window if any. |
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
125 Return the window chosen. |
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
126 Currently we do not insist on selecting the window within its frame. |
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
127 If ARGS is an alist, use it as a list of frame parameter specs. |
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
128 If ARGS is a list whose car is a symbol, |
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
129 use (car ARGS) as a function to do the work. |
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
130 Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args." |
8993
c6572fa27df3
(special-display-popup-frame): Rename new arg to ARGS.
Richard M. Stallman <rms@gnu.org>
parents:
8990
diff
changeset
|
131 (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
|
132 (apply (car args) buffer (cdr args)) |
55086
2c9194855ec9
(special-display-popup-frame, next-multiframe-window)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
53406
diff
changeset
|
133 (let ((window (get-buffer-window buffer 0))) |
39846
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
134 (or |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
135 ;; If we have a window already, make it visible. |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
136 (when window |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
137 (let ((frame (window-frame window))) |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
138 (make-frame-visible frame) |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
139 (raise-frame frame) |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
140 window)) |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
141 ;; Reuse the current window if the user requested it. |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
142 (when (cdr (assq 'same-window args)) |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
143 (condition-case nil |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
144 (progn (switch-to-buffer buffer) (selected-window)) |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
145 (error nil))) |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
146 ;; Stay on the same frame if requested. |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
147 (when (or (cdr (assq 'same-frame args)) (cdr (assq 'same-window args))) |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
148 (let* ((pop-up-frames nil) (pop-up-windows t) |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
149 special-display-regexps special-display-buffer-names |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
150 (window (display-buffer buffer))) |
55086
2c9194855ec9
(special-display-popup-frame, next-multiframe-window)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
53406
diff
changeset
|
151 ;; Only do it if this is a new window: |
39846
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
152 ;; (set-window-dedicated-p window t) |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
153 window)) |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
154 ;; If no window yet, make one in a new frame. |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
57541
diff
changeset
|
155 (let ((frame |
57541
841073f11023
(special-display-popup-frame): Make the buffer current as its frame is created.
Richard M. Stallman <rms@gnu.org>
parents:
56759
diff
changeset
|
156 (with-current-buffer buffer |
841073f11023
(special-display-popup-frame): Make the buffer current as its frame is created.
Richard M. Stallman <rms@gnu.org>
parents:
56759
diff
changeset
|
157 (make-frame (append args special-display-frame-alist))))) |
39846
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
158 (set-window-buffer (frame-selected-window frame) buffer) |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
159 (set-window-dedicated-p (frame-selected-window frame) t) |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
160 (frame-selected-window frame)))))) |
7057
7102dd374da4
(special-display-frame-alist): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
7020
diff
changeset
|
161 |
9175
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
162 (defun handle-delete-frame (event) |
25139
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
163 "Handle delete-frame events from the X server." |
9175
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
164 (interactive "e") |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
165 (let ((frame (posn-window (event-start event))) |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
166 (i 0) |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
167 (tail (frame-list))) |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
168 (while tail |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
169 (and (frame-visible-p (car tail)) |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
170 (not (eq (car tail) frame)) |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
171 (setq i (1+ i))) |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
172 (setq tail (cdr tail))) |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
173 (if (> i 0) |
df2f1773aa06
(handle-delete-frame): New function.
Richard M. Stallman <rms@gnu.org>
parents:
8993
diff
changeset
|
174 (delete-frame frame t) |
14701
ea592092c43c
(handle-delete-frame): Use save-buffers-kill-emacs.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
175 ;; Gildea@x.org says it is ok to ask questions before terminating. |
ea592092c43c
(handle-delete-frame): Use save-buffers-kill-emacs.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
176 (save-buffers-kill-emacs)))) |
394 | 177 |
777 | 178 ;;;; Arrangement of frames at startup |
394 | 179 |
39846
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
180 ;; 1) Load the window system startup file from the lisp library and read the |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
181 ;; high-priority arguments (-q and the like). The window system startup |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
182 ;; file should create any frames specified in the window system defaults. |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
183 ;; |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
184 ;; 2) If no frames have been opened, we open an initial text frame. |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
185 ;; |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
186 ;; 3) Once the init file is done, we apply any newly set parameters |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
187 ;; in initial-frame-alist to the frame. |
394 | 188 |
10557 | 189 ;; 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
|
190 ;; 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
|
191 ;; 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
|
192 ;; (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
|
193 ;; (add-hook 'window-setup-hook 'frame-notice-user-settings) |
394 | 194 |
39846
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
195 ;; If we create the initial frame, this is it. |
777 | 196 (defvar frame-initial-frame nil) |
394 | 197 |
4305
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
198 ;; 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
|
199 (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
|
200 |
7343
81f9ad98c323
(frame-notice-user-settings): When replacing the first
Richard M. Stallman <rms@gnu.org>
parents:
7322
diff
changeset
|
201 (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
|
202 |
39846
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
203 ;; startup.el calls this function before loading the user's init |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
204 ;; file - if there is no frame with a minibuffer open now, create |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
205 ;; one to display messages while loading the init file. |
777 | 206 (defun frame-initialize () |
35697
6f48576daf85
(frame-initialize): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents:
35512
diff
changeset
|
207 "Create an initial frame if necessary." |
394 | 208 ;; Are we actually running under a window system at all? |
83014
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
209 (if (and initial-window-system |
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
210 (not noninteractive) |
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
211 (not (eq initial-window-system 'pc))) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
212 (progn |
9737
1368ece6ec04
(frame-initialize): Set special-display-function here,
Richard M. Stallman <rms@gnu.org>
parents:
9687
diff
changeset
|
213 ;; 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
|
214 (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
|
215 |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
216 ;; 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
|
217 ;; 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
|
218 ;; 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
|
219 ;; minibuffer spec. |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
220 (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
|
221 (progn |
4305
a39dcf68a29c
(frame-notice-user-settings): Don't reapply a parm
Richard M. Stallman <rms@gnu.org>
parents:
3971
diff
changeset
|
222 (setq frame-initial-frame-alist |
35735
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
223 (append initial-frame-alist default-frame-alist nil)) |
7660
d47966265080
(frame-initialize): Record in frame-initial-frame-alist
Richard M. Stallman <rms@gnu.org>
parents:
7436
diff
changeset
|
224 (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
|
225 (setq frame-initial-frame-alist |
d47966265080
(frame-initialize): Record in frame-initial-frame-alist
Richard M. Stallman <rms@gnu.org>
parents:
7436
diff
changeset
|
226 (cons '(horizontal-scroll-bars . t) |
d47966265080
(frame-initialize): Record in frame-initial-frame-alist
Richard M. Stallman <rms@gnu.org>
parents:
7436
diff
changeset
|
227 frame-initial-frame-alist))) |
83014
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
228 (setq frame-initial-frame-alist |
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
229 (cons (cons 'window-system initial-window-system) |
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
230 frame-initial-frame-alist)) |
3050
8e2472cd4409
(frame-initialize): Handle `reverse' as parameter.
Richard M. Stallman <rms@gnu.org>
parents:
2870
diff
changeset
|
231 (setq default-minibuffer-frame |
8e2472cd4409
(frame-initialize): Handle `reverse' as parameter.
Richard M. Stallman <rms@gnu.org>
parents:
2870
diff
changeset
|
232 (setq frame-initial-frame |
18892
fb7337970b45
(frame-initialize): Don't alter vertical-scroll-bars
Richard M. Stallman <rms@gnu.org>
parents:
18481
diff
changeset
|
233 (make-frame frame-initial-frame-alist))) |
3433
2f5a9b79edf7
(frame-initialize): Delete geometry parms from initial-frame-alist.
Richard M. Stallman <rms@gnu.org>
parents:
3183
diff
changeset
|
234 ;; 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
|
235 ;; 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
|
236 ;; 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
|
237 ;; 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
|
238 (setq initial-frame-alist |
7309
beb9070c6fec
(frame-initialize): Delete the code for reverse-video.
Richard M. Stallman <rms@gnu.org>
parents:
7300
diff
changeset
|
239 (frame-remove-geometry-params initial-frame-alist)))) |
83529
0d9e16eab053
Rework environment variable support. (Reported by Kalle Olavi Niemitalo and Noah Friedman.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83496
diff
changeset
|
240 ;; Copy the environment of the Emacs process into the new frame. |
0d9e16eab053
Rework environment variable support. (Reported by Kalle Olavi Niemitalo and Noah Friedman.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83496
diff
changeset
|
241 (set-frame-parameter frame-initial-frame 'environment |
0d9e16eab053
Rework environment variable support. (Reported by Kalle Olavi Niemitalo and Noah Friedman.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83496
diff
changeset
|
242 (frame-parameter terminal-frame 'environment)) |
10557 | 243 ;; At this point, we know that we have a frame open, so we |
777 | 244 ;; can delete the terminal frame. |
245 (delete-frame terminal-frame) | |
83014
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
246 (setq terminal-frame nil)))) |
10557 | 247 |
27319
a896ba4a496b
(frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
26332
diff
changeset
|
248 (defvar frame-notice-user-settings t |
a896ba4a496b
(frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
26332
diff
changeset
|
249 "Non-nil means function `frame-notice-user-settings' wasn't run yet.") |
a896ba4a496b
(frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
26332
diff
changeset
|
250 |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
251 (declare-function tool-bar-mode "tool-bar" (&optional arg)) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
252 |
39846
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
253 ;; startup.el calls this function after loading the user's init |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
254 ;; file. Now default-frame-alist and initial-frame-alist contain |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
255 ;; information to which we must react; do what needs to be done. |
777 | 256 (defun frame-notice-user-settings () |
25139
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
257 "Act on user's init file settings of frame parameters. |
83360
0036e612aaef
Apply settings in `window-system-default-frame-alist' to the initial frame as well.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
258 React to settings of `initial-frame-alist', |
0036e612aaef
Apply settings in `window-system-default-frame-alist' to the initial frame as well.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
259 `window-system-default-frame-alist' and `default-frame-alist' |
0036e612aaef
Apply settings in `window-system-default-frame-alist' to the initial frame as well.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
260 there (in decreasing order of priority)." |
8056
1c5fd2cdfb36
(frame-notice-user-settings): Make menu-bar-mode
Richard M. Stallman <rms@gnu.org>
parents:
7712
diff
changeset
|
261 ;; Make menu-bar-mode and default-frame-alist consistent. |
31899
ce212cd0463f
(frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents:
31771
diff
changeset
|
262 (when (boundp 'menu-bar-mode) |
ce212cd0463f
(frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents:
31771
diff
changeset
|
263 (let ((default (assq 'menu-bar-lines default-frame-alist))) |
ce212cd0463f
(frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents:
31771
diff
changeset
|
264 (if default |
ce212cd0463f
(frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents:
31771
diff
changeset
|
265 (setq menu-bar-mode (not (eq (cdr default) 0))) |
ce212cd0463f
(frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents:
31771
diff
changeset
|
266 (setq default-frame-alist |
ce212cd0463f
(frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents:
31771
diff
changeset
|
267 (cons (cons 'menu-bar-lines (if menu-bar-mode 1 0)) |
ce212cd0463f
(frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents:
31771
diff
changeset
|
268 default-frame-alist))))) |
41579 | 269 |
31910
b54fba72959b
(frame-notice-user-settings): Don't add a
Gerd Moellmann <gerd@gnu.org>
parents:
31899
diff
changeset
|
270 ;; Make tool-bar-mode and default-frame-alist consistent. Don't do |
b54fba72959b
(frame-notice-user-settings): Don't add a
Gerd Moellmann <gerd@gnu.org>
parents:
31899
diff
changeset
|
271 ;; it in batch mode since that would leave a tool-bar-lines |
b54fba72959b
(frame-notice-user-settings): Don't add a
Gerd Moellmann <gerd@gnu.org>
parents:
31899
diff
changeset
|
272 ;; parameter in default-frame-alist in a dumped Emacs, which is not |
35735
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
273 ;; what we want. |
31910
b54fba72959b
(frame-notice-user-settings): Don't add a
Gerd Moellmann <gerd@gnu.org>
parents:
31899
diff
changeset
|
274 (when (and (boundp 'tool-bar-mode) |
83496
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
275 (not noninteractive)) |
31899
ce212cd0463f
(frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents:
31771
diff
changeset
|
276 (let ((default (assq 'tool-bar-lines default-frame-alist))) |
ce212cd0463f
(frame-notice-user-settings): Make tool-bar-mode and
Gerd Moellmann <gerd@gnu.org>
parents:
31771
diff
changeset
|
277 (if default |
83496
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
278 (setq tool-bar-mode (not (eq (cdr default) 0))) |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
279 ;; If Emacs was started on a tty, changing default-frame-alist |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
280 ;; would disable the toolbar on X frames created later. We |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
281 ;; want to keep the default of showing a toolbar under X even |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
282 ;; in this case. |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
283 ;; |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
284 ;; If the user explicitly called `tool-bar-mode' in .emacs, |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
285 ;; then default-frame-alist is already changed anyway. |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
286 (when initial-window-system |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
287 (setq default-frame-alist |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
288 (cons (cons 'tool-bar-lines (if tool-bar-mode 1 0)) |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
289 default-frame-alist)))))) |
8056
1c5fd2cdfb36
(frame-notice-user-settings): Make menu-bar-mode
Richard M. Stallman <rms@gnu.org>
parents:
7712
diff
changeset
|
290 |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
291 ;; 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
|
292 ;; 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
|
293 ;; 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
|
294 ;; 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
|
295 ;; window is the minibuffer. |
83360
0036e612aaef
Apply settings in `window-system-default-frame-alist' to the initial frame as well.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
296 (let ((old-buffer (current-buffer)) |
86284
d0c1a4ea2562
Fit within 80 columns.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
86277
diff
changeset
|
297 (window-system-frame-alist |
d0c1a4ea2562
Fit within 80 columns.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
86277
diff
changeset
|
298 (cdr (assq initial-window-system |
d0c1a4ea2562
Fit within 80 columns.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
86277
diff
changeset
|
299 window-system-default-frame-alist)))) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
300 |
27319
a896ba4a496b
(frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
26332
diff
changeset
|
301 (when (and frame-notice-user-settings |
a896ba4a496b
(frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
26332
diff
changeset
|
302 (null frame-initial-frame)) |
33009
e7cb49941cb1
(frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents:
32752
diff
changeset
|
303 ;; This case happens when we don't have a window system, and |
e7cb49941cb1
(frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents:
32752
diff
changeset
|
304 ;; also for MS-DOS frames. |
27319
a896ba4a496b
(frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
26332
diff
changeset
|
305 (let ((parms (frame-parameters frame-initial-frame))) |
a896ba4a496b
(frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
26332
diff
changeset
|
306 ;; Don't change the frame names. |
a896ba4a496b
(frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
26332
diff
changeset
|
307 (setq parms (delq (assq 'name parms) parms)) |
a896ba4a496b
(frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
26332
diff
changeset
|
308 ;; Can't modify the minibuffer parameter, so don't try. |
a896ba4a496b
(frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
26332
diff
changeset
|
309 (setq parms (delq (assq 'minibuffer parms) parms)) |
a896ba4a496b
(frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
26332
diff
changeset
|
310 (modify-frame-parameters nil |
83014
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
311 (if (null initial-window-system) |
33009
e7cb49941cb1
(frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents:
32752
diff
changeset
|
312 (append initial-frame-alist |
83360
0036e612aaef
Apply settings in `window-system-default-frame-alist' to the initial frame as well.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
313 window-system-frame-alist |
33009
e7cb49941cb1
(frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents:
32752
diff
changeset
|
314 default-frame-alist |
e7cb49941cb1
(frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents:
32752
diff
changeset
|
315 parms |
e7cb49941cb1
(frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents:
32752
diff
changeset
|
316 nil) |
e7cb49941cb1
(frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents:
32752
diff
changeset
|
317 ;; initial-frame-alist and |
e7cb49941cb1
(frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents:
32752
diff
changeset
|
318 ;; default-frame-alist were already |
e7cb49941cb1
(frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents:
32752
diff
changeset
|
319 ;; applied in pc-win.el. |
e7cb49941cb1
(frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents:
32752
diff
changeset
|
320 parms)) |
83014
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
321 (if (null initial-window-system) ;; MS-DOS does this differently in pc-win.el |
33009
e7cb49941cb1
(frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents:
32752
diff
changeset
|
322 (let ((newparms (frame-parameters)) |
e7cb49941cb1
(frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents:
32752
diff
changeset
|
323 (frame (selected-frame))) |
e7cb49941cb1
(frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents:
32752
diff
changeset
|
324 (tty-handle-reverse-video frame newparms) |
e7cb49941cb1
(frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents:
32752
diff
changeset
|
325 ;; If we changed the background color, we need to update |
e7cb49941cb1
(frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents:
32752
diff
changeset
|
326 ;; the background-mode parameter, and maybe some faces, |
e7cb49941cb1
(frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents:
32752
diff
changeset
|
327 ;; too. |
e7cb49941cb1
(frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents:
32752
diff
changeset
|
328 (when (assq 'background-color newparms) |
e7cb49941cb1
(frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents:
32752
diff
changeset
|
329 (unless (or (assq 'background-mode initial-frame-alist) |
e7cb49941cb1
(frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents:
32752
diff
changeset
|
330 (assq 'background-mode default-frame-alist)) |
e7cb49941cb1
(frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents:
32752
diff
changeset
|
331 (frame-set-background-mode frame)) |
e7cb49941cb1
(frame-notice-user-settings): Don't apply
Eli Zaretskii <eliz@gnu.org>
parents:
32752
diff
changeset
|
332 (face-set-after-frame-default frame)))))) |
27319
a896ba4a496b
(frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
26332
diff
changeset
|
333 |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
334 ;; 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
|
335 ;; and default-frame-alist to it. |
35735
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
336 (when (frame-live-p frame-initial-frame) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
337 |
35735
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
338 ;; When tool-bar has been switched off, correct the frame size |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
339 ;; by the lines added in x-create-frame for the tool-bar and |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
340 ;; switch `tool-bar-mode' off. |
35856
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
341 (when (display-graphic-p) |
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
342 (let ((tool-bar-lines (or (assq 'tool-bar-lines initial-frame-alist) |
83360
0036e612aaef
Apply settings in `window-system-default-frame-alist' to the initial frame as well.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
343 (assq 'tool-bar-lines window-system-frame-alist) |
35856
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
344 (assq 'tool-bar-lines default-frame-alist)))) |
36317
34ffe86aeeae
(frame-notice-user-settings): Only adjust frame height
Jason Rumney <jasonr@gnu.org>
parents:
36257
diff
changeset
|
345 (when (and tool-bar-originally-present |
34ffe86aeeae
(frame-notice-user-settings): Only adjust frame height
Jason Rumney <jasonr@gnu.org>
parents:
36257
diff
changeset
|
346 (or (null tool-bar-lines) |
34ffe86aeeae
(frame-notice-user-settings): Only adjust frame height
Jason Rumney <jasonr@gnu.org>
parents:
36257
diff
changeset
|
347 (null (cdr tool-bar-lines)) |
34ffe86aeeae
(frame-notice-user-settings): Only adjust frame height
Jason Rumney <jasonr@gnu.org>
parents:
36257
diff
changeset
|
348 (eq 0 (cdr tool-bar-lines)))) |
35856
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
349 (let* ((char-height (frame-char-height frame-initial-frame)) |
36317
34ffe86aeeae
(frame-notice-user-settings): Only adjust frame height
Jason Rumney <jasonr@gnu.org>
parents:
36257
diff
changeset
|
350 (image-height tool-bar-images-pixel-height) |
35856
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
351 (margin (cond ((and (consp tool-bar-button-margin) |
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
352 (integerp (cdr tool-bar-button-margin)) |
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
353 (> tool-bar-button-margin 0)) |
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
354 (cdr tool-bar-button-margin)) |
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
355 ((and (integerp tool-bar-button-margin) |
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
356 (> tool-bar-button-margin 0)) |
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
357 tool-bar-button-margin) |
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
358 (t 0))) |
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
359 (relief (if (and (integerp tool-bar-button-relief) |
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
360 (> tool-bar-button-relief 0)) |
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
361 tool-bar-button-relief 3)) |
41579 | 362 (lines (/ (+ image-height |
35856
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
363 (* 2 margin) |
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
364 (* 2 relief) |
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
365 (1- char-height)) |
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
366 char-height)) |
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
367 (height (frame-parameter frame-initial-frame 'height)) |
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
368 (newparms (list (cons 'height (- height lines)))) |
41579 | 369 (initial-top (cdr (assq 'top |
35856
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
370 frame-initial-geometry-arguments))) |
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
371 (top (frame-parameter frame-initial-frame 'top))) |
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
372 (when (and (consp initial-top) (eq '- (car initial-top))) |
53406
45cc6f8abd8d
(pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents:
52614
diff
changeset
|
373 (let ((adjusted-top |
45cc6f8abd8d
(pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents:
52614
diff
changeset
|
374 (cond ((and (consp top) |
45cc6f8abd8d
(pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents:
52614
diff
changeset
|
375 (eq '+ (car top))) |
45cc6f8abd8d
(pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents:
52614
diff
changeset
|
376 (list '+ |
45cc6f8abd8d
(pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents:
52614
diff
changeset
|
377 (+ (cadr top) |
45cc6f8abd8d
(pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents:
52614
diff
changeset
|
378 (* lines char-height)))) |
45cc6f8abd8d
(pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents:
52614
diff
changeset
|
379 ((and (consp top) |
45cc6f8abd8d
(pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents:
52614
diff
changeset
|
380 (eq '- (car top))) |
45cc6f8abd8d
(pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents:
52614
diff
changeset
|
381 (list '- |
45cc6f8abd8d
(pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents:
52614
diff
changeset
|
382 (- (cadr top) |
45cc6f8abd8d
(pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents:
52614
diff
changeset
|
383 (* lines char-height)))) |
45cc6f8abd8d
(pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents:
52614
diff
changeset
|
384 (t (+ top (* lines char-height)))))) |
45cc6f8abd8d
(pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents:
52614
diff
changeset
|
385 (setq newparms |
45cc6f8abd8d
(pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents:
52614
diff
changeset
|
386 (append newparms |
45cc6f8abd8d
(pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents:
52614
diff
changeset
|
387 `((top . ,adjusted-top)) |
45cc6f8abd8d
(pop-up-frame-function): Use quote, not `function'.
Richard M. Stallman <rms@gnu.org>
parents:
52614
diff
changeset
|
388 nil)))) |
35856
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
389 (modify-frame-parameters frame-initial-frame newparms) |
41652bd90468
(frame-notice-user-settings): When resizing the initial
Gerd Moellmann <gerd@gnu.org>
parents:
35738
diff
changeset
|
390 (tool-bar-mode -1))))) |
35735
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
391 |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
392 ;; The initial frame we create above always has a minibuffer. |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
393 ;; If the user wants to remove it, or make it a minibuffer-only |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
394 ;; frame, then we'll have to delete the current frame and make a |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
395 ;; new one; you can't remove or add a root window to/from an |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
396 ;; existing frame. |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
397 ;; |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
398 ;; NOTE: default-frame-alist was nil when we created the |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
399 ;; existing frame. We need to explicitly include |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
400 ;; default-frame-alist in the parameters of the screen we |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
401 ;; create here, so that its new value, gleaned from the user's |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
402 ;; .emacs file, will be applied to the existing screen. |
35738
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
403 (if (not (eq (cdr (or (assq 'minibuffer initial-frame-alist) |
83360
0036e612aaef
Apply settings in `window-system-default-frame-alist' to the initial frame as well.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
404 (assq 'minibuffer window-system-frame-alist) |
35738
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
405 (assq 'minibuffer default-frame-alist) |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
406 '(minibuffer . t))) |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
407 t)) |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
408 ;; Create the new frame. |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
409 (let (parms new) |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
410 ;; If the frame isn't visible yet, wait till it is. |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
411 ;; If the user has to position the window, |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
412 ;; Emacs doesn't know its real position until |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
413 ;; the frame is seen to be visible. |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
414 (while (not (cdr (assq 'visibility |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
415 (frame-parameters frame-initial-frame)))) |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
416 (sleep-for 1)) |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
417 (setq parms (frame-parameters frame-initial-frame)) |
35735
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
418 |
41579 | 419 ;; Get rid of `name' unless it was specified explicitly before. |
35738
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
420 (or (assq 'name frame-initial-frame-alist) |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
421 (setq parms (delq (assq 'name parms) parms))) |
91849
6c35c4ccf09e
(frame-notice-user-settings): Distinguish explicit parent-id
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
87903
diff
changeset
|
422 ;; An explicit parent-id is a request to XEmbed the frame. |
6c35c4ccf09e
(frame-notice-user-settings): Distinguish explicit parent-id
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
87903
diff
changeset
|
423 (or (assq 'parent-id frame-initial-frame-alist) |
6c35c4ccf09e
(frame-notice-user-settings): Distinguish explicit parent-id
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
87903
diff
changeset
|
424 (setq parms (delq (assq 'parent-id parms) parms))) |
35735
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
425 |
35738
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
426 (setq parms (append initial-frame-alist |
83360
0036e612aaef
Apply settings in `window-system-default-frame-alist' to the initial frame as well.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
427 window-system-frame-alist |
35738
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
428 default-frame-alist |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
429 parms |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
430 nil)) |
35735
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
431 |
35738
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
432 ;; Get rid of `reverse', because that was handled |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
433 ;; when we first made the frame. |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
434 (setq parms (cons '(reverse) (delq (assq 'reverse parms) parms))) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
435 |
35738
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
436 (if (assq 'height frame-initial-geometry-arguments) |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
437 (setq parms (assq-delete-all 'height parms))) |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
438 (if (assq 'width frame-initial-geometry-arguments) |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
439 (setq parms (assq-delete-all 'width parms))) |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
440 (if (assq 'left frame-initial-geometry-arguments) |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
441 (setq parms (assq-delete-all 'left parms))) |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
442 (if (assq 'top frame-initial-geometry-arguments) |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
443 (setq parms (assq-delete-all 'top parms))) |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
444 (setq new |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
445 (make-frame |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
446 ;; Use the geometry args that created the existing |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
447 ;; frame, rather than the parms we get for it. |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
448 (append frame-initial-geometry-arguments |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
449 '((user-size . t) (user-position . t)) |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
450 parms))) |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
451 ;; The initial frame, which we are about to delete, may be |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
452 ;; the only frame with a minibuffer. If it is, create a |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
453 ;; new one. |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
454 (or (delq frame-initial-frame (minibuffer-frame-list)) |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
455 (make-initial-minibuffer-frame nil)) |
35735
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
456 |
35738
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
457 ;; If the initial frame is serving as a surrogate |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
458 ;; minibuffer frame for any frames, we need to wean them |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
459 ;; onto a new frame. The default-minibuffer-frame |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
460 ;; variable must be handled similarly. |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
461 (let ((users-of-initial |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
462 (filtered-frame-list |
82111
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
463 (lambda (frame) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
464 (and (not (eq frame frame-initial-frame)) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
465 (eq (window-frame |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
466 (minibuffer-window frame)) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
467 frame-initial-frame)))))) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
468 (if (or users-of-initial |
35738
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
469 (eq default-minibuffer-frame frame-initial-frame)) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
470 |
35738
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
471 ;; Choose an appropriate frame. Prefer frames which |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
472 ;; are only minibuffers. |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
473 (let* ((new-surrogate |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
474 (car |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
475 (or (filtered-frame-list |
82111
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
476 (lambda (frame) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
477 (eq (cdr (assq 'minibuffer |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
478 (frame-parameters frame))) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
479 'only))) |
35738
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
480 (minibuffer-frame-list)))) |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
481 (new-minibuffer (minibuffer-window new-surrogate))) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
482 |
35738
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
483 (if (eq default-minibuffer-frame frame-initial-frame) |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
484 (setq default-minibuffer-frame new-surrogate)) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
485 |
35738
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
486 ;; Wean the frames using frame-initial-frame as |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
487 ;; their minibuffer frame. |
82111
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
488 (dolist (frame users-of-initial) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
489 (modify-frame-parameters |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
490 frame (list (cons 'minibuffer new-minibuffer))))))) |
1113 | 491 |
82111
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
492 ;; Redirect events enqueued at this frame to the new frame. |
35738
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
493 ;; Is this a good idea? |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
494 (redirect-frame-focus frame-initial-frame new) |
1113 | 495 |
35738
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
496 ;; Finally, get rid of the old frame. |
7b487e845547
(frame-notice-user-settings): Do the tool-bar
Gerd Moellmann <gerd@gnu.org>
parents:
35735
diff
changeset
|
497 (delete-frame frame-initial-frame t)) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
498 |
35735
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
499 ;; Otherwise, we don't need all that rigamarole; just apply |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
500 ;; the new parameters. |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
501 (let (newparms allparms tail) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
502 (setq allparms (append initial-frame-alist |
83360
0036e612aaef
Apply settings in `window-system-default-frame-alist' to the initial frame as well.
Karoly Lorentey <lorentey@elte.hu>
parents:
83353
diff
changeset
|
503 window-system-frame-alist |
35735
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
504 default-frame-alist nil)) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
505 (if (assq 'height frame-initial-geometry-arguments) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
506 (setq allparms (assq-delete-all 'height allparms))) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
507 (if (assq 'width frame-initial-geometry-arguments) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
508 (setq allparms (assq-delete-all 'width allparms))) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
509 (if (assq 'left frame-initial-geometry-arguments) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
510 (setq allparms (assq-delete-all 'left allparms))) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
511 (if (assq 'top frame-initial-geometry-arguments) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
512 (setq allparms (assq-delete-all 'top allparms))) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
513 (setq tail allparms) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
514 ;; Find just the parms that have changed since we first |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
515 ;; made this frame. Those are the ones actually set by |
41579 | 516 ;; the init file. For those parms whose values we already knew |
35735
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
517 ;; (such as those spec'd by command line options) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
518 ;; it is undesirable to specify the parm again |
41579 | 519 ;; once the user has seen the frame and been able to alter it |
35735
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
520 ;; manually. |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
521 (while tail |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
522 (let (newval oldval) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
523 (setq oldval (assq (car (car tail)) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
524 frame-initial-frame-alist)) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
525 (setq newval (cdr (assq (car (car tail)) allparms))) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
526 (or (and oldval (eq (cdr oldval) newval)) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
527 (setq newparms |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
528 (cons (cons (car (car tail)) newval) newparms)))) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
529 (setq tail (cdr tail))) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
530 (setq newparms (nreverse newparms)) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
531 (modify-frame-parameters frame-initial-frame |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
532 newparms) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
533 ;; If we changed the background color, |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
534 ;; we need to update the background-mode parameter |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
535 ;; and maybe some faces too. |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
536 (when (assq 'background-color newparms) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
537 (unless (assq 'background-mode newparms) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
538 (frame-set-background-mode frame-initial-frame)) |
e20f7bc75418
(frame-initialize): Create initial frame visible.
Gerd Moellmann <gerd@gnu.org>
parents:
35697
diff
changeset
|
539 (face-set-after-frame-default frame-initial-frame))))) |
394 | 540 |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
541 ;; Restore the original buffer. |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
542 (set-buffer old-buffer) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
543 |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
544 ;; 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
|
545 ;; Make sure frame-notice-user-settings does nothing if called twice. |
27319
a896ba4a496b
(frame-notice-user-settings): New variable.
Gerd Moellmann <gerd@gnu.org>
parents:
26332
diff
changeset
|
546 (setq frame-notice-user-settings nil) |
2870
cd270fa53052
* frame.el (frame-notice-user-settings): Don't make
Jim Blandy <jimb@redhat.com>
parents:
2846
diff
changeset
|
547 (setq frame-initial-frame nil))) |
394 | 548 |
12012
26aeed5ef544
(make-initial-minibuffer-frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11485
diff
changeset
|
549 (defun make-initial-minibuffer-frame (display) |
26aeed5ef544
(make-initial-minibuffer-frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11485
diff
changeset
|
550 (let ((parms (append minibuffer-frame-alist '((minibuffer . only))))) |
26aeed5ef544
(make-initial-minibuffer-frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11485
diff
changeset
|
551 (if display |
26aeed5ef544
(make-initial-minibuffer-frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11485
diff
changeset
|
552 (make-frame-on-display display parms) |
26aeed5ef544
(make-initial-minibuffer-frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11485
diff
changeset
|
553 (make-frame parms)))) |
26aeed5ef544
(make-initial-minibuffer-frame): New function.
Karl Heuer <kwzh@gnu.org>
parents:
11485
diff
changeset
|
554 |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
555 ;;;; Creation of additional frames, and other frame miscellanea |
394 | 556 |
51901
48f24a9d5a64
(modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents:
51507
diff
changeset
|
557 (defun modify-all-frames-parameters (alist) |
56507
8a0830a6f469
(modify-all-frames-parameters): Minor doc fix.
Luc Teirlinck <teirllm@auburn.edu>
parents:
56491
diff
changeset
|
558 "Modify all current and future frames' parameters according to ALIST. |
51901
48f24a9d5a64
(modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents:
51507
diff
changeset
|
559 This changes `default-frame-alist' and possibly `initial-frame-alist'. |
83496
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
560 Furthermore, this function removes all parameters in ALIST from |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
561 `window-system-default-frame-alist'. |
51901
48f24a9d5a64
(modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents:
51507
diff
changeset
|
562 See help of `modify-frame-parameters' for more information." |
83496
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
563 (dolist (frame (frame-list)) |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
564 (modify-frame-parameters frame alist)) |
51901
48f24a9d5a64
(modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents:
51507
diff
changeset
|
565 |
83496
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
566 (dolist (pair alist) ;; conses to add/replace |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
567 ;; initial-frame-alist needs setting only when |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
568 ;; frame-notice-user-settings is true. |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
569 (and frame-notice-user-settings |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
570 (setq initial-frame-alist |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
571 (assq-delete-all (car pair) initial-frame-alist))) |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
572 (setq default-frame-alist |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
573 (assq-delete-all (car pair) default-frame-alist)) |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
574 ;; Remove any similar settings from the window-system specific |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
575 ;; parameters---they would override default-frame-alist. |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
576 (dolist (w window-system-default-frame-alist) |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
577 (setcdr w (assq-delete-all (car pair) (cdr w))))) |
f271076dab2d
Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83468
diff
changeset
|
578 |
51901
48f24a9d5a64
(modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents:
51507
diff
changeset
|
579 (and frame-notice-user-settings |
48f24a9d5a64
(modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents:
51507
diff
changeset
|
580 (setq initial-frame-alist (append initial-frame-alist alist))) |
48f24a9d5a64
(modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents:
51507
diff
changeset
|
581 (setq default-frame-alist (append default-frame-alist alist))) |
48f24a9d5a64
(modify-all-frames-parameters): Reinstall (copyright papers received).
Juanma Barranquero <lekktu@gmail.com>
parents:
51507
diff
changeset
|
582 |
827 | 583 (defun get-other-frame () |
25139
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
584 "Return some frame other than the current frame. |
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
585 Create one if necessary. Note that the minibuffer frame, if separate, |
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
586 is not considered (see `next-frame')." |
777 | 587 (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
|
588 (make-frame) |
777 | 589 (next-frame (selected-frame))))) |
394 | 590 s)) |
591 | |
777 | 592 (defun next-multiframe-window () |
593 "Select the next window, regardless of which frame it is on." | |
394 | 594 (interactive) |
595 (select-window (next-window (selected-window) | |
596 (> (minibuffer-depth) 0) | |
55086
2c9194855ec9
(special-display-popup-frame, next-multiframe-window)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
53406
diff
changeset
|
597 0)) |
38781
c20b98060a6d
(select-frame-set-input-focus): New function
Gerd Moellmann <gerd@gnu.org>
parents:
38469
diff
changeset
|
598 (select-frame-set-input-focus (selected-frame))) |
394 | 599 |
777 | 600 (defun previous-multiframe-window () |
601 "Select the previous window, regardless of which frame it is on." | |
394 | 602 (interactive) |
603 (select-window (previous-window (selected-window) | |
604 (> (minibuffer-depth) 0) | |
55086
2c9194855ec9
(special-display-popup-frame, next-multiframe-window)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
53406
diff
changeset
|
605 0)) |
38781
c20b98060a6d
(select-frame-set-input-focus): New function
Gerd Moellmann <gerd@gnu.org>
parents:
38469
diff
changeset
|
606 (select-frame-set-input-focus (selected-frame))) |
394 | 607 |
86321
05a5763c9e23
(x-initialize-window-system): Declare as function.
Juanma Barranquero <lekktu@gmail.com>
parents:
86289
diff
changeset
|
608 (declare-function x-initialize-window-system "term/x-win" ()) |
96701
3d8b4709e0d0
(ns-initialize-window-system): Declare for compiler.
Glenn Morris <rgm@gnu.org>
parents:
96675
diff
changeset
|
609 (declare-function ns-initialize-window-system "term/ns-win" ()) |
96756
6bce8c5e3365
(ns-display-name): Declare for compiler.
Glenn Morris <rgm@gnu.org>
parents:
96701
diff
changeset
|
610 (defvar x-display-name) ; term/x-win |
86321
05a5763c9e23
(x-initialize-window-system): Declare as function.
Juanma Barranquero <lekktu@gmail.com>
parents:
86289
diff
changeset
|
611 |
9687
1048e2d032e6
(make-frame-on-display): New function.
Richard M. Stallman <rms@gnu.org>
parents:
9175
diff
changeset
|
612 (defun make-frame-on-display (display &optional parameters) |
83167
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83162
diff
changeset
|
613 "Make a frame on X display DISPLAY. |
9687
1048e2d032e6
(make-frame-on-display): New function.
Richard M. Stallman <rms@gnu.org>
parents:
9175
diff
changeset
|
614 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
|
615 (interactive "sMake frame on display: ") |
96921 | 616 (if (featurep 'ns) |
96675
d45acf0c8d23
merging Emacs.app (NeXTstep port)
Adrian Robert <Adrian.B.Robert@gmail.com>
parents:
95841
diff
changeset
|
617 (progn |
d45acf0c8d23
merging Emacs.app (NeXTstep port)
Adrian Robert <Adrian.B.Robert@gmail.com>
parents:
95841
diff
changeset
|
618 (when (and (boundp 'ns-initialized) (not ns-initialized)) |
96869
8cb5d45989af
(ns-display-name): Remove declaration.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96756
diff
changeset
|
619 (setq x-display-name display) |
96675
d45acf0c8d23
merging Emacs.app (NeXTstep port)
Adrian Robert <Adrian.B.Robert@gmail.com>
parents:
95841
diff
changeset
|
620 (ns-initialize-window-system)) |
d45acf0c8d23
merging Emacs.app (NeXTstep port)
Adrian Robert <Adrian.B.Robert@gmail.com>
parents:
95841
diff
changeset
|
621 (make-frame `((window-system . ns) (display . ,display) . ,parameters))) |
d45acf0c8d23
merging Emacs.app (NeXTstep port)
Adrian Robert <Adrian.B.Robert@gmail.com>
parents:
95841
diff
changeset
|
622 (progn |
96869
8cb5d45989af
(ns-display-name): Remove declaration.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96756
diff
changeset
|
623 (unless (string-match "\\`[^:]*:[0-9]+\\(\\.[0-9]+\\)?\\'" display) |
8cb5d45989af
(ns-display-name): Remove declaration.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96756
diff
changeset
|
624 (error "Invalid display, not HOST:SERVER or HOST:SERVER.SCREEN")) |
96675
d45acf0c8d23
merging Emacs.app (NeXTstep port)
Adrian Robert <Adrian.B.Robert@gmail.com>
parents:
95841
diff
changeset
|
625 (when (and (boundp 'x-initialized) (not x-initialized)) |
d45acf0c8d23
merging Emacs.app (NeXTstep port)
Adrian Robert <Adrian.B.Robert@gmail.com>
parents:
95841
diff
changeset
|
626 (setq x-display-name display) |
d45acf0c8d23
merging Emacs.app (NeXTstep port)
Adrian Robert <Adrian.B.Robert@gmail.com>
parents:
95841
diff
changeset
|
627 (x-initialize-window-system)) |
d45acf0c8d23
merging Emacs.app (NeXTstep port)
Adrian Robert <Adrian.B.Robert@gmail.com>
parents:
95841
diff
changeset
|
628 (make-frame `((window-system . x) (display . ,display) . ,parameters))))) |
9687
1048e2d032e6
(make-frame-on-display): New function.
Richard M. Stallman <rms@gnu.org>
parents:
9175
diff
changeset
|
629 |
83416
4513d8dcdfd5
Reimplement and extend support for terminal-local environment variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
83414
diff
changeset
|
630 (defun make-frame-on-tty (tty type &optional parameters) |
4513d8dcdfd5
Reimplement and extend support for terminal-local environment variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
83414
diff
changeset
|
631 "Make a frame on terminal device TTY. |
4513d8dcdfd5
Reimplement and extend support for terminal-local environment variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
83414
diff
changeset
|
632 TTY should be the file name of the tty device to use. TYPE |
4513d8dcdfd5
Reimplement and extend support for terminal-local environment variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
83414
diff
changeset
|
633 should be the terminal type string of TTY, for example \"xterm\" |
4513d8dcdfd5
Reimplement and extend support for terminal-local environment variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
83414
diff
changeset
|
634 or \"vt100\". The optional third argument PARAMETERS specifies |
4513d8dcdfd5
Reimplement and extend support for terminal-local environment variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
83414
diff
changeset
|
635 additional frame parameters." |
83004
7900111db01c
Converted display hooks to be display-local. Plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
82990
diff
changeset
|
636 (interactive "fOpen frame on tty device: \nsTerminal type of %s: ") |
83416
4513d8dcdfd5
Reimplement and extend support for terminal-local environment variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
83414
diff
changeset
|
637 (unless tty |
53233
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
52614
diff
changeset
|
638 (error "Invalid terminal device")) |
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
52614
diff
changeset
|
639 (unless type |
fe9b37bee5f7
Fully eliminated global tty state variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
52614
diff
changeset
|
640 (error "Invalid terminal type")) |
83416
4513d8dcdfd5
Reimplement and extend support for terminal-local environment variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
83414
diff
changeset
|
641 (make-frame `((window-system . nil) (tty . ,tty) (tty-type . ,type) . ,parameters))) |
9687
1048e2d032e6
(make-frame-on-display): New function.
Richard M. Stallman <rms@gnu.org>
parents:
9175
diff
changeset
|
642 |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
643 (declare-function x-close-connection "xfns.c" (terminal)) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
644 |
82111
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
645 (defun close-display-connection (display) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
646 "Close the connection to a display, deleting all its associated frames. |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
647 For DISPLAY, specify either a frame or a display name (a string). |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
648 If DISPLAY is nil, that stands for the selected frame's display." |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
649 (interactive |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
650 (list |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
651 (let* ((default (frame-parameter nil 'display)) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
652 (display (completing-read |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
653 (format "Close display (default %s): " default) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
654 (delete-dups |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
655 (mapcar (lambda (frame) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
656 (frame-parameter frame 'display)) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
657 (frame-list))) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
658 nil t nil nil |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
659 default))) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
660 (if (zerop (length display)) default display)))) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
661 (let ((frames (delq nil |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
662 (mapcar (lambda (frame) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
663 (if (equal display |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
664 (frame-parameter frame 'display)) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
665 frame)) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
666 (frame-list))))) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
667 (if (and (consp frames) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
668 (not (y-or-n-p (if (cdr frames) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
669 (format "Delete %s frames? " (length frames)) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
670 (format "Delete %s ? " (car frames)))))) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
671 (error "Abort!") |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
672 (mapc 'delete-frame frames) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
673 (x-close-connection display)))) |
9687
1048e2d032e6
(make-frame-on-display): New function.
Richard M. Stallman <rms@gnu.org>
parents:
9175
diff
changeset
|
674 |
15347
3885819ed860
(make-frame-command): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14701
diff
changeset
|
675 (defun make-frame-command () |
3885819ed860
(make-frame-command): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14701
diff
changeset
|
676 "Make a new frame, and select it if the terminal displays only one frame." |
3885819ed860
(make-frame-command): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14701
diff
changeset
|
677 (interactive) |
15364
a4e1db62f693
(make-frame-command): Treat msdos like no window system.
Richard M. Stallman <rms@gnu.org>
parents:
15347
diff
changeset
|
678 (if (and window-system (not (eq window-system 'pc))) |
15347
3885819ed860
(make-frame-command): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14701
diff
changeset
|
679 (make-frame) |
3885819ed860
(make-frame-command): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14701
diff
changeset
|
680 (select-frame (make-frame)))) |
3885819ed860
(make-frame-command): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14701
diff
changeset
|
681 |
17163
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
682 (defvar before-make-frame-hook nil |
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
683 "Functions to run before a frame is created.") |
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
684 |
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
685 (defvar after-make-frame-functions nil |
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
686 "Functions to run after a frame is created. |
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
687 The functions are run with one arg, the newly created frame.") |
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
688 |
33186
c63d52fc1eb7
(after-setting-font-hook): Rename hooks -> hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
33009
diff
changeset
|
689 (defvar after-setting-font-hook nil |
24982
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
690 "Functions to run after a frame's font has been changed.") |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
691 |
2246
1f0d48f7e583
(make-frame): Renamed from new-frame.
Richard M. Stallman <rms@gnu.org>
parents:
2202
diff
changeset
|
692 ;; Alias, kept temporarily. |
64543
f1a7394cf1a7
(set-frame-font, cursor-in-non-selected-windows): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
64298
diff
changeset
|
693 (define-obsolete-function-alias 'new-frame 'make-frame "22.1") |
17163
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
694 |
85148
f1dea8c68d8d
(frame-inherited-parameters): Remove unused `environment'
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85145
diff
changeset
|
695 (defvar frame-inherited-parameters '() |
85145
0833864bd9a1
(frame-inherited-parameters): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85114
diff
changeset
|
696 ;; FIXME: Shouldn't we add `font' here as well? |
0833864bd9a1
(frame-inherited-parameters): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85114
diff
changeset
|
697 "Parameters `make-frame' copies from the `selected-frame' to the new frame.") |
0833864bd9a1
(frame-inherited-parameters): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85114
diff
changeset
|
698 |
2246
1f0d48f7e583
(make-frame): Renamed from new-frame.
Richard M. Stallman <rms@gnu.org>
parents:
2202
diff
changeset
|
699 (defun make-frame (&optional parameters) |
17163
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
700 "Return a newly created frame displaying the current buffer. |
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
701 Optional argument PARAMETERS is an alist of parameters for the new frame. |
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
702 Each element of PARAMETERS should have the form (NAME . VALUE), for example: |
10574 | 703 |
17163
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
704 (name . STRING) The frame should be named STRING. |
542 | 705 |
17163
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
706 (width . NUMBER) The frame should be NUMBER characters in width. |
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
707 (height . NUMBER) The frame should be NUMBER text lines high. |
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
708 |
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
709 You cannot specify either `width' or `height', you must use neither or both. |
542 | 710 |
17163
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
711 (minibuffer . t) The frame should have a minibuffer. |
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
712 (minibuffer . nil) The frame should have no minibuffer. |
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
713 (minibuffer . only) The frame should contain only a minibuffer. |
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
714 (minibuffer . WINDOW) The frame should use WINDOW as its minibuffer window. |
542 | 715 |
83014
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
716 (window-system . nil) The frame should be displayed on a terminal device. |
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
717 (window-system . x) The frame should be displayed in an X window. |
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
718 |
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83427
diff
changeset
|
719 (terminal . ID) The frame should use the terminal identified by ID. |
83167
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83162
diff
changeset
|
720 |
83014
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
721 Before the frame is created (via `frame-creation-function-alist'), functions on the |
17163
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
722 hook `before-make-frame-hook' are run. After the frame is created, functions |
56528
b1b127f6d343
(make-frame): Doc fix.
Luc Teirlinck <teirllm@auburn.edu>
parents:
56507
diff
changeset
|
723 on `after-make-frame-functions' are run with one arg, the newly created frame. |
b1b127f6d343
(make-frame): Doc fix.
Luc Teirlinck <teirllm@auburn.edu>
parents:
56507
diff
changeset
|
724 |
b1b127f6d343
(make-frame): Doc fix.
Luc Teirlinck <teirllm@auburn.edu>
parents:
56507
diff
changeset
|
725 This function itself does not make the new frame the selected frame. |
b1b127f6d343
(make-frame): Doc fix.
Luc Teirlinck <teirllm@auburn.edu>
parents:
56507
diff
changeset
|
726 The previously selected frame remains selected. However, the |
b1b127f6d343
(make-frame): Doc fix.
Luc Teirlinck <teirllm@auburn.edu>
parents:
56507
diff
changeset
|
727 window system may select the new frame for its own reasons, for |
b1b127f6d343
(make-frame): Doc fix.
Luc Teirlinck <teirllm@auburn.edu>
parents:
56507
diff
changeset
|
728 instance if the frame appears under the mouse pointer and your |
b1b127f6d343
(make-frame): Doc fix.
Luc Teirlinck <teirllm@auburn.edu>
parents:
56507
diff
changeset
|
729 setup is for focus to follow the pointer." |
394 | 730 (interactive) |
83167
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83162
diff
changeset
|
731 (let* ((w (cond |
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83427
diff
changeset
|
732 ((assq 'terminal parameters) |
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83427
diff
changeset
|
733 (let ((type (terminal-live-p (cdr (assq 'terminal parameters))))) |
83167
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83162
diff
changeset
|
734 (cond |
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83162
diff
changeset
|
735 ((eq type t) nil) |
86284
d0c1a4ea2562
Fit within 80 columns.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
86277
diff
changeset
|
736 ((eq type nil) (error "Terminal %s does not exist" |
d0c1a4ea2562
Fit within 80 columns.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
86277
diff
changeset
|
737 (cdr (assq 'terminal parameters)))) |
83167
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83162
diff
changeset
|
738 (t type)))) |
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83162
diff
changeset
|
739 ((assq 'window-system parameters) |
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83162
diff
changeset
|
740 (cdr (assq 'window-system parameters))) |
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83162
diff
changeset
|
741 (t window-system))) |
83014
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
742 (frame-creation-function (cdr (assq w frame-creation-function-alist))) |
83427
2afc49c9f0c0
Store local environment in frame (not terminal) parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
83416
diff
changeset
|
743 (oldframe (selected-frame)) |
83014
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
744 frame) |
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
745 (unless frame-creation-function |
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
746 (error "Don't know how to create a frame on window system %s" w)) |
f5cadabb36dd
Support for opening X frames from a tty session.
Karoly Lorentey <lorentey@elte.hu>
parents:
83009
diff
changeset
|
747 (run-hooks 'before-make-frame-hook) |
86284
d0c1a4ea2562
Fit within 80 columns.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
86277
diff
changeset
|
748 (setq frame |
d0c1a4ea2562
Fit within 80 columns.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
86277
diff
changeset
|
749 (funcall frame-creation-function |
d0c1a4ea2562
Fit within 80 columns.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
86277
diff
changeset
|
750 (append parameters |
d0c1a4ea2562
Fit within 80 columns.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
86277
diff
changeset
|
751 (cdr (assq w window-system-default-frame-alist))))) |
83387
0181341f0aca
Fix Delete key on X by adapting normal-erase-is-backspace-mode for multi-tty. (Reported by Dan Waber and Dan Nicolaescu.)
Karoly Lorentey <lorentey@elte.hu>
parents:
83360
diff
changeset
|
752 (normal-erase-is-backspace-setup-frame frame) |
85145
0833864bd9a1
(frame-inherited-parameters): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85114
diff
changeset
|
753 ;; Inherit the original frame's parameters. |
0833864bd9a1
(frame-inherited-parameters): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85114
diff
changeset
|
754 (dolist (param frame-inherited-parameters) |
0833864bd9a1
(frame-inherited-parameters): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85114
diff
changeset
|
755 (unless (assq param parameters) ;Overridden by explicit parameters. |
0833864bd9a1
(frame-inherited-parameters): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85114
diff
changeset
|
756 (let ((val (frame-parameter oldframe param))) |
0833864bd9a1
(frame-inherited-parameters): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
85114
diff
changeset
|
757 (when val (set-frame-parameter frame param val))))) |
17163
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
758 (run-hook-with-args 'after-make-frame-functions frame) |
a63a326604ae
defvar before- and after- make frame vars; use properly in make-frame.
Simon Marshall <simon@gnu.org>
parents:
16963
diff
changeset
|
759 frame)) |
394 | 760 |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
761 (defun filtered-frame-list (predicate) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
762 "Return a list of all live frames which satisfy PREDICATE." |
31450
82556406aa45
(filtered-frame-list): Reduce consing.
Gerd Moellmann <gerd@gnu.org>
parents:
31400
diff
changeset
|
763 (let* ((frames (frame-list)) |
82556406aa45
(filtered-frame-list): Reduce consing.
Gerd Moellmann <gerd@gnu.org>
parents:
31400
diff
changeset
|
764 (list frames)) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
765 (while (consp frames) |
31450
82556406aa45
(filtered-frame-list): Reduce consing.
Gerd Moellmann <gerd@gnu.org>
parents:
31400
diff
changeset
|
766 (unless (funcall predicate (car frames)) |
82556406aa45
(filtered-frame-list): Reduce consing.
Gerd Moellmann <gerd@gnu.org>
parents:
31400
diff
changeset
|
767 (setcar frames nil)) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
768 (setq frames (cdr frames))) |
31450
82556406aa45
(filtered-frame-list): Reduce consing.
Gerd Moellmann <gerd@gnu.org>
parents:
31400
diff
changeset
|
769 (delq nil list))) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
770 |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
771 (defun minibuffer-frame-list () |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
772 "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
|
773 (filtered-frame-list |
82111
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
774 (lambda (frame) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
775 (eq frame (window-frame (minibuffer-window frame)))))) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
776 |
84699
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
777 ;; Used to be called `terminal-id' in termdev.el. |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
778 (defun get-device-terminal (device) |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
779 "Return the terminal corresponding to DEVICE. |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
780 DEVICE can be a terminal, a frame, nil (meaning the selected frame's terminal), |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
781 the name of an X display device (HOST.SERVER.SCREEN) or a tty device file." |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
782 (cond |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
783 ((or (null device) (framep device)) |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
784 (frame-terminal device)) |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
785 ((stringp device) |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
786 (let ((f (car (filtered-frame-list |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
787 (lambda (frame) |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
788 (or (equal (frame-parameter frame 'display) device) |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
789 (equal (frame-parameter frame 'tty) device))))))) |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
790 (or f (error "Display %s does not exist" device)) |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
791 (frame-terminal f))) |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
792 ((terminal-live-p device) device) |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
793 (t |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
794 (error "Invalid argument %s in `get-device-terminal'" device)))) |
83167
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83162
diff
changeset
|
795 |
84699
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
796 (defun frames-on-display-list (&optional device) |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
797 "Return a list of all frames on DEVICE. |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
798 |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
799 DEVICE should be a terminal, a frame, |
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
800 or a name of an X display or tty (a string of the form |
83396
201f610eb492
Update frames-on-display-list to accept terminal id numbers.
Karoly Lorentey <lorentey@elte.hu>
parents:
83389
diff
changeset
|
801 HOST:SERVER.SCREEN). |
201f610eb492
Update frames-on-display-list to accept terminal id numbers.
Karoly Lorentey <lorentey@elte.hu>
parents:
83389
diff
changeset
|
802 |
84699
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
803 If DEVICE is omitted or nil, it defaults to the selected |
83396
201f610eb492
Update frames-on-display-list to accept terminal id numbers.
Karoly Lorentey <lorentey@elte.hu>
parents:
83389
diff
changeset
|
804 frame's terminal device." |
84699
e3787b1a7e84
(get-device-terminal): New function. Moved from termdev.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
84682
diff
changeset
|
805 (let* ((terminal (get-device-terminal device)) |
31450
82556406aa45
(filtered-frame-list): Reduce consing.
Gerd Moellmann <gerd@gnu.org>
parents:
31400
diff
changeset
|
806 (func #'(lambda (frame) |
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83427
diff
changeset
|
807 (eq (frame-terminal frame) terminal)))) |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
808 (filtered-frame-list func))) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
809 |
83416
4513d8dcdfd5
Reimplement and extend support for terminal-local environment variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
83414
diff
changeset
|
810 (defun framep-on-display (&optional terminal) |
4513d8dcdfd5
Reimplement and extend support for terminal-local environment variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
83414
diff
changeset
|
811 "Return the type of frames on TERMINAL. |
4513d8dcdfd5
Reimplement and extend support for terminal-local environment variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
83414
diff
changeset
|
812 TERMINAL may be a terminal id, a display name or a frame. If it |
4513d8dcdfd5
Reimplement and extend support for terminal-local environment variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
83414
diff
changeset
|
813 is a frame, its type is returned. If TERMINAL is omitted or nil, |
4513d8dcdfd5
Reimplement and extend support for terminal-local environment variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
83414
diff
changeset
|
814 it defaults to the selected frame's terminal device. All frames |
4513d8dcdfd5
Reimplement and extend support for terminal-local environment variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
83414
diff
changeset
|
815 on a given display are of the same type." |
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83427
diff
changeset
|
816 (or (terminal-live-p terminal) |
83416
4513d8dcdfd5
Reimplement and extend support for terminal-local environment variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
83414
diff
changeset
|
817 (framep terminal) |
4513d8dcdfd5
Reimplement and extend support for terminal-local environment variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
83414
diff
changeset
|
818 (framep (car (frames-on-display-list terminal))))) |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
819 |
3971
6e7afc0a7fbc
* frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
820 (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
|
821 "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
|
822 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
|
823 `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
|
824 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
|
825 the user during startup." |
6e7afc0a7fbc
* frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
826 (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
|
827 (let ((tail param-list)) |
6e7afc0a7fbc
* frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
828 (while (consp (cdr tail)) |
6e7afc0a7fbc
* frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
829 (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
|
830 (memq (car (car (cdr tail))) |
81f9ad98c323
(frame-notice-user-settings): When replacing the first
Richard M. Stallman <rms@gnu.org>
parents:
7322
diff
changeset
|
831 '(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
|
832 (progn |
81f9ad98c323
(frame-notice-user-settings): When replacing the first
Richard M. Stallman <rms@gnu.org>
parents:
7322
diff
changeset
|
833 (setq frame-initial-geometry-arguments |
81f9ad98c323
(frame-notice-user-settings): When replacing the first
Richard M. Stallman <rms@gnu.org>
parents:
7322
diff
changeset
|
834 (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
|
835 (setcdr tail (cdr (cdr tail)))) |
3971
6e7afc0a7fbc
* frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
836 (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
|
837 (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
|
838 (nreverse frame-initial-geometry-arguments)) |
3971
6e7afc0a7fbc
* frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
839 (cdr param-list)) |
6e7afc0a7fbc
* frame.el (frame-remove-geometry-params): New function.
Jim Blandy <jimb@redhat.com>
parents:
3966
diff
changeset
|
840 |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
841 (declare-function x-focus-frame "xfns.c" (frame)) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
842 |
38781
c20b98060a6d
(select-frame-set-input-focus): New function
Gerd Moellmann <gerd@gnu.org>
parents:
38469
diff
changeset
|
843 (defun select-frame-set-input-focus (frame) |
c20b98060a6d
(select-frame-set-input-focus): New function
Gerd Moellmann <gerd@gnu.org>
parents:
38469
diff
changeset
|
844 "Select FRAME, raise it, and set input focus, if possible." |
c20b98060a6d
(select-frame-set-input-focus): New function
Gerd Moellmann <gerd@gnu.org>
parents:
38469
diff
changeset
|
845 (select-frame frame) |
c20b98060a6d
(select-frame-set-input-focus): New function
Gerd Moellmann <gerd@gnu.org>
parents:
38469
diff
changeset
|
846 (raise-frame frame) |
c20b98060a6d
(select-frame-set-input-focus): New function
Gerd Moellmann <gerd@gnu.org>
parents:
38469
diff
changeset
|
847 ;; Ensure, if possible, that frame gets input focus. |
97043
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96921
diff
changeset
|
848 (when (memq (window-system frame) '(x w32 ns)) |
85269
7fdf1d7a2fb4
Do not use a single clause cond.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85268
diff
changeset
|
849 (x-focus-frame frame)) |
7fdf1d7a2fb4
Do not use a single clause cond.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85268
diff
changeset
|
850 (when focus-follows-mouse |
7fdf1d7a2fb4
Do not use a single clause cond.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
85268
diff
changeset
|
851 (set-mouse-position (selected-frame) (1- (frame-width)) 0))) |
38781
c20b98060a6d
(select-frame-set-input-focus): New function
Gerd Moellmann <gerd@gnu.org>
parents:
38469
diff
changeset
|
852 |
4425
1b48826df9cb
(other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents:
4360
diff
changeset
|
853 (defun other-frame (arg) |
74481
9d2d9ff697a5
(other-frame): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
73070
diff
changeset
|
854 "Select the ARGth different visible frame on current display, and raise it. |
4425
1b48826df9cb
(other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents:
4360
diff
changeset
|
855 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
|
856 This command selects the frame ARG steps away in that order. |
43434
d1a09152b7b5
(other-frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
42952
diff
changeset
|
857 A negative ARG moves in the opposite order. |
d1a09152b7b5
(other-frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
42952
diff
changeset
|
858 |
d1a09152b7b5
(other-frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
42952
diff
changeset
|
859 To make this command work properly, you must tell Emacs |
d1a09152b7b5
(other-frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
42952
diff
changeset
|
860 how the system (or the window manager) generally handles |
d1a09152b7b5
(other-frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
42952
diff
changeset
|
861 focus-switching between windows. If moving the mouse onto a window |
d1a09152b7b5
(other-frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
42952
diff
changeset
|
862 selects it (gives it focus), set `focus-follows-mouse' to t. |
d1a09152b7b5
(other-frame): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
42952
diff
changeset
|
863 Otherwise, that variable should be nil." |
4425
1b48826df9cb
(other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents:
4360
diff
changeset
|
864 (interactive "p") |
1b48826df9cb
(other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents:
4360
diff
changeset
|
865 (let ((frame (selected-frame))) |
1b48826df9cb
(other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents:
4360
diff
changeset
|
866 (while (> arg 0) |
4431
2fe6adb8a82f
(other-frame): Skip iconified and invisible frames.
Roland McGrath <roland@gnu.org>
parents:
4425
diff
changeset
|
867 (setq frame (next-frame frame)) |
2fe6adb8a82f
(other-frame): Skip iconified and invisible frames.
Roland McGrath <roland@gnu.org>
parents:
4425
diff
changeset
|
868 (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
|
869 (setq frame (next-frame frame))) |
2fe6adb8a82f
(other-frame): Skip iconified and invisible frames.
Roland McGrath <roland@gnu.org>
parents:
4425
diff
changeset
|
870 (setq arg (1- arg))) |
4425
1b48826df9cb
(other-frame): New function, analogous to other-window.
Roland McGrath <roland@gnu.org>
parents:
4360
diff
changeset
|
871 (while (< arg 0) |
4431
2fe6adb8a82f
(other-frame): Skip iconified and invisible frames.
Roland McGrath <roland@gnu.org>
parents:
4425
diff
changeset
|
872 (setq frame (previous-frame frame)) |
2fe6adb8a82f
(other-frame): Skip iconified and invisible frames.
Roland McGrath <roland@gnu.org>
parents:
4425
diff
changeset
|
873 (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
|
874 (setq frame (previous-frame frame))) |
4553
ceb140c16ad2
(other-frame): Fix error in loop counting.
Richard M. Stallman <rms@gnu.org>
parents:
4431
diff
changeset
|
875 (setq arg (1+ arg))) |
38781
c20b98060a6d
(select-frame-set-input-focus): New function
Gerd Moellmann <gerd@gnu.org>
parents:
38469
diff
changeset
|
876 (select-frame-set-input-focus frame))) |
20386
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
877 |
51180
8444fb4d51cf
(iconify-or-deiconify-frame): Move from term/x-win.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50533
diff
changeset
|
878 (defun iconify-or-deiconify-frame () |
8444fb4d51cf
(iconify-or-deiconify-frame): Move from term/x-win.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50533
diff
changeset
|
879 "Iconify the selected frame, or deiconify if it's currently an icon." |
8444fb4d51cf
(iconify-or-deiconify-frame): Move from term/x-win.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50533
diff
changeset
|
880 (interactive) |
8444fb4d51cf
(iconify-or-deiconify-frame): Move from term/x-win.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50533
diff
changeset
|
881 (if (eq (cdr (assq 'visibility (frame-parameters))) t) |
8444fb4d51cf
(iconify-or-deiconify-frame): Move from term/x-win.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50533
diff
changeset
|
882 (iconify-frame) |
8444fb4d51cf
(iconify-or-deiconify-frame): Move from term/x-win.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50533
diff
changeset
|
883 (make-frame-visible))) |
8444fb4d51cf
(iconify-or-deiconify-frame): Move from term/x-win.el.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
50533
diff
changeset
|
884 |
83065
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83018
diff
changeset
|
885 (defun suspend-frame () |
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83018
diff
changeset
|
886 "Do whatever is right to suspend the current frame. |
83416
4513d8dcdfd5
Reimplement and extend support for terminal-local environment variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
83414
diff
changeset
|
887 Calls `suspend-emacs' if invoked from the controlling tty device, |
4513d8dcdfd5
Reimplement and extend support for terminal-local environment variables.
Karoly Lorentey <lorentey@elte.hu>
parents:
83414
diff
changeset
|
888 `suspend-tty' from a secondary tty device, and |
83065
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83018
diff
changeset
|
889 `iconify-or-deiconify-frame' from an X frame." |
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83018
diff
changeset
|
890 (interactive) |
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83018
diff
changeset
|
891 (let ((type (framep (selected-frame)))) |
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83018
diff
changeset
|
892 (cond |
96675
d45acf0c8d23
merging Emacs.app (NeXTstep port)
Adrian Robert <Adrian.B.Robert@gmail.com>
parents:
95841
diff
changeset
|
893 ((memq type '(x ns w32)) (iconify-or-deiconify-frame)) |
83065
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83018
diff
changeset
|
894 ((eq type t) |
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83427
diff
changeset
|
895 (if (controlling-tty-p) |
83173
6b4b299e2cd5
Fix suspend-frame on the controlling tty (reported by Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83167
diff
changeset
|
896 (suspend-emacs) |
6b4b299e2cd5
Fix suspend-frame on the controlling tty (reported by Dan Nicolaescu).
Karoly Lorentey <lorentey@elte.hu>
parents:
83167
diff
changeset
|
897 (suspend-tty))) |
83065
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83018
diff
changeset
|
898 (t (suspend-emacs))))) |
a871be7b26a5
Implemented suspending of emacsclient frames.
Karoly Lorentey <lorentey@elte.hu>
parents:
83018
diff
changeset
|
899 |
20386
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
900 (defun make-frame-names-alist () |
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
901 (let* ((current-frame (selected-frame)) |
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
902 (falist |
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
903 (cons |
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
904 (cons (frame-parameter current-frame 'name) current-frame) nil)) |
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
905 (frame (next-frame nil t))) |
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
906 (while (not (eq frame current-frame)) |
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
907 (progn |
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
908 (setq falist (cons (cons (frame-parameter frame 'name) frame) falist)) |
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
909 (setq frame (next-frame frame t)))) |
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
910 falist)) |
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
911 |
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
912 (defvar frame-name-history nil) |
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
913 (defun select-frame-by-name (name) |
39505
b7d5e9ab6f93
(select-frame-by-name, other-frame): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents:
38812
diff
changeset
|
914 "Select the frame on the current terminal whose name is NAME and raise it. |
20386
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
915 If there is no frame by that name, signal an error." |
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
916 (interactive |
21730
efa1c31f068c
(frame-name-alist): Remove this variable.
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
917 (let* ((frame-names-alist (make-frame-names-alist)) |
efa1c31f068c
(frame-name-alist): Remove this variable.
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
918 (default (car (car frame-names-alist))) |
efa1c31f068c
(frame-name-alist): Remove this variable.
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
919 (input (completing-read |
efa1c31f068c
(frame-name-alist): Remove this variable.
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
920 (format "Select Frame (default %s): " default) |
efa1c31f068c
(frame-name-alist): Remove this variable.
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
921 frame-names-alist nil t nil 'frame-name-history))) |
20386
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
922 (if (= (length input) 0) |
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
923 (list default) |
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
924 (list input)))) |
21730
efa1c31f068c
(frame-name-alist): Remove this variable.
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
925 (let* ((frame-names-alist (make-frame-names-alist)) |
efa1c31f068c
(frame-name-alist): Remove this variable.
Richard M. Stallman <rms@gnu.org>
parents:
21669
diff
changeset
|
926 (frame (cdr (assoc name frame-names-alist)))) |
20386
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
927 (or frame |
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
928 (error "There is no frame named `%s'" name)) |
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
929 (make-frame-visible frame) |
25ca60b3ca09
(make-frame-names-alist, select-frame-by-name): New
Eli Zaretskii <eliz@gnu.org>
parents:
20281
diff
changeset
|
930 (raise-frame frame) |
24207
69b4c339845d
(select-frame-by-name): Obey focus-follows-mouse.
Andrew Innes <andrewi@gnu.org>
parents:
23763
diff
changeset
|
931 (select-frame frame) |
69b4c339845d
(select-frame-by-name): Obey focus-follows-mouse.
Andrew Innes <andrewi@gnu.org>
parents:
23763
diff
changeset
|
932 ;; Ensure, if possible, that frame gets input focus. |
96675
d45acf0c8d23
merging Emacs.app (NeXTstep port)
Adrian Robert <Adrian.B.Robert@gmail.com>
parents:
95841
diff
changeset
|
933 (cond ((memq (window-system frame) '(x w32 ns)) |
84632
feefd62722f7
(select-frame-set-input-focus, select-frame-by-name): Use x-focus-frame for w32.
Jason Rumney <jasonr@gnu.org>
parents:
83808
diff
changeset
|
934 (x-focus-frame frame))) |
47016
876e9026e464
(select-frame-by-name, select-frame-set-input-focus):
Richard M. Stallman <rms@gnu.org>
parents:
44547
diff
changeset
|
935 (when focus-follows-mouse |
876e9026e464
(select-frame-by-name, select-frame-set-input-focus):
Richard M. Stallman <rms@gnu.org>
parents:
44547
diff
changeset
|
936 (set-mouse-position frame (1- (frame-width frame)) 0)))) |
394 | 937 |
777 | 938 ;;;; Frame configurations |
756 | 939 |
777 | 940 (defun current-frame-configuration () |
941 "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
|
942 Its car is `frame-configuration'. |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
943 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
|
944 where |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
945 FRAME is a frame object, |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
946 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
|
947 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
|
948 (cons 'frame-configuration |
82111
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
949 (mapcar (lambda (frame) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
950 (list frame |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
951 (frame-parameters frame) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
952 (current-window-configuration frame))) |
2202
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
953 (frame-list)))) |
756 | 954 |
4670
e39967101d8b
(set-frame-configuration): Take new optional arg NODELETE; if non-nil,
Roland McGrath <roland@gnu.org>
parents:
4625
diff
changeset
|
955 (defun set-frame-configuration (configuration &optional nodelete) |
777 | 956 "Restore the frames to the state described by CONFIGURATION. |
957 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
|
958 configuration, and other parameters set as specified in CONFIGURATION. |
56507
8a0830a6f469
(modify-all-frames-parameters): Minor doc fix.
Luc Teirlinck <teirllm@auburn.edu>
parents:
56491
diff
changeset
|
959 However, this function does not restore deleted frames. |
8a0830a6f469
(modify-all-frames-parameters): Minor doc fix.
Luc Teirlinck <teirllm@auburn.edu>
parents:
56491
diff
changeset
|
960 |
4919
3963d8a9f342
(set-frame-configuration): If NODELETE, make the unwanted frames invisible.
Richard M. Stallman <rms@gnu.org>
parents:
4911
diff
changeset
|
961 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
|
962 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
|
963 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
|
964 (or (frame-configuration-p configuration) |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
965 (signal 'wrong-type-argument |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
966 (list 'frame-configuration-p configuration))) |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
967 (let ((config-alist (cdr configuration)) |
081afcef5e85
Make frame configurations start with a distinctive symbol.
Jim Blandy <jimb@redhat.com>
parents:
2069
diff
changeset
|
968 frames-to-delete) |
82111
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
969 (dolist (frame (frame-list)) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
970 (let ((parameters (assq frame config-alist))) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
971 (if parameters |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
972 (progn |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
973 (modify-frame-parameters |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
974 frame |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
975 ;; Since we can't set a frame's minibuffer status, |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
976 ;; we might as well omit the parameter altogether. |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
977 (let* ((parms (nth 1 parameters)) |
85311 | 978 (mini (assq 'minibuffer parms)) |
979 (name (assq 'name parms)) | |
980 (explicit-name (cdr (assq 'explicit-name parms)))) | |
981 (when mini (setq parms (delq mini parms))) | |
982 ;; Leave name in iff it was set explicitly. | |
983 ;; This should fix the behavior reported in | |
984 ;; http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg01632.html | |
985 (when (and name (not explicit-name)) | |
986 (setq parms (delq name parms))) | |
82111
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
987 parms)) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
988 (set-window-configuration (nth 2 parameters))) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
989 (setq frames-to-delete (cons frame frames-to-delete))))) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
990 (mapc (if nodelete |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
991 ;; Note: making frames invisible here was tried |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
992 ;; but led to some strange behavior--each time the frame |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
993 ;; was made visible again, the window manager asked afresh |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
994 ;; for where to put it. |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
995 'iconify-frame |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
996 'delete-frame) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
997 frames-to-delete))) |
394 | 998 |
777 | 999 ;;;; Convenience functions for accessing and interactively changing |
1000 ;;;; frame parameters. | |
394 | 1001 |
826 | 1002 (defun frame-height (&optional frame) |
777 | 1003 "Return number of lines available for display on FRAME. |
1004 If FRAME is omitted, describe the currently selected frame." | |
826 | 1005 (cdr (assq 'height (frame-parameters frame)))) |
777 | 1006 |
1007 (defun frame-width (&optional frame) | |
1008 "Return number of columns available for display on FRAME. | |
1009 If FRAME is omitted, describe the currently selected frame." | |
826 | 1010 (cdr (assq 'width (frame-parameters frame)))) |
777 | 1011 |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1012 (declare-function x-list-fonts "xfaces.c" |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1013 (pattern &optional face frame maximum width)) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1014 |
16963
7daaf9702c47
(set-frame-font): Renamed from set-default-font,
Richard M. Stallman <rms@gnu.org>
parents:
16516
diff
changeset
|
1015 (defalias 'set-default-font 'set-frame-font) |
50522
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1016 (defun set-frame-font (font-name &optional keep-size) |
25139
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
1017 "Set the font of the selected frame to FONT-NAME. |
16047 | 1018 When called interactively, prompt for the name of the font to use. |
50522
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1019 To get the frame's current default font, use `frame-parameters'. |
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1020 |
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1021 The default behavior is to keep the numbers of lines and columns in |
64543
f1a7394cf1a7
(set-frame-font, cursor-in-non-selected-windows): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
64298
diff
changeset
|
1022 the frame, thus may change its pixel size. If optional KEEP-SIZE is |
50522
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1023 non-nil (interactively, prefix argument) the current frame size (in |
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1024 pixels) is kept by adjusting the numbers of the lines and columns." |
41579 | 1025 (interactive |
50522
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1026 (let* ((completion-ignore-case t) |
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1027 (font (completing-read "Font name: " |
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1028 ;; x-list-fonts will fail with an error |
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1029 ;; if this frame doesn't support fonts. |
82111
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
1030 (x-list-fonts "*" nil (selected-frame)) |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
1031 nil nil nil nil |
63aefab8fbc3
Use mapc and dolist instead of mapcar where possible.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
1032 (frame-parameter nil 'font)))) |
50522
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1033 (list font current-prefix-arg))) |
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1034 (let (fht fwd) |
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1035 (if keep-size |
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1036 (setq fht (* (frame-parameter nil 'height) (frame-char-height)) |
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1037 fwd (* (frame-parameter nil 'width) (frame-char-width)))) |
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1038 (modify-frame-parameters (selected-frame) |
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1039 (list (cons 'font font-name))) |
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1040 (if keep-size |
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1041 (modify-frame-parameters |
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1042 (selected-frame) |
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1043 (list (cons 'height (round fht (frame-char-height))) |
ac9f1c53789e
(set-frame-font): Allow keeping frame size after changing font.
Juanma Barranquero <lekktu@gmail.com>
parents:
47738
diff
changeset
|
1044 (cons 'width (round fwd (frame-char-width))))))) |
33186
c63d52fc1eb7
(after-setting-font-hook): Rename hooks -> hook.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
33009
diff
changeset
|
1045 (run-hooks 'after-setting-font-hook 'after-setting-font-hooks)) |
394 | 1046 |
39846
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
1047 (defun set-frame-parameter (frame parameter value) |
67346
bdeb6c3bfc1b
(set-frame-parameter): Add doc string.
Károly Lőrentey <lorentey@elte.hu>
parents:
66275
diff
changeset
|
1048 "Set frame parameter PARAMETER to VALUE on FRAME. |
bdeb6c3bfc1b
(set-frame-parameter): Add doc string.
Károly Lőrentey <lorentey@elte.hu>
parents:
66275
diff
changeset
|
1049 If FRAME is nil, it defaults to the selected frame. |
74481
9d2d9ff697a5
(other-frame): Doc fix.
Juanma Barranquero <lekktu@gmail.com>
parents:
73070
diff
changeset
|
1050 See `modify-frame-parameters'." |
39846
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
1051 (modify-frame-parameters frame (list (cons parameter value)))) |
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
1052 |
1881
436edc3e74f6
(frame-initialize): Fix error syntax.
Richard M. Stallman <rms@gnu.org>
parents:
1863
diff
changeset
|
1053 (defun set-background-color (color-name) |
25139
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
1054 "Set the background color of the selected frame to COLOR-NAME. |
16047 | 1055 When called interactively, prompt for the name of the color to use. |
1056 To get the frame's current background color, use `frame-parameters'." | |
67502
a4d770fc1404
(set-background-color, set-foreground-color)
Juri Linkov <juri@jurta.org>
parents:
67346
diff
changeset
|
1057 (interactive (list (facemenu-read-color "Background color: "))) |
777 | 1058 (modify-frame-parameters (selected-frame) |
40673
377344c6e1f1
(set-background-color, set-foreground-color): Call
Eli Zaretskii <eliz@gnu.org>
parents:
40467
diff
changeset
|
1059 (list (cons 'background-color color-name))) |
377344c6e1f1
(set-background-color, set-foreground-color): Call
Eli Zaretskii <eliz@gnu.org>
parents:
40467
diff
changeset
|
1060 (or window-system |
377344c6e1f1
(set-background-color, set-foreground-color): Call
Eli Zaretskii <eliz@gnu.org>
parents:
40467
diff
changeset
|
1061 (face-set-after-frame-default (selected-frame)))) |
394 | 1062 |
1881
436edc3e74f6
(frame-initialize): Fix error syntax.
Richard M. Stallman <rms@gnu.org>
parents:
1863
diff
changeset
|
1063 (defun set-foreground-color (color-name) |
25139
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
1064 "Set the foreground color of the selected frame to COLOR-NAME. |
16047 | 1065 When called interactively, prompt for the name of the color to use. |
1066 To get the frame's current foreground color, use `frame-parameters'." | |
67502
a4d770fc1404
(set-background-color, set-foreground-color)
Juri Linkov <juri@jurta.org>
parents:
67346
diff
changeset
|
1067 (interactive (list (facemenu-read-color "Foreground color: "))) |
777 | 1068 (modify-frame-parameters (selected-frame) |
40673
377344c6e1f1
(set-background-color, set-foreground-color): Call
Eli Zaretskii <eliz@gnu.org>
parents:
40467
diff
changeset
|
1069 (list (cons 'foreground-color color-name))) |
377344c6e1f1
(set-background-color, set-foreground-color): Call
Eli Zaretskii <eliz@gnu.org>
parents:
40467
diff
changeset
|
1070 (or window-system |
377344c6e1f1
(set-background-color, set-foreground-color): Call
Eli Zaretskii <eliz@gnu.org>
parents:
40467
diff
changeset
|
1071 (face-set-after-frame-default (selected-frame)))) |
394 | 1072 |
1073 (defun set-cursor-color (color-name) | |
25139
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
1074 "Set the text cursor color of the selected frame to COLOR-NAME. |
16047 | 1075 When called interactively, prompt for the name of the color to use. |
1076 To get the frame's current cursor color, use `frame-parameters'." | |
67502
a4d770fc1404
(set-background-color, set-foreground-color)
Juri Linkov <juri@jurta.org>
parents:
67346
diff
changeset
|
1077 (interactive (list (facemenu-read-color "Cursor color: "))) |
777 | 1078 (modify-frame-parameters (selected-frame) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
1079 (list (cons 'cursor-color color-name)))) |
394 | 1080 |
1974
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
1081 (defun set-mouse-color (color-name) |
25139
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
1082 "Set the color of the mouse pointer of the selected frame to COLOR-NAME. |
16047 | 1083 When called interactively, prompt for the name of the color to use. |
1084 To get the frame's current mouse color, use `frame-parameters'." | |
67502
a4d770fc1404
(set-background-color, set-foreground-color)
Juri Linkov <juri@jurta.org>
parents:
67346
diff
changeset
|
1085 (interactive (list (facemenu-read-color "Mouse color: "))) |
777 | 1086 (modify-frame-parameters (selected-frame) |
25074
2eca330f89d7
(set-mouse-color): If new color is nil,
Karl Heuer <kwzh@gnu.org>
parents:
24982
diff
changeset
|
1087 (list (cons 'mouse-color |
2eca330f89d7
(set-mouse-color): If new color is nil,
Karl Heuer <kwzh@gnu.org>
parents:
24982
diff
changeset
|
1088 (or color-name |
2eca330f89d7
(set-mouse-color): If new color is nil,
Karl Heuer <kwzh@gnu.org>
parents:
24982
diff
changeset
|
1089 (cdr (assq 'mouse-color |
2eca330f89d7
(set-mouse-color): If new color is nil,
Karl Heuer <kwzh@gnu.org>
parents:
24982
diff
changeset
|
1090 (frame-parameters)))))))) |
394 | 1091 |
1974
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
1092 (defun set-border-color (color-name) |
25139
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
1093 "Set the color of the border of the selected frame to COLOR-NAME. |
16047 | 1094 When called interactively, prompt for the name of the color to use. |
1095 To get the frame's current border color, use `frame-parameters'." | |
67502
a4d770fc1404
(set-background-color, set-foreground-color)
Juri Linkov <juri@jurta.org>
parents:
67346
diff
changeset
|
1096 (interactive (list (facemenu-read-color "Border color: "))) |
1974
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
1097 (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
|
1098 (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
|
1099 |
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
1100 (defun auto-raise-mode (arg) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
1101 "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
|
1102 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
|
1103 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
|
1104 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
|
1105 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
|
1106 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
|
1107 (interactive "P") |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
1108 (if (null arg) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
1109 (setq arg |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
1110 (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
|
1111 -1 1))) |
26166
312839b8086d
(auto-raise-mode): When enabling the mode,
Gerd Moellmann <gerd@gnu.org>
parents:
25266
diff
changeset
|
1112 (if (> arg 0) |
312839b8086d
(auto-raise-mode): When enabling the mode,
Gerd Moellmann <gerd@gnu.org>
parents:
25266
diff
changeset
|
1113 (raise-frame (selected-frame))) |
777 | 1114 (modify-frame-parameters (selected-frame) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
1115 (list (cons 'auto-raise (> arg 0))))) |
394 | 1116 |
1974
94e4f619080b
These changes were actually made by Richard; I stole his RCS lock.
Jim Blandy <jimb@redhat.com>
parents:
1881
diff
changeset
|
1117 (defun auto-lower-mode (arg) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
1118 "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
|
1119 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
|
1120 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
|
1121 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
|
1122 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
|
1123 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
|
1124 (interactive "P") |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
1125 (if (null arg) |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
1126 (setq arg |
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
1127 (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
|
1128 -1 1))) |
777 | 1129 (modify-frame-parameters (selected-frame) |
1863
6f55c76b5789
* frame.el: Clean up initialization code.
Jim Blandy <jimb@redhat.com>
parents:
1821
diff
changeset
|
1130 (list (cons 'auto-lower (> arg 0))))) |
20281
799de2d79c64
(set-frame-name): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
19681
diff
changeset
|
1131 (defun set-frame-name (name) |
799de2d79c64
(set-frame-name): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
19681
diff
changeset
|
1132 "Set the name of the selected frame to NAME. |
799de2d79c64
(set-frame-name): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
19681
diff
changeset
|
1133 When called interactively, prompt for the name of the frame. |
799de2d79c64
(set-frame-name): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
19681
diff
changeset
|
1134 The frame name is displayed on the modeline if the terminal displays only |
799de2d79c64
(set-frame-name): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
19681
diff
changeset
|
1135 one frame, otherwise the name is displayed on the frame's caption bar." |
799de2d79c64
(set-frame-name): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
19681
diff
changeset
|
1136 (interactive "sFrame name: ") |
799de2d79c64
(set-frame-name): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
19681
diff
changeset
|
1137 (modify-frame-parameters (selected-frame) |
799de2d79c64
(set-frame-name): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
19681
diff
changeset
|
1138 (list (cons 'name name)))) |
52614
a77e35d5d0c2
(frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents:
52401
diff
changeset
|
1139 |
a77e35d5d0c2
(frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents:
52401
diff
changeset
|
1140 (defun frame-current-scroll-bars (&optional frame) |
a77e35d5d0c2
(frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents:
52401
diff
changeset
|
1141 "Return the current scroll-bar settings in frame FRAME. |
63178
69c18304e55e
(frame-current-scroll-bars): Fix typos in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
62521
diff
changeset
|
1142 Value is a cons (VERTICAL . HORIZ0NTAL) where VERTICAL specifies the |
52614
a77e35d5d0c2
(frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents:
52401
diff
changeset
|
1143 current location of the vertical scroll-bars (left, right, or nil), |
63178
69c18304e55e
(frame-current-scroll-bars): Fix typos in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
62521
diff
changeset
|
1144 and HORIZONTAL specifies the current location of the horizontal scroll |
52614
a77e35d5d0c2
(frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents:
52401
diff
changeset
|
1145 bars (top, bottom, or nil)." |
a77e35d5d0c2
(frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents:
52401
diff
changeset
|
1146 (let ((vert (frame-parameter frame 'vertical-scroll-bars)) |
a77e35d5d0c2
(frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents:
52401
diff
changeset
|
1147 (hor nil)) |
a77e35d5d0c2
(frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents:
52401
diff
changeset
|
1148 (unless (memq vert '(left right nil)) |
a77e35d5d0c2
(frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents:
52401
diff
changeset
|
1149 (setq vert default-frame-scroll-bars)) |
a77e35d5d0c2
(frame-current-scroll-bars): New defun.
Kim F. Storm <storm@cua.dk>
parents:
52401
diff
changeset
|
1150 (cons vert hor))) |
394 | 1151 |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1152 ;;;; Frame/display capabilities. |
83431
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83427
diff
changeset
|
1153 (defun selected-terminal () |
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83427
diff
changeset
|
1154 "Return the terminal that is now selected." |
76396de7f50a
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
Karoly Lorentey <lorentey@elte.hu>
parents:
83427
diff
changeset
|
1155 (frame-terminal (selected-frame))) |
83167
69ebc75cb461
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83162
diff
changeset
|
1156 |
86289
8a7ed478f7bc
* international/titdic-cnv.el (dos-8+3-filename):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86284
diff
changeset
|
1157 (declare-function msdos-mouse-p "dosfns.c") |
8a7ed478f7bc
* international/titdic-cnv.el (dos-8+3-filename):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
86284
diff
changeset
|
1158 |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1159 (defun display-mouse-p (&optional display) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1160 "Return non-nil if DISPLAY has a mouse available. |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1161 DISPLAY can be a display name, a frame, or nil (meaning the selected |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1162 frame's display)." |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1163 (let ((frame-type (framep-on-display display))) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1164 (cond |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1165 ((eq frame-type 'pc) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1166 (msdos-mouse-p)) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1167 ((eq system-type 'windows-nt) |
56759
88d59be47588
(display-mouse-p, display-selections-p): Use with-no-warnings.
Richard M. Stallman <rms@gnu.org>
parents:
56528
diff
changeset
|
1168 (with-no-warnings |
88d59be47588
(display-mouse-p, display-selections-p): Use with-no-warnings.
Richard M. Stallman <rms@gnu.org>
parents:
56528
diff
changeset
|
1169 (> w32-num-mouse-buttons 0))) |
97043
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96921
diff
changeset
|
1170 ((memq frame-type '(x ns)) |
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96921
diff
changeset
|
1171 t) ;; We assume X and NeXTstep *always* have a pointing device |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1172 (t |
27774
097c2dd9367a
(display-mouse-p): Use variable xterm-mouse-mode and check for t-mouse
Dave Love <fx@gnu.org>
parents:
27570
diff
changeset
|
1173 (or (and (featurep 'xt-mouse) |
097c2dd9367a
(display-mouse-p): Use variable xterm-mouse-mode and check for t-mouse
Dave Love <fx@gnu.org>
parents:
27570
diff
changeset
|
1174 xterm-mouse-mode) |
097c2dd9367a
(display-mouse-p): Use variable xterm-mouse-mode and check for t-mouse
Dave Love <fx@gnu.org>
parents:
27570
diff
changeset
|
1175 ;; t-mouse is distributed with the GPM package. It doesn't have |
097c2dd9367a
(display-mouse-p): Use variable xterm-mouse-mode and check for t-mouse
Dave Love <fx@gnu.org>
parents:
27570
diff
changeset
|
1176 ;; a toggle. |
097c2dd9367a
(display-mouse-p): Use variable xterm-mouse-mode and check for t-mouse
Dave Love <fx@gnu.org>
parents:
27570
diff
changeset
|
1177 (featurep 't-mouse)))))) |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1178 |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1179 (defun display-popup-menus-p (&optional display) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1180 "Return non-nil if popup menus are supported on DISPLAY. |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1181 DISPLAY can be a display name, a frame, or nil (meaning the selected |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1182 frame's display). |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1183 Support for popup menus requires that the mouse be available." |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1184 (and |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1185 (let ((frame-type (framep-on-display display))) |
97043
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96921
diff
changeset
|
1186 (memq frame-type '(x w32 pc ns))) |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1187 (display-mouse-p display))) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1188 |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1189 (defun display-graphic-p (&optional display) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1190 "Return non-nil if DISPLAY is a graphic display. |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1191 Graphical displays are those which are capable of displaying several |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1192 frames and several different fonts at once. This is true for displays |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1193 that use a window system such as X, and false for text-only terminals. |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1194 DISPLAY can be a display name, a frame, or nil (meaning the selected |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1195 frame's display)." |
97043
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96921
diff
changeset
|
1196 (not (null (memq (framep-on-display display) '(x w32 ns))))) |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1197 |
38469
38c0279a4af4
(display-images-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
38412
diff
changeset
|
1198 (defun display-images-p (&optional display) |
38c0279a4af4
(display-images-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
38412
diff
changeset
|
1199 "Return non-nil if DISPLAY can display images. |
38c0279a4af4
(display-images-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
38412
diff
changeset
|
1200 |
38c0279a4af4
(display-images-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
38412
diff
changeset
|
1201 DISPLAY can be a display name, a frame, or nil (meaning the selected |
38c0279a4af4
(display-images-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
38412
diff
changeset
|
1202 frame's display)." |
38c0279a4af4
(display-images-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
38412
diff
changeset
|
1203 (and (display-graphic-p display) |
38c0279a4af4
(display-images-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
38412
diff
changeset
|
1204 (fboundp 'image-mask-p) |
44049
770a1adcce3e
(display-images-p): Do not explicitly check display type.
Jason Rumney <jasonr@gnu.org>
parents:
43661
diff
changeset
|
1205 (fboundp 'image-size))) |
38469
38c0279a4af4
(display-images-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents:
38412
diff
changeset
|
1206 |
29614
356975f21b18
(display-multi-frame-p, display-multi-font-p): New
Eli Zaretskii <eliz@gnu.org>
parents:
29354
diff
changeset
|
1207 (defalias 'display-multi-frame-p 'display-graphic-p) |
356975f21b18
(display-multi-frame-p, display-multi-font-p): New
Eli Zaretskii <eliz@gnu.org>
parents:
29354
diff
changeset
|
1208 (defalias 'display-multi-font-p 'display-graphic-p) |
356975f21b18
(display-multi-frame-p, display-multi-font-p): New
Eli Zaretskii <eliz@gnu.org>
parents:
29354
diff
changeset
|
1209 |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1210 (defun display-selections-p (&optional display) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1211 "Return non-nil if DISPLAY supports selections. |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1212 A selection is a way to transfer text or other data between programs |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1213 via special system buffers called `selection' or `cut buffer' or |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1214 `clipboard'. |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1215 DISPLAY can be a display name, a frame, or nil (meaning the selected |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1216 frame's display)." |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1217 (let ((frame-type (framep-on-display display))) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1218 (cond |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1219 ((eq frame-type 'pc) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1220 ;; MS-DOG frames support selections when Emacs runs inside |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1221 ;; the Windows' DOS Box. |
56759
88d59be47588
(display-mouse-p, display-selections-p): Use with-no-warnings.
Richard M. Stallman <rms@gnu.org>
parents:
56528
diff
changeset
|
1222 (with-no-warnings |
88d59be47588
(display-mouse-p, display-selections-p): Use with-no-warnings.
Richard M. Stallman <rms@gnu.org>
parents:
56528
diff
changeset
|
1223 (not (null dos-windows-version)))) |
97043
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96921
diff
changeset
|
1224 ((memq frame-type '(x w32 ns)) |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1225 t) ;; FIXME? |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1226 (t |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1227 nil)))) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1228 |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1229 (declare-function x-display-screens "xfns.c" (&optional terminal)) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1230 |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1231 (defun display-screens (&optional display) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1232 "Return the number of screens associated with DISPLAY." |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1233 (let ((frame-type (framep-on-display display))) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1234 (cond |
97043
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96921
diff
changeset
|
1235 ((memq frame-type '(x w32 ns)) |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1236 (x-display-screens display)) |
66275
737f713709af
(display-screens): Use x-display-screens also on Mac.
YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
parents:
66226
diff
changeset
|
1237 (t |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1238 1)))) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1239 |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1240 (declare-function x-display-pixel-height "xfns.c" (&optional terminal)) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1241 |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1242 (defun display-pixel-height (&optional display) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1243 "Return the height of DISPLAY's screen in pixels. |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1244 For character terminals, each character counts as a single pixel." |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1245 (let ((frame-type (framep-on-display display))) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1246 (cond |
97043
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96921
diff
changeset
|
1247 ((memq frame-type '(x w32 ns)) |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1248 (x-display-pixel-height display)) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1249 (t |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1250 (frame-height (if (framep display) display (selected-frame))))))) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1251 |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1252 (declare-function x-display-pixel-width "xfns.c" (&optional terminal)) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1253 |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1254 (defun display-pixel-width (&optional display) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1255 "Return the width of DISPLAY's screen in pixels. |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1256 For character terminals, each character counts as a single pixel." |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1257 (let ((frame-type (framep-on-display display))) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1258 (cond |
97043
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96921
diff
changeset
|
1259 ((memq frame-type '(x w32 ns)) |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1260 (x-display-pixel-width display)) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1261 (t |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1262 (frame-width (if (framep display) display (selected-frame))))))) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1263 |
72679
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1264 (defcustom display-mm-dimensions-alist nil |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1265 "Alist for specifying screen dimensions in millimeters. |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1266 The dimensions will be used for `display-mm-height' and |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1267 `display-mm-width' if defined for the respective display. |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1268 |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1269 Each element of the alist has the form (display . (width . height)), |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1270 e.g. (\":0.0\" . (287 . 215)). |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1271 |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1272 If `display' equals t, it specifies dimensions for all graphical |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1273 displays not explicitely specified." |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1274 :version "22.1" |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1275 :type '(alist :key-type (choice (string :tag "Display name") |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1276 (const :tag "Default" t)) |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1277 :value-type (cons :tag "Dimensions" |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1278 (integer :tag "Width") |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1279 (integer :tag "Height"))) |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1280 :group 'frames) |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1281 |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1282 (declare-function x-display-mm-height "xfns.c" (&optional terminal)) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1283 |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1284 (defun display-mm-height (&optional display) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1285 "Return the height of DISPLAY's screen in millimeters. |
79855
427fc2f81f46
(display-mm-height, display-mm-width): Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
79721
diff
changeset
|
1286 System values can be overridden by `display-mm-dimensions-alist'. |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1287 If the information is unavailable, value is nil." |
97043
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96921
diff
changeset
|
1288 (and (memq (framep-on-display display) '(x w32 ns)) |
72679
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1289 (or (cddr (assoc (or display (frame-parameter nil 'display)) |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1290 display-mm-dimensions-alist)) |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1291 (cddr (assoc t display-mm-dimensions-alist)) |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1292 (x-display-mm-height display)))) |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1293 |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1294 (declare-function x-display-mm-width "xfns.c" (&optional terminal)) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1295 |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1296 (defun display-mm-width (&optional display) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1297 "Return the width of DISPLAY's screen in millimeters. |
79855
427fc2f81f46
(display-mm-height, display-mm-width): Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
79721
diff
changeset
|
1298 System values can be overridden by `display-mm-dimensions-alist'. |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1299 If the information is unavailable, value is nil." |
97043
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96921
diff
changeset
|
1300 (and (memq (framep-on-display display) '(x w32 ns)) |
72679
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1301 (or (cadr (assoc (or display (frame-parameter nil 'display)) |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1302 display-mm-dimensions-alist)) |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1303 (cadr (assoc t display-mm-dimensions-alist)) |
b8e9392042ae
(display-mm-dimensions-alist): New defcustom.
Kim F. Storm <storm@cua.dk>
parents:
72484
diff
changeset
|
1304 (x-display-mm-width display)))) |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1305 |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1306 (declare-function x-display-backing-store "xfns.c" (&optional terminal)) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1307 |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1308 (defun display-backing-store (&optional display) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1309 "Return the backing store capability of DISPLAY's screen. |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1310 The value may be `always', `when-mapped', `not-useful', or nil if |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1311 the question is inapplicable to a certain kind of display." |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1312 (let ((frame-type (framep-on-display display))) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1313 (cond |
97043
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96921
diff
changeset
|
1314 ((memq frame-type '(x w32 ns)) |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1315 (x-display-backing-store display)) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1316 (t |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1317 'not-useful)))) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1318 |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1319 (declare-function x-display-save-under "xfns.c" (&optional terminal)) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1320 |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1321 (defun display-save-under (&optional display) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1322 "Return non-nil if DISPLAY's screen supports the SaveUnder feature." |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1323 (let ((frame-type (framep-on-display display))) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1324 (cond |
97043
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96921
diff
changeset
|
1325 ((memq frame-type '(x w32 ns)) |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1326 (x-display-save-under display)) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1327 (t |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1328 'not-useful)))) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1329 |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1330 (declare-function x-display-planes "xfns.c" (&optional terminal)) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1331 |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1332 (defun display-planes (&optional display) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1333 "Return the number of planes supported by DISPLAY." |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1334 (let ((frame-type (framep-on-display display))) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1335 (cond |
97043
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96921
diff
changeset
|
1336 ((memq frame-type '(x w32 ns)) |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1337 (x-display-planes display)) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1338 ((eq frame-type 'pc) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1339 4) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1340 (t |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1341 (truncate (log (length (tty-color-alist)) 2)))))) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1342 |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1343 (declare-function x-display-color-cells "xfns.c" (&optional terminal)) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1344 |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1345 (defun display-color-cells (&optional display) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1346 "Return the number of color cells supported by DISPLAY." |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1347 (let ((frame-type (framep-on-display display))) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1348 (cond |
97043
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96921
diff
changeset
|
1349 ((memq frame-type '(x w32 ns)) |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1350 (x-display-color-cells display)) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1351 ((eq frame-type 'pc) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1352 16) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1353 (t |
83008
040dd41ed7d0
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
Karoly Lorentey <lorentey@elte.hu>
parents:
83004
diff
changeset
|
1354 (tty-display-color-cells display))))) |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1355 |
95841
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1356 (declare-function x-display-visual-class "xfns.c" (&optional terminal)) |
b4e36ff621b3
Add some compiler declarations, for builds without X.
Glenn Morris <rgm@gnu.org>
parents:
94678
diff
changeset
|
1357 |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1358 (defun display-visual-class (&optional display) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1359 "Returns the visual class of DISPLAY. |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1360 The value is one of the symbols `static-gray', `gray-scale', |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1361 `static-color', `pseudo-color', `true-color', or `direct-color'." |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1362 (let ((frame-type (framep-on-display display))) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1363 (cond |
97043
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96921
diff
changeset
|
1364 ((memq frame-type '(x w32 ns)) |
27570
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1365 (x-display-visual-class display)) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1366 ((and (memq frame-type '(pc t)) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1367 (tty-display-color-p display)) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1368 'static-color) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1369 (t |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1370 'static-gray)))) |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1371 |
33c77685f4a2
(frames-on-display-list, framep-on-display): New functions.
Eli Zaretskii <eliz@gnu.org>
parents:
27471
diff
changeset
|
1372 |
87531
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1373 ;;;; Frame geometry values |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1374 |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1375 (defun frame-geom-value-cons (type value &optional frame) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1376 "Return equivalent geometry value for FRAME as a cons with car `+'. |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1377 A geometry value equivalent to VALUE for FRAME is returned, |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1378 where the value is a cons with car `+', not numeric. |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1379 TYPE is the car of the original geometry spec (TYPE . VALUE). |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1380 It is `top' or `left', depending on which edge VALUE is related to. |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1381 VALUE is the cdr of a frame geometry spec: (left/top . VALUE). |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1382 If VALUE is a number, then it is converted to a cons value, perhaps |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1383 relative to the opposite frame edge from that in the original spec. |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1384 FRAME defaults to the selected frame. |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1385 |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1386 Examples (measures in pixels) - |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1387 Assuming display height/width=1024, frame height/width=600: |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1388 300 inside display edge: 300 => (+ 300) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1389 (+ 300) => (+ 300) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1390 300 inside opposite display edge: (- 300) => (+ 124) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1391 -300 => (+ 124) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1392 300 beyond display edge |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1393 (= 724 inside opposite display edge): (+ -300) => (+ -300) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1394 300 beyond display edge |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1395 (= 724 inside opposite display edge): (- -300) => (+ 724) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1396 |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1397 In the 3rd, 4th, and 6th examples, the returned value is relative to |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1398 the opposite frame edge from the edge indicated in the input spec." |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1399 (cond ((and (consp value) (eq '+ (car value))) ; e.g. (+ 300), (+ -300) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1400 value) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1401 ((natnump value) (list '+ value)) ; e.g. 300 => (+ 300) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1402 (t ; e.g. -300, (- 300), (- -300) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1403 (list '+ (- (if (eq 'left type) ; => (+ 124), (+ 124), (+ 724) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1404 (x-display-pixel-width) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1405 (x-display-pixel-height)) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1406 (if (integerp value) (- value) (cadr value)) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1407 (if (eq 'left type) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1408 (frame-pixel-width frame) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1409 (frame-pixel-height frame))))))) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1410 |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1411 (defun frame-geom-spec-cons (spec &optional frame) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1412 "Return equivalent geometry spec for FRAME as a cons with car `+'. |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1413 A geometry specification equivalent to SPEC for FRAME is returned, |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1414 where the value is a cons with car `+', not numeric. |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1415 SPEC is a frame geometry spec: (left . VALUE) or (top . VALUE). |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1416 If VALUE is a number, then it is converted to a cons value, perhaps |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1417 relative to the opposite frame edge from that in the original spec. |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1418 FRAME defaults to the selected frame. |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1419 |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1420 Examples (measures in pixels) - |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1421 Assuming display height=1024, frame height=600: |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1422 top 300 below display top: (top . 300) => (top + 300) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1423 (top + 300) => (top + 300) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1424 bottom 300 above display bottom: (top - 300) => (top + 124) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1425 (top . -300) => (top + 124) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1426 top 300 above display top |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1427 (= bottom 724 above display bottom): (top + -300) => (top + -300) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1428 bottom 300 below display bottom |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1429 (= top 724 below display top): (top - -300) => (top + 724) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1430 |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1431 In the 3rd, 4th, and 6th examples, the returned value is relative to |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1432 the opposite frame edge from the edge indicated in the input spec." |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1433 (cons (car spec) (frame-geom-value-cons (car spec) (cdr spec)))) |
ed859b7392b4
(frame-geom-value-cons, frame-geom-spec-cons): New fns.
Richard M. Stallman <rms@gnu.org>
parents:
86321
diff
changeset
|
1434 |
777 | 1435 ;;;; Aliases for backward compatibility with Emacs 18. |
94158
072ae82c3f6a
(screen-height, screen-width, set-screen-width, set-screen-height):
Juanma Barranquero <lekktu@gmail.com>
parents:
91849
diff
changeset
|
1436 (define-obsolete-function-alias 'screen-height 'frame-height "19.7") |
072ae82c3f6a
(screen-height, screen-width, set-screen-width, set-screen-height):
Juanma Barranquero <lekktu@gmail.com>
parents:
91849
diff
changeset
|
1437 (define-obsolete-function-alias 'screen-width 'frame-width "19.7") |
958 | 1438 |
1439 (defun set-screen-width (cols &optional pretend) | |
64543
f1a7394cf1a7
(set-frame-font, cursor-in-non-selected-windows): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
64298
diff
changeset
|
1440 "Change the size of the screen to COLS columns. |
25139
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
1441 Optional second arg non-nil means that redisplay should use COLS columns |
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
1442 but that the idea of the actual width of the frame should not be changed. |
64543
f1a7394cf1a7
(set-frame-font, cursor-in-non-selected-windows): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
64298
diff
changeset
|
1443 This function is provided only for compatibility with Emacs 18." |
958 | 1444 (set-frame-width (selected-frame) cols pretend)) |
1445 | |
1446 (defun set-screen-height (lines &optional pretend) | |
64543
f1a7394cf1a7
(set-frame-font, cursor-in-non-selected-windows): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
64298
diff
changeset
|
1447 "Change the height of the screen to LINES lines. |
25139
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
1448 Optional second arg non-nil means that redisplay should use LINES lines |
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
1449 but that the idea of the actual height of the screen should not be changed. |
64543
f1a7394cf1a7
(set-frame-font, cursor-in-non-selected-windows): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
64298
diff
changeset
|
1450 This function is provided only for compatibility with Emacs 18." |
958 | 1451 (set-frame-height (selected-frame) lines pretend)) |
1452 | |
27471
c64b8825af55
(delete-other-frames): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
27319
diff
changeset
|
1453 (defun delete-other-frames (&optional frame) |
c64b8825af55
(delete-other-frames): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
27319
diff
changeset
|
1454 "Delete all frames except FRAME. |
37360
7bee98ffa33b
(delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents:
37132
diff
changeset
|
1455 If FRAME uses another frame's minibuffer, the minibuffer frame is |
7bee98ffa33b
(delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents:
37132
diff
changeset
|
1456 left untouched. FRAME nil or omitted means use the selected frame." |
27471
c64b8825af55
(delete-other-frames): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
27319
diff
changeset
|
1457 (interactive) |
c64b8825af55
(delete-other-frames): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
27319
diff
changeset
|
1458 (unless frame |
c64b8825af55
(delete-other-frames): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
27319
diff
changeset
|
1459 (setq frame (selected-frame))) |
37360
7bee98ffa33b
(delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents:
37132
diff
changeset
|
1460 (let* ((mini-frame (window-frame (minibuffer-window frame))) |
7bee98ffa33b
(delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents:
37132
diff
changeset
|
1461 (frames (delq mini-frame (delq frame (frame-list))))) |
7bee98ffa33b
(delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents:
37132
diff
changeset
|
1462 ;; Delete mon-minibuffer-only frames first, because `delete-frame' |
7bee98ffa33b
(delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents:
37132
diff
changeset
|
1463 ;; signals an error when trying to delete a mini-frame that's |
7bee98ffa33b
(delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents:
37132
diff
changeset
|
1464 ;; still in use by another frame. |
7bee98ffa33b
(delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents:
37132
diff
changeset
|
1465 (dolist (frame frames) |
7bee98ffa33b
(delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents:
37132
diff
changeset
|
1466 (unless (eq (frame-parameter frame 'minibuffer) 'only) |
7bee98ffa33b
(delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents:
37132
diff
changeset
|
1467 (delete-frame frame))) |
7bee98ffa33b
(delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents:
37132
diff
changeset
|
1468 ;; Delete minibuffer-only frames. |
7bee98ffa33b
(delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents:
37132
diff
changeset
|
1469 (dolist (frame frames) |
7bee98ffa33b
(delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents:
37132
diff
changeset
|
1470 (when (eq (frame-parameter frame 'minibuffer) 'only) |
7bee98ffa33b
(delete-other-frames): Handle minibuffer-only frames.
Gerd Moellmann <gerd@gnu.org>
parents:
37132
diff
changeset
|
1471 (delete-frame frame))))) |
27471
c64b8825af55
(delete-other-frames): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
27319
diff
changeset
|
1472 |
94158
072ae82c3f6a
(screen-height, screen-width, set-screen-width, set-screen-height):
Juanma Barranquero <lekktu@gmail.com>
parents:
91849
diff
changeset
|
1473 (make-obsolete 'set-screen-width 'set-frame-width "19.7") |
072ae82c3f6a
(screen-height, screen-width, set-screen-width, set-screen-height):
Juanma Barranquero <lekktu@gmail.com>
parents:
91849
diff
changeset
|
1474 (make-obsolete 'set-screen-height 'set-frame-height "19.7") |
777 | 1475 |
47738
f75902c4cbb5
(delete-frame-hook): Variable alias for
John Paul Wallington <jpw@pobox.com>
parents:
47016
diff
changeset
|
1476 ;; miscellaneous obsolescence declarations |
64543
f1a7394cf1a7
(set-frame-font, cursor-in-non-selected-windows): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
64298
diff
changeset
|
1477 (define-obsolete-variable-alias 'delete-frame-hook |
f1a7394cf1a7
(set-frame-font, cursor-in-non-selected-windows): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
64298
diff
changeset
|
1478 'delete-frame-functions "22.1") |
47738
f75902c4cbb5
(delete-frame-hook): Variable alias for
John Paul Wallington <jpw@pobox.com>
parents:
47016
diff
changeset
|
1479 |
777 | 1480 |
39846
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
1481 ;; Highlighting trailing whitespace. |
24982
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1482 |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1483 (make-variable-buffer-local 'show-trailing-whitespace) |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1484 |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1485 (defcustom show-trailing-whitespace nil |
56162
de7deaab0320
(show-trailing-whitespace): Doc fix.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55878
diff
changeset
|
1486 "*Non-nil means highlight trailing whitespace. |
de7deaab0320
(show-trailing-whitespace): Doc fix.
Luc Teirlinck <teirllm@auburn.edu>
parents:
55878
diff
changeset
|
1487 This is done in the face `trailing-whitespace'." |
24982
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1488 :type 'boolean |
62521
91bf7b558b82
(show-trailing-whitespace): In group `whitespace-faces'.
Richard M. Stallman <rms@gnu.org>
parents:
60398
diff
changeset
|
1489 :group 'whitespace-faces) |
24982
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1490 |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1491 |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1492 |
39846
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
1493 ;; Scrolling |
28693 | 1494 |
1495 (defgroup scrolling nil | |
1496 "Scrolling windows." | |
1497 :version "21.1" | |
1498 :group 'frames) | |
1499 | |
43661
9f8ac5084298
(auto-hscroll-mode): Renamed from automatic-hscrolling.
Eli Zaretskii <eliz@gnu.org>
parents:
43545
diff
changeset
|
1500 (defcustom auto-hscroll-mode t |
37823
7d2b56f9f9b4
(automatic-hscrolling): Fix a typo. From Pavel Janik <Pavel@Janik.cz>.
Eli Zaretskii <eliz@gnu.org>
parents:
37360
diff
changeset
|
1501 "*Allow or disallow automatic scrolling windows horizontally. |
28856
20f840aa2301
(automatic-hscrolling): Typo.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
28693
diff
changeset
|
1502 If non-nil, windows are automatically scrolled horizontally to make |
28693 | 1503 point visible." |
1504 :version "21.1" | |
1505 :type 'boolean | |
1506 :group 'scrolling) | |
43661
9f8ac5084298
(auto-hscroll-mode): Renamed from automatic-hscrolling.
Eli Zaretskii <eliz@gnu.org>
parents:
43545
diff
changeset
|
1507 (defvaralias 'automatic-hscrolling 'auto-hscroll-mode) |
28693 | 1508 |
1509 | |
39846
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
1510 ;; Blinking cursor |
24982
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1511 |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1512 (defgroup cursor nil |
26284 | 1513 "Displaying text cursors." |
25139
fde300f58ed8
Change comments to doc strings and other doc fixes.
Dave Love <fx@gnu.org>
parents:
25134
diff
changeset
|
1514 :version "21.1" |
24982
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1515 :group 'frames) |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1516 |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1517 (defcustom blink-cursor-delay 0.5 |
26284 | 1518 "*Seconds of idle time after which cursor starts to blink." |
24982
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1519 :type 'number |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1520 :group 'cursor) |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1521 |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1522 (defcustom blink-cursor-interval 0.5 |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1523 "*Length of cursor blink interval in seconds." |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1524 :type 'number |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1525 :group 'cursor) |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1526 |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1527 (defvar blink-cursor-idle-timer nil |
26284 | 1528 "Timer started after `blink-cursor-delay' seconds of Emacs idle time. |
1529 The function `blink-cursor-start' is called when the timer fires.") | |
24982
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1530 |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1531 (defvar blink-cursor-timer nil |
26284 | 1532 "Timer started from `blink-cursor-start'. |
60021
d751f08f4c04
(blink-cursor-timer): Doc fix.
Luc Teirlinck <teirllm@auburn.edu>
parents:
59996
diff
changeset
|
1533 This timer calls `blink-cursor-timer-function' every |
d751f08f4c04
(blink-cursor-timer): Doc fix.
Luc Teirlinck <teirllm@auburn.edu>
parents:
59996
diff
changeset
|
1534 `blink-cursor-interval' seconds.") |
24982
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1535 |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1536 (defun blink-cursor-start () |
26284 | 1537 "Timer function called from the timer `blink-cursor-idle-timer'. |
1538 This starts the timer `blink-cursor-timer', which makes the cursor blink | |
1539 if appropriate. It also arranges to cancel that timer when the next | |
1540 command starts, by installing a pre-command hook." | |
24982
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1541 (when (null blink-cursor-timer) |
72455
94094ff11364
* frame.el (blink-cursor-start): Set timer first.
Chong Yidong <cyd@stupidchicken.com>
parents:
72046
diff
changeset
|
1542 ;; Set up the timer first, so that if this signals an error, |
94094ff11364
* frame.el (blink-cursor-start): Set timer first.
Chong Yidong <cyd@stupidchicken.com>
parents:
72046
diff
changeset
|
1543 ;; blink-cursor-end is not added to pre-command-hook. |
24982
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1544 (setq blink-cursor-timer |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1545 (run-with-timer blink-cursor-interval blink-cursor-interval |
72455
94094ff11364
* frame.el (blink-cursor-start): Set timer first.
Chong Yidong <cyd@stupidchicken.com>
parents:
72046
diff
changeset
|
1546 'blink-cursor-timer-function)) |
94094ff11364
* frame.el (blink-cursor-start): Set timer first.
Chong Yidong <cyd@stupidchicken.com>
parents:
72046
diff
changeset
|
1547 (add-hook 'pre-command-hook 'blink-cursor-end) |
94094ff11364
* frame.el (blink-cursor-start): Set timer first.
Chong Yidong <cyd@stupidchicken.com>
parents:
72046
diff
changeset
|
1548 (internal-show-cursor nil nil))) |
26332
37f66ea5d1a1
* frame.el (blink-cursor-mode, blink-cursor-end): Use
Gerd Moellmann <gerd@gnu.org>
parents:
26284
diff
changeset
|
1549 |
37f66ea5d1a1
* frame.el (blink-cursor-mode, blink-cursor-end): Use
Gerd Moellmann <gerd@gnu.org>
parents:
26284
diff
changeset
|
1550 (defun blink-cursor-timer-function () |
37f66ea5d1a1
* frame.el (blink-cursor-mode, blink-cursor-end): Use
Gerd Moellmann <gerd@gnu.org>
parents:
26284
diff
changeset
|
1551 "Timer function of timer `blink-cursor-timer'." |
37f66ea5d1a1
* frame.el (blink-cursor-mode, blink-cursor-end): Use
Gerd Moellmann <gerd@gnu.org>
parents:
26284
diff
changeset
|
1552 (internal-show-cursor nil (not (internal-show-cursor-p)))) |
24982
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1553 |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1554 (defun blink-cursor-end () |
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1555 "Stop cursor blinking. |
26284 | 1556 This is installed as a pre-command hook by `blink-cursor-start'. |
41579 | 1557 When run, it cancels the timer `blink-cursor-timer' and removes |
26284 | 1558 itself as a pre-command hook." |
24982
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1559 (remove-hook 'pre-command-hook 'blink-cursor-end) |
26332
37f66ea5d1a1
* frame.el (blink-cursor-mode, blink-cursor-end): Use
Gerd Moellmann <gerd@gnu.org>
parents:
26284
diff
changeset
|
1560 (internal-show-cursor nil t) |
72484
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1561 (when blink-cursor-timer |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1562 (cancel-timer blink-cursor-timer) |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1563 (setq blink-cursor-timer nil))) |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1564 |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1565 (define-minor-mode blink-cursor-mode |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1566 "Toggle blinking cursor mode. |
78492
7c8949dbfa0d
Replace `iff' in doc-strings and comments.
Glenn Morris <rgm@gnu.org>
parents:
78236
diff
changeset
|
1567 With a numeric argument, turn blinking cursor mode on if ARG is positive, |
7c8949dbfa0d
Replace `iff' in doc-strings and comments.
Glenn Morris <rgm@gnu.org>
parents:
78236
diff
changeset
|
1568 otherwise turn it off. When blinking cursor mode is enabled, the |
7c8949dbfa0d
Replace `iff' in doc-strings and comments.
Glenn Morris <rgm@gnu.org>
parents:
78236
diff
changeset
|
1569 cursor of the selected window blinks. |
24982
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1570 |
72484
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1571 Note that this command is effective only when Emacs |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1572 displays through a window system, because then Emacs does its own |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1573 cursor display. On a text-only terminal, this is not implemented." |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1574 :init-value (not (or noninteractive |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1575 no-blinking-cursor |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1576 (eq system-type 'ms-dos) |
97043
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
96921
diff
changeset
|
1577 (not (memq window-system '(x w32))))) |
72484
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1578 :initialize 'custom-initialize-safe-default |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1579 :group 'cursor |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1580 :global t |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1581 (if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer)) |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1582 (setq blink-cursor-idle-timer nil) |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1583 (blink-cursor-end) |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1584 (when blink-cursor-mode |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1585 ;; Hide the cursor. |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1586 ;;(internal-show-cursor nil nil) |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1587 (setq blink-cursor-idle-timer |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1588 (run-with-idle-timer blink-cursor-delay |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1589 blink-cursor-delay |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1590 'blink-cursor-start)))) |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1591 |
f9400e50a0e5
(blink-cursor-end): Only ignore the error we care about.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
72455
diff
changeset
|
1592 (define-obsolete-variable-alias 'blink-cursor 'blink-cursor-mode "22.1") |
24982
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1593 |
39846
2e4007551cfd
(special-display-popup-frame): Obey new specs `same-window' and `same-frame'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
39505
diff
changeset
|
1594 ;; Hourglass pointer |
24982
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1595 |
36257
620c4b282fce
(display-hourglass): Renamed from busy-cursor.
Gerd Moellmann <gerd@gnu.org>
parents:
35856
diff
changeset
|
1596 (defcustom display-hourglass t |
67522
32fa5bd6304c
(display-hourglass): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
67502
diff
changeset
|
1597 "*Non-nil means show an hourglass pointer, when Emacs is busy. |
32fa5bd6304c
(display-hourglass): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
67502
diff
changeset
|
1598 This feature only works when on a window system that can change |
32fa5bd6304c
(display-hourglass): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
67502
diff
changeset
|
1599 cursor shapes." |
24982
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1600 :type 'boolean |
36257
620c4b282fce
(display-hourglass): Renamed from busy-cursor.
Gerd Moellmann <gerd@gnu.org>
parents:
35856
diff
changeset
|
1601 :group 'cursor) |
24982
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1602 |
36257
620c4b282fce
(display-hourglass): Renamed from busy-cursor.
Gerd Moellmann <gerd@gnu.org>
parents:
35856
diff
changeset
|
1603 (defcustom hourglass-delay 1 |
67502
a4d770fc1404
(set-background-color, set-foreground-color)
Juri Linkov <juri@jurta.org>
parents:
67346
diff
changeset
|
1604 "*Seconds to wait before displaying an hourglass pointer when Emacs is busy." |
27916
3288a7cd4796
(busy-cursor-delay-seconds): Change type to `number'.
Gerd Moellmann <gerd@gnu.org>
parents:
27909
diff
changeset
|
1605 :type 'number |
36257
620c4b282fce
(display-hourglass): Renamed from busy-cursor.
Gerd Moellmann <gerd@gnu.org>
parents:
35856
diff
changeset
|
1606 :group 'cursor) |
27865
490743da8567
(show-cursor-in-non-selected-windows): New option.
Gerd Moellmann <gerd@gnu.org>
parents:
27846
diff
changeset
|
1607 |
27846
1ef6cae16192
(show-cursor-in-non-selected-windows): New option.
Gerd Moellmann <gerd@gnu.org>
parents:
27774
diff
changeset
|
1608 |
37132
7d4fab575208
(cursor-in-non-selected-windows): Replaces
Gerd Moellmann <gerd@gnu.org>
parents:
36317
diff
changeset
|
1609 (defcustom cursor-in-non-selected-windows t |
64543
f1a7394cf1a7
(set-frame-font, cursor-in-non-selected-windows): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
64298
diff
changeset
|
1610 "*Non-nil means show a hollow box cursor in non-selected windows. |
33784
086c757fef3e
(show-cursor-in-non-selected-windows): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
33186
diff
changeset
|
1611 If nil, don't show a cursor except in the selected window. |
78936
c22151846924
(cursor-in-non-selected-windows): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
78738
diff
changeset
|
1612 If t, display a cursor related to the usual cursor type |
c22151846924
(cursor-in-non-selected-windows): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
78738
diff
changeset
|
1613 \(a solid box becomes hollow, a bar becomes a narrower bar). |
c22151846924
(cursor-in-non-selected-windows): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
78738
diff
changeset
|
1614 You can also specify the cursor type as in the `cursor-type' variable. |
41579 | 1615 Use Custom to set this variable to get the display updated." |
67502
a4d770fc1404
(set-background-color, set-foreground-color)
Juri Linkov <juri@jurta.org>
parents:
67346
diff
changeset
|
1616 :tag "Cursor In Non-selected Windows" |
27846
1ef6cae16192
(show-cursor-in-non-selected-windows): New option.
Gerd Moellmann <gerd@gnu.org>
parents:
27774
diff
changeset
|
1617 :type 'boolean |
1ef6cae16192
(show-cursor-in-non-selected-windows): New option.
Gerd Moellmann <gerd@gnu.org>
parents:
27774
diff
changeset
|
1618 :group 'cursor |
1ef6cae16192
(show-cursor-in-non-selected-windows): New option.
Gerd Moellmann <gerd@gnu.org>
parents:
27774
diff
changeset
|
1619 :set #'(lambda (symbol value) |
1ef6cae16192
(show-cursor-in-non-selected-windows): New option.
Gerd Moellmann <gerd@gnu.org>
parents:
27774
diff
changeset
|
1620 (set-default symbol value) |
1ef6cae16192
(show-cursor-in-non-selected-windows): New option.
Gerd Moellmann <gerd@gnu.org>
parents:
27774
diff
changeset
|
1621 (force-mode-line-update t))) |
41579 | 1622 |
24982
c81447275ea3
(after-setting-font-hooks): New; from Eric Banchrow
Gerd Moellmann <gerd@gnu.org>
parents:
24926
diff
changeset
|
1623 |
394 | 1624 ;;;; Key bindings |
1625 | |
15347
3885819ed860
(make-frame-command): New function.
Richard M. Stallman <rms@gnu.org>
parents:
14701
diff
changeset
|
1626 (define-key ctl-x-5-map "2" 'make-frame-command) |
27471
c64b8825af55
(delete-other-frames): New function.
Gerd Moellmann <gerd@gnu.org>
parents:
27319
diff
changeset
|
1627 (define-key ctl-x-5-map "1" 'delete-other-frames) |
777 | 1628 (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
|
1629 (define-key ctl-x-5-map "o" 'other-frame) |
584 | 1630 |
777 | 1631 (provide 'frame) |
658
7cbd4fcd8b0f
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
584
diff
changeset
|
1632 |
60193
261ebd199f28
(blink-cursor-mode): Use define-minor-mode.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
60021
diff
changeset
|
1633 ;; arch-tag: 82979c70-b8f2-4306-b2ad-ddbd6b328b56 |
777 | 1634 ;;; frame.el ends here |