help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lisp Questions - reading a file and processes stalling


From: Pascal J. Bourguignon
Subject: Re: Lisp Questions - reading a file and processes stalling
Date: Tue, 04 May 2010 15:43:05 -0000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (darwin)

Jeff Clough <jeff@chaosphere.com> 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__


reply via email to

[Prev in Thread] Current Thread [Next in Thread]