summaryrefslogtreecommitdiff
path: root/lisp/frame.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-09-22 05:47:28 +0000
committerRichard M. Stallman <rms@gnu.org>1994-09-22 05:47:28 +0000
commitfefaa14f6ff6de8856359df57ce7f736ff4cf2d7 (patch)
treef23bce418a88fc8fd9e1232f45adb6f1b3c71b7f /lisp/frame.el
parent17a25ea7c05ee3a310b0876bb4eb71a1f5592aff (diff)
downloademacs-fefaa14f6ff6de8856359df57ce7f736ff4cf2d7.tar.gz
(special-display-popup-frame): Rename new arg to ARGS.
Allow (FUNCTION OTHER-ARGS...) as the value of ARGS.
Diffstat (limited to 'lisp/frame.el')
-rw-r--r--lisp/frame.el32
1 files changed, 19 insertions, 13 deletions
diff --git a/lisp/frame.el b/lisp/frame.el
index e19ad10a3c2..f71a0a22e53 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -84,19 +84,25 @@ 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 &optional params)
- (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 (make-frame (append params 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)))))
+;; If ARGS is an alist, use it as a list of frame parameter specs.
+;; If ARGS is a list whose car is a symbol.
+;; use (car ARGS) as a function to do the work.
+;; Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args.
+(defun special-display-popup-frame (buffer &optional args)
+ (if (and args (symbolp (car args)))
+ (apply (car args) buffer (cdr args))
+ (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 (make-frame (append args 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)