From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Eli Zaretskii" Newsgroups: gmane.emacs.help Subject: Re: how to read file's content using elisp? Date: Thu, 16 Sep 2004 13:43:58 +0300 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <01c49bda$Blat.v2.2.2$37a73fa0@zahav.net.il> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: deer.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7BIT X-Trace: sea.gmane.org 1095331608 25000 80.91.229.6 (16 Sep 2004 10:46:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 16 Sep 2004 10:46:48 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 16 12:46:30 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C7tmY-0007sB-00 for ; Thu, 16 Sep 2004 12:46:30 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C7tsD-0005dc-Hh for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Sep 2004 06:52:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C7trt-0005dQ-P8 for help-gnu-emacs@gnu.org; Thu, 16 Sep 2004 06:52:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C7trr-0005d3-TC for help-gnu-emacs@gnu.org; Thu, 16 Sep 2004 06:52:00 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C7trr-0005ct-Pd for help-gnu-emacs@gnu.org; Thu, 16 Sep 2004 06:51:59 -0400 Original-Received: from [192.114.186.24] (helo=legolas.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C7tli-0002e5-Oi for help-gnu-emacs@gnu.org; Thu, 16 Sep 2004 06:45:40 -0400 Original-Received: from zaretski (pns03-206-187.inter.net.il [80.230.206.187]) by legolas.inter.net.il (MOS 3.5.3-GR) with ESMTP id COR04739 (AUTH halo1); Thu, 16 Sep 2004 13:45:35 +0300 (IDT) Original-To: help-gnu-emacs@gnu.org X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 2.2.2 In-reply-to: (message from Rokia on Thu, 16 Sep 2004 00:03:09 +0800) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:20708 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:20708 > From: Rokia > Date: Thu, 16 Sep 2004 00:03:09 +0800 > > > what I want to do is reading a file's content into a string > variable. That is actually not a very good idea in Emacs Lisp. In Emacs Lisp, it is much easier to manipulate text in a buffer than to manipulate text in a string. For starters, buffers are managed memory-wise much more efficiently (so the code that uses a buffer is generally faster), and there are many functions that only work on buffers. So I suggest to redesign the solution to whatever problem you are trying to deal with, such that you use a buffer (perhaps a temporary one) instead of a string. What problem was that, anyway?