What's the font-lock-mode for in emacs?
Asked Answered
D

2

6

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 change the font for that mode, some of the keywords are not shown because of the change in color. I mean, some of the characters(keywords) becomes white, and when the background color is white, those keywords are not seen anymore.

  • Is this expected behavior? With font-lock mode, am I supposed not to change any font?
  • What's the good for font-lock mode?

This is the code for changing default code.

;;; http://www.emacswiki.org/emacs/AquamacsFAQ
(set-default-font "-apple-dejavu sans mono-medium-r-normal--0-0-0-0-m-0-mac-roman")

And I used the following options to change a font for specific mode. http://a.imageshack.us/img823/2772/fontq.png

Dorset answered 26/8, 2010 at 22:1 Comment(3)
How exactly did you change the font? Post an excerpt from your .emacs, if possible.Callis
Font-lock-mode is to do syntax highlighting. You seem to have customized your highlighting to become unreadable.Hagood
@Paul : Does emacs have different color set of highlighting for each font?Dorset
V
3
  • Is this expected behavior? With font-lock mode, am I supposed not to change any font?

Yes. You have to customize the font faces and colors using customize-face command (change colors starting with "Font Lock"), or use a theme engine like color-theme.

  • What's the good for font-lock mode?

You can customize and extend font-lock to your need as this is the case for all things in emacs. This is the basic system for syntax highlighting that is used by the majority of the emacs users.

You have to learn how to customize it to your needs (C-h i m Emacs RET m Font Lock RET )

Viv answered 27/8, 2010 at 4:1 Comment(0)
H
1

From the emacs help on function font-lock-mode:

Toggle Font Lock mode.
With arg, turn Font Lock mode off if and only if arg is a non-positive
number; if arg is nil, toggle Font Lock mode; anything else turns Font
Lock on.
(Font Lock is also known as "syntax highlighting".)
Hagood answered 26/8, 2010 at 23:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.