diff options
| author | Stefan Monnier | 2013-08-13 09:47:54 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2013-08-13 09:47:54 -0400 |
| commit | 1f585e652964d260e93ee8007a2128c2846365af (patch) | |
| tree | a310b91840f41ffa259f7de855b6f045b1937270 /lisp | |
| parent | 9e37ee3be620a64afe9d9760076f80c22c986b62 (diff) | |
| download | emacs-1f585e652964d260e93ee8007a2128c2846365af.tar.gz emacs-1f585e652964d260e93ee8007a2128c2846365af.zip | |
* lisp/frameset.el (frameset--make): Rename constructor from make-frameset.
(frameset-p, frameset-valid-p): Don't autoload.
(frameset-valid-p): Use normal accessors.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/frameset.el | 38 |
2 files changed, 24 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 274ca3a3730..ff9f4ff8707 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-08-13 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * frameset.el (frameset--make): Rename constructor from make-frameset. | ||
| 4 | (frameset-p, frameset-valid-p): Don't autoload. | ||
| 5 | (frameset-valid-p): Use normal accessors. | ||
| 6 | |||
| 1 | 2013-08-13 Glenn Morris <rgm@gnu.org> | 7 | 2013-08-13 Glenn Morris <rgm@gnu.org> |
| 2 | 8 | ||
| 3 | * progmodes/compile.el (compile-command): Tweak example in doc. | 9 | * progmodes/compile.el (compile-command): Tweak example in doc. |
diff --git a/lisp/frameset.el b/lisp/frameset.el index a347599bb51..e334b4cb1fd 100644 --- a/lisp/frameset.el +++ b/lisp/frameset.el | |||
| @@ -42,6 +42,7 @@ | |||
| 42 | 42 | ||
| 43 | 43 | ||
| 44 | (cl-defstruct (frameset (:type vector) :named | 44 | (cl-defstruct (frameset (:type vector) :named |
| 45 | (:constructor frameset--make) | ||
| 45 | ;; Copier is defined below. | 46 | ;; Copier is defined below. |
| 46 | (:copier nil)) | 47 | (:copier nil)) |
| 47 | 48 | ||
| @@ -129,36 +130,33 @@ root window of the frame.\n | |||
| 129 | IMPORTANT: Modifying this slot may cause frameset functions to fail, | 130 | IMPORTANT: Modifying this slot may cause frameset functions to fail, |
| 130 | unless the type constraints defined above are respected.\n\n(fn FRAMESET)") | 131 | unless the type constraints defined above are respected.\n\n(fn FRAMESET)") |
| 131 | 132 | ||
| 132 | ;;;###autoload (autoload 'frameset-p "frameset" | 133 | ;; We autoloaded this for use in register.el, but now that we use registerv |
| 133 | ;;;###autoload "Return non-nil if OBJECT is a frameset, nil otherwise." nil) | 134 | ;; objects, this autoload is not useful any more. |
| 135 | ;; ;;;###autoload (autoload 'frameset-p "frameset" | ||
| 136 | ;; ;;;###autoload "Return non-nil if OBJECT is a frameset, nil otherwise." nil) | ||
| 134 | 137 | ||
| 135 | (defun frameset-copy (frameset) | 138 | (defun frameset-copy (frameset) |
| 136 | "Return a deep copy of FRAMESET. | 139 | "Return a deep copy of FRAMESET. |
| 137 | FRAMESET is copied with `copy-tree'." | 140 | FRAMESET is copied with `copy-tree'." |
| 138 | (copy-tree frameset t)) | 141 | (copy-tree frameset t)) |
| 139 | 142 | ||
| 140 | ;;;###autoload | ||
| 141 | (defun frameset-valid-p (object) | 143 | (defun frameset-valid-p (object) |
| 142 | "Return non-nil if OBJECT is a valid frameset, nil otherwise. | 144 | "Return non-nil if OBJECT is a valid frameset, nil otherwise." |
| 143 | 145 | (and (frameset-p object) | |
| 144 | The return value is nil if OBJECT is not a frameset, or not | 146 | (integerp (frameset-version object)) |
| 145 | a valid one, and the frameset version if it is valid." | 147 | (consp (frameset-timestamp object)) |
| 146 | (and (vectorp object) ; a vector | 148 | (let ((app (frameset-app object))) |
| 147 | (>= (length object) 8) ; of the right length (future-proof) | ||
| 148 | (eq (aref object 0) 'frameset) ; tagged as `frameset' | ||
| 149 | (integerp (aref object 1)) ; VERSION is an int | ||
| 150 | (consp (aref object 2)) ; TIMESTAMP is a non-null list | ||
| 151 | (let ((app (aref object 3))) | ||
| 152 | (or (null app) ; APP is nil | 149 | (or (null app) ; APP is nil |
| 153 | (symbolp app) ; or a symbol | 150 | (symbolp app) ; or a symbol |
| 154 | (and (consp app) ; or a list | 151 | (and (consp app) ; or a list |
| 155 | (symbolp (car app))))) ; starting with a symbol | 152 | (symbolp (car app))))) ; starting with a symbol |
| 156 | (stringp (or (aref object 4) "")) ; NAME is a string or nil | 153 | (stringp (or (frameset-name object) "")) |
| 157 | (stringp (or (aref object 5) "")) ; DESCRIPTION is a string or nil | 154 | (stringp (or (frameset-description object) "")) |
| 158 | (listp (aref object 6)) ; PROPERTIES is a list | 155 | (listp (frameset-properties object)) |
| 159 | (listp (aref object 7)) ; and STATES is, too | 156 | (let ((states (frameset-states object))) |
| 160 | (cl-every #'consp (aref object 7)) ; and an alist | 157 | (and (listp states) |
| 161 | (aref object 1))) ; return VERSION | 158 | (cl-every #'consp (frameset-states object)))) |
| 159 | (frameset-version object))) ; And VERSION is non-nil. | ||
| 162 | 160 | ||
| 163 | ;; A setf'able accessor to the frameset's properties | 161 | ;; A setf'able accessor to the frameset's properties |
| 164 | (defun frameset-prop (frameset property) | 162 | (defun frameset-prop (frameset property) |
| @@ -755,7 +753,7 @@ PROPERTIES is a user-defined property list to add to the frameset." | |||
| 755 | list))) | 753 | list))) |
| 756 | fs) | 754 | fs) |
| 757 | (frameset--record-minibuffer-relationships frames) | 755 | (frameset--record-minibuffer-relationships frames) |
| 758 | (setq fs (make-frameset | 756 | (setq fs (frameset--make |
| 759 | :app app | 757 | :app app |
| 760 | :name name | 758 | :name name |
| 761 | :description description | 759 | :description description |