Emacs highlighting fixes

Some further fixes to Emacs syntax highlighting, see the individual commit message for the gory details.
Did you mean `immutable` instead of `function`?