diff options
| author | Chong Yidong | 2011-10-15 12:38:45 -0400 |
|---|---|---|
| committer | Chong Yidong | 2011-10-15 12:38:45 -0400 |
| commit | 4185924154ffbb37ac2d9b960fba25dce7404fac (patch) | |
| tree | 9cf0fe5c742112b010a19251ac712c7ab3f0a750 | |
| parent | 21100e7d3fe488d90e747caebbe4f7ccb90d2515 (diff) | |
| download | emacs-4185924154ffbb37ac2d9b960fba25dce7404fac.tar.gz emacs-4185924154ffbb37ac2d9b960fba25dce7404fac.zip | |
* doc/emacs/display.texi (Scrolling): Tweak explanation of scroll direction.
(View Mode): Add index entries.
| -rw-r--r-- | doc/emacs/display.texi | 139 |
1 files changed, 73 insertions, 66 deletions
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index 2df31c88c1e..d2f49c62e4a 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi | |||
| @@ -6,10 +6,10 @@ | |||
| 6 | @node Display, Search, Registers, Top | 6 | @node Display, Search, Registers, Top |
| 7 | @chapter Controlling the Display | 7 | @chapter Controlling the Display |
| 8 | 8 | ||
| 9 | Since only part of a large buffer fits in the window, Emacs tries to | 9 | Since only part of a large buffer fits in the window, Emacs has to |
| 10 | show a part that is likely to be interesting. Display-control | 10 | show only a part of it. This chapter describes commands and variables |
| 11 | commands and variables allow you to specify which part of the text you | 11 | that let you specify which part of the text you want to see, and how |
| 12 | want to see, and how to display it. | 12 | the text is displayed. |
| 13 | 13 | ||
| 14 | @menu | 14 | @menu |
| 15 | * Scrolling:: Commands to move text up and down in a window. | 15 | * Scrolling:: Commands to move text up and down in a window. |
| @@ -49,7 +49,14 @@ portion of the buffer is displayed. | |||
| 49 | displayed in the window; equivalently, it moves the buffer text | 49 | displayed in the window; equivalently, it moves the buffer text |
| 50 | upwards relative to the window. Scrolling ``backward'' or ``down'' | 50 | upwards relative to the window. Scrolling ``backward'' or ``down'' |
| 51 | moves the displayed portion backwards, and moves the text downwards | 51 | moves the displayed portion backwards, and moves the text downwards |
| 52 | relative to the window. | 52 | relative to the window. In Emacs, scrolling ``up'' or ``down'' refers |
| 53 | to the direction that the text moves in the window, @emph{not} the | ||
| 54 | direction that the window moves relative to the text; this terminology | ||
| 55 | was taken up by Emacs before the modern meaning of ``scrolling up'' | ||
| 56 | and ``scrolling down'' became widely adopted. Hence the strange | ||
| 57 | result that @key{PageDown} scrolls ``up'' in the Emacs sense. In this | ||
| 58 | manual, we refer to scrolling ``foward'' and ``backward'' where | ||
| 59 | possible, in order to minimize confusion. | ||
| 53 | 60 | ||
| 54 | The portion of a buffer displayed in a window always contains point. | 61 | The portion of a buffer displayed in a window always contains point. |
| 55 | If you move point past the bottom or top of the window, scrolling | 62 | If you move point past the bottom or top of the window, scrolling |
| @@ -60,7 +67,7 @@ Scrolling}). You can also scroll explicitly with these commands: | |||
| 60 | @item C-l | 67 | @item C-l |
| 61 | Scroll the selected window so that the current line is the center-most | 68 | Scroll the selected window so that the current line is the center-most |
| 62 | text line; on subsequent consecutive invocations, make the current | 69 | text line; on subsequent consecutive invocations, make the current |
| 63 | line the top-most line, the bottom-most line, and so forth in cyclic | 70 | line the top-most line, the bottom-most line, and so on in cyclic |
| 64 | order; also, maybe redisplay the screen (@code{recenter-top-bottom}). | 71 | order; also, maybe redisplay the screen (@code{recenter-top-bottom}). |
| 65 | @item C-v | 72 | @item C-v |
| 66 | @itemx @key{next} | 73 | @itemx @key{next} |
| @@ -85,29 +92,29 @@ possible. | |||
| 85 | Typing @kbd{C-l} twice in a row (@kbd{C-l C-l}) scrolls the window | 92 | Typing @kbd{C-l} twice in a row (@kbd{C-l C-l}) scrolls the window |
| 86 | so that point is on the topmost screen line. Typing a third @kbd{C-l} | 93 | so that point is on the topmost screen line. Typing a third @kbd{C-l} |
| 87 | scrolls the window so that point is on the bottom-most screen line. | 94 | scrolls the window so that point is on the bottom-most screen line. |
| 88 | Each successive @kbd{C-l} cycles through these three screen positions. | 95 | Each successive @kbd{C-l} cycles through these three positions. |
| 89 | 96 | ||
| 90 | @vindex recenter-positions | 97 | @vindex recenter-positions |
| 91 | You can change the cycling order by customizing the list variable | 98 | You can change the cycling order by customizing the list variable |
| 92 | @code{recenter-positions}. Each list element should be the symbol | 99 | @code{recenter-positions}. Each list element should be the symbol |
| 93 | @code{top}, @code{middle}, or @code{bottom}, or a number; an integer | 100 | @code{top}, @code{middle}, or @code{bottom}, or a number; an integer |
| 94 | number means to move the line to the specified screen line, while a | 101 | means to move the line to the specified screen line, while a |
| 95 | floating-point number between 0.0 and 1.0 specifies a percentage of | 102 | floating-point number between 0.0 and 1.0 specifies a percentage of |
| 96 | the screen space from the top. The default, @code{(middle top | 103 | the screen space from the top of the window. The default, |
| 97 | bottom)}, is the cycling order described above. Furthermore, if you | 104 | @code{(middle top bottom)}, is the cycling order described above. |
| 98 | change the variable @code{scroll-margin} to a non-zero value @var{n}, | 105 | Furthermore, if you change the variable @code{scroll-margin} to a |
| 99 | @kbd{C-l} leaves @var{n} screen lines between point and the top or | 106 | non-zero value @var{n}, @kbd{C-l} always leaves at least @var{n} |
| 100 | bottom of the window (@pxref{Auto Scrolling}). | 107 | screen lines between point and the top or bottom of the window |
| 108 | (@pxref{Auto Scrolling}). | ||
| 101 | 109 | ||
| 102 | You can also supply @kbd{C-l} with a prefix argument. With a plain | 110 | You can also supply @kbd{C-l} with a prefix argument. With a plain |
| 103 | prefix argument, @kbd{C-u C-l}, Emacs simply recenters point. With a | 111 | prefix argument, @kbd{C-u C-l}, Emacs simply recenters point. With a |
| 104 | positive argument @var{n}, it scrolls to place point @var{n} lines | 112 | positive argument @var{n}, it scrolls to place point @var{n} lines |
| 105 | down from the top of the window. An argument of zero puts point on | 113 | down from the top of the window. An argument of zero puts point on |
| 106 | the topmost line. A negative argument @var{-n} puts point @var{n} | 114 | the topmost line. A negative argument @var{-n} puts point @var{n} |
| 107 | lines from the bottom of the window. For example, @kbd{C-u - 1 C-l} | 115 | lines from the bottom of the window. When given an argument, |
| 108 | puts point on the bottom line, and @kbd{C-u - 5 C-l} puts it five | 116 | @kbd{C-l} does not clear the screen or cycle through different screen |
| 109 | lines from the bottom. When given an argument, @kbd{C-l} does not | 117 | positions. |
| 110 | clear the screen or cycle through different screen positions. | ||
| 111 | 118 | ||
| 112 | @vindex recenter-redisplay | 119 | @vindex recenter-redisplay |
| 113 | If the variable @code{recenter-redisplay} has a non-@code{nil} | 120 | If the variable @code{recenter-redisplay} has a non-@code{nil} |
| @@ -117,7 +124,7 @@ text-terminal frames only. Redisplaying is useful in case the screen | |||
| 117 | becomes garbled for any reason (@pxref{Screen Garbled}). | 124 | becomes garbled for any reason (@pxref{Screen Garbled}). |
| 118 | 125 | ||
| 119 | @findex recenter | 126 | @findex recenter |
| 120 | The more primitive command @code{recenter} behaves like | 127 | The more primitive command @kbd{M-x recenter} behaves like |
| 121 | @code{recenter-top-bottom}, but does not cycle among screen positions. | 128 | @code{recenter-top-bottom}, but does not cycle among screen positions. |
| 122 | 129 | ||
| 123 | @kindex C-v | 130 | @kindex C-v |
| @@ -128,53 +135,46 @@ becomes garbled for any reason (@pxref{Screen Garbled}). | |||
| 128 | @kindex PageUp | 135 | @kindex PageUp |
| 129 | @findex scroll-up-command | 136 | @findex scroll-up-command |
| 130 | @findex scroll-down-command | 137 | @findex scroll-down-command |
| 131 | The @kbd{C-v} (@code{scroll-up-command}) command scrolls forward by | 138 | @kbd{C-v} (@code{scroll-up-command}) scrolls forward by nearly the |
| 132 | nearly the whole window height. The effect is to take the two lines | 139 | whole window height. The effect is to take the two lines at the |
| 133 | at the bottom of the window and put them at the top, followed by lines | 140 | bottom of the window and put them at the top, followed by lines that |
| 134 | that were not previously visible. If point was in the text that | 141 | were not previously visible. If point was in the text that scrolled |
| 135 | scrolled off the top, it ends up at the new top of the window. | 142 | off the top, it ends up on the window's new topmost line. |
| 136 | 143 | ||
| 137 | Similarly, @kbd{M-v} (@code{scroll-down-command}) scrolls backward. | 144 | Similarly, @kbd{M-v} (@code{scroll-down-command}) scrolls backward. |
| 138 | 145 | ||
| 146 | We refer to @kbd{C-v} and @kbd{M-v} as @dfn{full-screen scroll | ||
| 147 | commands}. The function key @key{next}, or @key{PageDown}, is | ||
| 148 | equivalent to @kbd{C-v}; the function key @key{prior}, or | ||
| 149 | @key{PageUp}, is equivalent to @kbd{M-v}. | ||
| 150 | |||
| 139 | @vindex next-screen-context-lines | 151 | @vindex next-screen-context-lines |
| 140 | The variable @code{next-screen-context-lines} controls the number of | 152 | The variable @code{next-screen-context-lines} controls the number of |
| 141 | lines of overlap left by @kbd{C-v} or @kbd{M-v}; by default, it is 2. | 153 | lines of overlap left by the full-screen scroll commands; by default, |
| 142 | The function keys @key{next} and @key{prior}, or @key{PageDown} and | 154 | it is 2. You can supply these commands with a numeric prefix argument |
| 143 | @key{PageUp}, are equivalent to @kbd{C-v} and @kbd{M-v} respectively. | ||
| 144 | |||
| 145 | You can supply @kbd{C-v} or @kbd{M-v} with a numeric prefix argument | ||
| 146 | @var{n}. This scrolls the window by @var{n} lines, while attempting | 155 | @var{n}. This scrolls the window by @var{n} lines, while attempting |
| 147 | to leave point unchanged (so that the text and point move up or down | 156 | to leave point unchanged (so that the text and point move up or down |
| 148 | together). @kbd{C-v} with a negative argument is like @kbd{M-v} and | 157 | together). @kbd{C-v} with a negative argument is like @kbd{M-v} and |
| 149 | vice versa. | 158 | vice versa. |
| 150 | 159 | ||
| 151 | The names of scroll commands are based on the direction that the | 160 | @vindex scroll-error-top-bottom |
| 152 | text moves in the window. For instance, @code{scroll-up-command} | 161 | By default, the full-screen scroll commands signal an error (by |
| 153 | moves the text upward on the screen. The keys @key{PageUp} and | 162 | beeping or flashing the screen) if no more scrolling is possible, |
| 154 | @key{PageDown} derive their names and customary meanings from a | 163 | because the window has reached the beginning or end of the buffer. If |
| 155 | different convention that developed elsewhere; hence the strange | 164 | you change the variable @code{scroll-error-top-bottom} to @code{t}, |
| 156 | result that @key{PageDown} runs @code{scroll-up-command}. | 165 | Emacs instead moves point to the farthest possible position. If point |
| 166 | is already there, the command signals an error. | ||
| 157 | 167 | ||
| 158 | @vindex scroll-preserve-screen-position | 168 | @vindex scroll-preserve-screen-position |
| 159 | Some users like the full-screen scroll commands to keep point at the | 169 | Some users like scroll commands to keep point at the same screen |
| 160 | same screen position. This behavior is convenient because scrolling | 170 | position. Then, scrolling back to the same screen also conveniently |
| 161 | back to the same screen also returns point to its original position. | 171 | returns point to its original position. You can enable this via the |
| 162 | You can enable this via the variable | 172 | variable @code{scroll-preserve-screen-position}. If the value is |
| 163 | @code{scroll-preserve-screen-position}. If the value is @code{t}, | 173 | @code{t}, Emacs adjusts point to keep it at the same vertical position |
| 164 | Emacs adjusts point to keep it at the same vertical position within | 174 | within the window, rather than the window edge, whenever a scroll |
| 165 | the window, rather than the window edge, whenever a scroll command | 175 | command moves it off the window. With any other non-@code{nil} value, |
| 166 | moves it off the window. With any other non-@code{nil} value, Emacs | 176 | Emacs adjusts point this way even if the scroll command leaves point |
| 167 | adjusts point this way even if the scroll command leaves point in the | 177 | in the window. |
| 168 | window. | ||
| 169 | |||
| 170 | @vindex scroll-error-top-bottom | ||
| 171 | By default, @code{scroll-up-command} and @code{scroll-down-command} | ||
| 172 | signal an error (by beeping or flashing the screen) if no more | ||
| 173 | scrolling is possible, because the window has reached the beginning or | ||
| 174 | end of the buffer. If you change the variable | ||
| 175 | @code{scroll-error-top-bottom} to @code{t}, Emacs instead moves point | ||
| 176 | to the farthest possible position. If point is already there, the | ||
| 177 | command signals an error. | ||
| 178 | 178 | ||
| 179 | @vindex scroll-up | 179 | @vindex scroll-up |
| 180 | @vindex scroll-down | 180 | @vindex scroll-down |
| @@ -185,9 +185,9 @@ Emacs 24, these were the default commands for scrolling up and down. | |||
| 185 | 185 | ||
| 186 | @kindex C-M-l | 186 | @kindex C-M-l |
| 187 | @findex reposition-window | 187 | @findex reposition-window |
| 188 | The @kbd{C-M-l} command (@code{reposition-window}) scrolls the current | 188 | @kbd{C-M-l} (@code{reposition-window}) scrolls the current window |
| 189 | window heuristically in a way designed to get useful information onto | 189 | heuristically in a way designed to get useful information onto the |
| 190 | the screen. For example, in a Lisp file, this command tries to get the | 190 | screen. For example, in a Lisp file, this command tries to get the |
| 191 | entire current defun onto the screen if possible. | 191 | entire current defun onto the screen if possible. |
| 192 | 192 | ||
| 193 | @node Auto Scrolling | 193 | @node Auto Scrolling |
| @@ -225,16 +225,15 @@ how aggressively it scrolls by setting the variables | |||
| 225 | The value of @code{scroll-up-aggressively} should be either | 225 | The value of @code{scroll-up-aggressively} should be either |
| 226 | @code{nil}, or a fraction @var{f} between 0 and 1. A fraction | 226 | @code{nil}, or a fraction @var{f} between 0 and 1. A fraction |
| 227 | specifies where on the screen to put point when scrolling upward, | 227 | specifies where on the screen to put point when scrolling upward, |
| 228 | i.e.@: when point moves forward in the buffer, and therefore text | 228 | i.e. forward. When point goes off the window end, the new start |
| 229 | scrolls up in the window. When point goes off the window end, the new | 229 | position is chosen to put point @var{f} parts of the window height |
| 230 | start position is chosen to put point @var{f} parts of the window | 230 | from the bottom. Thus, larger @var{f} means more aggressive |
| 231 | height from the bottom. Thus, larger @var{f} means more aggressive | ||
| 232 | scrolling: more new text is brought into view. The default value, | 231 | scrolling: more new text is brought into view. The default value, |
| 233 | @code{nil}, is equivalent to 0.5. | 232 | @code{nil}, is equivalent to 0.5. |
| 234 | 233 | ||
| 235 | Likewise, @code{scroll-down-aggressively} is used for scrolling | 234 | Likewise, @code{scroll-down-aggressively} is used for scrolling |
| 236 | down, i.e.@: moving point back in the buffer. The value specifies how | 235 | down, i.e. backward. The value specifies how far point should be |
| 237 | far point should be placed from the top of the window; thus, as with | 236 | placed from the top of the window; thus, as with |
| 238 | @code{scroll-up-aggressively}, a larger value is more aggressive. | 237 | @code{scroll-up-aggressively}, a larger value is more aggressive. |
| 239 | 238 | ||
| 240 | These two variables are ignored if either @code{scroll-step} or | 239 | These two variables are ignored if either @code{scroll-step} or |
| @@ -261,7 +260,7 @@ scrolling whenever point moves off the left or right edge of the | |||
| 261 | screen. To disable automatic horizontal scrolling, set the variable | 260 | screen. To disable automatic horizontal scrolling, set the variable |
| 262 | @code{auto-hscroll-mode} to @code{nil}. Note that when the automatic | 261 | @code{auto-hscroll-mode} to @code{nil}. Note that when the automatic |
| 263 | horizontal scrolling is turned off, if point moves off the edge of the | 262 | horizontal scrolling is turned off, if point moves off the edge of the |
| 264 | screen, the cursor disappears to indicate that. (On text-mode | 263 | screen, the cursor disappears to indicate that. (On text-only |
| 265 | terminals, the cursor is left at the edge instead.) | 264 | terminals, the cursor is left at the edge instead.) |
| 266 | 265 | ||
| 267 | @vindex hscroll-margin | 266 | @vindex hscroll-margin |
| @@ -389,6 +388,9 @@ it. @xref{Disabling}. | |||
| 389 | @cindex View mode | 388 | @cindex View mode |
| 390 | @cindex mode, View | 389 | @cindex mode, View |
| 391 | 390 | ||
| 391 | @kindex s @r{(View mode)} | ||
| 392 | @kindex SPC @r{(View mode)} | ||
| 393 | @kindex DEL @r{(View mode)} | ||
| 392 | View mode is a minor mode that lets you scan a buffer by sequential | 394 | View mode is a minor mode that lets you scan a buffer by sequential |
| 393 | screenfuls. It provides commands for scrolling through the buffer | 395 | screenfuls. It provides commands for scrolling through the buffer |
| 394 | conveniently but not for changing it. Apart from the usual Emacs | 396 | conveniently but not for changing it. Apart from the usual Emacs |
| @@ -396,9 +398,14 @@ cursor motion commands, you can type @key{SPC} to scroll forward one | |||
| 396 | windowful, @key{DEL} to scroll backward, and @kbd{s} to start an | 398 | windowful, @key{DEL} to scroll backward, and @kbd{s} to start an |
| 397 | incremental search. | 399 | incremental search. |
| 398 | 400 | ||
| 399 | Typing @kbd{q} disables View mode, and switches back to the buffer | 401 | @kindex q @r{(View mode)} |
| 400 | and position before View mode was enabled. Alternatively, typing | 402 | @kindex e @r{(View mode)} |
| 401 | @kbd{e} disables View mode, keeping the current buffer and position. | 403 | @findex View-quit |
| 404 | @findex View-exit | ||
| 405 | Typing @kbd{q} (@code{View-quit}) disables View mode, and switches | ||
| 406 | back to the buffer and position before View mode was enabled. Typing | ||
| 407 | @kbd{e} (@code{View-exit}) disables View mode, keeping the current | ||
| 408 | buffer and position. | ||
| 402 | 409 | ||
| 403 | @findex view-buffer | 410 | @findex view-buffer |
| 404 | @findex view-file | 411 | @findex view-file |