import xemacs-21.2.37
[chise/xemacs-chise.git.1] / man / xemacs / frame.texi
1 @node Frame, Keystrokes, Concept Index, Top
2 @comment  node-name,  next,  previous,  up
3 @chapter The XEmacs Frame
4 @cindex frame
5 @cindex window
6 @cindex buffer
7
8 @table @asis
9 @item Frame
10 In many environments, such as a tty terminal, an XEmacs frame
11 literally takes up the whole screen.  If you are
12 running XEmacs in a multi-window system like the X Window System, the
13 XEmacs frame takes up one X window.  @xref{XEmacs under X}, for more
14 information.@refill
15
16 @item Window
17 No matter what environment you are running in, XEmacs allows you to look
18 at several buffers at the same time by having several windows be part of
19 the frame.  Often, the whole frame is taken up by just one window, but
20 you can split the frame into two or more subwindows.  If you are
21 running XEmacs under the X window system, that means you can have several
22 @dfn{XEmacs windows} inside the X window that contains the XEmacs frame.
23 You can even have multiple frames in different X windows, each with
24 their own set of subwindows. 
25 @refill
26 @end table
27
28 Each XEmacs frame displays a variety of information: 
29 @itemize @bullet
30 @item
31 The biggest area usually displays the text you are editing.  It may
32 consist of one window or of two or more windows if you need to look at two
33 buffers a the same time. 
34 @item
35 Below each text window's last line is a @dfn{mode line} (@pxref{Mode
36 Line}), which describes what is going on in that window.  The mode line
37 is in inverse video if the terminal supports that.  If there are several
38 XEmacs windows in one frame, each window has its own mode line.
39 @item
40 At the bottom of each XEmacs frame is the @dfn{echo area} or @dfn{minibuffer
41 window}(@pxref{Echo Area}).  It is used by XEmacs to exchange information
42 with the user.  There is only one echo area per XEmacs frame.
43 @item
44 If you are running XEmacs under a graphical windowing system, a
45 menu bar at the top of the frame makes shortcuts to several of the
46 commands available (@pxref{Pull-down Menus}).
47 @item
48 If you are running XEmacs under a graphical windowing system, a
49 toolbar at the top of the frame, just under the menu bar if it exists,
50 provides ``one-touch'' shortcuts to several commands.  (Not yet
51 documented.)
52 @item
53 If you are running XEmacs under a graphical windowing system, a
54 gutter at the top (under the toolbar) and/or bottom of the frame
55 provides advanced GUI facilities like tab controls for rapid switching
56 among related windows and progress bars for time-consuming operations
57 like downloads across the Internet.  Gutters are an experimental feature
58 introduced in XEmacs version 21.2.  (Not yet documented.)
59 @end itemize
60
61   You can subdivide the XEmacs frame into multiple text windows, and use
62 each window for a different file (@pxref{Windows}).  Multiple XEmacs
63 windows are tiled vertically on the XEmacs frame.  The upper XEmacs window
64 is separated from the lower window by its mode line.
65
66   When there are multiple, tiled XEmacs windows on a single XEmacs frame,
67 the XEmacs window receiving input from the keyboard has the @dfn{keyboard
68 focus} and is called the @dfn{selected window}.  The selected window
69 contains the cursor, which indicates the insertion point.  If you are
70 working in an environment that permits multiple XEmacs frames, and you
71 move the focus from one XEmacs frame into another, the
72 selected window is the one that was last selected in that frame.
73
74   The same text can be displayed simultaneously in several XEmacs
75 windows, which can be in different XEmacs frames.  If you alter the text
76 in an XEmacs buffer by editing it in one XEmacs window, the changes are
77 visible in all XEmacs windows containing that buffer.
78
79
80 @menu
81 * Point::               The place in the text where editing commands operate.  
82 * Echo Area::           Short messages appear at the bottom of the frame.  
83 * Mode Line::           Interpreting the mode line.  
84 * XEmacs under X::      Some information on using XEmacs under the X 
85                         Window System. 
86 @end menu
87
88 @node Point, Echo Area, Frame, Frame
89 @comment  node-name,  next,  previous,  up
90 @section Point
91 @cindex point
92 @cindex cursor
93
94   When XEmacs is running, the cursor shows the location at which editing
95 commands will take effect.  This location is called @dfn{point}.  You
96 can use keystrokes or the mouse cursor to move point through the text
97 and edit the text at different places.
98
99   While the cursor appears to point @var{at} a character, you should
100 think of point as @var{between} two characters: it points @var{before}
101 the character on which the cursor appears.  The exception is at the
102 end of the line, where the cursor appears after the last character of
103 the line.  Where the display is capable, the cursor at the end of the
104 line will appear differently from a cursor over whitespace at the end
105 of the line.  (In an X Windows frame, the end-of-line cursor is half
106 the width of a within-line cursor.)  Sometimes people speak of ``the
107 cursor'' when they mean ``point,'' or speak of commands that move
108 point as ``cursor motion'' commands.
109
110  Each XEmacs frame has only one cursor.  When output is in progress, the cursor
111 must appear where the typing is being done.  This does not mean that
112 point is moving.  It is only that XEmacs has no way to show you the
113 location of point except when the terminal is idle.
114
115   If you are editing several files in XEmacs, each file has its own point
116 location.  A file that is not being displayed remembers where point is.
117 Point becomes visible at the correct location when you look at the file again.
118
119   When there are multiple text windows, each window has its own point
120 location.  The cursor shows the location of point in the selected
121 window.  The visible cursor also shows you which window is selected.  If
122 the same buffer appears in more than one window, point can be moved in
123 each window independently.
124
125   The term `point' comes from the character @samp{.}, which was the
126 command in TECO (the language in which the original Emacs was written)
127 for accessing the value now called `point'.
128
129 @node Echo Area, Mode Line, Point, Frame
130 @section The Echo Area
131 @cindex echo area
132
133   The line at the bottom of the frame (below the mode line) is the
134 @dfn{echo area}.  XEmacs uses this area to communicate with the user:
135
136 @itemize @bullet
137 @item
138   @dfn{Echoing} means printing out the characters that the user types.  XEmacs
139 never echoes single-character commands.  Multi-character commands are
140 echoed only if you pause while typing them: As soon as you pause for more
141 than one second in the middle of a command, all the characters of the command
142 so far are echoed.  This is intended to @dfn{prompt} you for the rest of
143 the command.  Once echoing has started, the rest of the command is echoed
144 immediately as you type it.  This behavior is designed to give confident
145 users fast response, while giving hesitant users maximum feedback.  You
146 can change this behavior by setting a variable (@pxref{Display Vars}).
147 @item
148   If you issue a command that cannot be executed, XEmacs may print an
149 @dfn{error message} in the echo area.  Error messages are accompanied by
150 a beep or by flashing the frame.  Any input you have typed ahead is
151 thrown away when an error happens.
152 @item
153   Some commands print informative messages in the echo area.  These
154 messages look similar to error messages, but are not announced with a
155 beep and do not throw away input.  Sometimes a message tells you what the
156 command has done, when this is not obvious from looking at the text being
157 edited.  Sometimes the sole purpose of a command is to print a message
158 giving you specific information.  For example, the command @kbd{C-x =} is
159 used to print a message describing the character position of point in the
160 text and its current column in the window.  Commands that take a long time
161 often display messages ending in @samp{...} while they are working, and
162 add @samp{done} at the end when they are finished.
163 @item
164   The echo area is also used to display the @dfn{minibuffer}, a window
165 that is used for reading arguments to commands, such as the name of a
166 file to be edited.  When the minibuffer is in use, the echo area displays
167 with a prompt string that usually ends with a colon.  The cursor
168 appears after the prompt.  You can always get out of the minibuffer by
169 typing @kbd{C-g}.  @xref{Minibuffer}.
170 @end itemize
171
172 @node Mode Line, XEmacs under X, Echo Area, Frame
173 @comment  node-name,  next,  previous,  up
174 @section The Mode Line
175 @cindex mode line
176 @cindex top level
177
178   Each text window's last line is a @dfn{mode line} which describes what is
179 going on in that window.  When there is only one text window, the mode line
180 appears right above the echo area.  The mode line is in inverse video if
181 the terminal supports that, starts and ends with dashes, and contains text
182 like @samp{XEmacs:@: @var{something}}.
183
184   If a mode line has something else in place of @samp{XEmacs:@:
185 @var{something}}, the window above it is in a special subsystem
186 such as Dired.  The mode line then indicates the status of the
187 subsystem.
188
189   Normally, the mode line has the following appearance:
190
191 @example
192 --@var{ch}-XEmacs: @var{buf}      (@var{major} @var{minor})----@var{pos}------
193 @end example
194
195 @noindent
196 This gives information about the buffer being displayed in the window: the
197 buffer's name, what major and minor modes are in use, whether the buffer's
198 text has been changed, and how far down the buffer you are currently
199 looking.
200
201   @var{ch} contains two stars (@samp{**}) if the text in the buffer has been
202 edited (the buffer is ``modified''), or two dashes (@samp{--}) if the
203 buffer has not been edited.  Exception: for a read-only buffer, it is 
204 @samp{%%}.
205
206   @var{buf} is the name of the window's chosen @dfn{buffer}.  The chosen
207 buffer in the selected window (the window that the cursor is in) is also
208 XEmacs's selected buffer, the buffer in which editing takes place.  When
209 we speak of what some command does to ``the buffer'', we mean the
210 currently selected buffer.  @xref{Buffers}.
211
212   @var{pos} tells you whether there is additional text above the top of
213 the screen or below the bottom.  If your file is small and it is
214 completely visible on the screen, @var{pos} is @samp{All}.  Otherwise, 
215 @var{pos} is @samp{Top} if you are looking at the beginning of the file,
216 @samp{Bot} if you are looking at the end of the file, or
217 @samp{@var{nn}%}, where @var{nn} is the percentage of the file above the
218 top of the screen.@refill
219
220   @var{major} is the name of the @dfn{major mode} in effect in the buffer.  At
221 any time, each buffer is in one and only one major mode.
222 The available major modes include Fundamental mode (the least specialized),
223 Text mode, Lisp mode, and C mode.  @xref{Major Modes}, for details
224 on how the modes differ and how you select one.@refill
225
226   @var{minor} is a list of some of the @dfn{minor modes} that are turned on
227 in the window's chosen buffer.  For example, @samp{Fill} means that Auto
228 Fill mode is on.  @code{Abbrev} means that Word Abbrev mode is on.
229 @code{Ovwrt} means that Overwrite mode is on.  @xref{Minor Modes}, for more
230 information.  @samp{Narrow} means that the buffer being displayed has
231 editing restricted to only a portion of its text.  This is not really a
232 minor mode, but is like one.  @xref{Narrowing}.  @code{Def} means that a
233 keyboard macro is being defined.  @xref{Keyboard Macros}.
234
235   Some buffers display additional information after the minor modes.  For
236 example, Rmail buffers display the current message number and the total
237 number of messages.  Compilation buffers and Shell mode display the status
238 of the subprocess.
239
240   If XEmacs is currently inside a recursive editing level, square
241 brackets (@samp{[@dots{}]}) appear around the parentheses that surround
242 the modes.  If XEmacs is in one recursive editing level within another,
243 double square brackets appear, and so on.  Since information on
244 recursive editing applies to XEmacs in general and not to any one buffer,
245 the square brackets appear in every mode line on the screen or not in
246 any of them.  @xref{Recursive Edit}.@refill
247
248 @findex display-time
249   XEmacs can optionally display the time and system load in all mode lines.
250 To enable this feature, type @kbd{M-x display-time}.  The information added
251 to the mode line usually appears after the file name, before the mode names
252 and their parentheses.  It looks like this:
253
254 @example
255 @var{hh}:@var{mm}pm @var{l.ll} [@var{d}]
256 @end example
257
258 @noindent
259 (Some fields may be missing if your operating system cannot support them.)
260 @var{hh} and @var{mm} are the hour and minute, followed always by @samp{am}
261 or @samp{pm}.  @var{l.ll} is the average number of running processes in the
262 whole system recently.  @var{d} is an approximate index of the ratio of
263 disk activity to CPU activity for all users.
264
265 The word @samp{Mail} appears after the load level if there is mail for
266 you that you have not read yet.
267
268 @vindex mode-line-inverse-video
269   Customization note: the variable @code{mode-line-inverse-video}
270 controls whether the mode line is displayed in inverse video (assuming
271 the terminal supports it); @code{nil} means no inverse video.  The
272 default is @code{t}.  For X frames, simply set the foreground and
273 background colors appropriately.
274   
275 @node XEmacs under X, , Mode Line, Frame
276 @section Using XEmacs Under the X Window System
277 @comment  node-name,  next,  previous,  up
278
279 XEmacs can be used with the X Window System and a window manager like
280 MWM or TWM.  In that case, the X window manager opens, closes, and
281 resizes XEmacs frames.  You use the window manager's mouse gestures to
282 perform the operations.  Consult your window manager guide or reference
283 manual for information on manipulating X windows.
284
285 When you are working under X, each X window (that is, each XEmacs frame)
286 has a menu bar for mouse-controlled operations (@pxref{Pull-down Menus}).
287
288 @cindex multi-frame XEmacs
289 @findex make-frame
290 XEmacs under X is also a multi-frame XEmacs.  You can use the @b{New
291 Frame} menu item from the @b{File} menu to create a new XEmacs frame in a
292 new X window from the same process.  The different frames will share the
293 same buffer list, but you can look at different buffers in the different
294 frames.
295
296 @findex find-file-other-frame
297 The function @code{find-file-other-frame} is just like @code{find-file},
298 but creates a new frame to display the buffer in first.  This is
299 normally bound to @kbd{C-x 5 C-f}, and is what the @b{Open File, New
300 Frame} menu item does.
301
302 @findex switch-to-buffer-other-frame
303 The function @code{switch-to-buffer-other-frame} is just like
304 @code{switch-to-buffer}, but creates a new frame to display the buffer
305 in first.  This is normally bound to @kbd{C-x 5 b}.
306
307 @vindex default-frame-alist
308 You can specify a different default frame size other than the one provided.
309 Use the variable @code{default-frame-alist}, which is an alist of default
310 values for frame creation other than the first one.  These may be set in
311 your init file, like this:  
312
313 @example
314   (setq default-frame-alist '((width . 80) (height . 55)))
315 @end example
316
317 @vindex x-frame-defaults
318 For values specific to the first XEmacs frame, you must use X resources.
319 The variable @code{x-frame-defaults} takes an alist of default frame
320 creation parameters for X window frames.  These override what is
321 specified in @file{~/.Xdefaults} but are overridden by the arguments to
322 the particular call to @code{x-create-frame}.
323
324 @vindex create-frame-hook
325 When you create a new frame, the variable @code{create-frame-hook}
326 is called with one argument, the frame just created.
327
328 If you want to close one or more of the X windows you created using
329 @b{New Frame}, use the @b{Delete Frame} menu item from the @b{File} menu.  
330
331 @vindex frame-title-format
332 @vindex frame-icon-title-format
333 If you are working with multiple frames, some special information
334 applies:
335 @itemize @bullet
336 @item
337 Two variables, @code{frame-title-format} and
338 @code{frame-icon-title-format} determine the title of the frame and
339 the title of the icon that results if you shrink the frame.
340
341 @vindex auto-lower-frame
342 @vindex auto-raise-frame
343 @item
344 The variables @code{auto-lower-frame} and @code{auto-raise-frame}
345 position a frame. If true, @code{auto-lower-frame} lowers a frame to
346 the bottom when it is no longer selected. If true,
347 @code{auto-raise-frame} raises a frame to the top when it is
348 selected. Under X, most ICCCM-compliant window managers will have
349 options to do this for you, but these variables are provided in case you
350 are using a broken window manager.
351
352 @item
353 There is a new frame/modeline format directive, %S, which expands to
354 the name of the current frame (a frame's name is distinct from its
355 title; the name is used for resource lookup, among other things, and the
356 title is simply what appears above the window.)
357 @end itemize