From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: pjb@informatimago.com (Pascal J. Bourguignon) Newsgroups: gmane.emacs.help Subject: Re: Lisp Questions - reading a file and processes stalling Date: Mon, 22 Mar 2010 03:20:59 +0100 Organization: Informatimago Message-ID: <878w9lqepg.fsf@galatea.lan.informatimago.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1272996955 2054 80.91.229.12 (4 May 2010 18:15:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 4 May 2010 18:15:55 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 04 20:15:54 2010 connect(): No such file or directory Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O9Mev-0006pc-F5 for geh-help-gnu-emacs@m.gmane.org; Tue, 04 May 2010 20:15:53 +0200 Original-Received: from localhost ([127.0.0.1]:56348 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9Meu-0006L9-OY for geh-help-gnu-emacs@m.gmane.org; Tue, 04 May 2010 14:15:52 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 45 Original-X-Trace: individual.net z6225/VyHpsyFNwZ8TXgDQssmdoiIuXfKVAlOK2xrx/ufC4nug Cancel-Lock: sha1:MjZjZTBiYTg0ZmU5ZjVhOGQyYzI4ZWY1ZDQ5YmE4ZGU5YjNjOWE1Mg== sha1:JV25uN2HpCgA6BEU17CigQMfJTM= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (darwin) Original-Xref: usenet.stanford.edu gnu.emacs.help:177534 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: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:73028 Archived-At: Jeff Clough writes: > I've got a few questions I'm hoping someone here can answer. > > First, what is the lightest weight way of getting the contents of a file > into a buffer? Stepping through insert-file-contents and > format-insert-file (with the requisite nil) seems to involve huge > numbers of calls and a lot of winding/unwinding the stack. insert-file-contents is really the lightest weight of getting the content of a file into a buffer. Why do you doubt it? Otherwise you may like find-file-literally, but it does more work. > I have a > function that wants to open thousands of files, examine them then put > them away. This is obviously slow and I'm wondering if I made some > boneheaded error in using these functions in the first place. To be > fair, my code is slow for reasons other than this, but I'm taking one > lump of molasses at a time. Openning thousands of files will be slow anyways. The standard solution is to build an index with the data you need, so that you can just open one index file. > Second, I have Emacs running an external program as a process. When > some other lengthy operation is happening elsewhere in Emacs (like Gnus > is trying to display the headers for a group*), that process stalls, > then picks up where it left off once the operation is done. Is there > any way to make Emacs not steal the resources from this process, or am I > doing something hopelessly wrong? No, there's no way. GNU emacs is not multi-threaded. My solution is to run ERC and GNUS each in its own instance of emacs. -- __Pascal Bourguignon__