Skip to main content

Emacs: Syntax Highlighting


It's that time again! Whether it's because I'm drinking coffee and that's causing my compulsive obsessive nature to do crazy things, or because I'm inspired by other smart programmers who use Emacs, I'm getting "must use Emacs" cravings again. However, as soon as I started it up, the syntax highlighting irritations hit me like a stop sign over the head. The time, it's just a normal Python file. Notice how Emacs doesn't understand that double quotes can be embedded in triple double quotes. By the way, this isn't my code, so don't send me hate mail because there's HTML embedded in Python ;)

Comments

Anonymous said…
There is a patch for python-mode that resolves that. Grab the latest patch from http://sourceforge.net/tracker/index.php?func=detail&aid=1023335&group_id=86916&atid=581351
See also here.

From: Barry A. Warsaw
This is not something python-mode can realistically address. As you properly guess, because of limitations in Emacs' (and XEmacs') built-in syntax table implementation, python-mode has no choice but to treat triple quoted strings as three separate entities.
Brandon L. Golm said…
emacs users lisp