Merge remote-tracking branch 'origin/master' into for-steve
[sxemacs] / info / sxemacs / display.texi
1 @node Display, Search, Registers, Top
2 @chapter Controlling the Display
3
4   Since only part of a large buffer fits in the window, SXEmacs tries to show
5 the part that is likely to be interesting.  The display control commands
6 allow you to specify which part of the text you want to see.
7
8 @table @kbd
9 @item C-l
10 Clear frame and redisplay, scrolling the selected window to center
11 point vertically within it (@code{recenter}).
12 @item C-v
13 @itemx pgdn
14 @itemx next
15 Scroll forward (a windowful or a specified number of lines) (@code{scroll-up}).
16 On most X keyboards, you can get this functionality using the key
17 labelled @samp{Page Down}, which generates either @kbd{next} or @kbd{pgdn}.
18 @item M-v
19 @itemx pgup
20 @itemx prior
21 Scroll backward (@code{scroll-down}).  On most X keyboards, you can get
22 this functionality using the key labelled @samp{Page Up}, which
23 generates either @kbd{prior} or @kbd{pgup}.
24 @item @var{arg} C-l
25 Scroll so point is on line @var{arg} (@code{recenter}).
26 @item C-x <
27 @itemx C-pgdn
28 @itemx C-next
29 Scroll text in current window to the left (@code{scroll-left}).
30 @item C-x >
31 @itemx C-pgup
32 @itemx C-prior
33 Scroll to the right (@code{scroll-right}).
34 @item C-x $
35 Make deeply indented lines invisible (@code{set-selective-display}).
36 @end table
37
38 @menu
39 * Scrolling::              Moving text up and down in a window.
40 * Horizontal Scrolling::   Moving text left and right in a window.
41 * Selective Display::      Hiding lines with lots of indentation.
42 * Display Vars::           Information on variables for customizing display.
43 @end menu
44
45 @node Scrolling, Horizontal Scrolling, Display, Display
46 @section Scrolling
47
48   If a buffer contains text that is too large to fit entirely within the
49 window that is displaying the buffer, SXEmacs shows a contiguous section of
50 the text.  The section shown always contains point.
51
52 @cindex scrolling
53   @dfn{Scrolling} means moving text up or down in the window so that
54 different parts of the text are visible.  Scrolling forward means that text
55 moves up, and new text appears at the bottom.  Scrolling backward moves
56 text down and new text appears at the top.
57
58   Scrolling happens automatically if you move point past the bottom or top
59 of the window.  You can also explicitly request scrolling with the commands
60 in this section.
61
62 @ifinfo
63 @table @kbd
64 @item C-l
65 Clear frame and redisplay, scrolling the selected window to center
66 point vertically within it (@code{recenter}).
67 @item C-v
68 @itemx pgdn
69 @itemx next
70 Scroll forward (a windowful or a specified number of lines) (@code{scroll-up}).
71 @item M-v
72 @itemx pgup
73 @itemx prior
74 Scroll backward (@code{scroll-down}).
75 @item @var{arg} C-l
76 Scroll so point is on line @var{arg} (@code{recenter}).
77 @end table
78 @end ifinfo
79
80 @kindex C-l
81 @findex recenter
82   The most basic scrolling command is @kbd{C-l} (@code{recenter}) with no
83 argument.  It clears the entire frame and redisplays all windows.  In
84 addition, it scrolls the selected window so that point is halfway down
85 from the top of the window.
86
87 @kindex C-v
88 @kindex M-v
89 @kindex pgup
90 @kindex pgdn
91 @kindex next
92 @kindex prior
93 @findex scroll-up
94 @findex scroll-down
95   The scrolling commands @kbd{C-v} and @kbd{M-v} let you move all the text
96 in the window up or down a few lines.  @kbd{C-v} (@code{scroll-up}) with an
97 argument shows you that many more lines at the bottom of the window, moving
98 the text and point up together as @kbd{C-l} might.  @kbd{C-v} with a
99 negative argument shows you more lines at the top of the window.
100 @kbd{Meta-v} (@code{scroll-down}) is like @kbd{C-v}, but moves in the
101 opposite direction.@refill
102
103 @vindex next-screen-context-lines
104   To read the buffer a windowful at a time, use @kbd{C-v} with no
105 argument.  @kbd{C-v} takes the last two lines at the bottom of the
106 window and puts them at the top, followed by nearly a whole windowful of
107 lines not previously visible.  Point moves to the new top of the window
108 if it was in the text scrolled off the top.  @kbd{M-v} with no argument
109 moves backward with similar overlap.  The number of lines of overlap
110 across a @kbd{C-v} or @kbd{M-v} is controlled by the variable
111 @code{next-screen-context-lines}; by default, it is two.
112
113   Another way to scroll is using @kbd{C-l} with a numeric argument.
114 @kbd{C-l} does not clear the frame when given an argument; it only
115 scrolls the selected window.  With a positive argument @var{n}, @kbd{C-l}
116 repositions text to put point @var{n} lines down from the top.  An
117 argument of zero puts point on the very top line.  Point does not move
118 with respect to the text; rather, the text and point move rigidly on the
119 frame.  @kbd{C-l} with a negative argument puts point that many lines
120 from the bottom of the window.  For example, @kbd{C-u - 1 C-l} puts
121 point on the bottom line, and @kbd{C-u - 5 C-l} puts it five lines from
122 the bottom.  Just @kbd{C-u} as argument, as in @kbd{C-u C-l}, scrolls
123 point to the center of the frame.
124
125 @vindex scroll-step
126   Scrolling happens automatically if point has moved out of the visible
127 portion of the text when it is time to display.  Usually scrolling is
128 done  to put point vertically centered within the window.  However, if
129 the variable @code{scroll-step} has a non-zero value, an attempt is made to
130 scroll the buffer by that many lines; if that is enough to bring point back
131 into visibility, that is what happens.
132
133   Scrolling happens automatically if point has moved out of the visible
134 portion of the text when it is time to display.  Usually scrolling is
135 done  to put point vertically centered within the window.  However, if
136 the variable @code{scroll-step} has a non-zero value, an attempt is made to
137 scroll the buffer by that many lines; if that is enough to bring point back
138 into visibility, that is what happens.
139
140 @vindex scroll-conservatively
141   If you set @code{scroll-step} to a small value because you want to use
142 arrow keys to scroll the screen without recentering, the redisplay
143 preemption will likely make SXEmacs keep recentering the screen when
144 scrolling fast, regardless of @code{scroll-step}.  To prevent this, set
145 @code{scroll-conservatively} to a small value, which will have the
146 result of overriding the redisplay preemption.
147
148 @node Horizontal Scrolling,, Scrolling, Display
149 @section Horizontal Scrolling
150
151 @ifinfo
152 @table @kbd
153 @item C-x <
154 Scroll text in current window to the left (@code{scroll-left}).
155 @item C-x >
156 Scroll to the right (@code{scroll-right}).
157 @end table
158 @end ifinfo
159
160 @kindex C-x <
161 @kindex C-x >
162 @findex scroll-left
163 @findex scroll-right
164 @cindex horizontal scrolling
165   The text in a window can also be scrolled horizontally.  This means that
166 each line of text is shifted sideways in the window, and one or more
167 characters at the beginning of each line are not displayed at all.  When a
168 window has been scrolled horizontally in this way, text lines are truncated
169 rather than continued (@pxref{Continuation Lines}), with a @samp{$} appearing
170 in the first column when there is text truncated to the left, and in the
171 last column when there is text truncated to the right.
172
173   The command @kbd{C-x <} (@code{scroll-left}) scrolls the selected
174 window to the left by @var{n} columns with argument @var{n}.  With no
175 argument, it scrolls by almost the full width of the window (two columns
176 less, to be precise).  @kbd{C-x >} (@code{scroll-right}) scrolls
177 similarly to the right.  The window cannot be scrolled any farther to
178 the right once it is displaying normally (with each line starting at the
179 window's left margin); attempting to do so has no effect.
180
181 @node Selective Display, Display Vars, Display, Display
182 @section Selective Display
183 @findex set-selective-display
184 @kindex C-x $
185
186   SXEmacs can hide lines indented more than a certain number
187 of columns (you specify how many columns).  This allows you  to get an
188 overview of a part of a program.
189
190   To hide lines, type @kbd{C-x $} (@code{set-selective-display}) with a
191 numeric argument @var{n}.  (@xref{Arguments}, for information on giving
192 the argument.)  Lines with at least @var{n} columns of indentation
193 disappear from the screen.  The only indication of their presence are
194 three dots (@samp{@dots{}}), which appear at the end of each visible
195 line that is followed by one or more invisible ones.@refill
196
197   The invisible lines are still present in the buffer, and most editing
198 commands see them as usual, so it is very easy to put point in the middle
199 of invisible text.  When this happens, the cursor appears at the end of the
200 previous line, after the three dots.  If point is at the end of the visible
201 line, before the newline that ends it, the cursor appears before the three
202 dots.
203
204   The commands @kbd{C-n} and @kbd{C-p} move across the invisible lines
205 as if they were not there.
206
207   To make everything visible again, type @kbd{C-x $} with no argument.
208
209 @node Display Vars,, Selective Display, Display
210 @section Variables Controlling Display
211
212   This section contains information for customization only.  Beginning
213 users should skip it.
214
215 @vindex no-redraw-on-reenter
216   When you reenter SXEmacs after suspending, SXEmacs normally clears the
217 screen and redraws the entire display.  On some terminals with more than
218 one page of memory, it is possible to arrange the termcap entry so that
219 the @samp{ti} and @samp{te} strings (output to the terminal when SXEmacs
220 is entered and exited, respectively) switch between pages of memory so
221 as to use one page for SXEmacs and another page for other output.  In that
222 case, you might want to set the variable @code{no-redraw-on-reenter} to
223 non-@code{nil} so that SXEmacs will assume, when resumed, that the screen
224 page it is using still contains what SXEmacs last wrote there.
225
226 @vindex echo-keystrokes
227   The variable @code{echo-keystrokes} controls the echoing of multi-character
228 keys; its value is the number of seconds of pause required to cause echoing
229 to start, or zero, meaning don't echo at all.  @xref{Echo Area}.
230
231 @vindex ctl-arrow
232   If the variable @code{ctl-arrow} is @code{nil}, control characters in the
233 buffer are displayed with octal escape sequences, all except newline and
234 tab.  If its value is @code{t}, then control characters will be printed
235 with an up-arrow, for example @kbd{^A}.
236
237 If its value is not @code{t} and not @code{nil}, then characters whose
238 code is greater than 160 (that is, the space character (32) with its
239 high bit set) will be assumed to be printable, and will be displayed
240 without alteration.  This is the default when running under X Windows,
241 since SXEmacs assumes an ISO/8859-1 character set (also known as
242 ``Latin1'').  The @code{ctl-arrow} variable may also be set to an
243 integer, in which case all characters whose codes are greater than or
244 equal to that value will be assumed to be printable.
245
246 Altering the value of @code{ctl-arrow} makes it local to the current
247 buffer; until that time, the default value is in effect.  @xref{Locals}.
248
249 @vindex tab-width
250   Normally, a tab character in the buffer is displayed as whitespace which
251 extends to the next display tab stop position, and display tab stops come
252 at intervals equal to eight spaces.  The number of spaces per tab is
253 controlled by the variable @code{tab-width}, which is made local by
254 changing it, just like @code{ctl-arrow}.  Note that how the tab character
255 in the buffer is displayed has nothing to do with the definition of
256 @key{TAB} as a command.
257
258 @vindex selective-display-ellipses
259   If you set the variable @code{selective-display-ellipses} to @code{nil},
260 the three dots at the end of a line that precedes invisible
261 lines do not appear.  There is no visible indication of the invisible lines.
262 This variable becomes local automatically when set.