diff options
| author | Richard M. Stallman | 1994-04-23 21:38:16 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-04-23 21:38:16 +0000 |
| commit | 8a9e86e647840264f55a0f973fb6893fbc63c80e (patch) | |
| tree | df1a56b6b6d7b650f871d43b75433e8c0b2af2d9 | |
| parent | a90712c210f563f2128cdae74295f014a5d8b9a1 (diff) | |
| download | emacs-8a9e86e647840264f55a0f973fb6893fbc63c80e.tar.gz emacs-8a9e86e647840264f55a0f973fb6893fbc63c80e.zip | |
(special-display-frame-alist): New variable.
(special-display-popup-frame): New function.
(special-display-function): Set it.
| -rw-r--r-- | lisp/frame.el | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lisp/frame.el b/lisp/frame.el index 1083037b015..a43f28ed669 100644 --- a/lisp/frame.el +++ b/lisp/frame.el | |||
| @@ -60,6 +60,34 @@ These supersede the values given in `default-frame-alist'.") | |||
| 60 | (function (lambda () | 60 | (function (lambda () |
| 61 | (new-frame pop-up-frame-alist)))) | 61 | (new-frame pop-up-frame-alist)))) |
| 62 | 62 | ||
| 63 | (defvar special-display-frame-alist | ||
| 64 | '((height . 14) (width . 80) (unsplittable . t)) | ||
| 65 | "*Alist of frame parameters used when creating special frames. | ||
| 66 | Special frames are used for buffers whose names are in | ||
| 67 | `special-display-buffer-names' and for buffers whose names match | ||
| 68 | one of the regular expressions in `special-display-regexps'. | ||
| 69 | This variable can be set in your init file, like this: | ||
| 70 | (setq special-display-frame-alist '((width . 80) (height . 20))) | ||
| 71 | These supersede the values given in `default-frame-alist'.") | ||
| 72 | |||
| 73 | ;; Display BUFFER in its own frame, reusing an existing window if any. | ||
| 74 | ;; Return the window chosen. | ||
| 75 | ;; Currently we do not insist on selecting the window within its frame. | ||
| 76 | (defun special-display-popup-frame (buffer) | ||
| 77 | (let ((window (get-buffer-window buffer t))) | ||
| 78 | (if window | ||
| 79 | ;; If we have a window already, make it visible. | ||
| 80 | (let ((frame (window-frame window))) | ||
| 81 | (make-frame-visible frame) | ||
| 82 | (raise-frame frame) | ||
| 83 | window) | ||
| 84 | ;; If no window yet, make one in a new frame. | ||
| 85 | (let ((frame (new-frame special-display-frame-alist))) | ||
| 86 | (set-window-buffer (frame-selected-window frame) buffer) | ||
| 87 | (set-window-dedicated-p (frame-selected-window frame) t) | ||
| 88 | (frame-selected-window frame))))) | ||
| 89 | |||
| 90 | (setq special-display-function 'special-display-popup-frame) | ||
| 63 | 91 | ||
| 64 | ;;;; Arrangement of frames at startup | 92 | ;;;; Arrangement of frames at startup |
| 65 | 93 | ||