diff options
author | Jim Blandy <jimb@redhat.com> | 1993-03-15 08:51:02 +0000 |
---|---|---|
committer | Jim Blandy <jimb@redhat.com> | 1993-03-15 08:51:02 +0000 |
commit | 376a7584deb5308cf09bb9b2e1db0d4522c4576e (patch) | |
tree | 4d293738f871646c02a4e6962d6b54eb807b02c2 /lisp/frame.el | |
parent | 797d8537f2effa462cfb7232e1bf48ad44bf4172 (diff) | |
download | emacs-376a7584deb5308cf09bb9b2e1db0d4522c4576e.tar.gz emacs-376a7584deb5308cf09bb9b2e1db0d4522c4576e.tar.bz2 emacs-376a7584deb5308cf09bb9b2e1db0d4522c4576e.zip |
Make frame configurations start with a distinctive symbol.
* frame.el (current-frame-configuration): Return a list as before,
but starting with `frame-configuration'.
(set-frame-configuration): Check that CONFIGURATION is a list
starting with `frame-configuration', strip it off, and do as before.
(frame-configuration-p): New function.
* register.el (jump-to-register): Use frame-configuration-p,
instead of catching an error in set-frame-configuration. Really now.
Diffstat (limited to 'lisp/frame.el')
-rw-r--r-- | lisp/frame.el | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/lisp/frame.el b/lisp/frame.el index e52d50de04b..989b3efa2ec 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -284,25 +284,32 @@ additional frame parameters that Emacs recognizes for X window frames." (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)) @@ -311,6 +318,13 @@ configuration, and other parameters set as specified in CONFIGURATION." (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))) + ;;;; Convenience functions for accessing and interactively changing ;;;; frame parameters. |