From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.emacs.devel Subject: bindat docs on length of str, strz, etc types Date: Thu, 28 Dec 2006 09:22:51 +1100 Message-ID: <87r6ulq8qs.fsf@zip.com.au> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1167258195 11596 80.91.229.10 (27 Dec 2006 22:23:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 27 Dec 2006 22:23:15 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 27 23:23:14 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1GzhB2-0006dZ-Pa for ged-emacs-devel@m.gmane.org; Wed, 27 Dec 2006 23:23:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GzhB2-00006F-3C for ged-emacs-devel@m.gmane.org; Wed, 27 Dec 2006 17:23:12 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GzhAp-00004w-Fh for emacs-devel@gnu.org; Wed, 27 Dec 2006 17:22:59 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GzhAl-0008UH-L4 for emacs-devel@gnu.org; Wed, 27 Dec 2006 17:22:59 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GzhAl-0008UE-HT for emacs-devel@gnu.org; Wed, 27 Dec 2006 17:22:55 -0500 Original-Received: from [61.8.2.231] (helo=mailout2.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GzhAl-0006Si-2U for emacs-devel@gnu.org; Wed, 27 Dec 2006 17:22:55 -0500 Original-Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout2.pacific.net.au (Postfix) with ESMTP id 446F510D219 for ; Thu, 28 Dec 2006 09:22:49 +1100 (EST) Original-Received: from localhost (ppp2ABA.dyn.pacific.net.au [61.8.42.186]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 4798E27407 for ; Thu, 28 Dec 2006 09:22:50 +1100 (EST) Original-Received: from gg by localhost with local (Exim 4.63) (envelope-from ) id 1GzhAh-0001qL-Oj for emacs-devel@gnu.org; Thu, 28 Dec 2006 09:22:51 +1100 Original-To: emacs-devel@gnu.org User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:64378 Archived-At: In the "Bindat Spec" node of the lisp manual, the `repeat' type has COUNT may be an integer, or a list of one element that names a previous field. If I'm not mistaken that applies to any of the LEN arguments for str, strz, etc too (the "Bindat Examples" have some like that). I wonder if the words could be in a more prominent / more general spot. And also if I'm not mistaken a form `(eval FOO)' is allowed, for calculating a length. It'd be nice to describe that. I tried it for a jpeg record, where the length field includes itself so the data is "length-2" bytes ((marker u16) (length u16) (data str (eval (- (assoc-default 'length struct) 2)))) But perhaps there's a cleaner way I missed.