From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: request for review: Doing direct file I/O in Emacs Lisp Date: 10 May 2004 14:21:54 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <878yg0rvr3.fsf-monnier+emacs@gnu.org> References: <87vfj4uzzs.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1084215357 29860 80.91.224.253 (10 May 2004 18:55:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 10 May 2004 18:55:57 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon May 10 20:55:41 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BNFwD-0007TO-00 for ; Mon, 10 May 2004 20:55:41 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BNFwD-0008Rb-00 for ; Mon, 10 May 2004 20:55:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BNFpK-0001nF-5b for emacs-devel@quimby.gnus.org; Mon, 10 May 2004 14:48:34 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BNFjz-0000cU-R7 for emacs-devel@gnu.org; Mon, 10 May 2004 14:43:03 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BNFWx-0005D7-QJ for emacs-devel@gnu.org; Mon, 10 May 2004 14:30:07 -0400 Original-Received: from [209.226.175.184] (helo=tomts22-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BNFPX-0003Oy-U7 for emacs-devel@gnu.org; Mon, 10 May 2004 14:21:56 -0400 Original-Received: from alfajor ([67.68.218.161]) by tomts22-srv.bellnexxia.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20040510182155.IGXZ11783.tomts22-srv.bellnexxia.net@alfajor>; Mon, 10 May 2004 14:21:55 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id EF8BCD73CE; Mon, 10 May 2004 14:21:54 -0400 (EDT) Original-To: Oliver Scholz In-Reply-To: Original-Lines: 18 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:23073 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23073 > FWIW =E2=80=A6 while working on an RTF reader I found it very annoying th= at I > have to insert the entire RTF file into a buffer, then tokenize it > character-wise, then delete that parts of the buffer that are > recognized as markup, applying text properties to the remaining text > as appropriate. > Being able to fetch characters from a stream, and deal with them > through several layers of abstraction, and then inserting the actual > text with properties into a buffer would be much nicer and cleaner. While I like code to be functional, I must say that from a memory management point of view, buffer modifications are significantly more efficient than string manipulation. So the other approach you suggest might indeed be cleaner, but it might also turn out to stress Emacs's GC too hard and the performance might suck. Stefan