Emacs highlighting fixes

Some further fixes to Emacs syntax highlighting, see the individual commit message for the gory details.