Emacs and Perl cperl-mode Color Syntax weirdness after Ubuntu Upgrade

For a quite some time now I’ve been happily using Ubuntu on my desktop and the emacs-snapshot-gtk package of GNU Emacs to get good fonts and a recent Emacs. I edit a lot of Perl code and use cperl-mode to do so (as I have for years). However, recently I’ve noticed the color syntax highlighting to be rather buggy. At seemingly random times it’s loses the colors for a fairly large chunk of code. Other times it just messes up a few lines.

I try to flip font-lock-mode off and back on but the problem persists. It’s become annoying enough that it’s a real distraction. At times the colors flip on and off with every other keystroke, as if the matching engine has become a state machine which every other state disables highlighting. It’s rather odd considering how I’ve used GNU Emacs and cperl-mode flawlessly for many years now.

All the while, indentation and paren/brace/bracket matching seem to work just fine.

Anyone seen this? I’ve done some searching but haven’t turned up anything concrete. It seems to have become an issue when I started upgrading my computers from Ubuntu 9.04 to 9.10. Does this ring a bell for anyone else?

About Jeremy Zawodny

I'm a software engineer and pilot. I work at craigslist by day, hacking on various bits of back-end software and data systems. As a pilot, I fly Glastar N97BM, Just AirCraft SuperSTOL N119AM, Bonanza N200TE, and high performance gliders in the northern California and Nevada area. I'm also the original author of "High Performance MySQL" published by O'Reilly Media. I still speak at conferences and user groups on occasion.
This entry was posted in programming. Bookmark the permalink.

3 Responses to Emacs and Perl cperl-mode Color Syntax weirdness after Ubuntu Upgrade

  1. Tom says:

    I’ve never been able to get cperl-mode to color anything. I always have to use just plain old perl-mode.

  2. Douglas says:

    I had a number of annoying issues with emacs-gtk on ubuntu 9.10 as well as 10.04 (mine were with java mode, however). I ended up just compiling gnu emacs from source and left it at that. I too just use regular perl-mode so no insight on cperl-mode.

  3. Interestingly, I’ve found that emacs23 from Maverick’s repository yields better results with cperl-mode’s syntax highlighting than emacs-snapshot. Checking cperl-version for both versions shows that one uses 5.x, and the other uses 6.x. I guess 6.x has crappy syntax highlighting.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s