Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to use different color-theme for different file types. I tried to use add-hook to set the color-theme for the major-mode, but it only applies when the buffer is first load. If I switch to another buffer and switch back, the color-theme will stay the same as it is in the previous buffer. Then I tried to set the window-configuration-change-hook, but the window blinks every time I press C-x, or M-x, or whatever that change the window properties.

Is there a better way to set the color-theme for each buffer?

share|improve this question
up vote 2 down vote accepted

If you happen to be using emacs 24, color-theme-buffer-local in the package manager will do what you want.

The version here reportedly works with 23.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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