diff options
| author | Chong Yidong | 2005-11-21 05:02:37 +0000 |
|---|---|---|
| committer | Chong Yidong | 2005-11-21 05:02:37 +0000 |
| commit | c4e8acbcfa34adc5336379d34ceeb8578b88267c (patch) | |
| tree | bff08490617256b665e5fc532d7568372bfb0fc6 | |
| parent | 74b99d45fd43a12213709ffdbdbadab67b9fdfba (diff) | |
| download | emacs-c4e8acbcfa34adc5336379d34ceeb8578b88267c.tar.gz emacs-c4e8acbcfa34adc5336379d34ceeb8578b88267c.zip | |
Font lock enabled by default.
| -rw-r--r-- | man/ChangeLog | 4 | ||||
| -rw-r--r-- | man/display.texi | 37 |
2 files changed, 24 insertions, 17 deletions
diff --git a/man/ChangeLog b/man/ChangeLog index 0590f63c555..b95063cb2d9 100644 --- a/man/ChangeLog +++ b/man/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2005-11-21 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * display.texi (Font Lock): Font lock is enabled by default now. | ||
| 4 | |||
| 1 | 2005-11-20 Juri Linkov <juri@jurta.org> | 5 | 2005-11-20 Juri Linkov <juri@jurta.org> |
| 2 | 6 | ||
| 3 | * basic.texi (Position Info): Update examples of the output. | 7 | * basic.texi (Position Info): Update examples of the output. |
diff --git a/man/display.texi b/man/display.texi index 42ea7ace2eb..cc345b93b8f 100644 --- a/man/display.texi +++ b/man/display.texi | |||
| @@ -258,32 +258,35 @@ Some special modes, such as Occur mode and Info mode, have completely | |||
| 258 | specialized ways of assigning fonts for Font Lock mode. | 258 | specialized ways of assigning fonts for Font Lock mode. |
| 259 | 259 | ||
| 260 | @findex font-lock-mode | 260 | @findex font-lock-mode |
| 261 | @findex turn-on-font-lock | 261 | Font Lock mode is turned on by default in all modes which support it. |
| 262 | The command @kbd{M-x font-lock-mode} turns Font Lock mode on with | 262 | You can toggle font-lock for each buffer with the command @kbd{M-x |
| 263 | positive argument, off with negative or zero argument, and toggles the | 263 | font-lock-mode}. Using a positive argument unconditionally turns Font |
| 264 | mode when it has no argument. The function @code{turn-on-font-lock} | 264 | Lock mode on, and a negative or zero argument turns it off. |
| 265 | unconditionally enables Font Lock mode. This is useful in mode-hook | ||
| 266 | functions. For example, to enable Font Lock mode whenever you edit a | ||
| 267 | C file, you can do this: | ||
| 268 | |||
| 269 | @example | ||
| 270 | (add-hook 'c-mode-hook 'turn-on-font-lock) | ||
| 271 | @end example | ||
| 272 | 265 | ||
| 273 | @findex global-font-lock-mode | 266 | @findex global-font-lock-mode |
| 274 | @vindex global-font-lock-mode | 267 | @vindex global-font-lock-mode |
| 275 | To turn on Font Lock mode automatically in all modes which support | 268 | If you do not wish Font Lock mode to be turned on by default, |
| 276 | it, customize the variable @code{global-font-lock-mode} using the | 269 | customize the variable @code{global-font-lock-mode} using the Customize |
| 277 | Customize interface (@pxref{Easy Customization}) or use the function | 270 | interface (@pxref{Easy Customization}), or use the function |
| 278 | @code{global-font-lock-mode} in your @file{.emacs} file, like this: | 271 | @code{global-font-lock-mode} in your @file{.emacs} file, like this: |
| 279 | 272 | ||
| 280 | @example | 273 | @example |
| 281 | (global-font-lock-mode 1) | 274 | (global-font-lock-mode 0) |
| 282 | @end example | 275 | @end example |
| 283 | 276 | ||
| 284 | @noindent | 277 | @noindent |
| 285 | You can also specify this using the menu bar Options menu, specifying | 278 | Global Font Lock mode can also be set using the menu bar Options menu, |
| 286 | first Syntax Highlighting and then Save Options. | 279 | specifying first Syntax Highlighting and then Save Options. |
| 280 | |||
| 281 | @findex turn-on-font-lock | ||
| 282 | If you have disabled Global Font Lock mode, you can still enable font | ||
| 283 | lock for specific major modes by adding the function | ||
| 284 | @code{turn-on-font-lock} to the mode hooks (@pxref{Hooks}). For | ||
| 285 | example, to enable Font Lock mode for editing C files, you can do this: | ||
| 286 | |||
| 287 | @example | ||
| 288 | (add-hook 'c-mode-hook 'turn-on-font-lock) | ||
| 289 | @end example | ||
| 287 | 290 | ||
| 288 | Font Lock mode uses several specifically named faces to do its job, | 291 | Font Lock mode uses several specifically named faces to do its job, |
| 289 | including @code{font-lock-string-face}, @code{font-lock-comment-face}, | 292 | including @code{font-lock-string-face}, @code{font-lock-comment-face}, |