tags:

views:

154

answers:

4

I was digging through the header files for SDL in Linux when I tried to open the file from the SDL library called "SDL_opengl.h" in Emacs. For some reason, it always causes it to crash. It opens just fine in Vim and in gedit.

Has anyone else had an issue with Emacs just plain refusing to open a particular file? What sort of things should I look for to find what is causing the problem? Mind you, I was able to open every other "SDL_*.h" file in that directory; just that one gives me trouble.

Much appreciated in advance!

+1  A: 

I would be interested to see the exact error message, and stack trace if possible.

I suspect file encoding, special characters, file size, cc-mode parsing, or something like that to be the culprit. (emacs 22 and libsdl1.2 on ubuntu 9 with utf-8 screen works fine for me)

John Weldon
A: 

Oh goodness, I'm a dunce.

So I apparently underestimated both the size of the file AND the speed of Emacs in opening said large files.

I decided to sit and wait to see if it dies completely on its own (as opposed to me xkill-ing it), and after a whole minute, the file is loaded.

So that solves one problem - the file is being loaded. However, why would Emacs take so long to do it? I have no strange settings enabled that should cause it to lag more than usual.

giogadi
Is the loading speed the same if you start emacs with '-q' option? And, with '-q -no-site-file'?
Laurynas Biveinis
What's the size of the file? You might want to open large files with M-x find-file-literally which forces fundamental mode.
Trey Jackson
Yeah, I tried running emacs with -q and --no-site-file and it's still hanging for about a minute before the file opens. It's not even that big of a file - only 400KB at most.
giogadi
What extension does it have (or, more importantly, what mode did it end up in)? Did you try the find-file-literally?
Trey Jackson
I just opened that file. Including loading cc-mode it took about 1.5 seconds.
justinhj
Interestingly, I just installed the snapshot of Emacs23 today and give it a try there and it works wonderfully.As for Emacs22: Trey's suggestion of using find-file-literally worked. So, the problem lies somewhere in Emacs converting the format/character code. But conversion shouldn't be that slow, should it?Also, the mode it ends up in shouldn't be problem, since I've tried opening the file in fundamental mode.
giogadi
Don't you know what "EMACS" stands for? "EMACS: EMACS Makes A Computer Slow" B-) (from the ...emacs/lib/humor folder...)
Brian Postow
A: 

have you hilit-mode on? with hilit-auto-highlight-maxout and a great value?

I have had the same problem with header-files, so reduce that value.

maybe it is hs-mode (hideshow-mode)?

Peter Miehle
A: 

Converting my comment into an answer b/c the comments get cut off.

Try loading the file with

M-x find-file-literally

Since this (appears to) resolve the issue for giogadi, I think that points to perhaps the colorization of the buffer. cc-mode does its own colorization...

Trey Jackson