annotate lisp/frame.el @ 551:36827ee0a6df

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Sun, 16 Feb 1992 04:14:10 +0000
parents 119ba212b686
children 4cd7543be581
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1 ;;;; Multi-screen management that is independent of window systems.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2 ;;;; Copyright (C) 1990 Free Software Foundation, Inc.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4 ;;; This file is part of GNU Emacs.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5 ;;;
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6 ;;; GNU Emacs is free software; you can redistribute it and/or modify
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7 ;;; it under the terms of the GNU General Public License as published by
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
8 ;;; the Free Software Foundation; either version 1, or (at your option)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9 ;;; any later version.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10 ;;;
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11 ;;; GNU Emacs is distributed in the hope that it will be useful,
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 ;;; GNU General Public License for more details.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15 ;;;
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16 ;;; You should have received a copy of the GNU General Public License
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 ;;; along with GNU Emacs; see the file COPYING. If not, write to
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
18 ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
19
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20 (provide 'screen)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22 (defvar screen-creation-function nil
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23 "Window-system dependent function to call to create a new screen.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
24 The window system startup file should set this to its screen creation
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
25 function, which should take an alist of parameters as its argument.")
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
26
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
27 ;;; The default value for this must ask for a minibuffer. There must
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
28 ;;; always exist a screen with a minibuffer, and after we delete the
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
29 ;;; terminal screen, this will be the only screen.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
30 (defvar initial-screen-alist '((minibuffer . nil))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
31 "Alist of values used when creating the initial emacs text screen.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
32 These may be set in your init file, like this:
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
33 (setq initial-screen-alist '((top . 1) (left . 1) (width . 80) (height . 55)))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
34 These supercede the values given in screen-default-alist.")
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
35
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36 (defvar minibuffer-screen-alist nil
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
37 "Alist of values to apply to a minibuffer screen.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38 These may be set in your init file, like this:
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
39 (setq minibuffer-screen-alist
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 '((top . 1) (left . 1) (width . 80) (height . 1)))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41 These supercede the values given in default-screen-alist.")
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43 (defvar pop-up-screen-alist nil
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44 "Alist of values used when creating pop-up screens.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45 Pop-up screens are used for completions, help, and the like.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
46 This variable can be set in your init file, like this:
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
47 (setq pop-up-screen-alist '((width . 80) (height . 20)))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
48 These supercede the values given in default-screen-alist.")
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
49
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
50 (setq pop-up-screen-function
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
51 (function (lambda ()
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
52 (new-screen pop-up-screen-alist))))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
53
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
54
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
55 ;;;; Arrangement of screens at startup
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
56
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
57 ;;; 1) Load the window system startup file from the lisp library and read the
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
58 ;;; high-priority arguments (-q and the like). The window system startup
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
59 ;;; file should create any screens specified in the window system defaults.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
60 ;;;
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
61 ;;; 2) If no screens have been opened, we open an initial text screen.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
62 ;;;
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
63 ;;; 3) Once the init file is done, we apply any newly set parameters
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
64 ;;; in initial-screen-alist to the screen.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
65
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
66 (add-hook 'pre-init-hook 'screen-initialize)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
67 (add-hook 'window-setup-hook 'screen-notice-user-settings)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
68
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
69 ;;; If we create the initial screen, this is it.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
70 (defvar screen-initial-screen nil)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
71
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
72 ;;; startup.el calls this function before loading the user's init
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
73 ;;; file - if there is no screen with a minibuffer open now, create
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
74 ;;; one to display messages while loading the init file.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
75 (defun screen-initialize ()
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
76
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
77 ;; Are we actually running under a window system at all?
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
78 (if (and window-system (not noninteractive))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
79 (let ((screens (screen-list)))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
80
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
81 ;; Look for a screen that has a minibuffer.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
82 (while (and screens
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
83 (or (eq (car screens) terminal-screen)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
84 (not (cdr (assq 'minibuffer
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
85 (screen-parameters
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
86 (car screens)))))))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
87 (setq screens (cdr screens)))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
88
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
89 ;; If there was none, then we need to create the opening screen.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
90 (or screens
428
a24ab90a6983 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 404
diff changeset
91 (setq default-minibuffer-screen
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
92 (setq screen-initial-screen
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
93 (new-screen initial-screen-alist))))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
94
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
95 ;; At this point, we know that we have a screen open, so we
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
96 ;; can delete the terminal screen.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
97 (delete-screen terminal-screen)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
98 (setq terminal-screen nil))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
99
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
100 ;; No, we're not running a window system. Arrange to cause errors.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
101 (setq screen-creation-function
404
f6c751f07c4a *** empty log message ***
Michael I. Bushnell <mib@gnu.org>
parents: 394
diff changeset
102 (function
f6c751f07c4a *** empty log message ***
Michael I. Bushnell <mib@gnu.org>
parents: 394
diff changeset
103 (lambda (parameters)
f6c751f07c4a *** empty log message ***
Michael I. Bushnell <mib@gnu.org>
parents: 394
diff changeset
104 (error
f6c751f07c4a *** empty log message ***
Michael I. Bushnell <mib@gnu.org>
parents: 394
diff changeset
105 "Can't create multiple screens without a window system."))))))
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
106
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
107 ;;; startup.el calls this function after loading the user's init file.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
108 ;;; If we created a minibuffer before knowing if we had permission, we
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
109 ;;; need to see if it should go away or change. Create a text screen
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
110 ;;; here.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
111 (defun screen-notice-user-settings ()
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
112 (if screen-initial-screen
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
113 (progn
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
114
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
115 ;; If the user wants a minibuffer-only screen, we'll have to
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
116 ;; make a new one; you can't remove or add a root window to/from
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
117 ;; an existing screen.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
118 (if (eq (cdr (or (assq 'minibuffer initial-screen-alist)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
119 '(minibuffer . t)))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
120 'only)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
121 (progn
428
a24ab90a6983 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 404
diff changeset
122 (setq default-minibuffer-screen
a24ab90a6983 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 404
diff changeset
123 (new-screen
a24ab90a6983 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 404
diff changeset
124 (append initial-screen-alist
a24ab90a6983 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 404
diff changeset
125 (screen-parameters screen-initial-screen))))
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
126 (delete-screen screen-initial-screen))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
127 (modify-screen-parameters screen-initial-screen
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
128 initial-screen-alist))))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
129
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
130 ;; Make sure the initial screen can be GC'd if it is ever deleted.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
131 (makunbound 'screen-initial-screen))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
132
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
133
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
134 ;;;; Creation of additional screens
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
135
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
136 ;;; Return some screen other than the current screen,
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
137 ;;; creating one if neccessary. Note that the minibuffer screen, if
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
138 ;;; separate, is not considered (see next-screen).
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
139 (defun get-screen ()
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
140 (let ((s (if (equal (next-screen (selected-screen)) (selected-screen))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
141 (new-screen)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
142 (next-screen (selected-screen)))))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
143 s))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
144
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
145 (defun next-multiscreen-window ()
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
146 "Select the next window, regardless of which screen it is on."
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
147 (interactive)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
148 (select-window (next-window (selected-window)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
149 (> (minibuffer-depth) 0)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
150 t)))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
151
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
152 (defun previous-multiscreen-window ()
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
153 "Select the previous window, regardless of which screen it is on."
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
154 (interactive)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
155 (select-window (previous-window (selected-window)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
156 (> (minibuffer-depth) 0)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
157 t)))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
158
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
159 (defun new-screen (&optional parameters)
539
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 428
diff changeset
160 "Create a new screen, displaying the current buffer.
b99d4eb7ed93 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 428
diff changeset
161
542
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
162 Optional argument PARAMETERS is an alist of parameters for the new
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
163 screen. Specifically, PARAMETERS is a list of pairs, each having one
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
164 of the following forms:
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
165
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
166 (name . STRING) - The screen should be named STRING.
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
167
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
168 (height . NUMBER) - The screen should be NUMBER text lines high. If
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
169 this parameter is present, the width parameter must also be
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
170 given.
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
171
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
172 (width . NUMBER) - The screen should be NUMBER characters in width.
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
173 If this parameter is present, the height parameter must also
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
174 be given.
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
175
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
176 (minibuffer . t) - the screen should have a minibuffer
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
177 (minibuffer . none) - the screen should have no minibuffer
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
178 (minibuffer . only) - the screen should contain only a minibuffer
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
179 (minibuffer . WINDOW) - the screen should use WINDOW as its minibuffer window.
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
180
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
181 (NAME . VALUE), specifying the parameter and the value it should have.
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
182 NAME should be one of the following symbols:
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
183 name VALUE
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
184
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
185 The documentation for the function x-create-screen describes
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
186 additional screen parameters that Emacs will recognize when running
119ba212b686 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 539
diff changeset
187 under the X Window System."
394
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
188 (interactive)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
189 (funcall screen-creation-function parameters))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
190
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
191
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
192 ;;;; Iconification
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
193
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
194 ;;; A possible enhancement for the below: if you iconify a surrogate
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
195 ;;; minibuffer screen, iconify all of its minibuffer's users too;
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
196 ;;; de-iconify them as a group. This will need to wait until screens
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
197 ;;; have mapping and unmapping hooks.
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
198
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
199 (defun iconify ()
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
200 "Iconify or deiconify the selected screen."
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
201 (interactive)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
202 (let ((screen (selected-screen)))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
203 (if (eq (screen-visible-p screen) t)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
204 (iconify-screen screen)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
205 (deiconify-screen screen))))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
206
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
207
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
208 ;;;; Convenience functions for dynamically changing screen parameters
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
209
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
210 (defun set-screen-height (h)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
211 (interactive "NHeight: ")
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
212 (let* ((screen (selected-screen))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
213 (width (cdr (assoc 'width (screen-parameters (selected-screen))))))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
214 (set-screen-size (selected-screen) width h)))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
215
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
216 (defun set-screen-width (w)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
217 (interactive "NWidth: ")
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
218 (let* ((screen (selected-screen))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
219 (height (cdr (assoc 'height (screen-parameters (selected-screen))))))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
220 (set-screen-size (selected-screen) w height)))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
221
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
222 (defun set-default-font (font-name)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
223 (interactive "sFont name: ")
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
224 (modify-screen-parameters (selected-screen)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
225 (list (cons 'font font-name))))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
226
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
227 (defun set-screen-background (color-name)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
228 (interactive "sColor: ")
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
229 (modify-screen-parameters (selected-screen)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
230 (list (cons 'background-color color-name))))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
231
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
232 (defun set-screen-foreground (color-name)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
233 (interactive "sColor: ")
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
234 (modify-screen-parameters (selected-screen)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
235 (list (cons 'foreground-color color-name))))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
236
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
237 (defun set-cursor-color (color-name)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
238 (interactive "sColor: ")
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
239 (modify-screen-parameters (selected-screen)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
240 (list (cons 'cursor-color color-name))))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
241
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
242 (defun set-pointer-color (color-name)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
243 (interactive "sColor: ")
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
244 (modify-screen-parameters (selected-screen)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
245 (list (cons 'mouse-color color-name))))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
246
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
247 (defun set-auto-raise (toggle)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
248 (interactive "xt or nil? ")
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
249 (modify-screen-parameters (selected-screen)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
250 (list (cons 'auto-raise toggle))))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
251
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
252 (defun set-auto-lower (toggle)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
253 (interactive "xt or nil? ")
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
254 (modify-screen-parameters (selected-screen)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
255 (list (cons 'auto-lower toggle))))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
256
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
257 (defun set-vertical-bar (toggle)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
258 (interactive "xt or nil? ")
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
259 (modify-screen-parameters (selected-screen)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
260 (list (cons 'vertical-scroll-bar toggle))))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
261
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
262 (defun set-horizontal-bar (toggle)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
263 (interactive "xt or nil? ")
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
264 (modify-screen-parameters (selected-screen)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
265 (list (cons 'horizontal-scroll-bar toggle))))
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
266
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
267 ;;;; Key bindings
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
268 (define-prefix-command 'ctl-x-3-map)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
269 (define-key ctl-x-map "3" 'ctl-x-3-map)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
270
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
271 (define-key ctl-x-3-map "2" 'new-screen)
5bd386d1a1cc Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
272 (define-key ctl-x-3-map "0" 'delete-screen)