diff options
| author | Lars Ingebrigtsen | 2016-04-29 23:53:12 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-04-29 23:53:12 +0200 |
| commit | 27abf372836532c57be2e9e3ed23413729cc07fc (patch) | |
| tree | f592066f72134fe77e4d1496970e7cd0eaa2432c | |
| parent | 323b69664914d687fd4b48593479cea223dfbcb4 (diff) | |
| download | emacs-27abf372836532c57be2e9e3ed23413729cc07fc.tar.gz emacs-27abf372836532c57be2e9e3ed23413729cc07fc.zip | |
Fill font-lock-mode doc string
* lisp/font-core.el (font-lock-mode): Fill the text to make it
narrower (bug#18008).
| -rw-r--r-- | lisp/font-core.el | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/lisp/font-core.el b/lisp/font-core.el index a0971a17f5f..b3da8970500 100644 --- a/lisp/font-core.el +++ b/lisp/font-core.el | |||
| @@ -86,46 +86,50 @@ When Font Lock mode is enabled, text is fontified as you type it: | |||
| 86 | 86 | ||
| 87 | - Comments are displayed in `font-lock-comment-face'; | 87 | - Comments are displayed in `font-lock-comment-face'; |
| 88 | - Strings are displayed in `font-lock-string-face'; | 88 | - Strings are displayed in `font-lock-string-face'; |
| 89 | - Certain other expressions are displayed in other faces according to the | 89 | - Certain other expressions are displayed in other faces |
| 90 | value of the variable `font-lock-keywords'. | 90 | according to the value of the variable `font-lock-keywords'. |
| 91 | 91 | ||
| 92 | To customize the faces (colors, fonts, etc.) used by Font Lock for | 92 | To customize the faces (colors, fonts, etc.) used by Font Lock for |
| 93 | fontifying different parts of buffer text, use \\[customize-face]. | 93 | fontifying different parts of buffer text, use \\[customize-face]. |
| 94 | 94 | ||
| 95 | You can enable Font Lock mode in any major mode automatically by turning on in | 95 | You can enable Font Lock mode in any major mode automatically by |
| 96 | the major mode's hook. For example, put in your ~/.emacs: | 96 | turning on in the major mode's hook. For example, put in your |
| 97 | ~/.emacs: | ||
| 97 | 98 | ||
| 98 | (add-hook \\='c-mode-hook \\='turn-on-font-lock) | 99 | (add-hook \\='c-mode-hook \\='turn-on-font-lock) |
| 99 | 100 | ||
| 100 | Alternatively, you can use Global Font Lock mode to automagically turn on Font | 101 | Alternatively, you can use Global Font Lock mode to automagically |
| 101 | Lock mode in buffers whose major mode supports it and whose major mode is one | 102 | turn on Font Lock mode in buffers whose major mode supports it |
| 102 | of `font-lock-global-modes'. For example, put in your ~/.emacs: | 103 | and whose major mode is one of `font-lock-global-modes'. For |
| 104 | example, put in your ~/.emacs: | ||
| 103 | 105 | ||
| 104 | (global-font-lock-mode t) | 106 | (global-font-lock-mode t) |
| 105 | 107 | ||
| 106 | Where major modes support different levels of fontification, you can use | 108 | Where major modes support different levels of fontification, you |
| 107 | the variable `font-lock-maximum-decoration' to specify which level you | 109 | can use the variable `font-lock-maximum-decoration' to specify |
| 108 | generally prefer. When you turn Font Lock mode on/off the buffer is | 110 | which level you generally prefer. When you turn Font Lock mode |
| 109 | fontified/defontified, though fontification occurs only if the buffer is | 111 | on/off the buffer is fontified/defontified, though fontification |
| 110 | less than `font-lock-maximum-size'. | 112 | occurs only if the buffer is less than `font-lock-maximum-size'. |
| 111 | 113 | ||
| 112 | To add your own highlighting for some major mode, and modify the highlighting | 114 | To add your own highlighting for some major mode, and modify the |
| 113 | selected automatically via the variable `font-lock-maximum-decoration', you can | 115 | highlighting selected automatically via the variable |
| 114 | use `font-lock-add-keywords'. | 116 | `font-lock-maximum-decoration', you can use |
| 117 | `font-lock-add-keywords'. | ||
| 115 | 118 | ||
| 116 | To fontify a buffer, without turning on Font Lock mode and regardless of buffer | 119 | To fontify a buffer, without turning on Font Lock mode and |
| 117 | size, you can use \\[font-lock-fontify-buffer]. | 120 | regardless of buffer size, you can use \\[font-lock-fontify-buffer]. |
| 118 | 121 | ||
| 119 | To fontify a block (the function or paragraph containing point, or a number of | 122 | To fontify a block (the function or paragraph containing point, |
| 120 | lines around point), perhaps because modification on the current line caused | 123 | or a number of lines around point), perhaps because modification |
| 121 | syntactic change on other lines, you can use \\[font-lock-fontify-block]. | 124 | on the current line caused syntactic change on other lines, you |
| 125 | can use \\[font-lock-fontify-block]. | ||
| 122 | 126 | ||
| 123 | You can set your own default settings for some mode, by setting a | 127 | You can set your own default settings for some mode, by setting a |
| 124 | buffer local value for `font-lock-defaults', via its mode hook. | 128 | buffer local value for `font-lock-defaults', via its mode hook. |
| 125 | 129 | ||
| 126 | The above is the default behavior of `font-lock-mode'; you may specify | 130 | The above is the default behavior of `font-lock-mode'; you may |
| 127 | your own function which is called when `font-lock-mode' is toggled via | 131 | specify your own function which is called when `font-lock-mode' |
| 128 | `font-lock-function'. " | 132 | is toggled via `font-lock-function'. " |
| 129 | nil nil nil | 133 | nil nil nil |
| 130 | :after-hook (font-lock-initial-fontify) | 134 | :after-hook (font-lock-initial-fontify) |
| 131 | ;; Don't turn on Font Lock mode if we don't have a display (we're running a | 135 | ;; Don't turn on Font Lock mode if we don't have a display (we're running a |