;;; frame.el --- multi-frame management independent of window systems.
-;;;; Copyright (C) 1990, 1992, 1993 Free Software Foundation, Inc.
+;;;; Copyright (C) 1993 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: internal
(> (minibuffer-depth) 0)
t)))
-(defun new-frame (&optional parameters)
+;; Alias, kept temporarily.
+(defalias 'new-frame 'make-frame)
+(defun make-frame (&optional parameters)
"Create a new frame, displaying the current buffer.
Optional argument PARAMETERS is an alist of parameters for the new
be given.
\(minibuffer . t) - the frame should have a minibuffer
-\(minibuffer . none) - the frame should have no minibuffer
+\(minibuffer . nil) - the frame should have no minibuffer
\(minibuffer . only) - the frame should contain only a minibuffer
\(minibuffer . WINDOW) - the frame should use WINDOW as its minibuffer window.
(defun current-frame-configuration ()
"Return a list describing the positions and states of all frames.
-Each element is a list of the form (FRAME ALIST WINDOW-CONFIG), where
-FRAME is a frame object, ALIST is an association list specifying
-some of FRAME's parameters, and WINDOW-CONFIG is a window
-configuration object for FRAME."
- (mapcar (function
- (lambda (frame)
- (list frame
- (frame-parameters frame)
- (current-window-configuration frame))))
- (frame-list)))
+Its car is `frame-configuration'.
+Each element of the cdr is a list of the form (FRAME ALIST WINDOW-CONFIG),
+where
+ FRAME is a frame object,
+ ALIST is an association list specifying some of FRAME's parameters, and
+ WINDOW-CONFIG is a window configuration object for FRAME."
+ (cons 'frame-configuration
+ (mapcar (function
+ (lambda (frame)
+ (list frame
+ (frame-parameters frame)
+ (current-window-configuration frame))))
+ (frame-list))))
(defun set-frame-configuration (configuration)
"Restore the frames to the state described by CONFIGURATION.
Each frame listed in CONFIGURATION has its position, size, window
configuration, and other parameters set as specified in CONFIGURATION."
- (let (frames-to-delete)
+ (or (frame-configuration-p configuration)
+ (signal 'wrong-type-argument
+ (list 'frame-configuration-p configuration)))
+ (let ((config-alist (cdr configuration))
+ frames-to-delete)
(mapcar (function
(lambda (frame)
- (let ((parameters (assq frame configuration)))
+ (let ((parameters (assq frame config-alist)))
(if parameters
(progn
(modify-frame-parameters frame (nth 1 parameters))
(frame-list))
(mapcar 'delete-frame frames-to-delete)))
+(defun frame-configuration-p (object)
+ "Return non-nil if OBJECT seems to be a frame configuration.
+Any list whose car is `frame-configuration' is assumed to be a frame
+configuration."
+ (and (consp object)
+ (eq (car object) 'frame-configuration)))
+
\f
;;;; Convenience functions for accessing and interactively changing
;;;; frame parameters.
(list (cons 'auto-lower (> arg 0)))))
(defun toggle-vertical-scroll-bar (arg)
- "Toggle whether or not the selected frame has vertical scrollbars.
-With arg, turn vertical scrollbars on if and only if arg is positive."
+ "Toggle whether or not the selected frame has vertical scroll bars.
+With arg, turn vertical scroll bars on if and only if arg is positive."
(interactive "P")
(if (null arg)
(setq arg
- (if (cdr (assq 'vertical-scrollbars
+ (if (cdr (assq 'vertical-scroll-bars
(frame-parameters (selected-frame))))
-1 1)))
(modify-frame-parameters (selected-frame)
- (list (cons 'vertical-scrollbars (> arg 0)))))
+ (list (cons 'vertical-scroll-bars (> arg 0)))))
(defun toggle-horizontal-scroll-bar (arg)
- "Toggle whether or not the selected frame has horizontal scrollbars.
-With arg, turn horizontal scrollbars on if and only if arg is positive.
-Horizontal scrollbars aren't implemented yet."
+ "Toggle whether or not the selected frame has horizontal scroll bars.
+With arg, turn horizontal scroll bars on if and only if arg is positive.
+Horizontal scroll bars aren't implemented yet."
(interactive "P")
(error "Horizontal scroll bars aren't implemented yet"))
\f
;;;; Aliases for backward compatibility with Emacs 18.
-(fset 'screen-height 'frame-height)
-(fset 'screen-width 'frame-width)
+(defalias 'screen-height 'frame-height)
+(defalias 'screen-width 'frame-width)
(defun set-screen-width (cols &optional pretend)
"Obsolete function to change the size of the screen to COLS columns.\n\
;;;; Key bindings
(defvar ctl-x-5-map (make-sparse-keymap)
"Keymap for frame commands.")
-(fset 'ctl-x-5-prefix ctl-x-5-map)
+(defalias 'ctl-x-5-prefix ctl-x-5-map)
(define-key ctl-x-map "5" 'ctl-x-5-prefix)
(define-key ctl-x-5-map "2" 'new-frame)