Initial git import
[sxemacs] / info / new-users-guide / xmenu.texi
1 @comment  node-name,  next,  previous,  up
2 @node Windows and Menus, Edit, Entering, Top
3 @chapter SXEmacs Windows and Menus
4 @cindex selected window
5 @cindex windows
6 @findex delete-window
7 @findex delete-other-windows
8 @findex scroll-other-window
9   
10   The first section of this chapter will show you how you can manipulate
11 SXEmacs Windows and the other section will explain the Pull-down Menus of
12 an SXEmacs window.
13
14 @comment  node-name,  next,  previous,  up
15 @menu
16 * SXEmacs Window::               Manipulating SXEmacs Windows
17 * Pull-down Menus::             Description of SXEmacs Pull-down Menus
18 @end menu
19
20 @node SXEmacs Window, Pull-down Menus, Windows and Menus, Windows and Menus
21 @section SXEmacs Windows
22   When you use SXEmacs under X, you can open multiple windows and each
23 window can display one buffer or multiple parts of one buffer. Each window
24 will have its own @dfn{mode line} and @dfn{echo area}. At any one time
25 there is only one @dfn{selected window} and the buffer it displays is
26 the @dfn{selected buffer}. There are some commands for manipulating
27 windows:
28
29 @kindex C-x 0
30 @kindex C-x 1
31 @kindex C-x 2
32 @kindex C-x 3
33 @kindex C-x 4
34 @kindex M-C-v
35 @table @kbd
36 @item M-C-v
37 @findex scroll-other-window
38 This command will scroll the window which is not @dfn{selected} 
39 (@code{scroll-other-window}).
40
41 @findex delete-window
42 @item C-x 0
43 This command will get rid of the selected window (@code{delete-window}).
44 That is a zero. If there is more than one Emacs frame, deleting the
45 sole remaining window on that frame deletes the frame as well. If the
46 current frame is the only frame, it is not deleted.
47
48 @findex delete-other-windows 
49 @item C-x 1
50 This command will get rid of all the windows except the selected one. 
51 (@code{delete-other-windows}). For example, if you use the @b{Describe
52 variable} option from the @b{Help} menu, the window will split
53 vertically and the bottom window will contain documentation for that
54 variable. After you are done looking at that variable's documentation
55 you might want to come back to your original single window. Just type
56 @kbd{C-x 1} after your cursor is in the top window (the window which you
57 want to keep) and hit @key{RET}.
58
59 @findex split-window-vertically 
60 @item C-x 2
61 This command will split the selected window into two windows, one above
62 the other (@code{split-window-vertically}). Both the windows will start
63 out by displaying the same buffer. The window in which you have your
64 cursor will be your @dfn{selected window}.
65
66 @findex split-window-horizontally
67 @item C-x 3
68 This will split the selected window into two windows positioned side by
69 side (@code{split-window-horizontally}). A line of vertical bars will
70 separate the window.
71 @end table
72 @noindent
73
74 You can select a buffer in another window by using some other
75 commands. These commands all have a prefix key @kbd{C-x 4} 
76 @table @kbd
77 @kindex C-x 4 b
78 @kindex C-x 4 f
79 @kindex C-x 4 d
80 @kindex C-x 4 m
81 @findex switch-to-buffer-other-window
82 @findex find-file-other-window
83 @findex dired-other-window
84 @findex mail-other-window
85 @item C-x 4 b @var{bufname} @key{RET}
86 This command will select a buffer @var{bufname} in another window.  This
87 runs @code{switch-to-buffer-other-window}. It will prompt you for a
88 buffername.
89
90 @item C-x 4 f @var{filename} @key{RET}
91 Visit file @var{filename} and select its buffer in another window.  This
92 runs @code{find-file-other-window}.  @xref{Visiting,,,sxemacs,SXEmacs User's
93 Manual}. It will prompt you for a filename.
94
95 @item C-x 4 d @var{directory} @key{RET}
96 Select a Dired buffer for directory @var{directory} in another window.
97 This runs @code{dired-other-window}.  @xref{Dired,,,sxemacs,SXEmacs User's
98 Manual}.
99
100 @item C-x 4 m
101 Start composing a mail message in another window.  This runs
102 @code{mail-other-window}, and its same-window version is @kbd{C-x m}.
103 @xref{Sending Mail,,,sxemacs,SXEmacs User's Manual}, for information on how
104 to @b{S}end @b{M}ail using SXEmacs. @xref{Reading Mail With
105 Rmail,,,sxemacs,SXEmacs User's Manual}, for information on reading mail using
106 @b{Rmail}.
107 @end table
108
109   
110   If you click the right button on the mouse on a mode line, you will
111 get a menu with following options:
112 @cindex windows
113 @cindex pull-down-menus
114 @cindex menus
115 @table @b
116 @item Delete Window
117 Choosing this menu will remove the window above this modeline from the frame.
118 @item Delete Other Windows
119 Delete all windows on the frame except for the one above this modeline.
120 @item Split Window
121 Split the window above the mode line in half, creating another window. 
122 @item Split Window Horizontally
123 Split the window above the mode line in half horizontally, so that there
124 will be two windows side-by-side.
125 @item Balance Windows
126 Readjust the sizes of all windows on the frame until all windows have
127 roughly the same number of lines.
128 @end table
129
130
131 @comment  node-name,  next,  previous,  up
132 @node Pull-down Menus,  , SXEmacs Window, Windows and Menus
133 @section SXEmacs Pull-down Menus
134
135 When you run SXEmacs under X, each Emacs frame has a menu-bar at the top
136 which provides commands for editing, help and other
137 options. All these options are also available via key commands, the
138 menus just provide convenient short-cuts. The key commands are displayed
139 right besides some of the options. The following is a brief
140 description of the four default menus on the menu bar:
141
142 @menu
143 * File menu::                   Items on the File menu
144 * Edit menu::                   Items on the Edit menu
145 * Options Menu::                Items on the Options Menu
146 * Buffers Menu::                Items on the Buffers Menu
147 * Help menu::                   The Help Menu at the extreme right on
148                                 the frame
149 @end menu
150
151 @node File menu, Edit menu, Pull-down Menus, Pull-down Menus
152 @subsection The File Menu
153 @cindex File menu
154 @cindex Open in New Frame... menu item
155 @cindex Open ... menu item
156 @cindex Insert File... menu item
157 @cindex Save Buffer menu item
158 @cindex Save Buffer As ... menu item
159 @cindex Revert Buffer menu item
160 @cindex Kill Buffer menu item
161 @cindex Print Buffer menu item
162 @cindex New Frame menu item
163 @cindex Delete Frame menu item
164 @cindex Split Frame
165 @cindex Un-split (Keep This)
166 @cindex Un-split (Keep Others)
167 @cindex Exit Emacs menu item
168
169 The @b{File} menu bar contains the following items. To choose a
170 particular option, press the left mouse button and drag it to the item
171 you wish to select. Then release the button.
172
173 @table @b
174 @item Open...
175 This option will prompt you for a file name. You will get a message in
176 the echo area:
177
178 @example
179 Find File: 
180 @end example
181 @noindent
182 After Find File, there might be a directory path also. After you type
183 the file name and press @key{RET} the file will be loaded into a new
184 buffer.  
185
186 @item Open in New Frame...
187 It prompts you for a file name and loads that file in a new buffer in
188 a new frame. You can open many frames for the same Emacs session. You
189 can delete the frame by selecting @b{Delete Frame}. 
190
191 @item Insert File...
192 Prompts you for a filename and inserts the contents of this filename in
193 your current buffer. Position your cursor at the place you wish to
194 insert the file and select this option. You will get the following
195 message in the echo area:
196
197 @example
198 Insert file:
199 @end example
200 @noindent
201 Insert the file name and press @key{RET}.
202
203 @item Save <Buffername>
204 It saves the changes you have made to the buffer. If you have made
205 changes which are not saved yet, the option will appear dark, otherwise
206 it will be light and unselectable. If you do not wish to save the
207 changes, select @b{Revert Buffer}.
208
209 @item Save As...
210 Prompts you for a filename and saves the current buffer in that file. It
211 loads the new file if the filename you specify is different from the one
212 you were working with.
213
214 @item Print Buffer <buffername>
215 Prints a hardcopy of the current or @dfn{selected} buffer.
216
217 @item New Frame
218 Opens a new frame with @b{*scratch*} as the default buffer. It doesn't
219 prompt you for a filename. To open a file you need to go to that frame
220 and select @b{Open...}
221
222 @item Split Frame
223 Splits the current window into two equal-sized windows with the same
224 buffer. To get back a single frame, select @b{Un-Split (Keep
225 This)}. @xref{SXEmacs Window}, for more information about windows. 
226
227 @item Un-Split (Keep This)
228 If the frame contains multiple windows, it will remove all windows
229 except the selected one. 
230
231 @item Un-Split (Keep Others)
232 If the frame contains multiple windows, it will remove the selected
233 window and keep the other one.
234
235 @item Revert Buffer <buffername>
236 If you do not wish to save the changes you made to the file since you
237 opened it, select this option. It will restore the last saved version of
238 the file to the current buffer.
239
240 @item Kill Buffer <buffername>
241 It will kill the current buffer. If will prompt you if there are unsaved
242 changes. 
243
244 @item Exit Emacs
245 It will kill the Emacs @dfn{process} as opposed to simply killing the
246 @dfn{buffer}. Before it kills the process, it will prompt you as to
247 which unsaved buffers you wish to save by going through the list of the
248 buffers. 
249
250 @end table
251
252 @comment  node-name,  next,  previous,  up
253 @menu
254 * Edit menu::                   Items on the Edit Menu
255 * Options Menu::                Items on the Options Menu
256 * Buffers Menu::                Items on the Buffers Menu
257 * Help menu::                   The Help Menu at the extreme right on
258                                 the frame
259 @end menu
260
261 @node Edit menu, Options Menu, File menu, Pull-down Menus
262 @subsection The Edit Menu
263 @cindex Undo menu item
264 @cindex Cut menu item
265 @cindex Copy menu item
266 @cindex Paste menu item
267 @cindex Clear menu item
268 @cindex Start Macro Recording menu item
269 @cindex End Macro Recording menu item
270 @cindex Execute Last Macro menu item
271
272 Most of the commands in this menu work on a block of text or a selected
273 region. The text will be highlighted as you select it.
274 @table @b
275 @item Undo 
276 Undoes the previous command.  If you type something by mistake you can
277 use this command. For example, if you select @b{Insert File...} from the
278 @b{File} menu and insert a wrong file by mistake, you can select this
279 item and it will remove the inserted file. It undoes a batch of text
280 which is worth an emacs command.
281
282 @item Cut
283 Removes the selected text block from the current buffer, makes it the X
284 clipboard selection, and places it in the kill ring 
285 (@pxref{Moving Text}). Before executing this command, you have to select
286 a region using Emacs region selection commands or with the
287 mouse. @xref{Selecting Text}. 
288
289 @item Copy 
290 Makes a selected text block the X clipboard selection, and places it in
291 the kill ring.  You can select text using one of the Emacs region
292 selection commands or by selecting a text region with the
293 mouse. @xref{Selecting Text}, for more information.
294
295 @item Paste 
296 Inserts the current value of the X clipboard selection in the current
297 buffer.  Note that this is not necessarily the same as the Emacs
298 @code{yank} command, because the Emacs kill ring and the X clipboard
299 selection are not the same thing.  You can paste in text you have placed
300 in the clipboard using @b{Copy} or @b{Cut}.  You can also use @b{Paste}
301 to insert text that was pasted into the clipboard from other
302 applications. @xref{X Clipboard Selection,,,sxemacs,SXEmacs User's Manual},
303 for information on using Clipboard Selection.
304
305 @item Clear
306 Removes the selected text block from the current buffer but does not
307 place it in the kill ring or the X clipboard selection. You will not be
308 able to get this text back.
309
310 @item Start Macro Recording
311 After selecting this, Emacs will remember every keystroke you type until
312 @b{End Macro Recording} is selected.  
313
314 @item End Macro Recording
315 Selecting this tells emacs to stop remembering your keystrokes. 
316
317 @item Execute Last Macro
318 Selecting this item will cause emacs to re-interpret all of the
319 keystrokes which were saved between selections of the @b{Start Macro
320 Recording} and @b{End Macro Recording} menu items.  You can now execute
321 the most recent keyboard macro. @xref{Keyboard Macros,,,sxemacs,SXEmacs
322 User's Manual}, for further information.
323 @end table
324
325 @comment  node-name,  next,  previous,  up
326 @node Options Menu, Buffers Menu, Edit menu, Pull-down Menus
327 @subsection The Options Menu
328 @cindex Options menu
329 @cindex Read Only menu item
330 @cindex Case Sensitive Search menu item
331 @cindex Overstrike menu item
332 @cindex Auto Delete Selection menu item
333 @cindex Teach Extended Commands menu item
334 @cindex Syntax Highlighting menu item
335 @cindex Paren Highlighting menu item
336 @cindex Font menu item
337 @cindex Size menu item
338 @cindex Weight menu item
339 @cindex Buffers Menu Length... menu item
340 @cindex Buffers Sub-Menus menu item
341 @cindex Save Options
342
343 There are sub-menus for some of the menus which you will need to
344 select. If sub-menus exist for an item, they will be displayed
345 automatically when you drag the mouse on that item. The items in this
346 menu provide some fancy editing operations.
347
348 @table @b
349 @item Read Only
350 Selecting this item will cause the buffer to visit the file in a 
351 read-only mode. Changes to the file will not be allowed. 
352
353 @item Case Sensitive Search
354 Selecting this item will cause searches to be case-sensitive. If 
355 its not selected then searches will ignore case. This option is 
356 local to the buffer. For example, if this item is selected and you are
357 searching for @samp{Smile}, then an occurrence of @samp{smile} will not
358 be recognized because of the smaller case of @samp{s}.
359
360 @item Overstrike
361 After selecting this item, when you type letters they will replace 
362 existing text on a one-to-one basis, rather than pushing it to the 
363 right. At the end of a line, such characters extend the line. Before 
364 a tab, such characters insert until the tab is filled in. 
365
366 @item Auto Delete Selection
367 Selecting this item will cause automatic deletion of the selected 
368 region. After you select a region and hit the @key{RET} key, the
369 selected text will be deleted. The typed text will replace the selection
370 if the selection is active (i.e. if its highlighted). If the option is
371 not selected then the typed text is just inserted at the cursor.
372
373 @item Teach Extended Commands
374 After you  select this item, any time you execute a command with 
375 @kbd{M-x} which has a shorter keybinding, you will be shown the 
376 alternate binding before the command executes. For example if you type
377 @kbd{M-x find-file-other-window} which performs the same function as the
378 @b{Open in Other Window...} in @b{File} menu you will see the following
379 message:
380
381 @example
382 M-x find-file-other-window (bound to keys: C-x 4 f, C-x 4 C-f)
383 @end example 
384
385 @item Syntax Highlighting
386 You can customize your @code{init.el} file to include the font-lock mode
387 so that when you select this item, the comments will be displayed in one
388 face, strings in another, reserved words in another, and so
389 on. @xref{Customization,,,sxemacs,SXEmacs User's Manual}, for more
390 information on customizing @code{init.el} file.  After selecting this
391 item, you will find your code a lot easier to read. When @b{Fonts} is
392 selected, different parts of the program will appear in different
393 Fonts. When @b{Colors} is selected, then the program will be displayed
394 in different colors. Selecting @b{None} causes the program to appear in
395 just one Font and Color. Selecting @b{Less} resets the Fonts and Colors
396 to a fast, minimal set of decorations. Selecting @b{More} resets the
397 Fonts and Colors to a larger set of decorations. For example, if
398 @b{Less} is selected (which is the default setting) then you might have
399 all comments in green color. It does not matter what the comments
400 contain. Whereas, if @b{More} is selected then a function name in the
401 comments themselves might appear in a different Color or Font. Even
402 though the comments themselves might appear in green color, a function
403 name @dfn{within} the comments might appear in red color.
404
405 @item Paren Highlighting
406 After selecting @b{Blink} from this item, if you place the cursor 
407 on a parenthesis, the matching parenthesis will blink. If you select 
408 @b{Highlight} and place the cursor on a parenthesis, the whole 
409 expression of the parenthesis under the cursor will be highlighted. 
410 Selecting @b{None} will turn off the options (regarding @b{Paren 
411 Highlighting}) which you had selected earlier.@refill
412
413 @item Font
414 You can select any Font for your program by choosing from one of the 
415 available Fonts. The whole buffer will be converted to the Font you select.
416
417 @item Size
418 You can select any size for the text in your buffer (ranging from @b{2} to @b{24}) by selecting the appropriate option.@refill
419
420 @item Weight
421 You can choose either @b{Bold} or @b{Medium} for the weight of the text
422 of your buffer.
423
424 @item Buffers Menu Length...
425 Prompts you for the number of buffers to display. Then it will display 
426 that number of most recently selected buffers.
427
428 @item Buffers Sub-Menus
429 After selection of this item the Buffers menu will contain several 
430 commands, as submenus of each buffer line. If this item is unselected, 
431 then there are no submenus for each buffer line, the only command 
432 available will be selecting that buffer.
433
434 @item Save Options
435 Selecting this item will save the current settings of your Options 
436 menu to your @code{init.el} file so that the next time you start SXEmacs,
437 you won't need to select the options again.
438 @end table
439
440
441 @comment  node-name,  next,  previous,  up
442 @node Buffers Menu, Help menu, Options Menu, Pull-down Menus
443 @subsection The Buffers Menu
444 @cindex Buffers menu
445 The @b{Buffers} menu provides a selection of up to ten buffers and the
446 item @b{List All Buffers}, which provides a Buffer List. If you select
447 @b{Buffers Sub-menus} from the @b{Options} menu, you will get some
448 sub-menus for each of the buffer listing.
449
450
451 @comment  node-name,  next,  previous,  up
452 @node Help menu,  , Buffers Menu, Pull-down Menus
453 @subsection The Help Menu
454 @cindex Help menu
455
456 The Help Menu gives you access to Emacs Info and provides a menu
457 equivalent for some of the choices you have when using @kbd{C-h}. 
458 @xref{Help}, for more information. 
459
460 The @b{Describe variable} and @b{Describe function} will provide
461 documentation for the corresponding variable or function. The Help menu
462 also gives access to UNIX online manual pages via the @b{UNIX Manual...}
463 option.   
464
465
466
467
468
469
470
471
472