Mercurial > emacs
comparison lisp/frame.el @ 7057:7102dd374da4
(special-display-frame-alist): New variable.
(special-display-popup-frame): New function.
(special-display-function): Set it.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 23 Apr 1994 21:38:16 +0000 |
parents | c7525f1cfaba |
children | cc7cd83ccf3f |
comparison
equal
deleted
inserted
replaced
7056:0a18af7eb587 | 7057:7102dd374da4 |
---|---|
58 | 58 |
59 (setq pop-up-frame-function | 59 (setq pop-up-frame-function |
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 |
66 ;;; 1) Load the window system startup file from the lisp library and read the | 94 ;;; 1) Load the window system startup file from the lisp library and read the |
67 ;;; high-priority arguments (-q and the like). The window system startup | 95 ;;; high-priority arguments (-q and the like). The window system startup |