[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug#1939: suggestion: adding read-line function to elisp
From: |
Ted Zlatanov |
Subject: |
Re: bug#1939: suggestion: adding read-line function to elisp |
Date: |
Tue, 20 Jan 2009 12:29:55 -0600 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) |
On Sun, 18 Jan 2009 06:48:10 +0100 Juanma Barranquero <lekktu@gmail.com> wrote:
JB> On Sat, Jan 17, 2009 at 19:13, xah lee <xah@xahlee.org> wrote:
>> Getting lines as list is a very frequent need.
>>
>> elisp is very suitable for tasks of text processing. So, having such a
>> convenience function seems appropriate.
JB> Getting lines as list is much less frequent in elisp. The reason is
JB> that is much more flexible (and faster) to manipulate text in a buffer
JB> than as a collection of strings.
JB> So in most cases, using `with-temp-buffer' (as in your read-lines
JB> function) is the Right Thing To Do.
OTOH, it would be nice to have a way to call a lambda for every line in
a file (`mapfile' essentially) without using a buffer. The function
would get the line and the line number as parameters. That would let
Emacs Lisp do some processing of large files without running out of
memory.
Ted