mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-03-26 08:41:47 -07:00
Fill font-lock-mode doc string
* lisp/font-core.el (font-lock-mode): Fill the text to make it
narrower (bug#18008).
(cherry picked from commit 27abf37283)
This commit is contained in:
parent
df6cee9456
commit
db20f89634
1 changed files with 27 additions and 23 deletions
|
|
@ -86,46 +86,50 @@ When Font Lock mode is enabled, text is fontified as you type it:
|
||||||
|
|
||||||
- Comments are displayed in `font-lock-comment-face';
|
- Comments are displayed in `font-lock-comment-face';
|
||||||
- Strings are displayed in `font-lock-string-face';
|
- Strings are displayed in `font-lock-string-face';
|
||||||
- Certain other expressions are displayed in other faces according to the
|
- Certain other expressions are displayed in other faces
|
||||||
value of the variable `font-lock-keywords'.
|
according to the value of the variable `font-lock-keywords'.
|
||||||
|
|
||||||
To customize the faces (colors, fonts, etc.) used by Font Lock for
|
To customize the faces (colors, fonts, etc.) used by Font Lock for
|
||||||
fontifying different parts of buffer text, use \\[customize-face].
|
fontifying different parts of buffer text, use \\[customize-face].
|
||||||
|
|
||||||
You can enable Font Lock mode in any major mode automatically by turning on in
|
You can enable Font Lock mode in any major mode automatically by
|
||||||
the major mode's hook. For example, put in your ~/.emacs:
|
turning on in the major mode's hook. For example, put in your
|
||||||
|
~/.emacs:
|
||||||
|
|
||||||
(add-hook \\='c-mode-hook \\='turn-on-font-lock)
|
(add-hook \\='c-mode-hook \\='turn-on-font-lock)
|
||||||
|
|
||||||
Alternatively, you can use Global Font Lock mode to automagically turn on Font
|
Alternatively, you can use Global Font Lock mode to automagically
|
||||||
Lock mode in buffers whose major mode supports it and whose major mode is one
|
turn on Font Lock mode in buffers whose major mode supports it
|
||||||
of `font-lock-global-modes'. For example, put in your ~/.emacs:
|
and whose major mode is one of `font-lock-global-modes'. For
|
||||||
|
example, put in your ~/.emacs:
|
||||||
|
|
||||||
(global-font-lock-mode t)
|
(global-font-lock-mode t)
|
||||||
|
|
||||||
Where major modes support different levels of fontification, you can use
|
Where major modes support different levels of fontification, you
|
||||||
the variable `font-lock-maximum-decoration' to specify which level you
|
can use the variable `font-lock-maximum-decoration' to specify
|
||||||
generally prefer. When you turn Font Lock mode on/off the buffer is
|
which level you generally prefer. When you turn Font Lock mode
|
||||||
fontified/defontified, though fontification occurs only if the buffer is
|
on/off the buffer is fontified/defontified, though fontification
|
||||||
less than `font-lock-maximum-size'.
|
occurs only if the buffer is less than `font-lock-maximum-size'.
|
||||||
|
|
||||||
To add your own highlighting for some major mode, and modify the highlighting
|
To add your own highlighting for some major mode, and modify the
|
||||||
selected automatically via the variable `font-lock-maximum-decoration', you can
|
highlighting selected automatically via the variable
|
||||||
use `font-lock-add-keywords'.
|
`font-lock-maximum-decoration', you can use
|
||||||
|
`font-lock-add-keywords'.
|
||||||
|
|
||||||
To fontify a buffer, without turning on Font Lock mode and regardless of buffer
|
To fontify a buffer, without turning on Font Lock mode and
|
||||||
size, you can use \\[font-lock-fontify-buffer].
|
regardless of buffer size, you can use \\[font-lock-fontify-buffer].
|
||||||
|
|
||||||
To fontify a block (the function or paragraph containing point, or a number of
|
To fontify a block (the function or paragraph containing point,
|
||||||
lines around point), perhaps because modification on the current line caused
|
or a number of lines around point), perhaps because modification
|
||||||
syntactic change on other lines, you can use \\[font-lock-fontify-block].
|
on the current line caused syntactic change on other lines, you
|
||||||
|
can use \\[font-lock-fontify-block].
|
||||||
|
|
||||||
You can set your own default settings for some mode, by setting a
|
You can set your own default settings for some mode, by setting a
|
||||||
buffer local value for `font-lock-defaults', via its mode hook.
|
buffer local value for `font-lock-defaults', via its mode hook.
|
||||||
|
|
||||||
The above is the default behavior of `font-lock-mode'; you may specify
|
The above is the default behavior of `font-lock-mode'; you may
|
||||||
your own function which is called when `font-lock-mode' is toggled via
|
specify your own function which is called when `font-lock-mode'
|
||||||
`font-lock-function'. "
|
is toggled via `font-lock-function'. "
|
||||||
nil nil nil
|
nil nil nil
|
||||||
:after-hook (font-lock-initial-fontify)
|
:after-hook (font-lock-initial-fontify)
|
||||||
;; Don't turn on Font Lock mode if we don't have a display (we're running a
|
;; Don't turn on Font Lock mode if we don't have a display (we're running a
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue