lisp/frameset.el (frameset-prop): New function and setter.
(frameset-save): Do not modify frame list passed by the caller.
This commit is contained in:
parent
a10c82694e
commit
2613dea20a
2 changed files with 23 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
2013-08-03 Juanma Barranquero <lekktu@gmail.com>
|
||||
|
||||
* frameset.el (frameset-prop): New function and setter.
|
||||
(frameset-save): Do not modify frame list passed by the caller.
|
||||
|
||||
2013-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* emacs-lisp/package.el (package-desc-from-define): Ignore unknown keys.
|
||||
|
|
|
@ -78,6 +78,21 @@ Else return nil."
|
|||
(and (eq (car-safe frameset) 'frameset)
|
||||
(plist-get (cl-second frameset) :version)))
|
||||
|
||||
;; A setf'able accessor to the frameset's properties
|
||||
(defun frameset-prop (frameset prop)
|
||||
"Return the value of the PROP property of FRAMESET.
|
||||
|
||||
Properties other than :version can be set with
|
||||
|
||||
(setf (frameset-prop FRAMESET PROP) NEW-VALUE)"
|
||||
(plist-get (frameset-properties frameset) prop))
|
||||
|
||||
(gv-define-setter frameset-prop (v fs prop)
|
||||
`(progn
|
||||
(cl-assert (not (eq ,prop :version)) t ":version can not be set")
|
||||
(setf (frameset-properties ,fs)
|
||||
(plist-put (frameset-properties ,fs) ,prop ,v))))
|
||||
|
||||
|
||||
;; Filtering
|
||||
|
||||
|
@ -294,8 +309,9 @@ PREDICATE is a predicate function, which must return non-nil for frames that
|
|||
should be saved; it defaults to saving all frames from FRAME-LIST.
|
||||
PROPERTIES is a user-defined property list to add to the frameset."
|
||||
(let ((frames (cl-delete-if-not #'frame-live-p
|
||||
(cl-remove-if-not (or predicate #'framep)
|
||||
(or frame-list (frame-list))))))
|
||||
(cl-delete-if-not (or predicate #'framep)
|
||||
(or (copy-sequence frame-list)
|
||||
(frame-list))))))
|
||||
(frameset--process-minibuffer-frames frames)
|
||||
(make-frameset :properties (append '(:version 1) properties)
|
||||
:states (mapcar
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue