mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-12 16:23:57 +00:00
Font lock enabled by default.
This commit is contained in:
parent
74b99d45fd
commit
c4e8acbcfa
@ -1,3 +1,7 @@
|
||||
2005-11-21 Chong Yidong <cyd@stupidchicken.com>
|
||||
|
||||
* display.texi (Font Lock): Font lock is enabled by default now.
|
||||
|
||||
2005-11-20 Juri Linkov <juri@jurta.org>
|
||||
|
||||
* basic.texi (Position Info): Update examples of the output.
|
||||
|
@ -258,33 +258,36 @@ Some special modes, such as Occur mode and Info mode, have completely
|
||||
specialized ways of assigning fonts for Font Lock mode.
|
||||
|
||||
@findex font-lock-mode
|
||||
Font Lock mode is turned on by default in all modes which support it.
|
||||
You can toggle font-lock for each buffer with the command @kbd{M-x
|
||||
font-lock-mode}. Using a positive argument unconditionally turns Font
|
||||
Lock mode on, and a negative or zero argument turns it off.
|
||||
|
||||
@findex global-font-lock-mode
|
||||
@vindex global-font-lock-mode
|
||||
If you do not wish Font Lock mode to be turned on by default,
|
||||
customize the variable @code{global-font-lock-mode} using the Customize
|
||||
interface (@pxref{Easy Customization}), or use the function
|
||||
@code{global-font-lock-mode} in your @file{.emacs} file, like this:
|
||||
|
||||
@example
|
||||
(global-font-lock-mode 0)
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
Global Font Lock mode can also be set using the menu bar Options menu,
|
||||
specifying first Syntax Highlighting and then Save Options.
|
||||
|
||||
@findex turn-on-font-lock
|
||||
The command @kbd{M-x font-lock-mode} turns Font Lock mode on with
|
||||
positive argument, off with negative or zero argument, and toggles the
|
||||
mode when it has no argument. The function @code{turn-on-font-lock}
|
||||
unconditionally enables Font Lock mode. This is useful in mode-hook
|
||||
functions. For example, to enable Font Lock mode whenever you edit a
|
||||
C file, you can do this:
|
||||
If you have disabled Global Font Lock mode, you can still enable font
|
||||
lock for specific major modes by adding the function
|
||||
@code{turn-on-font-lock} to the mode hooks (@pxref{Hooks}). For
|
||||
example, to enable Font Lock mode for editing C files, you can do this:
|
||||
|
||||
@example
|
||||
(add-hook 'c-mode-hook 'turn-on-font-lock)
|
||||
@end example
|
||||
|
||||
@findex global-font-lock-mode
|
||||
@vindex global-font-lock-mode
|
||||
To turn on Font Lock mode automatically in all modes which support
|
||||
it, customize the variable @code{global-font-lock-mode} using the
|
||||
Customize interface (@pxref{Easy Customization}) or use the function
|
||||
@code{global-font-lock-mode} in your @file{.emacs} file, like this:
|
||||
|
||||
@example
|
||||
(global-font-lock-mode 1)
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
You can also specify this using the menu bar Options menu, specifying
|
||||
first Syntax Highlighting and then Save Options.
|
||||
|
||||
Font Lock mode uses several specifically named faces to do its job,
|
||||
including @code{font-lock-string-face}, @code{font-lock-comment-face},
|
||||
and others. The easiest way to find them all is to use
|
||||
|
Loading…
Reference in New Issue
Block a user