Function: frameset-save

frameset-save is an autoloaded and byte-compiled function defined in frameset.el.gz.

Signature

(frameset-save FRAME-LIST &key APP NAME DESCRIPTION FILTERS PREDICATE PROPERTIES)

Documentation

Return a frameset for FRAME-LIST, a list of frames.

Dead frames and non-frame objects are silently removed from the list. If nil, FRAME-LIST defaults to the output of frame-list (all live frames). APP, NAME and DESCRIPTION are optional data; see the docstring of the frameset defstruct for details. FILTERS is an alist of parameter filters; if nil, the value of the variable frameset-filter-alist is used instead. PREDICATE is a predicate function, which must return non-nil for frames that should be saved; if PREDICATE is nil, all frames from FRAME-LIST are saved. PROPERTIES is a user-defined property list to add to the frameset.

Source Code

;; Defined in /usr/src/emacs/lisp/frameset.el.gz
;;;###autoload
(cl-defun frameset-save (frame-list
			 &key app name description
			      filters predicate properties)
  "Return a frameset for FRAME-LIST, a list of frames.
Dead frames and non-frame objects are silently removed from the list.
If nil, FRAME-LIST defaults to the output of `frame-list' (all live frames).
APP, NAME and DESCRIPTION are optional data; see the docstring of the
`frameset' defstruct for details.
FILTERS is an alist of parameter filters; if nil, the value of the variable
`frameset-filter-alist' is used instead.
PREDICATE is a predicate function, which must return non-nil for frames that
should be saved; if PREDICATE is nil, all frames from FRAME-LIST are saved.
PROPERTIES is a user-defined property list to add to the frameset."
  (let* ((list (or (copy-sequence frame-list) (frame-list)))
	 (frameset--target-display nil)
	 (frames (cl-delete-if-not #'frame-live-p
				   (if predicate
				       (cl-delete-if-not predicate list)
				     list)))
	 fs)
    (frameset--record-relationships frames)
    (setq fs (frameset--make
	      :app app
	      :name name
	      :description description
	      :properties properties
	      :states (mapcar
		       (lambda (frame)
			 (cons
			  (frameset-filter-params (frame-parameters frame)
						  (or filters
						      frameset-filter-alist)
						  t)
			  (window-state-get (frame-root-window frame) t)))
		       frames)))
    (cl-assert (frameset-valid-p fs))
    fs))