comparison man/display.texi @ 88155:d7ddb3e565de

sync with trunk
author Henrik Enberg <henrik.enberg@telia.com>
date Mon, 16 Jan 2006 00:03:54 +0000
parents 23a1cea22d13
children
comparison
equal deleted inserted replaced
88154:8ce476d3ba36 88155:d7ddb3e565de
1 @c This is part of the Emacs manual. 1 @c This is part of the Emacs manual.
2 @c Copyright (C) 1985, 86, 87, 93, 94, 95, 1997, 2000, 2001, 2002 2 @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
3 @c Free Software Foundation, Inc. 3 @c 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 @c See file emacs.texi for copying conditions. 4 @c See file emacs.texi for copying conditions.
5 @node Display, Search, Registers, Top 5 @node Display, Search, Registers, Top
6 @chapter Controlling the Display 6 @chapter Controlling the Display
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
10 allow you to specify which part of the text you want to see, and how to 10 allow you to specify which part of the text you want to see, and how to
11 display it. 11 display it.
12 12
13 @menu 13 @menu
14 * Faces:: How to change the display style using faces. 14 * Faces:: How to change the display style using faces.
15 * Standard Faces:: Emacs' predefined faces.
15 * Font Lock:: Minor mode for syntactic highlighting using faces. 16 * Font Lock:: Minor mode for syntactic highlighting using faces.
17 * Highlight Interactively:: Tell Emacs what text to highlight.
16 * Highlight Changes:: Using colors to show where you changed the buffer. 18 * Highlight Changes:: Using colors to show where you changed the buffer.
17 * Highlight Interactively:: Tell Emacs what text to highlight.
18 * Scrolling:: Moving text up and down in a window. 19 * Scrolling:: Moving text up and down in a window.
19 * Horizontal Scrolling:: Moving text left and right in a window. 20 * Horizontal Scrolling:: Moving text left and right in a window.
20 * Fringes:: Enabling or disabling window fringes. 21 * Fringes:: Enabling or disabling window fringes.
21 * Useless Whitespace:: Showing possibly-spurious trailing whitespace. 22 * Useless Whitespace:: Showing possibly-spurious trailing whitespace.
22 * Follow Mode:: Follow mode lets two windows scroll as one. 23 * Follow Mode:: Follow mode lets two windows scroll as one.
23 * Selective Display:: Hiding lines with lots of indentation. 24 * Selective Display:: Hiding lines with lots of indentation.
24 * Optional Mode Line:: Optional mode line display features. 25 * Optional Mode Line:: Optional mode line display features.
25 * Text Display:: How text characters are normally displayed. 26 * Text Display:: How text characters are normally displayed.
27 * Cursor Display:: Features for displaying the cursor.
26 * Display Custom:: Information on variables for customizing display. 28 * Display Custom:: Information on variables for customizing display.
27 * Cursor Display:: Features for displaying the cursor.
28 @end menu 29 @end menu
29 30
30 @node Faces 31 @node Faces
31 @section Using Multiple Typefaces 32 @section Using Multiple Typefaces
32 @cindex faces 33 @cindex faces
33 34
34 Emacs supports using multiple styles of displaying characters. Each 35 You can specify various styles for displaying text using
35 style is called a @dfn{face}. Each face can specify various @dfn{face 36 @dfn{faces}. Each face can specify various @dfn{face attributes},
36 attributes}, such as the font family, the height, weight and slant of 37 such as the font family, the height, weight and slant of the
37 the characters, the foreground and background color, and underlining 38 characters, the foreground and background color, and underlining or
38 or overlining. A face does not have to specify all of these 39 overlining. A face does not have to specify all of these attributes;
39 attributes; often it inherits many of them from another face. 40 often it inherits most of them from another face.
40 41
41 On a window system, all the Emacs face attributes are meaningful. 42 On a window system, all the Emacs face attributes are meaningful.
42 On a character terminal, only some of them work. Some character 43 On a character terminal, only some of them work. Some character
43 terminals support inverse video, bold, and underline attributes; some 44 terminals support inverse video, bold, and underline attributes; some
44 support colors. Character terminals generally do not support changing 45 support colors. Character terminals generally do not support changing
45 the height and width or the font family. 46 the height and width or the font family.
47
48 The easiest way to use faces is to turn on Font Lock mode.
49 @xref{Font Lock}, for more information about Font Lock mode and
50 syntactic highlighting. You can print out the buffer with the
51 highlighting that appears on your screen using the command
52 @code{ps-print-buffer-with-faces}. @xref{PostScript}.
46 53
47 Features which rely on text in multiple faces (such as Font Lock mode) 54 Features which rely on text in multiple faces (such as Font Lock mode)
48 will also work on non-windowed terminals that can display more than one 55 will also work on non-windowed terminals that can display more than one
49 face, whether by colors or underlining and emboldening. This includes 56 face, whether by colors or underlining and emboldening. This includes
50 the console on GNU/Linux, an @code{xterm} which supports colors, the 57 the console on GNU/Linux, an @code{xterm} which supports colors, the
79 the foreground and background colors on all frames, both existing and 86 the foreground and background colors on all frames, both existing and
80 those to be created in the future. (You can also set foreground and 87 those to be created in the future. (You can also set foreground and
81 background colors for the current frame only; see @ref{Frame 88 background colors for the current frame only; see @ref{Frame
82 Parameters}.) 89 Parameters}.)
83 90
84 Emacs 21 can correctly display variable-width fonts, but Emacs 91 Emacs can correctly display variable-width fonts, but Emacs commands
85 commands that calculate width and indentation do not know how to 92 that calculate width and indentation do not know how to calculate
86 calculate variable widths. This can sometimes lead to incorrect 93 variable widths. This can sometimes lead to incorrect results when
87 results when you use variable-width fonts. In particular, indentation 94 you use variable-width fonts. In particular, indentation commands can
88 commands can give inconsistent results, so we recommend you avoid 95 give inconsistent results, so we recommend you avoid variable-width
89 variable-width fonts for editing program source code. Filling will 96 fonts for editing program source code. Filling will sometimes make
90 sometimes make lines too long or too short. We plan to address these 97 lines too long or too short. We plan to address these issues in
91 issues in future Emacs versions. 98 future Emacs versions.
99
100 @node Standard Faces
101 @section Standard Faces
92 102
93 @findex list-faces-display 103 @findex list-faces-display
94 To see what faces are currently defined, and what they look like, type 104 To see what faces are currently defined, and what they look like,
95 @kbd{M-x list-faces-display}. It's possible for a given face to look 105 type @kbd{M-x list-faces-display}. It's possible for a given face to
96 different in different frames; this command shows the appearance in the 106 look different in different frames; this command shows the appearance
97 frame in which you type it. Here's a list of the standard defined 107 in the frame in which you type it.
98 faces: 108
109 Here are the standard faces for specifying text appearance. You can
110 use them on specific text, when you want the effects they produce.
99 111
100 @table @code 112 @table @code
101 @item default 113 @item default
102 This face is used for ordinary text that doesn't specify any other face. 114 This face is used for ordinary text that doesn't specify any other face.
115 @item bold
116 This face uses a bold variant of the default font, if it has one.
117 It's up to you to choose a default font that has a bold variant,
118 if you want to use one.
119 @item italic
120 This face uses an italic variant of the default font, if it has one.
121 @item bold-italic
122 This face uses a bold italic variant of the default font, if it has one.
123 @item underline
124 This face underlines text.
125 @item fixed-pitch
126 This face forces use of a particular fixed-width font.
127 @item variable-pitch
128 This face forces use of a particular variable-width font. It's
129 reasonable to customize this to use a different variable-width font,
130 if you like, but you should not make it a fixed-width font.
131 @item shadow
132 This face is used for making the text less noticeable than the surrounding
133 ordinary text. Usually this can be achieved by using shades of gray in
134 contrast with either black or white default foreground color.
135 @end table
136
137 Here's an incomplete list of faces used to highlight parts of the
138 text temporarily for specific purposes. (Many other modes define
139 their own faces for this purpose.)
140
141 @table @code
142 @item highlight
143 This face is used for highlighting portions of text, in various modes.
144 For example, mouse-sensitive text is highlighted using this face.
145 @item mode-line-highlight
146 Like @code{highlight}, but used for portions of text on mode lines.
147 @item isearch
148 This face is used for highlighting Isearch matches.
149 @item lazy-highlight
150 This face is used for lazy highlighting of Isearch and Query Replace
151 matches other than the current one.
152 @item region
153 This face is used for displaying a selected region (when Transient Mark
154 mode is enabled---see below).
155 @item secondary-selection
156 This face is used for displaying a secondary X selection (@pxref{Secondary
157 Selection}).
158 @item trailing-whitespace
159 The face for highlighting excess spaces and tabs at the end of a line
160 when @code{show-trailing-whitespace} is non-@code{nil}; see
161 @ref{Useless Whitespace}.
162 @item nobreak-space
163 The face for displaying the character ``nobreak space''.
164 @item escape-glyph
165 The face for highlighting the @samp{\} or @samp{^} that indicates
166 a control character. It's also used when @samp{\} indicates a
167 nobreak space or nobreak (soft) hyphen.
168 @end table
169
170 @cindex @code{region} face
171 When Transient Mark mode is enabled, the text of the region is
172 highlighted when the mark is active. This uses the face named
173 @code{region}; you can control the style of highlighting by changing the
174 style of this face (@pxref{Face Customization}). @xref{Transient Mark},
175 for more information about Transient Mark mode and activation and
176 deactivation of the mark.
177
178 These faces control the appearance of parts of the Emacs frame.
179 They exist as faces to provide a consistent way to customize the
180 appearance of these parts of the frame.
181
182 @table @code
103 @item mode-line 183 @item mode-line
104 This face is used for the mode line of the currently selected window. 184 @itemx modeline
105 By default, it's drawn with shadows for a ``raised'' effect on window 185 This face is used for the mode line of the currently selected window,
106 systems, and drawn as the inverse of the default face on non-windowed 186 and for menu bars when toolkit menus are not used. By default, it's
107 terminals. @xref{Display Custom}. 187 drawn with shadows for a ``raised'' effect on window systems, and
188 drawn as the inverse of the default face on non-windowed terminals.
189 @code{modeline} is an alias for the @code{mode-line} face, for
190 compatibility with old Emacs versions.
108 @item mode-line-inactive 191 @item mode-line-inactive
109 Like @code{mode-line}, but used for mode lines of the windows other 192 Like @code{mode-line}, but used for mode lines of the windows other
110 than the selected one (if @code{mode-line-in-non-selected-windows} is 193 than the selected one (if @code{mode-line-in-non-selected-windows} is
111 non-@code{nil}). This face inherits from @code{mode-line}, so changes 194 non-@code{nil}). This face inherits from @code{mode-line}, so changes
112 in that face affect mode lines in all windows. 195 in that face affect mode lines in all windows.
113 @item header-line 196 @item header-line
114 Similar to @code{mode-line} for a window's header line. Most modes 197 Similar to @code{mode-line} for a window's header line. Most modes
115 don't use the header line, but the Info mode does. 198 don't use the header line, but some special modes, such the Info mode, do.
199 @item vertical-border
200 This face is used for the vertical divider between windows.
201 By default this face inherits from the @code{mode-line-inactive} face
202 on character terminals. On window systems the foreground color of
203 this face is used for the vertical line between windows without
204 scrollbars.
116 @item minibuffer-prompt 205 @item minibuffer-prompt
206 @cindex @code{minibuffer-prompt} face
207 @vindex minibuffer-prompt-properties
117 This face is used for the prompt strings displayed in the minibuffer. 208 This face is used for the prompt strings displayed in the minibuffer.
118 @item highlight 209 By default, Emacs automatically adds this face to the value of
119 This face is used for highlighting portions of text, in various modes. 210 @code{minibuffer-prompt-properties}, which is a list of text
120 For example, mouse-sensitive text is highlighted using this face. 211 properties used to display the prompt text.
121 @item isearch
122 This face is used for highlighting Isearch matches.
123 @item isearch-lazy-highlight-face
124 This face is used for lazy highlighting of Isearch matches other than
125 the current one.
126 @item region
127 This face is used for displaying a selected region (when Transient Mark
128 mode is enabled---see below).
129 @item secondary-selection
130 This face is used for displaying a secondary X selection (@pxref{Secondary
131 Selection}).
132 @item bold
133 This face uses a bold variant of the default font, if it has one.
134 @item italic
135 This face uses an italic variant of the default font, if it has one.
136 @item bold-italic
137 This face uses a bold italic variant of the default font, if it has one.
138 @item underline
139 This face underlines text.
140 @item fixed-pitch
141 The basic fixed-pitch face.
142 @item fringe 212 @item fringe
143 @cindex fringe 213 @cindex @code{fringe} face
144 The face for the fringes to the left and right of windows on graphic 214 The face for the fringes to the left and right of windows on graphic
145 displays. (The fringes are the narrow portions of the Emacs frame 215 displays. (The fringes are the narrow portions of the Emacs frame
146 between the text area and the window's right and left borders.) 216 between the text area and the window's right and left borders.)
217 @xref{Fringes}.
147 @item scroll-bar 218 @item scroll-bar
148 This face determines the visual appearance of the scroll bar. 219 This face determines the visual appearance of the scroll bar.
220 @xref{Scroll Bars}.
149 @item border 221 @item border
150 This face determines the color of the frame border. 222 This face determines the color of the frame border.
151 @item cursor 223 @item cursor
152 This face determines the color of the cursor. 224 This face determines the color of the cursor.
153 @item mouse 225 @item mouse
154 This face determines the color of the mouse pointer. 226 This face determines the color of the mouse pointer.
155 @item tool-bar 227 @item tool-bar
156 This is the basic tool-bar face. No text appears in the tool bar, but the 228 This is the basic tool-bar face. No text appears in the tool bar, but the
157 colors of this face affect the appearance of tool bar icons. 229 colors of this face affect the appearance of tool bar icons. @xref{Tool Bars}.
158 @item tooltip 230 @item tooltip
159 This face is used for tooltips. 231 This face is used for tooltips. @xref{Tooltips}.
160 @item menu 232 @item menu
161 This face determines the colors and font of Emacs's menus. Setting the 233 @cindex menu bar appearance
162 font of LessTif/Motif menus is currently not supported; attempts to set 234 @cindex @code{menu} face, no effect if customized
163 the font are ignored in this case. 235 @cindex customization of @code{menu} face
164 @item trailing-whitespace 236 This face determines the colors and font of Emacs's menus. @xref{Menu
165 The face for highlighting trailing whitespace when 237 Bars}. Setting the font of LessTif/Motif menus is currently not
166 @code{show-trailing-whitespace} is non-@code{nil}; see @ref{Useless 238 supported; attempts to set the font are ignored in this case.
167 Whitespace}. 239 Likewise, attempts to customize this face in Emacs built with GTK and
168 @item variable-pitch 240 in the MS-Windows port are ignored by the respective GUI toolkits;
169 The basic variable-pitch face. 241 you need to use system-wide styles and options to change the
242 appearance of the menus.
170 @end table 243 @end table
171
172 @cindex @code{region} face
173 When Transient Mark mode is enabled, the text of the region is
174 highlighted when the mark is active. This uses the face named
175 @code{region}; you can control the style of highlighting by changing the
176 style of this face (@pxref{Face Customization}). @xref{Transient Mark},
177 for more information about Transient Mark mode and activation and
178 deactivation of the mark.
179
180 One easy way to use faces is to turn on Font Lock mode. This minor
181 mode, which is always local to a particular buffer, arranges to
182 choose faces according to the syntax of the text you are editing. It
183 can recognize comments and strings in most languages; in several
184 languages, it can also recognize and properly highlight various other
185 important constructs. @xref{Font Lock}, for more information about
186 Font Lock mode and syntactic highlighting.
187
188 You can print out the buffer with the highlighting that appears
189 on your screen using the command @code{ps-print-buffer-with-faces}.
190 @xref{PostScript}.
191 244
192 @node Font Lock 245 @node Font Lock
193 @section Font Lock mode 246 @section Font Lock mode
194 @cindex Font Lock mode 247 @cindex Font Lock mode
195 @cindex mode, Font Lock 248 @cindex mode, Font Lock
196 @cindex syntax highlighting and coloring 249 @cindex syntax highlighting and coloring
197 250
198 Font Lock mode is a minor mode, always local to a particular buffer, 251 Font Lock mode is a minor mode, always local to a particular buffer,
199 which highlights (or ``fontifies'') using various faces according to 252 which highlights (or ``fontifies'') the buffer contents according to
200 the syntax of the text you are editing. It can recognize comments and 253 the syntax of the text you are editing. It can recognize comments and
201 strings in most languages; in several languages, it can also recognize 254 strings in most languages; in several languages, it can also recognize
202 and properly highlight various other important constructs---for 255 and properly highlight various other important constructs---for
203 example, names of functions being defined or reserved keywords. 256 example, names of functions being defined or reserved keywords.
204 Some special modes, such as Occur mode and Info mode, have completely 257 Some special modes, such as Occur mode and Info mode, have completely
205 specialized ways of assigning fonts for Font Lock mode. 258 specialized ways of assigning fonts for Font Lock mode.
206 259
207 @findex font-lock-mode 260 @findex font-lock-mode
261 Font Lock mode is turned on by default in all modes which support it.
262 You can toggle font-lock for each buffer with the command @kbd{M-x
263 font-lock-mode}. Using a positive argument unconditionally turns Font
264 Lock mode on, and a negative or zero argument turns it off.
265
266 @findex global-font-lock-mode
267 @vindex global-font-lock-mode
268 If you do not wish Font Lock mode to be turned on by default,
269 customize the variable @code{global-font-lock-mode} using the Customize
270 interface (@pxref{Easy Customization}), or use the function
271 @code{global-font-lock-mode} in your @file{.emacs} file, like this:
272
273 @example
274 (global-font-lock-mode 0)
275 @end example
276
208 @findex turn-on-font-lock 277 @findex turn-on-font-lock
209 The command @kbd{M-x font-lock-mode} turns Font Lock mode on or off 278 If you have disabled Global Font Lock mode, you can still enable font
210 according to the argument, and toggles the mode when it has no argument. 279 lock for specific major modes by adding the function
211 The function @code{turn-on-font-lock} unconditionally enables Font Lock 280 @code{turn-on-font-lock} to the mode hooks (@pxref{Hooks}). For
212 mode. This is useful in mode-hook functions. For example, to enable 281 example, to enable Font Lock mode for editing C files, you can do this:
213 Font Lock mode whenever you edit a C file, you can do this:
214 282
215 @example 283 @example
216 (add-hook 'c-mode-hook 'turn-on-font-lock) 284 (add-hook 'c-mode-hook 'turn-on-font-lock)
217 @end example 285 @end example
218 286
219 @findex global-font-lock-mode
220 @vindex global-font-lock-mode
221 To turn on Font Lock mode automatically in all modes which support
222 it, customize the user option @code{global-font-lock-mode} or use the
223 function @code{global-font-lock-mode} in your @file{.emacs} file, like
224 this:
225
226 @example
227 (global-font-lock-mode 1)
228 @end example
229
230 Font Lock mode uses several specifically named faces to do its job, 287 Font Lock mode uses several specifically named faces to do its job,
231 including @code{font-lock-string-face}, @code{font-lock-comment-face}, 288 including @code{font-lock-string-face}, @code{font-lock-comment-face},
232 and others. The easiest way to find them all is to use completion 289 and others. The easiest way to find them all is to use
233 on the face name in @code{set-face-foreground}. 290 @kbd{M-x customize-group @key{RET} font-lock-faces @key{RET}}.
234 291
235 To change the colors or the fonts used by Font Lock mode to fontify 292 To change the colors or the fonts used by Font Lock mode to fontify
236 different parts of text, just change these faces. There are 293 different parts of text, just change these faces. There are
237 two ways to do it: 294 two ways to do it:
238 295
245 302
246 @item 303 @item
247 Customize the faces interactively with @kbd{M-x customize-face}, as 304 Customize the faces interactively with @kbd{M-x customize-face}, as
248 described in @ref{Face Customization}. 305 described in @ref{Face Customization}.
249 @end itemize 306 @end itemize
250
251 To get the full benefit of Font Lock mode, you need to choose a
252 default font which has bold, italic, and bold-italic variants; or else
253 you need to have a color or gray-scale screen.
254 307
255 @vindex font-lock-maximum-decoration 308 @vindex font-lock-maximum-decoration
256 The variable @code{font-lock-maximum-decoration} specifies the 309 The variable @code{font-lock-maximum-decoration} specifies the
257 preferred level of fontification, for modes that provide multiple 310 preferred level of fontification, for modes that provide multiple
258 levels. Level 1 is the least amount of fontification; some modes 311 levels. Level 1 is the least amount of fontification; some modes
313 '(("\\<\\(FIXME\\):" 1 font-lock-warning-face t))) 366 '(("\\<\\(FIXME\\):" 1 font-lock-warning-face t)))
314 @end example 367 @end example
315 368
316 @findex font-lock-remove-keywords 369 @findex font-lock-remove-keywords
317 To remove keywords from the font-lock highlighting patterns, use the 370 To remove keywords from the font-lock highlighting patterns, use the
318 function @code{font-lock-remove-keywords}. 371 function @code{font-lock-remove-keywords}. @xref{Search-based
372 Fontification,,, elisp, The Emacs Lisp Reference Manual}, for
373 documentation of the format of this list.
319 374
320 @cindex just-in-time (JIT) font-lock 375 @cindex just-in-time (JIT) font-lock
321 @cindex background syntax highlighting 376 @cindex background syntax highlighting
322 Fontifying large buffers can take a long time. To avoid large 377 Fontifying large buffers can take a long time. To avoid large
323 delays when a file is visited, Emacs fontifies only the visible 378 delays when a file is visited, Emacs fontifies only the visible
324 portion of a buffer. As you scroll through the buffer, each portion 379 portion of a buffer. As you scroll through the buffer, each portion
325 that becomes visible is fontified as soon as it is displayed. The 380 that becomes visible is fontified as soon as it is displayed. The
326 parts of the buffer that are not displayed are fontified 381 parts of the buffer that are not displayed are fontified
327 ``stealthily'', in the background, i.e.@: when Emacs is idle. You can 382 ``stealthily,'' in the background, i.e.@: when Emacs is idle. You can
328 control this background fontification, called @dfn{Just-In-Time}, or 383 control this background fontification, also called @dfn{Just-In-Time}
329 @dfn{JIT} Font Lock, by customizing various options in the 384 (or @dfn{JIT}) Lock, by customizing variables in the customization
330 customization group @samp{jit-lock}. @xref{Specific Customization}. 385 group @samp{jit-lock}. @xref{Specific Customization}.
331
332 @node Highlight Changes
333 @section Highlight Changes Mode
334
335 @findex highlight-changes-mode
336 Use @kbd{M-x highlight-changes-mode} to enable a minor mode
337 that uses faces (colors, typically) to indicate which parts of
338 the buffer were changed most recently.
339 386
340 @node Highlight Interactively 387 @node Highlight Interactively
341 @section Interactive Highlighting by Matching 388 @section Interactive Highlighting by Matching
342 @cindex highlighting by matching 389 @cindex highlighting by matching
343 @cindex interactive highlighting 390 @cindex interactive highlighting
344 391
345 It is sometimes useful to highlight the strings that match a certain 392 It is sometimes useful to temporarily highlight text that
346 regular expression. For example, you might wish to see all the 393 matches a certain regular expression. For example, you might wish to
347 references to a certain variable in a program source file, or highlight 394 see all the references to a certain variable in a program source file,
348 certain parts in a voluminous output of some program, or make certain 395 highlight certain parts in a voluminous output of some program, or
349 cliches stand out in an article. 396 make certain names stand out in an article.
350 397
351 @findex hi-lock-mode 398 @findex hi-lock-mode
352 Use the @kbd{M-x hi-lock-mode} command to turn on a minor mode that 399 Use the @kbd{M-x hi-lock-mode} command to turn on a minor mode that
353 allows you to specify regular expressions of the text to be 400 allows you to interactively add and remove regular expressions
354 highlighted. Hi-lock mode works like Font Lock (@pxref{Font Lock}), 401 specifying text to be highlighted. Hi Lock mode works like Font Lock
355 except that it lets you specify explicitly what parts of text to 402 mode (@pxref{Font Lock}), except that it lets you easily add and
356 highlight. You control Hi-lock mode with these commands: 403 remove regular expressions while you are editing a buffer. To enable
404 Hi Lock mode for all buffers use @kbd{M-x global-hi-lock-mode} or
405 place @code{(global-hi-lock-mode 1)} in your @file{.emacs} file.
406
407 You control Hi Lock mode with these commands:
357 408
358 @table @kbd 409 @table @kbd
359 @item C-x w h @var{regexp} @key{RET} @var{face} @key{RET} 410 @item C-x w h @var{regexp} @key{RET} @var{face} @key{RET}
360 @kindex C-x w h 411 @kindex C-x w h
361 @findex highlight-regexp 412 @findex highlight-regexp
362 Highlight text that matches 413 Highlight text that matches @var{regexp} using face @var{face}
363 @var{regexp} using face @var{face} (@code{highlight-regexp}). 414 (@code{highlight-regexp}). By using this command more than once, you
364 By using this command more than once, you can highlight various 415 can highlight various parts of the text in different ways. The
365 parts of the text in different ways. 416 highlighting will remain as long as the buffer is loaded. For
417 example, to highlight all occurrences of the word ``whim'' using the
418 default face (a yellow background) @kbd{C-x w h whim @key{RET}
419 @key{RET}}. Any face can be used for highlighting, Hi Lock provides
420 several of its own and these are pre-loaded into a history list. While
421 being prompted for a face use @kbd{M-p} and @kbd{M-n} to cycle through
422 them.
366 423
367 @item C-x w r @var{regexp} @key{RET} 424 @item C-x w r @var{regexp} @key{RET}
368 @kindex C-x w r 425 @kindex C-x w r
369 @findex unhighlight-regexp 426 @findex unhighlight-regexp
370 Unhighlight @var{regexp} (@code{unhighlight-regexp}). You must enter 427 Unhighlight @var{regexp} (@code{unhighlight-regexp}).
371 one of the regular expressions currently specified for highlighting. 428 When activated from the menu select the expression to unhighlight from
372 (You can use completion, or choose from a menu, to enter one of them 429 a list. When activated from the keyboard the most recently added
373 conveniently.) 430 expression will be shown. Use @kbd{M-p} to show the next older
431 expression and @kbd{M-n} to select the next newer expression. When
432 the expression to unhighlight appears press @kbd{@key{RET}} to unhighlight
433 it. The expression can also be typed and completion is available.
374 434
375 @item C-x w l @var{regexp} @key{RET} @var{face} @key{RET} 435 @item C-x w l @var{regexp} @key{RET} @var{face} @key{RET}
376 @kindex C-x w l 436 @kindex C-x w l
377 @findex highlight-lines-matching-regexp 437 @findex highlight-lines-matching-regexp
378 @cindex lines, highlighting 438 @cindex lines, highlighting
387 at point, with comment delimiters to prevent them from changing your 447 at point, with comment delimiters to prevent them from changing your
388 program. This key binding runs the 448 program. This key binding runs the
389 @code{hi-lock-write-interactive-patterns} command. 449 @code{hi-lock-write-interactive-patterns} command.
390 450
391 These patterns will be read the next time you visit the file while 451 These patterns will be read the next time you visit the file while
392 Hi-lock mode is enabled, or whenever you use the @kbd{M-x 452 Hi Lock mode is enabled, or whenever you use the @kbd{M-x
393 hi-lock-find-patterns} command. 453 hi-lock-find-patterns} command.
394 454
395 @item C-x w i 455 @item C-x w i
396 @kindex C-x w i 456 @kindex C-x w i
397 @findex hi-lock-find-patterns 457 @findex hi-lock-find-patterns
398 @vindex hi-lock-exclude-modes 458 @vindex hi-lock-exclude-modes
399 Re-read regexp/face pairs in the current buffer 459 Re-read regexp/face pairs in the current buffer
400 (@code{hi-lock-write-interactive-patterns}). The list of pairs is 460 (@code{hi-lock-write-interactive-patterns}). Users familiar with Font
401 found no matter where in the buffer it may be. 461 Lock keywords might interactively enter patterns
462 (@code{highlight-regexp}), write them into the file
463 (@code{hi-lock-write-interactive-patterns}), edit them, perhaps
464 including different faces for different parenthesized parts of the
465 match, and finally use this command
466 (@code{hi-lock-write-interactive-patterns}) to have Hi Lock highlight
467 them.
402 468
403 This command does nothing if the major mode is a member of the list 469 This command does nothing if the major mode is a member of the list
404 @code{hi-lock-exclude-modes}. 470 @code{hi-lock-exclude-modes}.
405 @end table 471 @end table
472
473 @node Highlight Changes
474 @section Highlight Changes Mode
475
476 @findex highlight-changes-mode
477 Use @kbd{M-x highlight-changes-mode} to enable a minor mode
478 that uses faces (colors, typically) to indicate which parts of
479 the buffer were changed most recently.
406 480
407 @node Scrolling 481 @node Scrolling
408 @section Scrolling 482 @section Scrolling
409 483
410 If a buffer contains text that is too large to fit entirely within a 484 If a buffer contains text that is too large to fit entirely within a
443 @end table 517 @end table
444 518
445 @kindex C-l 519 @kindex C-l
446 @findex recenter 520 @findex recenter
447 The most basic scrolling command is @kbd{C-l} (@code{recenter}) with 521 The most basic scrolling command is @kbd{C-l} (@code{recenter}) with
448 no argument. It clears the entire screen and redisplays all windows. 522 no argument. It scrolls the selected window so that point is halfway
449 In addition, it scrolls the selected window so that point is halfway 523 down from the top of the window. On a text terminal, it also clears
450 down from the top of the window. 524 the screen and redisplays all windows. That is useful in case the
525 screen is garbled (@pxref{Screen Garbled}).
451 526
452 @kindex C-v 527 @kindex C-v
453 @kindex M-v 528 @kindex M-v
454 @kindex NEXT 529 @kindex NEXT
455 @kindex PRIOR 530 @kindex PRIOR
491 @code{scroll-up}. 566 @code{scroll-up}.
492 567
493 @vindex scroll-preserve-screen-position 568 @vindex scroll-preserve-screen-position
494 Some users like the full-screen scroll commands to keep point at the 569 Some users like the full-screen scroll commands to keep point at the
495 same screen line. To enable this behavior, set the variable 570 same screen line. To enable this behavior, set the variable
496 @code{scroll-preserve-screen-position} to a non-@code{nil} value. This 571 @code{scroll-preserve-screen-position} to a non-@code{nil} value. In
497 mode is convenient for browsing through a file by scrolling by 572 this mode, when scrolling shifts point off the screen, or into the
498 screenfuls; if you come back to the screen where you started, point goes 573 scrolling margins, Emacs moves point to keep the same vertical
499 back to the line where it started. However, this mode is inconvenient 574 position within the window. This mode is convenient for browsing
500 when you move to the next screen in order to move point to the text 575 through a file by scrolling by screenfuls; if you come back to the
501 there. 576 screen where you started, point goes back to the line where it
577 started. However, this mode is inconvenient when you move to the next
578 screen in order to move point to the text there.
502 579
503 Another way to do scrolling is with @kbd{C-l} with a numeric argument. 580 Another way to do scrolling is with @kbd{C-l} with a numeric argument.
504 @kbd{C-l} does not clear the screen when given an argument; it only scrolls 581 @kbd{C-l} does not clear the screen when given an argument; it only scrolls
505 the selected window. With a positive argument @var{n}, it repositions text 582 the selected window. With a positive argument @var{n}, it repositions text
506 to put point @var{n} lines down from the top. An argument of zero puts 583 to put point @var{n} lines down from the top. An argument of zero puts
560 @section Horizontal Scrolling 637 @section Horizontal Scrolling
561 @cindex horizontal scrolling 638 @cindex horizontal scrolling
562 639
563 @dfn{Horizontal scrolling} means shifting all the lines sideways 640 @dfn{Horizontal scrolling} means shifting all the lines sideways
564 within a window---so that some of the text near the left margin is not 641 within a window---so that some of the text near the left margin is not
565 displayed at all. Emacs does this automatically in any window that 642 displayed at all. When the text in a window is scrolled horizontally,
566 uses line truncation rather than continuation: whenever point moves 643 text lines are truncated rather than continued (@pxref{Display
567 off the left or right edge of the screen, Emacs scrolls the buffer 644 Custom}). Whenever a window shows truncated lines, Emacs
568 horizontally to make point visible. 645 automatically updates its horizontal scrolling whenever point moves
569 646 off the left or right edge of the screen. You can also use these
570 When a window has been scrolled horizontally, text lines are truncated 647 commands to do explicit horizontal scrolling.
571 rather than continued (@pxref{Continuation Lines}), with a @samp{$}
572 appearing in the first column when there is text truncated to the left,
573 and in the last column when there is text truncated to the right.
574
575 You can use these commands to do explicit horizontal scrolling.
576 648
577 @table @kbd 649 @table @kbd
578 @item C-x < 650 @item C-x <
579 Scroll text in current window to the left (@code{scroll-left}). 651 Scroll text in current window to the left (@code{scroll-left}).
580 @item C-x > 652 @item C-x >
596 normally (with each line starting at the window's left margin); 668 normally (with each line starting at the window's left margin);
597 attempting to do so has no effect. This means that you don't have to 669 attempting to do so has no effect. This means that you don't have to
598 calculate the argument precisely for @w{@kbd{C-x >}}; any sufficiently large 670 calculate the argument precisely for @w{@kbd{C-x >}}; any sufficiently large
599 argument will restore the normal display. 671 argument will restore the normal display.
600 672
601 If you scroll a window horizontally by hand, that sets a lower bound 673 If you use those commands to scroll a window horizontally, that sets
602 for automatic horizontal scrolling. Automatic scrolling will continue 674 a lower bound for automatic horizontal scrolling. Automatic scrolling
603 to scroll the window, but never farther to the right than the amount 675 will continue to scroll the window, but never farther to the right
604 you previously set by @code{scroll-left}. 676 than the amount you previously set by @code{scroll-left}.
605 677
606 @vindex hscroll-margin 678 @vindex hscroll-margin
607 The value of the variable @code{hscroll-margin} controls how close 679 The value of the variable @code{hscroll-margin} controls how close
608 to the window's edges point is allowed to get before the window will 680 to the window's edges point is allowed to get before the window will
609 be automatically scrolled. It is measured in columns. If the value 681 be automatically scrolled. It is measured in columns. If the value
639 711
640 The fringes indicate line truncation with short horizontal arrows 712 The fringes indicate line truncation with short horizontal arrows
641 meaning ``there's more text on this line which is scrolled 713 meaning ``there's more text on this line which is scrolled
642 horizontally out of view;'' clicking the mouse on one of the arrows 714 horizontally out of view;'' clicking the mouse on one of the arrows
643 scrolls the display horizontally in the direction of the arrow. The 715 scrolls the display horizontally in the direction of the arrow. The
644 fringes also indicate other things such as empty lines, or where a 716 fringes can also indicate other things, such as empty lines, or where a
645 program you are debugging is executing (@pxref{Debuggers}). 717 program you are debugging is executing (@pxref{Debuggers}).
646 718
647 @findex set-fringe-style 719 @findex set-fringe-style
648 @findex fringe-mode 720 @findex fringe-mode
649 You can enable and disable the fringes for all frames using 721 You can enable and disable the fringes for all frames using
677 To delete all trailing whitespace within the current buffer's 749 To delete all trailing whitespace within the current buffer's
678 accessible portion (@pxref{Narrowing}), type @kbd{M-x 750 accessible portion (@pxref{Narrowing}), type @kbd{M-x
679 delete-trailing-whitespace @key{RET}}. (This command does not remove 751 delete-trailing-whitespace @key{RET}}. (This command does not remove
680 the form-feed characters.) 752 the form-feed characters.)
681 753
682 @vindex indicate-unused-lines 754 @vindex indicate-empty-lines
683 @vindex default-indicate-empty-lines 755 @vindex default-indicate-empty-lines
684 @cindex unused lines 756 @cindex unused lines
685 @cindex fringes, and unused line indication 757 @cindex fringes, and unused line indication
686 Emacs can indicate unused lines at the end of the window with a 758 Emacs can indicate unused lines at the end of the window with a
687 small image in the left fringe (@pxref{Fringes}). The image appears 759 small image in the left fringe (@pxref{Fringes}). The image appears
688 for window lines that do not correspond to any buffer text. Blank 760 for window lines that do not correspond to any buffer text. Blank
689 lines at the end of the buffer then stand out because they do not have 761 lines at the end of the buffer then stand out because they do not have
690 this image in the fringe. 762 this image in the fringe.
691 763
692 To enable this feature, set the buffer-local variable 764 To enable this feature, set the buffer-local variable
693 @code{indicate-unused-lines} to a non-@code{nil} value. The default 765 @code{indicate-empty-lines} to a non-@code{nil} value. The default
694 value of this variable is controlled by the variable 766 value of this variable is controlled by the variable
695 @code{default-indicate-unused-lines}; by setting that variable, you 767 @code{default-indicate-empty-lines}; by setting that variable, you
696 can enable or disable this feature for all new buffers. (This feature 768 can enable or disable this feature for all new buffers. (This feature
697 currently doesn't work on character terminals.) 769 currently doesn't work on character terminals.)
698 770
699 @node Follow Mode 771 @node Follow Mode
700 @section Follow Mode 772 @section Follow Mode
702 @cindex mode, Follow 774 @cindex mode, Follow
703 @findex follow-mode 775 @findex follow-mode
704 @cindex windows, synchronizing 776 @cindex windows, synchronizing
705 @cindex synchronizing windows 777 @cindex synchronizing windows
706 778
707 @dfn{Follow mode} is a minor mode that makes two windows showing the 779 @dfn{Follow mode} is a minor mode that makes two windows, both
708 same buffer scroll as one tall ``virtual window.'' To use Follow mode, 780 showing the same buffer, scroll as a single tall ``virtual window.''
709 go to a frame with just one window, split it into two side-by-side 781 To use Follow mode, go to a frame with just one window, split it into
710 windows using @kbd{C-x 3}, and then type @kbd{M-x follow-mode}. From 782 two side-by-side windows using @kbd{C-x 3}, and then type @kbd{M-x
711 then on, you can edit the buffer in either of the two windows, or scroll 783 follow-mode}. From then on, you can edit the buffer in either of the
712 either one; the other window follows it. 784 two windows, or scroll either one; the other window follows it.
713 785
714 In Follow mode, if you move point outside the portion visible in one 786 In Follow mode, if you move point outside the portion visible in one
715 window and into the portion visible in the other window, that selects 787 window and into the portion visible in the other window, that selects
716 the other window---again, treating the two as if they were parts of 788 the other window---again, treating the two as if they were parts of
717 one large window. 789 one large window.
726 798
727 Emacs has the ability to hide lines indented more than a certain number 799 Emacs has the ability to hide lines indented more than a certain number
728 of columns (you specify how many columns). You can use this to get an 800 of columns (you specify how many columns). You can use this to get an
729 overview of a part of a program. 801 overview of a part of a program.
730 802
731 To hide lines, type @kbd{C-x $} (@code{set-selective-display}) with a 803 To hide lines in the current buffer, type @kbd{C-x $}
732 numeric argument @var{n}. Then lines with at least @var{n} columns of 804 (@code{set-selective-display}) with a numeric argument @var{n}. Then
733 indentation disappear from the screen. The only indication of their 805 lines with at least @var{n} columns of indentation disappear from the
734 presence is that three dots (@samp{@dots{}}) appear at the end of each 806 screen. The only indication of their presence is that three dots
735 visible line that is followed by one or more hidden ones. 807 (@samp{@dots{}}) appear at the end of each visible line that is
808 followed by one or more hidden ones.
736 809
737 The commands @kbd{C-n} and @kbd{C-p} move across the hidden lines as 810 The commands @kbd{C-n} and @kbd{C-p} move across the hidden lines as
738 if they were not there. 811 if they were not there.
739 812
740 The hidden lines are still present in the buffer, and most editing 813 The hidden lines are still present in the buffer, and most editing
750 If you set the variable @code{selective-display-ellipses} to 823 If you set the variable @code{selective-display-ellipses} to
751 @code{nil}, the three dots do not appear at the end of a line that 824 @code{nil}, the three dots do not appear at the end of a line that
752 precedes hidden lines. Then there is no visible indication of the 825 precedes hidden lines. Then there is no visible indication of the
753 hidden lines. This variable becomes local automatically when set. 826 hidden lines. This variable becomes local automatically when set.
754 827
828 See also @ref{Outline Mode} for another way to hide part of
829 the text in a buffer.
830
755 @node Optional Mode Line 831 @node Optional Mode Line
756 @section Optional Mode Line Features 832 @section Optional Mode Line Features
833
834 @cindex buffer size display
835 @cindex display of buffer size
836 @findex size-indication-mode
837 The buffer percentage @var{pos} indicates the percentage of the
838 buffer above the top of the window. You can additionally display the
839 size of the buffer by typing @kbd{M-x size-indication-mode} to turn on
840 Size Indication mode. The size will be displayed immediately
841 following the buffer percentage like this:
842
843 @example
844 @var{POS} of @var{SIZE}
845 @end example
846
847 @noindent
848 Here @var{SIZE} is the human readable representation of the number of
849 characters in the buffer, which means that @samp{k} for 10^3, @samp{M}
850 for 10^6, @samp{G} for 10^9, etc., are used to abbreviate.
851
852 @cindex narrowing, and buffer size display
853 If you have narrowed the buffer (@pxref{Narrowing}), the size of the
854 accessible part of the buffer is shown.
757 855
758 @cindex line number display 856 @cindex line number display
759 @cindex display of line number 857 @cindex display of line number
760 @findex line-number-mode 858 @findex line-number-mode
761 The current line number of point appears in the mode line when Line 859 The current line number of point appears in the mode line when Line
762 Number mode is enabled. Use the command @kbd{M-x line-number-mode} to 860 Number mode is enabled. Use the command @kbd{M-x line-number-mode} to
763 turn this mode on and off; normally it is on. The line number appears 861 turn this mode on and off; normally it is on. The line number appears
764 before the buffer percentage @var{pos}, with the letter @samp{L} to 862 after the buffer percentage @var{pos}, with the letter @samp{L} to
765 indicate what it is. @xref{Minor Modes}, for more information about 863 indicate what it is. @xref{Minor Modes}, for more information about
766 minor modes and about how to use this command. 864 minor modes and about how to use this command.
767 865
768 @cindex narrowing, and line number display 866 @cindex narrowing, and line number display
769 If you have narrowed the buffer (@pxref{Narrowing}), the displayed 867 If you have narrowed the buffer (@pxref{Narrowing}), the displayed
863 961
864 @node Text Display 962 @node Text Display
865 @section How Text Is Displayed 963 @section How Text Is Displayed
866 @cindex characters (in text) 964 @cindex characters (in text)
867 965
868 ASCII printing characters (octal codes 040 through 0176) in Emacs 966 @acronym{ASCII} printing characters (octal codes 040 through 0176) in Emacs
869 buffers are displayed with their graphics, as are non-ASCII multibyte 967 buffers are displayed with their graphics, as are non-ASCII multibyte
870 printing characters (octal codes above 0400). 968 printing characters (octal codes above 0400).
871 969
872 Some ASCII control characters are displayed in special ways. The 970 Some @acronym{ASCII} control characters are displayed in special ways. The
873 newline character (octal code 012) is displayed by starting a new line. 971 newline character (octal code 012) is displayed by starting a new line.
874 The tab character (octal code 011) is displayed by moving to the next 972 The tab character (octal code 011) is displayed by moving to the next
875 tab stop column (normally every 8 columns). 973 tab stop column (normally every 8 columns).
876 974
877 Other ASCII control characters are normally displayed as a caret 975 Other @acronym{ASCII} control characters are normally displayed as a caret
878 (@samp{^}) followed by the non-control version of the character; thus, 976 (@samp{^}) followed by the non-control version of the character; thus,
879 control-A is displayed as @samp{^A}. 977 control-A is displayed as @samp{^A}.
880 978
881 Non-ASCII characters 0200 through 0237 (octal) are displayed with 979 Non-@acronym{ASCII} characters 0200 through 0237 (octal) are displayed with
882 octal escape sequences; thus, character code 0230 (octal) is displayed 980 octal escape sequences; thus, character code 0230 (octal) is displayed
883 as @samp{\230}. The display of character codes 0240 through 0377 981 as @samp{\230}. The display of character codes 0240 through 0377
884 (octal) may be either as escape sequences or as graphics. They do not 982 (octal) may be either as escape sequences or as graphics. They do not
885 normally occur in multibyte buffers, but if they do, they are displayed 983 normally occur in multibyte buffers, but if they do, they are displayed
886 as Latin-1 graphics. In unibyte mode, if you enable European display 984 as Latin-1 graphics. In unibyte mode, if you enable European display
887 they are displayed using their graphics (assuming your terminal supports 985 they are displayed using their graphics (assuming your terminal supports
888 them), otherwise as escape sequences. @xref{Single-Byte Character 986 them), otherwise as escape sequences. @xref{Single-Byte Character
889 Support}. 987 Support}.
890 988
891 @node Display Custom 989 @vindex nobreak-char-display
892 @section Customization of Display 990 @cindex no-break space, display
893 991 @cindex no-break hyphen, display
894 This section contains information for customization only. Beginning 992 @cindex soft hyphen, display
895 users should skip it. 993 Some character sets define ``no-break'' versions of the space and
896 994 hyphen characters, which are used where a line should not be broken.
897 @vindex mode-line-inverse-video 995 Emacs normally displays these characters with special faces
898 The variable @code{mode-line-inverse-video} is an obsolete way of 996 (respectively, @code{nobreak-space} and @code{escape-glyph}) to
899 controlling whether the mode line is displayed in inverse video; the 997 distinguish them from ordinary spaces and hyphens. You can turn off
900 preferred way of doing this is to change the @code{mode-line} face. 998 this feature by setting the variable @code{nobreak-char-display} to
901 @xref{Mode Line}. However, if @code{mode-line-inverse-video} has a 999 @code{nil}. If you set the variable to any other value, that means to
902 value of @code{nil}, then the @code{mode-line} face will be ignored, 1000 prefix these characters with an escape character.
903 and mode-lines will be drawn using the default text face.
904 @xref{Faces}.
905
906 @vindex inverse-video
907 If the variable @code{inverse-video} is non-@code{nil}, Emacs attempts
908 to invert all the lines of the display from what they normally are.
909
910 @vindex visible-bell
911 If the variable @code{visible-bell} is non-@code{nil}, Emacs attempts
912 to make the whole screen blink when it would normally make an audible bell
913 sound. This variable has no effect if your terminal does not have a way
914 to make the screen blink.@refill
915
916 @vindex no-redraw-on-reenter
917 When you reenter Emacs after suspending, Emacs normally clears the
918 screen and redraws the entire display. On some terminals with more than
919 one page of memory, it is possible to arrange the termcap entry so that
920 the @samp{ti} and @samp{te} strings (output to the terminal when Emacs
921 is entered and exited, respectively) switch between pages of memory so
922 as to use one page for Emacs and another page for other output. Then
923 you might want to set the variable @code{no-redraw-on-reenter}
924 non-@code{nil}; this tells Emacs to assume, when resumed, that the
925 screen page it is using still contains what Emacs last wrote there.
926
927 @vindex echo-keystrokes
928 The variable @code{echo-keystrokes} controls the echoing of multi-character
929 keys; its value is the number of seconds of pause required to cause echoing
930 to start, or zero meaning don't echo at all. @xref{Echo Area}.
931
932 @vindex ctl-arrow
933 If the variable @code{ctl-arrow} is @code{nil}, all control characters in
934 the buffer are displayed with octal escape sequences, except for newline
935 and tab. Altering the value of @code{ctl-arrow} makes it local to the
936 current buffer; until that time, the default value is in effect. The
937 default is initially @code{t}. @xref{Display Tables,, Display Tables,
938 elisp, The Emacs Lisp Reference Manual}.
939
940 @vindex tab-width
941 Normally, a tab character in the buffer is displayed as whitespace which
942 extends to the next display tab stop position, and display tab stops come
943 at intervals equal to eight spaces. The number of spaces per tab is
944 controlled by the variable @code{tab-width}, which is made local by
945 changing it, just like @code{ctl-arrow}. Note that how the tab character
946 in the buffer is displayed has nothing to do with the definition of
947 @key{TAB} as a command. The variable @code{tab-width} must have an
948 integer value between 1 and 1000, inclusive.
949
950 @c @vindex truncate-lines @c No index entry here, because we have one
951 @c in the continuation section.
952 If the variable @code{truncate-lines} is non-@code{nil}, then each
953 line of text gets just one screen line for display; if the text line is
954 too long, display shows only the part that fits. If
955 @code{truncate-lines} is @code{nil}, then long text lines display as
956 more than one screen line, enough to show the whole text of the line.
957 @xref{Continuation Lines}. Altering the value of @code{truncate-lines}
958 makes it local to the current buffer; until that time, the default value
959 is in effect. The default is initially @code{nil}.
960
961 @c @vindex truncate-partial-width-windows @c Idx entry is in Split Windows.
962 If the variable @code{truncate-partial-width-windows} is
963 non-@code{nil}, it forces truncation rather than continuation in any
964 window less than the full width of the screen or frame, regardless of
965 the value of @code{truncate-lines}. For information about side-by-side
966 windows, see @ref{Split Window}. See also @ref{Display,, Display,
967 elisp, The Emacs Lisp Reference Manual}.
968
969 @vindex baud-rate
970 The variable @code{baud-rate} holds the output speed of the
971 terminal, as far as Emacs knows. Setting this variable does not
972 change the speed of actual data transmission, but the value is used
973 for calculations. On terminals, it affects padding, and decisions
974 about whether to scroll part of the screen or redraw it instead.
975 It also affects the behavior of incremental search.
976
977 On window-systems, @code{baud-rate} is only used to determine how
978 frequently to look for pending input during display updating. A
979 higher value of @code{baud-rate} means that check for pending input
980 will be done less frequently.
981
982 You can customize the way any particular character code is displayed
983 by means of a display table. @xref{Display Tables,, Display Tables,
984 elisp, The Emacs Lisp Reference Manual}.
985
986 @cindex hourglass pointer display
987 @vindex hourglass-delay
988 On a window system, Emacs can optionally display the mouse pointer
989 in a special shape to say that Emacs is busy. To turn this feature on
990 or off, customize the group @code{cursor}. You can also control the
991 amount of time Emacs must remain busy before the busy indicator is
992 displayed, by setting the variable @code{hourglass-delay}.
993
994 @findex tty-suppress-bold-inverse-default-colors
995 On some text-only terminals, bold face and inverse video together
996 result in text that is hard to read. Call the function
997 @code{tty-suppress-bold-inverse-default-colors} with a non-@code{nil}
998 argument to suppress the effect of bold-face in this case.
999 1001
1000 @node Cursor Display 1002 @node Cursor Display
1001 @section Displaying the Cursor 1003 @section Displaying the Cursor
1002 1004
1003 @findex blink-cursor-mode 1005 @findex blink-cursor-mode
1010 or disables the blinking of the cursor. (On text terminals, the 1012 or disables the blinking of the cursor. (On text terminals, the
1011 terminal itself blinks the cursor, and Emacs has no control over it.) 1013 terminal itself blinks the cursor, and Emacs has no control over it.)
1012 You can control how the cursor appears when it blinks off by setting 1014 You can control how the cursor appears when it blinks off by setting
1013 the variable @code{blink-cursor-alist}. 1015 the variable @code{blink-cursor-alist}.
1014 1016
1017 @vindex visible-cursor
1018 Some text terminals offer two different cursors: the normal cursor
1019 and the very visible cursor, where the latter may be e.g. bigger or
1020 blinking. By default Emacs uses the very visible cursor. Setting the
1021 variable @code{visible-cursor} to @code{nil} makes it use the
1022 normal cursor.
1023
1015 @cindex cursor in non-selected windows 1024 @cindex cursor in non-selected windows
1016 @vindex cursor-in-non-selected-windows 1025 @vindex cursor-in-non-selected-windows
1017 Normally, the cursor appears in non-selected windows in the ``off'' 1026 Normally, the cursor appears in non-selected windows in the ``off''
1018 state, with the same appearance as when the blinking cursor blinks 1027 state, with the same appearance as when the blinking cursor blinks
1019 ``off''. For a box cursor, this is a hollow box; for a bar cursor, 1028 ``off''. For a box cursor, this is a hollow box; for a bar cursor,
1020 this is a thinner bar. To turn off cursors in non-selected windows, 1029 this is a thinner bar. To turn off cursors in non-selected windows,
1021 customize the option @code{cursor-in-non-selected-windows} and assign 1030 customize the variable @code{cursor-in-non-selected-windows} and assign
1022 it a @code{nil} value. 1031 it a @code{nil} value.
1023 1032
1024 @vindex x-stretch-cursor 1033 @vindex x-stretch-cursor
1025 @cindex wide block cursor 1034 @cindex wide block cursor
1026 On graphical terminals, Emacs can optionally draw the block cursor 1035 On graphical terminals, Emacs can optionally draw the block cursor
1034 @cindex highlight current line 1043 @cindex highlight current line
1035 If you find it hard to see the cursor, you might like HL Line mode, 1044 If you find it hard to see the cursor, you might like HL Line mode,
1036 a minor mode that highlights the line containing point. Use @kbd{M-x 1045 a minor mode that highlights the line containing point. Use @kbd{M-x
1037 hl-line-mode} to enable or disable it in the current buffer. @kbd{M-x 1046 hl-line-mode} to enable or disable it in the current buffer. @kbd{M-x
1038 global-hl-line-mode} enables or disables the same mode globally. 1047 global-hl-line-mode} enables or disables the same mode globally.
1048
1049 @node Display Custom
1050 @section Customization of Display
1051
1052 This section contains information for customization only. Beginning
1053 users should skip it.
1054
1055 @vindex inverse-video
1056 If the variable @code{inverse-video} is non-@code{nil}, Emacs attempts
1057 to invert all the lines of the display from what they normally are.
1058
1059 @vindex visible-bell
1060 If the variable @code{visible-bell} is non-@code{nil}, Emacs attempts
1061 to make the whole screen blink when it would normally make an audible bell
1062 sound. This variable has no effect if your terminal does not have a way
1063 to make the screen blink.
1064
1065 @vindex no-redraw-on-reenter
1066 On a text terminal, when you reenter Emacs after suspending, Emacs
1067 normally clears the screen and redraws the entire display. On some
1068 terminals with more than one page of memory, it is possible to arrange
1069 the termcap entry so that the @samp{ti} and @samp{te} strings (output
1070 to the terminal when Emacs is entered and exited, respectively) switch
1071 between pages of memory so as to use one page for Emacs and another
1072 page for other output. Then you might want to set the variable
1073 @code{no-redraw-on-reenter} non-@code{nil}; this tells Emacs to
1074 assume, when resumed, that the screen page it is using still contains
1075 what Emacs last wrote there.
1076
1077 @vindex echo-keystrokes
1078 The variable @code{echo-keystrokes} controls the echoing of multi-character
1079 keys; its value is the number of seconds of pause required to cause echoing
1080 to start, or zero meaning don't echo at all. @xref{Echo Area}.
1081
1082 @vindex ctl-arrow
1083 If the variable @code{ctl-arrow} is @code{nil}, all control characters in
1084 the buffer are displayed with octal escape sequences, except for newline
1085 and tab. Altering the value of @code{ctl-arrow} makes it local to the
1086 current buffer; until that time, the default value is in effect. The
1087 default is initially @code{t}. @xref{Display Tables,, Display Tables,
1088 elisp, The Emacs Lisp Reference Manual}.
1089
1090 @vindex tab-width
1091 @vindex default-tab-width
1092 Normally, a tab character in the buffer is displayed as whitespace which
1093 extends to the next display tab stop position, and display tab stops come
1094 at intervals equal to eight spaces. The number of spaces per tab is
1095 controlled by the variable @code{tab-width}, which is made local by
1096 changing it, just like @code{ctl-arrow}. Note that how the tab character
1097 in the buffer is displayed has nothing to do with the definition of
1098 @key{TAB} as a command. The variable @code{tab-width} must have an
1099 integer value between 1 and 1000, inclusive. The variable
1100 @code{default-tab-width} controls the default value of this variable
1101 for buffers where you have not set it locally.
1102
1103 @cindex truncation
1104 @cindex line truncation, and fringes
1105 As an alternative to continuation, Emacs can display long lines by
1106 @dfn{truncation}. This means that all the characters that do not fit
1107 in the width of the screen or window do not appear at all. On
1108 graphical terminals, a small straight arrow in the fringe indicates
1109 truncation at either end of the line. On text terminals, @samp{$}
1110 appears in the first column when there is text truncated to the left,
1111 and in the last column when there is text truncated to the right.
1112
1113 @vindex truncate-lines
1114 @findex toggle-truncate-lines
1115 Horizontal scrolling automatically causes line truncation
1116 (@pxref{Horizontal Scrolling}). You can explicitly enable line
1117 truncation for a particular buffer with the command @kbd{M-x
1118 toggle-truncate-lines}. This works by locally changing the variable
1119 @code{truncate-lines}. If that variable is non-@code{nil}, long lines
1120 are truncated; if it is @code{nil}, they are continued onto multiple
1121 screen lines. Setting the variable @code{truncate-lines} in any way
1122 makes it local to the current buffer; until that time, the default
1123 value is in effect. The default value is normally @code{nil}.
1124
1125 @c @vindex truncate-partial-width-windows @c Idx entry is in Split Windows.
1126 If the variable @code{truncate-partial-width-windows} is
1127 non-@code{nil}, it forces truncation rather than continuation in any
1128 window less than the full width of the screen or frame, regardless of
1129 the value of @code{truncate-lines}. For information about side-by-side
1130 windows, see @ref{Split Window}. See also @ref{Display,, Display,
1131 elisp, The Emacs Lisp Reference Manual}.
1132
1133 @vindex overflow-newline-into-fringe
1134 If the variable @code{overflow-newline-into-fringe} is
1135 non-@code{nil} on a window system, it specifies that lines which are
1136 exactly as wide as the window (not counting the final newline
1137 character) shall not be broken into two lines on the display (with
1138 just the newline on the second line). Instead, the newline
1139 overflows into the right fringe, and the cursor will be displayed in
1140 the fringe when positioned on that newline.
1141
1142 @vindex indicate-buffer-boundaries
1143 On a window system, Emacs may indicate the buffer boundaries in the
1144 fringes. The buffer boundaries, i.e. first and last line in the
1145 buffer, can be marked with angle bitmaps in the left or right fringe.
1146 This can be combined with up and down arrow bitmaps shown at the top
1147 and bottom of the left or right fringe if the window can be scrolled
1148 in either direction.
1149
1150 The buffer-local variable @code{indicate-buffer-boundaries} controls
1151 how the buffer boundaries and window scrolling is indicated in the
1152 fringes.
1153
1154 If the value is @code{left} or @code{right}, both angle and arrow
1155 bitmaps are displayed in the left or right fringe, respectively.
1156
1157 If value is an alist, each element @code{(@var{indicator} .
1158 @var{position})} specifies the position of one of the indicators.
1159 The @var{indicator} must be one of @code{top}, @code{bottom},
1160 @code{up}, @code{down}, or @code{t} which specifies the default
1161 position for the indicators not present in the alist.
1162 The @var{position} is one of @code{left}, @code{right}, or @code{nil}
1163 which specifies not to show this indicator.
1164
1165 For example, @code{((top . left) (t . right))} places the top angle
1166 bitmap in left fringe, the bottom angle bitmap in right fringe, and
1167 both arrow bitmaps in right fringe. To show just the angle bitmaps in
1168 the left fringe, but no arrow bitmaps, use @code{((top . left)
1169 (bottom . left))}.
1170
1171 @vindex default-indicate-buffer-boundaries
1172 The value of the variable @code{default-indicate-buffer-boundaries}
1173 is the default value for @code{indicate-buffer-boundaries} in buffers
1174 that do not override it.
1175
1176 @vindex baud-rate
1177 The variable @anchor{baud-rate}@code{baud-rate} holds the output speed of the
1178 terminal, as far as Emacs knows. Setting this variable does not
1179 change the speed of actual data transmission, but the value is used
1180 for calculations. On terminals, it affects padding, and decisions
1181 about whether to scroll part of the screen or redraw it instead.
1182 It also affects the behavior of incremental search.
1183
1184 On window-systems, @code{baud-rate} is only used to determine how
1185 frequently to look for pending input during display updating. A
1186 higher value of @code{baud-rate} means that check for pending input
1187 will be done less frequently.
1188
1189 You can customize the way any particular character code is displayed
1190 by means of a display table. @xref{Display Tables,, Display Tables,
1191 elisp, The Emacs Lisp Reference Manual}.
1192
1193 @cindex hourglass pointer display
1194 @vindex hourglass-delay
1195 On a window system, Emacs can optionally display the mouse pointer
1196 in a special shape to say that Emacs is busy. To turn this feature on
1197 or off, customize the group @code{cursor}. You can also control the
1198 amount of time Emacs must remain busy before the busy indicator is
1199 displayed, by setting the variable @code{hourglass-delay}.
1200
1201 @findex tty-suppress-bold-inverse-default-colors
1202 On some text-only terminals, bold face and inverse video together
1203 result in text that is hard to read. Call the function
1204 @code{tty-suppress-bold-inverse-default-colors} with a non-@code{nil}
1205 argument to suppress the effect of bold-face in this case.
1206
1207 @ignore
1208 arch-tag: 2219f910-2ff0-4521-b059-1bd231a536c4
1209 @end ignore