0

Trying to get a mode to work with silverstipe templates.

How do I set the background of the <% %> tag to be a darker color?

Mario Michelli
  • 523
  • 1
  • 5
  • 11

2 Answers2

0

According to your link, the face that highlights <% and %> is face font-lock-keyword-face.

If you want that face to be darker everywhere, then customize it, as @db48x suggested.

If you instead want to leave that face alone but have <% and %> be darker in silverstripe-mode then use a different, darker face in your font-lock-add-keywords expression. Use defface to define a new face, and use that.

Drew
  • 29,895
  • 7
  • 74
  • 104
0

You can customize any face using the customization system, but the trick is to know which face you have to edit to get the look that you want. There is a shortcut you can use in this case: position the point over the text in question and run M-x describe-face. This asks for a face name, but the default if you leave the input blank is the face used by the text at point. This gets you a help window with information about the face, including a link that takes you to its customization page.

db48x
  • 3,108
  • 24
  • 16
  • Thank you, but I was trying to colour the background of the tag not change any of the already used faces. html-mode does nothing with <% %> tags (silverstripe template tag) – Mario Michelli Jul 05 '11 at 19:08
  • if it's leaving them in the default face then you'll need to change the mode itself to make it recognize them. – db48x Jul 06 '11 at 15:05
  • yes, that's why I linked to the mode I am trying to update to do that. – Mario Michelli Jul 07 '11 at 05:48