tags:

views:

97

answers:

2

Hi all.

I'm looking for a way to quickly open files in my project's source tree. What I've been doing so far is adding files to the file-name-cache like so:

(file-cache-add-directory-recursively (concat project-root "some/sub/folder") ".*\\.\\(py\\)$")

after which I can use anything-for-files to access any file in the source tree with about 4 keystrokes.

Unfortunately, this solution started falling over today. I've added another folder to the cache and emacs has started running out of memory. What's weird is that this folder contains less than 25% of files I'm adding, and yet emacs memory use goes up from 20mb to 400mb on adding just this folder. The total number of files is around 2000, so this memory use seems very high. Presumably I'm abusing the file cache.

Anyway, what do other people do for this? I like this solution for its simplicity and speed; I've looked at some of the many, many project management packages for emacs and none of them really grabbed me...

Thanks in advance!

Simon

A: 

I'd suggest you take a look at this article. I have to support Trey's comment - I don't think your approach is very good at the moment.

Bozhidar Batsov
Thanks - I'll check out FindFileInProject.
bbbscarter
+2  A: 

Testing here give me no problem with some 50000 file (well, I had to say that I had to wait some time, but Emacs only use 48 mB when it finished), You seem to have been hit by some bug you should probably report.

Rémi
Thanks for the information. I've now tried the same folder on Emacs 23.1 with win32, cygwin and linux, all with emacs -q, and they all cause memory to spike quite high. The difference is that, under linux, it comes down again whereas under win32 it stays high, even after forcing a garbage collect.Anyway, it's good to know that:a) My approach isn't completely insane and it works for other people.b) The problem I'm hitting is probably a bug. Thanks for the help!Simon
bbbscarter