I edited a perl script
recently and since the edits, XEmacs
refuses to do the cperl-mode
syntax highlighting automatically.
I have been able to force the buffer to do the syntax highlighting in 2 different ways:
Options->Syntax Highlighting->Lazy Lock
M-x font-lock-fontify-buffer
For the life of me, I have not been able to figure out why these work-arounds are necessary. Other .pl files
open with syntax highlighting just fine. The script runs, so it's valid code.
I tried updating. I tried adding things to the init.el file
to run the font-lock-fontify-buffer
command upon opening a file. After trying a bunch of things, I finally just blew away the init.el file
away and it still opens other .pl files
fine, but still chokes on this one file.
Whenever I open the file, the last status message printed is "Loading cperl-mode...done"
(same as other .pl files
without any errors).
Another thing that fails to happen is the window doesn't automatically resize to 80 columns.
question
Any idea why this is happening and how to get the syntax highlighting to work on ALL .pl files?
I don't use XEmacs, but GNU Emacs has a font-lock-maximum-size
variable. XEmacs probably has the same or a similar setting. You may need to increase that, or just set it to nil
.