Questions tagged [font-lock-mode]
8 questions
72
votes
5 answers
Change Emacs syntax highlighting colors
I'm running Emacs, editing files in C++ mode and PHP mode. I love syntax highlighting as a concept, but the default colors are a travesty. I can barely read some of them: way too dark. What is the easiest way to change their values? I can't seem to…

adum
- 2,890
- 3
- 25
- 30
8
votes
2 answers
Emacs: font-lock explanation
I'm using Emacs since a long time and I've customized it quite a lot. I've even written simple ELisp functions and now I'm starting to use macros more and more. I'm not anywhere near a knowledgable Emacs user but I'm not either a complete…

Cedric Martin
- 5,945
- 4
- 34
- 66
5
votes
2 answers
What's the font-lock-mode for in emacs?
I have font-lock mode on by putting (global-font-lock-mode 1) in .emacs. And, with font-lock mode "your program certainly look different" as explained in page 274 of Learning GNU emacs.
What I found was that, with python mode or org mode, when I…

prosseek
- 182,215
- 215
- 566
- 871
5
votes
1 answer
Font-lock-keywords: highlighting multiple sub-expression
When setting up font-lock-keywords for a GNU/Emacs mode, is it possible to highlight multiple sub-expressions of a regular expression with a single matcher? What I'd like to do is something along the lines of:
("\\(foo\\)-\\(bar\\)" '(1 foo-face)…

Thomas
- 17,016
- 4
- 46
- 70
3
votes
1 answer
How do I make emacs render mathematical combining characters in font-lock mode?
I am trying to get emacs to properly render mathematical combining characters such the diaeresis, over bar, etc in font-lock mode. The goal is to be able to write something mathematical like x_dot and have it be displayed as "ẋ", or x_bar as…

ivar
- 1,484
- 12
- 20
3
votes
1 answer
Is it possible to change an emacs syntax table based on context?
I'm working on improving an emacs major mode for UnrealScript. One of the (many) quirks is that it allows syntax like this for specifying tooltips in the Unreal editor:
var() int MyEditorVar ;
The…

Adam Rosenfield
- 390,455
- 97
- 512
- 589
1
vote
1 answer
Emacs: font-lock-fontify-region and multiline
I am writing a minor mode for php/html files. I use a function (cf. font-lock-keywords) to fontify blocs.
In order to fontify multilined blocs, I need to set font-lock-multiline to t.
Everything is running quite nicely. Their is just a…

fxbois
- 806
- 9
- 21
1
vote
1 answer
Font-Lock an Emacs-Lisp Regexp Group
I'm currently writing a major-mode for Emacs and am trying to figure out how to get syntax highlighting to work. My major-mode is for a lisp-like language that looks like this:
[= a 3]
[= [double x] [* x 2]]
[double a]
Basically, what I'm trying to…

Ajay Tatachar
- 383
- 3
- 16