From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: struct.el -- a package to encode/decode binary data Date: Tue, 19 Mar 2002 09:02:19 +0200 (IST) Sender: emacs-devel-admin@gnu.org Message-ID: References: <5x1yehpj1w.fsf@kfs2.cua.dk> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: main.gmane.org 1016521580 19982 127.0.0.1 (19 Mar 2002 07:06:20 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 19 Mar 2002 07:06:20 +0000 (UTC) Cc: emacs-devel@gnu.org, Kenichi Handa Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16nDhL-0005CC-00 for ; Tue, 19 Mar 2002 08:06:19 +0100 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16nDmW-00032L-00 for ; Tue, 19 Mar 2002 08:11:40 +0100 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16nDhB-0005T6-00; Tue, 19 Mar 2002 02:06:09 -0500 Original-Received: from is.elta.co.il ([199.203.121.2]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16nDed-0005K6-00 for ; Tue, 19 Mar 2002 02:03:31 -0500 Original-Received: from is (is [199.203.121.2]) by is.elta.co.il (8.9.3/8.8.8) with SMTP id JAA15815; Tue, 19 Mar 2002 09:02:20 +0200 (IST) X-Sender: eliz@is Original-To: "Kim F. Storm" In-Reply-To: <5x1yehpj1w.fsf@kfs2.cua.dk> Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.5 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:2027 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:2027 On 19 Mar 2002, Kim F. Storm wrote: > While writing a package that sends and receives datagrams using the > new make-network-process functionality, I quickly found that I needed > to be able to encode and decode binary data structures, so I came up > with the following package (struct.el). > > I'd like to hear if something like this already exists, or if others > find it should be added to emacs (with more complete documentation of > course). [Also, the struct-pack function doesn't work with nested > data, but I'll fix that if there is an interest in this package]. I think it would be a very useful addition to Emacs, but I have one comment about the implementation: I don't like (and that's an understatement!) the idea of using unibyte strings. I especially get shivers when I see string-make-unibyte and its ilk. Unibyte strings and buffers are The Mother Of All Evil in Emacs--they are the primary reason for those pesky \201 characters popping up in user buffers. Thanks to titanic effort of Handa-san and others, Emacs mostly does TRT with unibyte text, but I think we shouldn't test that too much for our own good, especially in a package bundled with Emacs. If I understand correctly what you want to do, there should be no reason for unibyte text in your implementation. Emacs should be able to deal with binary data as multibyte, just be sure to decode it as raw-text-unix. _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel