From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel 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 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1375926987 4294 80.91.229.3 (8 Aug 2013 01:56:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 8 Aug 2013 01:56:27 +0000 (UTC) Cc: emacs-devel@gnu.org To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 08 03:56:29 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V7FSm-0001gO-QV for ged-emacs-devel@m.gmane.org; Thu, 08 Aug 2013 03:56:28 +0200 Original-Received: from localhost ([::1]:56472 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7FSm-0008Jb-E5 for ged-emacs-devel@m.gmane.org; Wed, 07 Aug 2013 21:56:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7FSc-0008HY-CG for emacs-devel@gnu.org; Wed, 07 Aug 2013 21:56:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V7FSV-0001Su-2X for emacs-devel@gnu.org; Wed, 07 Aug 2013 21:56:18 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:32757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7FSU-0001Sn-U1 for emacs-devel@gnu.org; Wed, 07 Aug 2013 21:56:10 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFLd/Nq/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDpHqBXoMT X-IPAS-Result: Av4EABK/CFFLd/Nq/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDpHqBXoMT X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="20942339" Original-Received: from 75-119-243-106.dsl.teksavvy.com (HELO pastel.home) ([75.119.243.106]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 07 Aug 2013 21:56:00 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 571FA62EBF; Wed, 7 Aug 2013 21:56:06 -0400 (EDT) In-Reply-To: (Juanma Barranquero's message of "Wed, 07 Aug 2013 22:54:19 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:162478 Archived-At: > +(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