diff options
| author | Chong Yidong | 2008-08-31 02:11:52 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-08-31 02:11:52 +0000 |
| commit | 956c76efe48835e005b84e1b23e418a6bedde8a1 (patch) | |
| tree | df82cae100f0a9c4b20650240ebccea5cbf746a3 | |
| parent | fa9f971a145b3d63a06c08abd0c028cfb1c9a847 (diff) | |
| download | emacs-956c76efe48835e005b84e1b23e418a6bedde8a1.tar.gz emacs-956c76efe48835e005b84e1b23e418a6bedde8a1.zip | |
(Display): Move Temporary Face Changes node to just
after Standard Faces.
(Scrolling): Document recenter-top-bottom instead of recenter.
(Horizontal Scrolling): Move auto hscroll discussion to the top.
(Faces, Standard Faces, Temporary Face Changes, Useless Whitespace)
(Display Custom): Copyedits.
(Optional Mode Line): Document display-battery-mode.
| -rw-r--r-- | doc/emacs/display.texi | 631 |
1 files changed, 294 insertions, 337 deletions
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index fdeeda2e617..4c3ba1f9a93 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi | |||
| @@ -7,11 +7,8 @@ | |||
| 7 | 7 | ||
| 8 | Since only part of a large buffer fits in the window, Emacs tries to | 8 | Since only part of a large buffer fits in the window, Emacs tries to |
| 9 | show a part that is likely to be interesting. Display-control | 9 | show a part that is likely to be interesting. Display-control |
| 10 | commands allow you to specify which part of the text you want to see, | 10 | commands and variables allow you to specify which part of the text you |
| 11 | and how to display it. Many variables also affect the details of | 11 | want to see, and how to display it. |
| 12 | redisplay. Unless otherwise stated, the variables described in this | ||
| 13 | chapter have their effect by customizing redisplay itself; therefore, | ||
| 14 | their values only make a difference at the time of redisplay. | ||
| 15 | 12 | ||
| 16 | @menu | 13 | @menu |
| 17 | * Scrolling:: Commands to move text up and down in a window. | 14 | * Scrolling:: Commands to move text up and down in a window. |
| @@ -20,6 +17,7 @@ their values only make a difference at the time of redisplay. | |||
| 20 | * Follow Mode:: Follow mode lets two windows scroll as one. | 17 | * Follow Mode:: Follow mode lets two windows scroll as one. |
| 21 | * Faces:: How to change the display style using faces. | 18 | * Faces:: How to change the display style using faces. |
| 22 | * Standard Faces:: Emacs' predefined faces. | 19 | * Standard Faces:: Emacs' predefined faces. |
| 20 | * Temporary Face Changes:: Commands to temporarily modify the default text face | ||
| 23 | * Font Lock:: Minor mode for syntactic highlighting using faces. | 21 | * Font Lock:: Minor mode for syntactic highlighting using faces. |
| 24 | * Highlight Interactively:: Tell Emacs what text to highlight. | 22 | * Highlight Interactively:: Tell Emacs what text to highlight. |
| 25 | * Fringes:: Enabling or disabling window fringes. | 23 | * Fringes:: Enabling or disabling window fringes. |
| @@ -32,7 +30,6 @@ their values only make a difference at the time of redisplay. | |||
| 32 | * Line Truncation:: Truncating lines to fit the screen width instead | 30 | * Line Truncation:: Truncating lines to fit the screen width instead |
| 33 | of continuing them to multiple screen lines. | 31 | of continuing them to multiple screen lines. |
| 34 | * Visual Line Mode:: Word wrap and screen line-based editing. | 32 | * Visual Line Mode:: Word wrap and screen line-based editing. |
| 35 | * Temporary Face Changes:: Commands to temporarily modify the default text face | ||
| 36 | * Display Custom:: Information on variables for customizing display. | 33 | * Display Custom:: Information on variables for customizing display. |
| 37 | @end menu | 34 | @end menu |
| 38 | 35 | ||
| @@ -51,37 +48,52 @@ Scrolling ``backward'' or ``down'' moves text down, and new text | |||
| 51 | appears at the top. | 48 | appears at the top. |
| 52 | 49 | ||
| 53 | Scrolling happens automatically if you move point past the bottom or | 50 | Scrolling happens automatically if you move point past the bottom or |
| 54 | top of the window. You can also scroll explicitly with the commands | 51 | top of the window. You can also scroll explicitly with these |
| 55 | in this section. | 52 | commands: |
| 56 | 53 | ||
| 57 | @table @kbd | 54 | @table @kbd |
| 58 | @item C-l | 55 | @item C-l |
| 59 | Clear screen and redisplay, scrolling the selected window to center | 56 | Scroll the selected window to center point vertically within it and |
| 60 | point vertically within it (@code{recenter}). | 57 | redisplay the screen (@code{recenter-top-bottom}). |
| 61 | @item C-v | 58 | @item C-v |
| 62 | Scroll forward (a windowful or a specified number of lines) (@code{scroll-up}). | 59 | @itemx @key{NEXT} |
| 63 | @item @key{NEXT} | ||
| 64 | @itemx @key{PAGEDOWN} | 60 | @itemx @key{PAGEDOWN} |
| 65 | Likewise, scroll forward. | 61 | Scroll forward by nearly a full window (@code{scroll-up}). |
| 66 | @item M-v | 62 | @item M-v |
| 67 | Scroll backward (@code{scroll-down}). | 63 | @itemx @key{PRIOR} |
| 68 | @item @key{PRIOR} | ||
| 69 | @itemx @key{PAGEUP} | 64 | @itemx @key{PAGEUP} |
| 70 | Likewise, scroll backward. | 65 | Scroll backward (@code{scroll-down}). |
| 71 | @item @var{arg} C-l | ||
| 72 | Scroll so point is on line @var{arg} (@code{recenter}). | ||
| 73 | @item C-M-l | 66 | @item C-M-l |
| 74 | Scroll heuristically to bring useful information onto the screen | 67 | Scroll heuristically to bring useful information onto the screen |
| 75 | (@code{reposition-window}). | 68 | (@code{reposition-window}). |
| 76 | @end table | 69 | @end table |
| 77 | 70 | ||
| 78 | @kindex C-l | 71 | @kindex C-l |
| 79 | @findex recenter | 72 | @findex recenter-top-bottom |
| 80 | The most basic scrolling command is @kbd{C-l} (@code{recenter}) with | 73 | The most basic scrolling command is @kbd{C-l} |
| 81 | no argument. It scrolls the selected window so that point is halfway | 74 | (@code{recenter-top-bottom}). This @dfn{recenters} the selected |
| 82 | down from the top of the window. On a text terminal, it also clears | 75 | window, scrolling it so that the current screen line is exactly in the |
| 83 | the screen and redisplays all windows. That is useful in case the | 76 | center of the window, or as close to the center as possible. It also |
| 84 | screen is garbled (@pxref{Screen Garbled}). | 77 | clears the screen and redisplays all windows; this is useful in case |
| 78 | the screen becomes garbled for any reason (@pxref{Screen Garbled}). | ||
| 79 | |||
| 80 | Typing @kbd{C-l} twice in a row (@kbd{C-l C-l}) scrolls the window | ||
| 81 | so that point is on the topmost screen line. Typing a third @kbd{C-l} | ||
| 82 | scrolls the window so that point is on the bottom-most screen line. | ||
| 83 | Each successive @kbd{C-l} cycles through these three screen positions. | ||
| 84 | (If you change the variable @code{scroll-margin} to a non-zero value | ||
| 85 | @var{n}, Emacs leaves @var{n} screen lines between point and the top | ||
| 86 | or bottom of the window. @xref{Auto Scrolling}.) | ||
| 87 | |||
| 88 | You can also supply @kbd{C-l} with a prefix argument. With a plain | ||
| 89 | prefix argument, @kbd{C-u C-l}, Emacs simply recenters point. With a | ||
| 90 | positive argument @var{n}, it scrolls to place point @var{n} lines | ||
| 91 | down from the top of the window. An argument of zero puts point on | ||
| 92 | the topmost line. A negative argument @var{-n} puts point @var{n} | ||
| 93 | lines from the bottom of the window. For example, @kbd{C-u - 1 C-l} | ||
| 94 | puts point on the bottom line, and @kbd{C-u - 5 C-l} puts it five | ||
| 95 | lines from the bottom. When given an argument, @kbd{C-l} does not | ||
| 96 | clear the screen or cycle through different screen positions. | ||
| 85 | 97 | ||
| 86 | @kindex C-v | 98 | @kindex C-v |
| 87 | @kindex M-v | 99 | @kindex M-v |
| @@ -92,61 +104,44 @@ screen is garbled (@pxref{Screen Garbled}). | |||
| 92 | @findex scroll-up | 104 | @findex scroll-up |
| 93 | @findex scroll-down | 105 | @findex scroll-down |
| 94 | To read the buffer a windowful at a time, use @kbd{C-v} | 106 | To read the buffer a windowful at a time, use @kbd{C-v} |
| 95 | (@code{scroll-up}) with no argument. This scrolls forward by nearly | 107 | (@code{scroll-up}). This scrolls forward by nearly the whole window |
| 96 | the whole window height. The effect is to take the two lines at the | 108 | height. The effect is to take the two lines at the bottom of the |
| 97 | bottom of the window and put them at the top, followed by nearly a | 109 | window and put them at the top, followed by lines that were not |
| 98 | whole windowful of lines that were not previously visible. If point | 110 | previously visible. If point was in the text that scrolled off the |
| 99 | was in the text that scrolled off the top, it ends up at the new top | 111 | top, it ends up at the new top of the window. |
| 100 | of the window. | 112 | |
| 113 | @kbd{M-v} (@code{scroll-down}) scrolls backward in a similar way. | ||
| 101 | 114 | ||
| 102 | @vindex next-screen-context-lines | 115 | @vindex next-screen-context-lines |
| 103 | @kbd{M-v} (@code{scroll-down}) with no argument scrolls backward in | 116 | The variable @code{next-screen-context-lines} controls the number of |
| 104 | a similar way, also with overlap. The number of lines of overlap that | 117 | lines of overlap left by @kbd{C-v} or @kbd{M-v}; by default, it is 2. |
| 105 | the @kbd{C-v} or @kbd{M-v} commands leave is controlled by the | 118 | The function keys @key{NEXT} and @key{PRIOR}, or @key{PageDown} and |
| 106 | variable @code{next-screen-context-lines}; by default, it is 2. The | 119 | @key{PageUp}, are equivalent to @kbd{C-v} and @kbd{M-v} respectively. |
| 107 | function keys @key{NEXT} and @key{PRIOR}, or @key{PAGEDOWN} and | 120 | |
| 108 | @key{PAGEUP}, are equivalent to @kbd{C-v} and @kbd{M-v}. | 121 | You can supply @kbd{C-v} or @kbd{M-v} with a numeric prefix argument |
| 109 | 122 | @var{n}. This scrolls the window by @var{n} lines, while attempting | |
| 110 | The commands @kbd{C-v} and @kbd{M-v} with a numeric argument scroll | 123 | to leave point unchanged (so that the text and point move up or down |
| 111 | the text in the selected window up or down a few lines. @kbd{C-v} | 124 | together). @kbd{C-v} with a negative argument is like @kbd{M-v} and |
| 112 | with an argument moves the text and point up, together, that many | 125 | vice versa. |
| 113 | lines; it brings the same number of new lines into view at the bottom | ||
| 114 | of the window. @kbd{M-v} with numeric argument scrolls the text | ||
| 115 | downward, bringing that many new lines into view at the top of the | ||
| 116 | window. @kbd{C-v} with a negative argument is like @kbd{M-v} and vice | ||
| 117 | versa. | ||
| 118 | 126 | ||
| 119 | The names of scroll commands are based on the direction that the | 127 | The names of scroll commands are based on the direction that the |
| 120 | text moves in the window. Thus, the command to scroll forward is | 128 | text moves in the window. Thus, the command to scroll forward is |
| 121 | called @code{scroll-up} because it moves the text upward on the | 129 | called @code{scroll-up} because it moves the text upward on the |
| 122 | screen. The keys @key{PAGEDOWN} and @key{PAGEUP} derive their names | 130 | screen. The keys @key{PageUp} and @key{PageDown} derive their names |
| 123 | and customary meanings from a different convention that developed | 131 | and customary meanings from a different convention that developed |
| 124 | elsewhere; hence the strange result that @key{PAGEDOWN} runs | 132 | elsewhere; hence the strange result that @key{PageDown} runs |
| 125 | @code{scroll-up}. | 133 | @code{scroll-up}. |
| 126 | 134 | ||
| 127 | @vindex scroll-preserve-screen-position | 135 | @vindex scroll-preserve-screen-position |
| 128 | Some users like the full-screen scroll commands to keep point at the | 136 | Some users like the full-screen scroll commands to keep point at the |
| 129 | same screen line. To enable this behavior, set the variable | 137 | same screen position. To enable this behavior, set the variable |
| 130 | @code{scroll-preserve-screen-position} to a non-@code{nil} value. In | 138 | @code{scroll-preserve-screen-position} to a non-@code{nil} value. |
| 131 | this mode, when these commands would scroll the text around point off | 139 | Then, whenever a command scrolls the text around point offscreen (or |
| 132 | the screen, or within @code{scroll-margin} lines of the edge, they | 140 | within @code{scroll-margin} lines of the edge), Emacs moves point to |
| 133 | move point to keep the same vertical position within the window. | 141 | keep it at the same vertical and horizontal position within the |
| 134 | This mode is convenient for browsing through a file by scrolling by | 142 | window. This mode is convenient for browsing through a file by |
| 135 | screenfuls; if you come back to the screen where you started, point | 143 | scrolling by screenfuls; if you come back to the screen where you |
| 136 | goes back to the line where it started. However, this mode is | 144 | started, point goes back to the line where it started. |
| 137 | inconvenient when you move to the next screen in order to move point | ||
| 138 | to the text there. | ||
| 139 | |||
| 140 | Another way to do scrolling is with @kbd{C-l} with a numeric argument. | ||
| 141 | @kbd{C-l} does not clear the screen when given an argument; it only scrolls | ||
| 142 | the selected window. With a positive argument @var{n}, it repositions text | ||
| 143 | to put point @var{n} lines down from the top. An argument of zero puts | ||
| 144 | point on the very top line. Point does not move with respect to the text; | ||
| 145 | rather, the text and point move rigidly on the screen. @kbd{C-l} with a | ||
| 146 | negative argument puts point that many lines from the bottom of the window. | ||
| 147 | For example, @kbd{C-u - 1 C-l} puts point on the bottom line, and @kbd{C-u | ||
| 148 | - 5 C-l} puts it five lines from the bottom. @kbd{C-u C-l} scrolls to put | ||
| 149 | point at the center (vertically) of the selected window. | ||
| 150 | 145 | ||
| 151 | @kindex C-M-l | 146 | @kindex C-M-l |
| 152 | @findex reposition-window | 147 | @findex reposition-window |
| @@ -158,60 +153,72 @@ entire current defun onto the screen if possible. | |||
| 158 | @node Auto Scrolling | 153 | @node Auto Scrolling |
| 159 | @section Automatic Scrolling | 154 | @section Automatic Scrolling |
| 160 | 155 | ||
| 156 | Emacs performs @dfn{automatic scrolling} when point moves out of the | ||
| 157 | visible portion of the text. | ||
| 158 | |||
| 161 | @vindex scroll-conservatively | 159 | @vindex scroll-conservatively |
| 162 | Redisplay scrolls the buffer automatically when point moves out of | 160 | Normally, this centers point vertically within the window. However, |
| 163 | the visible portion of the text. The purpose of automatic scrolling | 161 | if you set @code{scroll-conservatively} to a small number @var{n}, |
| 164 | is to make point visible, but you can customize many aspects of how | 162 | then if you move point just a little off the screen (less than @var{n} |
| 165 | this is done. | 163 | lines), Emacs scrolls the text just far enough to bring point back on |
| 166 | 164 | screen. By default, @code{scroll-conservatively} is@tie{}0. | |
| 167 | Normally, automatic scrolling centers point vertically within the | ||
| 168 | window. However, if you set @code{scroll-conservatively} to a small | ||
| 169 | number @var{n}, then if you move point just a little off the | ||
| 170 | screen---less than @var{n} lines---then Emacs scrolls the text just | ||
| 171 | far enough to bring point back on screen. By default, | ||
| 172 | @code{scroll-conservatively} is@tie{}0. | ||
| 173 | 165 | ||
| 174 | @cindex aggressive scrolling | 166 | @cindex aggressive scrolling |
| 175 | @vindex scroll-up-aggressively | 167 | @vindex scroll-up-aggressively |
| 176 | @vindex scroll-down-aggressively | 168 | @vindex scroll-down-aggressively |
| 177 | When the window does scroll by a longer distance, you can control | 169 | When the window does scroll by a longer distance, you can control |
| 178 | how aggressively it scrolls, by setting the variables | 170 | how aggressively it scrolls by setting the variables |
| 179 | @code{scroll-up-aggressively} and @code{scroll-down-aggressively}. | 171 | @code{scroll-up-aggressively} and @code{scroll-down-aggressively}. |
| 180 | The value of @code{scroll-up-aggressively} should be either | 172 | The value of @code{scroll-up-aggressively} should be either |
| 181 | @code{nil}, or a fraction @var{f} between 0 and 1. A fraction | 173 | @code{nil}, or a fraction @var{f} between 0 and 1. A fraction |
| 182 | specifies where on the screen to put point when scrolling upward. | 174 | specifies where on the screen to put point when scrolling upward: when |
| 183 | More precisely, when a window scrolls up because point is above the | 175 | a window scrolls up because point is above the window start, the new |
| 184 | window start, the new start position is chosen to put point @var{f} | 176 | start position is chosen to put point @var{f} parts of the window |
| 185 | part of the window height from the top. The larger @var{f}, the more | 177 | height from the top. Thus, larger @var{f} means more aggressive |
| 186 | aggressive the scrolling. | 178 | scrolling. The default value, @code{nil}, is equivalent to 0.5. |
| 187 | |||
| 188 | @code{nil}, which is the default, scrolls to put point at the center. | ||
| 189 | So it is equivalent to .5. | ||
| 190 | 179 | ||
| 191 | Likewise, @code{scroll-down-aggressively} is used for scrolling | 180 | Likewise, @code{scroll-down-aggressively} is used for scrolling |
| 192 | down. The value, @var{f}, specifies how far point should be placed | 181 | down. The value specifies how far point should be placed from the |
| 193 | from the bottom of the window; thus, as with | 182 | bottom of the window; thus, as with @code{scroll-up-aggressively}, a |
| 194 | @code{scroll-up-aggressively}, a larger value is more aggressive. | 183 | larger value is more aggressive. |
| 195 | 184 | ||
| 196 | @vindex scroll-margin | 185 | @vindex scroll-margin |
| 197 | The variable @code{scroll-margin} restricts how close point can come | 186 | The variable @code{scroll-margin} restricts how close point can come |
| 198 | to the top or bottom of a window. Its value is a number of screen | 187 | to the top or bottom of a window. Its value is a number of screen |
| 199 | lines; if point comes within that many lines of the top or bottom of the | 188 | lines; if point comes within that many lines of the top or bottom of |
| 200 | window, Emacs recenters the window. By default, @code{scroll-margin} is | 189 | the window, Emacs performs automatic scrolling. By default, |
| 201 | 0. | 190 | @code{scroll-margin} is 0. |
| 202 | 191 | ||
| 203 | @node Horizontal Scrolling | 192 | @node Horizontal Scrolling |
| 204 | @section Horizontal Scrolling | 193 | @section Horizontal Scrolling |
| 205 | @cindex horizontal scrolling | 194 | @cindex horizontal scrolling |
| 206 | 195 | ||
| 196 | @vindex auto-hscroll-mode | ||
| 207 | @dfn{Horizontal scrolling} means shifting all the lines sideways | 197 | @dfn{Horizontal scrolling} means shifting all the lines sideways |
| 208 | within a window---so that some of the text near the left margin is not | 198 | within a window, so that some of the text near the left margin is not |
| 209 | displayed at all. When the text in a window is scrolled horizontally, | 199 | displayed. When the text in a window is scrolled horizontally, text |
| 210 | text lines are truncated rather than continued (@pxref{Line | 200 | lines are truncated rather than continued (@pxref{Line Truncation}). |
| 211 | Truncation}). Whenever a window shows truncated lines, Emacs | 201 | If a window shows truncated lines, Emacs performs automatic horizontal |
| 212 | automatically updates its horizontal scrolling whenever point moves | 202 | scrolling whenever point moves off the left or right edge of the |
| 213 | off the left or right edge of the screen. You can also use these | 203 | screen. To disable automatic horizontal scrolling, set the variable |
| 214 | commands to do explicit horizontal scrolling. | 204 | @code{auto-hscroll-mode} to @code{nil}. |
| 205 | |||
| 206 | @vindex hscroll-margin | ||
| 207 | The variable @code{hscroll-margin} controls how close point can get | ||
| 208 | to the window's edges before the window is automatically scrolled. It | ||
| 209 | is measured in columns. If the value is 5, then moving point within 5 | ||
| 210 | columns of the edge causes horizontal scrolling away from that edge. | ||
| 211 | |||
| 212 | @vindex hscroll-step | ||
| 213 | The variable @code{hscroll-step} determines how many columns to | ||
| 214 | scroll the window when point gets too close to the edge. Zero, the | ||
| 215 | default value, means to center point horizontally within the window. | ||
| 216 | A positive integer value specifies the number of columns to scroll by. | ||
| 217 | A floating-point number specifies the fraction of the window's width | ||
| 218 | to scroll by. | ||
| 219 | |||
| 220 | You can also perform explicit horizontal scrolling with the | ||
| 221 | following commands: | ||
| 215 | 222 | ||
| 216 | @table @kbd | 223 | @table @kbd |
| 217 | @item C-x < | 224 | @item C-x < |
| @@ -224,43 +231,23 @@ Scroll to the right (@code{scroll-right}). | |||
| 224 | @kindex C-x > | 231 | @kindex C-x > |
| 225 | @findex scroll-left | 232 | @findex scroll-left |
| 226 | @findex scroll-right | 233 | @findex scroll-right |
| 227 | The command @kbd{C-x <} (@code{scroll-left}) scrolls the selected | 234 | @kbd{C-x <} (@code{scroll-left}) scrolls the selected window to the |
| 228 | window to the left by @var{n} columns with argument @var{n}. This moves | 235 | left by the full width of the window, less two columns. (In other |
| 229 | part of the beginning of each line off the left edge of the window. | 236 | words, the text in the window moves left relative to the window.) |
| 230 | With no argument, it scrolls by almost the full width of the window (two | 237 | With a numeric argument @var{n}, it scrolls by @var{n} columns. |
| 231 | columns less, to be precise). | 238 | |
| 232 | 239 | @kbd{C-x >} (@code{scroll-right}) scrolls similarly to the right. | |
| 233 | @kbd{C-x >} (@code{scroll-right}) scrolls similarly to the right. The | 240 | The window cannot be scrolled any farther to the right once it is |
| 234 | window cannot be scrolled any farther to the right once it is displayed | 241 | displayed normally, with each line starting at the window's left |
| 235 | normally (with each line starting at the window's left margin); | 242 | margin; attempting to do so has no effect. This means that you don't |
| 236 | attempting to do so has no effect. This means that you don't have to | 243 | have to calculate the argument precisely for @w{@kbd{C-x >}}; any |
| 237 | calculate the argument precisely for @w{@kbd{C-x >}}; any sufficiently large | 244 | sufficiently large argument will restore the normal display. |
| 238 | argument will restore the normal display. | ||
| 239 | 245 | ||
| 240 | If you use those commands to scroll a window horizontally, that sets | 246 | If you use those commands to scroll a window horizontally, that sets |
| 241 | a lower bound for automatic horizontal scrolling. Automatic scrolling | 247 | a lower bound for automatic horizontal scrolling. Automatic scrolling |
| 242 | will continue to scroll the window, but never farther to the right | 248 | will continue to scroll the window, but never farther to the right |
| 243 | than the amount you previously set by @code{scroll-left}. | 249 | than the amount you previously set by @code{scroll-left}. |
| 244 | 250 | ||
| 245 | @vindex hscroll-margin | ||
| 246 | The value of the variable @code{hscroll-margin} controls how close | ||
| 247 | to the window's edges point is allowed to get before the window will | ||
| 248 | be automatically scrolled. It is measured in columns. If the value | ||
| 249 | is 5, then moving point within 5 columns of the edge causes horizontal | ||
| 250 | scrolling away from that edge. | ||
| 251 | |||
| 252 | @vindex hscroll-step | ||
| 253 | The variable @code{hscroll-step} determines how many columns to | ||
| 254 | scroll the window when point gets too close to the edge. If it's | ||
| 255 | zero, horizontal scrolling centers point horizontally within the | ||
| 256 | window. If it's a positive integer, it specifies the number of | ||
| 257 | columns to scroll by. If it's a floating-point number, it specifies | ||
| 258 | the fraction of the window's width to scroll by. The default is zero. | ||
| 259 | |||
| 260 | @vindex auto-hscroll-mode | ||
| 261 | To disable automatic horizontal scrolling, set the variable | ||
| 262 | @code{auto-hscroll-mode} to @code{nil}. | ||
| 263 | |||
| 264 | @node Follow Mode | 251 | @node Follow Mode |
| 265 | @section Follow Mode | 252 | @section Follow Mode |
| 266 | @cindex Follow mode | 253 | @cindex Follow mode |
| @@ -287,18 +274,17 @@ one large window. | |||
| 287 | @section Faces: Controlling Text Display Style | 274 | @section Faces: Controlling Text Display Style |
| 288 | @cindex faces | 275 | @cindex faces |
| 289 | 276 | ||
| 290 | You can specify various styles for displaying text using | 277 | Emacs can display text in several different styles, which are called |
| 291 | @dfn{faces}. Each face can specify various @dfn{face attributes}, | 278 | @dfn{faces}. Each face can specify various @dfn{face attributes}, |
| 292 | such as the font family, the height, weight and slant of the | 279 | such as the font, height, weight and slant, the foreground and |
| 293 | characters, the foreground and background color, and underlining or | 280 | background color, and underlining or overlining. A face does not have |
| 294 | overlining. A face does not have to specify all of these attributes; | 281 | to specify all of these attributes; often it inherits most of them |
| 295 | often it inherits most of them from another face. | 282 | from another face. |
| 296 | 283 | ||
| 297 | On graphical display, all the Emacs face attributes are meaningful. | 284 | On a text-only terminal, not all face attributes are meaningful. |
| 298 | On a text-only terminal, only some of them work. Some text-only | 285 | Some text-only terminals support inverse video, bold, and underline |
| 299 | terminals support inverse video, bold, and underline attributes; some | 286 | attributes; some support colors. Text-only terminals generally do not |
| 300 | support colors. Text-only terminals generally do not support changing | 287 | support changing the height, width or font. |
| 301 | the height and width or the font family. | ||
| 302 | 288 | ||
| 303 | Most major modes assign faces to the text automatically through the | 289 | Most major modes assign faces to the text automatically through the |
| 304 | work of Font Lock mode. @xref{Font Lock}, for more information about | 290 | work of Font Lock mode. @xref{Font Lock}, for more information about |
| @@ -306,48 +292,40 @@ Font Lock mode and syntactic highlighting. You can print the current | |||
| 306 | buffer with the highlighting that appears on your screen using the | 292 | buffer with the highlighting that appears on your screen using the |
| 307 | command @code{ps-print-buffer-with-faces}. @xref{PostScript}. | 293 | command @code{ps-print-buffer-with-faces}. @xref{PostScript}. |
| 308 | 294 | ||
| 309 | You control the appearance of a part of the text in the buffer by | 295 | Enriched mode, the mode for editing formatted text, provides |
| 310 | specifying the face or faces to use for it. The style of display used | ||
| 311 | for any given character is determined by combining the attributes of | ||
| 312 | all the applicable faces specified for that character. Any attribute | ||
| 313 | that isn't specified by these faces is taken from the @code{default} face, | ||
| 314 | whose attributes reflect the default settings of the frame itself. | ||
| 315 | |||
| 316 | Enriched mode, the mode for editing formatted text, includes several | ||
| 317 | commands and menus for specifying faces for text in the buffer. | 296 | commands and menus for specifying faces for text in the buffer. |
| 318 | @xref{Format Faces}, for how to specify the font for text in the | 297 | @xref{Format Faces}. |
| 319 | buffer. @xref{Format Colors}, for how to specify the foreground and | ||
| 320 | background color. | ||
| 321 | 298 | ||
| 322 | @cindex face colors, setting | 299 | @cindex face colors, setting |
| 323 | @findex set-face-foreground | ||
| 324 | @findex set-face-background | ||
| 325 | To alter the appearance of a face, use the customization buffer. | 300 | To alter the appearance of a face, use the customization buffer. |
| 326 | @xref{Face Customization}. You can also use X resources to specify | 301 | @xref{Face Customization}. You can also use X resources to specify |
| 327 | attributes of particular faces (@pxref{Resources}). Alternatively, | 302 | attributes of any particular face (@pxref{Resources}). When |
| 328 | you can change the foreground and background colors of a specific face | 303 | displaying a character, any attribute that isn't specified by its face |
| 329 | with @kbd{M-x set-face-foreground} and @kbd{M-x set-face-background}. | 304 | is taken from the @code{default} face, whose attributes reflect the |
| 330 | These commands prompt in the minibuffer for a face name and a color | 305 | default settings of the frame itself. |
| 331 | name, with completion, and then set that face to use the specified | 306 | |
| 332 | color. Changing the colors of the @code{default} face also changes | 307 | @findex set-face-foreground |
| 333 | the foreground and background colors on all frames, both existing and | 308 | @findex set-face-background |
| 334 | those to be created in the future. (You can also set foreground and | 309 | You can also change the foreground and background colors of a |
| 335 | background colors for the current frame only; see @ref{Frame | 310 | specific face with @kbd{M-x set-face-foreground} and @kbd{M-x |
| 336 | Parameters}.) | 311 | set-face-background}. These commands prompt in the minibuffer for a |
| 337 | 312 | face name and a color name, with completion, and then set that face to | |
| 338 | If you want to alter the appearance of all Emacs frames, you need to | 313 | use the specified color. @xref{Face Customization}, for information |
| 339 | customize the frame parameters in the variable | 314 | about color names. These commands affect the face colors on all |
| 340 | @code{default-frame-alist}; see @ref{Creating Frames, | 315 | frames, both existing and those to be created in the future. These |
| 341 | default-frame-alist}. | 316 | changes do not, however, persist for future Emacs sessions; to make |
| 342 | 317 | lasting changes, use the customization buffer (@pxref{Face | |
| 343 | Emacs can correctly display variable-width fonts, but Emacs commands | 318 | Customization}). |
| 344 | that calculate width and indentation do not know how to calculate | 319 | |
| 345 | variable widths. This can sometimes lead to incorrect results when | 320 | You can also set foreground and background colors for the current |
| 346 | you use variable-width fonts. In particular, indentation commands can | 321 | frame only; see @ref{Frame Parameters}. |
| 347 | give inconsistent results, so we recommend you avoid variable-width | 322 | |
| 348 | fonts for editing program source code. Filling will sometimes make | 323 | Emacs can display variable-width fonts, but some of the Emacs |
| 349 | lines too long or too short. We plan to address these issues in | 324 | commands that calculate width and indentation do not know how to |
| 350 | future Emacs versions. | 325 | calculate variable widths. This can sometimes lead to incorrect |
| 326 | results when you use variable-width fonts. In particular, indentation | ||
| 327 | commands can give inconsistent results, so we recommend you avoid | ||
| 328 | variable-width fonts, especially for editing program source code. | ||
| 351 | 329 | ||
| 352 | @node Standard Faces | 330 | @node Standard Faces |
| 353 | @section Standard Faces | 331 | @section Standard Faces |
| @@ -367,21 +345,19 @@ apply them to specific text when you want the effects they produce. | |||
| 367 | @item default | 345 | @item default |
| 368 | This face is used for ordinary text that doesn't specify any face. | 346 | This face is used for ordinary text that doesn't specify any face. |
| 369 | @item bold | 347 | @item bold |
| 370 | This face uses a bold variant of the default font, if it has one. | 348 | This face uses a bold variant of the default font. |
| 371 | It's up to you to choose a default font that has a bold variant, | ||
| 372 | if you want to use one. | ||
| 373 | @item italic | 349 | @item italic |
| 374 | This face uses an italic variant of the default font, if it has one. | 350 | This face uses an italic variant of the default font. |
| 375 | @item bold-italic | 351 | @item bold-italic |
| 376 | This face uses a bold italic variant of the default font, if it has one. | 352 | This face uses a bold italic variant of the default font. |
| 377 | @item underline | 353 | @item underline |
| 378 | This face underlines text. | 354 | This face underlines text. |
| 379 | @item fixed-pitch | 355 | @item fixed-pitch |
| 380 | This face forces use of a particular fixed-width font. | 356 | This face forces use of a fixed-width font. It's reasonable to |
| 357 | customize this face to use a different fixed-width font, if you like, | ||
| 358 | but you should not make it a variable-width font. | ||
| 381 | @item variable-pitch | 359 | @item variable-pitch |
| 382 | This face forces use of a particular variable-width font. It's | 360 | This face forces use of a variable-width font. |
| 383 | reasonable to customize this face to use a different variable-width font, | ||
| 384 | if you like, but you should not make it a fixed-width font. | ||
| 385 | @item shadow | 361 | @item shadow |
| 386 | This face is used for making the text less noticeable than the surrounding | 362 | This face is used for making the text less noticeable than the surrounding |
| 387 | ordinary text. Usually this can be achieved by using shades of gray in | 363 | ordinary text. Usually this can be achieved by using shades of gray in |
| @@ -397,9 +373,11 @@ their own faces for this purpose.) | |||
| 397 | This face is used for highlighting portions of text, in various modes. | 373 | This face is used for highlighting portions of text, in various modes. |
| 398 | For example, mouse-sensitive text is highlighted using this face. | 374 | For example, mouse-sensitive text is highlighted using this face. |
| 399 | @item isearch | 375 | @item isearch |
| 400 | This face is used for highlighting the current Isearch match. | 376 | This face is used for highlighting the current Isearch match |
| 377 | (@pxref{Incremental Search}). | ||
| 401 | @item query-replace | 378 | @item query-replace |
| 402 | This face is used for highlighting the current Query Replace match. | 379 | This face is used for highlighting the current Query Replace match |
| 380 | (@pxref{Replace}). | ||
| 403 | @item lazy-highlight | 381 | @item lazy-highlight |
| 404 | This face is used for lazy highlighting of Isearch and Query Replace | 382 | This face is used for lazy highlighting of Isearch and Query Replace |
| 405 | matches other than the current one. | 383 | matches other than the current one. |
| @@ -426,13 +404,10 @@ appearance of these parts of the frame. | |||
| 426 | 404 | ||
| 427 | @table @code | 405 | @table @code |
| 428 | @item mode-line | 406 | @item mode-line |
| 429 | @itemx modeline | ||
| 430 | This face is used for the mode line of the currently selected window, | 407 | This face is used for the mode line of the currently selected window, |
| 431 | and for menu bars when toolkit menus are not used. By default, it's | 408 | and for menu bars when toolkit menus are not used. By default, it's |
| 432 | drawn with shadows for a ``raised'' effect on graphical displays, and | 409 | drawn with shadows for a ``raised'' effect on graphical displays, and |
| 433 | drawn as the inverse of the default face on non-windowed terminals. | 410 | drawn as the inverse of the default face on non-windowed terminals. |
| 434 | @code{modeline} is an alias for the @code{mode-line} face, for | ||
| 435 | compatibility with old Emacs versions. | ||
| 436 | @item mode-line-inactive | 411 | @item mode-line-inactive |
| 437 | Like @code{mode-line}, but used for mode lines of the windows other | 412 | Like @code{mode-line}, but used for mode lines of the windows other |
| 438 | than the selected one (if @code{mode-line-in-non-selected-windows} is | 413 | than the selected one (if @code{mode-line-in-non-selected-windows} is |
| @@ -485,14 +460,59 @@ This face is used for tooltips. @xref{Tooltips}. | |||
| 485 | @cindex @code{menu} face, no effect if customized | 460 | @cindex @code{menu} face, no effect if customized |
| 486 | @cindex customization of @code{menu} face | 461 | @cindex customization of @code{menu} face |
| 487 | This face determines the colors and font of Emacs's menus. @xref{Menu | 462 | This face determines the colors and font of Emacs's menus. @xref{Menu |
| 488 | Bars}. Setting the font of LessTif/Motif menus is currently not | 463 | Bars}. This has no effect in Emacs built with GTK and in the |
| 489 | supported; attempts to set the font are ignored in this case. | 464 | MS-Windows/Mac ports; you need to use system-wide styles and options |
| 490 | Likewise, attempts to customize this face in Emacs built with GTK and | 465 | to change the appearance of GTK, Windows, or Mac menus. Setting the |
| 491 | in the MS-Windows/Mac ports are ignored by the respective GUI toolkits; | 466 | font of LessTif/Motif menus is currently not supported; attempts to |
| 492 | you need to use system-wide styles and options to change the | 467 | set the font are ignored in this case. |
| 493 | appearance of the menus. | ||
| 494 | @end table | 468 | @end table |
| 495 | 469 | ||
| 470 | @node Temporary Face Changes | ||
| 471 | @section Temporary Face Changes | ||
| 472 | |||
| 473 | The following commands change the default face within a buffer. | ||
| 474 | |||
| 475 | @cindex adjust buffer face height | ||
| 476 | @findex text-scale-adjust | ||
| 477 | @kindex C-x C-+ | ||
| 478 | @kindex C-x C-- | ||
| 479 | @kindex C-x C-= | ||
| 480 | @kindex C-x C-0 | ||
| 481 | To increase the height of the default face in the current buffer, | ||
| 482 | type @kbd{C-x C-+} or @kbd{C-x C-=}. To decrease it, type @kbd{C-x | ||
| 483 | C--}. To restore the default (global) face height, type @kbd{C-x | ||
| 484 | C-0}. These keys are all bound to the same command, | ||
| 485 | @code{text-scale-adjust}, which looks at the last key typed to | ||
| 486 | determine which action to take. | ||
| 487 | |||
| 488 | The final key of these commands may be repeated without the leading | ||
| 489 | @kbd{C-x}. For instance, @kbd{C-x C-= C-= C-=} increases the face | ||
| 490 | height by three steps. Each step scales the height of the default | ||
| 491 | face by the value of the variable @code{text-scale-mode-step}. As a | ||
| 492 | special case, an argument of 0 removes any scaling currently active. | ||
| 493 | |||
| 494 | @cindex increase buffer face height | ||
| 495 | @findex text-scale-increase | ||
| 496 | @cindex decrease buffer face height | ||
| 497 | @findex text-scale-decrease | ||
| 498 | The commands @code{text-scale-increase} and | ||
| 499 | @code{text-scale-decrease} increase or decrease the height of the | ||
| 500 | default face, just like @kbd{C-x C-+} and @kbd{C-x C--} respectively. | ||
| 501 | You may find it convenient to bind to these commands, rather than | ||
| 502 | @code{text-scale-adjust}. | ||
| 503 | |||
| 504 | @findex text-scale-mode | ||
| 505 | The above commands automatically enable or disable the minor mode | ||
| 506 | @code{text-scale-mode}, depending on whether the current font scaling | ||
| 507 | is other than 1 or not. | ||
| 508 | |||
| 509 | @cindex variable pitch mode | ||
| 510 | @findex variable-pitch-mode | ||
| 511 | To temporarily change the face in the current buffer to a | ||
| 512 | variable-pitch (``proportional'') font, use the command @kbd{M-x | ||
| 513 | variable-pitch-mode} to enable or disable the Variable Pitch minor | ||
| 514 | mode. | ||
| 515 | |||
| 496 | @node Font Lock | 516 | @node Font Lock |
| 497 | @section Font Lock mode | 517 | @section Font Lock mode |
| 498 | @cindex Font Lock mode | 518 | @cindex Font Lock mode |
| @@ -502,11 +522,11 @@ appearance of the menus. | |||
| 502 | Font Lock mode is a minor mode, always local to a particular buffer, | 522 | Font Lock mode is a minor mode, always local to a particular buffer, |
| 503 | which highlights (or ``fontifies'') the buffer contents according to | 523 | which highlights (or ``fontifies'') the buffer contents according to |
| 504 | the syntax of the text you are editing. It can recognize comments and | 524 | the syntax of the text you are editing. It can recognize comments and |
| 505 | strings in most languages; in several languages, it can also recognize | 525 | strings in most programming languages; in several languages, it can |
| 506 | and properly highlight various other important constructs---for | 526 | also recognize and properly highlight various other important |
| 507 | example, names of functions being defined or reserved keywords. | 527 | constructs, such as names of functions being defined or reserved |
| 508 | Some special modes, such as Occur mode and Info mode, have completely | 528 | keywords. Some special modes, such as Occur mode and Info mode, have |
| 509 | specialized ways of assigning fonts for Font Lock mode. | 529 | completely specialized ways of assigning fonts for Font Lock mode. |
| 510 | 530 | ||
| 511 | @findex font-lock-mode | 531 | @findex font-lock-mode |
| 512 | Font Lock mode is turned on by default in all modes which support it. | 532 | Font Lock mode is turned on by default in all modes which support it. |
| @@ -547,9 +567,6 @@ customize-group @key{RET} font-lock-faces @key{RET}}. You can then | |||
| 547 | use that customization buffer to customize the appearance of these | 567 | use that customization buffer to customize the appearance of these |
| 548 | faces. @xref{Face Customization}. | 568 | faces. @xref{Face Customization}. |
| 549 | 569 | ||
| 550 | You can also customize these faces using @kbd{M-x | ||
| 551 | set-face-foreground} or @kbd{M-x set-face-background}. @xref{Faces}. | ||
| 552 | |||
| 553 | @vindex font-lock-maximum-decoration | 570 | @vindex font-lock-maximum-decoration |
| 554 | The variable @code{font-lock-maximum-decoration} specifies the | 571 | The variable @code{font-lock-maximum-decoration} specifies the |
| 555 | preferred level of fontification, for modes that provide multiple | 572 | preferred level of fontification, for modes that provide multiple |
| @@ -616,20 +633,18 @@ comments, use this: | |||
| 616 | @findex font-lock-remove-keywords | 633 | @findex font-lock-remove-keywords |
| 617 | To remove keywords from the font-lock highlighting patterns, use the | 634 | To remove keywords from the font-lock highlighting patterns, use the |
| 618 | function @code{font-lock-remove-keywords}. @xref{Search-based | 635 | function @code{font-lock-remove-keywords}. @xref{Search-based |
| 619 | Fontification,,, elisp, The Emacs Lisp Reference Manual}, for | 636 | Fontification,,, elisp, The Emacs Lisp Reference Manual}. |
| 620 | documentation of the format of this list. | ||
| 621 | 637 | ||
| 622 | @cindex just-in-time (JIT) font-lock | 638 | @cindex just-in-time (JIT) font-lock |
| 623 | @cindex background syntax highlighting | 639 | @cindex background syntax highlighting |
| 624 | Fontifying large buffers can take a long time. To avoid large | 640 | Fontifying large buffers can take a long time. To avoid large |
| 625 | delays when a file is visited, Emacs fontifies only the visible | 641 | delays when a file is visited, Emacs fontifies only the visible |
| 626 | portion of a buffer. As you scroll through the buffer, each portion | 642 | portion of a buffer. As you scroll through the buffer, each portion |
| 627 | that becomes visible is fontified as soon as it is displayed. The | 643 | that becomes visible is fontified as soon as it is displayed; this |
| 628 | parts of the buffer that are not displayed are fontified | 644 | type of Font Lock is called @dfn{Just-In-Time} (or @dfn{JIT}) Lock. |
| 629 | ``stealthily,'' in the background, i.e.@: when Emacs is idle. You can | 645 | You can control how JIT Lock behaves, including telling it to perform |
| 630 | control this background fontification, also called @dfn{Just-In-Time} | 646 | fontification while idle, by customizing variables in the |
| 631 | (or @dfn{JIT}) Lock, by customizing variables in the customization | 647 | customization group @samp{jit-lock}. @xref{Specific Customization}. |
| 632 | group @samp{jit-lock}. @xref{Specific Customization}. | ||
| 633 | 648 | ||
| 634 | @node Highlight Interactively | 649 | @node Highlight Interactively |
| 635 | @section Interactive Highlighting | 650 | @section Interactive Highlighting |
| @@ -638,21 +653,21 @@ group @samp{jit-lock}. @xref{Specific Customization}. | |||
| 638 | @cindex Highlight Changes mode | 653 | @cindex Highlight Changes mode |
| 639 | 654 | ||
| 640 | @findex highlight-changes-mode | 655 | @findex highlight-changes-mode |
| 641 | Use @kbd{M-x highlight-changes-mode} to enable (or disable) | 656 | Highlight Changes mode is a minor mode that @dfn{highlights} the parts |
| 642 | Highlight Changes mode, a minor mode that uses faces (colors, | 657 | of the buffer were changed most recently, by giving that text a |
| 643 | typically) to indicate which parts of the buffer were changed most | 658 | different face. To enable or disable Highlight Changes mode, use |
| 644 | recently. | 659 | @kbd{M-x highlight-changes-mode}. |
| 645 | 660 | ||
| 646 | @cindex Hi Lock mode | 661 | @cindex Hi Lock mode |
| 647 | @findex hi-lock-mode | 662 | @findex hi-lock-mode |
| 648 | Hi Lock mode highlights text that matches regular expressions you | 663 | Hi Lock mode is a minor mode that highlights text that matches |
| 649 | specify. For example, you might wish to see all the references to a | 664 | regular expressions you specify. For example, you can use it to |
| 650 | certain variable in a program source file, highlight certain parts in | 665 | highlight all the references to a certain variable in a program source |
| 651 | a voluminous output of some program, or make certain names stand out | 666 | file, highlight certain parts in a voluminous output of some program, |
| 652 | in an article. Use the @kbd{M-x hi-lock-mode} command to enable (or | 667 | or highlight certain names in an article. To enable or disable Hi |
| 653 | disable) Hi Lock mode. To enable Hi Lock mode for all buffers, use | 668 | Lock mode, use the command @kbd{M-x hi-lock-mode}. To enable Hi Lock |
| 654 | @kbd{M-x global-hi-lock-mode} or place @code{(global-hi-lock-mode 1)} | 669 | mode for all buffers, use @kbd{M-x global-hi-lock-mode} or place |
| 655 | in your @file{.emacs} file. | 670 | @code{(global-hi-lock-mode 1)} in your @file{.emacs} file. |
| 656 | 671 | ||
| 657 | Hi Lock mode works like Font Lock mode (@pxref{Font Lock}), except | 672 | Hi Lock mode works like Font Lock mode (@pxref{Font Lock}), except |
| 658 | that you specify explicitly the regular expressions to highlight. You | 673 | that you specify explicitly the regular expressions to highlight. You |
| @@ -741,8 +756,8 @@ mode's symbol is a member of the list @code{hi-lock-exclude-modes}. | |||
| 741 | @cindex fringes | 756 | @cindex fringes |
| 742 | 757 | ||
| 743 | On a graphical display, each Emacs window normally has narrow | 758 | On a graphical display, each Emacs window normally has narrow |
| 744 | @dfn{fringes} on the left and right edges. The fringes display | 759 | @dfn{fringes} on the left and right edges. The fringes are used to |
| 745 | indications about the text in the window. | 760 | display symbols that provide information about the text in the window. |
| 746 | 761 | ||
| 747 | The most common use of the fringes is to indicate a continuation | 762 | The most common use of the fringes is to indicate a continuation |
| 748 | line, when one line of text is split into multiple lines on the | 763 | line, when one line of text is split into multiple lines on the |
| @@ -807,14 +822,12 @@ that do not override it. | |||
| 807 | It is easy to leave unnecessary spaces at the end of a line, or | 822 | It is easy to leave unnecessary spaces at the end of a line, or |
| 808 | empty lines at the end of a file, without realizing it. In most | 823 | empty lines at the end of a file, without realizing it. In most |
| 809 | cases, this @dfn{trailing whitespace} has no effect, but there are | 824 | cases, this @dfn{trailing whitespace} has no effect, but there are |
| 810 | special circumstances where it matters. It can also be a nuisance | 825 | special circumstances where it matters, and it can be a nuisance. |
| 811 | that the line has ``changed,'' when the change is just spaces added or | ||
| 812 | removed at the end. | ||
| 813 | 826 | ||
| 814 | You can make trailing whitespace at the end of a line visible on the | 827 | You can make trailing whitespace at the end of a line visible by |
| 815 | screen by setting the buffer-local variable | 828 | setting the buffer-local variable @code{show-trailing-whitespace} to |
| 816 | @code{show-trailing-whitespace} to @code{t}. Then Emacs displays | 829 | @code{t}. Then Emacs displays trailing whitespace, using the face |
| 817 | trailing whitespace in the face @code{trailing-whitespace}. | 830 | @code{trailing-whitespace}. |
| 818 | 831 | ||
| 819 | This feature does not apply when point is at the end of the line | 832 | This feature does not apply when point is at the end of the line |
| 820 | containing the whitespace. Strictly speaking, that is ``trailing | 833 | containing the whitespace. Strictly speaking, that is ``trailing |
| @@ -824,10 +837,9 @@ the location of point is enough to show you that the spaces are | |||
| 824 | present. | 837 | present. |
| 825 | 838 | ||
| 826 | @findex delete-trailing-whitespace | 839 | @findex delete-trailing-whitespace |
| 827 | To delete all trailing whitespace within the current buffer's | 840 | To delete all trailing whitespace within the buffer's accessible |
| 828 | accessible portion (@pxref{Narrowing}), type @kbd{M-x | 841 | portion (@pxref{Narrowing}), type @kbd{M-x delete-trailing-whitespace |
| 829 | delete-trailing-whitespace @key{RET}}. (This command does not remove | 842 | @key{RET}}. This command does not remove newline characters. |
| 830 | the form-feed characters.) | ||
| 831 | 843 | ||
| 832 | @vindex indicate-empty-lines | 844 | @vindex indicate-empty-lines |
| 833 | @vindex default-indicate-empty-lines | 845 | @vindex default-indicate-empty-lines |
| @@ -852,9 +864,9 @@ currently doesn't work on text-only terminals.) | |||
| 852 | @findex set-selective-display | 864 | @findex set-selective-display |
| 853 | @kindex C-x $ | 865 | @kindex C-x $ |
| 854 | 866 | ||
| 855 | Emacs has the ability to hide lines indented more than a certain number | 867 | Emacs has the ability to hide lines indented more than a given |
| 856 | of columns (you specify how many columns). You can use this to get an | 868 | number of columns. You can use this to get an overview of a part of a |
| 857 | overview of a part of a program. | 869 | program. |
| 858 | 870 | ||
| 859 | To hide lines in the current buffer, type @kbd{C-x $} | 871 | To hide lines in the current buffer, type @kbd{C-x $} |
| 860 | (@code{set-selective-display}) with a numeric argument @var{n}. Then | 872 | (@code{set-selective-display}) with a numeric argument @var{n}. Then |
| @@ -905,10 +917,6 @@ Here @var{SIZE} is the human readable representation of the number of | |||
| 905 | characters in the buffer, which means that @samp{k} for 10^3, @samp{M} | 917 | characters in the buffer, which means that @samp{k} for 10^3, @samp{M} |
| 906 | for 10^6, @samp{G} for 10^9, etc., are used to abbreviate. | 918 | for 10^6, @samp{G} for 10^9, etc., are used to abbreviate. |
| 907 | 919 | ||
| 908 | @cindex narrowing, and buffer size display | ||
| 909 | If you have narrowed the buffer (@pxref{Narrowing}), the size of the | ||
| 910 | accessible part of the buffer is shown. | ||
| 911 | |||
| 912 | @cindex line number display | 920 | @cindex line number display |
| 913 | @cindex display of line number | 921 | @cindex display of line number |
| 914 | @findex line-number-mode | 922 | @findex line-number-mode |
| @@ -938,17 +946,17 @@ file.) | |||
| 938 | 946 | ||
| 939 | @vindex line-number-display-limit | 947 | @vindex line-number-display-limit |
| 940 | If the buffer is very large (larger than the value of | 948 | If the buffer is very large (larger than the value of |
| 941 | @code{line-number-display-limit}), then the line number doesn't appear. | 949 | @code{line-number-display-limit}), Emacs won't compute the line |
| 942 | Emacs doesn't compute the line number when the buffer is large, because | 950 | number, because that would be too slow; therefore, the line number |
| 943 | that would be too slow. Set it to @code{nil} to remove the limit. | 951 | won't appear on the mode-line. To remove this limit, set |
| 952 | @code{line-number-display-limit} to @code{nil}. | ||
| 944 | 953 | ||
| 945 | @vindex line-number-display-limit-width | 954 | @vindex line-number-display-limit-width |
| 946 | Line-number computation can also be slow if the lines in the buffer | 955 | Line-number computation can also be slow if the lines in the buffer |
| 947 | are too long. For this reason, Emacs normally doesn't display line | 956 | are too long. For this reason, Emacs doesn't display line numbers if |
| 948 | numbers if the average width, in characters, of lines near point is | 957 | the average width, in characters, of lines near point is larger than |
| 949 | larger than the value of the variable | 958 | the value of @code{line-number-display-limit-width}. The default |
| 950 | @code{line-number-display-limit-width}. The default value is 200 | 959 | value is 200 characters. |
| 951 | characters. | ||
| 952 | 960 | ||
| 953 | @findex display-time | 961 | @findex display-time |
| 954 | @cindex time (on mode line) | 962 | @cindex time (on mode line) |
| @@ -986,6 +994,19 @@ the mail file to check, or set @code{display-time-mail-directory} | |||
| 986 | to specify the directory to check for incoming mail (any nonempty regular | 994 | to specify the directory to check for incoming mail (any nonempty regular |
| 987 | file in the directory is considered as ``newly arrived mail''). | 995 | file in the directory is considered as ``newly arrived mail''). |
| 988 | 996 | ||
| 997 | @cindex mail (on mode line) | ||
| 998 | @findex display-battery-mode | ||
| 999 | @vindex display-battery-mode | ||
| 1000 | @vindex battery-mode-line-format | ||
| 1001 | When running Emacs on a laptop computer, you can display the battery | ||
| 1002 | charge on the mode-line, by using the command | ||
| 1003 | @code{display-battery-mode} or customizing the variable | ||
| 1004 | @code{display-battery-mode}. The variable | ||
| 1005 | @code{battery-mode-line-format} determines the way the battery charge | ||
| 1006 | is displayed; the exact mode-line message depends on the operating | ||
| 1007 | system, and it usually shows the current battery charge as a | ||
| 1008 | percentage of the total charge. | ||
| 1009 | |||
| 989 | @cindex mode line, 3D appearance | 1010 | @cindex mode line, 3D appearance |
| 990 | @cindex attributes of mode line, changing | 1011 | @cindex attributes of mode line, changing |
| 991 | @cindex non-integral number of lines in a window | 1012 | @cindex non-integral number of lines in a window |
| @@ -1026,10 +1047,18 @@ formats by setting each of the variables @code{eol-mnemonic-unix}, | |||
| 1026 | buffers are displayed with their graphics, as are non-ASCII multibyte | 1047 | buffers are displayed with their graphics, as are non-ASCII multibyte |
| 1027 | printing characters (octal codes above 0400). | 1048 | printing characters (octal codes above 0400). |
| 1028 | 1049 | ||
| 1029 | Some @acronym{ASCII} control characters are displayed in special ways. The | 1050 | @vindex tab-width |
| 1030 | newline character (octal code 012) is displayed by starting a new line. | 1051 | @vindex default-tab-width |
| 1031 | The tab character (octal code 011) is displayed by moving to the next | 1052 | Some @acronym{ASCII} control characters are displayed in special |
| 1032 | tab stop column (normally every 8 columns). | 1053 | ways. The newline character (octal code 012) is displayed by starting |
| 1054 | a new line. The tab character (octal code 011) is displayed by moving | ||
| 1055 | to the next tab stop column (normally every 8 columns). The number of | ||
| 1056 | spaces per tab is controlled by the variable @code{tab-width}, which | ||
| 1057 | must have an integer value between 1 and 1000, inclusive, and is made | ||
| 1058 | local by changing it. Note that how the tab character in the buffer | ||
| 1059 | is displayed has nothing to do with the definition of @key{TAB} as a | ||
| 1060 | command. The variable @code{default-tab-width} controls the default | ||
| 1061 | value of this variable for buffers where you have not set it locally. | ||
| 1033 | 1062 | ||
| 1034 | Other @acronym{ASCII} control characters are normally displayed as a caret | 1063 | Other @acronym{ASCII} control characters are normally displayed as a caret |
| 1035 | (@samp{^}) followed by the non-control version of the character; thus, | 1064 | (@samp{^}) followed by the non-control version of the character; thus, |
| @@ -1068,19 +1097,6 @@ this feature by setting the variable @code{nobreak-char-display} to | |||
| 1068 | @code{nil}. If you set the variable to any other value, that means to | 1097 | @code{nil}. If you set the variable to any other value, that means to |
| 1069 | prefix these characters with an escape character. | 1098 | prefix these characters with an escape character. |
| 1070 | 1099 | ||
| 1071 | @vindex tab-width | ||
| 1072 | @vindex default-tab-width | ||
| 1073 | Normally, a tab character in the buffer is displayed as whitespace which | ||
| 1074 | extends to the next display tab stop position, and display tab stops come | ||
| 1075 | at intervals equal to eight spaces. The number of spaces per tab is | ||
| 1076 | controlled by the variable @code{tab-width}, which is made local by | ||
| 1077 | changing it. Note that how the tab character | ||
| 1078 | in the buffer is displayed has nothing to do with the definition of | ||
| 1079 | @key{TAB} as a command. The variable @code{tab-width} must have an | ||
| 1080 | integer value between 1 and 1000, inclusive. The variable | ||
| 1081 | @code{default-tab-width} controls the default value of this variable | ||
| 1082 | for buffers where you have not set it locally. | ||
| 1083 | |||
| 1084 | You can customize the way any particular character code is displayed | 1100 | You can customize the way any particular character code is displayed |
| 1085 | by means of a display table. @xref{Display Tables,, Display Tables, | 1101 | by means of a display table. @xref{Display Tables,, Display Tables, |
| 1086 | elisp, The Emacs Lisp Reference Manual}. | 1102 | elisp, The Emacs Lisp Reference Manual}. |
| @@ -1162,8 +1178,7 @@ value is in effect. The default value is normally @code{nil}. | |||
| 1162 | If the variable @code{truncate-partial-width-windows} is | 1178 | If the variable @code{truncate-partial-width-windows} is |
| 1163 | non-@code{nil}, it forces truncation rather than continuation in any | 1179 | non-@code{nil}, it forces truncation rather than continuation in any |
| 1164 | window less than the full width of the screen or frame, regardless of | 1180 | window less than the full width of the screen or frame, regardless of |
| 1165 | the value of @code{truncate-lines}. For information about side-by-side | 1181 | the value of @code{truncate-lines}. See also @ref{Display,, Display, |
| 1166 | windows, see @ref{Split Window}. See also @ref{Display,, Display, | ||
| 1167 | elisp, The Emacs Lisp Reference Manual}. | 1182 | elisp, The Emacs Lisp Reference Manual}. |
| 1168 | 1183 | ||
| 1169 | @vindex overflow-newline-into-fringe | 1184 | @vindex overflow-newline-into-fringe |
| @@ -1217,64 +1232,6 @@ logical lines, so having a fringe indicator for each wrapped line | |||
| 1217 | would be visually distracting. You can change this by customizing the | 1232 | would be visually distracting. You can change this by customizing the |
| 1218 | variable @code{visual-line-fringe-indicators}. | 1233 | variable @code{visual-line-fringe-indicators}. |
| 1219 | 1234 | ||
| 1220 | @node Temporary Face Changes | ||
| 1221 | @section Temporary Face Changes | ||
| 1222 | |||
| 1223 | These are commands which temporarily change the default face used to | ||
| 1224 | display text in a buffer. | ||
| 1225 | |||
| 1226 | @cindex adjust buffer face height | ||
| 1227 | @findex text-scale-adjust | ||
| 1228 | @kindex C-x C-+ | ||
| 1229 | @kindex C-x C-- | ||
| 1230 | @kindex C-x C-= | ||
| 1231 | @kindex C-x C-0 | ||
| 1232 | To increase the height of the default face in the current buffer one | ||
| 1233 | step, type @kbd{C-x C-+} or @kbd{C-x C-=}. To decrease it one step, | ||
| 1234 | type @kbd{C-x C--}. To restore the default (global) face height, type | ||
| 1235 | @kbd{C-x C-0}. These keys are all bound to the same command, | ||
| 1236 | @code{text-scale-adjust}, which looks at the last key typed to | ||
| 1237 | determine the adjustment to make. | ||
| 1238 | |||
| 1239 | The final key of these commands may be repeated without the leading | ||
| 1240 | @kbd{C-x} -- for instance, @kbd{C-x C-= C-= C-=} increases the face | ||
| 1241 | height by three steps. | ||
| 1242 | |||
| 1243 | Each step scales the height of the default face by the value of the | ||
| 1244 | variable @code{text-scale-mode-step} (a negative number of steps | ||
| 1245 | decreases the height by the same amount). As a special case, an | ||
| 1246 | argument of 0 will remove any scaling currently active. | ||
| 1247 | |||
| 1248 | This command is a special-purpose wrapper around the | ||
| 1249 | @code{text-scale-increase} command which makes repetition convenient | ||
| 1250 | even when it is bound in a non-top-level keymap. For binding in a | ||
| 1251 | top-level keymap, @code{text-scale-increase} or | ||
| 1252 | @code{text-scale-decrease} may be more appropriate." | ||
| 1253 | |||
| 1254 | @cindex increase buffer face height | ||
| 1255 | @findex text-scale-increase | ||
| 1256 | @cindex decrease buffer face height | ||
| 1257 | @findex text-scale-decrease | ||
| 1258 | The @code{text-scale-increase} and @code{text-scale-decrease} commands | ||
| 1259 | increase or decrease the height of the default face in the current | ||
| 1260 | buffer by one step. With a numeric prefix argument, the size will be | ||
| 1261 | increased/decreased by that many steps; each step scales the font | ||
| 1262 | height by the value of the variable @code{text-scale-mode-step}. If | ||
| 1263 | repeated, this command has a cumulative effect. As a special case, a | ||
| 1264 | prefix argument of 0 will remove any scaling currently active. | ||
| 1265 | |||
| 1266 | @findex text-scale-mode | ||
| 1267 | These commands automatically enable or disable the | ||
| 1268 | @code{text-scale-mode} minor-mode, depending on whether the current | ||
| 1269 | font scaling is other than 1 or not. | ||
| 1270 | |||
| 1271 | @cindex variable pitch mode | ||
| 1272 | @findex variable-pitch-mode | ||
| 1273 | To temporarily change the display face in the current buffer to a | ||
| 1274 | variable-pitch (``proportional'') font, use the command @kbd{M-x | ||
| 1275 | variable-pitch-mode} to enable or disable the Variable Pitch minor | ||
| 1276 | mode. | ||
| 1277 | |||
| 1278 | @node Display Custom | 1235 | @node Display Custom |
| 1279 | @section Customization of Display | 1236 | @section Customization of Display |
| 1280 | 1237 | ||
| @@ -1315,19 +1272,19 @@ will be done less frequently. | |||
| 1315 | 1272 | ||
| 1316 | @cindex hourglass pointer display | 1273 | @cindex hourglass pointer display |
| 1317 | @vindex hourglass-delay | 1274 | @vindex hourglass-delay |
| 1318 | On graphical display, Emacs can optionally display the mouse pointer | 1275 | On graphical displays, Emacs can optionally display the mouse pointer |
| 1319 | in a special shape to say that Emacs is busy. To turn this feature on | 1276 | in a special shape to say that Emacs is busy. To turn this feature on |
| 1320 | or off, customize the group @code{cursor}. You can also control the | 1277 | or off, customize the group @code{cursor}. You can also control the |
| 1321 | amount of time Emacs must remain busy before the busy indicator is | 1278 | amount of time Emacs must remain busy before the busy indicator is |
| 1322 | displayed, by setting the variable @code{hourglass-delay}. | 1279 | displayed, by setting the variable @code{hourglass-delay}. |
| 1323 | 1280 | ||
| 1324 | @vindex overline-margin | 1281 | @vindex overline-margin |
| 1325 | On graphical display, the variable @code{overline-margin} specifies the vertical position | 1282 | On graphical displays, the variable @code{overline-margin} specifies |
| 1326 | of an overline above the text, including the height of the overline | 1283 | the vertical position of an overline above the text, including the |
| 1327 | itself (1 pixel). The default value is 2 pixels. | 1284 | height of the overline itself, in pixels. The default value is 2. |
| 1328 | 1285 | ||
| 1329 | @vindex x-underline-at-descent-line | 1286 | @vindex x-underline-at-descent-line |
| 1330 | On graphical display, Emacs normally draws an underline at the | 1287 | On graphical displays, Emacs normally draws an underline at the |
| 1331 | baseline level of the font. If @code{x-underline-at-descent-line} is | 1288 | baseline level of the font. If @code{x-underline-at-descent-line} is |
| 1332 | non-@code{nil}, Emacs draws the underline at the same height as the | 1289 | non-@code{nil}, Emacs draws the underline at the same height as the |
| 1333 | font's descent line. | 1290 | font's descent line. |