I recently installed Emacs on Cygwin. When I first opened code in it, I got a sort of black-and-white syntax highlighting - keywords were white, function names in declarations were black on a white background, and generic code was grey.

I would like to get Emacs to use full color for syntax highlighting, but have not been able to figure out how to turn it on. Googling has mostly found outdated stuff; things like turning on font-lock-mode, which has been enabled by default since 22.1. Right now, my .emacs.d/init.el file contains this code relevant to highlighting:

(setq font-lock-auto-fontify t)
(add-hook 'find-file-hooks (lambda () (font-lock-mode 1)))

I found these snippets from websites that claimed to tell you how to enable syntax highlighting, but nothing I've tried, including the lines above, has changed anything.

Emacs seems to be analyzing syntax, but it is not using colors to show it. Does anyone know how to force it to use colors?

  • 1
    Emacs-NN.MM.9X are pretest versions, which should only be used when they're fresh (during the pretest). Do yourself a favor and use the 24.4 release instead.
    – Stefan
    Nov 28, 2014 at 4:28

1 Answer 1


Emacs was not using colors because the TERM environment variable was set to vt100. Changing it to xterm solved the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.