From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Oliver Scholz Newsgroups: gmane.emacs.devel Subject: Re: request for review: Doing direct file I/O in Emacs Lisp Date: Mon, 10 May 2004 19:46:32 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: 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: 8bit X-Trace: sea.gmane.org 1084213711 25525 80.91.224.253 (10 May 2004 18:28:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 10 May 2004 18:28:31 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon May 10 20:28:12 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 1BNFVb-0005Nb-00 for ; Mon, 10 May 2004 20:28:11 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BNFVa-0007nY-00 for ; Mon, 10 May 2004 20:28:11 +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 1BNFIs-00021D-G5 for emacs-devel@quimby.gnus.org; Mon, 10 May 2004 14:15:02 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BNF74-0005zS-C9 for emacs-devel@gnu.org; Mon, 10 May 2004 14:02:50 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BNF0i-00043Y-Ne for emacs-devel@gnu.org; Mon, 10 May 2004 13:56:52 -0400 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1BNEyo-0003S4-QO for emacs-devel@gnu.org; Mon, 10 May 2004 13:54:19 -0400 Original-Received: (qmail 14461 invoked by uid 65534); 10 May 2004 17:53:55 -0000 Original-Received: from dialin-145-254-140-138.arcor-ip.net (EHLO GERTRUD) (145.254.140.138) by mail.gmx.net (mp025) with SMTP; 10 May 2004 19:53:55 +0200 X-Authenticated: #1497658 Original-To: Stefan Monnier In-Reply-To: <87vfj4uzzs.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "10 May 2004 10:19:19 -0400") X-Attribution: os X-Face: "HgH2sgK|bfH$; PiOJI6|qUCf.ve<51_Od(%ynHr?=>znn#~#oS>",F%B8&\vus),2AsPYb -n>PgddtGEn}s7kH?7kH{P_~vu?]OvVN^qD(L)>G^gDCl(U9n{:d>'DkilN!_K"eNzjrtI4Ya6; Td% IZGMbJ{lawG+'J>QXPZD&TwWU@^~A}f^zAb[Ru;CT(UA]c& User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) 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:23063 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23063 Stefan Monnier writes: >> The following patch implements a file-handle interface for Emacs Lisp, >> which allows files to be directly opened and read/written to without >> an intervening buffer. Eshell can now use this, for example, to >> greatly speed up output redirection (by several orders of magnitude). > > Doesn't seem like a bad idea, but I'd rather postpone it to > after-the-release. [...] 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. Thus I have a low-level feature request (for after-the-release): provide an interface to the file visiting routines such that Lisp code which is meant to deal with formatted text can handle the file’s content as a character stream (of course this makes sense only if it is efficient). For example, add an optional CHARSTREAMP element to the elements of ‘format-alist’. If it is non-nil, FROM-FN and TO-FN get a file handler as additional argument and take the full responsibility for writing to the file/inserting the file’s content into the buffer. Oliver -- Oliver Scholz 22 Floréal an 212 de la Révolution Taunusstr. 25 Liberté, Egalité, Fraternité! 60329 Frankfurt a. M. http://www.jungdemokratenhessen.de Tel. (069) 97 40 99 42 http://www.jdjl.org