Commit | Line | Data |
---|---|---|
802b0ea7 | 1 | @c This is part of the Emacs manual. |
b65d8176 | 2 | @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, |
0419b8d6 GM |
3 | @c 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 |
4 | @c Free Software Foundation, Inc. | |
5 | ||
6bf7aab6 DL |
6 | @c See file emacs.texi for copying conditions. |
7 | @node Display, Search, Registers, Top | |
8 | @chapter Controlling the Display | |
9 | ||
10 | Since only part of a large buffer fits in the window, Emacs tries to | |
43d67313 | 11 | show a part that is likely to be interesting. Display-control |
956c76ef CY |
12 | commands and variables allow you to specify which part of the text you |
13 | want to see, and how to display it. | |
6bf7aab6 DL |
14 | |
15 | @menu | |
43d67313 RS |
16 | * Scrolling:: Commands to move text up and down in a window. |
17 | * Auto Scrolling:: Redisplay scrolls text automatically when needed. | |
54952612 RS |
18 | * Horizontal Scrolling:: Moving text left and right in a window. |
19 | * Follow Mode:: Follow mode lets two windows scroll as one. | |
b8f3a9e3 | 20 | * Faces:: How to change the display style using faces. |
43d08eb9 | 21 | * Standard Faces:: Emacs' predefined faces. |
956c76ef | 22 | * Temporary Face Changes:: Commands to temporarily modify the default text face |
b8f3a9e3 | 23 | * Font Lock:: Minor mode for syntactic highlighting using faces. |
b8f3a9e3 | 24 | * Highlight Interactively:: Tell Emacs what text to highlight. |
fad78d58 | 25 | * Fringes:: Enabling or disabling window fringes. |
9d2908a6 | 26 | * Displaying Boundaries:: Displaying top and bottom of the buffer. |
fad78d58 | 27 | * Useless Whitespace:: Showing possibly-spurious trailing whitespace. |
6bf7aab6 DL |
28 | * Selective Display:: Hiding lines with lots of indentation. |
29 | * Optional Mode Line:: Optional mode line display features. | |
30 | * Text Display:: How text characters are normally displayed. | |
099bfef9 | 31 | * Cursor Display:: Features for displaying the cursor. |
9d2908a6 RS |
32 | * Line Truncation:: Truncating lines to fit the screen width instead |
33 | of continuing them to multiple screen lines. | |
458db4b6 | 34 | * Visual Line Mode:: Word wrap and screen line-based editing. |
0015d677 | 35 | * Display Custom:: Information on variables for customizing display. |
6bf7aab6 DL |
36 | @end menu |
37 | ||
dc917bd9 RS |
38 | @node Scrolling |
39 | @section Scrolling | |
40 | ||
41 | If a buffer contains text that is too large to fit entirely within a | |
42 | window that is displaying the buffer, Emacs shows a contiguous portion of | |
43 | the text. The portion shown always contains point. | |
44 | ||
45 | @cindex scrolling | |
46 | @dfn{Scrolling} means moving text up or down in the window so that | |
47 | different parts of the text are visible. Scrolling ``forward'' or | |
48 | ``up'' means that text moves up, and new text appears at the bottom. | |
49 | Scrolling ``backward'' or ``down'' moves text down, and new text | |
50 | appears at the top. | |
51 | ||
52 | Scrolling happens automatically if you move point past the bottom or | |
956c76ef CY |
53 | top of the window. You can also scroll explicitly with these |
54 | commands: | |
dc917bd9 RS |
55 | |
56 | @table @kbd | |
57 | @item C-l | |
91ed7ea8 CY |
58 | Scroll the selected window so that the current line is the center-most |
59 | text line; on subsequent consecutive invocations, make the current | |
60 | line the top-most line, the bottom-most line, and so forth in cyclic | |
61 | order; also, maybe redisplay the screen (@code{recenter-top-bottom}). | |
dc917bd9 | 62 | @item C-v |
b5700de6 CY |
63 | @itemx @key{next} |
64 | @itemx @key{PageDown} | |
956c76ef | 65 | Scroll forward by nearly a full window (@code{scroll-up}). |
dc917bd9 | 66 | @item M-v |
b5700de6 CY |
67 | @itemx @key{prior} |
68 | @itemx @key{PageUp} | |
956c76ef | 69 | Scroll backward (@code{scroll-down}). |
dc917bd9 RS |
70 | @item C-M-l |
71 | Scroll heuristically to bring useful information onto the screen | |
72 | (@code{reposition-window}). | |
73 | @end table | |
74 | ||
75 | @kindex C-l | |
956c76ef | 76 | @findex recenter-top-bottom |
91ed7ea8 CY |
77 | @kbd{C-l} (@code{recenter-top-bottom}) is a basic scrolling command. |
78 | It @dfn{recenters} the selected window, scrolling it so that the | |
79 | current screen line is exactly in the center of the window, or as | |
80 | close to the center as possible. | |
956c76ef CY |
81 | |
82 | Typing @kbd{C-l} twice in a row (@kbd{C-l C-l}) scrolls the window | |
83 | so that point is on the topmost screen line. Typing a third @kbd{C-l} | |
84 | scrolls the window so that point is on the bottom-most screen line. | |
85 | Each successive @kbd{C-l} cycles through these three screen positions. | |
91ed7ea8 CY |
86 | |
87 | @vindex recenter-positions | |
88 | You can change the cycling order by customizing the list variable | |
89 | @code{recenter-positions}. Each list element should be the symbol | |
90 | @code{top}, @code{middle}, or @code{bottom}, or a number; an integer | |
91 | number means to move the line to the specified screen line, while a | |
92 | floating-point number between 0.0 and 1.0 specifies a percentage of | |
93 | the screen space from the top. The default, @code{(middle top | |
94 | bottom)}, is the cycling order described above. Furthermore, if you | |
95 | change the variable @code{scroll-margin} to a non-zero value @var{n}, | |
96 | Emacs always leaves @var{n} screen lines between point and the top or | |
97 | bottom of the window (@pxref{Auto Scrolling}). | |
956c76ef CY |
98 | |
99 | You can also supply @kbd{C-l} with a prefix argument. With a plain | |
100 | prefix argument, @kbd{C-u C-l}, Emacs simply recenters point. With a | |
101 | positive argument @var{n}, it scrolls to place point @var{n} lines | |
102 | down from the top of the window. An argument of zero puts point on | |
103 | the topmost line. A negative argument @var{-n} puts point @var{n} | |
104 | lines from the bottom of the window. For example, @kbd{C-u - 1 C-l} | |
105 | puts point on the bottom line, and @kbd{C-u - 5 C-l} puts it five | |
106 | lines from the bottom. When given an argument, @kbd{C-l} does not | |
107 | clear the screen or cycle through different screen positions. | |
dc917bd9 | 108 | |
91ed7ea8 CY |
109 | The more primitive command @code{recenter} behaves like |
110 | @code{recenter-top-bottom}, but does not cycle among screen positions. | |
111 | Prior to Emacs 23, @kbd{C-l} was bound to @code{recenter}. | |
112 | ||
666e158e | 113 | @vindex recenter-redisplay |
91ed7ea8 CY |
114 | If the variable @code{recenter-redisplay} has a non-@code{nil} |
115 | value, Emacs clears and redisplays the screen each time @kbd{C-l} | |
116 | recenters the window; the special value @code{tty} (the default) says | |
117 | to do this on text-terminal frames only. Redisplaying is useful in | |
118 | case the screen becomes garbled for any reason (@pxref{Screen | |
119 | Garbled}). | |
666e158e | 120 | |
dc917bd9 RS |
121 | @kindex C-v |
122 | @kindex M-v | |
b5700de6 CY |
123 | @kindex next |
124 | @kindex prior | |
125 | @kindex PageDown | |
126 | @kindex PageUp | |
dc917bd9 RS |
127 | @findex scroll-up |
128 | @findex scroll-down | |
91ed7ea8 | 129 | To read the buffer a windowful at a time, type @kbd{C-v} |
956c76ef CY |
130 | (@code{scroll-up}). This scrolls forward by nearly the whole window |
131 | height. The effect is to take the two lines at the bottom of the | |
132 | window and put them at the top, followed by lines that were not | |
133 | previously visible. If point was in the text that scrolled off the | |
134 | top, it ends up at the new top of the window. | |
135 | ||
136 | @kbd{M-v} (@code{scroll-down}) scrolls backward in a similar way. | |
dc917bd9 | 137 | |
43d67313 | 138 | @vindex next-screen-context-lines |
956c76ef CY |
139 | The variable @code{next-screen-context-lines} controls the number of |
140 | lines of overlap left by @kbd{C-v} or @kbd{M-v}; by default, it is 2. | |
b5700de6 | 141 | The function keys @key{next} and @key{prior}, or @key{PageDown} and |
956c76ef CY |
142 | @key{PageUp}, are equivalent to @kbd{C-v} and @kbd{M-v} respectively. |
143 | ||
144 | You can supply @kbd{C-v} or @kbd{M-v} with a numeric prefix argument | |
145 | @var{n}. This scrolls the window by @var{n} lines, while attempting | |
146 | to leave point unchanged (so that the text and point move up or down | |
147 | together). @kbd{C-v} with a negative argument is like @kbd{M-v} and | |
148 | vice versa. | |
dc917bd9 RS |
149 | |
150 | The names of scroll commands are based on the direction that the | |
151 | text moves in the window. Thus, the command to scroll forward is | |
152 | called @code{scroll-up} because it moves the text upward on the | |
956c76ef | 153 | screen. The keys @key{PageUp} and @key{PageDown} derive their names |
dc917bd9 | 154 | and customary meanings from a different convention that developed |
956c76ef | 155 | elsewhere; hence the strange result that @key{PageDown} runs |
dc917bd9 RS |
156 | @code{scroll-up}. |
157 | ||
158 | @vindex scroll-preserve-screen-position | |
159 | Some users like the full-screen scroll commands to keep point at the | |
956c76ef CY |
160 | same screen position. To enable this behavior, set the variable |
161 | @code{scroll-preserve-screen-position} to a non-@code{nil} value. | |
162 | Then, whenever a command scrolls the text around point offscreen (or | |
163 | within @code{scroll-margin} lines of the edge), Emacs moves point to | |
164 | keep it at the same vertical and horizontal position within the | |
165 | window. This mode is convenient for browsing through a file by | |
166 | scrolling by screenfuls; if you come back to the screen where you | |
167 | started, point goes back to the line where it started. | |
dc917bd9 RS |
168 | |
169 | @kindex C-M-l | |
170 | @findex reposition-window | |
171 | The @kbd{C-M-l} command (@code{reposition-window}) scrolls the current | |
172 | window heuristically in a way designed to get useful information onto | |
173 | the screen. For example, in a Lisp file, this command tries to get the | |
174 | entire current defun onto the screen if possible. | |
175 | ||
43d67313 RS |
176 | @node Auto Scrolling |
177 | @section Automatic Scrolling | |
178 | ||
956c76ef CY |
179 | Emacs performs @dfn{automatic scrolling} when point moves out of the |
180 | visible portion of the text. | |
181 | ||
dc917bd9 | 182 | @vindex scroll-conservatively |
956c76ef CY |
183 | Normally, this centers point vertically within the window. However, |
184 | if you set @code{scroll-conservatively} to a small number @var{n}, | |
185 | then if you move point just a little off the screen (less than @var{n} | |
186 | lines), Emacs scrolls the text just far enough to bring point back on | |
187 | screen. By default, @code{scroll-conservatively} is@tie{}0. | |
dc917bd9 RS |
188 | |
189 | @cindex aggressive scrolling | |
190 | @vindex scroll-up-aggressively | |
191 | @vindex scroll-down-aggressively | |
192 | When the window does scroll by a longer distance, you can control | |
956c76ef | 193 | how aggressively it scrolls by setting the variables |
dc917bd9 RS |
194 | @code{scroll-up-aggressively} and @code{scroll-down-aggressively}. |
195 | The value of @code{scroll-up-aggressively} should be either | |
196 | @code{nil}, or a fraction @var{f} between 0 and 1. A fraction | |
956c76ef CY |
197 | specifies where on the screen to put point when scrolling upward: when |
198 | a window scrolls up because point is above the window start, the new | |
199 | start position is chosen to put point @var{f} parts of the window | |
200 | height from the top. Thus, larger @var{f} means more aggressive | |
201 | scrolling. The default value, @code{nil}, is equivalent to 0.5. | |
dc917bd9 RS |
202 | |
203 | Likewise, @code{scroll-down-aggressively} is used for scrolling | |
956c76ef CY |
204 | down. The value specifies how far point should be placed from the |
205 | bottom of the window; thus, as with @code{scroll-up-aggressively}, a | |
206 | larger value is more aggressive. | |
dc917bd9 RS |
207 | |
208 | @vindex scroll-margin | |
209 | The variable @code{scroll-margin} restricts how close point can come | |
210 | to the top or bottom of a window. Its value is a number of screen | |
956c76ef CY |
211 | lines; if point comes within that many lines of the top or bottom of |
212 | the window, Emacs performs automatic scrolling. By default, | |
213 | @code{scroll-margin} is 0. | |
dc917bd9 RS |
214 | |
215 | @node Horizontal Scrolling | |
216 | @section Horizontal Scrolling | |
217 | @cindex horizontal scrolling | |
218 | ||
956c76ef | 219 | @vindex auto-hscroll-mode |
dc917bd9 | 220 | @dfn{Horizontal scrolling} means shifting all the lines sideways |
956c76ef CY |
221 | within a window, so that some of the text near the left margin is not |
222 | displayed. When the text in a window is scrolled horizontally, text | |
223 | lines are truncated rather than continued (@pxref{Line Truncation}). | |
224 | If a window shows truncated lines, Emacs performs automatic horizontal | |
225 | scrolling whenever point moves off the left or right edge of the | |
226 | screen. To disable automatic horizontal scrolling, set the variable | |
6308321a EZ |
227 | @code{auto-hscroll-mode} to @code{nil}. Note that when the automatic |
228 | horizontal scrolling is turned off, if point moves off the edge of the | |
229 | screen, the cursor disappears to indicate that. (On text-mode | |
230 | terminals, the cursor is left at the edge instead.) | |
956c76ef CY |
231 | |
232 | @vindex hscroll-margin | |
233 | The variable @code{hscroll-margin} controls how close point can get | |
6308321a EZ |
234 | to the window's edges before automatic scrolling occurs. It is |
235 | measured in columns. For example, if the value is 5, then moving | |
236 | point within 5 columns of an edge causes horizontal scrolling away | |
237 | from that edge. | |
956c76ef CY |
238 | |
239 | @vindex hscroll-step | |
240 | The variable @code{hscroll-step} determines how many columns to | |
241 | scroll the window when point gets too close to the edge. Zero, the | |
242 | default value, means to center point horizontally within the window. | |
243 | A positive integer value specifies the number of columns to scroll by. | |
244 | A floating-point number specifies the fraction of the window's width | |
245 | to scroll by. | |
246 | ||
247 | You can also perform explicit horizontal scrolling with the | |
248 | following commands: | |
dc917bd9 RS |
249 | |
250 | @table @kbd | |
251 | @item C-x < | |
252 | Scroll text in current window to the left (@code{scroll-left}). | |
253 | @item C-x > | |
254 | Scroll to the right (@code{scroll-right}). | |
255 | @end table | |
256 | ||
257 | @kindex C-x < | |
258 | @kindex C-x > | |
259 | @findex scroll-left | |
260 | @findex scroll-right | |
6308321a EZ |
261 | @kbd{C-x <} (@code{scroll-left}) scrolls text in the selected window |
262 | to the left by the full width of the window, less two columns. (In | |
263 | other words, the text in the window moves left relative to the | |
264 | window.) With a numeric argument @var{n}, it scrolls by @var{n} | |
265 | columns. | |
266 | ||
267 | If the text is scrolled to the left, and point moves off the left | |
268 | edge of the window, the cursor will freeze at the left edge of the | |
269 | window, until point moves back to the displayed portion of the text. | |
270 | This is independent of the current setting of | |
271 | @code{auto-hscroll-mode}, which, for text scrolled to the left, only | |
272 | affects the behavior at the right edge of the window. | |
956c76ef CY |
273 | |
274 | @kbd{C-x >} (@code{scroll-right}) scrolls similarly to the right. | |
275 | The window cannot be scrolled any farther to the right once it is | |
276 | displayed normally, with each line starting at the window's left | |
277 | margin; attempting to do so has no effect. This means that you don't | |
278 | have to calculate the argument precisely for @w{@kbd{C-x >}}; any | |
279 | sufficiently large argument will restore the normal display. | |
dc917bd9 RS |
280 | |
281 | If you use those commands to scroll a window horizontally, that sets | |
282 | a lower bound for automatic horizontal scrolling. Automatic scrolling | |
283 | will continue to scroll the window, but never farther to the right | |
284 | than the amount you previously set by @code{scroll-left}. | |
285 | ||
dc917bd9 RS |
286 | @node Follow Mode |
287 | @section Follow Mode | |
288 | @cindex Follow mode | |
289 | @cindex mode, Follow | |
290 | @findex follow-mode | |
291 | @cindex windows, synchronizing | |
292 | @cindex synchronizing windows | |
293 | ||
294 | @dfn{Follow mode} is a minor mode that makes two windows, both | |
295 | showing the same buffer, scroll as a single tall ``virtual window.'' | |
296 | To use Follow mode, go to a frame with just one window, split it into | |
297 | two side-by-side windows using @kbd{C-x 3}, and then type @kbd{M-x | |
298 | follow-mode}. From then on, you can edit the buffer in either of the | |
299 | two windows, or scroll either one; the other window follows it. | |
300 | ||
301 | In Follow mode, if you move point outside the portion visible in one | |
302 | window and into the portion visible in the other window, that selects | |
303 | the other window---again, treating the two as if they were parts of | |
304 | one large window. | |
305 | ||
306 | To turn off Follow mode, type @kbd{M-x follow-mode} a second time. | |
307 | ||
b8f3a9e3 | 308 | @node Faces |
b18a8f7f | 309 | @section Faces: Controlling Text Display Style |
b8f3a9e3 GM |
310 | @cindex faces |
311 | ||
956c76ef | 312 | Emacs can display text in several different styles, which are called |
0015d677 | 313 | @dfn{faces}. Each face can specify various @dfn{face attributes}, |
956c76ef CY |
314 | such as the font, height, weight and slant, the foreground and |
315 | background color, and underlining or overlining. A face does not have | |
316 | to specify all of these attributes; often it inherits most of them | |
317 | from another face. | |
306da12e | 318 | |
956c76ef CY |
319 | On a text-only terminal, not all face attributes are meaningful. |
320 | Some text-only terminals support inverse video, bold, and underline | |
321 | attributes; some support colors. Text-only terminals generally do not | |
322 | support changing the height, width or font. | |
c1b45553 | 323 | |
b18a8f7f RS |
324 | Most major modes assign faces to the text automatically through the |
325 | work of Font Lock mode. @xref{Font Lock}, for more information about | |
326 | Font Lock mode and syntactic highlighting. You can print the current | |
327 | buffer with the highlighting that appears on your screen using the | |
328 | command @code{ps-print-buffer-with-faces}. @xref{PostScript}. | |
43d08eb9 | 329 | |
956c76ef | 330 | Enriched mode, the mode for editing formatted text, provides |
0073fd65 | 331 | commands and menus for specifying faces for text in the buffer. |
956c76ef | 332 | @xref{Format Faces}. |
b8f3a9e3 GM |
333 | |
334 | @cindex face colors, setting | |
0073fd65 RS |
335 | To alter the appearance of a face, use the customization buffer. |
336 | @xref{Face Customization}. You can also use X resources to specify | |
956c76ef CY |
337 | attributes of any particular face (@pxref{Resources}). When |
338 | displaying a character, any attribute that isn't specified by its face | |
339 | is taken from the @code{default} face, whose attributes reflect the | |
340 | default settings of the frame itself. | |
341 | ||
342 | @findex set-face-foreground | |
343 | @findex set-face-background | |
344 | You can also change the foreground and background colors of a | |
345 | specific face with @kbd{M-x set-face-foreground} and @kbd{M-x | |
346 | set-face-background}. These commands prompt in the minibuffer for a | |
347 | face name and a color name, with completion, and then set that face to | |
348 | use the specified color. @xref{Face Customization}, for information | |
349 | about color names. These commands affect the face colors on all | |
350 | frames, both existing and those to be created in the future. These | |
351 | changes do not, however, persist for future Emacs sessions; to make | |
352 | lasting changes, use the customization buffer (@pxref{Face | |
353 | Customization}). | |
354 | ||
355 | You can also set foreground and background colors for the current | |
356 | frame only; see @ref{Frame Parameters}. | |
357 | ||
358 | Emacs can display variable-width fonts, but some of the Emacs | |
359 | commands that calculate width and indentation do not know how to | |
360 | calculate variable widths. This can sometimes lead to incorrect | |
361 | results when you use variable-width fonts. In particular, indentation | |
362 | commands can give inconsistent results, so we recommend you avoid | |
363 | variable-width fonts, especially for editing program source code. | |
b8f3a9e3 | 364 | |
43d08eb9 RS |
365 | @node Standard Faces |
366 | @section Standard Faces | |
367 | ||
b8f3a9e3 | 368 | @findex list-faces-display |
43d08eb9 RS |
369 | To see what faces are currently defined, and what they look like, |
370 | type @kbd{M-x list-faces-display}. It's possible for a given face to | |
371 | look different in different frames; this command shows the appearance | |
93339ade CY |
372 | in the frame in which you type it. With a prefix argument, this |
373 | prompts for a regular expression, and displays only faces with names | |
374 | matching that regular expression. | |
3b91a16d | 375 | |
54952612 RS |
376 | Here are the standard faces for specifying text appearance. You can |
377 | apply them to specific text when you want the effects they produce. | |
b8f3a9e3 GM |
378 | |
379 | @table @code | |
380 | @item default | |
54952612 | 381 | This face is used for ordinary text that doesn't specify any face. |
43d08eb9 | 382 | @item bold |
956c76ef | 383 | This face uses a bold variant of the default font. |
43d08eb9 | 384 | @item italic |
956c76ef | 385 | This face uses an italic variant of the default font. |
43d08eb9 | 386 | @item bold-italic |
956c76ef | 387 | This face uses a bold italic variant of the default font. |
43d08eb9 RS |
388 | @item underline |
389 | This face underlines text. | |
390 | @item fixed-pitch | |
956c76ef CY |
391 | This face forces use of a fixed-width font. It's reasonable to |
392 | customize this face to use a different fixed-width font, if you like, | |
393 | but you should not make it a variable-width font. | |
43d08eb9 | 394 | @item variable-pitch |
956c76ef | 395 | This face forces use of a variable-width font. |
3b91a16d JL |
396 | @item shadow |
397 | This face is used for making the text less noticeable than the surrounding | |
398 | ordinary text. Usually this can be achieved by using shades of gray in | |
399 | contrast with either black or white default foreground color. | |
43d08eb9 RS |
400 | @end table |
401 | ||
402 | Here's an incomplete list of faces used to highlight parts of the | |
403 | text temporarily for specific purposes. (Many other modes define | |
404 | their own faces for this purpose.) | |
405 | ||
406 | @table @code | |
407 | @item highlight | |
408 | This face is used for highlighting portions of text, in various modes. | |
409 | For example, mouse-sensitive text is highlighted using this face. | |
43d08eb9 | 410 | @item isearch |
956c76ef CY |
411 | This face is used for highlighting the current Isearch match |
412 | (@pxref{Incremental Search}). | |
54952612 | 413 | @item query-replace |
956c76ef CY |
414 | This face is used for highlighting the current Query Replace match |
415 | (@pxref{Replace}). | |
43d08eb9 RS |
416 | @item lazy-highlight |
417 | This face is used for lazy highlighting of Isearch and Query Replace | |
418 | matches other than the current one. | |
419 | @item region | |
04eaab7d | 420 | This face is used for displaying a selected region (@pxref{Mark}). |
43d08eb9 RS |
421 | @item secondary-selection |
422 | This face is used for displaying a secondary X selection (@pxref{Secondary | |
423 | Selection}). | |
424 | @item trailing-whitespace | |
3b91a16d JL |
425 | The face for highlighting excess spaces and tabs at the end of a line |
426 | when @code{show-trailing-whitespace} is non-@code{nil}; see | |
427 | @ref{Useless Whitespace}. | |
43d08eb9 | 428 | @item nobreak-space |
5a7f4c1b | 429 | The face for displaying the character ``nobreak space.'' |
43d08eb9 RS |
430 | @item escape-glyph |
431 | The face for highlighting the @samp{\} or @samp{^} that indicates | |
432 | a control character. It's also used when @samp{\} indicates a | |
433 | nobreak space or nobreak (soft) hyphen. | |
43d08eb9 RS |
434 | @end table |
435 | ||
43d08eb9 RS |
436 | These faces control the appearance of parts of the Emacs frame. |
437 | They exist as faces to provide a consistent way to customize the | |
438 | appearance of these parts of the frame. | |
439 | ||
440 | @table @code | |
b8f3a9e3 | 441 | @item mode-line |
3b91a16d JL |
442 | This face is used for the mode line of the currently selected window, |
443 | and for menu bars when toolkit menus are not used. By default, it's | |
54952612 | 444 | drawn with shadows for a ``raised'' effect on graphical displays, and |
3b91a16d | 445 | drawn as the inverse of the default face on non-windowed terminals. |
b9e58bf2 EZ |
446 | @item mode-line-inactive |
447 | Like @code{mode-line}, but used for mode lines of the windows other | |
448 | than the selected one (if @code{mode-line-in-non-selected-windows} is | |
ac6875fc RS |
449 | non-@code{nil}). This face inherits from @code{mode-line}, so changes |
450 | in that face affect mode lines in all windows. | |
d545c9fd JL |
451 | @item mode-line-highlight |
452 | Like @code{highlight}, but used for portions of text on mode lines. | |
453 | @item mode-line-buffer-id | |
454 | This face is used for buffer identification parts in the mode line. | |
b8f3a9e3 | 455 | @item header-line |
54952612 RS |
456 | Similar to @code{mode-line} for a window's header line, which appears |
457 | at the top of a window just as the mode line appears at the bottom. | |
458 | Most windows do not have a header line---only some special modes, such | |
459 | Info mode, create one. | |
53abc3bf | 460 | @item vertical-border |
58f1b4d8 JL |
461 | This face is used for the vertical divider between windows. |
462 | By default this face inherits from the @code{mode-line-inactive} face | |
54952612 | 463 | on character terminals. On graphical displays the foreground color of |
58f1b4d8 JL |
464 | this face is used for the vertical line between windows without |
465 | scrollbars. | |
3094ad7a | 466 | @item minibuffer-prompt |
3b91a16d JL |
467 | @cindex @code{minibuffer-prompt} face |
468 | @vindex minibuffer-prompt-properties | |
3094ad7a | 469 | This face is used for the prompt strings displayed in the minibuffer. |
3b91a16d JL |
470 | By default, Emacs automatically adds this face to the value of |
471 | @code{minibuffer-prompt-properties}, which is a list of text | |
43d67313 RS |
472 | properties used to display the prompt text. (This variable takes |
473 | effect when you enter the minibuffer.) | |
b8f3a9e3 | 474 | @item fringe |
3b91a16d | 475 | @cindex @code{fringe} face |
b8f3a9e3 GM |
476 | The face for the fringes to the left and right of windows on graphic |
477 | displays. (The fringes are the narrow portions of the Emacs frame | |
940627fe | 478 | between the text area and the window's right and left borders.) |
43d08eb9 | 479 | @xref{Fringes}. |
b8f3a9e3 GM |
480 | @item scroll-bar |
481 | This face determines the visual appearance of the scroll bar. | |
43d08eb9 | 482 | @xref{Scroll Bars}. |
b8f3a9e3 GM |
483 | @item border |
484 | This face determines the color of the frame border. | |
485 | @item cursor | |
486 | This face determines the color of the cursor. | |
487 | @item mouse | |
488 | This face determines the color of the mouse pointer. | |
489 | @item tool-bar | |
54952612 | 490 | This face determines the color of tool bar icons. @xref{Tool Bars}. |
b8f3a9e3 | 491 | @item tooltip |
43d08eb9 | 492 | This face is used for tooltips. @xref{Tooltips}. |
b8f3a9e3 | 493 | @item menu |
9e6bb19f EZ |
494 | @cindex menu bar appearance |
495 | @cindex @code{menu} face, no effect if customized | |
496 | @cindex customization of @code{menu} face | |
497 | This face determines the colors and font of Emacs's menus. @xref{Menu | |
956c76ef CY |
498 | Bars}. This has no effect in Emacs built with GTK and in the |
499 | MS-Windows/Mac ports; you need to use system-wide styles and options | |
500 | to change the appearance of GTK, Windows, or Mac menus. Setting the | |
501 | font of LessTif/Motif menus is currently not supported; attempts to | |
502 | set the font are ignored in this case. | |
b8f3a9e3 GM |
503 | @end table |
504 | ||
956c76ef CY |
505 | @node Temporary Face Changes |
506 | @section Temporary Face Changes | |
507 | ||
508 | The following commands change the default face within a buffer. | |
509 | ||
510 | @cindex adjust buffer face height | |
511 | @findex text-scale-adjust | |
512 | @kindex C-x C-+ | |
513 | @kindex C-x C-- | |
514 | @kindex C-x C-= | |
515 | @kindex C-x C-0 | |
516 | To increase the height of the default face in the current buffer, | |
517 | type @kbd{C-x C-+} or @kbd{C-x C-=}. To decrease it, type @kbd{C-x | |
518 | C--}. To restore the default (global) face height, type @kbd{C-x | |
519 | C-0}. These keys are all bound to the same command, | |
520 | @code{text-scale-adjust}, which looks at the last key typed to | |
521 | determine which action to take. | |
522 | ||
523 | The final key of these commands may be repeated without the leading | |
524 | @kbd{C-x}. For instance, @kbd{C-x C-= C-= C-=} increases the face | |
525 | height by three steps. Each step scales the height of the default | |
526 | face by the value of the variable @code{text-scale-mode-step}. As a | |
527 | special case, an argument of 0 removes any scaling currently active. | |
528 | ||
529 | @cindex increase buffer face height | |
530 | @findex text-scale-increase | |
531 | @cindex decrease buffer face height | |
532 | @findex text-scale-decrease | |
533 | The commands @code{text-scale-increase} and | |
534 | @code{text-scale-decrease} increase or decrease the height of the | |
535 | default face, just like @kbd{C-x C-+} and @kbd{C-x C--} respectively. | |
536 | You may find it convenient to bind to these commands, rather than | |
537 | @code{text-scale-adjust}. | |
538 | ||
05fbc4a9 MB |
539 | @cindex set buffer face height |
540 | @findex text-scale-set | |
541 | The command @code{text-scale-set} sets the height of the default face | |
542 | in the current buffer to an absolute level specified by its prefix | |
543 | argument. | |
544 | ||
956c76ef CY |
545 | @findex text-scale-mode |
546 | The above commands automatically enable or disable the minor mode | |
547 | @code{text-scale-mode}, depending on whether the current font scaling | |
548 | is other than 1 or not. | |
549 | ||
550 | @cindex variable pitch mode | |
551 | @findex variable-pitch-mode | |
552 | To temporarily change the face in the current buffer to a | |
553 | variable-pitch (``proportional'') font, use the command @kbd{M-x | |
554 | variable-pitch-mode} to enable or disable the Variable Pitch minor | |
555 | mode. | |
556 | ||
b8f3a9e3 GM |
557 | @node Font Lock |
558 | @section Font Lock mode | |
559 | @cindex Font Lock mode | |
560 | @cindex mode, Font Lock | |
561 | @cindex syntax highlighting and coloring | |
562 | ||
8cc11660 | 563 | Font Lock mode is a minor mode, always local to a particular buffer, |
0015d677 | 564 | which highlights (or ``fontifies'') the buffer contents according to |
8cc11660 | 565 | the syntax of the text you are editing. It can recognize comments and |
956c76ef CY |
566 | strings in most programming languages; in several languages, it can |
567 | also recognize and properly highlight various other important | |
568 | constructs, such as names of functions being defined or reserved | |
569 | keywords. Some special modes, such as Occur mode and Info mode, have | |
570 | completely specialized ways of assigning fonts for Font Lock mode. | |
b8f3a9e3 GM |
571 | |
572 | @findex font-lock-mode | |
c4e8acbc CY |
573 | Font Lock mode is turned on by default in all modes which support it. |
574 | You can toggle font-lock for each buffer with the command @kbd{M-x | |
575 | font-lock-mode}. Using a positive argument unconditionally turns Font | |
576 | Lock mode on, and a negative or zero argument turns it off. | |
b8f3a9e3 GM |
577 | |
578 | @findex global-font-lock-mode | |
579 | @vindex global-font-lock-mode | |
c4e8acbc CY |
580 | If you do not wish Font Lock mode to be turned on by default, |
581 | customize the variable @code{global-font-lock-mode} using the Customize | |
582 | interface (@pxref{Easy Customization}), or use the function | |
d239287a | 583 | @code{global-font-lock-mode} in your @file{.emacs} file, like this: |
b8f3a9e3 GM |
584 | |
585 | @example | |
c4e8acbc | 586 | (global-font-lock-mode 0) |
b8f3a9e3 GM |
587 | @end example |
588 | ||
43d67313 RS |
589 | @noindent |
590 | This variable, like all the variables that control Font Lock mode, | |
591 | take effect whenever fontification is done; that is, potentially at | |
592 | any time. | |
593 | ||
c4e8acbc | 594 | @findex turn-on-font-lock |
54952612 RS |
595 | If you have disabled Global Font Lock mode, you can still enable Font |
596 | Lock for specific major modes by adding the function | |
c4e8acbc CY |
597 | @code{turn-on-font-lock} to the mode hooks (@pxref{Hooks}). For |
598 | example, to enable Font Lock mode for editing C files, you can do this: | |
599 | ||
600 | @example | |
601 | (add-hook 'c-mode-hook 'turn-on-font-lock) | |
602 | @end example | |
0015d677 | 603 | |
b8f3a9e3 GM |
604 | Font Lock mode uses several specifically named faces to do its job, |
605 | including @code{font-lock-string-face}, @code{font-lock-comment-face}, | |
54952612 RS |
606 | and others. The easiest way to find them all is to use @kbd{M-x |
607 | customize-group @key{RET} font-lock-faces @key{RET}}. You can then | |
608 | use that customization buffer to customize the appearance of these | |
609 | faces. @xref{Face Customization}. | |
b8f3a9e3 | 610 | |
b8f3a9e3 GM |
611 | @vindex font-lock-maximum-decoration |
612 | The variable @code{font-lock-maximum-decoration} specifies the | |
613 | preferred level of fontification, for modes that provide multiple | |
614 | levels. Level 1 is the least amount of fontification; some modes | |
615 | support levels as high as 3. The normal default is ``as high as | |
616 | possible.'' You can specify an integer, which applies to all modes, or | |
617 | you can specify different numbers for particular major modes; for | |
618 | example, to use level 1 for C/C++ modes, and the default level | |
619 | otherwise, use this: | |
620 | ||
621 | @example | |
622 | (setq font-lock-maximum-decoration | |
623 | '((c-mode . 1) (c++-mode . 1))) | |
624 | @end example | |
625 | ||
626 | @vindex font-lock-maximum-size | |
627 | Fontification can be too slow for large buffers, so you can suppress | |
54952612 RS |
628 | it for buffers above a certain size. The variable |
629 | @code{font-lock-maximum-size} specifies a buffer size, beyond which | |
630 | buffer fontification is suppressed. | |
b8f3a9e3 GM |
631 | |
632 | @c @w is used below to prevent a bad page-break. | |
633 | @vindex font-lock-beginning-of-syntax-function | |
e07e854d EZ |
634 | @cindex incorrect fontification |
635 | @cindex parenthesis in column zero and fontification | |
636 | @cindex brace in column zero and fontification | |
b8f3a9e3 GM |
637 | Comment and string fontification (or ``syntactic'' fontification) |
638 | relies on analysis of the syntactic structure of the buffer text. For | |
174862cf RS |
639 | the sake of speed, some modes, including Lisp mode, rely on a special |
640 | convention: an open-parenthesis or open-brace in the leftmost column | |
641 | always defines the @w{beginning} of a defun, and is thus always | |
642 | outside any string or comment. (@xref{Left Margin Paren}.) If you | |
643 | don't follow this convention, Font Lock mode can misfontify the text | |
644 | that follows an open-parenthesis or open-brace in the leftmost column | |
645 | that is inside a string or comment. | |
b8f3a9e3 | 646 | |
6bb2ed9b | 647 | @cindex slow display during scrolling |
b8f3a9e3 GM |
648 | The variable @code{font-lock-beginning-of-syntax-function} (always |
649 | buffer-local) specifies how Font Lock mode can find a position | |
650 | guaranteed to be outside any comment or string. In modes which use the | |
651 | leftmost column parenthesis convention, the default value of the variable | |
652 | is @code{beginning-of-defun}---that tells Font Lock mode to use the | |
653 | convention. If you set this variable to @code{nil}, Font Lock no longer | |
654 | relies on the convention. This avoids incorrect results, but the price | |
655 | is that, in some cases, fontification for a changed text must rescan | |
6bb2ed9b EZ |
656 | buffer text from the beginning of the buffer. This can considerably |
657 | slow down redisplay while scrolling, particularly if you are close to | |
658 | the end of a large buffer. | |
b8f3a9e3 GM |
659 | |
660 | @findex font-lock-add-keywords | |
661 | Font Lock highlighting patterns already exist for many modes, but you | |
662 | may want to fontify additional patterns. You can use the function | |
663 | @code{font-lock-add-keywords}, to add your own highlighting patterns for | |
664 | a particular mode. For example, to highlight @samp{FIXME:} words in C | |
665 | comments, use this: | |
666 | ||
667 | @example | |
a152877d SM |
668 | (add-hook 'c-mode-hook |
669 | (lambda () | |
670 | (font-lock-add-keywords nil | |
671 | '(("\\<\\(FIXME\\):" 1 font-lock-warning-face t))))) | |
b8f3a9e3 GM |
672 | @end example |
673 | ||
4063fff3 EZ |
674 | @findex font-lock-remove-keywords |
675 | To remove keywords from the font-lock highlighting patterns, use the | |
cd77ce13 | 676 | function @code{font-lock-remove-keywords}. @xref{Search-based |
956c76ef | 677 | Fontification,,, elisp, The Emacs Lisp Reference Manual}. |
4063fff3 | 678 | |
3be9b0ca EZ |
679 | @cindex just-in-time (JIT) font-lock |
680 | @cindex background syntax highlighting | |
681 | Fontifying large buffers can take a long time. To avoid large | |
682 | delays when a file is visited, Emacs fontifies only the visible | |
683 | portion of a buffer. As you scroll through the buffer, each portion | |
956c76ef CY |
684 | that becomes visible is fontified as soon as it is displayed; this |
685 | type of Font Lock is called @dfn{Just-In-Time} (or @dfn{JIT}) Lock. | |
686 | You can control how JIT Lock behaves, including telling it to perform | |
687 | fontification while idle, by customizing variables in the | |
688 | customization group @samp{jit-lock}. @xref{Specific Customization}. | |
3be9b0ca | 689 | |
b8f3a9e3 | 690 | @node Highlight Interactively |
54952612 | 691 | @section Interactive Highlighting |
b8f3a9e3 GM |
692 | @cindex highlighting by matching |
693 | @cindex interactive highlighting | |
54952612 | 694 | @cindex Highlight Changes mode |
b8f3a9e3 | 695 | |
54952612 | 696 | @findex highlight-changes-mode |
956c76ef CY |
697 | Highlight Changes mode is a minor mode that @dfn{highlights} the parts |
698 | of the buffer were changed most recently, by giving that text a | |
699 | different face. To enable or disable Highlight Changes mode, use | |
700 | @kbd{M-x highlight-changes-mode}. | |
b8f3a9e3 | 701 | |
54952612 | 702 | @cindex Hi Lock mode |
b8f3a9e3 | 703 | @findex hi-lock-mode |
956c76ef CY |
704 | Hi Lock mode is a minor mode that highlights text that matches |
705 | regular expressions you specify. For example, you can use it to | |
706 | highlight all the references to a certain variable in a program source | |
707 | file, highlight certain parts in a voluminous output of some program, | |
708 | or highlight certain names in an article. To enable or disable Hi | |
709 | Lock mode, use the command @kbd{M-x hi-lock-mode}. To enable Hi Lock | |
710 | mode for all buffers, use @kbd{M-x global-hi-lock-mode} or place | |
711 | @code{(global-hi-lock-mode 1)} in your @file{.emacs} file. | |
54952612 RS |
712 | |
713 | Hi Lock mode works like Font Lock mode (@pxref{Font Lock}), except | |
714 | that you specify explicitly the regular expressions to highlight. You | |
715 | control them with these commands: | |
b8f3a9e3 GM |
716 | |
717 | @table @kbd | |
718 | @item C-x w h @var{regexp} @key{RET} @var{face} @key{RET} | |
719 | @kindex C-x w h | |
720 | @findex highlight-regexp | |
cedf175b | 721 | Highlight text that matches @var{regexp} using face @var{face} |
54952612 RS |
722 | (@code{highlight-regexp}). The highlighting will remain as long as |
723 | the buffer is loaded. For example, to highlight all occurrences of | |
724 | the word ``whim'' using the default face (a yellow background) | |
725 | @kbd{C-x w h whim @key{RET} @key{RET}}. Any face can be used for | |
726 | highlighting, Hi Lock provides several of its own and these are | |
29a483ac JL |
727 | pre-loaded into a list of default values. While being prompted |
728 | for a face use @kbd{M-n} and @kbd{M-p} to cycle through them. | |
54952612 RS |
729 | |
730 | You can use this command multiple times, specifying various regular | |
731 | expressions to highlight in different ways. | |
b8f3a9e3 GM |
732 | |
733 | @item C-x w r @var{regexp} @key{RET} | |
734 | @kindex C-x w r | |
735 | @findex unhighlight-regexp | |
630acdcc | 736 | Unhighlight @var{regexp} (@code{unhighlight-regexp}). |
54952612 RS |
737 | |
738 | If you invoke this from the menu, you select the expression to | |
739 | unhighlight from a list. If you invoke this from the keyboard, you | |
740 | use the minibuffer. It will show the most recently added regular | |
741 | expression; use @kbd{M-p} to show the next older expression and | |
742 | @kbd{M-n} to select the next newer expression. (You can also type the | |
743 | expression by hand, with completion.) When the expression you want to | |
744 | unhighlight appears in the minibuffer, press @kbd{@key{RET}} to exit | |
745 | the minibuffer and unhighlight it. | |
b8f3a9e3 GM |
746 | |
747 | @item C-x w l @var{regexp} @key{RET} @var{face} @key{RET} | |
748 | @kindex C-x w l | |
749 | @findex highlight-lines-matching-regexp | |
750 | @cindex lines, highlighting | |
751 | @cindex highlighting lines of text | |
04d0b662 | 752 | Highlight entire lines containing a match for @var{regexp}, using face |
b8f3a9e3 GM |
753 | @var{face} (@code{highlight-lines-matching-regexp}). |
754 | ||
755 | @item C-x w b | |
756 | @kindex C-x w b | |
757 | @findex hi-lock-write-interactive-patterns | |
758 | Insert all the current highlighting regexp/face pairs into the buffer | |
759 | at point, with comment delimiters to prevent them from changing your | |
54952612 RS |
760 | program. (This key binding runs the |
761 | @code{hi-lock-write-interactive-patterns} command.) | |
b8f3a9e3 | 762 | |
3173ce7e RS |
763 | These patterns are extracted from the comments, if appropriate, if you |
764 | invoke @kbd{M-x hi-lock-find-patterns}, or if you visit the file while | |
765 | Hi Lock mode is enabled (since that runs @code{hi-lock-find-patterns}). | |
b8f3a9e3 GM |
766 | |
767 | @item C-x w i | |
768 | @kindex C-x w i | |
769 | @findex hi-lock-find-patterns | |
3173ce7e RS |
770 | Extract regexp/face pairs from comments in the current buffer |
771 | (@code{hi-lock-find-patterns}). Thus, you can enter patterns | |
772 | interactively with @code{highlight-regexp}, store them into the file | |
773 | with @code{hi-lock-write-interactive-patterns}, edit them (perhaps | |
cedf175b | 774 | including different faces for different parenthesized parts of the |
3173ce7e RS |
775 | match), and finally use this command (@code{hi-lock-find-patterns}) to |
776 | have Hi Lock highlight the edited patterns. | |
b8f3a9e3 | 777 | |
3173ce7e | 778 | @vindex hi-lock-file-patterns-policy |
d439bcd8 | 779 | The variable @code{hi-lock-file-patterns-policy} controls whether Hi |
0419b8d6 GM |
780 | Lock mode should automatically extract and highlight patterns found in a |
781 | file when it is visited. Its value can be @code{nil} (never highlight), | |
782 | @code{ask} (query the user), or a function. If it is a function, | |
783 | @code{hi-lock-find-patterns} calls it with the patterns as argument; if | |
784 | the function returns non-@code{nil}, the patterns are used. The default | |
785 | is @code{ask}. Note that patterns are always highlighted if you call | |
786 | @code{hi-lock-find-patterns} directly, regardless of the value of this | |
787 | variable. | |
3173ce7e RS |
788 | |
789 | @vindex hi-lock-exclude-modes | |
790 | Also, @code{hi-lock-find-patterns} does nothing if the current major | |
791 | mode's symbol is a member of the list @code{hi-lock-exclude-modes}. | |
b8f3a9e3 GM |
792 | @end table |
793 | ||
fad78d58 RS |
794 | @node Fringes |
795 | @section Window Fringes | |
796 | @cindex fringes | |
797 | ||
798 | On a graphical display, each Emacs window normally has narrow | |
956c76ef CY |
799 | @dfn{fringes} on the left and right edges. The fringes are used to |
800 | display symbols that provide information about the text in the window. | |
fad78d58 RS |
801 | |
802 | The most common use of the fringes is to indicate a continuation | |
803 | line, when one line of text is split into multiple lines on the | |
804 | screen. The left fringe shows a curving arrow for each screen line | |
805 | except the first, indicating that ``this is not the real beginning.'' | |
806 | The right fringe shows a curving arrow for each screen line except the | |
807 | last, indicating that ``this is not the real end.'' | |
808 | ||
566da2e7 | 809 | The fringes indicate line truncation with short horizontal arrows |
fad78d58 | 810 | meaning ``there's more text on this line which is scrolled |
566da2e7 EZ |
811 | horizontally out of view;'' clicking the mouse on one of the arrows |
812 | scrolls the display horizontally in the direction of the arrow. The | |
d239287a | 813 | fringes can also indicate other things, such as empty lines, or where a |
566da2e7 | 814 | program you are debugging is executing (@pxref{Debuggers}). |
fad78d58 RS |
815 | |
816 | @findex set-fringe-style | |
817 | @findex fringe-mode | |
818 | You can enable and disable the fringes for all frames using | |
819 | @kbd{M-x fringe-mode}. To enable and disable the fringes | |
820 | for the selected frame, use @kbd{M-x set-fringe-style}. | |
821 | ||
9d2908a6 RS |
822 | @node Displaying Boundaries |
823 | @section Displaying Boundaries | |
824 | ||
825 | @vindex indicate-buffer-boundaries | |
826 | On a graphical display, Emacs can indicate the buffer boundaries in | |
827 | the fringes. It indicates the first line and the last line with | |
828 | angle images in the fringes. This can be combined with up and down | |
829 | arrow images which say whether it is possible to scroll the window up | |
830 | and down. | |
831 | ||
832 | The buffer-local variable @code{indicate-buffer-boundaries} controls | |
833 | how the buffer boundaries and window scrolling is indicated in the | |
834 | fringes. If the value is @code{left} or @code{right}, both angle and | |
835 | arrow bitmaps are displayed in the left or right fringe, respectively. | |
836 | ||
837 | If value is an alist, each element @code{(@var{indicator} . | |
838 | @var{position})} specifies the position of one of the indicators. | |
839 | The @var{indicator} must be one of @code{top}, @code{bottom}, | |
840 | @code{up}, @code{down}, or @code{t} which specifies the default | |
841 | position for the indicators not present in the alist. | |
842 | The @var{position} is one of @code{left}, @code{right}, or @code{nil} | |
843 | which specifies not to show this indicator. | |
844 | ||
845 | For example, @code{((top . left) (t . right))} places the top angle | |
846 | bitmap in left fringe, the bottom angle bitmap in right fringe, and | |
847 | both arrow bitmaps in right fringe. To show just the angle bitmaps in | |
848 | the left fringe, but no arrow bitmaps, use @code{((top . left) | |
849 | (bottom . left))}. | |
850 | ||
fad78d58 RS |
851 | @node Useless Whitespace |
852 | @section Useless Whitespace | |
853 | ||
854 | @cindex trailing whitespace | |
855 | @cindex whitespace, trailing | |
856 | @vindex show-trailing-whitespace | |
857 | It is easy to leave unnecessary spaces at the end of a line, or | |
858 | empty lines at the end of a file, without realizing it. In most | |
859 | cases, this @dfn{trailing whitespace} has no effect, but there are | |
956c76ef | 860 | special circumstances where it matters, and it can be a nuisance. |
fad78d58 | 861 | |
956c76ef CY |
862 | You can make trailing whitespace at the end of a line visible by |
863 | setting the buffer-local variable @code{show-trailing-whitespace} to | |
864 | @code{t}. Then Emacs displays trailing whitespace, using the face | |
865 | @code{trailing-whitespace}. | |
fad78d58 RS |
866 | |
867 | This feature does not apply when point is at the end of the line | |
868 | containing the whitespace. Strictly speaking, that is ``trailing | |
869 | whitespace'' nonetheless, but displaying it specially in that case | |
870 | looks ugly while you are typing in new text. In this special case, | |
871 | the location of point is enough to show you that the spaces are | |
872 | present. | |
873 | ||
874 | @findex delete-trailing-whitespace | |
956c76ef CY |
875 | To delete all trailing whitespace within the buffer's accessible |
876 | portion (@pxref{Narrowing}), type @kbd{M-x delete-trailing-whitespace | |
877 | @key{RET}}. This command does not remove newline characters. | |
fad78d58 | 878 | |
23e3383d | 879 | @vindex indicate-empty-lines |
877db12e RS |
880 | @cindex unused lines |
881 | @cindex fringes, and unused line indication | |
882 | Emacs can indicate unused lines at the end of the window with a | |
883 | small image in the left fringe (@pxref{Fringes}). The image appears | |
884 | for window lines that do not correspond to any buffer text. Blank | |
885 | lines at the end of the buffer then stand out because they do not have | |
886 | this image in the fringe. | |
887 | ||
888 | To enable this feature, set the buffer-local variable | |
cd61af01 SM |
889 | @code{indicate-empty-lines} to a non-@code{nil} value. You can enable |
890 | or disable this feature for all new buffers by setting the default | |
891 | value of this variable, e.g.@: @code{(setq-default | |
892 | indicate-empty-lines t)};. (This feature currently doesn't work on | |
893 | text-only terminals.) | |
fad78d58 | 894 | |
6bf7aab6 DL |
895 | @node Selective Display |
896 | @section Selective Display | |
4946337d | 897 | @cindex selective display |
6bf7aab6 DL |
898 | @findex set-selective-display |
899 | @kindex C-x $ | |
900 | ||
956c76ef CY |
901 | Emacs has the ability to hide lines indented more than a given |
902 | number of columns. You can use this to get an overview of a part of a | |
903 | program. | |
6bf7aab6 | 904 | |
d239287a LT |
905 | To hide lines in the current buffer, type @kbd{C-x $} |
906 | (@code{set-selective-display}) with a numeric argument @var{n}. Then | |
907 | lines with at least @var{n} columns of indentation disappear from the | |
908 | screen. The only indication of their presence is that three dots | |
909 | (@samp{@dots{}}) appear at the end of each visible line that is | |
910 | followed by one or more hidden ones. | |
6bf7aab6 DL |
911 | |
912 | The commands @kbd{C-n} and @kbd{C-p} move across the hidden lines as | |
913 | if they were not there. | |
914 | ||
915 | The hidden lines are still present in the buffer, and most editing | |
916 | commands see them as usual, so you may find point in the middle of the | |
917 | hidden text. When this happens, the cursor appears at the end of the | |
918 | previous line, after the three dots. If point is at the end of the | |
919 | visible line, before the newline that ends it, the cursor appears before | |
920 | the three dots. | |
921 | ||
922 | To make all lines visible again, type @kbd{C-x $} with no argument. | |
923 | ||
924 | @vindex selective-display-ellipses | |
925 | If you set the variable @code{selective-display-ellipses} to | |
926 | @code{nil}, the three dots do not appear at the end of a line that | |
927 | precedes hidden lines. Then there is no visible indication of the | |
928 | hidden lines. This variable becomes local automatically when set. | |
929 | ||
0015d677 RS |
930 | See also @ref{Outline Mode} for another way to hide part of |
931 | the text in a buffer. | |
932 | ||
6bf7aab6 DL |
933 | @node Optional Mode Line |
934 | @section Optional Mode Line Features | |
935 | ||
b213b767 LK |
936 | @cindex buffer size display |
937 | @cindex display of buffer size | |
938 | @findex size-indication-mode | |
939 | The buffer percentage @var{pos} indicates the percentage of the | |
940 | buffer above the top of the window. You can additionally display the | |
941 | size of the buffer by typing @kbd{M-x size-indication-mode} to turn on | |
942 | Size Indication mode. The size will be displayed immediately | |
943 | following the buffer percentage like this: | |
944 | ||
945 | @example | |
946 | @var{POS} of @var{SIZE} | |
947 | @end example | |
948 | ||
949 | @noindent | |
950 | Here @var{SIZE} is the human readable representation of the number of | |
951 | characters in the buffer, which means that @samp{k} for 10^3, @samp{M} | |
952 | for 10^6, @samp{G} for 10^9, etc., are used to abbreviate. | |
953 | ||
e598186c RS |
954 | @cindex line number display |
955 | @cindex display of line number | |
6bf7aab6 DL |
956 | @findex line-number-mode |
957 | The current line number of point appears in the mode line when Line | |
958 | Number mode is enabled. Use the command @kbd{M-x line-number-mode} to | |
959 | turn this mode on and off; normally it is on. The line number appears | |
b213b767 | 960 | after the buffer percentage @var{pos}, with the letter @samp{L} to |
79199dd2 AM |
961 | indicate what it is. |
962 | ||
963 | @cindex Column Number mode | |
964 | @cindex mode, Column Number | |
965 | @findex column-number-mode | |
966 | Similarly, you can display the current column number by turning on | |
967 | Column number mode with @kbd{M-x column-number-mode}. The column | |
968 | number is indicated by the letter @samp{C}. However, when both of | |
969 | these modes are enabled, the line and column numbers are displayed in | |
970 | parentheses, the line number first, rather than with @samp{L} and | |
971 | @samp{C}. For example: @samp{(561,2)}. @xref{Minor Modes}, for more | |
972 | information about minor modes and about how to use these commands. | |
6bf7aab6 | 973 | |
43f971ab EZ |
974 | @cindex narrowing, and line number display |
975 | If you have narrowed the buffer (@pxref{Narrowing}), the displayed | |
976 | line number is relative to the accessible portion of the buffer. | |
54952612 RS |
977 | Thus, it isn't suitable as an argument to @code{goto-line}. (Use |
978 | @code{what-line} command to see the line number relative to the whole | |
979 | file.) | |
43f971ab | 980 | |
6bf7aab6 DL |
981 | @vindex line-number-display-limit |
982 | If the buffer is very large (larger than the value of | |
956c76ef CY |
983 | @code{line-number-display-limit}), Emacs won't compute the line |
984 | number, because that would be too slow; therefore, the line number | |
985 | won't appear on the mode-line. To remove this limit, set | |
986 | @code{line-number-display-limit} to @code{nil}. | |
43f971ab EZ |
987 | |
988 | @vindex line-number-display-limit-width | |
989 | Line-number computation can also be slow if the lines in the buffer | |
956c76ef CY |
990 | are too long. For this reason, Emacs doesn't display line numbers if |
991 | the average width, in characters, of lines near point is larger than | |
992 | the value of @code{line-number-display-limit-width}. The default | |
993 | value is 200 characters. | |
6bf7aab6 | 994 | |
6bf7aab6 DL |
995 | @findex display-time |
996 | @cindex time (on mode line) | |
997 | Emacs can optionally display the time and system load in all mode | |
4f00b8c1 DL |
998 | lines. To enable this feature, type @kbd{M-x display-time} or customize |
999 | the option @code{display-time-mode}. The information added to the mode | |
1000 | line usually appears after the buffer name, before the mode names and | |
1001 | their parentheses. It looks like this: | |
6bf7aab6 DL |
1002 | |
1003 | @example | |
1004 | @var{hh}:@var{mm}pm @var{l.ll} | |
1005 | @end example | |
1006 | ||
1007 | @noindent | |
1008 | @vindex display-time-24hr-format | |
1009 | Here @var{hh} and @var{mm} are the hour and minute, followed always by | |
1010 | @samp{am} or @samp{pm}. @var{l.ll} is the average number of running | |
1011 | processes in the whole system recently. (Some fields may be missing if | |
1012 | your operating system cannot support them.) If you prefer time display | |
1013 | in 24-hour format, set the variable @code{display-time-24hr-format} | |
1014 | to @code{t}. | |
1015 | ||
1016 | @cindex mail (on mode line) | |
72bd7b7b DL |
1017 | @vindex display-time-use-mail-icon |
1018 | @vindex display-time-mail-face | |
fad78d58 RS |
1019 | @vindex display-time-mail-file |
1020 | @vindex display-time-mail-directory | |
6bf7aab6 | 1021 | The word @samp{Mail} appears after the load level if there is mail |
72bd7b7b DL |
1022 | for you that you have not read yet. On a graphical display you can use |
1023 | an icon instead of @samp{Mail} by customizing | |
1024 | @code{display-time-use-mail-icon}; this may save some space on the mode | |
1025 | line. You can customize @code{display-time-mail-face} to make the mail | |
fad78d58 RS |
1026 | indicator prominent. Use @code{display-time-mail-file} to specify |
1027 | the mail file to check, or set @code{display-time-mail-directory} | |
1028 | to specify the directory to check for incoming mail (any nonempty regular | |
1029 | file in the directory is considered as ``newly arrived mail''). | |
6bf7aab6 | 1030 | |
956c76ef CY |
1031 | @cindex mail (on mode line) |
1032 | @findex display-battery-mode | |
1033 | @vindex display-battery-mode | |
1034 | @vindex battery-mode-line-format | |
1035 | When running Emacs on a laptop computer, you can display the battery | |
1036 | charge on the mode-line, by using the command | |
1037 | @code{display-battery-mode} or customizing the variable | |
1038 | @code{display-battery-mode}. The variable | |
1039 | @code{battery-mode-line-format} determines the way the battery charge | |
1040 | is displayed; the exact mode-line message depends on the operating | |
1041 | system, and it usually shows the current battery charge as a | |
1042 | percentage of the total charge. | |
1043 | ||
47d7776c | 1044 | @cindex mode line, 3D appearance |
bd3ead08 EZ |
1045 | @cindex attributes of mode line, changing |
1046 | @cindex non-integral number of lines in a window | |
04d0b662 RS |
1047 | By default, the mode line is drawn on graphics displays with |
1048 | 3D-style highlighting, like that of a button when it is not being | |
1049 | pressed. If you don't like this effect, you can disable the 3D | |
1050 | highlighting of the mode line, by customizing the attributes of the | |
54952612 | 1051 | @code{mode-line} face. @xref{Face Customization}. |
bd3ead08 | 1052 | |
b9e58bf2 | 1053 | @cindex non-selected windows, mode line appearance |
ac6875fc | 1054 | By default, the mode line of nonselected windows is displayed in a |
1c9f5f23 | 1055 | different face, called @code{mode-line-inactive}. Only the selected |
ac6875fc RS |
1056 | window is displayed in the @code{mode-line} face. This helps show |
1057 | which window is selected. When the minibuffer is selected, since | |
1058 | it has no mode line, the window from which you activated the minibuffer | |
1059 | has its mode line displayed using @code{mode-line}; as a result, | |
1060 | ordinary entry to the minibuffer does not change any mode lines. | |
1061 | ||
1062 | @vindex mode-line-in-non-selected-windows | |
1063 | You can disable use of @code{mode-line-inactive} by setting variable | |
1c9f5f23 KS |
1064 | @code{mode-line-in-non-selected-windows} to @code{nil}; then all mode |
1065 | lines are displayed in the @code{mode-line} face. | |
b9e58bf2 | 1066 | |
589a3f9f RS |
1067 | @vindex eol-mnemonic-unix |
1068 | @vindex eol-mnemonic-dos | |
1069 | @vindex eol-mnemonic-mac | |
1070 | @vindex eol-mnemonic-undecided | |
1071 | You can customize the mode line display for each of the end-of-line | |
1072 | formats by setting each of the variables @code{eol-mnemonic-unix}, | |
1073 | @code{eol-mnemonic-dos}, @code{eol-mnemonic-mac}, and | |
54952612 | 1074 | @code{eol-mnemonic-undecided} to the strings you prefer. |
589a3f9f | 1075 | |
6bf7aab6 DL |
1076 | @node Text Display |
1077 | @section How Text Is Displayed | |
1078 | @cindex characters (in text) | |
1079 | ||
76dd3692 | 1080 | @acronym{ASCII} printing characters (octal codes 040 through 0176) in Emacs |
06723f0f | 1081 | buffers are displayed with their graphics, as are non-@acronym{ASCII} multibyte |
6bf7aab6 DL |
1082 | printing characters (octal codes above 0400). |
1083 | ||
956c76ef | 1084 | @vindex tab-width |
956c76ef CY |
1085 | Some @acronym{ASCII} control characters are displayed in special |
1086 | ways. The newline character (octal code 012) is displayed by starting | |
1087 | a new line. The tab character (octal code 011) is displayed by moving | |
1088 | to the next tab stop column (normally every 8 columns). The number of | |
1089 | spaces per tab is controlled by the variable @code{tab-width}, which | |
1090 | must have an integer value between 1 and 1000, inclusive, and is made | |
cd61af01 | 1091 | buffer-local by changing it. Note that how the tab character in the buffer |
956c76ef | 1092 | is displayed has nothing to do with the definition of @key{TAB} as a |
cd61af01 | 1093 | command. |
6bf7aab6 | 1094 | |
76dd3692 | 1095 | Other @acronym{ASCII} control characters are normally displayed as a caret |
6bf7aab6 | 1096 | (@samp{^}) followed by the non-control version of the character; thus, |
54952612 RS |
1097 | control-A is displayed as @samp{^A}. The caret appears in face |
1098 | @code{escape-glyph}. | |
1099 | ||
1100 | Non-@acronym{ASCII} characters 0200 through 0237 (octal) are | |
1101 | displayed with octal escape sequences; thus, character code 0230 | |
1102 | (octal) is displayed as @samp{\230}. The backslash appears in face | |
1103 | @code{escape-glyph}. | |
1104 | ||
1105 | @vindex ctl-arrow | |
1106 | If the variable @code{ctl-arrow} is @code{nil}, control characters in | |
1107 | the buffer are displayed with octal escape sequences, except for newline | |
1108 | and tab. Altering the value of @code{ctl-arrow} makes it local to the | |
1109 | current buffer; until that time, the default value is in effect. The | |
1110 | default is initially @code{t}. | |
1111 | ||
1112 | The display of character codes 0240 through 0377 (octal) may be | |
1113 | either as escape sequences or as graphics. They do not normally occur | |
1114 | in multibyte buffers, but if they do, they are displayed as Latin-1 | |
1115 | graphics. In unibyte mode, if you enable European display they are | |
1116 | displayed using their graphics (assuming your terminal supports them), | |
662286c3 | 1117 | otherwise as escape sequences. @xref{Unibyte Mode}. |
6bf7aab6 | 1118 | |
470a11a3 | 1119 | @vindex nobreak-char-display |
367aa52c RS |
1120 | @cindex no-break space, display |
1121 | @cindex no-break hyphen, display | |
1122 | @cindex soft hyphen, display | |
470a11a3 RS |
1123 | Some character sets define ``no-break'' versions of the space and |
1124 | hyphen characters, which are used where a line should not be broken. | |
1125 | Emacs normally displays these characters with special faces | |
1126 | (respectively, @code{nobreak-space} and @code{escape-glyph}) to | |
1127 | distinguish them from ordinary spaces and hyphens. You can turn off | |
1128 | this feature by setting the variable @code{nobreak-char-display} to | |
1129 | @code{nil}. If you set the variable to any other value, that means to | |
1130 | prefix these characters with an escape character. | |
b5cced4b | 1131 | |
54952612 RS |
1132 | You can customize the way any particular character code is displayed |
1133 | by means of a display table. @xref{Display Tables,, Display Tables, | |
1134 | elisp, The Emacs Lisp Reference Manual}. | |
1135 | ||
0015d677 RS |
1136 | @node Cursor Display |
1137 | @section Displaying the Cursor | |
1138 | ||
1139 | @findex blink-cursor-mode | |
1140 | @vindex blink-cursor-alist | |
1141 | @cindex cursor, locating visually | |
1142 | @cindex cursor, blinking | |
1143 | You can customize the cursor's color, and whether it blinks, using | |
1144 | the @code{cursor} Custom group (@pxref{Easy Customization}). On | |
098199b1 | 1145 | a graphical display, the command @kbd{M-x blink-cursor-mode} enables |
0015d677 RS |
1146 | or disables the blinking of the cursor. (On text terminals, the |
1147 | terminal itself blinks the cursor, and Emacs has no control over it.) | |
1148 | You can control how the cursor appears when it blinks off by setting | |
1149 | the variable @code{blink-cursor-alist}. | |
1150 | ||
468160b7 SM |
1151 | @vindex visible-cursor |
1152 | Some text terminals offer two different cursors: the normal cursor | |
1153 | and the very visible cursor, where the latter may be e.g. bigger or | |
43d67313 RS |
1154 | blinking. By default Emacs uses the very visible cursor, and switches |
1155 | to it when you start or resume Emacs. If the variable | |
1156 | @code{visible-cursor} is @code{nil} when Emacs starts or resumes, it | |
1157 | doesn't switch, so it uses the normal cursor. | |
468160b7 | 1158 | |
0015d677 RS |
1159 | @cindex cursor in non-selected windows |
1160 | @vindex cursor-in-non-selected-windows | |
93870ce2 RS |
1161 | Normally, the cursor appears in non-selected windows without |
1162 | blinking, with the same appearance as when the blinking cursor blinks | |
5a7f4c1b | 1163 | ``off.'' For a box cursor, this is a hollow box; for a bar cursor, |
0015d677 | 1164 | this is a thinner bar. To turn off cursors in non-selected windows, |
93870ce2 RS |
1165 | customize the variable @code{cursor-in-non-selected-windows} and |
1166 | assign it a @code{nil} value. | |
0015d677 RS |
1167 | |
1168 | @vindex x-stretch-cursor | |
1169 | @cindex wide block cursor | |
098199b1 | 1170 | On graphical displays, Emacs can optionally draw the block cursor |
0015d677 RS |
1171 | as wide as the character under the cursor---for example, if the cursor |
1172 | is on a tab character, it would cover the full width occupied by that | |
1173 | tab character. To enable this feature, set the variable | |
1174 | @code{x-stretch-cursor} to a non-@code{nil} value. | |
1175 | ||
1176 | @findex hl-line-mode | |
1177 | @findex global-hl-line-mode | |
1178 | @cindex highlight current line | |
54952612 RS |
1179 | To make the cursor even more visible, you can use HL Line mode, a |
1180 | minor mode that highlights the line containing point. Use @kbd{M-x | |
0015d677 RS |
1181 | hl-line-mode} to enable or disable it in the current buffer. @kbd{M-x |
1182 | global-hl-line-mode} enables or disables the same mode globally. | |
1183 | ||
9d2908a6 RS |
1184 | @node Line Truncation |
1185 | @section Truncation of Lines | |
0015d677 RS |
1186 | |
1187 | @cindex truncation | |
1188 | @cindex line truncation, and fringes | |
9c6361c9 MR |
1189 | As an alternative to continuation (@pxref{Continuation Lines}), Emacs |
1190 | can display long lines by @dfn{truncation}. This means that all the | |
1191 | characters that do not fit in the width of the screen or window do not | |
1192 | appear at all. On graphical displays, a small straight arrow in the | |
1193 | fringe indicates truncation at either end of the line. On text-only | |
1194 | terminals, @samp{$} appears in the first column when there is text | |
1195 | truncated to the left, and in the last column when there is text | |
1196 | truncated to the right. | |
0015d677 RS |
1197 | |
1198 | @vindex truncate-lines | |
1199 | @findex toggle-truncate-lines | |
1200 | Horizontal scrolling automatically causes line truncation | |
1201 | (@pxref{Horizontal Scrolling}). You can explicitly enable line | |
1202 | truncation for a particular buffer with the command @kbd{M-x | |
1203 | toggle-truncate-lines}. This works by locally changing the variable | |
1204 | @code{truncate-lines}. If that variable is non-@code{nil}, long lines | |
1205 | are truncated; if it is @code{nil}, they are continued onto multiple | |
1206 | screen lines. Setting the variable @code{truncate-lines} in any way | |
1207 | makes it local to the current buffer; until that time, the default | |
1208 | value is in effect. The default value is normally @code{nil}. | |
6bf7aab6 DL |
1209 | |
1210 | @c @vindex truncate-partial-width-windows @c Idx entry is in Split Windows. | |
1211 | If the variable @code{truncate-partial-width-windows} is | |
1212 | non-@code{nil}, it forces truncation rather than continuation in any | |
1213 | window less than the full width of the screen or frame, regardless of | |
956c76ef | 1214 | the value of @code{truncate-lines}. See also @ref{Display,, Display, |
6bf7aab6 DL |
1215 | elisp, The Emacs Lisp Reference Manual}. |
1216 | ||
80174a97 KS |
1217 | @vindex overflow-newline-into-fringe |
1218 | If the variable @code{overflow-newline-into-fringe} is | |
54952612 RS |
1219 | non-@code{nil} on a graphical display, then Emacs does not continue or |
1220 | truncate a line which is exactly as wide as the window. Instead, the | |
1221 | newline overflows into the right fringe, and the cursor appears in the | |
1222 | fringe when positioned on that newline. | |
80174a97 | 1223 | |
458db4b6 CY |
1224 | @node Visual Line Mode |
1225 | @section Visual Line Mode | |
1226 | ||
1227 | @cindex word wrap | |
1228 | Another alternative to ordinary line continuation is to use | |
1229 | @dfn{word wrap}. Here, each long logical line is divided into two or | |
1230 | more screen lines, like in ordinary line continuation. However, Emacs | |
1231 | attempts to wrap the line at word boundaries near the right window | |
1232 | edge. This makes the text easier to read, as wrapping does not occur | |
1233 | in the middle of words. | |
1234 | ||
1235 | @cindex Visual Line mode | |
1236 | @findex visual-line-mode | |
1237 | @findex global-visual-line-mode | |
1238 | Word wrap is enabled by Visual Line mode, an optional minor mode. | |
1239 | To turn on Visual Line mode in the current buffer, type @kbd{M-x | |
1240 | visual-line-mode}; repeating this command turns it off. You can also | |
1241 | turn on Visual Line mode using the menu bar: in the Options menu, | |
1242 | select the @samp{Line Wrapping in this Buffer} submenu, followed by | |
1243 | the @samp{Word Wrap (Visual Line Mode)} menu item. While Visual Line | |
1244 | mode is enabled, the mode-line shows the string @samp{wrap} in the | |
1245 | mode display. The command @kbd{M-x global-visual-line-mode} toggles | |
1246 | Visual Line mode in all buffers. | |
1247 | ||
1248 | @findex beginning-of-visual-line | |
1249 | @findex end-of-visual-line | |
1250 | @findex next-logical-line | |
1251 | @findex previous-logical-line | |
1252 | In Visual Line mode, some editing commands work on screen lines | |
1253 | instead of logical lines: @kbd{C-a} (@code{beginning-of-visual-line}) | |
1254 | moves to the beginning of the screen line, @kbd{C-e} | |
1255 | (@code{end-of-visual-line}) moves to the end of the screen line, and | |
1256 | @kbd{C-k} (@code{kill-visual-line}) kills text to the end of the | |
21927cd7 CY |
1257 | screen line. |
1258 | ||
1259 | To move by logical lines, use the commands @kbd{M-x | |
1260 | next-logical-line} and @kbd{M-x previous-logical-line}. These move | |
1261 | point to the next logical line and the previous logical line | |
1262 | respectively, regardless of whether Visual Line mode is enabled. If | |
1263 | you use these commands frequently, it may be convenient to assign key | |
1264 | bindings to them. @xref{Init Rebinding}. | |
458db4b6 CY |
1265 | |
1266 | By default, word-wrapped lines do not display fringe indicators. | |
1267 | Visual Line mode is often used to edit files that contain many long | |
1268 | logical lines, so having a fringe indicator for each wrapped line | |
1269 | would be visually distracting. You can change this by customizing the | |
1270 | variable @code{visual-line-fringe-indicators}. | |
1271 | ||
9d2908a6 RS |
1272 | @node Display Custom |
1273 | @section Customization of Display | |
80174a97 | 1274 | |
9d2908a6 RS |
1275 | This section describes variables (@pxref{Variables}) that you can |
1276 | change to customize how Emacs displays. Beginning users can skip | |
1277 | it. | |
1278 | @c the reason for that pxref is because an xref early in the | |
1279 | @c ``echo area'' section leads here. | |
62ea61af | 1280 | |
9d2908a6 RS |
1281 | @vindex visible-bell |
1282 | If the variable @code{visible-bell} is non-@code{nil}, Emacs attempts | |
1283 | to make the whole screen blink when it would normally make an audible bell | |
1284 | sound. This variable has no effect if your terminal does not have a way | |
1285 | to make the screen blink. | |
80174a97 | 1286 | |
9d2908a6 RS |
1287 | @vindex echo-keystrokes |
1288 | The variable @code{echo-keystrokes} controls the echoing of multi-character | |
1289 | keys; its value is the number of seconds of pause required to cause echoing | |
1290 | to start, or zero, meaning don't echo at all. The value takes effect when | |
1291 | there is someting to echo. @xref{Echo Area}. | |
80174a97 | 1292 | |
6bf7aab6 | 1293 | @vindex baud-rate |
54952612 | 1294 | The variable @anchor{baud-rate}@code{baud-rate} holds the output |
b4a1a8b2 CY |
1295 | speed of the terminal. Setting this variable does not change the |
1296 | speed of actual data transmission, but the value is used for | |
1297 | calculations. On text-only terminals, it affects padding, and | |
1298 | decisions about whether to scroll part of the screen or redraw it | |
1299 | instead. It also affects the behavior of incremental search. On | |
1300 | graphical displays, @code{baud-rate} is only used to determine how | |
1301 | frequently to look for pending input during display updating. A | |
e598186c RS |
1302 | higher value of @code{baud-rate} means that check for pending input |
1303 | will be done less frequently. | |
6bf7aab6 | 1304 | |
b4a1a8b2 | 1305 | @cindex mouse pointer |
62095f01 | 1306 | @cindex hourglass pointer display |
b4a1a8b2 | 1307 | @vindex display-hourglass |
62095f01 | 1308 | @vindex hourglass-delay |
b4a1a8b2 CY |
1309 | On graphical displays, Emacs displays the mouse pointer as an |
1310 | hourglass if Emacs is busy. To disable this feature, set the variable | |
1311 | @code{display-hourglass} to @code{nil}. The variable | |
1312 | @code{hourglass-delay} determines the number of seconds of ``busy | |
1313 | time'' before the hourglass is shown; the default is 1. | |
1314 | ||
1315 | @vindex make-pointer-invisible | |
1316 | If the mouse pointer lies inside an Emacs frame, Emacs makes it | |
1317 | invisible each time you type a character to insert text, to prevent it | |
1318 | from obscuring the text. (To be precise, the hiding occurs when you | |
1319 | type a ``self-inserting'' character. @xref{Inserting Text}.) Moving | |
1320 | the mouse pointer makes it visible again. To disable this feature, | |
1321 | set the variable @code{make-pointer-invisible} to @code{nil}. | |
1322 | ||
1323 | @vindex underline-minimum-offset | |
1324 | @vindex x-underline-at-descent-line | |
1325 | On graphical displays, the variable @code{underline-minimum-offset} | |
1326 | determines the minimum distance between the baseline and underline, in | |
1327 | pixels, for underlined text. By default, the value is 1; increasing | |
1328 | it may improve the legibility of underlined text for certain fonts. | |
1329 | (However, Emacs will never draw the underline below the current line | |
1330 | area.) The variable @code{x-underline-at-descent-line} determines how | |
1331 | to draw underlined text. The default is @code{nil}, which means to | |
1332 | draw it at the baseline level of the font; if you change it to | |
1333 | @code{nil}, Emacs draws the underline at the same height as the font's | |
1334 | descent line. | |
099bfef9 | 1335 | |
9d2908a6 | 1336 | @vindex overline-margin |
b4a1a8b2 CY |
1337 | The variable @code{overline-margin} specifies the vertical position |
1338 | of an overline above the text, including the height of the overline | |
1339 | itself, in pixels; the default is 2. | |
9d2908a6 | 1340 | |
a66b12be RS |
1341 | @findex tty-suppress-bold-inverse-default-colors |
1342 | On some text-only terminals, bold face and inverse video together | |
1343 | result in text that is hard to read. Call the function | |
1344 | @code{tty-suppress-bold-inverse-default-colors} with a non-@code{nil} | |
1345 | argument to suppress the effect of bold-face in this case. | |
1346 | ||
54952612 RS |
1347 | @vindex no-redraw-on-reenter |
1348 | On a text-only terminal, when you reenter Emacs after suspending, Emacs | |
1349 | normally clears the screen and redraws the entire display. On some | |
1350 | terminals with more than one page of memory, it is possible to arrange | |
1351 | the termcap entry so that the @samp{ti} and @samp{te} strings (output | |
1352 | to the terminal when Emacs is entered and exited, respectively) switch | |
1353 | between pages of memory so as to use one page for Emacs and another | |
43d67313 | 1354 | page for other output. On such terminals, you might want to set the variable |
54952612 RS |
1355 | @code{no-redraw-on-reenter} non-@code{nil}; this tells Emacs to |
1356 | assume, when resumed, that the screen page it is using still contains | |
1357 | what Emacs last wrote there. | |
1358 | ||
ab5796a9 MB |
1359 | @ignore |
1360 | arch-tag: 2219f910-2ff0-4521-b059-1bd231a536c4 | |
1361 | @end ignore |