From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: request for review: Doing direct file I/O in Emacs Lisp Date: Tue, 11 May 2004 08:22:55 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <87vfj4uzzs.fsf-monnier+emacs@gnu.org> Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1084278365 30087 80.91.224.253 (11 May 2004 12:26:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 11 May 2004 12:26:05 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue May 11 14:25:52 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 1BNWKW-00007l-00 for ; Tue, 11 May 2004 14:25:52 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BNWKW-0003E6-00 for ; Tue, 11 May 2004 14:25:52 +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 1BNWIf-00017E-EL for emacs-devel@quimby.gnus.org; Tue, 11 May 2004 08:23:57 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BNWIL-00015t-70 for emacs-devel@gnu.org; Tue, 11 May 2004 08:23:37 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BNWHg-0000vE-9q for emacs-devel@gnu.org; Tue, 11 May 2004 08:23:32 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BNWHf-0000v6-NF for emacs-devel@gnu.org; Tue, 11 May 2004 08:22:55 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1BNWHf-00083w-1o; Tue, 11 May 2004 08:22:55 -0400 Original-To: Oliver Scholz In-reply-to: (message from Oliver Scholz on Mon, 10 May 2004 19:46:32 +0200) 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:23131 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23131 FWIW ? while working on an RTF reader I found it very annoying that 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. I expect this would be much slower, because you'd need to have Lisp code that handles characters one by one. Parsing them in the buffer is much faster, when you can use one call to skip-chars-forward and one call to buffer-substring to process a whole token at once, without ever needing a Lisp-level loop to process the token's characters one by one. Also, character set detection works more reliably on the entire file.