This commit was generated by cvs2svn to compensate for changes in r5670,
[chise/xemacs-chise.git.1] / info / new-users-guide.info-2
1 This is Info file ../../info/new-users-guide.info, produced by Makeinfo
2 version 1.68 from the input file new-users-guide.texi.
3
4 INFO-DIR-SECTION XEmacs Editor
5 START-INFO-DIR-ENTRY
6 * Intro: (new-users-guide).     Introduction to the XEmacs Editor.
7 END-INFO-DIR-ENTRY
8
9    This manual serves as an introduction to the XEmacs editor.
10
11    Copyright (C) 1985, 1986, 1988 Richard M. Stallman.  Copyright (C)
12 1991, 1992, 1993, 1994 Lucid, Inc.  Copyright (C) 1993, 1994 Sun
13 Microsystems, Inc.
14
15    Permission is granted to make and distribute verbatim copies of this
16 manual provided the copyright notice and this permission notice are
17 preserved on all copies.
18
19 \1f
20 File: new-users-guide.info,  Node: Help,  Next: Modes,  Prev: Customization Basics,  Up: Top
21
22 Help
23 ****
24
25    XEmacs provides a comprehensive Help facility. On the extreme right
26 of the menu-bar there is a Help menu. There are several help commands
27 provided by this menu. You can also use `C-h' for invoking the Help
28 facility. Type "?" for a list of keys you can type after typing `C-h'.
29 If you want more information on what your options are and what kind of
30 help you can get type "?" again. You will get a listing of all the keys
31 you can type and what they will do. Initially if you want help, type
32 `C-h' three times.
33
34 * Menu:
35
36 * The Help Menu::                   Items on the Help menu
37
38 \1f
39 File: new-users-guide.info,  Node: The Help Menu,  Prev: Help,  Up: Help
40
41 Help menu
42 =========
43
44    When you click on the Help menu with any of the mouse buttons you
45 will get the following menu items:
46
47 Info
48      Selecting this item will take you to the Info page which is the
49      online documentation browsing system. You can simply click on the
50      highlighted items and "Info" will take you to the document
51      providing information about that topic.
52
53 Describe Mode
54      After you select this item, you will get a documentation on the
55      major and minor modes which are enabled in the buffer you are
56      working with. *Note Modes::, for information on Modes.
57
58 Hyper Apropos...
59      After you select this item, you will see the following message in
60      the echo area:
61
62           List symbols matching regexp:
63
64      If you type "mode" and hit <RET>, you will get a list of all the
65      symbols (like functions and commands). You can now get
66      documentation on any of the given symbols by "clicking" on any of
67      the symbols (i.e. drag your mouse on the appropriate symbol and
68      release the button). For example, if you "click" on the
69      'auto-fill-mode' you will get the following message in the window
70      at the bottom:
71
72           auto-fill-mode
73           
74           Function, Command:
75           
76             Toggle auto-fill mode.
77             With arg, turn auto-fill mode on if and only if arg is positive.
78             In auto-fill mode, inserting a space at a column beyond `fill-column'
79             automatically breaks the line at a previous space.
80           
81           Variable:
82           
83             value = nil
84           
85             variable not documented
86
87 Command Apropos...
88      Selecting this item will prompt you for a string just like when you
89      select Hyper Apropos.... After you give a string name, you will get
90      a listing of all the functions and commands containing that string
91      name with a very short description about what that command does.
92
93 Full Apropos...
94      After you select this item, you will be prompted for a string name
95      in the echo area:
96
97           Apropos (regexp):
98
99      Now you can give any string name, for example "mode" and hit
100      <RET>. You will get a listing of all the variables and commands
101      containing that string i.e "mode" with a short description of its
102      function.
103
104 List Keybindings
105      Select this item and you will get a listing of all the keys and the
106      commands that they execute. Depending on which Major mode your
107      buffer is in, you will get a listing of the special keybindings
108      for that particular buffer also. For example, if you are in
109      "Texinfo" mode, part of your list will contain:
110
111           C-c C-c n     texinfo-insert-@node
112           C-c C-c o     texinfo-insert-@noindent
113           C-c C-c s     texinfo-insert-@samp
114           C-c C-c t     texinfo-insert-@table
115           C-c C-c v     texinfo-insert-@var
116           C-c C-c x     texinfo-insert-@example
117           C-c C-c {     texinfo-insert-braces
118
119      These keybindings apply only to "Texinfo" mode. *Note Modes::, for
120      more information on various modes.
121
122 Describe Key...
123      After you select this item, you will be see the following message
124      in the echo area:
125
126           Describe Key:
127      After you type a command key sequence, full documentation of that
128      command will be displayed. For example if you type `C-g', you will
129      see the following documentation for `C-g':
130
131           keyboard-quit:
132           Signal a `quit' condition.
133      This means that `C-g' will quit whatever command you gave earlier.
134
135 Describe Function...
136      This menu item provides documentation for a function. After you
137      select this item, it will prompt you for a function name in the
138      echo area:
139
140           Describe function (default <some function name>):
141
142      If you hit <RET> without giving a function name, you will get
143      documentation for that default function name, otherwise if you
144      type a function name and hit <RET>, you will get documentation for
145      the given function.
146
147 Describe Variable...
148      You can get documentation on any variable by selecting this menu
149      item. It is similar to Describe Function and will prompt you for a
150      variable name.
151
152 Unix Manual...
153      After you select this item you will be prompted for a Unix command
154      for which you wish to see the man page. You will see the following
155      message in the echo area:
156
157           Manual entry: (default <some name>)
158
159      Now you can type any command, for example type `who' and press
160      <RET>. You will get the man page for the Unix command `who' which
161      lists who is on the system.
162
163 Emacs Tutorial
164      Select this item and you will get a tutorial on Emacs. It is good
165      for new users.
166
167 Emacs News
168      Select this item and you will get a lot of historical and current
169      news on Emacs !
170
171    For more information on the Help facility, *Note Help: (xemacs)Help.
172
173 \1f
174 File: new-users-guide.info,  Node: Modes,  Next: Files,  Prev: Help,  Up: Top
175
176 Major and Minor Modes
177 *********************
178
179    XEmacs is "language sensitive". It has several "major" and "minor"
180 modes.  The major modes customize Emacs to edit text of a particular
181 sort. There are major modes for C, Lisp, Emacs Lisp, LaTeX, English
182 etc. Within each major mode, certain functions and keys are redefined
183 to "suit" that particular sort of text. The minor modes provide certain
184 features which can be turned off or on at any time. Emacs can only be
185 in one major mode at any time, but it can turn on several minor modes
186 at the same time. After you have selected any major or minor mode, you
187 can select Describe Mode from the Help menu and you will get
188 documentation about those modes.
189
190 * Menu:
191
192 * Major Modes::                 Choosing Major Modes
193 * Minor Modes::                 Auto-Fill, Abbrev and other minor modes
194
195 \1f
196 File: new-users-guide.info,  Node: Major Modes,  Next: Minor Modes,  Prev: Modes,  Up: Modes
197
198 Major Modes
199 ===========
200
201    Emacs has several major modes which customize Emacs to edit text of
202 various sorts. You can have only one major mode at any time. Within each
203 major mode, Emacs redefines certain functions (like cursor movement,
204 indentation and text killing) to suit the needs of the text being
205 edited. When you are editing a specific type of text you should switch
206 to the appropriate mode. If you are working with C code, you should
207 switch to C mode; if you are working with Lisp code, then switch to lisp
208 mode and if you are working with English text switch to Text mode.
209
210    When you open a file to work on, Emacs usually selects the
211 appropriate mode. For example, if you open a file called `guide.c' then
212 Emacs will select the C mode because of the ".c" extension of the file.
213 To explicitly select a mode type the following command:
214
215      ;;; selects lisp mode
216      M-x lisp-mode
217      
218      ;;; selects C mode
219      M-x c-mode
220
221 To select any other mode, just add the major mode name before the
222 '-mode'. The current mode in which you are in will be displayed in
223 parenthesis in the mode-line at the bottom of the frame. All major
224 modes have some special keybindings and you can get a listing of those
225 keybindings by selecting List Keybindings from the Help menu on the
226 menu bar.
227
228    Some of the available modes in XEmacs are :
229
230 fundamental-mode
231      When you start XEmacs, usually you start with the default
232      "Fundamental" mode. This mode has no special definitions or
233      settings.
234
235 nroff-mode
236      Use this mode when you have to format a text with nroff before it
237      can be available in readable form. It redefines some indentation
238      commands. *Note Nroff Mode: (xemacs)Nroff Mode, for information on
239      this mode.
240
241 tex-mode
242      Use this mode if you are using the LaTeX text-formatter. It
243      provides commands for insertion of quotes, braces and other
244      characters. It also allows you to format the buffer for printing.
245      *Note TeX Mode: (xemacs)TeX Mode, for information on this mode.
246
247 texinfo-mode
248      Texinfo is a documentation system that uses a single source file to
249      produce both printed output and on-line documentation. When you
250      use this mode, there will be some special keybindings for
251      inserting some characters and executing some commands.
252
253      This info file which you are reading right now is produced by
254      'Texinfo'
255
256 outline-mode
257      Use this mode for editing outlines. When you enable this mode, you
258      can make part of the text temporarily invisible so that you can
259      see the overall structure of the outline. *Note Outline Mode:
260      (xemacs)Outline Mode, for information on this mode.
261
262 c-mode
263      Use this mode for C programs. It will redefine some indentation
264      commands. *Note C Indent: (xemacs)C Indent.
265
266 lisp-mode
267      Use this mode for Lisp programs. Look at the XEmacs User's Manual
268      for more information.
269
270 fortran-mode
271      Use this mode for Fortran programs. This mode provides special
272      commands to move around and some other indentation commands.  For
273      more information on this mode, *Note Fortran: (xemacs)Fortran.
274
275 edit-picture
276      This is the picture mode which you can use to create a picture out
277      of text characters. *Note Picture: (xemacs)Picture, for more
278      information.
279
280 asm-mode
281      Use asm-mode for editing files of assembler code. Look at the file
282      ` /usr/local/lib/xemacs-19.11/lisp/modes/asm.el' for more
283      information.
284
285    There are some other modes and commands for working with other kinds
286 of text or programs. Emacs also provides commands for reading and
287 sending Mail. For more information on these features look at the XEmacs
288 Manual. Emacs also provides the functions of a desk calendar, with a
289 diary of past or planned events. For more information on the calendar
290 mode look at the manual for Calendar Mode and Diary.
291
292 \1f
293 File: new-users-guide.info,  Node: Minor Modes,  Prev: Major Modes,  Up: Modes
294
295 Minor Modes
296 ===========
297
298    The minor modes in Emacs provide some optional features which you can
299 turn on or off. Any number of minor modes can be active at the same time
300 with any major mode. You can enable a minor mode in one buffer and
301 disable it in other mode. To enable a minor mode, for example the
302 font-lock mode type the following command:
303
304      M-x font-lock-mode
305
306 To enable the other minor modes, replace the "font-lock" with the name
307 of the minor mode. To disable the mode type the command again. A
308 positive argument will always turn the mode on. Whenever you type this
309 command, it will turn the mode on if it was off, OR it will turn it off
310 if it was on i.e. it toggles. Look at the mode-line at the bottom of the
311 frame. If it says FLock in parentheses, then it means that this mode is
312 on, otherwise it is off.
313
314    The following are some of the minor modes available in XEmacs. To
315 enable any one of them type "M-x" in front of them.
316
317 font-lock-mode
318      You can also choose this mode by selecting the Syntax Highlighting
319      menu item from the Options menu on the menu-bar at the top. If you
320      wish to have this mode enabled permanently, choose Save Options
321      from the Options menu. *Note Options Menu::, for more information
322      on the Options menu.  You can also add statements in your `.emacs'
323      file. For each major mode in which you wish to enable this minor
324      mode, you need a statement in your `.emacs' file. The following
325      example shows how to enable the font-lock mode when the major mode
326      is c-mode.
327
328           (add-hook 'c-mode-hook                'turn-on-font-lock)
329
330      *Note Other Customizations::.
331
332      When you enable this mode, the text will be displayed in different
333      colors and fonts depending on the type of the text. This makes the
334      text very easy to read and understand. For example, comments might
335      be displayed in red, variables in black, functions in blue and
336      other keywords in different colors and fonts. When you select More
337      from the Syntax Highlighting option, you get very detailed display
338      of colors and fonts; function names within comments themselves
339      might appear in a different font and color.
340
341 auto-fill-mode
342      Enabling this mode will provide automatic word-wrapping. The <SPC>
343      key will break lines i.e. insert newlines as you type to prevent
344      lines from becoming too long.
345
346 overwrite-mode
347      When you enable this mode, the text that you type will replace the
348      existing text rather than moving it to the right (the default
349      case). You can enable this mode by selecting Overstrike menu-item
350      from the Options menu from the menu-bar.
351
352 abbrev-mode
353      After you enable this mode, you can define words which will expand
354      into some different text i.e. you can define abbreviations. For
355      example, you might define "expand" to "expand will eventually
356      expand to this text". After this definition you will be able to
357      get "expand will eventually expand to this text" simply by typing
358
359           expand <SPC>
360
361      *Note Abbrevs: (xemacs)Abbrevs, for more information on this mode
362      and on defining abbreviations.
363
364 auto-save-mode
365      After you enable this mode in a buffer, the contents of that
366      buffer will be saved periodically. This will reduce the amount you
367      might lose in case of a system crash.
368
369 line-number-mode
370      After you enable this mode, the line number at which your cursor is
371      present will be displayed continously in the mode line.
372
373 blink-paren
374      To enable this command, just type
375           M-x blink-paren
376
377      Do not add the "-mode" to it.  You can also select the Paren
378      Highlighting option from the Options menu. After you enable this
379      command, put your cursor on one of the left parenthesis. The other
380      matching parenthesis will start blinking. *Note Options Menu::,
381      for more information on the Paren Highlighting option.
382
383    For information on some other modes, look at the XEmacs User's Manual
384 and the associated files.
385
386 \1f
387 File: new-users-guide.info,  Node: Files,  Next: Other Customizations,  Prev: Modes,  Up: Top
388
389 Files
390 *****
391
392    The basic unit of stored data in Unix is the "file".  To edit a file,
393 you must tell Emacs to read the file into a buffer. This is called
394 "visiting" the file. You can now edit the buffer and to save the
395 changes you must write the buffer back to the file.
396
397    In addition to visiting and saving files, Emacs can delete, copy,
398 rename, and append to files, and operate on file directories.
399
400 * Menu:
401
402 * File Names::                  How to type and edit file name arguments.
403 * Visiting::                    Visiting a file prepares Emacs to edit the file.
404 * Saving Files::                How to save Emacs files.
405
406 \1f
407 File: new-users-guide.info,  Node: File Names,  Next: Visiting,  Prev: Files,  Up: Files
408
409 File Names
410 ==========
411
412    Most of the Emacs commands that operate on a file require you to
413 specify a file name. For example, you might specify the file name
414 initially when you enter Emacs :
415
416      xemacs myfile RET
417
418 After you hit <RET>, you will enter XEmacs with "myfile" read into the
419 current buffer. If you do not specify the filename when entering Emacs,
420 you can use the Open... option from the File menu. You will be prompted
421 for a filename in the echo area:
422
423      Find file: /usr/workspace/
424
425 Type in a file name which you want to open after the "/" and hit <RET>.
426 The specified file will be read into the current buffer. The
427 "/usr/workspace" might be the "default directory". When Emacs prompts
428 you for a file, it uses the default-directory unless you specify a
429 directory. You can see what the default directory of the current buffer
430 is by using the Describe Variable option from the Help menu. When Emacs
431 prompts you for the variable name to describe, type DEFAULT-DIRECTORY.
432 If you wish to open a file in some other directory, use <DEL> or the
433 <BackSpace> key to go back and type the path name of the new directory.
434
435    You can create a new directory by typing `M-x make-directory'. This
436 command will prompt you for a directory name:
437
438      Create directory: /usr/workspace/
439
440 After you type a directory name and press <RET>, a new directory with
441 the specified name will be created. If you do not wish to create a new
442 directory, then simply press `C-g' to quit the command. Similarly, you
443 can also remove a directory by using the command `remove-directory'.
444 The command `M-x pwd' will print the current buffer's default
445 directory. For more information on file names, *Note File Names:
446 (xemacs)File Names.
447
448 \1f
449 File: new-users-guide.info,  Node: Visiting,  Next: Saving Files,  Prev: File Names,  Up: Files
450
451 Visiting Files
452 ==============
453
454    To edit a file in Emacs you need to "visit" it. "Visiting" a file
455 means copying its contents (or reading them) into the current buffer.
456 Emacs will create a new buffer for each file that you visit. The buffer
457 will be named after the file that you open. If you open a file
458 `/usr/workspace/myfile.texinfo', the buffer will be called
459 "myfile.texinfo". If a buffer with this name already exists, a unique
460 name will be constructed by appending `<2>', `<3>', etc. If this is the
461 second buffer with the same name, a "<2>" will be appended, "<3>" for a
462 third buffer and so on. The name of the buffer which is being displayed
463 in the window will be shown both at the top and bottom of the frame.
464 Once you are in XEmacs, you can use the following commands:
465
466 `C-x C-f'
467      This command will visit a file (`find-file'). It will prompt you
468      for a file name to visit. The Open... option from the File menu
469      does the same thing:
470
471           Find file: /usr/workspace/
472
473      Type in a filename and press <RET>. You will see a new buffer on
474      the screen with its name in the mode-line. If the filename you
475      specify already exists in Emacs, the buffer containing that file
476      will be selected. You will get an error message if the filename
477      does not exist. If you still press <RET>, a new buffer with the
478      given filename will be displayed on the screen.
479
480 `C-x C-v'
481      This command (`find-alternate-file'), will visit a different file
482      instead of the one visited last. It is similar to `C-c C-f' except
483      that it kills the current buffer (after offering to save it).
484
485 `C-x 5 C-f'
486      This command will visit a file in another frame
487      (`find-file-other-frame') without changing the current window or
488      frame. The Open in New Frame... from the File menu will do the
489      same thing. It will prompt you for a file name in the echo area.
490      After you type the file name and press <RET>, the specified file
491      will be read into a new buffer and displayed on a new frame.
492
493 \1f
494 File: new-users-guide.info,  Node: Saving Files,  Prev: Visiting,  Up: Files
495
496 Saving Files
497 ============
498
499    The changes that you make after visiting a file will not be saved
500 unless you save the buffer. When you save the buffer, Emacs writes the
501 current contents of the buffer into the visited file. Some commands to
502 save buffers are:
503
504 `C-x C-s'
505      This command will permanently save the current buffer in its
506      visited file (`save-buffer'). You will see the following message
507      in the echo area if you save a file called "myfile.texinfo" :
508
509           Wrote /usr/workspace/myfile.texinfo
510
511      Try using this command twice. You will get the above message the
512      first time you use this command, the second time you will get the
513      following message:
514
515           (No changes need to be saved)
516
517      This message indicates that you haven't made any changes since the
518      last time you saved the file.
519
520 `C-x s'
521      This command will save all the buffers in their visited files
522      (`save-some-buffers'). It will prompt you for typing yes or no:
523
524           Save file /usr/workspace/myfile.texinfo? (y or n)
525
526      You will get the above message for all the buffers. Type "y" if
527      you want to save the buffer.
528
529 `C-x C-w'
530      This command will prompt you for a file name and save the current
531      buffer in that file. (`write-file'). You will see the following
532      message in the echo area:
533
534           Write file: /usr/workspace/
535
536      After you type in a file name, press <RET>. The buffer will be
537      saved in a new file. You can make copies of a particular file
538      using this command.
539
540    You can also undo all the changes made since the file was visited or
541 saved by reading the text from the file again (called "reverting"). For
542 more information on this option, *Note Reverting: (xemacs)Reverting.
543
544    When you save a file in Emacs, it destroys its old contents. However,
545 if you set the variable MAKE-BACKUP-FILES to non-NIL i.e. `t', Emacs
546 will create a "backup" file. Select the Describe variable option from
547 the Help menu and look at the documentation for this variable. Its
548 default value should be `t'. However, if its not then use `M-x
549 set-variable' to set it to `t' (*note Setting Variables::.). The backup
550 file will contain the contents from the last time you visited the file.
551 Emacs also provides options for creating numbered backups. For more
552 information on backups, *Note Backup: (xemacs)Backup.
553
554    Emacs also saves all the files from time to time so that in case of a
555 system crash you don't lose lot of your work. You will see the message
556 `Auto-saving...' displayed in the echo area when the buffer is being
557 saved automatically. The auto saved files are named by putting the
558 character `#' in front and back. For example a file called
559 "myfile.texinfo" would be named as `#myfile.texinfo#'. For information
560 on controlling auto-saving and recovering data from auto-saving, *Note
561 Auto Save Files: (xemacs)Auto Save Files.
562
563    Emacs provides protection from simultaneous editing which occurs if
564 two users are visiting the same file and trying to save their changes.
565 It will put a lock on a file which is being visited and modified. If
566 any other user tries to modify that file, it will inform the user about
567 the lock and provide some options. For more information on protection
568 against simultaneous editing, *Note Interlocking: (xemacs)Interlocking.
569
570 \1f
571 File: new-users-guide.info,  Node: Other Customizations,  Next: Select and Move,  Prev: Files,  Up: Top
572
573 Other Customizations
574 ********************
575
576    You can modify the behavior of Emacs in minor ways permanently by
577 putting your changes in your `.emacs' file. This file contains Lisp
578 function call expressions. Each of these expressions will consist of a
579 function name followed by arguments, all surrounded by parentheses. For
580 example, to turn on the auto-fill-mode (i.e. break lines automatically
581 when they become too long) , put the following  line in your `.emacs'
582 file:
583
584      (add-hook 'text-mode-hook
585              '(lambda() (auto-fill-mode 1)))
586
587 Emacs has a function named "turn-on-auto-fill" which is defined as
588 "(lambda() (auto-fill-mode 1))". Therefore you can also write the above
589 as:
590
591      (add-hook 'text-mode-hook 'turn-on-auto-fill)
592
593 Emacs provides a number of hooks for the sake of customization. The hook
594 variables contain list of functions to be called with no arguments. To
595 turn on the auto-fill-mode, add the appropriate hook as shown in the
596 example above.
597
598    Similarly, to enable the "font-lock mode" which displays your
599 program in different fonts and colors(*note Modes::.), put the
600 following in your `.emacs' file. The comments above the statement
601 explain what the statements do.
602
603      ;;; enables the font-lock-mode in Lisp Mode
604      (add-hook 'lisp-mode-hook    'turn-on-font-lock)
605      
606      ;;; enables the font-lock-mode in Texinfo Mode
607      (add-hook 'texinfo-mode-hook    'turn-on-font-lock)
608      
609      ;;; enables the font-lock mode in C Mode
610      (add-hook 'c-mode-hook             'turn-on-font-lock)
611
612    To turn on the font-lock mode in other Major Modes like emacs-lisp,
613 just put the name of the mode with "-hook" appended to it as the middle
614 parameter in the above examples. You can also select the color that the
615 functions, comments or other keywords  should be displayed in :
616
617      ;;; the function names will now be displayed in blue color
618      (set-face-foreground 'font-lock-function-name-face "blue")
619      
620      ;;; the comments will be displayed in forest green
621       (set-face-foreground 'font-lock-comment-face "forest green")
622
623 For other customizations regarding the font-lock face, look at the file
624 `/usr/local/lib/xemacs-19.11/etc/sample.emacs'.
625
626 * Menu:
627
628 * Setting Variables::           Customizing Emacs variables
629 * Init File::                   Some examples of Lisp expressions in
630                                 .emacs file
631
632 \1f
633 File: new-users-guide.info,  Node: Setting Variables,  Next: Init File,  Prev: Other Customizations,  Up: Other Customizations
634
635 Other Customizations
636 ====================
637
638    In XEmacs, "variables" are used for internal record-keeping and
639 customizations. There are some variables called "options" which you can
640 use for customizations. To examine a variable use:
641
642      ;;; print the value and documentation of the variable, use either of the
643      ;;; following commands
644      C-h v
645      M-x describe variable
646
647    After you type any of the above commands, you will be prompted for a
648 variable name in the "echo area". Type in the name of the variable, for
649 example, type  CASE-FOLD-SEARCH <RET> Your window will split into two
650 and you will see the following message in that window:
651
652      case-fold-search's value is t
653      This value is specific to the current buffer.
654      
655      Documentation:
656      *Non-nil if searches should ignore case.
657      Automatically becomes buffer-local when set in any fashion.
658
659 Since this variable's value is 't' searches will ignore case. If you
660 want case-sensitive-search (i.e. if you are searching for "Foo" and you
661 do not want "foo" to be included in the search, you need to set this
662 variable to "nil". In order to do that, use:
663
664      M-x set-variable
665
666 Emacs will prompt you for the variable which you wish to set. Type in
667 "case-fold-search" and hit <RET>. You will see the following message:
668
669      Set case-fold-search to value:
670
671 Type "nil" and hit <RET>.  Now if you again use `M-x describe variable'
672 , you will see that the new value of case-fold-search will be "nil" and
673 your searches will be case-sensitive. This will be effective only for
674 that Emacs session. If you want to change the value of a variable
675 permanently put the following statement in your `.emacs' file :
676
677      (setq case-fold-search nil)
678
679 This statement will make searches case-sensitive only in the current
680 buffer which is the `.emacs' file. This will not be very useful. To
681 make searches case-sensitive globally in all buffers, use:
682
683      (setq-default case-fold-search nil)
684
685    If you want to change the value of any other variable, use :
686
687      (setq <variable-name> <new value>)
688
689 "setq" will assign the "new value" to the "variable-name" .
690
691    If you want a list of the "options" i.e. the variables available for
692 customization type:
693
694
695      ;;; displays a buffer listing names, values and documentation of options
696      M-x list-options
697      
698      ;;; displays options and allows you to edit those list of options
699      M-x edit-options
700
701 Try these options. If you are using edit-options to edit a variable,
702 just point at the variable you wish to edit and use one of the following
703 commands:
704
705 1
706      Set the value of the variable to t (non-nil).
707
708 0
709      Set the value of the variable to nil.
710
711 n
712      Move to the next variable.
713
714 p
715      Move to the previous variable.
716
717    There are some other options available to make the value of a
718 variable local to a buffer and then to switch to its global value. You
719 can also have a "local variables list" in a file which specifies the
720 values to use for certain Emacs variables when you edit that file.
721 *Note Variables: (xemacs)Variables, for information on these options.
722
723 \1f
724 File: new-users-guide.info,  Node: Init File,  Prev: Setting Variables,  Up: Other Customizations
725
726 Init File Examples
727 ==================
728
729    For customizing Emacs, you need to put Lisp expressions in your
730 `.emacs' file. The following are some useful Lisp expressions. If you
731 find any of them useful, just type them in your `.emacs' file:
732
733    * The following expression will make <TAB> in C mode insert a real
734      tab character if the cursor or point is in the middle of the line.
735      Now hitting the <TAB> key will indent a line only if the cursor is
736      at the left margin or in the line's indentation:
737
738           (setq c-tab-always-indent nil)
739
740      The value of the variable C-TAB-ALWAYS-INDENT is usually `t' for
741      `true'. When this variable is true, then hitting the <TAB> key
742      always indents the current line.
743
744    * This expression will turn on the AUTO-FILL-MODE when you are in
745      text mode:
746
747           (setq text-mode-hook 'turn-on-auto-fill)
748
749      This mode will automatically break lines when you type a space so
750      that the lines don't become too long. The length of the lines is
751      controlled by the variable FILL-COLUMN. You can set this variable
752      to a value you wish. Look at the documentation for this variable
753      to see its default value. To change the value to 75 for example,
754      use:
755
756           (setq-default fill-column 75)
757
758      This will change the value of this variable globally.
759
760    * The following expression will enable the use of EVAL-EXPRESSION
761      without confirmation:
762
763           (put 'eval-expression 'disabled nil)
764
765      Now when you use EVAL-EXPRESSION, it will print the value of the
766      expression you specify in the "echo area" without confirming with
767      you.
768
769    * This expression will remove the binding of `C-x C-c', because its
770      easy to hit this key by mistake and you will exit Emacs
771      unintentionally. You can use the Exit Emacs option from the File
772      menu to exit Emacs.
773
774           (global-set-key "\C-x\C-c" nil)
775
776      Now if you type `C-x C-c', you won't exit Emacs.
777
778    * The following expression will make the <BACKSPACE> and the <DEL>
779      key work in the same manner:
780
781           (global-set-key 'backspace [delete])
782
783    * This expression will make searches case sensitive:
784
785           (setq-default case-fold-search nil)
786
787      If we use "setq" instead of "setq-default" then searches will be
788      case-sensitive only in the current buffer's local value. In this
789      case the buffer would be the `.emacs' file. Since this would not
790      be too helpful and we want to have case-sensitive searches in all
791      buffers, we have to use "setq-default".
792
793    * This expression will enable the font-lock mode when you are using
794      texinfo mode:
795
796           (add-hook 'texinfo-mode-hook 'turn-on-font-lock)
797
798      *Note Minor Modes::, for information on font-lock mode.
799
800    * Rebinds the key `C-x l' to run the function `make-symbolic-link':
801
802           (global-set-key "\C-xl" 'make-symbolic-link)
803
804      We use the single quote before "make-symbolic-link" because its a
805      function name. You can also use the following expression which
806      does the same thing:
807
808           (define-key global-map "C-xl" 'make-symbolic-link)
809
810    * The following expression will bind `C-x l' to run the function
811      `make-symbolic-link' in C mode only:
812
813           (define-key c-mode-map "C-xl" 'make-symbolic-link)
814
815      Instead of binding `C-xl' to run `make-symbolic-link', you can
816      bind the <F1> key to run this function:
817
818           (define-key c-mode-map 'f1 'make-symbolic-link)
819
820      Here, you have to use lower case for naming function keys like
821      <F1>.
822
823    * You can bind the function `undo' i.e. `C-x u' to any key, for
824      example to <F2>:
825
826           (global-set-key 'f2 'undo)
827
828    * The following statement will display the current time in the
829      modeline of the buffer:
830
831           (display-time)
832
833    * This displays the current line number on which the cursor is
834      present in the modeline:
835
836           (setq line-number-mode t)
837
838    * If you don't want the text to be highlighted when you use commands
839      for marking regions so as to use the "kill" and "yank" commands
840      later, you can use the following expression in your `.emacs' file:
841
842           (setq zmacs-regions nil)
843
844      Now if you use a command like `C-x C-p' (`mark-page'), the text
845      will not be highlighted.
846
847    * To control the number of buffers listed when you select the Buffers
848      menu, you need to set the variable BUFFERS-MENU-MAX-SIZE to
849      whatever value you wish. For example, if you want 20 buffers to be
850      listed when you select Buffers use:
851
852           (setq buffers-menu-max-size 20)
853
854    * If you want the window title area to display the full
855      directory/name of the current buffer's file, and not just the
856      name, use:
857
858           (setq frame-title-format "%S: %f")
859
860    * To get rid of the menu, use :
861
862           (set-menubar nil)
863
864    * If you want an extensive menu-bar use the following expression in
865      your `.emacs' file.
866
867           (load "big-menubar")
868
869      If you want to write your own menus, you can look at some of the
870      examples in
871      `/usr/local/lib/xemacs-20.0/lisp/packages/big-menubar.el' file.
872
873    For more information on initializing your `.emacs' file, *Note Init
874 File: (xemacs)Init File. You should also look at
875 `/usr/local/lib/xemacs-20.0/etc/sample.emacs', which is a sample
876 `.emacs' file. It contains some of the commonly desired customizations
877 in Emacs.
878
879 \1f
880 File: new-users-guide.info,  Node: Select and Move,  Next: Search and Replace,  Prev: Other Customizations,  Up: Top
881
882 Selecting and Moving Text
883 *************************
884
885    Many Emacs commands operate on an arbitrary contiguous part of the
886 current buffer. You can select some part of the buffer and edit only
887 that part of the buffer. This selected buffer is called a "region". You
888 can select text in two ways:
889
890    * You use special keys to select text by defining a region between
891      the cursor and "the mark" (which you set).
892
893    * If you are running XEmacs under X, you can also select text with
894      the mouse.
895
896 * Menu:
897
898 * Selecting Text::              Select a region of text by setting the Mark
899 * Mouse::                       Selecting Text with Mouse
900 * Region Operation::            Various ways to operate on a selected text
901 * Moving Text::                 Moving Text
902 * Accumulating text::           Accumulating Text from several buffers
903
904 \1f
905 File: new-users-guide.info,  Node: Selecting Text,  Next: Mouse,  Prev: Select and Move,  Up: Select and Move
906
907 Setting the Mark
908 ================
909
910    To define a region you need to set "the mark" at one end of it and
911 move the cursor to the other end. Once you set the mark, it remains
912 there until you set it again to some other place. Each buffer has its
913 own "mark ring" (a place where Emacs remembers 16 previous locations of
914 the mark). To set "the mark", you can use the following commands:
915
916 `C-<SPC>'
917      This command will set "the mark" at the position of your cursor
918      (`set-mark-command').  You can move your cursor around and "the
919      mark" will stay there.
920
921 `C-x C-x'
922      Interchange mark and point (`exchange-point-and-mark'). Since Emacs
923      will have only one cursor, after you move the cursor it will be
924      unable to show you where you set the "the mark". In order to see
925      "the mark" you can type the command `C-x C-x' which will put your
926      cursor on the position of your mark and your mark on the position
927      of your cursor. Use the command again to reset the positions of
928      your cursor and mark.
929
930 `C-<'
931      This command will push the mark at the beginning of the buffer
932      without changing the position of your cursor.
933
934 `C->'
935      This command will push the mark at the end of the buffer without
936      changing the position of your cursor.
937
938 You can also give arguments to `C-<' or `C->'. *Note The Mark and the
939 Region: (xemacs)The Mark and the Region, for more information.
940
941 \1f
942 File: new-users-guide.info,  Node: Mouse,  Next: Region Operation,  Prev: Selecting Text,  Up: Select and Move
943
944 Selecting Text with Mouse
945 =========================
946
947    If you are using XEmacs under X, you can use the mouse to select
948 text. The selected text will always be highlighted, so just by looking
949 at the text you know what you have selected so far. To select a word
950 just double-click with the left-mouse-button on the word. To select a
951 whole line triple-click anywhere on the line with the
952 left-mouse-button. You can also use the Copy item from the Edit menu on
953 the menu-bar to select text. This kind of selection is called Clipboard
954 selection, *Note X Clipboard Selection: (xemacs)X Clipboard Selection,
955 for more information. To select an arbitrary region, follow these steps:
956
957   1. Move the mouse cursor over the character at the beginning of the
958      region of text you want to select.
959
960   2. Press and hold the left mouse button.
961
962   3. While holding the left mouse button down, drag the cursor to the
963      character at the end of the region of text you want to select.
964
965   4. Release the left mouse button.
966         The selected region of text is highlighted.
967
968    *Note Selecting Text with the Mouse: (xemacs)Selecting Text with the
969 Mouse, for more information regarding the Mouse and additional mouse
970 operations.
971
972 \1f
973 File: new-users-guide.info,  Node: Region Operation,  Next: Moving Text,  Prev: Mouse,  Up: Select and Move
974
975 Operating on the Region
976 =======================
977
978    Once you have selected a region you can do a lot of things to the
979 text in the region:
980    * Kill the text with `C-w'. For example if you want to kill a
981      paragraph, position the cursor to the beginning of the paragraph
982      and type `C-SPC'. Then go to the end of the paragraph and type
983      `C-w'. The entire paragraph will be deleted. You can also select
984      the text with a mouse and type `C-w' to kill the entire region.
985      *Note Killing: (xemacs)Killing, for more information.
986
987    * Save the text in a buffer or a file (*note Accumulating Text:
988      (xemacs)Accumulating Text.).
989
990    * You can convert the case of the text with `C-x C-l' or `C-x C-u'
991      If you type `C-x C-u' the selected text will become all
992      upper-case. If you type `C-x C-l' the selected text will become all
993      lower-case.
994
995    * Print hardcopy with `M-x print-region'. *Note Hardcopy:
996      (xemacs)Hardcopy, for more information. This command will print a
997      hardcopy of only the selected text.
998
999    * Indent it with `C-x <TAB>' or `C-M-\' *Note Indentation:
1000      (xemacs)Indentation, for more information.
1001
1002 \1f
1003 File: new-users-guide.info,  Node: Moving Text,  Next: Accumulating text,  Prev: Region Operation,  Up: Select and Move
1004
1005 Moving Text
1006 ===========
1007
1008    The most common way to move or copy text in Emacs is through
1009 "killing" or `cutting' it and then "yanking" or `pasting' it. You can
1010 also use the Cut or Copy option from the Edit menu for killing and
1011 copying respectively. *Note Edit menu::, for reviewing the commands for
1012 killing text. All the killed text in Emacs is recorded in the "kill
1013 ring". Since there is only one kill ring in Emacs, you can kill text in
1014 one buffer and yank it in another buffer. To `paste' or `yank' the
1015 killed text you can use the following commands:
1016 `C-y'
1017      This command will yank or paste the last killed text (`yank').
1018
1019 `M-w'
1020      Save region as last killed text without actually killing it
1021      (`copy-region-as-kill'). You can use this command to copy a
1022      selected region and then yank (or paste) it without actually
1023      removing it from the buffer.
1024
1025 `C-M-w'
1026      Append next kill to last batch of killed text
1027      (`append-next-kill'). This command will append whatever you killed
1028      last to what you kill now. Then later you will be able to yank the
1029      entire appended text from the "kill ring".
1030
1031 \1f
1032 File: new-users-guide.info,  Node: Accumulating text,  Prev: Moving Text,  Up: Select and Move
1033
1034 Accumulating Text
1035 =================
1036
1037    The following commands can be used for accumulating text from
1038 different buffers into one place or for copying one region of text into
1039 many buffers:
1040
1041 `M-x append-to-buffer'
1042      Append region to contents of specified buffer
1043      (`append-to-buffer'). After you type in this command and press
1044      <RET>, Emacs will prompt you for a buffer name. You will see a
1045      message in the echo area:
1046           Append to buffer: (default <buffer name>)
1047
1048      After you type in a buffer name, a copy of the region will be
1049      inserted at the location of the cursor into that buffer. If there
1050      is no buffer with the name given by you, Emacs will create a new
1051      buffer with that name. By default the cursor's position in the
1052      <buffer name> is at the end.
1053
1054 `M-x prepend-to-buffer'
1055      Prepend region to contents of specified buffer. This command is
1056      similar to the above command except that the cursor in the buffer
1057      (by default) is at the beginning rather than at the end.
1058
1059 `M-x copy-to-buffer'
1060      Copy region into specified buffer, deleting that buffer's old
1061      contents. This command will also prompt you for a buffer name.
1062
1063 `M-x insert-buffer'
1064      Insert contents of specified buffer into current buffer at point.
1065      This command will prompt you for a buffername which you want to be
1066      copied into the current buffer at the location of the cursor.
1067
1068 `M-x append-to-file'
1069      This command will prompt you for a filename and append the region
1070      to the end of the contents of the specified file.
1071
1072 *Note Accumulating Text: (xemacs)Accumulating Text, for more
1073 information regarding this topic.
1074
1075    You can also use "rectangle commands" for operating on rectangular
1076 areas of text. *Note Rectangles: (xemacs)Rectangles, for more
1077 information regarding rectangle commands.
1078
1079    Emacs also provides "registers" which serve as temporary storage for
1080 text or positions. Each register has a one character name and they can
1081 store "regions", a "rectangle", or a "mark" i.e. a cursor position.
1082 Whatever you store in register stays there until you store something
1083 else in that register. To find out about commands which manipulate
1084 registers *Note Registers: (xemacs)Registers.
1085
1086 \1f
1087 File: new-users-guide.info,  Node: Search and Replace,  Prev: Select and Move,  Up: Top
1088
1089 Searching and Replacing
1090 ***********************
1091
1092    Emacs provides commands for searching for occurrences of a particular
1093 string. The search is incremental i.e. it begins even before you
1094 complete typing the whole string. All searches in Emacs ignore the case
1095 of the text they are searching, i.e. if you are searching for "String",
1096 then "string" will also be one of the selections. If you want a case
1097 sensitive search select the Case Sensitive Search from the Option menu.
1098 You can also set the variable CASE-FOLD-SEARCH to NIL for making
1099 searches case-sensitive. For information on setting variables, *Note
1100 Setting Variables::. The two commands for searching for strings in
1101 XEmacs are:
1102
1103 `C-s'
1104      This command will prompt you for a string to search :
1105
1106           I-search:
1107
1108      If you type "myname" as the string to be searched, then Emacs will
1109      start searching for "m", "my", "myn", etc as you go on typing the
1110      whole string in the forward direction. The cursor will be on the
1111      matching string which has been found so far. If you find the
1112      correct match just hit <RET> or type `C-f' or `C-b' to set the
1113      cursor's position. If you find a matching string "myname" but you
1114      were looking for a different occurrence of it, use `C-s' again. If
1115      the search is unable to find the string, it will give you an error
1116      message.
1117
1118 `C-r'
1119      This command will perform an incremental search in the backward
1120      direction. It will prompt you for a string name:
1121
1122           I-search backward:
1123
1124      After you start typing the string name, it will search for the
1125      string in the same fashion as it does for `C-s' except that it
1126      will search in the backward direction. If it cannot find the
1127      string name, it will give you an error message.
1128
1129    If you make a mistake while typing the string names when you use the
1130 above commands, you can use the <DEL> key to erase characters. Each
1131 <DEL> will erase the last character. At any time if you want to quit
1132 the search, just type `C-g'.
1133
1134    To do a non-incremental search i.e. to start the search only after
1135 you have typed the whole string you can use the following commands:
1136
1137 `C-s RET "string" RET'
1138      This command will search for the specified string in the forward
1139      direction and will give an error message if the string is not
1140      found.
1141
1142 `C-r RET "string" RET'
1143      This command will search for the specified string in the backward
1144      direction.
1145
1146    For information on how Emacs searches for words and regular
1147 expressions, *Note Search: (xemacs)Search.
1148
1149    To replace all occurrences of a string in Emacs, you can use the
1150 following command:
1151      M-x replace-string
1152
1153 After you type `M-x replace-string', you will be prompted for a string
1154 name to replace:
1155
1156      Replace string:
1157
1158 After you type in a string name, for example "FOO" and press <RET>, you
1159 will see another prompt:
1160
1161      Replace string FOO with:
1162
1163 Now type the string which you want to replace "FOO" with and press
1164 <RET>. After all the occurrences are replaced you will see the message
1165 "Done" in the echo area.  If you want only some occurrences of the
1166 string to be replaced, use `M-x query-replace RET <string> RET
1167 <newstring> RET'. For more information, *Note Query Replace:
1168 (xemacs)Query Replace.
1169
1170    XEmacs also provides a utility for checking spellings. Use `M-x
1171 ispell-buffer' to check for spellings in the whole buffer. You can also
1172 check the spelling of a word or a region. You can use menus to check
1173 for spellings:
1174
1175 Evaluate the expression `(load "big-menubar")'. To evaluate this
1176 expression you need to hit the <META> or the <ESC> key twice and type
1177 in the expression in the echo area before hitting <RET>. You will get
1178 an extensive menubar. Select the Spell Check menu item from the
1179 Utilities menu for checking spellings.
1180
1181 \1f
1182 File: new-users-guide.info,  Node: Key Index,  Next: Command Index,  Prev: Intro,  Up: Top
1183
1184 Key (Character) Index
1185 *********************
1186
1187 * Menu:
1188
1189 * C-<:                                   Selecting Text.
1190 * C->:                                   Selecting Text.
1191 * C-a:                                   Cursor Position.
1192 * C-b:                                   Cursor Position.
1193 * C-d:                                   Erase.
1194 * C-e:                                   Cursor Position.
1195 * C-fx:                                  Cursor Position.
1196 * C-g:                                   The Help Menu.
1197 * C-h d:                                 The Help Menu.
1198 * C-h k:                                 The Help Menu.
1199 * C-h t:                                 Edit.
1200 * C-k:                                   Erase.
1201 * C-M-\:                                 Region Operation.
1202 * C-n:                                   Cursor Position.
1203 * C-p:                                   Cursor Position.
1204 * C-r:                                   Search and Replace.
1205 * C-s:                                   Search and Replace.
1206 * C-SPC <1>:                             Selecting Text.
1207 * C-SPC:                                 Region Operation.
1208 * C-t:                                   Cursor Position.
1209 * C-u:                                   Numeric Argument.
1210 * C-v:                                   Cursor Position.
1211 * C-w:                                   Region Operation.
1212 * C-x 0:                                 XEmacs Window.
1213 * C-x 1:                                 XEmacs Window.
1214 * C-x 2:                                 XEmacs Window.
1215 * C-x 3:                                 XEmacs Window.
1216 * C-x 4:                                 XEmacs Window.
1217 * C-x 4 b:                               XEmacs Window.
1218 * C-x 4 d:                               XEmacs Window.
1219 * C-x 4 f:                               XEmacs Window.
1220 * C-x 4 m:                               XEmacs Window.
1221 * C-x 5 C-f:                             Visiting.
1222 * C-x C-c:                               Exiting.
1223 * C-x C-f:                               Visiting.
1224 * C-x C-l:                               Region Operation.
1225 * C-x C-s:                               Saving Files.
1226 * C-x C-u:                               Region Operation.
1227 * C-x C-v:                               Visiting.
1228 * C-x C-w:                               Saving Files.
1229 * C-x C-x:                               Selecting Text.
1230 * C-x s:                                 Saving Files.
1231 * C-x TAB:                               Region Operation.
1232 * C-x u:                                 Undo.
1233 * C-y:                                   Moving Text.
1234 * C-z:                                   Exiting.
1235 * DEL:                                   Insert.
1236 * M--:                                   Numeric Argument.
1237 * M-<:                                   Cursor Position.
1238 * M->:                                   Cursor Position.
1239 * M-C-v:                                 XEmacs Window.
1240 * M-d:                                   Erase.
1241 * M-DEL:                                 Erase.
1242 * M-k:                                   Erase.
1243 * M-v:                                   Cursor Position.
1244 * M-z:                                   Erase.
1245 * RET:                                   Insert.
1246