diff options
| author | Richard M. Stallman <rms@gnu.org> | 1994-04-23 21:38:16 +0000 |
|---|---|---|
| committer | Richard M. Stallman <rms@gnu.org> | 1994-04-23 21:38:16 +0000 |
| commit | 8a9e86e647840264f55a0f973fb6893fbc63c80e (patch) | |
| tree | df1a56b6b6d7b650f871d43b75433e8c0b2af2d9 /lisp/frame.el | |
| parent | a90712c210f563f2128cdae74295f014a5d8b9a1 (diff) | |
| download | emacs-8a9e86e647840264f55a0f973fb6893fbc63c80e.tar.gz | |
(special-display-frame-alist): New variable.
(special-display-popup-frame): New function.
(special-display-function): Set it.
Diffstat (limited to 'lisp/frame.el')
| -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'.") (function (lambda () (new-frame pop-up-frame-alist)))) +(defvar special-display-frame-alist + '((height . 14) (width . 80) (unsplittable . t)) + "*Alist of frame parameters used when creating special frames. +Special frames are used for buffers whose names are in +`special-display-buffer-names' and for buffers whose names match +one of the regular expressions in `special-display-regexps'. +This variable can be set in your init file, like this: + (setq special-display-frame-alist '((width . 80) (height . 20))) +These supersede the values given in `default-frame-alist'.") + +;; Display BUFFER in its own frame, reusing an existing window if any. +;; Return the window chosen. +;; Currently we do not insist on selecting the window within its frame. +(defun special-display-popup-frame (buffer) + (let ((window (get-buffer-window buffer t))) + (if window + ;; If we have a window already, make it visible. + (let ((frame (window-frame window))) + (make-frame-visible frame) + (raise-frame frame) + window) + ;; If no window yet, make one in a new frame. + (let ((frame (new-frame special-display-frame-alist))) + (set-window-buffer (frame-selected-window frame) buffer) + (set-window-dedicated-p (frame-selected-window frame) t) + (frame-selected-window frame))))) + +(setq special-display-function 'special-display-popup-frame) ;;;; Arrangement of frames at startup |
