Emacs cc major mode showing no color on Ubuntu but lisp mode does

231 views Asked by At

How do I fix that?

I open xemacs and have lovely colors. I open a .c or .cpp file and cc-mode loads - lovely - but no color is displayed.

Installed emacs, version:

XEmacs 21.4 (patch 22) "Instant Classic" [Lucid] (x86_64-linux-gnu, Mule) of Mon Nov 21 2011 on allspice

2

There are 2 answers

0
deong On

Does something like this in your .emacs do the trick?

(add-hook 'c-mode-common-hook
  (lambda () (font-lock-mode t)))

I haven't tested it in xemacs, but the basic idea ought to work, even if you have to tweak things a bit.

0
Mike Kupfer On

I have

(require 'font-lock)

in one of the files that I load on XEmacs startup. That enables font-lock for all files.