In Emacs, I'd like to highlight the parts of long lines that exceed 80 characters.
The package highlight-80+
is great for that. But how can I automatically enable it when a C++ source file is loaded?
I tried to add highlight-80+
to the C++ mode, but it didn't work:
(require 'highlight-80+)
(defun my-c++-mode-common-hook ()
(highlight-80+-mode 1))
(add-hook 'c++-mode-common-hook 'my-c++-mode-common-hook)
When I load a .cc file it goes in C++ mode but highlight-80+
is not enabled, so the long lines are not marked.