diff options
| author | Jim Blandy | 1992-07-15 00:32:19 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-07-15 00:32:19 +0000 |
| commit | dc6d96816db5f4f7b484e5e394501e5724c2d02f (patch) | |
| tree | bcc0d5ce3ede2cf3b3da4d8b90c47723bdd82f86 | |
| parent | e6dd9901bb92e21908bb8c3abf8cdfdcc54a6dd7 (diff) | |
| download | emacs-dc6d96816db5f4f7b484e5e394501e5724c2d02f.tar.gz emacs-dc6d96816db5f4f7b484e5e394501e5724c2d02f.zip | |
*** empty log message ***
| -rw-r--r-- | lisp/abbrevlist.el | 2 | ||||
| -rw-r--r-- | lisp/buff-menu.el | 6 | ||||
| -rw-r--r-- | lisp/calendar/appt.el | 4 | ||||
| -rw-r--r-- | lisp/frame.el | 312 | ||||
| -rw-r--r-- | src/frame.c | 15 |
5 files changed, 185 insertions, 154 deletions
diff --git a/lisp/abbrevlist.el b/lisp/abbrevlist.el index ee77462907e..520ce29b201 100644 --- a/lisp/abbrevlist.el +++ b/lisp/abbrevlist.el | |||
| @@ -32,7 +32,7 @@ | |||
| 32 | abbrev-table) | 32 | abbrev-table) |
| 33 | (setq abbrev-list (sort abbrev-list 'string-lessp)) | 33 | (setq abbrev-list (sort abbrev-list 'string-lessp)) |
| 34 | (while abbrev-list | 34 | (while abbrev-list |
| 35 | (if (> (+ first-column 40) (screen-width)) | 35 | (if (> (+ first-column 40) (frame-width)) |
| 36 | (progn | 36 | (progn |
| 37 | (insert "\n") | 37 | (insert "\n") |
| 38 | (setq first-column 0))) | 38 | (setq first-column 0))) |
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index 7053e78448f..1a83f4f8664 100644 --- a/lisp/buff-menu.el +++ b/lisp/buff-menu.el | |||
| @@ -61,7 +61,7 @@ Letters do not insert themselves; instead, they are commands. | |||
| 61 | \\[Buffer-menu-mark] -- mark buffer to be displayed. | 61 | \\[Buffer-menu-mark] -- mark buffer to be displayed. |
| 62 | \\[Buffer-menu-select] -- select buffer of line point is on. | 62 | \\[Buffer-menu-select] -- select buffer of line point is on. |
| 63 | Also show buffers marked with m in other windows. | 63 | Also show buffers marked with m in other windows. |
| 64 | \\[Buffer-menu-1-window] -- select that buffer in full-screen window. | 64 | \\[Buffer-menu-1-window] -- select that buffer in full-frame window. |
| 65 | \\[Buffer-menu-2-window] -- select that buffer in one window, | 65 | \\[Buffer-menu-2-window] -- select that buffer in one window, |
| 66 | together with buffer selected before this one in another window. | 66 | together with buffer selected before this one in another window. |
| 67 | \\[Buffer-menu-this-window] -- select that buffer in place of the buffer menu buffer. | 67 | \\[Buffer-menu-this-window] -- select that buffer in place of the buffer menu buffer. |
| @@ -239,7 +239,7 @@ You can mark buffers with the \\<Buffer-menu-mode-map>\\[Buffer-menu-mark] comma | |||
| 239 | (insert ?\ )) | 239 | (insert ?\ )) |
| 240 | (or (eq tem buff) (memq tem others) (setq others (cons tem others)))) | 240 | (or (eq tem buff) (memq tem others) (setq others (cons tem others)))) |
| 241 | (setq others (nreverse others) | 241 | (setq others (nreverse others) |
| 242 | tem (/ (1- (screen-height)) (1+ (length others)))) | 242 | tem (/ (1- (frame-height)) (1+ (length others)))) |
| 243 | (delete-other-windows) | 243 | (delete-other-windows) |
| 244 | (switch-to-buffer buff) | 244 | (switch-to-buffer buff) |
| 245 | (or (eq menu buff) | 245 | (or (eq menu buff) |
| @@ -260,7 +260,7 @@ You can mark buffers with the \\<Buffer-menu-mode-map>\\[Buffer-menu-mark] comma | |||
| 260 | (error "Specified buffer has no file")))) | 260 | (error "Specified buffer has no file")))) |
| 261 | 261 | ||
| 262 | (defun Buffer-menu-1-window () | 262 | (defun Buffer-menu-1-window () |
| 263 | "Select this line's buffer, alone, in full screen." | 263 | "Select this line's buffer, alone, in full frame." |
| 264 | (interactive) | 264 | (interactive) |
| 265 | (switch-to-buffer (Buffer-menu-buffer t)) | 265 | (switch-to-buffer (Buffer-menu-buffer t)) |
| 266 | (bury-buffer (other-buffer)) | 266 | (bury-buffer (other-buffer)) |
diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el index 2376d76a867..3f2778be604 100644 --- a/lisp/calendar/appt.el +++ b/lisp/calendar/appt.el | |||
| @@ -291,7 +291,7 @@ Therefore, you need to have `(display-time)' in your .emacs file." | |||
| 291 | ;; Make sure we're not in the minibuffer | 291 | ;; Make sure we're not in the minibuffer |
| 292 | ;; before splitting the window. | 292 | ;; before splitting the window. |
| 293 | 293 | ||
| 294 | (if (= (screen-height) | 294 | (if (= (frame-height) |
| 295 | (nth 3 (window-edges (selected-window)))) | 295 | (nth 3 (window-edges (selected-window)))) |
| 296 | nil | 296 | nil |
| 297 | (appt-select-lowest-window) | 297 | (appt-select-lowest-window) |
| @@ -313,7 +313,7 @@ Therefore, you need to have `(display-time)' in your .emacs file." | |||
| 313 | (beep 1)) | 313 | (beep 1)) |
| 314 | (kill-buffer appt-disp-buf)))) | 314 | (kill-buffer appt-disp-buf)))) |
| 315 | 315 | ||
| 316 | ;; Select the lowest window on the screen. | 316 | ;; Select the lowest window on the frame. |
| 317 | (defun appt-select-lowest-window () | 317 | (defun appt-select-lowest-window () |
| 318 | (setq lowest-window (selected-window)) | 318 | (setq lowest-window (selected-window)) |
| 319 | (let* ((bottom-edge (car (cdr (cdr (cdr (window-edges)))))) | 319 | (let* ((bottom-edge (car (cdr (cdr (cdr (window-edges)))))) |
diff --git a/lisp/frame.el b/lisp/frame.el index a040e2ea6e3..e88bbc64b0c 100644 --- a/lisp/frame.el +++ b/lisp/frame.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; screen.el --- multi-screen management independent of window systems. | 1 | ;;; frame.el --- multi-frame management independent of window systems. |
| 2 | 2 | ||
| 3 | ;;;; Copyright (C) 1990, 1992 Free Software Foundation, Inc. | 3 | ;;;; Copyright (C) 1990, 1992 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -18,292 +18,310 @@ | |||
| 18 | ;;; along with GNU Emacs; see the file COPYING. If not, write to | 18 | ;;; along with GNU Emacs; see the file COPYING. If not, write to |
| 19 | ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | 19 | ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
| 20 | 20 | ||
| 21 | (defvar screen-creation-function nil | 21 | (defvar frame-creation-function nil |
| 22 | "Window-system dependent function to call to create a new screen. | 22 | "Window-system dependent function to call to create a new frame. |
| 23 | The window system startup file should set this to its screen creation | 23 | The window system startup file should set this to its frame creation |
| 24 | function, which should take an alist of parameters as its argument.") | 24 | function, which should take an alist of parameters as its argument.") |
| 25 | 25 | ||
| 26 | ;;; The default value for this must ask for a minibuffer. There must | 26 | ;;; The default value for this must ask for a minibuffer. There must |
| 27 | ;;; always exist a screen with a minibuffer, and after we delete the | 27 | ;;; always exist a frame with a minibuffer, and after we delete the |
| 28 | ;;; terminal screen, this will be the only screen. | 28 | ;;; terminal frame, this will be the only frame. |
| 29 | (defvar initial-screen-alist '((minibuffer . nil)) | 29 | (defvar initial-frame-alist '((minibuffer . nil)) |
| 30 | "Alist of values used when creating the initial emacs text screen. | 30 | "Alist of values used when creating the initial emacs text frame. |
| 31 | These may be set in your init file, like this: | 31 | These may be set in your init file, like this: |
| 32 | (setq initial-screen-alist '((top . 1) (left . 1) (width . 80) (height . 55))) | 32 | (setq initial-frame-alist '((top . 1) (left . 1) (width . 80) (height . 55))) |
| 33 | These supercede the values given in screen-default-alist.") | 33 | These supercede the values given in frame-default-alist.") |
| 34 | 34 | ||
| 35 | (defvar minibuffer-screen-alist nil | 35 | (defvar minibuffer-frame-alist nil |
| 36 | "Alist of values to apply to a minibuffer screen. | 36 | "Alist of values to apply to a minibuffer frame. |
| 37 | These may be set in your init file, like this: | 37 | These may be set in your init file, like this: |
| 38 | (setq minibuffer-screen-alist | 38 | (setq minibuffer-frame-alist |
| 39 | '((top . 1) (left . 1) (width . 80) (height . 1))) | 39 | '((top . 1) (left . 1) (width . 80) (height . 1))) |
| 40 | These supercede the values given in default-screen-alist.") | 40 | These supercede the values given in default-frame-alist.") |
| 41 | 41 | ||
| 42 | (defvar pop-up-screen-alist nil | 42 | (defvar pop-up-frame-alist nil |
| 43 | "Alist of values used when creating pop-up screens. | 43 | "Alist of values used when creating pop-up frames. |
| 44 | Pop-up screens are used for completions, help, and the like. | 44 | Pop-up frames are used for completions, help, and the like. |
| 45 | This variable can be set in your init file, like this: | 45 | This variable can be set in your init file, like this: |
| 46 | (setq pop-up-screen-alist '((width . 80) (height . 20))) | 46 | (setq pop-up-frame-alist '((width . 80) (height . 20))) |
| 47 | These supercede the values given in default-screen-alist.") | 47 | These supercede the values given in default-frame-alist.") |
| 48 | 48 | ||
| 49 | (setq pop-up-screen-function | 49 | (setq pop-up-frame-function |
| 50 | (function (lambda () | 50 | (function (lambda () |
| 51 | (new-screen pop-up-screen-alist)))) | 51 | (new-frame pop-up-frame-alist)))) |
| 52 | 52 | ||
| 53 | 53 | ||
| 54 | ;;;; Arrangement of screens at startup | 54 | ;;;; Arrangement of frames at startup |
| 55 | 55 | ||
| 56 | ;;; 1) Load the window system startup file from the lisp library and read the | 56 | ;;; 1) Load the window system startup file from the lisp library and read the |
| 57 | ;;; high-priority arguments (-q and the like). The window system startup | 57 | ;;; high-priority arguments (-q and the like). The window system startup |
| 58 | ;;; file should create any screens specified in the window system defaults. | 58 | ;;; file should create any frames specified in the window system defaults. |
| 59 | ;;; | 59 | ;;; |
| 60 | ;;; 2) If no screens have been opened, we open an initial text screen. | 60 | ;;; 2) If no frames have been opened, we open an initial text frame. |
| 61 | ;;; | 61 | ;;; |
| 62 | ;;; 3) Once the init file is done, we apply any newly set parameters | 62 | ;;; 3) Once the init file is done, we apply any newly set parameters |
| 63 | ;;; in initial-screen-alist to the screen. | 63 | ;;; in initial-frame-alist to the frame. |
| 64 | 64 | ||
| 65 | (add-hook 'before-init-hook 'screen-initialize) | 65 | (add-hook 'before-init-hook 'frame-initialize) |
| 66 | (add-hook 'window-setup-hook 'screen-notice-user-settings) | 66 | (add-hook 'window-setup-hook 'frame-notice-user-settings) |
| 67 | 67 | ||
| 68 | ;;; If we create the initial screen, this is it. | 68 | ;;; If we create the initial frame, this is it. |
| 69 | (defvar screen-initial-screen nil) | 69 | (defvar frame-initial-frame nil) |
| 70 | 70 | ||
| 71 | ;;; startup.el calls this function before loading the user's init | 71 | ;;; startup.el calls this function before loading the user's init |
| 72 | ;;; file - if there is no screen with a minibuffer open now, create | 72 | ;;; file - if there is no frame with a minibuffer open now, create |
| 73 | ;;; one to display messages while loading the init file. | 73 | ;;; one to display messages while loading the init file. |
| 74 | (defun screen-initialize () | 74 | (defun frame-initialize () |
| 75 | 75 | ||
| 76 | ;; Are we actually running under a window system at all? | 76 | ;; Are we actually running under a window system at all? |
| 77 | (if (and window-system (not noninteractive)) | 77 | (if (and window-system (not noninteractive)) |
| 78 | (let ((screens (screen-list))) | 78 | (let ((frames (frame-list))) |
| 79 | 79 | ||
| 80 | ;; Look for a screen that has a minibuffer. | 80 | ;; Look for a frame that has a minibuffer. |
| 81 | (while (and screens | 81 | (while (and frames |
| 82 | (or (eq (car screens) terminal-screen) | 82 | (or (eq (car frames) terminal-frame) |
| 83 | (not (cdr (assq 'minibuffer | 83 | (not (cdr (assq 'minibuffer |
| 84 | (screen-parameters | 84 | (frame-parameters |
| 85 | (car screens))))))) | 85 | (car frames))))))) |
| 86 | (setq screens (cdr screens))) | 86 | (setq frames (cdr frames))) |
| 87 | 87 | ||
| 88 | ;; If there was none, then we need to create the opening screen. | 88 | ;; If there was none, then we need to create the opening frame. |
| 89 | (or screens | 89 | (or frames |
| 90 | (setq default-minibuffer-screen | 90 | (setq default-minibuffer-frame |
| 91 | (setq screen-initial-screen | 91 | (setq frame-initial-frame |
| 92 | (new-screen initial-screen-alist)))) | 92 | (new-frame initial-frame-alist)))) |
| 93 | 93 | ||
| 94 | ;; At this point, we know that we have a screen open, so we | 94 | ;; At this point, we know that we have a frame open, so we |
| 95 | ;; can delete the terminal screen. | 95 | ;; can delete the terminal frame. |
| 96 | (delete-screen terminal-screen) | 96 | (delete-frame terminal-frame) |
| 97 | (setq terminal-screen nil)) | 97 | (setq terminal-frame nil)) |
| 98 | 98 | ||
| 99 | ;; No, we're not running a window system. Arrange to cause errors. | 99 | ;; No, we're not running a window system. Arrange to cause errors. |
| 100 | (setq screen-creation-function | 100 | (setq frame-creation-function |
| 101 | (function | 101 | (function |
| 102 | (lambda (parameters) | 102 | (lambda (parameters) |
| 103 | (error | 103 | (error |
| 104 | "Can't create multiple screens without a window system.")))))) | 104 | "Can't create multiple frames without a window system.")))))) |
| 105 | 105 | ||
| 106 | ;;; startup.el calls this function after loading the user's init file. | 106 | ;;; startup.el calls this function after loading the user's init file. |
| 107 | ;;; If we created a minibuffer before knowing if we had permission, we | 107 | ;;; If we created a minibuffer before knowing if we had permission, we |
| 108 | ;;; need to see if it should go away or change. Create a text screen | 108 | ;;; need to see if it should go away or change. Create a text frame |
| 109 | ;;; here. | 109 | ;;; here. |
| 110 | (defun screen-notice-user-settings () | 110 | (defun frame-notice-user-settings () |
| 111 | (if screen-initial-screen | 111 | (if frame-initial-frame |
| 112 | (progn | 112 | (progn |
| 113 | 113 | ||
| 114 | ;; If the user wants a minibuffer-only screen, we'll have to | 114 | ;; If the user wants a minibuffer-only frame, we'll have to |
| 115 | ;; make a new one; you can't remove or add a root window to/from | 115 | ;; make a new one; you can't remove or add a root window to/from |
| 116 | ;; an existing screen. | 116 | ;; an existing frame. |
| 117 | (if (eq (cdr (or (assq 'minibuffer initial-screen-alist) | 117 | (if (eq (cdr (or (assq 'minibuffer initial-frame-alist) |
| 118 | '(minibuffer . t))) | 118 | '(minibuffer . t))) |
| 119 | 'only) | 119 | 'only) |
| 120 | (progn | 120 | (progn |
| 121 | (setq default-minibuffer-screen | 121 | (setq default-minibuffer-frame |
| 122 | (new-screen | 122 | (new-frame |
| 123 | (append initial-screen-alist | 123 | (append initial-frame-alist |
| 124 | (screen-parameters screen-initial-screen)))) | 124 | (frame-parameters frame-initial-frame)))) |
| 125 | (delete-screen screen-initial-screen)) | 125 | (delete-frame frame-initial-frame)) |
| 126 | (modify-screen-parameters screen-initial-screen | 126 | (modify-frame-parameters frame-initial-frame |
| 127 | initial-screen-alist)))) | 127 | initial-frame-alist)))) |
| 128 | 128 | ||
| 129 | ;; Make sure the initial screen can be GC'd if it is ever deleted. | 129 | ;; Make sure the initial frame can be GC'd if it is ever deleted. |
| 130 | (makunbound 'screen-initial-screen)) | 130 | (makunbound 'frame-initial-frame)) |
| 131 | 131 | ||
| 132 | 132 | ||
| 133 | ;;;; Creation of additional screens | 133 | ;;;; Creation of additional frames |
| 134 | 134 | ||
| 135 | ;;; Return some screen other than the current screen, | 135 | ;;; Return some frame other than the current frame, |
| 136 | ;;; creating one if neccessary. Note that the minibuffer screen, if | 136 | ;;; creating one if neccessary. Note that the minibuffer frame, if |
| 137 | ;;; separate, is not considered (see next-screen). | 137 | ;;; separate, is not considered (see next-frame). |
| 138 | (defun get-screen () | 138 | (defun get-frame () |
| 139 | (let ((s (if (equal (next-screen (selected-screen)) (selected-screen)) | 139 | (let ((s (if (equal (next-frame (selected-frame)) (selected-frame)) |
| 140 | (new-screen) | 140 | (new-frame) |
| 141 | (next-screen (selected-screen))))) | 141 | (next-frame (selected-frame))))) |
| 142 | s)) | 142 | s)) |
| 143 | 143 | ||
| 144 | (defun next-multiscreen-window () | 144 | (defun next-multiframe-window () |
| 145 | "Select the next window, regardless of which screen it is on." | 145 | "Select the next window, regardless of which frame it is on." |
| 146 | (interactive) | 146 | (interactive) |
| 147 | (select-window (next-window (selected-window) | 147 | (select-window (next-window (selected-window) |
| 148 | (> (minibuffer-depth) 0) | 148 | (> (minibuffer-depth) 0) |
| 149 | t))) | 149 | t))) |
| 150 | 150 | ||
| 151 | (defun previous-multiscreen-window () | 151 | (defun previous-multiframe-window () |
| 152 | "Select the previous window, regardless of which screen it is on." | 152 | "Select the previous window, regardless of which frame it is on." |
| 153 | (interactive) | 153 | (interactive) |
| 154 | (select-window (previous-window (selected-window) | 154 | (select-window (previous-window (selected-window) |
| 155 | (> (minibuffer-depth) 0) | 155 | (> (minibuffer-depth) 0) |
| 156 | t))) | 156 | t))) |
| 157 | 157 | ||
| 158 | (defun new-screen (&optional parameters) | 158 | (defun new-frame (&optional parameters) |
| 159 | "Create a new screen, displaying the current buffer. | 159 | "Create a new frame, displaying the current buffer. |
| 160 | 160 | ||
| 161 | Optional argument PARAMETERS is an alist of parameters for the new | 161 | Optional argument PARAMETERS is an alist of parameters for the new |
| 162 | screen. Specifically, PARAMETERS is a list of pairs, each having one | 162 | frame. Specifically, PARAMETERS is a list of pairs, each having one |
| 163 | of the following forms: | 163 | of the following forms: |
| 164 | 164 | ||
| 165 | (name . STRING) - The screen should be named STRING. | 165 | (name . STRING) - The frame should be named STRING. |
| 166 | 166 | ||
| 167 | (height . NUMBER) - The screen should be NUMBER text lines high. If | 167 | (height . NUMBER) - The frame should be NUMBER text lines high. If |
| 168 | this parameter is present, the width parameter must also be | 168 | this parameter is present, the width parameter must also be |
| 169 | given. | 169 | given. |
| 170 | 170 | ||
| 171 | (width . NUMBER) - The screen should be NUMBER characters in width. | 171 | (width . NUMBER) - The frame should be NUMBER characters in width. |
| 172 | If this parameter is present, the height parameter must also | 172 | If this parameter is present, the height parameter must also |
| 173 | be given. | 173 | be given. |
| 174 | 174 | ||
| 175 | (minibuffer . t) - the screen should have a minibuffer | 175 | (minibuffer . t) - the frame should have a minibuffer |
| 176 | (minibuffer . none) - the screen should have no minibuffer | 176 | (minibuffer . none) - the frame should have no minibuffer |
| 177 | (minibuffer . only) - the screen should contain only a minibuffer | 177 | (minibuffer . only) - the frame should contain only a minibuffer |
| 178 | (minibuffer . WINDOW) - the screen should use WINDOW as its minibuffer window. | 178 | (minibuffer . WINDOW) - the frame should use WINDOW as its minibuffer window. |
| 179 | 179 | ||
| 180 | (NAME . VALUE), specifying the parameter and the value it should have. | 180 | (NAME . VALUE), specifying the parameter and the value it should have. |
| 181 | NAME should be one of the following symbols: | 181 | NAME should be one of the following symbols: |
| 182 | name VALUE | 182 | name VALUE |
| 183 | 183 | ||
| 184 | The documentation for the function x-create-screen describes | 184 | The documentation for the function x-create-frame describes |
| 185 | additional screen parameters that Emacs will recognize when running | 185 | additional frame parameters that Emacs will recognize when running |
| 186 | under the X Window System." | 186 | under the X Window System." |
| 187 | (interactive) | 187 | (interactive) |
| 188 | (funcall screen-creation-function parameters)) | 188 | (funcall frame-creation-function parameters)) |
| 189 | 189 | ||
| 190 | 190 | ||
| 191 | ;;;; Iconification | 191 | ;;;; Iconification |
| 192 | 192 | ||
| 193 | ;;; A possible enhancement for the below: if you iconify a surrogate | 193 | ;;; A possible enhancement for the below: if you iconify a surrogate |
| 194 | ;;; minibuffer screen, iconify all of its minibuffer's users too; | 194 | ;;; minibuffer frame, iconify all of its minibuffer's users too; |
| 195 | ;;; de-iconify them as a group. This will need to wait until screens | 195 | ;;; de-iconify them as a group. This will need to wait until frames |
| 196 | ;;; have mapping and unmapping hooks. | 196 | ;;; have mapping and unmapping hooks. |
| 197 | 197 | ||
| 198 | (defun iconify () | 198 | (defun iconify () |
| 199 | "Iconify or deiconify the selected screen." | 199 | "Iconify or deiconify the selected frame." |
| 200 | (interactive) | 200 | (interactive) |
| 201 | (let ((screen (selected-screen))) | 201 | (let ((frame (selected-frame))) |
| 202 | (if (eq (screen-visible-p screen) t) | 202 | (if (eq (frame-visible-p frame) t) |
| 203 | (iconify-screen screen) | 203 | (iconify-frame frame) |
| 204 | (make-screen-visible screen)))) | 204 | (make-frame-visible frame)))) |
| 205 | 205 | ||
| 206 | 206 | ||
| 207 | ;;;; Screen configurations | 207 | ;;;; Frame configurations |
| 208 | 208 | ||
| 209 | (defun current-screen-configuration () | 209 | (defun current-frame-configuration () |
| 210 | "Return a list describing the positions and states of all screens. | 210 | "Return a list describing the positions and states of all frames. |
| 211 | Each element is a list of the form (SCREEN ALIST WINDOW-CONFIG), where | 211 | Each element is a list of the form (FRAME ALIST WINDOW-CONFIG), where |
| 212 | SCREEN is a screen object, ALIST is an association list specifying | 212 | FRAME is a frame object, ALIST is an association list specifying |
| 213 | some of SCREEN's parameters, and WINDOW-CONFIG is a window | 213 | some of FRAME's parameters, and WINDOW-CONFIG is a window |
| 214 | configuration object for SCREEN." | 214 | configuration object for FRAME." |
| 215 | (mapcar (function | 215 | (mapcar (function |
| 216 | (lambda (screen) | 216 | (lambda (frame) |
| 217 | (list screen | 217 | (list frame |
| 218 | (screen-parameters screen) | 218 | (frame-parameters frame) |
| 219 | (current-window-configuration screen)))) | 219 | (current-window-configuration frame)))) |
| 220 | (screen-list))) | 220 | (frame-list))) |
| 221 | 221 | ||
| 222 | (defun set-screen-configuration (configuration) | 222 | (defun set-frame-configuration (configuration) |
| 223 | "Restore the screens to the state described by CONFIGURATION. | 223 | "Restore the frames to the state described by CONFIGURATION. |
| 224 | Each screen listed in CONFIGURATION has its position, size, window | 224 | Each frame listed in CONFIGURATION has its position, size, window |
| 225 | configuration, and other parameters set as specified in CONFIGURATION." | 225 | configuration, and other parameters set as specified in CONFIGURATION." |
| 226 | (let (screens-to-delete) | 226 | (let (frames-to-delete) |
| 227 | (mapcar (function | 227 | (mapcar (function |
| 228 | (lambda (screen) | 228 | (lambda (frame) |
| 229 | (let ((parameters (assq screen configuration))) | 229 | (let ((parameters (assq frame configuration))) |
| 230 | (if parameters | 230 | (if parameters |
| 231 | (progn | 231 | (progn |
| 232 | (modify-screen-parameters screen (nth 1 parameters)) | 232 | (modify-frame-parameters frame (nth 1 parameters)) |
| 233 | (set-window-configuration (nth 2 parameters))) | 233 | (set-window-configuration (nth 2 parameters))) |
| 234 | (setq screens-to-delete (cons screen screens-to-delete)))))) | 234 | (setq frames-to-delete (cons frame frames-to-delete)))))) |
| 235 | (screen-list)) | 235 | (frame-list)) |
| 236 | (mapcar 'delete-screen screens-to-delete))) | 236 | (mapcar 'delete-frame frames-to-delete))) |
| 237 | 237 | ||
| 238 | 238 | ||
| 239 | ;;;; Convenience functions for dynamically changing screen parameters | 239 | ;;;; Convenience functions for accessing and interactively changing |
| 240 | ;;;; frame parameters. | ||
| 240 | 241 | ||
| 241 | (defun set-screen-height (h) | 242 | (defun frame-width (&optional frame) |
| 243 | "Return number of lines available for display on FRAME. | ||
| 244 | If FRAME is omitted, describe the currently selected frame." | ||
| 245 | (cdr (assq 'width (frame-parameters frame)))) | ||
| 246 | |||
| 247 | (defun frame-width (&optional frame) | ||
| 248 | "Return number of columns available for display on FRAME. | ||
| 249 | If FRAME is omitted, describe the currently selected frame." | ||
| 250 | (cdr (assq 'height (frame-parameters frame)))) | ||
| 251 | |||
| 252 | (defun set-frame-height (h) | ||
| 242 | (interactive "NHeight: ") | 253 | (interactive "NHeight: ") |
| 243 | (let* ((screen (selected-screen)) | 254 | (let* ((frame (selected-frame)) |
| 244 | (width (cdr (assoc 'width (screen-parameters (selected-screen)))))) | 255 | (width (cdr (assoc 'width (frame-parameters (selected-frame)))))) |
| 245 | (set-screen-size (selected-screen) width h))) | 256 | (set-frame-size (selected-frame) width h))) |
| 246 | 257 | ||
| 247 | (defun set-screen-width (w) | 258 | (defun set-frame-width (w) |
| 248 | (interactive "NWidth: ") | 259 | (interactive "NWidth: ") |
| 249 | (let* ((screen (selected-screen)) | 260 | (let* ((frame (selected-frame)) |
| 250 | (height (cdr (assoc 'height (screen-parameters (selected-screen)))))) | 261 | (height (cdr (assoc 'height (frame-parameters (selected-frame)))))) |
| 251 | (set-screen-size (selected-screen) w height))) | 262 | (set-frame-size (selected-frame) w height))) |
| 252 | 263 | ||
| 253 | (defun set-default-font (font-name) | 264 | (defun set-default-font (font-name) |
| 254 | (interactive "sFont name: ") | 265 | (interactive "sFont name: ") |
| 255 | (modify-screen-parameters (selected-screen) | 266 | (modify-frame-parameters (selected-frame) |
| 256 | (list (cons 'font font-name)))) | 267 | (list (cons 'font font-name)))) |
| 257 | 268 | ||
| 258 | (defun set-screen-background (color-name) | 269 | (defun set-frame-background (color-name) |
| 259 | (interactive "sColor: ") | 270 | (interactive "sColor: ") |
| 260 | (modify-screen-parameters (selected-screen) | 271 | (modify-frame-parameters (selected-frame) |
| 261 | (list (cons 'background-color color-name)))) | 272 | (list (cons 'background-color color-name)))) |
| 262 | 273 | ||
| 263 | (defun set-screen-foreground (color-name) | 274 | (defun set-frame-foreground (color-name) |
| 264 | (interactive "sColor: ") | 275 | (interactive "sColor: ") |
| 265 | (modify-screen-parameters (selected-screen) | 276 | (modify-frame-parameters (selected-frame) |
| 266 | (list (cons 'foreground-color color-name)))) | 277 | (list (cons 'foreground-color color-name)))) |
| 267 | 278 | ||
| 268 | (defun set-cursor-color (color-name) | 279 | (defun set-cursor-color (color-name) |
| 269 | (interactive "sColor: ") | 280 | (interactive "sColor: ") |
| 270 | (modify-screen-parameters (selected-screen) | 281 | (modify-frame-parameters (selected-frame) |
| 271 | (list (cons 'cursor-color color-name)))) | 282 | (list (cons 'cursor-color color-name)))) |
| 272 | 283 | ||
| 273 | (defun set-pointer-color (color-name) | 284 | (defun set-pointer-color (color-name) |
| 274 | (interactive "sColor: ") | 285 | (interactive "sColor: ") |
| 275 | (modify-screen-parameters (selected-screen) | 286 | (modify-frame-parameters (selected-frame) |
| 276 | (list (cons 'mouse-color color-name)))) | 287 | (list (cons 'mouse-color color-name)))) |
| 277 | 288 | ||
| 278 | (defun set-auto-raise (toggle) | 289 | (defun set-auto-raise (toggle) |
| 279 | (interactive "xt or nil? ") | 290 | (interactive "xt or nil? ") |
| 280 | (modify-screen-parameters (selected-screen) | 291 | (modify-frame-parameters (selected-frame) |
| 281 | (list (cons 'auto-raise toggle)))) | 292 | (list (cons 'auto-raise toggle)))) |
| 282 | 293 | ||
| 283 | (defun set-auto-lower (toggle) | 294 | (defun set-auto-lower (toggle) |
| 284 | (interactive "xt or nil? ") | 295 | (interactive "xt or nil? ") |
| 285 | (modify-screen-parameters (selected-screen) | 296 | (modify-frame-parameters (selected-frame) |
| 286 | (list (cons 'auto-lower toggle)))) | 297 | (list (cons 'auto-lower toggle)))) |
| 287 | 298 | ||
| 288 | (defun set-vertical-bar (toggle) | 299 | (defun set-vertical-bar (toggle) |
| 289 | (interactive "xt or nil? ") | 300 | (interactive "xt or nil? ") |
| 290 | (modify-screen-parameters (selected-screen) | 301 | (modify-frame-parameters (selected-frame) |
| 291 | (list (cons 'vertical-scroll-bar toggle)))) | 302 | (list (cons 'vertical-scroll-bar toggle)))) |
| 292 | 303 | ||
| 293 | (defun set-horizontal-bar (toggle) | 304 | (defun set-horizontal-bar (toggle) |
| 294 | (interactive "xt or nil? ") | 305 | (interactive "xt or nil? ") |
| 295 | (modify-screen-parameters (selected-screen) | 306 | (modify-frame-parameters (selected-frame) |
| 296 | (list (cons 'horizontal-scroll-bar toggle)))) | 307 | (list (cons 'horizontal-scroll-bar toggle)))) |
| 297 | 308 | ||
| 309 | ;;;; Aliases for backward compatibility with Emacs 18. | ||
| 310 | (fset 'screen-height 'frame-height) | ||
| 311 | (fset 'screen-width 'frame-width) | ||
| 312 | (fset 'set-screen-width 'set-frame-width) | ||
| 313 | (fset 'set-screen-height 'set-frame-height) | ||
| 314 | |||
| 315 | |||
| 298 | ;;;; Key bindings | 316 | ;;;; Key bindings |
| 299 | (defvar ctl-x-5-map (make-sparse-keymap) | 317 | (defvar ctl-x-5-map (make-sparse-keymap) |
| 300 | "Keymap for screen commands.") | 318 | "Keymap for frame commands.") |
| 301 | (fset 'ctl-x-5-prefix ctl-x-5-map) | 319 | (fset 'ctl-x-5-prefix ctl-x-5-map) |
| 302 | (define-key ctl-x-map "5" 'ctl-x-5-prefix) | 320 | (define-key ctl-x-map "5" 'ctl-x-5-prefix) |
| 303 | 321 | ||
| 304 | (define-key ctl-x-5-map "2" 'new-screen) | 322 | (define-key ctl-x-5-map "2" 'new-frame) |
| 305 | (define-key ctl-x-5-map "0" 'delete-screen) | 323 | (define-key ctl-x-5-map "0" 'delete-frame) |
| 306 | 324 | ||
| 307 | (provide 'screen) | 325 | (provide 'frame) |
| 308 | 326 | ||
| 309 | ;;; screen.el ends here | 327 | ;;; frame.el ends here |
diff --git a/src/frame.c b/src/frame.c index 8482d1b3d14..57ffeda04b2 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | |||
| 1 | /* Generic frame functions. | 2 | /* Generic frame functions. |
| 2 | Copyright (C) 1989, 1992 Free Software Foundation. | 3 | Copyright (C) 1989, 1992 Free Software Foundation. |
| 3 | 4 | ||
| @@ -884,7 +885,8 @@ store_frame_param (f, prop, val) | |||
| 884 | DEFUN ("frame-parameters", Fframe_parameters, Sframe_parameters, 0, 1, 0, | 885 | DEFUN ("frame-parameters", Fframe_parameters, Sframe_parameters, 0, 1, 0, |
| 885 | "Return the parameters-alist of frame FRAME.\n\ | 886 | "Return the parameters-alist of frame FRAME.\n\ |
| 886 | It is a list of elements of the form (PARM . VALUE), where PARM is a symbol.\n\ | 887 | It is a list of elements of the form (PARM . VALUE), where PARM is a symbol.\n\ |
| 887 | The meaningful PARMs depend on the kind of frame.") | 888 | The meaningful PARMs depend on the kind of frame.\n\ |
| 889 | If FRAME is omitted, return information on the currently selected frame.") | ||
| 888 | (frame) | 890 | (frame) |
| 889 | Lisp_Object frame; | 891 | Lisp_Object frame; |
| 890 | { | 892 | { |
| @@ -953,6 +955,11 @@ The meaningful PARMs depend on the kind of frame; undefined PARMs are ignored.") | |||
| 953 | } | 955 | } |
| 954 | 956 | ||
| 955 | 957 | ||
| 958 | #if 0 | ||
| 959 | /* This function isn't useful enough by itself to include; we need to | ||
| 960 | add functions to allow the user to find the size of a font before | ||
| 961 | this is actually useful. */ | ||
| 962 | |||
| 956 | DEFUN ("frame-pixel-size", Fframe_pixel_size, | 963 | DEFUN ("frame-pixel-size", Fframe_pixel_size, |
| 957 | Sframe_pixel_size, 1, 1, 0, | 964 | Sframe_pixel_size, 1, 1, 0, |
| 958 | "Return a cons (width . height) of FRAME's size in pixels.") | 965 | "Return a cons (width . height) of FRAME's size in pixels.") |
| @@ -968,6 +975,10 @@ DEFUN ("frame-pixel-size", Fframe_pixel_size, | |||
| 968 | return Fcons (make_number (x_pixel_width (f)), | 975 | return Fcons (make_number (x_pixel_width (f)), |
| 969 | make_number (x_pixel_height (f))); | 976 | make_number (x_pixel_height (f))); |
| 970 | } | 977 | } |
| 978 | #endif | ||
| 979 | |||
| 980 | #if 0 | ||
| 981 | /* These functions have no C callers, and can be written nicely in lisp. */ | ||
| 971 | 982 | ||
| 972 | DEFUN ("frame-height", Fframe_height, Sframe_height, 0, 0, 0, | 983 | DEFUN ("frame-height", Fframe_height, Sframe_height, 0, 0, 0, |
| 973 | "Return number of lines available for display on selected frame.") | 984 | "Return number of lines available for display on selected frame.") |
| @@ -982,6 +993,7 @@ DEFUN ("frame-width", Fframe_width, Sframe_width, 0, 0, 0, | |||
| 982 | { | 993 | { |
| 983 | return make_number (FRAME_WIDTH (selected_frame)); | 994 | return make_number (FRAME_WIDTH (selected_frame)); |
| 984 | } | 995 | } |
| 996 | #endif | ||
| 985 | 997 | ||
| 986 | DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0, | 998 | DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0, |
| 987 | "Specify that the frame FRAME has LINES lines.\n\ | 999 | "Specify that the frame FRAME has LINES lines.\n\ |
| @@ -1084,6 +1096,7 @@ off the frame.") | |||
| 1084 | 1096 | ||
| 1085 | return Qt; | 1097 | return Qt; |
| 1086 | } | 1098 | } |
| 1099 | |||
| 1087 | 1100 | ||
| 1088 | #ifndef HAVE_X11 | 1101 | #ifndef HAVE_X11 |
| 1089 | DEFUN ("rubber-band-rectangle", Frubber_band_rectangle, Srubber_band_rectangle, | 1102 | DEFUN ("rubber-band-rectangle", Frubber_band_rectangle, Srubber_band_rectangle, |