aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2011-10-15 12:38:45 -0400
committerChong Yidong2011-10-15 12:38:45 -0400
commit4185924154ffbb37ac2d9b960fba25dce7404fac (patch)
tree9cf0fe5c742112b010a19251ac712c7ab3f0a750
parent21100e7d3fe488d90e747caebbe4f7ccb90d2515 (diff)
downloademacs-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.texi139
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
10show a part that is likely to be interesting. Display-control 10show only a part of it. This chapter describes commands and variables
11commands and variables allow you to specify which part of the text you 11that let you specify which part of the text you want to see, and how
12want to see, and how to display it. 12the 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.
49displayed in the window; equivalently, it moves the buffer text 49displayed in the window; equivalently, it moves the buffer text
50upwards relative to the window. Scrolling ``backward'' or ``down'' 50upwards relative to the window. Scrolling ``backward'' or ``down''
51moves the displayed portion backwards, and moves the text downwards 51moves the displayed portion backwards, and moves the text downwards
52relative to the window. 52relative to the window. In Emacs, scrolling ``up'' or ``down'' refers
53to the direction that the text moves in the window, @emph{not} the
54direction that the window moves relative to the text; this terminology
55was taken up by Emacs before the modern meaning of ``scrolling up''
56and ``scrolling down'' became widely adopted. Hence the strange
57result that @key{PageDown} scrolls ``up'' in the Emacs sense. In this
58manual, we refer to scrolling ``foward'' and ``backward'' where
59possible, 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.
55If you move point past the bottom or top of the window, scrolling 62If 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
61Scroll the selected window so that the current line is the center-most 68Scroll the selected window so that the current line is the center-most
62text line; on subsequent consecutive invocations, make the current 69text line; on subsequent consecutive invocations, make the current
63line the top-most line, the bottom-most line, and so forth in cyclic 70line the top-most line, the bottom-most line, and so on in cyclic
64order; also, maybe redisplay the screen (@code{recenter-top-bottom}). 71order; 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
86so that point is on the topmost screen line. Typing a third @kbd{C-l} 93so that point is on the topmost screen line. Typing a third @kbd{C-l}
87scrolls the window so that point is on the bottom-most screen line. 94scrolls the window so that point is on the bottom-most screen line.
88Each successive @kbd{C-l} cycles through these three screen positions. 95Each 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
94number means to move the line to the specified screen line, while a 101means to move the line to the specified screen line, while a
95floating-point number between 0.0 and 1.0 specifies a percentage of 102floating-point number between 0.0 and 1.0 specifies a percentage of
96the screen space from the top. The default, @code{(middle top 103the screen space from the top of the window. The default,
97bottom)}, is the cycling order described above. Furthermore, if you 104@code{(middle top bottom)}, is the cycling order described above.
98change the variable @code{scroll-margin} to a non-zero value @var{n}, 105Furthermore, 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 106non-zero value @var{n}, @kbd{C-l} always leaves at least @var{n}
100bottom of the window (@pxref{Auto Scrolling}). 107screen 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
103prefix argument, @kbd{C-u C-l}, Emacs simply recenters point. With a 111prefix argument, @kbd{C-u C-l}, Emacs simply recenters point. With a
104positive argument @var{n}, it scrolls to place point @var{n} lines 112positive argument @var{n}, it scrolls to place point @var{n} lines
105down from the top of the window. An argument of zero puts point on 113down from the top of the window. An argument of zero puts point on
106the topmost line. A negative argument @var{-n} puts point @var{n} 114the topmost line. A negative argument @var{-n} puts point @var{n}
107lines from the bottom of the window. For example, @kbd{C-u - 1 C-l} 115lines from the bottom of the window. When given an argument,
108puts 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
109lines from the bottom. When given an argument, @kbd{C-l} does not 117positions.
110clear 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
117becomes garbled for any reason (@pxref{Screen Garbled}). 124becomes 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
132nearly the whole window height. The effect is to take the two lines 139whole window height. The effect is to take the two lines at the
133at the bottom of the window and put them at the top, followed by lines 140bottom of the window and put them at the top, followed by lines that
134that were not previously visible. If point was in the text that 141were not previously visible. If point was in the text that scrolled
135scrolled off the top, it ends up at the new top of the window. 142off 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
147commands}. The function key @key{next}, or @key{PageDown}, is
148equivalent 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
141lines of overlap left by @kbd{C-v} or @kbd{M-v}; by default, it is 2. 153lines of overlap left by the full-screen scroll commands; by default,
142The function keys @key{next} and @key{prior}, or @key{PageDown} and 154it 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
147to leave point unchanged (so that the text and point move up or down 156to leave point unchanged (so that the text and point move up or down
148together). @kbd{C-v} with a negative argument is like @kbd{M-v} and 157together). @kbd{C-v} with a negative argument is like @kbd{M-v} and
149vice versa. 158vice versa.
150 159
151 The names of scroll commands are based on the direction that the 160@vindex scroll-error-top-bottom
152text moves in the window. For instance, @code{scroll-up-command} 161 By default, the full-screen scroll commands signal an error (by
153moves the text upward on the screen. The keys @key{PageUp} and 162beeping or flashing the screen) if no more scrolling is possible,
154@key{PageDown} derive their names and customary meanings from a 163because the window has reached the beginning or end of the buffer. If
155different convention that developed elsewhere; hence the strange 164you change the variable @code{scroll-error-top-bottom} to @code{t},
156result that @key{PageDown} runs @code{scroll-up-command}. 165Emacs instead moves point to the farthest possible position. If point
166is 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
160same screen position. This behavior is convenient because scrolling 170position. Then, scrolling back to the same screen also conveniently
161back to the same screen also returns point to its original position. 171returns point to its original position. You can enable this via the
162You can enable this via the variable 172variable @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
164Emacs adjusts point to keep it at the same vertical position within 174within the window, rather than the window edge, whenever a scroll
165the window, rather than the window edge, whenever a scroll command 175command moves it off the window. With any other non-@code{nil} value,
166moves it off the window. With any other non-@code{nil} value, Emacs 176Emacs adjusts point this way even if the scroll command leaves point
167adjusts point this way even if the scroll command leaves point in the 177in the window.
168window.
169
170@vindex scroll-error-top-bottom
171 By default, @code{scroll-up-command} and @code{scroll-down-command}
172signal an error (by beeping or flashing the screen) if no more
173scrolling is possible, because the window has reached the beginning or
174end of the buffer. If you change the variable
175@code{scroll-error-top-bottom} to @code{t}, Emacs instead moves point
176to the farthest possible position. If point is already there, the
177command 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
189window heuristically in a way designed to get useful information onto 189heuristically in a way designed to get useful information onto the
190the screen. For example, in a Lisp file, this command tries to get the 190screen. For example, in a Lisp file, this command tries to get the
191entire current defun onto the screen if possible. 191entire 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
225The value of @code{scroll-up-aggressively} should be either 225The 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
227specifies where on the screen to put point when scrolling upward, 227specifies where on the screen to put point when scrolling upward,
228i.e.@: when point moves forward in the buffer, and therefore text 228i.e. forward. When point goes off the window end, the new start
229scrolls up in the window. When point goes off the window end, the new 229position is chosen to put point @var{f} parts of the window height
230start position is chosen to put point @var{f} parts of the window 230from the bottom. Thus, larger @var{f} means more aggressive
231height from the bottom. Thus, larger @var{f} means more aggressive
232scrolling: more new text is brought into view. The default value, 231scrolling: 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
236down, i.e.@: moving point back in the buffer. The value specifies how 235down, i.e. backward. The value specifies how far point should be
237far point should be placed from the top of the window; thus, as with 236placed 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
261screen. To disable automatic horizontal scrolling, set the variable 260screen. 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
263horizontal scrolling is turned off, if point moves off the edge of the 262horizontal scrolling is turned off, if point moves off the edge of the
264screen, the cursor disappears to indicate that. (On text-mode 263screen, the cursor disappears to indicate that. (On text-only
265terminals, the cursor is left at the edge instead.) 264terminals, 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
393screenfuls. It provides commands for scrolling through the buffer 395screenfuls. It provides commands for scrolling through the buffer
394conveniently but not for changing it. Apart from the usual Emacs 396conveniently 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
396windowful, @key{DEL} to scroll backward, and @kbd{s} to start an 398windowful, @key{DEL} to scroll backward, and @kbd{s} to start an
397incremental search. 399incremental search.
398 400
399 Typing @kbd{q} disables View mode, and switches back to the buffer 401@kindex q @r{(View mode)}
400and 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
406back to the buffer and position before View mode was enabled. Typing
407@kbd{e} (@code{View-exit}) disables View mode, keeping the current
408buffer and position.
402 409
403@findex view-buffer 410@findex view-buffer
404@findex view-file 411@findex view-file