Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

While emacs is running, how can I find out which color theme is currently in use?

share|improve this question

migrated from stackoverflow.com Aug 8 '11 at 3:48

This question came from our site for professional and enthusiast programmers.

add comment

4 Answers

up vote 5 down vote accepted

There isn't the concept of a current theme, and indeed, multiple themes can be applied in sequence to additively define the set of active faces. Support for theming was added into the latest Emacs versions (see M-x customize-theme), and there's still the option to "Select more than one theme at a time".

In short, when you activate a theme, you're not switching to that theme, but rather applying the changes specified in the theme to the faces it lists.

share|improve this answer
add comment

To add to sanityinc's response, you either set it yourself, or it's in your init.el (dotemacs) file.

I guess you are asking because you tried a couple of them and forgot right? I know I have, I wonder if you can check your Messages buffer to see the last one applied.

@sanityinc thanks for the explanation too. I noticed when I started to add more and more themes in succession, some areas, like the mini buffer wouldn't change or would be set to the last theme's value. now i know why.

share|improve this answer
    
In the old color-theme package, there's a var called color-theme-is-cumulative, which you could set to nil so that themes don't interfere with each other; it sounds like a good idea, but the results are usually wholly unexpected, I think partly because themes typically make assumptions about the built-in faces. –  sanityinc Aug 6 '11 at 18:04
    
yeah i noticed that assumption too, when i made one up... I'd copy from a 'popular' one but it'd have half the loc that the next one did... etc. Lead me to think that some themes just changed those variables that it 'wanted' to, and that there were hundreds to change so why bother. On a related note, i use chocolate rain theme and love it now. It's been on my 24.x build for many months. –  pjammer Aug 7 '11 at 2:07
    
I tried few color themes using the command "color-theme-select" , and i liked a color-theme but i had closed the color-theme-select buffer by then and also i forgot what i have selected, so i thought may be some variable is storing which color-theme is being applied currently. There is no logs about it in Messages buffer –  Talespin_Kit Aug 7 '11 at 8:17
    
Perhaps you can try M-x describe-face RET default RET (or a different non-default face), and then use M-x rgrep to look for color-theme .el files containing the same color names / hex values. –  sanityinc Aug 7 '11 at 12:15
add comment

M-x color-theme-print is useful to tell you exactly which font faces are in effect. It won't tell you which named color themes have been applied, but you should be able to work that out from your init file. If not, I suppose you must be using a mode that applies its own color theme (I know Proof General does this, and most irritating it is).

share|improve this answer
add comment

Share an example for using color-theme-print to get what theme I applied.

via 'M-x color-theme-print' you will get outputs about the color theme info, then find a typical value that is unique for different color themes, I choose 'background-color' whose value is 537182 for my emacs.

Open the color theme library 'color-theme-library.el' then search the file with keyword as '537182', then you'd get the theme name there.

Although not a straight-forward way but it really works, hope that helps!

share|improve this answer
add comment

Your Answer

 
discard

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.