From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.bugs Subject: Re: bug#1939: suggestion: adding read-line function to elisp Date: Tue, 20 Jan 2009 12:29:55 -0600 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <86ljt5g7a4.fsf@lifelogs.com> References: <421D26F9-3257-44EE-97B0-A7276A97AD73@xahlee.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1232476817 27451 80.91.229.12 (20 Jan 2009 18:40:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 20 Jan 2009 18:40:17 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 20 19:41:29 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LPLXV-0003Km-MO for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Jan 2009 19:41:29 +0100 Original-Received: from localhost ([127.0.0.1]:46447 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LPLWC-0007Qt-89 for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Jan 2009 13:40:08 -0500 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!newsfeed0.kamp.net!newsfeed.kamp.net!newsfeed.freenet.de!news.albasani.net!not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 22 Original-X-Trace: news.albasani.net ggcCmmXVkWGzMbq/Jl9694hmGFPn4Sc3/YkvdZUNicym00O5ZOeN7p/1vSv5hB4NNA2tNKEZTMsdJf433Xhj4k6sjrjyo2p2ym/QtwXHT5UZx3hP/cvNs8DtxcGrdx9U Original-X-Complaints-To: abuse@albasani.net Original-NNTP-Posting-Date: Tue, 20 Jan 2009 18:28:45 +0000 (UTC) X-User-ID: qYwtrXkfgVWX6p3C1Ek7s+h9KGVC71MJZnvUapolF3Y= X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Cancel-Lock: sha1:8fdlRZza00T0mfIK2ueQaRnphwA= sha1:0pnVlqSltdyd3pbqWIxwcsujppY= User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) X-NNTP-Posting-Host: mSBHPes2zdFCuYhnkuY4eMdclsy04AXS7f+S/N1qK6Y= Original-Xref: news.stanford.edu gnu.emacs.bug:52056 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:24335 Archived-At: On Sun, 18 Jan 2009 06:48:10 +0100 Juanma Barranquero wrote: JB> On Sat, Jan 17, 2009 at 19:13, xah lee 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