diff options
| author | Chong Yidong | 2011-10-01 17:54:33 -0400 |
|---|---|---|
| committer | Chong Yidong | 2011-10-01 17:54:33 -0400 |
| commit | 550f41cdba7ebc49996d8fd17eacff86a2456f35 (patch) | |
| tree | bc1581afa5519355c866d4a550f0acfa572c45d7 | |
| parent | ce3cefcca3227944d27d75e7de0f1e4f4b6d11a6 (diff) | |
| download | emacs-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/ChangeLog | 11 | ||||
| -rw-r--r-- | doc/emacs/basic.texi | 16 | ||||
| -rw-r--r-- | doc/emacs/custom.texi | 4 | ||||
| -rw-r--r-- | doc/emacs/display.texi | 113 | ||||
| -rw-r--r-- | doc/emacs/rmail.texi | 11 | ||||
| -rw-r--r-- | doc/emacs/search.texi | 10 | ||||
| -rw-r--r-- | doc/lispref/ChangeLog | 6 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 136 | ||||
| -rw-r--r-- | etc/NEWS | 8 |
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 @@ | |||
| 1 | 2011-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 | |||
| 1 | 2011-09-30 Glenn Morris <rgm@gnu.org> | 12 | 2011-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-> |
| 221 | Move to the end of the buffer (@code{end-of-buffer}). | 221 | Move 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} |
| 225 | Scroll the display one screen forward, and move point if necessary to | 226 | Scroll the display one screen forward, and move point onscreen if |
| 226 | put it on the screen (@code{scroll-up}). If your keyboard has a | 227 | necessary (@code{scroll-up-command}). @xref{Scrolling}. |
| 227 | @key{PageDown} key (sometimes labelled @key{next}), it does the same | 228 | |
| 228 | thing 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} |
| 233 | Scroll one screen backward, and move point if necessary to put it on | 232 | Scroll one screen backward, and move point onscreen if necessary |
| 234 | the screen (@code{scroll-down}). If your keyboard has a @key{PageUp} | 233 | (@code{scroll-down-command}). @xref{Scrolling}. |
| 235 | key (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 |
| 238 | Read a number @var{n} and move point to buffer position @var{n}. | 236 | Read a number @var{n} and move point to buffer position @var{n}. |
| 239 | Position 1 is the beginning of the buffer. | 237 | Position 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 | |||
| 1854 | keys.'' For example, if you click the mouse in the mode line, you get | 1854 | keys.'' For example, if you click the mouse in the mode line, you get |
| 1855 | the prefix key @code{mode-line} before the ordinary mouse-button symbol. | 1855 | the prefix key @code{mode-line} before the ordinary mouse-button symbol. |
| 1856 | Thus, here is how to define the command for clicking the first button in | 1856 | Thus, here is how to define the command for clicking the first button in |
| 1857 | a mode line to run @code{scroll-up}: | 1857 | a 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 |
| 44 | window that is displaying the buffer, Emacs shows a contiguous portion of | 45 | displays only a portion of it. @dfn{Scrolling} commands change which |
| 45 | the text. The portion shown always contains point. | 46 | portion 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 | 49 | displayed in the window; equivalently, it moves the buffer text |
| 49 | different parts of the text are visible. Scrolling ``forward'' or | 50 | upwards relative to the window. Scrolling ``backward'' or ``down'' |
| 50 | ``up'' means that text moves up, and new text appears at the bottom. | 51 | moves the displayed portion backwards, and moves the text downwards |
| 51 | Scrolling ``backward'' or ``down'' moves text down, and new text | 52 | relative to the window. |
| 52 | appears 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. |
| 55 | top of the window. You can also scroll explicitly with these | 55 | If you move point past the bottom or top of the window, scrolling |
| 56 | commands: | 56 | occurs automatically to bring it back onscreen (@pxref{Auto |
| 57 | Scrolling}). 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} |
| 80 | It @dfn{recenters} the selected window, scrolling it so that the | 81 | the selected window, scrolling it so that the current screen line is |
| 81 | current screen line is exactly in the center of the window, or as | 82 | exactly in the center of the window, or as close to the center as |
| 82 | close to the center as possible. | 83 | possible. |
| 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 |
| 85 | so that point is on the topmost screen line. Typing a third @kbd{C-l} | 86 | so 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 | |||
| 95 | the screen space from the top. The default, @code{(middle top | 96 | the screen space from the top. The default, @code{(middle top |
| 96 | bottom)}, is the cycling order described above. Furthermore, if you | 97 | bottom)}, is the cycling order described above. Furthermore, if you |
| 97 | change the variable @code{scroll-margin} to a non-zero value @var{n}, | 98 | change the variable @code{scroll-margin} to a non-zero value @var{n}, |
| 98 | Emacs 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 |
| 99 | bottom of the window (@pxref{Auto Scrolling}). | 100 | bottom 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 | |||
| 108 | lines from the bottom. When given an argument, @kbd{C-l} does not | 109 | lines from the bottom. When given an argument, @kbd{C-l} does not |
| 109 | clear the screen or cycle through different screen positions. | 110 | clear 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. | ||
| 113 | Prior 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} |
| 117 | value, Emacs clears and redisplays the screen each time @kbd{C-l} | 114 | value, each invocation of @kbd{C-l} also clears and redisplays the |
| 118 | recenters the window; the special value @code{tty} (the default) says | 115 | screen; the special value @code{tty} (the default) says to do this on |
| 119 | to do this on text-terminal frames only. Redisplaying is useful in | 116 | text-terminal frames only. Redisplaying is useful in case the screen |
| 120 | case the screen becomes garbled for any reason (@pxref{Screen | 117 | becomes garbled for any reason (@pxref{Screen Garbled}). |
| 121 | Garbled}). | 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 | 132 | nearly the whole window height. The effect is to take the two lines |
| 133 | height. The effect is to take the two lines at the bottom of the | 133 | at the bottom of the window and put them at the top, followed by lines |
| 134 | window and put them at the top, followed by lines that were not | 134 | that were not previously visible. If point was in the text that |
| 135 | previously visible. If point was in the text that scrolled off the | 135 | scrolled off the top, it ends up at the new top of the window. |
| 136 | top, 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 | |||
| 150 | vice versa. | 149 | vice 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 |
| 153 | text moves in the window. Thus, the command to scroll forward is | 152 | text moves in the window. For instance, @code{scroll-up-command} |
| 154 | called @code{scroll-up} because it moves the text upward on the | 153 | moves the text upward on the screen. The keys @key{PageUp} and |
| 155 | screen. The keys @key{PageUp} and @key{PageDown} derive their names | 154 | @key{PageDown} derive their names and customary meanings from a |
| 156 | and customary meanings from a different convention that developed | 155 | different convention that developed elsewhere; hence the strange |
| 157 | elsewhere; hence the strange result that @key{PageDown} runs | 156 | result 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 |
| 162 | same screen position. To enable this behavior, set the variable | 160 | same screen position. This behavior is convenient because scrolling |
| 163 | @code{scroll-preserve-screen-position} to a non-@code{nil} value. | 161 | back to the same screen also returns point to its original position. |
| 164 | Then, whenever a command scrolls the text around point offscreen (or | 162 | You can enable this via the variable |
| 165 | within @code{scroll-margin} lines of the edge), Emacs moves point to | 163 | @code{scroll-preserve-screen-position}. If the value is @code{t}, |
| 166 | keep it at the same vertical and horizontal position within the | 164 | Emacs adjusts point to keep it at the same vertical position within |
| 167 | window. This mode is convenient for browsing through a file by | 165 | the window, rather than the window edge, whenever a scroll command |
| 168 | scrolling by screenfuls; if you come back to the screen where you | 166 | moves it off the window. With any other non-@code{nil} value, Emacs |
| 169 | started, point goes back to the line where it started. | 167 | adjusts point this way even if the scroll command leaves point in the |
| 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 | |||
| 179 | @vindex scroll-up | ||
| 180 | @vindex scroll-down | ||
| 181 | The commands @code{scroll-up} and @code{scroll-down} behave | ||
| 182 | similarly to @code{scroll-up-command} and @code{scroll-down-command}, | ||
| 183 | except they do not obey @code{scroll-error-top-bottom}. Prior to | ||
| 184 | Emacs 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} |
| 103 | Scroll forward (@code{scroll-up}). | 103 | Scroll forward (@code{scroll-up-command}). |
| 104 | @item @key{DEL} | 104 | @item @key{DEL} |
| 105 | Scroll backward (@code{scroll-down}). | 105 | Scroll backward (@code{scroll-down-command}). |
| 106 | @item . | 106 | @item . |
| 107 | Scroll to start of message (@code{rmail-beginning-of-message}). | 107 | Scroll 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 |
| 115 | through it by screenfuls, Rmail makes @key{SPC} and @key{DEL} synonyms of | 115 | scroll 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}) | 116 | do 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. | |||
| 306 | search (without exiting the search) by setting the customizable | 306 | search (without exiting the search) by setting the customizable |
| 307 | variable @code{isearch-allow-scroll} to a non-@code{nil} value. This | 307 | variable @code{isearch-allow-scroll} to a non-@code{nil} value. This |
| 308 | applies to using the vertical scroll-bar and to certain keyboard | 308 | applies to using the vertical scroll-bar and to certain keyboard |
| 309 | commands such as @key{prior} (@code{scroll-down}), @key{next} | 309 | commands such as @code{scroll-down-command}, @code{scroll-up-command} |
| 310 | (@code{scroll-up}) and @kbd{C-l} (@code{recenter}). You must run | 310 | and @code{recenter} (@pxref{Scrolling}). You must run these commands |
| 311 | these commands via their key sequences to stay in the search---typing | 311 | via 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 | 312 | terminate the search. You can give prefix arguments to these commands |
| 313 | these commands in the usual way. | 313 | in 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, |
| 316 | however. | 316 | however. |
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 @@ | |||
| 1 | 2011-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 | |||
| 1 | 2011-09-28 Juanma Barranquero <lekktu@gmail.com> | 7 | 2011-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 |
| 3103 | window. It works by changing the value of the window's display-start | 3103 | window. It works by changing the window's display-start location. It |
| 3104 | location. It may also change the value of @code{window-point} to keep | 3104 | may also change the value of @code{window-point} to keep point on the |
| 3105 | point on the screen. | 3105 | screen (@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 |
| 3108 | changed its name to distinguish it from the new vertical fractional | 3108 | scrolls forward) and @code{scroll-down} (which scrolls backward). In |
| 3109 | scrolling feature (@pxref{Vertical Scrolling}). | 3109 | these function names, ``up'' and ``down'' refer to the direction of |
| 3110 | 3110 | motion of the buffer text relative to the window. Imagine that the | |
| 3111 | In the commands @code{scroll-up} and @code{scroll-down}, the directions | 3111 | text 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 | 3112 | commands move the paper up and down. Thus, if you are looking at the |
| 3113 | you are looking through the window. Imagine that the text is | 3113 | middle of a buffer and repeatedly call @code{scroll-down}, you will |
| 3114 | written on a long roll of paper and that the scrolling commands move the | 3114 | eventually see the beginning of the buffer. |
| 3115 | paper up and down. Thus, if you are looking at text in the middle of a | ||
| 3116 | buffer and repeatedly call @code{scroll-down}, you will eventually see | ||
| 3117 | the 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 |
| 3120 | imagine that the window moves over text that remains in place. Then | 3117 | imagine 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 |
| 3122 | more consistent with the actual relationship between windows and the | 3119 | is consistent with fact that such a command is bound to a key named |
| 3123 | text 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 |
| 3124 | position of a window on the terminal does not move, and short scrolling | 3121 | convention as that is likely to break existing Emacs Lisp code. |
| 3125 | commands clearly move the text up or down on the screen. We have chosen | 3122 | |
| 3126 | names that fit the user's point of view. | 3123 | Textual scrolling functions (aside from @code{scroll-other-window}) |
| 3127 | 3124 | have unpredictable results if the current buffer is not the one | |
| 3128 | The textual scrolling functions (aside from | 3125 | displayed in the selected window. @xref{Current Buffer}. |
| 3129 | @code{scroll-other-window}) have unpredictable results if the current | 3126 | |
| 3130 | buffer 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 |
| 3131 | window. @xref{Current Buffer}. | 3128 | (for example in the presence of a large image), the scroll functions |
| 3132 | 3129 | will 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 | 3130 | partially visible row. Lisp callers can disable this feature by |
| 3134 | window (for example in the presence of a large image), the scroll | 3131 | binding the variable @code{auto-window-vscroll} to @code{nil} |
| 3135 | functions will adjust the window's vertical scroll position to scroll | 3132 | (@pxref{Vertical Scrolling}). |
| 3136 | the partially visible row. To disable this feature, Lisp code may bind | ||
| 3137 | the variable @code{auto-window-vscroll} to @code{nil} (@pxref{Vertical | ||
| 3138 | Scrolling}). | ||
| 3139 | 3133 | ||
| 3140 | @deffn Command scroll-up &optional count | 3134 | @deffn Command scroll-up &optional count |
| 3141 | This function scrolls the text in the selected window upward | 3135 | This function scrolls forward by @var{count} lines in the selected |
| 3142 | @var{count} lines. If @var{count} is negative, scrolling is actually | 3136 | window. |
| 3143 | downward. | ||
| 3144 | 3137 | ||
| 3145 | If @var{count} is @code{nil} (or omitted), then the length of scroll | 3138 | If @var{count} is negative, it scrolls backward instead. If |
| 3146 | is @code{next-screen-context-lines} lines less than the usable height of | 3139 | @var{count} is @code{nil} (or omitted), the distance scrolled is |
| 3147 | the window (not counting its mode line). | 3140 | @code{next-screen-context-lines} lines less than the height of the |
| 3141 | window's text area. | ||
| 3148 | 3142 | ||
| 3149 | @code{scroll-up} returns @code{nil}, unless it gets an error | 3143 | If the selected window cannot be scrolled any further, this function |
| 3150 | because it can't scroll any further. | 3144 | signals 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 |
| 3154 | This function scrolls the text in the selected window downward | 3148 | This function scrolls backward by @var{count} lines in the selected |
| 3155 | @var{count} lines. If @var{count} is negative, scrolling is actually | 3149 | window. |
| 3156 | upward. | 3150 | |
| 3151 | If @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 | ||
| 3154 | window's text area. | ||
| 3157 | 3155 | ||
| 3158 | If @var{count} is omitted or @code{nil}, then the length of the scroll | 3156 | If the selected window cannot be scrolled any further, this function |
| 3159 | is @code{next-screen-context-lines} lines less than the usable height of | 3157 | signals an error. Otherwise, it returns @code{nil}. |
| 3160 | the window (not counting its mode line). | 3158 | @end deffn |
| 3159 | |||
| 3160 | @deffn Command scroll-up-command &optional count | ||
| 3161 | This behaves like @code{scroll-up}, except that if the selected window | ||
| 3162 | cannot 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 | ||
| 3164 | end of the buffer instead. If point is already there, it signals an | ||
| 3165 | error. | ||
| 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 |
| 3163 | it can't scroll any further. | 3169 | This behaves like @code{scroll-down}, except that if the selected |
| 3170 | window 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 | ||
| 3172 | beginning of the buffer instead. If point is already there, it | ||
| 3173 | signals 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 |
| 3195 | If this variable is non-@code{nil}, it tells @code{scroll-other-window} | 3204 | If this variable is non-@code{nil}, it tells @code{scroll-other-window} |
| 3196 | which buffer's window to scroll. | 3205 | which buffer's window to scroll. |
| @@ -3245,13 +3254,18 @@ only by precisely @var{n} lines, not a smaller number. This feature | |||
| 3245 | does not work with @code{scroll-margin}. The default value is zero. | 3254 | does 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 |
| 3249 | If this option is @code{t}, scrolling which would move the current | 3259 | If this option is @code{t}, whenever a scrolling command moves point |
| 3250 | point position out of the window chooses the new position of point | 3260 | off-window, Emacs tries to adjust point to keep the cursor at its old |
| 3251 | so that the vertical position of the cursor is unchanged, if possible. | 3261 | vertical position in the window, rather than the window edge. |
| 3262 | |||
| 3263 | If the value is non-@code{nil} and not @code{t}, Emacs adjusts point | ||
| 3264 | to keep the cursor at the same vertical position, even if the | ||
| 3265 | scrolling command didn't move point off-window. | ||
| 3252 | 3266 | ||
| 3253 | If it is non-@code{nil} and not @code{t}, then the scrolling functions | 3267 | This option affects all scroll commands that have a non-@code{nil} |
| 3254 | always 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 | ||
| 3280 | If this option is @code{nil} (the default), @code{scroll-up-command} | ||
| 3281 | and @code{scroll-down-command} simply signal an error when no more | ||
| 3282 | scrolling is possible. | ||
| 3283 | |||
| 3284 | If the value is @code{t}, these commands instead move point to the | ||
| 3285 | beginning or end of the buffer (depending on scrolling direction); | ||
| 3286 | only 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 |
| 3267 | This function scrolls the text in the selected window so that point is | 3291 | This function scrolls the text in the selected window so that point is |
| @@ -288,15 +288,19 @@ If you have code that adds something to kill-emacs-hook, you should | |||
| 288 | consider if it is still appropriate to add it in the noninteractive case. | 288 | consider 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 |
| 294 | of buffer at first key-press (instead move to top/bottom of buffer) | 294 | of buffer at first key-press (instead move to top/bottom of buffer) |
| 295 | when a new variable `scroll-error-top-bottom' is non-nil. | 295 | when `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' |
| 298 | scroll a line instead of full screen. | 301 | scroll 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 |
| 301 | define it as a scroll command affected by `scroll-preserve-screen-position'. | 305 | define it as a scroll command affected by `scroll-preserve-screen-position'. |
| 302 | 306 | ||