# HG changeset patch # User Richard M. Stallman # Date 767137096 0 # Node ID 7102dd374da40add76d0385583d0dcc2161bf378 # Parent 0a18af7eb58763a173091ce7d6b06c85224e1185 (special-display-frame-alist): New variable. (special-display-popup-frame): New function. (special-display-function): Set it. diff -r 0a18af7eb587 -r 7102dd374da4 lisp/frame.el --- a/lisp/frame.el Sat Apr 23 21:37:15 1994 +0000 +++ b/lisp/frame.el Sat Apr 23 21:38:16 1994 +0000 @@ -60,6 +60,34 @@ (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