emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] trunk r113747: lisp/frameset.el: Convert `frameset' to


From: Stefan Monnier
Subject: Re: [Emacs-diffs] trunk r113747: lisp/frameset.el: Convert `frameset' to vector and add new slots.
Date: Wed, 07 Aug 2013 21:56:06 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> +(defun frameset-p (object)
> +  "If OBJECT is a frameset, return its version number.

I know we have some offenders, but please try to stick to "foo-p returns
a boolean".

>  Else return nil."
> -  (and (eq (car-safe frameset) 'frameset) ; is a list
> -       (integerp (nth 1 frameset)) ; version is an int
> -       (nth 3 frameset)            ; states is non-null
> -       (nth 1 frameset)))          ; return version
> +  (and (vectorp object)                   ; a vector
> +       (eq (aref object 0) 'frameset)     ; tagged as `frameset'
> +       (integerp (aref object 1))         ; version is an int
> +       (consp (aref object 2))            ; timestamp is a non-null list
> +       (stringp (or (aref object 4) ""))  ; name is a string or null
> +       (stringp (or (aref object 5) ""))  ; description is a string or null
> +       (listp (aref object 6))            ; properties is a list
> +       (consp (aref object 7))            ; and states is non-null
> +       (aref object 1)))                  ; return version

Also, this doesn't just test whether it's a frameset or not (which is
what one expects from "frameset-p") but it does some sanity checks
as well, something I'd call maybe "frameset-valid-p".


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]