;;; 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
(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.
\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)