1

I am using Emacs Prelude. I didn't find most of the custom themes comfortable. I really liked Sublime Text 2's Monokai theme, so I installed the Monokai theme ported for Emacs. Though it is more or less similar to Sublime Text 2's Monokai, there are some differences which I want to correct, so as get my Emacs Monokai more close to Sublime's Monokai.

For example I don't want every Python keyword to be the bold pinkish. I would be prefer keywords like class,def to have a blue color than the pink ones and I would prefer the function arguments to have an orange color.

The Emacs Monokai theme seems to color the variable name to an orange color, which I don't want. How do I implement this? I checked the monokai-theme.el file, but I don't know what variable to edit and what variable to add to give the features in color changes I mentioned above.

Cœur
  • 37,241
  • 25
  • 195
  • 267
user1955184
  • 599
  • 1
  • 5
  • 18

1 Answers1

1

I suppose you're referring to this version of Monokai?

You'll be able to make some of your changes, but without doing a huge amount of work some of them won't be feasible. This theme uses font-lock to identify many of the things to be coloured, and font-lock identifies all Python keywords the same way.

Have a look through the various font-lock variables in that file. This will give you a good idea of what you can easily change. For example, if you want to change variables from orange to something else, change

'(font-lock-variable-name-face
  (:foreground monokai-orange))

to use one of the other monokai- colour variables, or define your own.

If you're trying to figure out how a particular character is recognized by Emacs, move your cursor over that character and do C-u C-x = (C-u M-x what-cursor-position). This will show, among other things, the face for that character.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
  • That's sad :( I guess,this is how most Emacs Color Themes work then? Is there any Emacs theme which gives me this functionality ? – user1955184 Jan 03 '14 at 16:28
  • @user1955184, yes, that's how most Emacs colour themes work. I think some modes bypass `font-lock` and have more advanced tokenization (`js2-mode` springs to mind), but for the most part you're stuck with what `font-lock` provides. – ChrisGPT was on strike Jan 03 '14 at 16:31
  • Is there way to make keyworded arguments in a function definition appear in a different color ? – user1955184 Jan 03 '14 at 16:44
  • @user1955184 doubtful, but you can see if they're recognized differently using `what-cursor-position`. I've updated my answer to include details on this. – ChrisGPT was on strike Jan 03 '14 at 16:49