emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: request for review: Doing direct file I/O in Emacs Lisp


From: Oliver Scholz
Subject: Re: request for review: Doing direct file I/O in Emacs Lisp
Date: Mon, 10 May 2004 19:46:32 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt)

Stefan Monnier <address@hidden> 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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]