aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2011-10-01 17:54:33 -0400
committerChong Yidong2011-10-01 17:54:33 -0400
commit550f41cdba7ebc49996d8fd17eacff86a2456f35 (patch)
treebc1581afa5519355c866d4a550f0acfa572c45d7
parentce3cefcca3227944d27d75e7de0f1e4f4b6d11a6 (diff)
downloademacs-550f41cdba7ebc49996d8fd17eacff86a2456f35.tar.gz
emacs-550f41cdba7ebc49996d8fd17eacff86a2456f35.zip
Document some Emacs 24 scrolling changes.
* doc/emacs/basic.texi (Moving Point): * doc/emacs/custom.texi (Mouse Buttons): * doc/emacs/rmail.texi (Rmail Scrolling): * doc/emacs/search.texi (Isearch Scroll): * doc/emacs/display.texi (Scrolling): Replace scroll-up/down with scroll-up/down-command. Fix scroll-preserve-screen-position description. Document scroll-error-top-bottom. * doc/lispref/windows.texi (Textual Scrolling): Document scroll-up-command, scroll-down-command, scroll-error-top-bottom, and the scroll-command symbol property.
-rw-r--r--doc/emacs/ChangeLog11
-rw-r--r--doc/emacs/basic.texi16
-rw-r--r--doc/emacs/custom.texi4
-rw-r--r--doc/emacs/display.texi113
-rw-r--r--doc/emacs/rmail.texi11
-rw-r--r--doc/emacs/search.texi10
-rw-r--r--doc/lispref/ChangeLog6
-rw-r--r--doc/lispref/windows.texi136
-rw-r--r--etc/NEWS8
9 files changed, 187 insertions, 128 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 88c208ce295..7d883a6eb91 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,14 @@
12011-10-01 Chong Yidong <cyd@stupidchicken.com>
2
3 * basic.texi (Moving Point):
4 * custom.texi (Mouse Buttons):
5 * rmail.texi (Rmail Scrolling):
6 * search.texi (Isearch Scroll):
7
8 * display.texi (Scrolling): Replace scroll-up/down with
9 scroll-up/down-command. Fix scroll-preserve-screen-position
10 description. Document scroll-error-top-bottom.
11
12011-09-30 Glenn Morris <rgm@gnu.org> 122011-09-30 Glenn Morris <rgm@gnu.org>
2 13
3 * commands.texi (Keys): Whitespace fix. (Bug#9635) 14 * commands.texi (Keys): Whitespace fix. (Bug#9635)
diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi
index b06391f004c..8c8708a3b51 100644
--- a/doc/emacs/basic.texi
+++ b/doc/emacs/basic.texi
@@ -219,21 +219,19 @@ numeric argument @var{n}, move to @var{n}/10 of the way from the top.
219@xref{Arguments}, for more information on numeric arguments.@refill 219@xref{Arguments}, for more information on numeric arguments.@refill
220@item M-> 220@item M->
221Move to the end of the buffer (@code{end-of-buffer}). 221Move to the end of the buffer (@code{end-of-buffer}).
222
222@item C-v 223@item C-v
223@itemx @key{PageDown} 224@itemx @key{PageDown}
224@itemx @key{next} 225@itemx @key{next}
225Scroll the display one screen forward, and move point if necessary to 226Scroll the display one screen forward, and move point onscreen if
226put it on the screen (@code{scroll-up}). If your keyboard has a 227necessary (@code{scroll-up-command}). @xref{Scrolling}.
227@key{PageDown} key (sometimes labelled @key{next}), it does the same 228
228thing as @key{C-v}. Scrolling commands are described further in
229@ref{Scrolling}.
230@item M-v 229@item M-v
231@itemx @key{PageUp} 230@itemx @key{PageUp}
232@itemx @key{prior} 231@itemx @key{prior}
233Scroll one screen backward, and move point if necessary to put it on 232Scroll one screen backward, and move point onscreen if necessary
234the screen (@code{scroll-down}). If your keyboard has a @key{PageUp} 233(@code{scroll-down-command}). @xref{Scrolling}.
235key (sometimes labelled @key{prior}), it does the same thing as 234
236@kbd{M-v}.
237@item M-x goto-char 235@item M-x goto-char
238Read a number @var{n} and move point to buffer position @var{n}. 236Read a number @var{n} and move point to buffer position @var{n}.
239Position 1 is the beginning of the buffer. 237Position 1 is the beginning of the buffer.
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index a22d6c1f5dd..6af77374d07 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -1854,10 +1854,10 @@ comes from a special area of the screen by means of dummy ``prefix
1854keys.'' For example, if you click the mouse in the mode line, you get 1854keys.'' For example, if you click the mouse in the mode line, you get
1855the prefix key @code{mode-line} before the ordinary mouse-button symbol. 1855the prefix key @code{mode-line} before the ordinary mouse-button symbol.
1856Thus, here is how to define the command for clicking the first button in 1856Thus, here is how to define the command for clicking the first button in
1857a mode line to run @code{scroll-up}: 1857a mode line to run @code{scroll-up-command}:
1858 1858
1859@example 1859@example
1860(global-set-key [mode-line mouse-1] 'scroll-up) 1860(global-set-key [mode-line mouse-1] 'scroll-up-command)
1861@end example 1861@end example
1862 1862
1863 Here is the complete list of these dummy prefix keys and their 1863 Here is the complete list of these dummy prefix keys and their
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index 09e365d9d5f..2df31c88c1e 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -39,21 +39,22 @@ want to see, and how to display it.
39 39
40@node Scrolling 40@node Scrolling
41@section Scrolling 41@section Scrolling
42@cindex scrolling
42 43
43 If a buffer contains text that is too large to fit entirely within a 44 If a window is too small to display all the text in its buffer, it
44window that is displaying the buffer, Emacs shows a contiguous portion of 45displays only a portion of it. @dfn{Scrolling} commands change which
45the text. The portion shown always contains point. 46portion of the buffer is displayed.
46 47
47@cindex scrolling 48 Scrolling ``forward'' or ``up'' advances the portion of the buffer
48 @dfn{Scrolling} means moving text up or down in the window so that 49displayed in the window; equivalently, it moves the buffer text
49different parts of the text are visible. Scrolling ``forward'' or 50upwards relative to the window. Scrolling ``backward'' or ``down''
50``up'' means that text moves up, and new text appears at the bottom. 51moves the displayed portion backwards, and moves the text downwards
51Scrolling ``backward'' or ``down'' moves text down, and new text 52relative to the window.
52appears at the top.
53 53
54 Scrolling happens automatically if you move point past the bottom or 54 The portion of a buffer displayed in a window always contains point.
55top of the window. You can also scroll explicitly with these 55If you move point past the bottom or top of the window, scrolling
56commands: 56occurs automatically to bring it back onscreen (@pxref{Auto
57Scrolling}). You can also scroll explicitly with these commands:
57 58
58@table @kbd 59@table @kbd
59@item C-l 60@item C-l
@@ -76,10 +77,10 @@ Scroll heuristically to bring useful information onto the screen
76 77
77@kindex C-l 78@kindex C-l
78@findex recenter-top-bottom 79@findex recenter-top-bottom
79 @kbd{C-l} (@code{recenter-top-bottom}) is a basic scrolling command. 80 The @kbd{C-l} (@code{recenter-top-bottom}) command @dfn{recenters}
80It @dfn{recenters} the selected window, scrolling it so that the 81the selected window, scrolling it so that the current screen line is
81current screen line is exactly in the center of the window, or as 82exactly in the center of the window, or as close to the center as
82close to the center as possible. 83possible.
83 84
84 Typing @kbd{C-l} twice in a row (@kbd{C-l C-l}) scrolls the window 85 Typing @kbd{C-l} twice in a row (@kbd{C-l C-l}) scrolls the window
85so that point is on the topmost screen line. Typing a third @kbd{C-l} 86so that point is on the topmost screen line. Typing a third @kbd{C-l}
@@ -95,7 +96,7 @@ floating-point number between 0.0 and 1.0 specifies a percentage of
95the screen space from the top. The default, @code{(middle top 96the screen space from the top. The default, @code{(middle top
96bottom)}, is the cycling order described above. Furthermore, if you 97bottom)}, is the cycling order described above. Furthermore, if you
97change the variable @code{scroll-margin} to a non-zero value @var{n}, 98change the variable @code{scroll-margin} to a non-zero value @var{n},
98Emacs always leaves @var{n} screen lines between point and the top or 99@kbd{C-l} leaves @var{n} screen lines between point and the top or
99bottom of the window (@pxref{Auto Scrolling}). 100bottom of the window (@pxref{Auto Scrolling}).
100 101
101 You can also supply @kbd{C-l} with a prefix argument. With a plain 102 You can also supply @kbd{C-l} with a prefix argument. With a plain
@@ -108,17 +109,16 @@ puts point on the bottom line, and @kbd{C-u - 5 C-l} puts it five
108lines from the bottom. When given an argument, @kbd{C-l} does not 109lines from the bottom. When given an argument, @kbd{C-l} does not
109clear the screen or cycle through different screen positions. 110clear the screen or cycle through different screen positions.
110 111
111 The more primitive command @code{recenter} behaves like
112@code{recenter-top-bottom}, but does not cycle among screen positions.
113Prior to Emacs 23, @kbd{C-l} was bound to @code{recenter}.
114
115@vindex recenter-redisplay 112@vindex recenter-redisplay
116 If the variable @code{recenter-redisplay} has a non-@code{nil} 113 If the variable @code{recenter-redisplay} has a non-@code{nil}
117value, Emacs clears and redisplays the screen each time @kbd{C-l} 114value, each invocation of @kbd{C-l} also clears and redisplays the
118recenters the window; the special value @code{tty} (the default) says 115screen; the special value @code{tty} (the default) says to do this on
119to do this on text-terminal frames only. Redisplaying is useful in 116text-terminal frames only. Redisplaying is useful in case the screen
120case the screen becomes garbled for any reason (@pxref{Screen 117becomes garbled for any reason (@pxref{Screen Garbled}).
121Garbled}). 118
119@findex recenter
120 The more primitive command @code{recenter} behaves like
121@code{recenter-top-bottom}, but does not cycle among screen positions.
122 122
123@kindex C-v 123@kindex C-v
124@kindex M-v 124@kindex M-v
@@ -126,16 +126,15 @@ Garbled}).
126@kindex prior 126@kindex prior
127@kindex PageDown 127@kindex PageDown
128@kindex PageUp 128@kindex PageUp
129@findex scroll-up 129@findex scroll-up-command
130@findex scroll-down 130@findex scroll-down-command
131 To read the buffer a windowful at a time, type @kbd{C-v} 131 The @kbd{C-v} (@code{scroll-up-command}) command scrolls forward by
132(@code{scroll-up}). This scrolls forward by nearly the whole window 132nearly the whole window height. The effect is to take the two lines
133height. The effect is to take the two lines at the bottom of the 133at the bottom of the window and put them at the top, followed by lines
134window and put them at the top, followed by lines that were not 134that were not previously visible. If point was in the text that
135previously visible. If point was in the text that scrolled off the 135scrolled off the top, it ends up at the new top of the window.
136top, it ends up at the new top of the window.
137 136
138 @kbd{M-v} (@code{scroll-down}) scrolls backward in a similar way. 137 Similarly, @kbd{M-v} (@code{scroll-down-command}) scrolls backward.
139 138
140@vindex next-screen-context-lines 139@vindex next-screen-context-lines
141 The variable @code{next-screen-context-lines} controls the number of 140 The variable @code{next-screen-context-lines} controls the number of
@@ -150,23 +149,39 @@ together). @kbd{C-v} with a negative argument is like @kbd{M-v} and
150vice versa. 149vice versa.
151 150
152 The names of scroll commands are based on the direction that the 151 The names of scroll commands are based on the direction that the
153text moves in the window. Thus, the command to scroll forward is 152text moves in the window. For instance, @code{scroll-up-command}
154called @code{scroll-up} because it moves the text upward on the 153moves the text upward on the screen. The keys @key{PageUp} and
155screen. The keys @key{PageUp} and @key{PageDown} derive their names 154@key{PageDown} derive their names and customary meanings from a
156and customary meanings from a different convention that developed 155different convention that developed elsewhere; hence the strange
157elsewhere; hence the strange result that @key{PageDown} runs 156result that @key{PageDown} runs @code{scroll-up-command}.
158@code{scroll-up}.
159 157
160@vindex scroll-preserve-screen-position 158@vindex scroll-preserve-screen-position
161 Some users like the full-screen scroll commands to keep point at the 159 Some users like the full-screen scroll commands to keep point at the
162same screen position. To enable this behavior, set the variable 160same screen position. This behavior is convenient because scrolling
163@code{scroll-preserve-screen-position} to a non-@code{nil} value. 161back to the same screen also returns point to its original position.
164Then, whenever a command scrolls the text around point offscreen (or 162You can enable this via the variable
165within @code{scroll-margin} lines of the edge), Emacs moves point to 163@code{scroll-preserve-screen-position}. If the value is @code{t},
166keep it at the same vertical and horizontal position within the 164Emacs adjusts point to keep it at the same vertical position within
167window. This mode is convenient for browsing through a file by 165the window, rather than the window edge, whenever a scroll command
168scrolling by screenfuls; if you come back to the screen where you 166moves it off the window. With any other non-@code{nil} value, Emacs
169started, point goes back to the line where it started. 167adjusts point this way even if the scroll command leaves point in the
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
179@vindex scroll-up
180@vindex scroll-down
181 The commands @code{scroll-up} and @code{scroll-down} behave
182similarly to @code{scroll-up-command} and @code{scroll-down-command},
183except they do not obey @code{scroll-error-top-bottom}. Prior to
184Emacs 24, these were the default commands for scrolling up and down.
170 185
171@kindex C-M-l 186@kindex C-M-l
172@findex reposition-window 187@findex reposition-window
diff --git a/doc/emacs/rmail.texi b/doc/emacs/rmail.texi
index 0a9594d3798..b894d01b9bb 100644
--- a/doc/emacs/rmail.texi
+++ b/doc/emacs/rmail.texi
@@ -100,9 +100,9 @@ frequent that it deserves to be easier.
100 100
101@table @kbd 101@table @kbd
102@item @key{SPC} 102@item @key{SPC}
103Scroll forward (@code{scroll-up}). 103Scroll forward (@code{scroll-up-command}).
104@item @key{DEL} 104@item @key{DEL}
105Scroll backward (@code{scroll-down}). 105Scroll backward (@code{scroll-down-command}).
106@item . 106@item .
107Scroll to start of message (@code{rmail-beginning-of-message}). 107Scroll to start of message (@code{rmail-beginning-of-message}).
108@item / 108@item /
@@ -111,9 +111,10 @@ Scroll to end of message (@code{rmail-end-of-message}).
111 111
112@kindex SPC @r{(Rmail)} 112@kindex SPC @r{(Rmail)}
113@kindex DEL @r{(Rmail)} 113@kindex DEL @r{(Rmail)}
114 Since the most common thing to do while reading a message is to scroll 114 Since the most common thing to do while reading a message is to
115through it by screenfuls, Rmail makes @key{SPC} and @key{DEL} synonyms of 115scroll through it by screenfuls, Rmail makes @key{SPC} and @key{DEL}
116@kbd{C-v} (@code{scroll-up}) and @kbd{M-v} (@code{scroll-down}) 116do the same as @kbd{C-v} (@code{scroll-up-command}) and @kbd{M-v}
117(@code{scroll-down-command}) respectively.
117 118
118@kindex . @r{(Rmail)} 119@kindex . @r{(Rmail)}
119@kindex / @r{(Rmail)} 120@kindex / @r{(Rmail)}
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi
index 015f9529b73..caf03291fbc 100644
--- a/doc/emacs/search.texi
+++ b/doc/emacs/search.texi
@@ -306,11 +306,11 @@ minibuffer.
306search (without exiting the search) by setting the customizable 306search (without exiting the search) by setting the customizable
307variable @code{isearch-allow-scroll} to a non-@code{nil} value. This 307variable @code{isearch-allow-scroll} to a non-@code{nil} value. This
308applies to using the vertical scroll-bar and to certain keyboard 308applies to using the vertical scroll-bar and to certain keyboard
309commands such as @key{prior} (@code{scroll-down}), @key{next} 309commands such as @code{scroll-down-command}, @code{scroll-up-command}
310(@code{scroll-up}) and @kbd{C-l} (@code{recenter}). You must run 310and @code{recenter} (@pxref{Scrolling}). You must run these commands
311these commands via their key sequences to stay in the search---typing 311via their key sequences to stay in the search---typing @kbd{M-x} will
312@kbd{M-x} will terminate the search. You can give prefix arguments to 312terminate the search. You can give prefix arguments to these commands
313these commands in the usual way. 313in the usual way.
314 314
315 This feature won't let you scroll the current match out of visibility, 315 This feature won't let you scroll the current match out of visibility,
316however. 316however.
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index afd32ad4ebe..7755fd65bff 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,9 @@
12011-10-01 Chong Yidong <cyd@stupidchicken.com>
2
3 * windows.texi (Textual Scrolling): Document scroll-up-command,
4 scroll-down-command, scroll-error-top-bottom, and the
5 scroll-command symbol property.
6
12011-09-28 Juanma Barranquero <lekktu@gmail.com> 72011-09-28 Juanma Barranquero <lekktu@gmail.com>
2 8
3 * windows.texi (Splitting Windows): Fix typos. 9 * windows.texi (Splitting Windows): Fix typos.
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 6a7206f459d..2ba52ef8b59 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -3100,67 +3100,77 @@ text line, @var{ypos} is negative.
3100@cindex scrolling textually 3100@cindex scrolling textually
3101 3101
3102 @dfn{Textual scrolling} means moving the text up or down through a 3102 @dfn{Textual scrolling} means moving the text up or down through a
3103window. It works by changing the value of the window's display-start 3103window. It works by changing the window's display-start location. It
3104location. It may also change the value of @code{window-point} to keep 3104may also change the value of @code{window-point} to keep point on the
3105point on the screen. 3105screen (@pxref{Window Point}).
3106 3106
3107 Textual scrolling was formerly called ``vertical scrolling,'' but we 3107 The basic textual scrolling functions are @code{scroll-up} (which
3108changed its name to distinguish it from the new vertical fractional 3108scrolls forward) and @code{scroll-down} (which scrolls backward). In
3109scrolling feature (@pxref{Vertical Scrolling}). 3109these function names, ``up'' and ``down'' refer to the direction of
3110 3110motion of the buffer text relative to the window. Imagine that the
3111 In the commands @code{scroll-up} and @code{scroll-down}, the directions 3111text is written on a long roll of paper and that the scrolling
3112``up'' and ``down'' refer to the motion of the text in the buffer at which 3112commands move the paper up and down. Thus, if you are looking at the
3113you are looking through the window. Imagine that the text is 3113middle of a buffer and repeatedly call @code{scroll-down}, you will
3114written on a long roll of paper and that the scrolling commands move the 3114eventually see the beginning of the buffer.
3115paper up and down. Thus, if you are looking at text in the middle of a
3116buffer and repeatedly call @code{scroll-down}, you will eventually see
3117the beginning of the buffer.
3118 3115
3119 Some people have urged that the opposite convention be used: they 3116 Some people have urged that the opposite convention be used: they
3120imagine that the window moves over text that remains in place. Then 3117imagine the window moving over text that remains in place, so that
3121``down'' commands would take you to the end of the buffer. This view is 3118``down'' commands take you to the end of the buffer. This convention
3122more consistent with the actual relationship between windows and the 3119is consistent with fact that such a command is bound to a key named
3123text in the buffer, but it is less like what the user sees. The 3120@key{PageDown} on modern keyboards. We have not switched to this
3124position of a window on the terminal does not move, and short scrolling 3121convention as that is likely to break existing Emacs Lisp code.
3125commands clearly move the text up or down on the screen. We have chosen 3122
3126names that fit the user's point of view. 3123 Textual scrolling functions (aside from @code{scroll-other-window})
3127 3124have unpredictable results if the current buffer is not the one
3128 The textual scrolling functions (aside from 3125displayed in the selected window. @xref{Current Buffer}.
3129@code{scroll-other-window}) have unpredictable results if the current 3126
3130buffer is different from the buffer that is displayed in the selected 3127 If the window contains a row taller than the height of the window
3131window. @xref{Current Buffer}. 3128(for example in the presence of a large image), the scroll functions
3132 3129will adjust the window's vertical scroll position to scroll the
3133 If the window contains a row which is taller than the height of the 3130partially visible row. Lisp callers can disable this feature by
3134window (for example in the presence of a large image), the scroll 3131binding the variable @code{auto-window-vscroll} to @code{nil}
3135functions will adjust the window's vertical scroll position to scroll 3132(@pxref{Vertical Scrolling}).
3136the partially visible row. To disable this feature, Lisp code may bind
3137the variable @code{auto-window-vscroll} to @code{nil} (@pxref{Vertical
3138Scrolling}).
3139 3133
3140@deffn Command scroll-up &optional count 3134@deffn Command scroll-up &optional count
3141This function scrolls the text in the selected window upward 3135This function scrolls forward by @var{count} lines in the selected
3142@var{count} lines. If @var{count} is negative, scrolling is actually 3136window.
3143downward.
3144 3137
3145If @var{count} is @code{nil} (or omitted), then the length of scroll 3138If @var{count} is negative, it scrolls backward instead. If
3146is @code{next-screen-context-lines} lines less than the usable height of 3139@var{count} is @code{nil} (or omitted), the distance scrolled is
3147the window (not counting its mode line). 3140@code{next-screen-context-lines} lines less than the height of the
3141window's text area.
3148 3142
3149@code{scroll-up} returns @code{nil}, unless it gets an error 3143If the selected window cannot be scrolled any further, this function
3150because it can't scroll any further. 3144signals an error. Otherwise, it returns @code{nil}.
3151@end deffn 3145@end deffn
3152 3146
3153@deffn Command scroll-down &optional count 3147@deffn Command scroll-down &optional count
3154This function scrolls the text in the selected window downward 3148This function scrolls backward by @var{count} lines in the selected
3155@var{count} lines. If @var{count} is negative, scrolling is actually 3149window.
3156upward. 3150
3151If @var{count} is negative, it scrolls forward instead. If
3152@var{count} is omitted or @code{nil}, the distance scrolled is
3153@code{next-screen-context-lines} lines less than the height of the
3154window's text area.
3157 3155
3158If @var{count} is omitted or @code{nil}, then the length of the scroll 3156If the selected window cannot be scrolled any further, this function
3159is @code{next-screen-context-lines} lines less than the usable height of 3157signals an error. Otherwise, it returns @code{nil}.
3160the window (not counting its mode line). 3158@end deffn
3159
3160@deffn Command scroll-up-command &optional count
3161This behaves like @code{scroll-up}, except that if the selected window
3162cannot be scrolled any further and the value of the variable
3163@code{scroll-error-top-bottom} is @code{t}, it tries to move to the
3164end of the buffer instead. If point is already there, it signals an
3165error.
3166@end deffn
3161 3167
3162@code{scroll-down} returns @code{nil}, unless it gets an error because 3168@deffn Command scroll-down-command &optional count
3163it can't scroll any further. 3169This behaves like @code{scroll-down}, except that if the selected
3170window cannot be scrolled any further and the value of the variable
3171@code{scroll-error-top-bottom} is @code{t}, it tries to move to the
3172beginning of the buffer instead. If point is already there, it
3173signals an error.
3164@end deffn 3174@end deffn
3165 3175
3166@deffn Command scroll-other-window &optional count 3176@deffn Command scroll-other-window &optional count
@@ -3190,7 +3200,6 @@ line reappears after the echo area momentarily displays the message
3190@samp{Beginning of buffer}. 3200@samp{Beginning of buffer}.
3191@end deffn 3201@end deffn
3192 3202
3193@c Emacs 19 feature
3194@defvar other-window-scroll-buffer 3203@defvar other-window-scroll-buffer
3195If this variable is non-@code{nil}, it tells @code{scroll-other-window} 3204If this variable is non-@code{nil}, it tells @code{scroll-other-window}
3196which buffer's window to scroll. 3205which buffer's window to scroll.
@@ -3245,13 +3254,18 @@ only by precisely @var{n} lines, not a smaller number. This feature
3245does not work with @code{scroll-margin}. The default value is zero. 3254does not work with @code{scroll-margin}. The default value is zero.
3246@end defopt 3255@end defopt
3247 3256
3257@cindex @code{scroll-command} property
3248@defopt scroll-preserve-screen-position 3258@defopt scroll-preserve-screen-position
3249If this option is @code{t}, scrolling which would move the current 3259If this option is @code{t}, whenever a scrolling command moves point
3250point position out of the window chooses the new position of point 3260off-window, Emacs tries to adjust point to keep the cursor at its old
3251so that the vertical position of the cursor is unchanged, if possible. 3261vertical position in the window, rather than the window edge.
3262
3263If the value is non-@code{nil} and not @code{t}, Emacs adjusts point
3264to keep the cursor at the same vertical position, even if the
3265scrolling command didn't move point off-window.
3252 3266
3253If it is non-@code{nil} and not @code{t}, then the scrolling functions 3267This option affects all scroll commands that have a non-@code{nil}
3254always preserve the vertical position of point, if possible. 3268@code{scroll-command} symbol property.
3255@end defopt 3269@end defopt
3256 3270
3257@defopt next-screen-context-lines 3271@defopt next-screen-context-lines
@@ -3262,6 +3276,16 @@ bottom of the window appear instead at the top. The default value is
3262@code{2}. 3276@code{2}.
3263@end defopt 3277@end defopt
3264 3278
3279@defopt scroll-error-top-bottom
3280If this option is @code{nil} (the default), @code{scroll-up-command}
3281and @code{scroll-down-command} simply signal an error when no more
3282scrolling is possible.
3283
3284If the value is @code{t}, these commands instead move point to the
3285beginning or end of the buffer (depending on scrolling direction);
3286only if point is already on that position do they signal an error.
3287@end defopt
3288
3265@deffn Command recenter &optional count 3289@deffn Command recenter &optional count
3266@cindex centering point 3290@cindex centering point
3267This function scrolls the text in the selected window so that point is 3291This function scrolls the text in the selected window so that point is
diff --git a/etc/NEWS b/etc/NEWS
index f6901e3b88f..ae2f137e1f9 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -288,15 +288,19 @@ If you have code that adds something to kill-emacs-hook, you should
288consider if it is still appropriate to add it in the noninteractive case. 288consider if it is still appropriate to add it in the noninteractive case.
289 289
290** Scrolling changes 290** Scrolling changes
291 291+++
292*** New scrolling commands `scroll-up-command' and `scroll-down-command' 292*** New scrolling commands `scroll-up-command' and `scroll-down-command'
293(bound to C-v/[next] and M-v/[prior]) do not signal errors at top/bottom 293(bound to C-v/[next] and M-v/[prior]) do not signal errors at top/bottom
294of buffer at first key-press (instead move to top/bottom of buffer) 294of buffer at first key-press (instead move to top/bottom of buffer)
295when a new variable `scroll-error-top-bottom' is non-nil. 295when `scroll-error-top-bottom' is non-nil.
296
297+++
298*** New variable `scroll-error-top-bottom' (see above).
296 299
297*** New scrolling commands `scroll-up-line' and `scroll-down-line' 300*** New scrolling commands `scroll-up-line' and `scroll-down-line'
298scroll a line instead of full screen. 301scroll a line instead of full screen.
299 302
303+++
300*** New property `scroll-command' should be set on a command's symbol to 304*** New property `scroll-command' should be set on a command's symbol to
301define it as a scroll command affected by `scroll-preserve-screen-position'. 305define it as a scroll command affected by `scroll-preserve-screen-position'.
302 306