From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jeff Clough Newsgroups: gmane.emacs.help Subject: Re: Lisp Questions - reading a file and processes stalling Date: Sun, 21 Mar 2010 23:22:29 -0400 Organization: A noiseless patient Spider Message-ID: References: <878w9lqepg.fsf@galatea.lan.informatimago.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1272997036 2412 80.91.229.12 (4 May 2010 18:17:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 4 May 2010 18:17:16 +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:17:15 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 1O9MgB-0007XY-MH for geh-help-gnu-emacs@m.gmane.org; Tue, 04 May 2010 20:17:12 +0200 Original-Received: from localhost ([127.0.0.1]:56962 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9MgA-0007dG-9j for geh-help-gnu-emacs@m.gmane.org; Tue, 04 May 2010 14:17:10 -0400 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!feeder.eternal-september.org!eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 52 Injection-Date: Mon, 22 Mar 2010 03:19:08 +0000 (UTC) Injection-Info: feeder.eternal-september.org; posting-host="VDM3607lx+ft0F522riMcQ"; logging-data="25503"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19hgPpHgssReXxyCPTMEJwt" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:E2xZjJPofOYhiTO+gthMKyTzS3s= sha1:uzueTqpBJmECf0ZMi18EQRQGPb4= Original-Xref: usenet.stanford.edu gnu.emacs.help:177535 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:73029 Archived-At: pjb@informatimago.com (Pascal J. Bourguignon) writes: > insert-file-contents is really the lightest weight of getting the > content of a file into a buffer. Why do you doubt it? When I step through my function with the debugger I see insert-file-contents doing a lot of work. I haven't counted, but there's at least a dozen calls going on and that overhead seems...excessive. For instance, I can see it trying to match file extensions in several batches, I assume as an attempt to determine the correct mode for the buffer. I can't seem to find a way of telling Emacs to put the contents of the file in a buffer then move along. > Otherwise you may like find-file-literally, but it does more work. Interesting, and I see the related function insert-file-contents-literally. I'll take a look at it, but the statement "it does more work" probably means it's not going to be much different. > 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. Yeah, that's what I'm doing now. Realistically, it's unlikely that I'll ever have to process the entire set of files more than once (to generate the index), and can just process additions as they come. I'm just poking at the code, trying to figure out both what's going on under the hood and how to do things better. >> 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. Yeah, I didn't think so but it was worth asking the gurus. I'll probably just deal with it since I'm generally happier with just one instance of emacs. For now, at least. Thanks! Jeff