home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / emacsinf.zip / emacs.inf (.txt) < prev    next >
OS/2 Help File  |  1994-01-21  |  602KB  |  17,490 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Title page ΓòÉΓòÉΓòÉ
  3.  
  4.                                 GNU Emacs Manual
  5.  
  6.                         Eighth Edition, Emacs version 19
  7.  
  8.                                  for Unix Users
  9.  
  10.                                     June 1993
  11.  
  12.                                 Richard Stallman
  13.  
  14. Copyright (C) 1985, 1986, 1987, 1993 Free Software Foundation, Inc. 
  15.  
  16. Eighth Edition 
  17. For Emacs Version 19, 
  18. Printed June, 1993. 
  19.  
  20. ISBN 1-882114-02-7 
  21.  
  22. Published by the Free Software Foundation 
  23. 675 Massachusetts Avenue 
  24. Cambridge, MA 02139 USA 
  25.  
  26. Permission is granted to make and distribute verbatim copies of this manual 
  27. provided the copyright notice and this permission notice are preserved on all 
  28. copies. 
  29.  
  30. Permission is granted to copy and distribute modified versions of this manual 
  31. under the conditions for verbatim copying, provided also that the sections 
  32. entitled ``The GNU Manifesto'', ``Distribution'' and ``GNU Emacs General Public 
  33. License'' are included exactly as in the original, and provided that the entire 
  34. resulting derived work is distributed under the terms of a permission notice 
  35. identical to this one. 
  36.  
  37. Permission is granted to copy and distribute translations of this manual into 
  38. another language, under the above conditions for modified versions, except that 
  39. the sections entitled ``The GNU Manifesto'', ``Distribution'' and ``GNU Emacs 
  40. General Public License'' may be included in a translation approved by the Free 
  41. Software Foundation instead of in the original English. 
  42.  
  43.  
  44. ΓòÉΓòÉΓòÉ 2. Top ΓòÉΓòÉΓòÉ
  45.  
  46. The Emacs Editor **************** 
  47.  
  48. Emacs is the extensible, customizable, self-documenting real-time display 
  49. editor.  This Info file describes how to edit with Emacs and some of how to 
  50. customize it, but not how to extend it.  It corresponds to GNU Emacs version 
  51. 19.17. 
  52.  
  53.  
  54. ΓòÉΓòÉΓòÉ 3. Distribution ΓòÉΓòÉΓòÉ
  55.  
  56. GNU Emacs is free; this means that everyone is free to use it and free to 
  57. redistribute it on certain conditions.  GNU Emacs is not in the public domain; 
  58. it is copyrighted and there are restrictions on its distribution, but these 
  59. restrictions are designed to permit everything that a good cooperating citizen 
  60. would want to do.  What is not allowed is to try to prevent others from further 
  61. sharing any version of GNU Emacs that they might get from you.  The precise 
  62. conditions are found in the GNU Emacs General Public License that comes with 
  63. Emacs and also appears following this section. 
  64.  
  65. The easiest way to get a copy of GNU Emacs is from someone else who has it. 
  66. You need not ask for permission to do so, or tell any one else; just copy it. 
  67. If you have access to the Internet, you can get the latest distribution version 
  68. of GNU Emacs from host `prep.ai.mit.edu' using anonymous login.  See the file 
  69. `/pub/gnu/GETTING.GNU.SOFTWARE' on that host to find out about your options for 
  70. copying and which files to use. 
  71.  
  72. You may also receive GNU Emacs when you buy a computer.  Computer manufacturers 
  73. are free to distribute copies on the same terms that apply to everyone else. 
  74. These terms require them to give you the full sources, including whatever 
  75. changes they may have made, and to permit you to redistribute the GNU Emacs 
  76. received from them under the usual terms of the General Public License.  In 
  77. other words, the program must be free for you when you get it, not just free 
  78. for the manufacturer. 
  79.  
  80. You can also order copies of GNU Emacs from the Free Software Foundation, on 
  81. various magnetic media or on CD-ROM.  This is a convenient and reliable way to 
  82. get a copy; it is also a good way to help fund our work.  (The Foundation has 
  83. always received most of its funds in this way.)  An order form is included at 
  84. the end of manuals printed by the Foundation.  It is also included in the file 
  85. `etc/ORDERS' in the Emacs distribution.  For further information, write to 
  86.  
  87. Free Software Foundation
  88. 675 Mass Ave
  89. Cambridge, MA 02139
  90. USA
  91.  
  92. The income from distribution fees goes to support the foundation's purpose: the 
  93. development of new free software, and improvements to our existing programs 
  94. including GNU Emacs. 
  95.  
  96. If you find GNU Emacs useful, please *send a donation* to the Free Software 
  97. Foundation to support our work.  Donations to the Free Software Foundation are 
  98. tax deductible.  If you use GNU Emacs at your workplace, suggest that the 
  99. company make a donation.  If the management of your office opposes the idea of 
  100. donations, you might instead suggest ordering a CD-ROM from the Foundation 
  101. occasionally. 
  102.  
  103.  
  104. ΓòÉΓòÉΓòÉ 4. GNU GENERAL PUBLIC LICENSE ΓòÉΓòÉΓòÉ
  105.  
  106.                               Version 2, June 1991
  107.  
  108. Copyright (C) 1989, 1991 Free Software Foundation, Inc.
  109. 675 Mass Ave, Cambridge, MA 02139, USA
  110.  
  111. Everyone is permitted to copy and distribute verbatim copies
  112. of this license document, but changing it is not allowed.
  113.  
  114.  
  115. ΓòÉΓòÉΓòÉ 4.1. Preamble ΓòÉΓòÉΓòÉ
  116.  
  117.  The licenses for most software are designed to take away your freedom to share 
  118. and change it.  By contrast, the GNU General Public License is intended to 
  119. guarantee your freedom to share and change free software---to make sure the 
  120. software is free for all its users.  This General Public License applies to 
  121. most of the Free Software Foundation's software and to any other program whose 
  122. authors commit to using it.  (Some other Free Software Foundation software is 
  123. covered by the GNU Library General Public License instead.)  You can apply it 
  124. to your programs, too. 
  125.  
  126.  When we speak of free software, we are referring to freedom, not price.  Our 
  127. General Public Licenses are designed to make sure that you have the freedom to 
  128. distribute copies of free software (and charge for this service if you wish), 
  129. that you receive source code or can get it if you want it, that you can change 
  130. the software or use pieces of it in new free programs; and that you know you 
  131. can do these things. 
  132.  
  133.  To protect your rights, we need to make restrictions that forbid anyone to 
  134. deny you these rights or to ask you to surrender the rights. These restrictions 
  135. translate to certain responsibilities for you if you distribute copies of the 
  136. software, or if you modify it. 
  137.  
  138.  For example, if you distribute copies of such a program, whether gratis or for 
  139. a fee, you must give the recipients all the rights that you have.  You must 
  140. make sure that they, too, receive or can get the source code.  And you must 
  141. show them these terms so they know their rights. 
  142.  
  143.  We protect your rights with two steps: (1) copyright the software, and (2) 
  144. offer you this license which gives you legal permission to copy, distribute 
  145. and/or modify the software. 
  146.  
  147.  Also, for each author's protection and ours, we want to make certain that 
  148. everyone understands that there is no warranty for this free software.  If the 
  149. software is modified by someone else and passed on, we want its recipients to 
  150. know that what they have is not the original, so that any problems introduced 
  151. by others will not reflect on the original authors' reputations. 
  152.  
  153.  Finally, any free program is threatened constantly by software patents.  We 
  154. wish to avoid the danger that redistributors of a free program will 
  155. individually obtain patent licenses, in effect making the program proprietary. 
  156. To prevent this, we have made it clear that any patent must be licensed for 
  157. everyone's free use or not licensed at all. 
  158.  
  159.  The precise terms and conditions for copying, distribution and modification 
  160. follow. 
  161.  
  162.          TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  163.  
  164.  1. This License applies to any program or other work which contains a notice 
  165.     placed by the copyright holder saying it may be distributed under the terms 
  166.     of this General Public License.  The ``Program'', below, refers to any such 
  167.     program or work, and a ``work based on the Program'' means either the 
  168.     Program or any derivative work under copyright law: that is to say, a work 
  169.     containing the Program or a portion of it, either verbatim or with 
  170.     modifications and/or translated into another language.  (Hereinafter, 
  171.     translation is included without limitation in the term ``modification''.) 
  172.     Each licensee is addressed as ``you''. 
  173.  
  174.     Activities other than copying, distribution and modification are not 
  175.     covered by this License; they are outside its scope.  The act of running 
  176.     the Program is not restricted, and the output from the Program is covered 
  177.     only if its contents constitute a work based on the Program (independent of 
  178.     having been made by running the Program). Whether that is true depends on 
  179.     what the Program does. 
  180.  
  181.  2. You may copy and distribute verbatim copies of the Program's source code as 
  182.     you receive it, in any medium, provided that you conspicuously and 
  183.     appropriately publish on each copy an appropriate copyright notice and 
  184.     disclaimer of warranty; keep intact all the notices that refer to this 
  185.     License and to the absence of any warranty; and give any other recipients 
  186.     of the Program a copy of this License along with the Program. 
  187.  
  188.     You may charge a fee for the physical act of transferring a copy, and you 
  189.     may at your option offer warranty protection in exchange for a fee. 
  190.  
  191.  3. You may modify your copy or copies of the Program or any portion of it, 
  192.     thus forming a work based on the Program, and copy and distribute such 
  193.     modifications or work under the terms of Section 1 above, provided that you 
  194.     also meet all of these conditions: 
  195.  
  196.     a. You must cause the modified files to carry prominent notices stating 
  197.        that you changed the files and the date of any change. 
  198.  
  199.     b. You must cause any work that you distribute or publish, that in whole or 
  200.        in part contains or is derived from the Program or any part thereof, to 
  201.        be licensed as a whole at no charge to all third parties under the terms 
  202.        of this License. 
  203.  
  204.     c. If the modified program normally reads commands interactively when run, 
  205.        you must cause it, when started running for such interactive use in the 
  206.        most ordinary way, to print or display an announcement including an 
  207.        appropriate copyright notice and a notice that there is no warranty (or 
  208.        else, saying that you provide a warranty) and that users may 
  209.        redistribute the program under these conditions, and telling the user 
  210.        how to view a copy of this License.  (Exception: if the Program itself 
  211.        is interactive but does not normally print such an announcement, your 
  212.        work based on the Program is not required to print an announcement.) 
  213.  
  214.     These requirements apply to the modified work as a whole.  If identifiable 
  215.     sections of that work are not derived from the Program, and can be 
  216.     reasonably considered independent and separate works in themselves, then 
  217.     this License, and its terms, do not apply to those sections when you 
  218.     distribute them as separate works.  But when you distribute the same 
  219.     sections as part of a whole which is a work based on the Program, the 
  220.     distribution of the whole must be on the terms of this License, whose 
  221.     permissions for other licensees extend to the entire whole, and thus to 
  222.     each and every part regardless of who wrote it. 
  223.  
  224.     Thus, it is not the intent of this section to claim rights or contest your 
  225.     rights to work written entirely by you; rather, the intent is to exercise 
  226.     the right to control the distribution of derivative or collective works 
  227.     based on the Program. 
  228.  
  229.     In addition, mere aggregation of another work not based on the Program with 
  230.     the Program (or with a work based on the Program) on a volume of a storage 
  231.     or distribution medium does not bring the other work under the scope of 
  232.     this License. 
  233.  
  234.  4. You may copy and distribute the Program (or a work based on it, under 
  235.     Section 2) in object code or executable form under the terms of Sections 1 
  236.     and 2 above provided that you also do one of the following: 
  237.  
  238.     a. Accompany it with the complete corresponding machine-readable source 
  239.        code, which must be distributed under the terms of Sections 1 and 2 
  240.        above on a medium customarily used for software interchange; or, 
  241.  
  242.     b. Accompany it with a written offer, valid for at least three years, to 
  243.        give any third party, for a charge no more than your cost of physically 
  244.        performing source distribution, a complete machine-readable copy of the 
  245.        corresponding source code, to be distributed under the terms of Sections 
  246.        1 and 2 above on a medium customarily used for software interchange; or, 
  247.  
  248.     c. Accompany it with the information you received as to the offer to 
  249.        distribute corresponding source code.  (This alternative is allowed only 
  250.        for noncommercial distribution and only if you received the program in 
  251.        object code or executable form with such an offer, in accord with 
  252.        Subsection b above.) 
  253.  
  254.     The source code for a work means the preferred form of the work for making 
  255.     modifications to it.  For an executable work, complete source code means 
  256.     all the source code for all modules it contains, plus any associated 
  257.     interface definition files, plus the scripts used to control compilation 
  258.     and installation of the executable.  However, as a special exception, the 
  259.     source code distributed need not include anything that is normally 
  260.     distributed (in either source or binary form) with the major components 
  261.     (compiler, kernel, and so on) of the operating system on which the 
  262.     executable runs, unless that component itself accompanies the executable. 
  263.  
  264.     If distribution of executable or object code is made by offering access to 
  265.     copy from a designated place, then offering equivalent access to copy the 
  266.     source code from the same place counts as distribution of the source code, 
  267.     even though third parties are not compelled to copy the source along with 
  268.     the object code. 
  269.  
  270.  5. You may not copy, modify, sublicense, or distribute the Program except as 
  271.     expressly provided under this License.  Any attempt otherwise to copy, 
  272.     modify, sublicense or distribute the Program is void, and will 
  273.     automatically terminate your rights under this License. However, parties 
  274.     who have received copies, or rights, from you under this License will not 
  275.     have their licenses terminated so long as such parties remain in full 
  276.     compliance. 
  277.  
  278.  6. You are not required to accept this License, since you have not signed it. 
  279.     However, nothing else grants you permission to modify or distribute the 
  280.     Program or its derivative works.  These actions are prohibited by law if 
  281.     you do not accept this License.  Therefore, by modifying or distributing 
  282.     the Program (or any work based on the Program), you indicate your 
  283.     acceptance of this License to do so, and all its terms and conditions for 
  284.     copying, distributing or modifying the Program or works based on it. 
  285.  
  286.  7. Each time you redistribute the Program (or any work based on the Program), 
  287.     the recipient automatically receives a license from the original licensor 
  288.     to copy, distribute or modify the Program subject to these terms and 
  289.     conditions.  You may not impose any further restrictions on the recipients' 
  290.     exercise of the rights granted herein. You are not responsible for 
  291.     enforcing compliance by third parties to this License. 
  292.  
  293.  8. If, as a consequence of a court judgment or allegation of patent 
  294.     infringement or for any other reason (not limited to patent issues), 
  295.     conditions are imposed on you (whether by court order, agreement or 
  296.     otherwise) that contradict the conditions of this License, they do not 
  297.     excuse you from the conditions of this License.  If you cannot distribute 
  298.     so as to satisfy simultaneously your obligations under this License and any 
  299.     other pertinent obligations, then as a consequence you may not distribute 
  300.     the Program at all.  For example, if a patent license would not permit 
  301.     royalty-free redistribution of the Program by all those who receive copies 
  302.     directly or indirectly through you, then the only way you could satisfy 
  303.     both it and this License would be to refrain entirely from distribution of 
  304.     the Program. 
  305.  
  306.     If any portion of this section is held invalid or unenforceable under any 
  307.     particular circumstance, the balance of the section is intended to apply 
  308.     and the section as a whole is intended to apply in other circumstances. 
  309.  
  310.     It is not the purpose of this section to induce you to infringe any patents 
  311.     or other property right claims or to contest validity of any such claims; 
  312.     this section has the sole purpose of protecting the integrity of the free 
  313.     software distribution system, which is implemented by public license 
  314.     practices.  Many people have made generous contributions to the wide range 
  315.     of software distributed through that system in reliance on consistent 
  316.     application of that system; it is up to the author/donor to decide if he or 
  317.     she is willing to distribute software through any other system and a 
  318.     licensee cannot impose that choice. 
  319.  
  320.     This section is intended to make thoroughly clear what is believed to be a 
  321.     consequence of the rest of this License. 
  322.  
  323.  9. If the distribution and/or use of the Program is restricted in certain 
  324.     countries either by patents or by copyrighted interfaces, the original 
  325.     copyright holder who places the Program under this License may add an 
  326.     explicit geographical distribution limitation excluding those countries, so 
  327.     that distribution is permitted only in or among countries not thus 
  328.     excluded.  In such case, this License incorporates the limitation as if 
  329.     written in the body of this License. 
  330.  
  331. 10. The Free Software Foundation may publish revised and/or new versions of the 
  332.     General Public License from time to time.  Such new versions will be 
  333.     similar in spirit to the present version, but may differ in detail to 
  334.     address new problems or concerns. 
  335.  
  336.     Each version is given a distinguishing version number.  If the Program 
  337.     specifies a version number of this License which applies to it and ``any 
  338.     later version'', you have the option of following the terms and conditions 
  339.     either of that version or of any later version published by the Free 
  340.     Software Foundation.  If the Program does not specify a version number of 
  341.     this License, you may choose any version ever published by the Free 
  342.     Software Foundation. 
  343.  
  344. 11. If you wish to incorporate parts of the Program into other free programs 
  345.     whose distribution conditions are different, write to the author to ask for 
  346.     permission.  For software which is copyrighted by the Free Software 
  347.     Foundation, write to the Free Software Foundation; we sometimes make 
  348.     exceptions for this.  Our decision will be guided by the two goals of 
  349.     preserving the free status of all derivatives of our free software and of 
  350.     promoting the sharing and reuse of software generally. 
  351.  
  352.                                      NO WARRANTY
  353.  
  354. 12. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR 
  355.     THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN 
  356.     OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 
  357.     PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER 
  358.     EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 
  359.     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK 
  360.     AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE 
  361.     PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 
  362.     REPAIR OR CORRECTION. 
  363.  
  364. 13. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL 
  365.     ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE 
  366.     THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 
  367.     GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 
  368.     USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 
  369.     DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 
  370.     PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 
  371.     EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 
  372.     SUCH DAMAGES. 
  373.  
  374.                            END OF TERMS AND CONDITIONS
  375.  
  376.  
  377. ΓòÉΓòÉΓòÉ 4.2. How to Apply These Terms to Your New Programs ΓòÉΓòÉΓòÉ
  378.  
  379.  If you develop a new program, and you want it to be of the greatest possible 
  380. use to the public, the best way to achieve this is to make it free software 
  381. which everyone can redistribute and change under these terms. 
  382.  
  383.  To do so, attach the following notices to the program.  It is safest to attach 
  384. them to the start of each source file to most effectively convey the exclusion 
  385. of warranty; and each file should have at least the ``copyright'' line and a 
  386. pointer to where the full notice is found. 
  387.  
  388. one line to give the program's name and an idea of what it does.
  389. Copyright (C) 19yy  name of author
  390.  
  391. This program is free software; you can redistribute it and/or
  392. modify it under the terms of the GNU General Public License
  393. as published by the Free Software Foundation; either version 2
  394. of the License, or (at your option) any later version.
  395.  
  396. This program is distributed in the hope that it will be useful,
  397. but WITHOUT ANY WARRANTY; without even the implied warranty of
  398. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  399. GNU General Public License for more details.
  400.  
  401. You should have received a copy of the GNU General Public License
  402. along with this program; if not, write to the Free Software
  403. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  404.  
  405. Also add information on how to contact you by electronic and paper mail. 
  406.  
  407. If the program is interactive, make it output a short notice like this when it 
  408. starts in an interactive mode: 
  409.  
  410. Gnomovision version 69, Copyright (C) 19yy name of author
  411. Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
  412. type `show w'.  This is free software, and you are welcome
  413. to redistribute it under certain conditions; type `show c'
  414. for details.
  415.  
  416. The hypothetical commands `show w' and `show c' should show the appropriate 
  417. parts of the General Public License.  Of course, the commands you use may be 
  418. called something other than `show w' and `show c'; they could even be 
  419. mouse-clicks or menu items---whatever suits your program. 
  420.  
  421. You should also get your employer (if you work as a programmer) or your school, 
  422. if any, to sign a ``copyright disclaimer'' for the program, if necessary.  Here 
  423. is a sample; alter the names: 
  424.  
  425. Yoyodyne, Inc., hereby disclaims all copyright
  426. interest in the program `Gnomovision'
  427. (which makes passes at compilers) written
  428. by James Hacker.
  429.  
  430. signature of Ty Coon, 1 April 1989
  431. Ty Coon, President of Vice
  432.  
  433. This General Public License does not permit incorporating your program into 
  434. proprietary programs.  If your program is a subroutine library, you may 
  435. consider it more useful to permit linking proprietary applications with the 
  436. library.  If this is what you want to do, use the GNU Library General Public 
  437. License instead of this License. 
  438.  
  439.  
  440. ΓòÉΓòÉΓòÉ 5. Introduction ΓòÉΓòÉΓòÉ
  441.  
  442.  You are reading about GNU Emacs, the GNU incarnation of the advanced, 
  443. self-documenting, customizable, extensible real-time display editor Emacs. (The 
  444. `G' in `GNU' is not silent.) 
  445.  
  446.  We say that Emacs is a display editor because normally the text being edited 
  447. is visible on the screen and is updated automatically as you type your 
  448. commands.  See Screen. 
  449.  
  450.  We call it a real-time editor because the display is updated very frequently, 
  451. usually after each character or pair of characters you type.  This minimizes 
  452. the amount of information you must keep in your head as you edit.  See Basic 
  453. Editing. 
  454.  
  455.  We call Emacs advanced because it provides facilities that go beyond simple 
  456. insertion and deletion: filling of text; automatic indentation of programs; 
  457. viewing two or more files at once; and dealing in terms of characters, words, 
  458. lines, sentences, paragraphs, and pages, as well as expressions and comments in 
  459. several different programming languages. 
  460.  
  461.  Self-documenting means that at any time you can type a special character, 
  462. Control-h, to find out what your options are.  You can also use it to find out 
  463. what any command does, or to find all the commands that pertain to a topic. 
  464. See Help. 
  465.  
  466.  Customizable means that you can change the definitions of Emacs commands in 
  467. little ways.  For example, if you use a programming language in which comments 
  468. start with `<**' and end with `**>', you can tell the Emacs comment 
  469. manipulation commands to use those strings (see Comments).  Another sort of 
  470. customization is rearrangement of the command set.  For example, if you prefer 
  471. the four basic cursor motion commands (up, down, left and right) on keys in a 
  472. diamond pattern on the keyboard, you can have it.  See Customization. 
  473.  
  474.  Extensible means that you can go beyond simple customization and write 
  475. entirely new commands, programs in the Lisp language to be run by Emacs's own 
  476. Lisp interpreter.  Emacs is an ``on-line extensible'' system, which means that 
  477. it is divided into many functions that call each other, any of which can be 
  478. redefined in the middle of an editing session.  Any part of Emacs can be 
  479. replaced without making a separate copy of all of Emacs.  Most of the editing 
  480. commands of Emacs are written in Lisp already; the few exceptions could have 
  481. been written in Lisp but are written in C for efficiency.  Although only a 
  482. programmer can write an extension, anybody can use it afterward. 
  483.  
  484.   When run under the X Window System, Emacs provides its own menus and 
  485. convenient bindings to mouse buttons.  But Emacs can provide many of the 
  486. benefits of a window system on a text-only terminal.  For instance, you can 
  487. look at or edit several files at once, move text between them, and edit files 
  488. at the same time as you run shell commands. 
  489.  
  490.  
  491. ΓòÉΓòÉΓòÉ 6. The Organization of the Screen ΓòÉΓòÉΓòÉ
  492.  
  493.  On a text-only terminal, the Emacs display occupies the whole screen. On the X 
  494. Window System, Emacs creates its own X windows to use.  We use the term frame 
  495. to mean an entire text-only screen or an entire X window used by Emacs.  Emacs 
  496. uses both kinds of frames in the same way to display your editing.  Emacs 
  497. normally starts out with just one frame, but under X you can create additional 
  498. frames if you wish.  See Frames. 
  499.  
  500.  When you start Emacs, the entire frame except for the last line is devoted to 
  501. the text you are editing.  This area is called window. The last line is a 
  502. special echo area or minibuffer window where prompts appear and where you can 
  503. enter responses.  You can subdivide the large text window horizontally or 
  504. vertically into multiple text windows, each of which can be used for a 
  505. different file (see Windows).  In this manual, the word ``window'' always 
  506. refers to the subdivisions of a frame within Emacs. 
  507.  
  508.  The window that the cursor is in is the selected window, in which editing 
  509. takes place.  Most Emacs commands implicitly apply to the text in the selected 
  510. window.  The other windows display text for reference only, unless/until you 
  511. select them. 
  512.  
  513.  Each window's last line is a mode line which describes what is going on in 
  514. that window.  It is in inverse video if the terminal supports that, and 
  515. contains text that starts like `-----Emacs: something'.  Its purpose is to 
  516. indicate what buffer is being displayed above it in the window; what major and 
  517. minor modes are in use; and whether the buffer contains unsaved changes. 
  518.  
  519.  
  520. ΓòÉΓòÉΓòÉ 6.1. Point ΓòÉΓòÉΓòÉ
  521.  
  522.  Within Emacs, the terminal's cursor shows the location at which editing 
  523. commands will take effect.  This location is called point.  Other commands move 
  524. point through the text, so that you can edit at different places in it. 
  525.  
  526.  While the cursor appears to point at a character, you should think of point as 
  527. between two characters; it points before the character that appears under the 
  528. cursor.  For example, if your text looks like `frob' with the cursor over the 
  529. `b', then point is between the `o' and the `b'.  If you insert the character 
  530. `!' at that position, the result is `fro!b', with point between the `!' and the 
  531. `b'.  Thus, the cursor remains over the `b', as before. 
  532.  
  533.  Sometimes people speak of ``the cursor'' when they mean ``point'', or speak of 
  534. commands that move point as ``cursor motion'' commands. 
  535.  
  536.  Terminals have only one cursor, and when output is in progress it must appear 
  537. where the typing is being done.  This does not mean that point is moving.  It 
  538. is only that Emacs has no way to show you the location of point except when the 
  539. terminal is idle. 
  540.  
  541.  If you are editing several files in Emacs, each in its own buffer, each buffer 
  542. has its own point location.  A buffer that is not currently displayed remembers 
  543. where point is in case you display it again later. 
  544.  
  545.  When there are multiple windows, each window has its own point location.  The 
  546. cursor shows the location of point in the selected window.  This also is how 
  547. you can tell which window is selected.  If the same buffer appears in more than 
  548. one window, each window has its own position for point in that buffer. 
  549.  
  550.  The term `point' comes from the character `.', which was the command in TECO 
  551. (the language in which the original Emacs was written) for accessing the value 
  552. now called `point'. 
  553.  
  554.  
  555. ΓòÉΓòÉΓòÉ 6.2. The Echo Area ΓòÉΓòÉΓòÉ
  556.  
  557.  The line at the bottom of the screen (below the mode line) is the echo area. 
  558. It is used to display small amounts of text for several purposes. 
  559.  
  560.  Echoing means printing out the characters that you type. Outside Emacs, the 
  561. operating system normally echoes all your input. Emacs handles echoing 
  562. differently. 
  563.  
  564.  Single-character commands do not echo in Emacs, and multi-character commands 
  565. echo only if you pause while typing them.  As soon as you pause for more than a 
  566. second in the middle of a command, Emacs echoes all the characters of the 
  567. command so far.  This is to prompt you for the rest of the command.  Once 
  568. echoing has started, the rest of the command echoes immediately as you type it. 
  569. This behavior is designed to give confident users fast response, while giving 
  570. hesitant users maximum feedback.  You can change this behavior by setting a 
  571. variable (see Display Vars). 
  572.  
  573.  If a command cannot be executed, it may print an error message in the echo 
  574. area.  Error messages are accompanied by a beep or by flashing the screen. 
  575. Also, any input you have typed ahead is thrown away when an error happens. 
  576.  
  577.  Some commands print informative messages in the echo area.  These messages 
  578. look much like error messages, but they are not announced with a beep and do 
  579. not throw away input.  Sometimes the message tells you what the command has 
  580. done, when this is not obvious from looking at the text being edited. 
  581. Sometimes the sole purpose of a command is to print a message giving you 
  582. specific information---for example, C-x = prints a message describing the 
  583. character position of point in the text and its current column in the window. 
  584. Commands that take a long time often display messages ending in `...' while 
  585. they are working, and add `done' at the end when they are finished. 
  586.  
  587.  The echo area is also used to display the minibuffer, a window that is used 
  588. for reading arguments to commands, such as the name of a file to be edited. 
  589. When the minibuffer is in use, the echo area begins with a prompt string that 
  590. usually ends with a colon; also, the cursor appears in that line because it is 
  591. the selected window.  You can always get out of the minibuffer by typing C-g. 
  592. See Minibuffer. 
  593.  
  594.  
  595. ΓòÉΓòÉΓòÉ 6.3. The Mode Line ΓòÉΓòÉΓòÉ
  596.  
  597.  Each text window's last line is a mode line which describes what is going on 
  598. in that window.  When there is only one text window, the mode line appears 
  599. right above the echo area.  The mode line is in inverse video if the terminal 
  600. supports that, starts and ends with dashes, and contains text like `Emacs: 
  601. something'. 
  602.  
  603.  If a mode line has something else in place of `Emacs: something', then the 
  604. window above it is in a special subsystem such as Dired.  The mode line then 
  605. indicates the status of the subsystem. 
  606.  
  607.  Normally, the mode line looks like this: 
  608.  
  609. --ch-Emacs: buf      (major minor)----pos------
  610.  
  611. This gives information about the buffer being displayed in the window: the 
  612. buffer's name, what major and minor modes are in use, whether the buffer's text 
  613. has been changed, and how far down the buffer you are currently looking. 
  614.  
  615.  ch contains two stars `**' if the text in the buffer has been edited (the 
  616. buffer is ``modified''), or `--' if the buffer has not been edited.  Exception: 
  617. for a read-only buffer, it is `%%'. 
  618.  
  619.  buf is the name of the window's buffer.  In most cases this is the same as the 
  620. name of a file you are editing.  See Buffers. 
  621.  
  622.  The buffer displayed in the selected window (the window that the cursor is in) 
  623. is also Emacs's selected buffer, the one that editing takes place in.  When we 
  624. speak of what some command does to ``the buffer'', we are talking about the 
  625. currently selected buffer. 
  626.  
  627.  pos tells you whether there is additional text above the top of the window, or 
  628. below the bottom.  If your buffer is small and it is all visible in the window, 
  629. pos is `All'.  Otherwise, it is `Top' if you are looking at the beginning of 
  630. the buffer, `Bot' if you are looking at the end of the buffer, or `nn%', where 
  631. nn is the percentage of the buffer above the top of the window. 
  632.  
  633.  major is the name of the major mode in effect in the buffer.  At any time, 
  634. each buffer is in one and only one of the possible major modes. The major modes 
  635. available include Fundamental mode (the least specialized), Text mode, Lisp 
  636. mode, and C mode.  See Major Modes, for details of how the modes differ and how 
  637. to select one. 
  638.  
  639.  minor is a list of some of the minor modes that are turned on at the moment in 
  640. the window's chosen buffer.  `Fill' means that Auto Fill mode is on.  `Abbrev' 
  641. means that Word Abbrev mode is on. `Ovwrt' means that Overwrite mode is on. 
  642. See Minor Modes, for more information.  `Narrow' means that the buffer being 
  643. displayed has editing restricted to only a portion of its text.  This is not 
  644. really a minor mode, but is like one.  See Narrowing.  `Def' means that a 
  645. keyboard macro is being defined.  See Keyboard Macros. 
  646.  
  647.  Some buffers display additional information after the minor modes.  For 
  648. example, Rmail buffers display the current message number and the total number 
  649. of messages.  Compilation buffers and Shell mode display the status of the 
  650. subprocess. 
  651.  
  652.  In addition, if Emacs is currently inside a recursive editing level, square 
  653. brackets (`[...]') appear around the parentheses that surround the modes.  If 
  654. Emacs is in one recursive editing level within another, double square brackets 
  655. appear, and so on.  Since recursive editing levels affect Emacs globally and 
  656. not any one buffer, the square brackets appear in every window's mode line or 
  657. not in any of them. See Recursive Edit. 
  658.  
  659.  See Optional Display, for features that add other handy information to the 
  660. mode line, such as the current line number of point, the current time, and 
  661. whether mail has arrived for you. 
  662.  
  663.  
  664. ΓòÉΓòÉΓòÉ 6.4. Keyboard Input ΓòÉΓòÉΓòÉ
  665.  
  666.  GNU Emacs uses an extension of the ASCII character set for keyboard input. 
  667. ASCII consists of 128 character codes.  Some of these codes are assigned 
  668. graphic symbols such as `a' and `='; the rest are control characters, such as 
  669. Control-a (usually written C-a for short).  C-a gets its name from the fact 
  670. that you type it by holding down the CTRL key and then pressing a. 
  671.  
  672.  Some control characters have special names, and special keys you can type them 
  673. with: for example, RET, TAB, LFD, DEL and ESC.  The space character is usually 
  674. referred to below as SPC, even though strictly speaking it is a graphic 
  675. character whose graphic happens to be blank. 
  676.  
  677.  On ASCII terminals, the shift key is meaningless with control characters: C-a 
  678. and C-A are the same character, and Emacs cannot distinguish them.  Under X 
  679. Windows, these are distinct characters, but the standard key bindings treat 
  680. them the same in all contexts. 
  681.  
  682.  On ASCII terminals, there are only 32 possible control characters. These are 
  683. the control variants of letters and `@[]\^_'.  Under X Windows, every 
  684. non-control character has a control variant.  For example, C-+ and C-5 are 
  685. meaningful under X. 
  686.  
  687.  Emacs extends the ASCII character code by adding an extra bit to each 
  688. character.  The additional bit is called Meta.  Any character can be made Meta; 
  689. examples of Meta characters include Meta-a (normally written M-a, for short), 
  690. M-A (not the same character as M-a, but those two characters normally have the 
  691. same meaning in Emacs), M-RET, and M-C-a.  For traditional reasons, M-C-a is 
  692. usually called C-M-a; logically speaking, the order in which the modifier keys 
  693. CTRL and META are mentioned does not matter. 
  694.  
  695.  Some terminals have a META key, and allow you to type Meta characters by 
  696. holding this key down.  Thus, Meta-a is typed by holding down META and pressing 
  697. a.  The META key works much like the SHIFT key.  Such a key is not always 
  698. labeled META, however, as this function is often a special option for a key 
  699. with some other primary purpose. 
  700.  
  701.  If there is no META key, you can still type Meta characters using 
  702. two-character sequences starting with ESC.  Thus, to enter M-a, you could type 
  703. ESC a.  To enter C-M-a, you would type ESC C-a.  ESC is allowed on terminals 
  704. with Meta keys, too, in case you have formed a habit of using it. 
  705.  
  706.  X Windows provides several other modifier keys that can be applied to any 
  707. keyboard input character.  These are called SUPER, HYPER and ALT.  With them, 
  708. you can make characters that we denote with `s-', `H-' and `A-'.  Thus, s-H-C-x 
  709. is short for Super-Hyper-Control-x.  Not all X terminals actually provide keys 
  710. for these modifier flags, and the standard key bindings of Emacs do not include 
  711. such characters.  But you can assign them meanings of your own by customizing 
  712. Emacs. 
  713.  
  714.  Keyboard input includes keyboard keys that are not characters at all: for 
  715. example function keys and arrow keys.  Mouse buttons are also outside the gamut 
  716. of characters.  These inputs do not have numeric character codes.  Instead, 
  717. Emacs represents them by their names (actually, Lisp objects called symbols). 
  718.  
  719.  Input characters and non-character inputs are collectively called input 
  720. events. 
  721.  
  722.  ASCII terminals cannot really send anything to the computer except ASCII 
  723. characters.  These terminals use a sequence of characters to represent each 
  724. function key.  But that is invisible to the Emacs user, because the keyboard 
  725. input routines recognize these special sequences and converts them to names 
  726. before any other part of Emacs gets to see them. 
  727.  
  728.  
  729. ΓòÉΓòÉΓòÉ 6.5. Keys ΓòÉΓòÉΓòÉ
  730.  
  731.  A key sequence (key, for short) is a sequence of input events that combine as 
  732. part of the invocation of a single command. Recall that input events include 
  733. both keyboard characters and non-character inputs (function keys, arrow keys, 
  734. mouse buttons, and so forth). 
  735.  
  736.  If the sequence is enough to invoke a command, it is a complete key.  If it 
  737. isn't long enough to be complete, we call it a prefix key.  Examples of 
  738. complete keys include C-a, X, RET, NEXT (a function key), DOWN (an arrow key), 
  739. C-x C-f and C-x 4 C-f. 
  740.  
  741.  Most single characters constitute complete keys in the standard Emacs command 
  742. bindings.  A few of them are prefix keys.  A prefix key can be followed by 
  743. additional input characters (or other events) to make a longer key, which may 
  744. itself be complete or a prefix. 
  745.  
  746.  For example, C-x is a prefix key, so C-x and the next input character combine 
  747. to make a two-character key sequence.  Most of these key sequences are complete 
  748. keys, including C-x C-f and C-x b.  A few, such as C-x 4 and C-x r, are 
  749. themselves prefix keys that lead to three-character key sequences.  There's no 
  750. limit to the length of a key sequence, but any key sequence longer than one 
  751. character must be reached through a chain of prefix keys. 
  752.  
  753.  By contrast, the two-character sequence C-f C-k is not a key, because the C-f 
  754. is a complete key in itself.  It's impossible to give C-f C-k an independent 
  755. meaning as a command.  C-f C-k is two key sequences, not one. 
  756.  
  757.  All told, the prefix keys in Emacs are C-c, C-x, C-h, C-x C-a, C-x n, C-x r, 
  758. C-x v, C-x 4, C-x 5, and ESC.  But this is not cast in concrete; it is just a 
  759. matter of Emacs's standard key bindings.  In customizing Emacs, you could make 
  760. new prefix keys, or eliminate these. See Key Bindings. 
  761.  
  762.  Whether a sequence is a key can be changed by customization.  For example, if 
  763. you redefine C-f as a prefix, C-f C-k automatically becomes a key (complete, 
  764. unless you define it too as a prefix). Conversely, if you remove the prefix 
  765. definition of C-x 4, then C-x 4 f (or C-x 4 anything) is no longer a key. 
  766.  
  767.  
  768. ΓòÉΓòÉΓòÉ 6.6. Keys and Commands ΓòÉΓòÉΓòÉ
  769.  
  770.  This manual is full of passages that tell you what particular keys do.  But 
  771. Emacs does not assign meanings to keys directly.  Instead, Emacs assigns 
  772. meanings to named commands, and then gives keys their meanings by binding them 
  773. to commands. 
  774.  
  775.  Every command has a name chosen by a programmer.  The name is usually made of 
  776. a few English words separated by dashes; for example, next-line or 
  777. forward-word.  A command also has a function definition which is a Lisp 
  778. program; this is what makes the command do what it does.  In Emacs Lisp, a 
  779. command is actually a special kind of Lisp function; one which specifies how to 
  780. read arguments for it and call it interactively.  For more information on 
  781. commands and functions, see What Is a Function.  (The definition we use in this 
  782. manual is simplified slightly.) 
  783.  
  784.  The bindings between keys and commands are recorded in various tables called 
  785. keymaps.  See Keymaps. 
  786.  
  787.  When we say that ``C-n moves down vertically one line'' we are glossing over a 
  788. distinction that is irrelevant in ordinary use but is vital in understanding 
  789. how to customize Emacs.  It is the command next-line that is programmed to move 
  790. down vertically.  C-n has this effect because it is bound to that command.  If 
  791. you rebind C-n to the command forward-word then C-n will move forward by words 
  792. instead.  Rebinding keys is a common method of customization. 
  793.  
  794.  In the rest of this manual, we usually ignore this subtlety to keep things 
  795. simple.  To give the customizer the information he needs, we state the name of 
  796. the command which really does the work in parentheses after mentioning the key 
  797. that runs it.  For example, we will say that ``The command C-n (next-line) 
  798. moves point vertically down,'' meaning that next-line is a command that moves 
  799. vertically down and C-n is a key that is standardly bound to it. 
  800.  
  801.  While we are on the subject of information for customization only, it's a good 
  802. time to tell you about variables.  Often the description of a command will say, 
  803. ``To change this, set the variable mumble-foo.'' A variable is a name used to 
  804. remember a value.  Most of the variables documented in this manual exist just 
  805. to facilitate customization: some command or other part of Emacs examines the 
  806. variable and behaves differently accordingly.  Until you are interested in 
  807. customizing, you can ignore the information about variables.  When you are 
  808. ready to be interested, read the basic information on variables, and then the 
  809. information on individual variables will make sense.  See Variables. 
  810.  
  811.  
  812. ΓòÉΓòÉΓòÉ 6.7. Character Set for Text ΓòÉΓòÉΓòÉ
  813.  
  814.  Emacs buffers use an 8-bit character set, because bytes have 8 bits. ASCII 
  815. graphic characters in Emacs buffers are displayed with their graphics.  The 
  816. newline character (which has the same character code as LFD) is displayed by 
  817. starting a new line.  The tab character is displayed by moving to the next tab 
  818. stop column (usually every 8 columns).  Other control characters are displayed 
  819. as a caret (`^') followed by the non-control version of the character; thus, 
  820. C-a is displayed as `^A'. 
  821.  
  822.  Non-ASCII characters 128 and up are displayed with octal escape sequences; 
  823. thus, character code 243 (octal) is displayed as `\243'.  You can customize the 
  824. display of these character codes (or ANSI characters) by creating a display 
  825. table; this is useful for editing files that use 8-bit European character sets. 
  826. See Display Tables. 
  827.  
  828.  
  829. ΓòÉΓòÉΓòÉ 7. Entering and Exiting Emacs ΓòÉΓòÉΓòÉ
  830.  
  831.  The usual way to invoke Emacs is with the shell command `emacs'. Emacs clears 
  832. the screen and then displays an initial help message and copyright notice.  On 
  833. a window system, Emacs opens a window of its own. You can begin typing Emacs 
  834. commands immediately afterward. 
  835.  
  836.  Some operating systems insist on discarding all type-ahead when Emacs starts 
  837. up; they give Emacs no way to prevent this.  Therefore, it is wise to wait 
  838. until Emacs clears the screen before typing your first editing command. 
  839.  
  840.  If you run Emacs from a shell window under the X Window System, run it in the 
  841. background with `emacs&'.  This way, Emacs does not tie up the shell window, so 
  842. you can use it to run other shell commands while Emacs operates its own X 
  843. windows. 
  844.  
  845.  When Emacs starts up, it makes a buffer named `*scratch*'. That's the buffer 
  846. you start out in.  The `*scratch*' uses Lisp Interaction mode; you can use it 
  847. to type Lisp expressions and evaluate them, or you can ignore that capability 
  848. and simply doodle.  (You can specify a different major mode for this buffer by 
  849. setting the variable initial-major-mode in your init file.  See Init File.) 
  850.  
  851.  It is also possible to specify files to be visited, Lisp files to be loaded, 
  852. and functions to be called, by giving Emacs arguments in the shell command 
  853. line.  See Command Arguments.  But we don't recommend doing this.  The feature 
  854. exists mainly for compatibility with other editors. 
  855.  
  856.  Many other editors are designed to be started afresh each time you want to 
  857. edit.  You edit one file and then exit the editor.  The next time you want to 
  858. edit either another file or the same one, you must run the editor again.  With 
  859. these editors, it makes sense to use a command line argument to say which file 
  860. to edit. 
  861.  
  862.  But starting a new Emacs each time you want to edit a different file does not 
  863. make sense.  For one thing, this would be annoyingly slow.  For another, this 
  864. would fail to take advantage of Emacs's ability to visit more than one file in 
  865. a single editing session. 
  866.  
  867.  The recommended way to use GNU Emacs is to start it only once, just after you 
  868. log in, and do all your editing in the same Emacs session. Each time you want 
  869. to edit a different file, you visit it with the existing Emacs, which 
  870. eventually comes to have many files in it ready for editing.  Usually you do 
  871. not kill the Emacs until you are about to log out. 
  872.  
  873.  
  874. ΓòÉΓòÉΓòÉ 7.1. Exiting Emacs ΓòÉΓòÉΓòÉ
  875.  
  876.  There are two commands for exiting Emacs because there are two kinds of 
  877. exiting: suspending Emacs and killing Emacs. 
  878.  
  879.  Suspending means stopping Emacs temporarily and returning control to its 
  880. parent process (usually a shell), allowing you to resume editing later in the 
  881. same Emacs job, with the same files, same kill ring, same undo history, and so 
  882. on.  This is the usual way to exit. 
  883.  
  884.  Killing Emacs means destroying the Emacs job.  You can run Emacs again later, 
  885. but you will get a fresh Emacs; there is no way to resume the same editing 
  886. session after it has been killed. 
  887.  
  888. C-z 
  889.           Suspend Emacs (suspend-emacs). 
  890.  
  891. C-x C-c 
  892.           Kill Emacs (save-buffers-kill-emacs). 
  893.  
  894.  To suspend Emacs, type C-z (suspend-emacs).  This takes you back to the shell 
  895. from which you invoked Emacs.  You can resume Emacs with the shell command 
  896. `%emacs' in most common shells. 
  897.  
  898.  On systems that do not permit programs to be suspended, C-z runs an inferior 
  899. shell that communicates directly with the terminal, and Emacs waits until you 
  900. exit the subshell.  (The way to do that is probably with C-d or `exit', but it 
  901. depends on which shell you use.)  The only way on these systems to get back to 
  902. the shell from which Emacs was run (to log out, for example) is to kill Emacs. 
  903.  
  904.  When Emacs communicates directly with an X server and creates its own 
  905. dedicated X windows, C-z has a different meaning.  Suspending an applications 
  906. that uses its own X windows is not meaningful or useful. Instead, C-z runs the 
  907. command iconify-frame, which temporarily closes up the selected Emacs frame. 
  908. The way to get back to a shell window is with the window manager. 
  909.  
  910.  To kill Emacs, type C-x C-c (save-buffers-kill-emacs).  A two-character key is 
  911. used for this to make it harder to type.  Unless a numeric argument is used, 
  912. this command first offers to save any modified buffers.  If you do not save 
  913. them all, it asks for reconfirmation with yes before killing Emacs, since any 
  914. changes not saved will be lost forever.  Also, if any subprocesses are still 
  915. running, C-x C-c asks for confirmation about them, since killing Emacs will 
  916. kill the subprocesses immediately. 
  917.  
  918.  The operating system usually listens for certain special characters whose 
  919. meaning is to kill or suspend the program you are running. This operating 
  920. system feature is turned off while you are in Emacs. The meanings of C-z and 
  921. C-x C-c as keys in Emacs were inspired by the use of C-z and C-c on several 
  922. operating systems as the characters for stopping or killing a program, but that 
  923. is their only relationship with the operating system.  You can customize these 
  924. keys to run any commands (see Keymaps). 
  925.  
  926.  
  927. ΓòÉΓòÉΓòÉ 8. Basic Editing Commands ΓòÉΓòÉΓòÉ
  928.  
  929.  We now give the basics of how to enter text, make corrections, and save the 
  930. text in a file.  If this material is new to you, you might learn it more easily 
  931. by running the Emacs learn-by-doing tutorial.  To start the tutorial, type 
  932. Control-h t (help-with-tutorial). 
  933.  
  934.  To clear the screen and redisplay, type C-l (recenter). 
  935.  
  936.  
  937. ΓòÉΓòÉΓòÉ 8.1. Inserting Text ΓòÉΓòÉΓòÉ
  938.  
  939.  To insert printing characters into the text you are editing, just type them. 
  940. This inserts the characters you type into the buffer at the cursor (that is, at 
  941. point; see Point).  The cursor moves forward, and any text after the cursor 
  942. moves forward too.  If the text in the buffer is `FOOBAR', with the cursor 
  943. before the `B', then if you type XX, you get `FOOXXBAR', with the cursor still 
  944. before the `B'. 
  945.  
  946.   To delete text you have just inserted, use DEL.  DEL deletes the character 
  947. before the cursor (not the one that the cursor is on top of or under; that is 
  948. the character after the cursor).  The cursor and all characters after it move 
  949. backwards.  Therefore, if you type a printing character and then type DEL, they 
  950. cancel out. 
  951.  
  952.   To end a line and start typing a new one, type RET.  This inserts a newline 
  953. character in the buffer.  If point is in the middle of a line, RET splits the 
  954. line.  Typing DEL when the cursor is at the beginning of a line deletes the 
  955. preceding newline, thus joining the line with the preceding line. 
  956.  
  957.  Emacs can split lines automatically when they become too long, if you turn on 
  958. a special mode called Auto Fill mode.  See Filling, for how to use Auto Fill 
  959. mode. 
  960.  
  961.  Customization information: DEL in most modes runs the command 
  962. delete-backward-char; RET runs the command newline, and self-inserting printing 
  963. characters run the command self-insert, which inserts whatever character was 
  964. typed to invoke it.  Some major modes rebind DEL to other commands. 
  965.  
  966.  Direct insertion works for printing characters and SPC, but other characters 
  967. act as editing commands and do not insert themselves.  If you need to insert a 
  968. control character or a character whose code is above 200 octal, you must quote 
  969. it by typing the character Control-q (quoted-insert) first.  (This character's 
  970. name is normally written C-q for short.)  There are two ways to use C-q: 
  971.  
  972. o C-q followed by any non-graphic character (even C-g) inserts that character. 
  973.  
  974. o C-q followed by three octal digits inserts the character with the specified 
  975.   character code. 
  976.  
  977. A numeric argument to C-q specifies how many copies of the quoted character 
  978. should be inserted (see Arguments). 
  979.  
  980.  If you prefer to have text characters replace (overwrite) existing text rather 
  981. than shove it to the right, you can enable Overwrite mode, a minor mode.  See 
  982. Minor Modes. 
  983.  
  984.  
  985. ΓòÉΓòÉΓòÉ 8.2. Changing the Location of Point ΓòÉΓòÉΓòÉ
  986.  
  987.  To do more than insert characters, you have to know how to move point (see 
  988. Point).  The simplest way to do this is with arrow keys or the left mouse 
  989. button. 
  990.  
  991.  There are also control and meta characters for cursor motion.  Some are 
  992. equivalent to the arrow keys (these date back to the days before terminals had 
  993. arrow keys, and are usable on terminals which don't have them).  Others do more 
  994. sophisticated things. 
  995.  
  996. C-a 
  997.           Move to the beginning of the line (beginning-of-line). 
  998.  
  999. C-e 
  1000.           Move to the end of the line (end-of-line). 
  1001.  
  1002. C-f 
  1003.           Move forward one character (forward-char). 
  1004.  
  1005. C-b 
  1006.           Move backward one character (backward-char). 
  1007.  
  1008. M-f 
  1009.           Move forward one word (forward-word). 
  1010.  
  1011. M-b 
  1012.           Move backward one word (backward-word). 
  1013.  
  1014. C-n 
  1015.           Move down one line, vertically (next-line).  This command attempts to 
  1016.           keep the horizontal position unchanged, so if you start in the middle 
  1017.           of one line, you end in the middle of the next.  When on the last 
  1018.           line of text, C-n creates a new line and moves onto it. 
  1019.  
  1020. C-p 
  1021.           Move up one line, vertically (previous-line). 
  1022.  
  1023. M-r 
  1024.           Move point to left margin, vertically centered in the window 
  1025.           (move-to-window-line).  Text does not move on the screen.  A numeric 
  1026.           argument says how many screen lines down from the top of the window 
  1027.           (zero for the top line).  A negative argument counts lines from the 
  1028.           bottom (-1 for the bottom line). 
  1029.  
  1030. M-< 
  1031.           Move to the top of the buffer (beginning-of-buffer).  With numeric 
  1032.           argument n, move to n/10 of the way from the top. See Arguments, for 
  1033.           more information on numeric arguments. 
  1034.  
  1035. M-> 
  1036.           Move to the end of the buffer (end-of-buffer). 
  1037.  
  1038. M-x goto-char 
  1039.           Read a number n and move cursor to character number n. Position 1 is 
  1040.           the beginning of the buffer. 
  1041.  
  1042. M-x goto-line 
  1043.           Read a number n and move cursor to line number n.  Line 1 is the 
  1044.           beginning of the buffer. 
  1045.  
  1046. C-x C-n 
  1047.           Use the current column of point as the semipermanent goal column for 
  1048.           C-n and C-p (set-goal-column).  Henceforth, those commands always 
  1049.           move to this column in each line moved into, or as close as possible 
  1050.           given the contents of the line.  This goal column remains in effect 
  1051.           until canceled. 
  1052.  
  1053. C-u C-x C-n 
  1054.           Cancel the goal column.  Henceforth, C-n and C-p once again try to 
  1055.           avoid changing the horizontal position, as usual. 
  1056.  
  1057.  If you set the variable track-eol to a non-nil value, then C-n and C-p when at 
  1058. the end of the starting line move to the end of another line.  Normally, 
  1059. track-eol is nil. See Variables, for how to set variables such as track-eol. 
  1060.  
  1061.  Normally, C-n on the last line of a buffer appends a newline to it.  If the 
  1062. variable next-line-add-newlines is nil, then C-n gets an error instead (like 
  1063. C-p on the first line). 
  1064.  
  1065.  
  1066. ΓòÉΓòÉΓòÉ 8.3. Erasing Text ΓòÉΓòÉΓòÉ
  1067.  
  1068. DEL 
  1069.           Delete the character before the cursor (delete-backward-char). 
  1070.  
  1071. C-d 
  1072.           Delete the character after the cursor (delete-char). 
  1073.  
  1074. C-k 
  1075.           Kill to the end of the line (kill-line). 
  1076.  
  1077. M-d 
  1078.           Kill forward to the end of the next word (kill-word). 
  1079.  
  1080. M-DEL 
  1081.           Kill back to the beginning of the previous word (backward-kill-word). 
  1082.  
  1083.  You already know about the DEL key which deletes the character before the 
  1084. cursor.  Another key, Control-d (C-d for short), deletes the character after 
  1085. the cursor, causing the rest of the text on the line to shift left.  If C-d is 
  1086. typed at the end of a line, that line and the next line are joined together. 
  1087.  
  1088.  To erase a larger amount of text, use the C-k key, which kills a line at a 
  1089. time.  If C-k is done at the beginning or middle of a line, it kills all the 
  1090. text up to the end of the line.  If C-k is done at the end of a line, it joins 
  1091. that line and the next line. 
  1092.  
  1093.  If you delete or kill text by mistake, you can use the undo command to get it 
  1094. back.  See Undo. 
  1095.  
  1096.  See Killing, for more flexible ways of killing text. 
  1097.  
  1098.  
  1099. ΓòÉΓòÉΓòÉ 8.4. Files ΓòÉΓòÉΓòÉ
  1100.  
  1101.  The commands above are sufficient for creating and altering text in an Emacs 
  1102. buffer; the more advanced Emacs commands just make things easier. But to keep 
  1103. any text permanently you must put it in a file.  Files are named units of text 
  1104. which are stored by the operating system for you to retrieve later by name.  To 
  1105. look at or use the contents of a file in any way, including editing the file 
  1106. with Emacs, you must specify the file name. 
  1107.  
  1108.  Consider a file named `/usr/rms/foo.c'.  In Emacs, to begin editing this file, 
  1109. type 
  1110.  
  1111. C-x C-f /usr/rms/foo.c RET
  1112.  
  1113. Here the file name is given as an argument to the command C-x C-f (find-file). 
  1114. That command uses the minibuffer to read the argument, and you type RET to 
  1115. terminate the argument (see Minibuffer). 
  1116.  
  1117.  Emacs obeys the command by visiting the file: creating a buffer, copying the 
  1118. contents of the file into the buffer, and then displaying the buffer for you to 
  1119. edit.  Then you can make changes, and save the file by typing C-x C-s 
  1120. (save-buffer).  This makes the changes permanent by copying the altered 
  1121. contents of the buffer back into the file `/usr/rms/foo.c'.  Until you save, 
  1122. the changes exist only inside Emacs, and the file `foo.c' is unaltered. 
  1123.  
  1124.  To create a file, just visit the file with C-x C-f as if it already existed. 
  1125. This creates an empty buffer in which you can insert the text you want to put 
  1126. in the file.  The file is actually created when you save this buffer with C-x 
  1127. C-s. 
  1128.  
  1129.  Of course, there is a lot more to learn about using files.  See Files. 
  1130.  
  1131.  
  1132. ΓòÉΓòÉΓòÉ 8.5. Help ΓòÉΓòÉΓòÉ
  1133.  
  1134.  If you forget what a key does, you can find out with the Help character, which 
  1135. is C-h.  Type C-h k followed by the key you want to know about; for example, 
  1136. C-h k C-n tells you all about what C-n does.  C-h is a prefix key; C-h k is 
  1137. just one of its subcommands (the command describe-key).  The other subcommands 
  1138. of C-h provide different kinds of help.  Type C-h three times to get a 
  1139. description of all the help facilities.  See Help. 
  1140.  
  1141.  
  1142. ΓòÉΓòÉΓòÉ 8.6. Blank Lines ΓòÉΓòÉΓòÉ
  1143.  
  1144.  Here are special commands and techniques for putting in and taking out blank 
  1145. lines. 
  1146.  
  1147. C-o 
  1148.           Insert one or more blank lines after the cursor (open-line). 
  1149.  
  1150. C-x C-o 
  1151.           Delete all but one of many consecutive blank lines 
  1152.           (delete-blank-lines). 
  1153.  
  1154.  When you want to insert a new line of text before an existing line, you can do 
  1155. it by typing the new line of text, followed by RET.  However, it may be easier 
  1156. to see what you are doing if you first make a blank line and then insert the 
  1157. desired text into it.  This is easy to do using the key C-o (open-line), which 
  1158. inserts a newline after point but leaves point in front of the newline.  After 
  1159. C-o, type the text for the new line.  C-o F O O has the same effect as F O O 
  1160. RET, except for the final location of point. 
  1161.  
  1162.  You can make several blank lines by typing C-o several times, or by giving it 
  1163. a numeric argument to tell it how many blank lines to make.  See Arguments, for 
  1164. how. 
  1165.  
  1166.  If you have a fill prefix, then C-o command inserts the fill prefix on the new 
  1167. line, when you use it at the beginning of a line. See Fill Prefix. 
  1168.  
  1169.  The easy way to get rid of extra blank lines is with the command C-x C-o 
  1170. (delete-blank-lines).  C-x C-o in a run of several blank lines deletes all but 
  1171. one of them.  C-x C-o on a solitary blank line deletes that blank line.  When 
  1172. point is on a nonblank line, C-x C-o deletes any blank lines following that 
  1173. nonblank line. 
  1174.  
  1175.  
  1176. ΓòÉΓòÉΓòÉ 8.7. Continuation Lines ΓòÉΓòÉΓòÉ
  1177.  
  1178.  If you add too many characters to one line, without breaking it with RET, the 
  1179. line will grow to occupy two (or more) lines on the screen, with a `\' at the 
  1180. extreme right margin of all but the last of them. The `\' says that the 
  1181. following screen line is not really a distinct line in the text, but just the 
  1182. continuation of a line too long to fit the screen.  Continuation is also called 
  1183. line wrapping. 
  1184.  
  1185.  Sometimes it is nice to have Emacs insert newlines automatically when a line 
  1186. gets too long.  Continuation on the screen does not do that.  Use Auto Fill 
  1187. mode (see Filling) if that's what you want. 
  1188.  
  1189.  Instead of continuation, you can display long lines by truncation.  This means 
  1190. that all the characters that do not fit in the width of the screen or window do 
  1191. not appear at all.  They remain in the buffer, temporarily invisible.  `$' is 
  1192. used in the last column instead of `\' to inform you that truncation is in 
  1193. effect. 
  1194.  
  1195.  You can turn off continuation for a particular buffer by setting the variable 
  1196. truncate-lines to non-nil in that buffer. (See Variables.)  Truncation instead 
  1197. of continuation also happens whenever horizontal scrolling is in use, and 
  1198. optionally whenever side-by-side windows are in use (see Windows).  Altering 
  1199. the value of truncate-lines makes it local to the current buffer; until that 
  1200. time, the default value is in effect.  The default is initially nil.  See 
  1201. Locals. 
  1202.  
  1203.  See Display Vars, for additional variables that affect how text is displayed. 
  1204.  
  1205.  
  1206. ΓòÉΓòÉΓòÉ 8.8. Cursor Position Information ΓòÉΓòÉΓòÉ
  1207.  
  1208.  Here are commands to get information about the size and position of parts of 
  1209. the buffer, and to count lines. 
  1210.  
  1211. M-x what-page 
  1212.           Print page number of point, and line number within page. 
  1213.  
  1214. M-x what-line 
  1215.           Print line number of point in the buffer. 
  1216.  
  1217. M-x line-number-mode 
  1218.           Toggle automatic display of current line number. 
  1219.  
  1220. M-= 
  1221.           Print number of lines in the current region (count-lines-region). 
  1222.  
  1223. C-x = 
  1224.           Print character code of character after point, character position of 
  1225.           point, and column of point (what-cursor-position). 
  1226.  
  1227.  There are two commands for printing the current line number.  M-x what-line 
  1228. computes the current line number and displays it in the echo area.  M-x 
  1229. line-number-mode enables display of the current line number in the mode line; 
  1230. once you turn this on, the number updates as you move point, so it remains 
  1231. valid all the time.  See Mode Line. 
  1232.  
  1233.  Line numbers count from one at the beginning of the buffer.  To go to a given 
  1234. line by number, use M-x goto-line; it prompts you for the line number. 
  1235.  
  1236.  By contrast, M-x what-page counts pages from the beginning of the file, and 
  1237. counts lines within the page, printing both numbers. See Pages. 
  1238.  
  1239.  While on this subject, we might as well mention M-= (count-lines-region), 
  1240. which prints the number of lines in the region (see Mark). See Pages, for the 
  1241. command C-x l which counts the lines in the current page. 
  1242.  
  1243.  The command C-x = (what-cursor-position) can be used to find out the column 
  1244. that the cursor is in, and other miscellaneous information about point.  It 
  1245. prints a line in the echo area that looks like this: 
  1246.  
  1247. Char: x (0170)  point=65986 of 563027(12%)  x=44
  1248.  
  1249. (In fact, this is the output produced when point is before the `x=44' in the 
  1250. example.) 
  1251.  
  1252.  The two values after `Char:' describe the character following point, first by 
  1253. showing it and second by giving its octal character code. 
  1254.  
  1255.  `point=' is followed by the position of point expressed as a character count. 
  1256. The front of the buffer counts as position 1, one character later as 2, and so 
  1257. on.  The next, larger number is the total number of characters in the buffer. 
  1258. Afterward in parentheses comes the position expressed as a percentage of the 
  1259. total size. 
  1260.  
  1261.  `x=' is followed by the horizontal position of point, in columns from the left 
  1262. edge of the window. 
  1263.  
  1264.  If the buffer has been narrowed, making some of the text at the beginning and 
  1265. the end temporarily off limits, C-x = prints additional text describing the 
  1266. currently accessible range.  For example, it might display this: 
  1267.  
  1268. Char: x (0170)  point=65986 of 563025(12%) <65102 - 68533>  x=44
  1269.  
  1270. where the two extra numbers give the smallest and largest character position 
  1271. that point is allowed to assume.  The characters between those two positions 
  1272. are the accessible ones.  See Narrowing. 
  1273.  
  1274.  If point is at the end of the buffer (or the end of the accessible part), C-x 
  1275. = omits any description of the character after point. The output looks like 
  1276. this: 
  1277.  
  1278. point=563026 of 563025(100%)  x=0
  1279.  
  1280.  
  1281. ΓòÉΓòÉΓòÉ 8.9. Numeric Arguments ΓòÉΓòÉΓòÉ
  1282.  
  1283.  Any Emacs command can be given a numeric argument (also called a prefix 
  1284. argument).  Some commands interpret the argument as a repetition count.  For 
  1285. example, giving an argument of ten to the key C-f moves forward ten characters 
  1286. instead of one.  With these commands, no argument is equivalent to an argument 
  1287. of one.  Negative arguments tell most such commands to move or act in the 
  1288. opposite direction. 
  1289.  
  1290.  If your terminal keyboard has a META key, the easiest way to specify a numeric 
  1291. argument is to type digits and/or a minus sign while holding down the the META 
  1292. key.  For example, 
  1293.  
  1294. M-5 C-n
  1295.  
  1296. would move down five lines.  The characters Meta-1, Meta-2, and so on, as well 
  1297. as Meta--, do this because they are keys bound to commands (digit-argument and 
  1298. negative-argument) that are defined to contribute to an argument for the next 
  1299. command. 
  1300.  
  1301.  Another way of specifying an argument is to use the C-u (universal-argument) 
  1302. command followed by the digits of the argument. With C-u, you can type the 
  1303. argument digits without holding down shift keys.  To type a negative argument, 
  1304. start with a minus sign. Just a minus sign normally means -1.  C-u works on all 
  1305. terminals. 
  1306.  
  1307.  C-u followed by a character which is neither a digit nor a minus sign has the 
  1308. special meaning of ``multiply by four''.  It multiplies the argument for the 
  1309. next command by four.  C-u twice multiplies it by sixteen.  Thus, C-u C-u C-f 
  1310. moves forward sixteen characters.  This is a good way to move forward ``fast'', 
  1311. since it moves about 1/5 of a line in the usual size screen.  Other useful 
  1312. combinations are C-u C-n, C-u C-u C-n (move down a good fraction of a screen), 
  1313. C-u C-u C-o (make ``a lot'' of blank lines), and C-u C-k (kill four lines). 
  1314.  
  1315.  Some commands care only about whether there is an argument, and not about its 
  1316. value.  For example, the command M-q (fill-paragraph) with no argument fills 
  1317. text; with an argument, it justifies the text as well. (See Filling, for more 
  1318. information on M-q.)  Just C-u is a handy way of providing an argument for such 
  1319. commands. 
  1320.  
  1321.  Some commands use the value of the argument as a repeat count, but do 
  1322. something peculiar when there is no argument.  For example, the command C-k 
  1323. (kill-line) with argument n kills n lines, including their terminating 
  1324. newlines.  But C-k with no argument is special: it kills the text up to the 
  1325. next newline, or, if point is right at the end of the line, it kills the 
  1326. newline itself.  Thus, two C-k commands with no arguments can kill a nonblank 
  1327. line, just like C-k with an argument of one.  (See Killing, for more 
  1328. information on C-k.) 
  1329.  
  1330.  A few commands treat a plain C-u differently from an ordinary argument.  A few 
  1331. others may treat an argument of just a minus sign differently from an argument 
  1332. of -1.  These unusual cases will be described when they come up; they are 
  1333. always for reasons of convenience of use of the individual command. 
  1334.  
  1335.  You can use a numeric argument to insert multiple copies of a character.  This 
  1336. is straightforward unless the character is a digit.  To prevent the digit from 
  1337. becoming part of the argument, type another C-u.  That terminates the argument. 
  1338. If you then type another digit, then the digit acts as a self-inserting 
  1339. character and uses the argument as a repeat count. 
  1340.  
  1341.  We use the term ``prefix argument'' as well as ``numeric argument'' to 
  1342. emphasize that you type the argument before the command, and to distinguish 
  1343. these arguments from minibuffer arguments that come after the command. 
  1344.  
  1345.  
  1346. ΓòÉΓòÉΓòÉ 9. Undoing Changes ΓòÉΓòÉΓòÉ
  1347.  
  1348.  Emacs allows all changes made in the text of a buffer to be undone, up to a 
  1349. certain amount of change.  Each buffer records changes individually, and the 
  1350. undo command always applies to the current buffer.  Usually each editing 
  1351. command makes a separate entry in the undo records, but some commands such as 
  1352. query-replace make many entries, and very simple commands such as 
  1353. self-inserting characters are often grouped to make undoing less tedious. 
  1354.  
  1355. C-x u 
  1356.           Undo one batch of changes---usually, one command worth (undo). 
  1357.  
  1358. C-_ 
  1359.           The same. 
  1360.  
  1361.  The command C-x u or C-_ is how you undo.  The first time you give this 
  1362. command, it undoes the last change.  Point moves back to where it was before 
  1363. the command that made the change. 
  1364.  
  1365.  Consecutive repetitions of the C-_ or C-x u commands undo earlier and earlier 
  1366. changes, back to the limit of what has been recorded.  If all recorded changes 
  1367. have already been undone, the undo command prints an error message and does 
  1368. nothing. 
  1369.  
  1370.  Any command other than an undo command breaks the sequence of undo commands. 
  1371. Starting at this moment, the previous undo commands are considered ordinary 
  1372. changes that can themselves be undone.  Thus, you can redo changes you have 
  1373. undone by typing C-f or any other command that will have no important effect, 
  1374. and then using more undo commands. 
  1375.  
  1376.  If you notice that a buffer has been modified accidentally, the easiest way to 
  1377. recover is to type C-_ repeatedly until the stars disappear from the front of 
  1378. the mode line.  At this time, all the modifications you made have been 
  1379. cancelled.  If you do not remember whether you changed the buffer deliberately, 
  1380. type C-_ once, and when you see the last change you made undone, you will 
  1381. remember why you made it.  If it was an accident, leave it undone.  If it was 
  1382. deliberate, redo the change as described in the preceding paragraph. 
  1383.  
  1384.  Whenever an undo command makes the stars disappear from the mode line, it 
  1385. means that the buffer contents are the same as they were when the file was last 
  1386. read in or saved. 
  1387.  
  1388.  Not all buffers record undo information.  Buffers whose names start with 
  1389. spaces don't; these buffers are used internally by Emacs and its extensions to 
  1390. hold text that users don't normally look at or edit. 
  1391.  
  1392.  You cannot undo mere cursor motion; only changes in the buffer contents save 
  1393. undo information.  However, some cursor motion commands set the mark, so if you 
  1394. use these commands from time to time, you can move back to the neighborhoods 
  1395. you have moved through by popping the mark ring (see Mark Ring). 
  1396.  
  1397.  When the undo information of a buffer becomes too large, Emacs discards the 
  1398. oldest undo information from time to time (during garbage collection).  You can 
  1399. specify how much undo information to keep by setting two variables: undo-limit 
  1400. and undo-strong-limit. Their values are expressed in units of bytes of space. 
  1401.  
  1402.  The variable undo-limit sets a soft limit: Emacs keeps undo data for enough 
  1403. commands to reach this size, and perhaps exceed it, but does not keep data for 
  1404. any earlier commands beyond that.  Its default value is 20000.  The variable 
  1405. undo-strong-limit sets a harsher limit: the command which pushes the size past 
  1406. this amount is itself forgotten.  Its default value is 30000. 
  1407.  
  1408.  Regardless of the values of those variables, the most recent change is never 
  1409. discarded, so there is no danger that garbage collection occurring right after 
  1410. an unintentional large change might prevent you from undoing it. 
  1411.  
  1412.  The reason the undo command has two keys, C-x u and C-_, set up to run it is 
  1413. that it is worthy of a single-character key, but on some keyboards it is not 
  1414. obvious how to type C-_. C-x u is an alternative you can type in the same 
  1415. fashion on any terminal. 
  1416.  
  1417.  
  1418. ΓòÉΓòÉΓòÉ 10. The Minibuffer ΓòÉΓòÉΓòÉ
  1419.  
  1420.  The minibuffer is the facility used by Emacs commands to read arguments more 
  1421. complicated than a single number.  Minibuffer arguments can be file names, 
  1422. buffer names, Lisp function names, Emacs command names, Lisp expressions, and 
  1423. many other things, depending on the command reading the argument.  You can use 
  1424. the usual Emacs editing commands in the minibuffer to edit the argument text. 
  1425.  
  1426.  When the minibuffer is in use, it appears in the echo area, and the terminal's 
  1427. cursor moves there.  The beginning of the minibuffer line displays a prompt 
  1428. which says what kind of input you should supply and how it will be used.  Often 
  1429. this prompt is derived from the name of the command that the argument is for. 
  1430. The prompt normally ends with a colon. 
  1431.  
  1432.  Sometimes a default argument appears in parentheses after the colon; it too is 
  1433. part of the prompt.  The default will be used as the argument value if you 
  1434. enter an empty argument (e.g., just type RET). For example, commands that read 
  1435. buffer names always show a default, which is the name of the buffer that will 
  1436. be used if you type just RET. 
  1437.  
  1438.  The simplest way to enter a minibuffer argument is to type the text you want, 
  1439. terminated by RET which exits the minibuffer.  You can get out of the 
  1440. minibuffer, canceling the command that it was for, by typing C-g. 
  1441.  
  1442.  Since the minibuffer uses the screen space of the echo area, it can conflict 
  1443. with other ways Emacs customarily uses the echo area.  Here is how Emacs 
  1444. handles such conflicts: 
  1445.  
  1446. o If a command gets an error while you are in the minibuffer, this does not 
  1447.   cancel the minibuffer.  However, the echo area is needed for the error 
  1448.   message and therefore the minibuffer itself is hidden for a while.  It comes 
  1449.   back after a few seconds, or as soon as you type anything. 
  1450.  
  1451. o If in the minibuffer you use a command whose purpose is to print a message in 
  1452.   the echo area, such as C-x =, the message is printed normally, and the 
  1453.   minibuffer is hidden for a while.  It comes back after a few seconds, or as 
  1454.   soon as you type anything. 
  1455.  
  1456. o Echoing of keystrokes does not take place while the minibuffer is in use. 
  1457.  
  1458.  
  1459. ΓòÉΓòÉΓòÉ 10.1. Minibuffers for File Names ΓòÉΓòÉΓòÉ
  1460.  
  1461.  Sometimes the minibuffer starts out with text in it.  For example, when you 
  1462. are supposed to give a file name, the minibuffer starts out containing the 
  1463. default directory, which ends with a slash.  This is to inform you which 
  1464. directory the file will be found in if you do not specify a directory.  For 
  1465. example, the minibuffer might start out with 
  1466.  
  1467. Find File: /u2/emacs/src/
  1468.  
  1469. where `Find File: ' is the prompt.  Typing buffer.c specifies the file 
  1470. `/u2/emacs/src/buffer.c'.  To find files in nearby directories, use ..; thus, 
  1471. if you type ../lisp/simple.el, you will get the file named 
  1472. `/u2/emacs/lisp/simple.el'.  Alternatively, you can kill with M-DEL the 
  1473. directory names you don't want (see Words). 
  1474.  
  1475.  You can also type an absolute file name, one starting with a slash or a tilde, 
  1476. ignoring the default directory.  For example, to find the file `/etc/termcap', 
  1477. just insert that name, giving these minibuffer contents: 
  1478.  
  1479. Find File: /u2/emacs/src//etc/termcap
  1480.  
  1481. Two slashes in a row are not normally meaningful in a file name, but they are 
  1482. allowed in GNU Emacs.  They mean, ``ignore everything before the second slash 
  1483. in the pair.''  Thus, `/u2/emacs/src/' is ignored, and you get the file 
  1484. `/etc/termcap'. 
  1485.  
  1486.  If you set insert-default-directory to nil, the default directory is not 
  1487. inserted in the minibuffer.  This way, the minibuffer starts out empty.  But 
  1488. the name you type, if relative, is still interpreted with respect to the same 
  1489. default directory. 
  1490.  
  1491.  
  1492. ΓòÉΓòÉΓòÉ 10.2. Editing in the Minibuffer ΓòÉΓòÉΓòÉ
  1493.  
  1494.  The minibuffer is an Emacs buffer (albeit a peculiar one), and the usual Emacs 
  1495. commands are available for editing the text of an argument you are entering. 
  1496.  
  1497.  Since RET in the minibuffer is defined to exit the minibuffer, inserting a 
  1498. newline into the minibuffer must be done with C-o or with C-q LFD.  (Recall 
  1499. that a newline is really the LFD character.) 
  1500.  
  1501.  The minibuffer has its own window which always has space on the screen but 
  1502. acts as if it were not there when the minibuffer is not in use.  When the 
  1503. minibuffer is in use, its window is just like the others; you can switch to 
  1504. another window with C-x o, edit text in other windows and perhaps even visit 
  1505. more files, before returning to the minibuffer to submit the argument.  You can 
  1506. kill text in another window, return to the minibuffer window, and then yank the 
  1507. text to use it in the argument. See Windows. 
  1508.  
  1509.  There are some restrictions on the use of the minibuffer window, however. You 
  1510. cannot switch buffers in it---the minibuffer and its window are permanently 
  1511. attached.  Also, you cannot split or kill the minibuffer window.  But you can 
  1512. make it taller in the normal fashion with C-x ^. 
  1513.  
  1514.  If while in the minibuffer you issue a command that displays help text of any 
  1515. sort in another window, you can use the C-M-v command while in the minibuffer 
  1516. to scroll the help text.  This lasts until you exit the minibuffer.  This 
  1517. feature is especially useful if a completing minibuffer gives you a list of 
  1518. possible completions.  See Other Window. 
  1519.  
  1520.  You can't use a command that reads a minibuffer argument while you are in the 
  1521. minibuffer window.  This rule is to prevent recursive minibuffers from 
  1522. confusing novice users.  If you want to be able to use such commands in the 
  1523. minibuffer, set the variable enable-recursive-minibuffers to a non-nil value. 
  1524.  
  1525.  
  1526. ΓòÉΓòÉΓòÉ 10.3. Completion ΓòÉΓòÉΓòÉ
  1527.  
  1528.  For certain kinds of arguments, you can use completion to enter the argument 
  1529. value.  Completion means that you type part of the argument, then Emacs visibly 
  1530. fills in the rest, or as much as can be determined from the part you have 
  1531. typed. 
  1532.  
  1533.  When completion is available, certain keys---TAB, RET, and SPC---are rebound 
  1534. to complete the text present in the minibuffer into a longer string that it 
  1535. stands for, by matching it against a set of completion alternatives provided by 
  1536. the command reading the argument.  ? is defined to display a list of possible 
  1537. completions of what you have inserted. 
  1538.  
  1539.  For example, when M-x uses the minibuffer to read the name of a command, it 
  1540. provides a list of all available Emacs command names to complete against.  The 
  1541. completion keys match the text in the minibuffer against all the command names, 
  1542. find any additional name characters implied by the ones already present in the 
  1543. minibuffer, and add those characters to the ones you have given.  This is what 
  1544. makes it possible to type M-x ins SPC b RET instead of M-x insert-buffer RET 
  1545. (for example). 
  1546.  
  1547.  Case is normally significant in completion, because it is significant in most 
  1548. of the names that you can complete (buffer names, file names and command 
  1549. names).  Thus, `fo' does not complete to `Foo'. Completion does ignore case 
  1550. distinctions for certain arguments in which case does not matter. 
  1551.  
  1552.  
  1553. ΓòÉΓòÉΓòÉ 10.3.1. Completion Example ΓòÉΓòÉΓòÉ
  1554.  
  1555.  A concrete example may help here.  If you type M-x au TAB, the TAB looks for 
  1556. alternatives (in this case, command names) that start with `au'.  There are 
  1557. only two: auto-fill-mode and auto-save-mode.  These are the same as far as 
  1558. auto-, so the `au' in the minibuffer changes to `auto-'. 
  1559.  
  1560.  If you type TAB again immediately, there are multiple possibilities for the 
  1561. very next character---it could be `s' or `f'---so no more characters are added; 
  1562. instead, TAB displays a list of all possible completions in another window. 
  1563.  
  1564.  If you go on to type f TAB, this TAB sees `auto-f'.  The only command name 
  1565. starting this way is auto-fill-mode, so completion fills in the rest of that. 
  1566. You now have `auto-fill-mode' in the minibuffer after typing just au TAB f TAB. 
  1567. Note that TAB has this effect because in the minibuffer it is bound to the 
  1568. command minibuffer-complete when completion is available. 
  1569.  
  1570.  
  1571. ΓòÉΓòÉΓòÉ 10.3.2. Completion Commands ΓòÉΓòÉΓòÉ
  1572.  
  1573.  Here is a list of the completion commands defined in the minibuffer when 
  1574. completion is available. 
  1575.  
  1576. TAB 
  1577.           Complete the text in the minibuffer as much as possible 
  1578.           (minibuffer-complete). 
  1579.  
  1580. SPC 
  1581.           Complete the minibuffer text, but don't go beyond one word 
  1582.           (minibuffer-complete-word). 
  1583.  
  1584. RET 
  1585.           Submit the text in the minibuffer as the argument, possibly 
  1586.           completing first as described below (minibuffer-complete-and-exit). 
  1587.  
  1588.           Print a list of all possible completions of the text in the 
  1589.           minibuffer (minibuffer-list-completions). 
  1590.  
  1591.  SPC completes much like TAB, but never goes beyond the next hyphen or space. 
  1592. If you have `auto-f' in the minibuffer and type SPC, it finds that the 
  1593. completion is `auto-fill-mode', but it stops completing after `fill-'.  This 
  1594. gives `auto-fill-'.  Another SPC at this point completes all the way to 
  1595. `auto-fill-mode'.  SPC in the minibuffer when completion is available runs the 
  1596. command minibuffer-complete-word. 
  1597.  
  1598.  There are three different ways that RET can work in completing minibuffers, 
  1599. depending on how the argument will be used. 
  1600.  
  1601. o Strict completion is used when it is meaningless to give any argument except 
  1602.   one of the known alternatives.  For example, when C-x k reads the name of a 
  1603.   buffer to kill, it is meaningless to give anything but the name of an 
  1604.   existing buffer.  In strict completion, RET refuses to exit if the text in 
  1605.   the minibuffer does not complete to an exact match. 
  1606.  
  1607. o Cautious completion is similar to strict completion, except that RET exits 
  1608.   only if the text was an exact match already, not needing completion.  If the 
  1609.   text is not an exact match, RET does not exit, but it does complete the text. 
  1610.   If it completes to an exact match, a second RET will exit. 
  1611.  
  1612.   Cautious completion is used for reading file names for files that must 
  1613.   already exist. 
  1614.  
  1615. o Permissive completion is used when any string whatever is meaningful, and the 
  1616.   list of completion alternatives is just a guide. For example, when C-x C-f 
  1617.   reads the name of a file to visit, any file name is allowed, in case you want 
  1618.   to create a file.  In permissive completion, RET takes the text in the 
  1619.   minibuffer exactly as given, without completing it. 
  1620.  
  1621.  The completion commands display a list of all possible completions in a window 
  1622. whenever there is more than one possibility for the very next character.  Also, 
  1623. typing ? explicitly requests such a list.  If the list of completions is long, 
  1624. you can scroll it with C-M-v (see Other Window). 
  1625.  
  1626.  When completion is done on file names, certain file names are usually ignored. 
  1627. The variable completion-ignored-extensions contains a list of strings; a file 
  1628. whose name ends in any of those strings is ignored as a possible completion. 
  1629. The standard value of this variable has several elements including ".o", 
  1630. ".elc", ".dvi" and "~".  The effect is that, for example, `foo' can complete to 
  1631. `foo.c' even though `foo.o' exists as well. However, if all the possible 
  1632. completions end in ``ignored'' strings, then they are not ignored.  Ignored 
  1633. extensions do not apply to lists of completions---those always mention all 
  1634. possible completions. 
  1635.  
  1636.  Normally, a completion command that finds the next character is undetermined 
  1637. automatically displays a list of all possible completions.  If the variable 
  1638. completion-auto-help is set to nil, this does not happen, and you must type ? 
  1639. to display the possible completions. 
  1640.  
  1641.  
  1642. ΓòÉΓòÉΓòÉ 10.4. Minibuffer History ΓòÉΓòÉΓòÉ
  1643.  
  1644.  Every argument that you enter with the minibuffer is saved on a minibuffer 
  1645. history list so that you can use it again later in another argument.  Special 
  1646. commands load the text of an earlier argument in the minibuffer.  They discard 
  1647. the old minibuffer contents, so you can think of them as moving through the 
  1648. history of previous arguments. 
  1649.  
  1650. M-p 
  1651.           Move to the next earlier argument string saved in the minibuffer 
  1652.           history (previous-history-element). 
  1653.  
  1654. M-n 
  1655.           Move to the next later argument string saved in the minibuffer 
  1656.           history (next-history-element). 
  1657.  
  1658. M-r regexp RET 
  1659.           Move to an earlier saved argument in the minibuffer history that has 
  1660.           a match for regexp (previous-matching-history-element). 
  1661.  
  1662. M-s regexp RET 
  1663.           Move to a later saved argument in the minibuffer history that has a 
  1664.           match for regexp (next-matching-history-element). 
  1665.  
  1666.  The simplest way to reuse the saved arguments in the history list is to move 
  1667. through the history list one element at a time.  While in the minibuffer, type 
  1668. M-p (previous-history-element) to ``move to'' the next earlier minibuffer 
  1669. input, and use M-n (next-history-element) to ``move to'' the next later input. 
  1670.  
  1671.  The previous input that you fetch from the history entirely replaces the 
  1672. contents of the minibuffer.  To use it as the argument, exit the minibuffer as 
  1673. usual with RET.  You can also edit the text before you reuse it; this does not 
  1674. change the history element that you ``moved'' to, but your new argument does go 
  1675. at the end of the history list in its own right. 
  1676.  
  1677.  There are also commands to search forward or backward through the history.  As 
  1678. of this writing, they search for history elements that match a regular 
  1679. expression that you specify with the minibuffer. M-r 
  1680. (previous-matching-history-element) searches older elements in the history, 
  1681. while M-s (next-matching-history-element) searches newer elements.  By special 
  1682. dispensation, these commands can use the minibuffer to read their arguments 
  1683. even though you are already in the minibuffer when you issue them. 
  1684.  
  1685.  All uses of the minibuffer record your input on a history list, but there are 
  1686. separate history lists for different kinds of input.  For example, there is a 
  1687. list for file names, used by all the commands that read file names.  There is a 
  1688. list for arguments of commands like query-replace.  There are also very 
  1689. specific history lists, such as the one that compile uses for compilation 
  1690. commands.  Finally, there is one ``miscellaneous'' history list that most 
  1691. minibuffer arguments use. 
  1692.  
  1693.  
  1694. ΓòÉΓòÉΓòÉ 10.5. Repeating Minibuffer Commands ΓòÉΓòÉΓòÉ
  1695.  
  1696.  Every command that uses the minibuffer at least once is recorded on a special 
  1697. history list, together with the values of their arguments, so that you can 
  1698. repeat the entire command.  In particular, every use of M-x is recorded, since 
  1699. M-x uses the minibuffer to read the command name. 
  1700.  
  1701. C-x ESC ESC 
  1702.           Re-execute a recent minibuffer command 
  1703.           (repeat-complex-command). 
  1704.  
  1705. M-x list-command-history 
  1706.           Display the entire command history, showing all the commands C-x ESC 
  1707.           ESC can repeat, most recent first. 
  1708.  
  1709.  C-x ESC ESC is used to re-execute a recent minibuffer-using command.  With no 
  1710. argument, it repeats the last such command.  A numeric argument specifies which 
  1711. command to repeat; one means the last one, and larger numbers specify earlier 
  1712. ones. 
  1713.  
  1714.  C-x ESC ESC works by turning the previous command into a Lisp expression and 
  1715. then entering a minibuffer initialized with the text for that expression.  If 
  1716. you type just RET, the command is repeated as before.  You can also change the 
  1717. command by editing the Lisp expression.  Whatever expression you finally submit 
  1718. is what will be executed.  The repeated command is added to the front of the 
  1719. command history unless it is identical to the most recently executed command 
  1720. already there. 
  1721.  
  1722.  Even if you don't understand Lisp syntax, it will probably be obvious which 
  1723. command is displayed for repetition.  If you do not change the text, it will 
  1724. repeat exactly as before. 
  1725.  
  1726.  Once inside the minibuffer for C-x ESC ESC, you can use the minibuffer history 
  1727. commands (M-p, M-n, M-r, M-s; see Minibuffer History) to move through the 
  1728. history list of saved entire commands.  After finding the desired previous 
  1729. command, you can edit its expression as usual and then resubmit it by typing 
  1730. RET as usual. 
  1731.  
  1732.  The list of previous minibuffer-using commands is stored as a Lisp list in the 
  1733. variable command-history.  Each element is a Lisp expression which describes 
  1734. one command and its arguments.  Lisp programs can reexecute a command by 
  1735. calling eval with the command-history element. 
  1736.  
  1737.  
  1738. ΓòÉΓòÉΓòÉ 11. Running Commands by Name ΓòÉΓòÉΓòÉ
  1739.  
  1740.  The Emacs commands that are used often or that must be quick to type are bound 
  1741. to keys---short sequences of characters---for convenient use.  Other Emacs 
  1742. commands that do not need to be brief are not bound to keys; to run them, you 
  1743. must refer to them by name. 
  1744.  
  1745.  A command name is, by convention, made up of one or more words, separated by 
  1746. hyphens; for example, auto-fill-mode or manual-entry.  The use of English words 
  1747. makes the command name easier to remember than a key made up of obscure 
  1748. characters, even though it is more characters to type. 
  1749.  
  1750.  The way to run a command by name is to start with M-x, type the command name, 
  1751. and finish it with RET.  M-x uses the minibuffer to read the command name.  RET 
  1752. exits the minibuffer and runs the command.  The string `M-x' appears at the 
  1753. beginning of the minibuffer as a prompt to remind you to enter the name of a 
  1754. command to be run.  See Minibuffer, for full information on the features of the 
  1755. minibuffer. 
  1756.  
  1757.  You can use completion to enter the command name.  For example, the command 
  1758. forward-char can be invoked by name by typing 
  1759.  
  1760. M-x forward-char RET
  1761.  
  1762. or
  1763.  
  1764. M-x fo TAB c RET
  1765.  
  1766. Note that forward-char is the same command that you invoke with the key C-f. 
  1767. You can run any Emacs command by its name using M-x, whether or not any keys 
  1768. are bound to it. 
  1769.  
  1770.  If you type C-g while the command name is being read, you cancel the M-x 
  1771. command and get out of the minibuffer, ending up at top level. 
  1772.  
  1773.  To pass a numeric argument to the command you are invoking with M-x, specify 
  1774. the numeric argument before the M-x.  M-x passes the argument along to the 
  1775. command it runs.  The argument value appears in the prompt while the command 
  1776. name is being read. 
  1777.  
  1778.  Normally, when describing a command that is run by name, we omit the RET that 
  1779. is needed to terminate the name.  Thus we might speak of M-x auto-fill-mode 
  1780. rather than M-x auto-fill-mode RET.  We mention the RET only when there is a 
  1781. need to emphasize its presence, such as when we show the command together with 
  1782. following arguments. 
  1783.  
  1784.  M-x is defined to run the command execute-extended-command, which is 
  1785. responsible for reading the name of another command and invoking it. 
  1786.  
  1787.  
  1788. ΓòÉΓòÉΓòÉ 12. Help ΓòÉΓòÉΓòÉ
  1789.  
  1790.  Emacs provides extensive help features accessible through a single character, 
  1791. C-h.  C-h is a prefix key that is used only for documentation-printing 
  1792. commands.  The characters that you can type after C-h are called help options. 
  1793. One help option is C-h; that is how you ask for help about using C-h. 
  1794.  
  1795.  C-h C-h prints a list of the possible help options, and then asks you to go 
  1796. ahead and type the option.  It prompts with this string: 
  1797.  
  1798. a b c f i k l m n p s t v w C-c C-d C-n C-w.  Type C-h for more help:
  1799.  
  1800. You should then type one of those characters. 
  1801.  
  1802.  Typing a third C-h displays a description of what the options mean; it still 
  1803. waits for you to type an option.  To cancel, type C-g. 
  1804.  
  1805.  
  1806. ΓòÉΓòÉΓòÉ 12.1. Help Summary ΓòÉΓòÉΓòÉ
  1807.  
  1808.  Here is a summary of the defined help commands. 
  1809.  
  1810. C-h a regexp RET 
  1811.           Display list of commands whose names match regexp (command-apropos). 
  1812.  
  1813. C-h b 
  1814.           Display a table of all key bindings in effect now, in this order: 
  1815.           minor mode bindings, major mode bindings, and global bindings 
  1816.           (describe-bindings). 
  1817.  
  1818. C-h c key 
  1819.           Print the name of the command that key runs (describe-key-briefly). 
  1820.           c is for `character'.  For more extensive information on key, use C-h 
  1821.           k. 
  1822.  
  1823. C-h f function RET 
  1824.           Display documentation on the Lisp function named function 
  1825.           (describe-function).  Since commands are Lisp functions, a command 
  1826.           name may be used. 
  1827.  
  1828. C-h i 
  1829.           Run Info, the program for browsing documentation files (info). The 
  1830.           complete Emacs manual is available on-line in Info. 
  1831.  
  1832. C-h k key 
  1833.           Display name and documentation of the command that key runs 
  1834.           (describe-key). 
  1835.  
  1836. C-h l 
  1837.           Display a description of the last 100 characters you typed 
  1838.           (view-lossage). 
  1839.  
  1840. C-h m 
  1841.           Display documentation of the current major mode (describe-mode). 
  1842.  
  1843. C-h n 
  1844.           Display documentation of Emacs changes, most recent first 
  1845.           (view-emacs-news). 
  1846.  
  1847. C-h p 
  1848.           Find packages by topic keyword (finder-by-keyword). 
  1849.  
  1850. C-h s 
  1851.           Display current contents of the syntax table, plus an explanation of 
  1852.           what they mean (describe-syntax).  See Syntax. 
  1853.  
  1854. C-h t 
  1855.           Enter the Emacs interactive tutorial (help-with-tutorial). 
  1856.  
  1857. C-h v var RET 
  1858.           Display the documentation of the Lisp variable var 
  1859.           (describe-variable). 
  1860.  
  1861. C-h w command RET 
  1862.           Print which keys run the command named command (where-is). 
  1863.  
  1864. C-h C-f function RET 
  1865.           Enter Info and go to the node documenting the Emacs function function 
  1866.           (info-goto-emacs-command-node). 
  1867.  
  1868. C-h C-k key 
  1869.           Enter Info and go to the node where the key sequence key is 
  1870.           documented (info-goto-emacs-key-command-node). 
  1871.  
  1872.  
  1873. ΓòÉΓòÉΓòÉ 12.2. Documentation for a Key ΓòÉΓòÉΓòÉ
  1874.  
  1875.  The most basic C-h options are C-h c (describe-key-briefly) and C-h k 
  1876. (describe-key). C-h c key prints in the echo area the name of the command that 
  1877. key is bound to.  For example, C-h c C-f prints `forward-char'.  Since command 
  1878. names are chosen to describe what the commands do, this is a good way to get a 
  1879. very brief description of what key does. 
  1880.  
  1881.  C-h k key is similar but gives more information: it displays the documentation 
  1882. string of the command as well as its name. This is too big for the echo area, 
  1883. so a window is used for the display. 
  1884.  
  1885.  C-h c and C-h k work for any sort of key sequences, including function keys 
  1886. and mouse events. 
  1887.  
  1888.  
  1889. ΓòÉΓòÉΓòÉ 12.3. Help by Command or Variable Name ΓòÉΓòÉΓòÉ
  1890.  
  1891.  C-h f (describe-function) reads the name of a Lisp function using the 
  1892. minibuffer, then displays that function's documentation string in a window. 
  1893. Since commands are Lisp functions, you can use this to get the documentation of 
  1894. a command that is known by name.  For example, 
  1895.  
  1896. C-h f auto-fill-mode RET
  1897.  
  1898. displays the documentation of auto-fill-mode.  This is the only way to get the 
  1899. documentation of a command that is not bound to any key (one which you would 
  1900. normally run using M-x). 
  1901.  
  1902.  C-h f is also useful for Lisp functions that you are planning to use in a Lisp 
  1903. program.  For example, if you have just written the expression (make-vector 
  1904. len) and want to check that you are using make-vector properly, type C-h f 
  1905. make-vector RET. Because C-h f allows all function names, not just command 
  1906. names, you may find that some of your favorite abbreviations that work in M-x 
  1907. don't work in C-h f.  An abbreviation may be unique among command names yet 
  1908. fail to be unique when other function names are allowed. 
  1909.  
  1910.  The function name for C-h f to describe has a default which is used if you 
  1911. type RET leaving the minibuffer empty.  The default is the function called by 
  1912. the innermost Lisp expression in the buffer around point, provided that is a 
  1913. valid, defined Lisp function name.  For example, if point is located following 
  1914. the text `(make-vector (car x)', the innermost list containing point is the one 
  1915. that starts with `(make-vector', so the default is to describe the function 
  1916. make-vector. 
  1917.  
  1918.  C-h f is often useful just to verify that you have the right spelling for the 
  1919. function name.  If C-h f mentions a default in the prompt, you have typed the 
  1920. name of a defined Lisp function.  If that is all you want to know, just type 
  1921. C-g to cancel the C-h f command, then go on editing. 
  1922.  
  1923.  C-h w command RET tells you what keys are bound to command.  It prints a list 
  1924. of the keys in the echo area.  If it says the command is not on any key, you 
  1925. must use M-x to run it. 
  1926.  
  1927.  C-h v (describe-variable) is like C-h f but describes Lisp variables instead 
  1928. of Lisp functions.  Its default is the Lisp symbol around or before point, but 
  1929. only if that is the name of a known Lisp variable.  See Variables. 
  1930.  
  1931.  
  1932. ΓòÉΓòÉΓòÉ 12.4. Apropos ΓòÉΓòÉΓòÉ
  1933.  
  1934.  A more sophisticated sort of question to ask is, ``What are the commands for 
  1935. working with files?''  To ask this question, type C-h a file RET, which 
  1936. displays a list of all command names that contain `file', including copy-file, 
  1937. find-file, and so on.  With each command name appears a brief description of 
  1938. how to use the command, and what keys you can currently invoke it with.  For 
  1939. example, it would say that you can invoke find-file by typing C-x C-f.  The a 
  1940. in C-h a stands for `Apropos'; C-h a runs the command command-apropos. 
  1941.  
  1942.  Because C-h a looks only for functions whose names contain the string which 
  1943. you specify, you must use ingenuity in choosing the string.  If you are looking 
  1944. for commands for killing backwards and C-h a kill-backwards RET doesn't reveal 
  1945. any, don't give up. Try just kill, or just backwards, or just back.  Be 
  1946. persistent.  Also note that you can use a regular expression as the argument, 
  1947. for more flexibility (see Regexps). 
  1948.  
  1949.  Here is a set of arguments to give to C-h a that covers many classes of Emacs 
  1950. commands, since there are strong conventions for naming the standard Emacs 
  1951. commands.  By giving you a feel for the naming conventions, this set should 
  1952. also serve to aid you in developing a technique for picking apropos strings. 
  1953.  
  1954. char, line, word, sentence, paragraph, region, page, sexp, list, defun, rect, 
  1955. buffer, frame, window, file, dir, register, mode, beginning, end, forward, 
  1956. backward, next, previous, up, down, search, goto, kill, delete, mark, insert, 
  1957. yank, fill, indent, case, change, set, what, list, find, view, describe. 
  1958.  
  1959.  To list all Lisp symbols that contain a match for a regexp, not just the ones 
  1960. that are defined as commands, use the command M-x apropos instead of C-h a. 
  1961. This command does not check key bindings by default; specify a numeric argument 
  1962. if you want it to check them. 
  1963.  
  1964.  The super-apropos command is like apropos except that it searches 
  1965. documentation strings as well as symbol names for matches for the specified 
  1966. regular expression. 
  1967.  
  1968.  
  1969. ΓòÉΓòÉΓòÉ 12.5. Keyword Search for Lisp Libraries ΓòÉΓòÉΓòÉ
  1970.  
  1971. The C-h p command lets you search the standard Emacs Lisp libraries by topic 
  1972. keywords.  Here is a partial list of keywords you can use: 
  1973.  
  1974. `abbrev' 
  1975.           Abbreviation handling, typing shortcuts, macros. 
  1976.  
  1977. `bib' 
  1978.           Support for the bibliography processor bib. 
  1979.  
  1980. `c' 
  1981.           C and C++ language support. 
  1982.  
  1983. `calendar' 
  1984.           Calendar and time management support. 
  1985.  
  1986. `comm' 
  1987.           Communications, networking, remote access to files. 
  1988.  
  1989. `docs' 
  1990.           Support for Emacs documentation. 
  1991.  
  1992. `emulations' 
  1993.           Emulations of other editors. 
  1994.  
  1995. `extensions' 
  1996.           Emacs Lisp language extensions. 
  1997.  
  1998. `faces' 
  1999.           Support for using faces (fonts and colors; see Faces). 
  2000.  
  2001. `games' 
  2002.           Games, jokes and amusements. 
  2003.  
  2004. `hardware' 
  2005.           Support for interfacing with exotic hardware. 
  2006.  
  2007. `help' 
  2008.           Support for on-line help systems. 
  2009.  
  2010. `i18n' 
  2011.           Internationalization and alternate character-set support. 
  2012.  
  2013. `internal' 
  2014.           Code for Emacs internals, build process, defaults. 
  2015.  
  2016. `languages' 
  2017.           Specialized modes for editing programming languages. 
  2018.  
  2019. `lisp' 
  2020.           Support for using Lisp (including Emacs Lisp). 
  2021.  
  2022. `local' 
  2023.           Libraries local to your site. 
  2024.  
  2025. `maint' 
  2026.           Maintenance aids for the Emacs development group. 
  2027.  
  2028. `mail' 
  2029.           Modes for electronic-mail handling. 
  2030.  
  2031. `news' 
  2032.           Support for netnews reading and posting. 
  2033.  
  2034. `non-text' 
  2035.           Support for editing files that are not ordinary text. 
  2036.  
  2037. `processes' 
  2038.           Process, subshell, compilation, and job control support. 
  2039.  
  2040. `terminals' 
  2041.           Support for terminal types. 
  2042.  
  2043. `tex' 
  2044.           Support for the TeX formatter. 
  2045.  
  2046. `tools' 
  2047.           Programming tools. 
  2048.  
  2049. `unix' 
  2050.           Front-ends/assistants for, or emulators of, Unix features. 
  2051.  
  2052. `vms' 
  2053.           Support code for VMS. 
  2054.  
  2055. `wp' 
  2056.           Word processing. 
  2057.  
  2058.  
  2059. ΓòÉΓòÉΓòÉ 12.6. Other Help Commands ΓòÉΓòÉΓòÉ
  2060.  
  2061.  C-h i (info) runs the Info program, which is used for browsing through 
  2062. structured documentation files.  The entire Emacs manual is available within 
  2063. Info.  Eventually all the documentation of the GNU system will be available. 
  2064. Type h after entering Info to run a tutorial on using Info. 
  2065.  
  2066.  There are two special help commands for accessing Emacs documentation through 
  2067. Info.  C-h C-f function RET enters Info and goes straight to the documentation 
  2068. of the Emacs function function.  C-h C-k key enters Info and goes straight to 
  2069. the documentation of the key key.  These two keys run the commands 
  2070. Info-goto-emacs-command-node and Info-goto-emacs-key-command-node. 
  2071.  
  2072.  If something surprising happens, and you are not sure what commands you typed, 
  2073. use C-h l (view-lossage).  C-h l prints the last 100 command characters you 
  2074. typed in.  If you see commands that you don't know, you can use C-h c to find 
  2075. out what they do. 
  2076.  
  2077.  Emacs has numerous major modes, each of which redefines a few keys and makes a 
  2078. few other changes in how editing works.  C-h m (describe-mode) prints 
  2079. documentation on the current major mode, which normally describes all the 
  2080. commands that are changed in this mode. 
  2081.  
  2082.  C-h b (describe-bindings) and C-h s (describe-syntax) present other 
  2083. information about the current Emacs mode.  C-h b displays a list of all the key 
  2084. bindings now in effect; the local bindings defined by the current minor modes 
  2085. first, then the local bindings defined by the current major mode, and finally 
  2086. the global bindings (see Key Bindings).  C-h s displays the contents of the 
  2087. syntax table, with explanations of each character's syntax (see Syntax). 
  2088.  
  2089.  You can get a similar list for a particular prefix key by typing C-h after the 
  2090. prefix key.  (There are a few prefix keys for which this does not work---those 
  2091. that provide their own bindings for C-h.  One of these is ESC, because ESC C-h 
  2092. is actually C-M-h, which marks a defun.) 
  2093.  
  2094.  The other C-h options display various files of useful information. C-h C-w 
  2095. displays the full details on the complete absence of warranty for GNU Emacs. 
  2096. C-h n (view-emacs-news) displays the file `emacs/etc/NEWS', which contains 
  2097. documentation on Emacs changes arranged chronologically.  C-h t 
  2098. (help-with-tutorial) displays the learn-by-doing Emacs tutorial.  C-h C-c 
  2099. (describe-copying) displays the file `emacs/etc/COPYING', which tells you the 
  2100. conditions you must obey in distributing copies of Emacs.  C-h C-d 
  2101. (describe-distribution) displays the file `emacs/etc/DISTRIB', which tells you 
  2102. how you can order a copy of the latest version of Emacs. 
  2103.  
  2104.  
  2105. ΓòÉΓòÉΓòÉ 13. The Mark and the Region ΓòÉΓòÉΓòÉ
  2106.  
  2107.  There are many Emacs commands which operate on an arbitrary contiguous part of 
  2108. the current buffer.  To specify the text for such a command to operate on, you 
  2109. set the mark at one end of it, and move point to the other end.  The text 
  2110. between point and the mark is called the region. You can move point or the mark 
  2111. to adjust the boundaries of the region.  It doesn't matter which one is set 
  2112. first chronologically, or which one comes earlier in the text. 
  2113.  
  2114.  Once the mark has been set, it remains where you put it until it is set again 
  2115. at another place.  The mark remains fixed with respect to the preceding 
  2116. character if text is inserted or deleted in the buffer.  Each Emacs buffer has 
  2117. its own mark, so that when you return to a buffer that had been selected 
  2118. previously, it has the same mark it had before. 
  2119.  
  2120.  Many commands that insert text, such as C-y (yank) and M-x insert-buffer, 
  2121. position point and the mark at opposite ends of the inserted text, so that the 
  2122. region contains the text just inserted. 
  2123.  
  2124.  Aside from delimiting the region, the mark is also useful for remembering a 
  2125. spot that you may want to go back to.  To make this feature more useful, each 
  2126. buffer remembers 16 previous locations of the mark in the mark ring. 
  2127.  
  2128.  
  2129. ΓòÉΓòÉΓòÉ 13.1. Setting the Mark ΓòÉΓòÉΓòÉ
  2130.  
  2131.  Here are some commands for setting the mark: 
  2132.  
  2133. C-SPC 
  2134.           Set the mark where point is (set-mark-command). 
  2135.  
  2136. C-@ 
  2137.           The same. 
  2138.  
  2139. C-x C-x 
  2140.           Interchange mark and point (exchange-point-and-mark). 
  2141.  
  2142.  For example, suppose you wish to convert part of the buffer to all upper-case, 
  2143. using the C-x C-u (upcase-region) command which operates on the text in the 
  2144. region.  You can first go to the beginning of the text to be capitalized, type 
  2145. C-SPC to put the mark there, move to the end, and then type C-x C-u.  Or, you 
  2146. can set the mark at the end of the text, move to the beginning, and then type 
  2147. C-x C-u. 
  2148.  
  2149.  The most common way to set the mark is with the C-SPC command 
  2150. (set-mark-command).  This sets the mark where point is.  Then you can move 
  2151. point away, leaving the mark behind. 
  2152.  
  2153.  Ordinary terminals have only one cursor, so there is no way for Emacs to show 
  2154. you where the mark is located.  You have to remember.  The usual solution to 
  2155. this problem is to set the mark and then use it soon, before you forget where 
  2156. it is.  Alternatively, you can see where the mark is with the command C-x C-x 
  2157. (exchange-point-and-mark) which puts the mark where point was and point where 
  2158. the mark was.  The extent of the region is unchanged, but the cursor and point 
  2159. are now at the previous position of the mark. 
  2160.  
  2161.  C-x C-x is also useful when you are satisfied with the position of point but 
  2162. want to move the mark; do C-x C-x to put point at that end of the region, and 
  2163. then move it.  A second use of C-x C-x, if necessary, puts the mark at the new 
  2164. position with point back at its original position. 
  2165.  
  2166.  There is no such character as C-SPC in ASCII; when you type SPC while holding 
  2167. down CTRL, what you get on most ordinary terminals is the character C-@.  This 
  2168. key is actually bound to set-mark-command.  But unless you are unlucky enough 
  2169. to have a terminal where typing C-SPC does not produce C-@, you might as well 
  2170. think of this character as C-SPC.  Under X, C-SPC is actually a distinct 
  2171. character, but its binding is still set-mark-command. 
  2172.  
  2173.  
  2174. ΓòÉΓòÉΓòÉ 13.2. Transient Mark Mode ΓòÉΓòÉΓòÉ
  2175.  
  2176.  Many Emacs commands move the mark and invisibly set new regions. This means 
  2177. that there is almost always some region that you can act on.  This is 
  2178. convenient, provided you get used to keeping track of the mark's position. 
  2179.  
  2180.  Some people prefer a more rigid mode of operation in which you must set up a 
  2181. region for each command that uses one---in which the region ``lasts'' only 
  2182. temporarily.  This is called Transient Mark mode.  It is particularly 
  2183. well-suited to window systems such as X, since Emacs can highlight the region 
  2184. when it is active. 
  2185.  
  2186.  To enable Transient Mark mode, type M-x transient-mark-mode. This command 
  2187. toggles the mode, so you can issue it again to return to the normal Emacs way 
  2188. of handling the mark and the region. 
  2189.  
  2190.  Here are the details of Transient Mark mode: 
  2191.  
  2192. o To set the mark, type C-SPC (set-mark-command). This makes the mark active; 
  2193.   as you move point, you will see the region highlighting change in extent. 
  2194.  
  2195. o On a window system, an easy way to select a region is to press the button 
  2196.   Mouse-1 (normally the left button) at one end of it, drag the mouse to the 
  2197.   other end, and then release the button. 
  2198.  
  2199. o When the mark is active, you can execute any commands you want on the region, 
  2200.   such as killing, indentation, or writing to a file. 
  2201.  
  2202. o Any change to the buffer, such as inserting or deleting a character, 
  2203.   deactivates the mark.  This means any subsequent command that operates on a 
  2204.   region will get an error and refuse to operate.  You can make the region 
  2205.   active again by typing C-x C-x. 
  2206.  
  2207. o Commands like M-> that ``leave the mark behind'' do not activate the new 
  2208.   mark.  it.  You can activate the new region by executing C-x C-x 
  2209.   (exchange-point-and-mark). 
  2210.  
  2211. o Quitting with C-g deactivates the mark. 
  2212.  
  2213.  Transient Mark mode is also sometimes known as ``Zmacs mode'' because the 
  2214. Zmacs editor on the MIT Lisp Machine handled the mark in a similar way. 
  2215.  
  2216.  When multiple windows show the same buffer, they can have different regions, 
  2217. because they can have different values of point.  In Transient Mark mode, each 
  2218. window highlights its own region.  The part that is highlighted in the selected 
  2219. window is the region that editing commands use.  See Windows. 
  2220.  
  2221.  
  2222. ΓòÉΓòÉΓòÉ 13.3. Operating on the Region ΓòÉΓòÉΓòÉ
  2223.  
  2224.  Once you have set up a region and the mark is active, you can do many things 
  2225. to the text in it: 
  2226.  
  2227. o Kill it with C-w (see Killing). 
  2228.  
  2229. o Save it in a register with C-x r s (see Registers). 
  2230.  
  2231. o Save it in a buffer or a file (see Accumulating Text). 
  2232.  
  2233. o Convert case with C-x C-l or C-x C-u (see Case). 
  2234.  
  2235. o Indent it with C-x TAB or C-M-\ (see Indentation). 
  2236.  
  2237. o Fill it as text with M-x fill-region (see Filling). 
  2238.  
  2239. o Print hardcopy with M-x print-region (see Hardcopy). 
  2240.  
  2241. o Evaluate it as Lisp code with M-x eval-region (see Lisp Eval). 
  2242.  
  2243.  Most commands that operate on the text in the region have the word region in 
  2244. their names. 
  2245.  
  2246.  
  2247. ΓòÉΓòÉΓòÉ 13.4. Commands to Mark Textual Objects ΓòÉΓòÉΓòÉ
  2248.  
  2249.  Here are the commands for placing point and the mark around a textual object 
  2250. such as a word, list, paragraph or page. 
  2251.  
  2252. M-@ 
  2253.           Set mark after end of next word (mark-word).  This command and the 
  2254.           following one do not move point. 
  2255.  
  2256. C-M-@ 
  2257.           Set mark after end of next Lisp expression (mark-sexp). 
  2258.  
  2259. M-h 
  2260.           Put region around current paragraph (mark-paragraph). 
  2261.  
  2262. C-M-h 
  2263.           Put region around current Lisp defun (mark-defun). 
  2264.  
  2265. C-x h 
  2266.           Put region around entire buffer (mark-whole-buffer). 
  2267.  
  2268. C-x C-p 
  2269.           Put region around current page (mark-page). 
  2270.  
  2271. M-@ (mark-word) puts the mark at the end of the next word, while C-M-@ 
  2272. (mark-sexp) puts it at the end of the next Lisp expression.  These commands 
  2273. handle arguments just like M-f and C-M-f. 
  2274.  
  2275.   Other commands set both point and mark, to delimit an object in the buffer. 
  2276. For example, M-h (mark-paragraph) moves point to the beginning of the paragraph 
  2277. that surrounds or follows point, and puts the mark at the end of that paragraph 
  2278. (see Paragraphs).  It prepares the region so you can indent, case-convert, or 
  2279. kill a whole paragraph. 
  2280.  
  2281.  C-M-h (mark-defun) similarly puts point before and the mark after the current 
  2282. or following defun (see Defuns).  C-x C-p (mark-page) puts point before the 
  2283. current page, and mark at the end (see Pages).  The mark goes after the 
  2284. terminating page delimiter (to include it), while point goes after the 
  2285. preceding page delimiter (to exclude it).  A numeric argument specifies a later 
  2286. page (if positive) or an earlier page (if negative) instead of the current 
  2287. page. 
  2288.  
  2289.  Finally, C-x h (mark-whole-buffer) sets up the entire buffer as the region, by 
  2290. putting point at the beginning and the mark at the end. 
  2291.  
  2292.  
  2293. ΓòÉΓòÉΓòÉ 13.5. The Mark Ring ΓòÉΓòÉΓòÉ
  2294.  
  2295.  Aside from delimiting the region, the mark is also useful for remembering a 
  2296. spot that you may want to go back to.  To make this feature more useful, each 
  2297. buffer remembers 16 previous locations of the mark, in the mark ring.  Commands 
  2298. that set the mark also push the old mark onto this ring.  To return to a marked 
  2299. location, use C-u C-SPC (or C-u C-@); this is the command set-mark-command 
  2300. given a numeric argument.  It moves point to where the mark was, and restores 
  2301. the mark from the ring of former marks.  Thus, repeated use of this command 
  2302. moves point to all of the old marks on the ring, one by one.  The mark 
  2303. positions you move through in this way are not lost; they go to the end of the 
  2304. ring. 
  2305.  
  2306.  Each buffer has its own mark ring.  All editing commands use the current 
  2307. buffer's mark ring.  In particular, C-u C-SPC always stays in the same buffer. 
  2308.  
  2309.  Many commands that can move long distances, such as M-< (beginning-of-buffer), 
  2310. start by setting the mark and saving the old mark on the mark ring.  This is to 
  2311. make it easier for you to move back later.  Searches set the mark if they move 
  2312. point.  You can tell when a command sets the mark because it displays `Mark 
  2313. Set' in the echo area. 
  2314.  
  2315.  If you want to move back to the same place over and over, the mark ring may 
  2316. not be convenient enough.  If so, you can record the position in a register for 
  2317. later retrieval (see RegPos). 
  2318.  
  2319.  The variable mark-ring-max specifies the maximum number of entries to keep in 
  2320. the mark ring.  If that many entries exist and another one is pushed, the last 
  2321. one in the list is discarded.  Repeating C-u C-SPC circulates through the 
  2322. positions currently in the ring. 
  2323.  
  2324.  The variable mark-ring holds the mark ring itself, as a list of marker objects 
  2325. in the order most recent first.  This variable is local in every buffer. 
  2326.  
  2327.  
  2328. ΓòÉΓòÉΓòÉ 13.6. Deletion and Killing ΓòÉΓòÉΓòÉ
  2329.  
  2330.  Most commands which erase text from the buffer save it in the kill ring so 
  2331. that you can move or copy it to other parts of the buffer. These commands are 
  2332. known as kill commands.  The rest of the commands that erase text do not save 
  2333. it in the kill ring; they are known as delete commands.  (This distinction is 
  2334. made only for erasure of text in the buffer.)  If you do a kill or delete 
  2335. command by mistake, you can use the C-x u (undo) command to undo it (see Undo). 
  2336.  
  2337.  The delete commands include C-d (delete-char) and DEL (delete-backward-char), 
  2338. which delete only one character at a time, and those commands that delete only 
  2339. spaces or newlines.  Commands that can destroy significant amounts of 
  2340. nontrivial data generally kill. The commands' names and individual descriptions 
  2341. use the words `kill' and `delete' to say which they do. 
  2342.  
  2343.  You can use kill commands in read-only buffers.  They don't actually change 
  2344. the buffer, and they beep to warn you of that, but they do copy the text you 
  2345. tried to kill into the kill ring, so you can yank it into other buffers. 
  2346.  
  2347.  
  2348. ΓòÉΓòÉΓòÉ 13.6.1. Deletion ΓòÉΓòÉΓòÉ
  2349.  
  2350. C-d 
  2351.           Delete next character (delete-char). 
  2352.  
  2353. DEL 
  2354.           Delete previous character (delete-backward-char). 
  2355.  
  2356. M-\ 
  2357.           Delete spaces and tabs around point (delete-horizontal-space). 
  2358.  
  2359. M-SPC 
  2360.           Delete spaces and tabs around point, leaving one space 
  2361.           (just-one-space). 
  2362.  
  2363. C-x C-o 
  2364.           Delete blank lines around the current line (delete-blank-lines). 
  2365.  
  2366. M-^ 
  2367.           Join two lines by deleting the intervening newline, along with any 
  2368.           indentation following it (delete-indentation). 
  2369.  
  2370.  The most basic delete commands are C-d (delete-char) and DEL 
  2371. (delete-backward-char).  C-d deletes the character after point, the one the 
  2372. cursor is ``on top of''.  This doesn't move point.  DEL deletes the character 
  2373. before the cursor, and moves point back.  You can delete newlines like any 
  2374. other characters in the buffer; deleting a newline joins two lines.  Actually, 
  2375. C-d and DEL aren't always delete commands; when given arguments, they kill 
  2376. instead, since they can erase more than one character this way. 
  2377.  
  2378.  The other delete commands are those which delete only whitespace characters: 
  2379. spaces, tabs and newlines.  M-\ (delete-horizontal-space) deletes all the 
  2380. spaces and tab characters before and after point.  M-SPC (just-one-space) does 
  2381. likewise but leaves a single space after point, regardless of the number of 
  2382. spaces that existed previously (even zero). 
  2383.  
  2384.  C-x C-o (delete-blank-lines) deletes all blank lines after the current line. 
  2385. If the current line is blank, it deletes all blank lines preceding the current 
  2386. line as well (leaving one blank line, the current line). 
  2387.  
  2388.  M-^ (delete-indentation) joins the current line and the previous line, by 
  2389. deleting a newline and all surrounding spaces, usually leaving a single space. 
  2390. See Indentation. 
  2391.  
  2392.  
  2393. ΓòÉΓòÉΓòÉ 13.6.2. Killing by Lines ΓòÉΓòÉΓòÉ
  2394.  
  2395. C-k 
  2396.           Kill rest of line or one or more lines (kill-line). 
  2397.  
  2398.  The simplest kill command is C-k.  If given at the beginning of a line, it 
  2399. kills all the text on the line, leaving it blank.  When used on a blank line, 
  2400. it kills the whole line including its newline.  To kill an entire non-blank 
  2401. line, go to the beginning and type C-k twice. 
  2402.  
  2403.  More generally, C-k kills from point up to the end of the line, unless it is 
  2404. at the end of a line.  In that case it kills the newline following point, thus 
  2405. merging the next line into the current one. Spaces and tabs that you can't see 
  2406. at the end of the line are ignored when deciding which case applies, so if 
  2407. point appears to be at the end of the line, you can be sure C-k will kill the 
  2408. newline. 
  2409.  
  2410.  When C-k is given a positive argument, it kills that many lines and the 
  2411. newlines that follow them (however, text on the current line before point is 
  2412. spared).  With a negative argument -n, it kills n lines preceding the current 
  2413. line (together with the text on the current line before point).  Thus, C-u - 2 
  2414. C-k at the front of a line kills the two previous lines. 
  2415.  
  2416.  C-k with an argument of zero kills the text before point on the current line. 
  2417.  
  2418.  If the variable kill-whole-line is non-nil, C-k at the very beginning of a 
  2419. line kills the entire line including the following newline.  This variable is 
  2420. normally nil. 
  2421.  
  2422.  
  2423. ΓòÉΓòÉΓòÉ 13.6.3. Other Kill Commands ΓòÉΓòÉΓòÉ
  2424.  
  2425. C-w 
  2426.           Kill region (from point to the mark) (kill-region). 
  2427.  
  2428. M-d 
  2429.           Kill word (kill-word).  See Words. 
  2430.  
  2431. M-DEL 
  2432.           Kill word backwards (backward-kill-word). 
  2433.  
  2434. C-x DEL 
  2435.           Kill back to beginning of sentence (backward-kill-sentence). See 
  2436.           Sentences. 
  2437.  
  2438. M-k 
  2439.           Kill to end of sentence (kill-sentence). 
  2440.  
  2441. C-M-k 
  2442.           Kill sexp (kill-sexp).  See Lists. 
  2443.  
  2444. M-z char 
  2445.           Kill through the next occurrence of char (zap-to-char). 
  2446.  
  2447.  A kill command which is very general is C-w (kill-region), which kills 
  2448. everything between point and the mark.  With this command, you can kill any 
  2449. contiguous sequence of characters, if you first set the region around them. 
  2450.  
  2451.  A convenient way of killing is combined with searching: M-z (zap-to-char) 
  2452. reads a character and kills from point up to (and including) the next 
  2453. occurrence of that character in the buffer.  A numeric argument acts as a 
  2454. repeat count.  A negative argument means to search backward and kill text 
  2455. before point. 
  2456.  
  2457.  Other syntactic units can be killed: words, with M-DEL and M-d (see Words); 
  2458. sexps, with C-M-k (see Lists); and sentences, with C-x DEL and M-k (see 
  2459. Sentences). 
  2460.  
  2461.  
  2462. ΓòÉΓòÉΓòÉ 13.7. Yanking ΓòÉΓòÉΓòÉ
  2463.  
  2464.  Yanking means reinserting text previously killed.  This is what some systems 
  2465. call ``pasting''.  The usual way to move or copy text is to kill it and then 
  2466. yank it elsewhere one or more times. 
  2467.  
  2468. C-y 
  2469.           Yank last killed text (yank). 
  2470.  
  2471. M-y 
  2472.           Replace text just yanked with an earlier batch of killed text 
  2473.           (yank-pop). 
  2474.  
  2475. M-w 
  2476.           Save region as last killed text without actually killing it 
  2477.           (kill-ring-save). 
  2478.  
  2479. C-M-w 
  2480.           Append next kill to last batch of killed text (append-next-kill). 
  2481.  
  2482.  
  2483. ΓòÉΓòÉΓòÉ 13.7.1. The Kill Ring ΓòÉΓòÉΓòÉ
  2484.  
  2485.  All killed text is recorded in the kill ring, a list of blocks of text that 
  2486. have been killed.  There is only one kill ring, used in all buffers, so you can 
  2487. kill text in one buffer and yank it in another buffer. This is the usual way to 
  2488. move text from one file to another. (See Accumulating Text, for some other 
  2489. ways.) 
  2490.  
  2491.  The command C-y (yank) reinserts the text of the most recent kill.  It leaves 
  2492. the cursor at the end of the text.  It sets the mark at the beginning of the 
  2493. text.  See Mark. 
  2494.  
  2495.  C-u C-y leaves the cursor in front of the text, and sets the mark after it. 
  2496. This is only if the argument is specified with just a C-u, precisely.  Any 
  2497. other sort of argument, including C-u and digits, specifies an earlier kill to 
  2498. yank (see Earlier Kills). 
  2499.  
  2500.  If you wish to copy a block of text, you might want to use M-w 
  2501. (kill-ring-save), which copies the region into the kill ring without removing 
  2502. it from the buffer.  This is approximately equivalent to C-w followed by C-x u, 
  2503. except that M-w does not alter the undo history and does not temporarily change 
  2504. the screen. 
  2505.  
  2506.  
  2507. ΓòÉΓòÉΓòÉ 13.7.2. Appending Kills ΓòÉΓòÉΓòÉ
  2508.  
  2509.  Normally, each kill command pushes a new entry onto the kill ring. However, 
  2510. two or more kill commands in a row combine their text into a single entry, so 
  2511. that a single C-y gets it all back as it was before it was killed. 
  2512.  
  2513.  Thus, if you want to yank text as a unit, you need not kill all of it with one 
  2514. command; you can keep killing line after line, or word after word, until you 
  2515. have killed it all, and you can still get it all back at once. 
  2516.  
  2517.  Commands that kill forward from point add onto the end of the previous killed 
  2518. text.  Commands that kill backward from point add text onto the beginning. 
  2519. This way, any sequence of mixed forward and backward kill commands puts all the 
  2520. killed text into one entry without rearrangement. Numeric arguments do not 
  2521. break the sequence of appending kills.  For example, suppose the buffer 
  2522. contains 
  2523.  
  2524. This is a line -!-of sample text.
  2525.  
  2526. with point as shown.  If you type M-d M-DEL M-d M-DEL, killing alternately 
  2527. forward and backward, you end up with `a line of sample' as one entry in the 
  2528. kill ring, and `This is text.' in the buffer.  (Note the double space, which 
  2529. you can clean up with M-SPC or M-q.) 
  2530.  
  2531.  Another way to kill the same text is to move back two words with M-b M-b, then 
  2532. kill all four words forward with C-u M-d. This produces exactly the same 
  2533. results in the buffer and in the kill ring.  M-f M-f C-u M-DEL kills the same 
  2534. text, all going backward; once again, the result is the same.  The text in the 
  2535. kill ring entry always has the same order that it had in the buffer before you 
  2536. killed it. 
  2537.  
  2538.  If a kill command is separated from the last kill command by other commands 
  2539. (not just numeric arguments), it starts a new entry on the kill ring.  But you 
  2540. can force it to append by first typing the command C-M-w (append-next-kill) 
  2541. right before it.  The C-M-w tells the following command, if it is a kill 
  2542. command, to append the text it kills to the last killed text, instead of 
  2543. starting a new entry.  With C-M-w, you can kill several separated pieces of 
  2544. text and accumulate them to be yanked back in one place. 
  2545.  
  2546.  
  2547. ΓòÉΓòÉΓòÉ 13.7.3. Yanking Earlier Kills ΓòÉΓòÉΓòÉ
  2548.  
  2549.  To recover killed text that is no longer the most recent kill, use the M-y 
  2550. command (yank-pop).  It takes the text previously yanked and replaces it with 
  2551. the text from an earlier kill.  So, to recover the text of the next-to-the-last 
  2552. kill, first use C-y to yank the last kill, and then use M-y to replace it with 
  2553. the previous kill.  M-y is allowed only after a C-y or another M-y. 
  2554.  
  2555.  You can understand M-y in terms of a ``last yank'' pointer which points at an 
  2556. entry in the kill ring.  Each time you kill, the ``last yank'' pointer moves to 
  2557. the newly made entry at the front of the ring. C-y yanks the entry which the 
  2558. ``last yank'' pointer points to. M-y moves the ``last yank'' pointer to a 
  2559. different entry, and the text in the buffer changes to match.  Enough M-y 
  2560. commands can move the pointer to any entry in the ring, so you can get any 
  2561. entry into the buffer.  Eventually the pointer reaches the end of the ring; the 
  2562. next M-y moves it to the first entry again. 
  2563.  
  2564.  M-y moves the ``last yank'' pointer around the ring, but it does not change 
  2565. the order of the entries in the ring, which always runs from the most recent 
  2566. kill at the front to the oldest one still remembered. 
  2567.  
  2568.  M-y can take a numeric argument, which tells it how many entries to advance 
  2569. the ``last yank'' pointer by.  A negative argument moves the pointer toward the 
  2570. front of the ring; from the front of the ring, it moves ``around'' to the last 
  2571. entry and continues forward from there. 
  2572.  
  2573.  Once the text you are looking for is brought into the buffer, you can stop 
  2574. doing M-y commands and it will stay there.  It's just a copy of the kill ring 
  2575. entry, so editing it in the buffer does not change what's in the ring.  As long 
  2576. as no new killing is done, the ``last yank'' pointer remains at the same place 
  2577. in the kill ring, so repeating C-y will yank another copy of the same previous 
  2578. kill. 
  2579.  
  2580.  If you know how many M-y commands it would take to find the text you want, you 
  2581. can yank that text in one step using C-y with a numeric argument.  C-y with an 
  2582. argument restores the text the specified number of entries back in the kill 
  2583. ring.  Thus, C-u 2 C-y gets the next to the last block of killed text.  It is 
  2584. equivalent to C-y M-y.  C-y with a numeric argument starts counting from the 
  2585. ``last yank'' pointer, and sets the ``last yank'' pointer to the entry that it 
  2586. yanks. 
  2587.  
  2588.  The length of the kill ring is controlled by the variable kill-ring-max; no 
  2589. more than that many blocks of killed text are saved. 
  2590.  
  2591.  The actual contents of the kill ring are stored in a variable named kill-ring; 
  2592. you can view the entire contents of the kill ring with the command C-h v 
  2593. kill-ring. 
  2594.  
  2595.  
  2596. ΓòÉΓòÉΓòÉ 13.8. Accumulating Text ΓòÉΓòÉΓòÉ
  2597.  
  2598.  Usually we copy or move text by killing it and yanking it, but there are other 
  2599. methods convenient for copying one block of text in many places, or for copying 
  2600. many scattered blocks of text into one place.  To copy one block to many 
  2601. places, store it in a register (see Registers).  Here we describe the commands 
  2602. to accumulate scattered pieces of text into a buffer or into a file. 
  2603.  
  2604. M-x append-to-buffer 
  2605.           Append region to contents of specified buffer. 
  2606.  
  2607. M-x prepend-to-buffer 
  2608.           Prepend region to contents of specified buffer. 
  2609.  
  2610. M-x copy-to-buffer 
  2611.           Copy region into specified buffer, deleting that buffer's old 
  2612.           contents. 
  2613.  
  2614. M-x insert-buffer 
  2615.           Insert contents of specified buffer into current buffer at point. 
  2616.  
  2617. M-x append-to-file 
  2618.           Append region to contents of specified file, at the end. 
  2619.  
  2620.  To accumulate text into a buffer, use M-x append-to-buffer. This reads a 
  2621. buffer name, them inserts a copy of the region into the buffer specified.  If 
  2622. you specify a nonexistent buffer, append-to-buffer creates the buffer.  The 
  2623. text is inserted wherever point is in that buffer.  If you have been using the 
  2624. buffer for editing, the copied text goes into the middle of the text of the 
  2625. buffer, wherever point happens to be in it. 
  2626.  
  2627.  Point in that buffer is left at the end of the copied text, so successive uses 
  2628. of append-to-buffer accumulate the text in the specified buffer in the same 
  2629. order as they were copied.  Strictly speaking, append-to-buffer does not always 
  2630. append to the text already in the buffer---only if point in that buffer is at 
  2631. the end. However, if append-to-buffer is the only command you use to alter a 
  2632. buffer, then point is always at the end. 
  2633.  
  2634.  M-x prepend-to-buffer is just like append-to-buffer except that point in the 
  2635. other buffer is left before the copied text, so successive prependings add text 
  2636. in reverse order.  M-x copy-to-buffer is similar except that any existing text 
  2637. in the other buffer is deleted, so the buffer is left containing just the text 
  2638. newly copied into it. 
  2639.  
  2640.  To retrieve the accumulated text from another buffer, use M-x insert-buffer; 
  2641. this too takes buffername as an argument.  It inserts a copy of the text in 
  2642. buffer buffername into the selected buffer.  You can alternatively select the 
  2643. other buffer for editing, then optionally move text from it by killing.  See 
  2644. Buffers, for background information on buffers. 
  2645.  
  2646.  Instead of accumulating text within Emacs, in a buffer, you can append text 
  2647. directly into a file with M-x append-to-file, which takes filename as an 
  2648. argument.  It adds the text of the region to the end of the specified file. 
  2649. The file is changed immediately on disk. 
  2650.  
  2651.  You should use append-to-file only with files that are not being visited in 
  2652. Emacs.  Using it on a file that you are editing in Emacs would change the file 
  2653. behind Emacs's back, which can lead to losing some of your editing. 
  2654.  
  2655.  
  2656. ΓòÉΓòÉΓòÉ 13.9. Rectangles ΓòÉΓòÉΓòÉ
  2657.  
  2658.  The rectangle commands operate on rectangular areas of the text: all the 
  2659. characters between a certain pair of columns, in a certain range of lines. 
  2660. Commands are provided to kill rectangles, yank killed rectangles, clear them 
  2661. out, fill them with blanks or text, or delete them. Rectangle commands are 
  2662. useful with text in multicolumn formats, and for changing text into or out of 
  2663. such formats. 
  2664.  
  2665.  When you must specify a rectangle for a command to work on, you do it by 
  2666. putting the mark at one corner and point at the opposite corner.  The rectangle 
  2667. thus specified is called the region-rectangle because you control it in about 
  2668. the same way the region is controlled.  But remember that a given combination 
  2669. of point and mark values can be interpreted either as a region or as a 
  2670. rectangle, depending on the command that uses them. 
  2671.  
  2672.  If point and the mark are in the same column, the rectangle they delimit is 
  2673. empty.  If they are in the same line, the rectangle is one line high.  This 
  2674. asymmetry between lines and columns comes about because point (and likewise the 
  2675. mark) is between two columns, but within a line. 
  2676.  
  2677. C-x r k 
  2678.           Kill the text of the region-rectangle, saving its contents as the 
  2679.           ``last killed rectangle'' (kill-rectangle). 
  2680.  
  2681. C-x r y 
  2682.           Yank the last killed rectangle with its upper left corner at point 
  2683.           (yank-rectangle). 
  2684.  
  2685. C-x r o 
  2686.           Insert blank space to fill the space of the region-rectangle 
  2687.           (open-rectangle).  This pushes the previous contents of the 
  2688.           region-rectangle rightward. 
  2689.  
  2690. M-x delete-rectangle 
  2691.           Delete the text of the region-rectangle without saving it in any 
  2692.           special way. 
  2693.  
  2694. M-x clear-rectangle 
  2695.           Clear the region-rectangle by replacing its contents with spaces. 
  2696.  
  2697. M-x string-rectangle RET string RET 
  2698.           Insert string on each line of the region-rectangle. 
  2699.  
  2700.  The rectangle operations fall into two classes: commands deleting and 
  2701. inserting rectangles, and commands for blank rectangles. 
  2702.  
  2703.  There are two ways to get rid of the text in a rectangle: you can discard the 
  2704. text (delete it) or save it as the ``last killed'' rectangle.  The commands for 
  2705. these two ways are M-x delete-rectangle and C-x r k (kill-rectangle).  In 
  2706. either case, the portion of each line that falls inside the rectangle's 
  2707. boundaries is deleted, causing following text (if any) on the line to move left 
  2708. into the gap. 
  2709.  
  2710.  Note that ``killing'' a rectangle is not killing in the usual sense; the 
  2711. rectangle is not stored in the kill ring, but in a special place that can only 
  2712. record the most recent rectangle killed.  This is because yanking a rectangle 
  2713. is so different from yanking linear text that different yank commands have to 
  2714. be used and yank-popping is hard to make sense of. 
  2715.  
  2716.  Yanking a rectangle is the opposite of killing one.  Point specifies where to 
  2717. put the rectangle's upper left corner.  The rectangle's first line is inserted 
  2718. there, the rectangle's second line is inserted at a point one line vertically 
  2719. down, and so on.  The number of lines affected is determined by the height of 
  2720. the saved rectangle. 
  2721.  
  2722.  To yank the last killed rectangle, type C-x r y (yank-rectangle).  This can be 
  2723. used to convert single-column lists into double-column lists; kill the second 
  2724. half of the list as a rectangle and then yank it beside the first line of the 
  2725. list. 
  2726.  
  2727.  You can also copy rectangles into and out of registers with C-x r r r and C-x 
  2728. r i r. See Rectangle Registers. 
  2729.  
  2730.  The command M-x string-rectangle is similar to C-x r o, but it inserts a 
  2731. specified string instead of blanks.  You specify the string with the 
  2732. minibuffer.  Since the length of the string specifies how many columns to 
  2733. insert, the width of the region-rectangle does not matter for this command. 
  2734. What does matter is the position of the left edge (which specifies the column 
  2735. position for the insertion in each line) and the range of lines that the 
  2736. rectangle occupies.  The previous contents of the text after the insertion 
  2737. column are pushed rightward. 
  2738.  
  2739.  There are two commands for making with blank rectangles: M-x clear-rectangle 
  2740. to blank out existing text, and C-x r o (open-rectangle) to insert a blank 
  2741. rectangle.  Clearing a rectangle is equivalent to deleting it and then 
  2742. inserting a blank rectangle of the same size. 
  2743.  
  2744.  
  2745. ΓòÉΓòÉΓòÉ 14. Registers ΓòÉΓòÉΓòÉ
  2746.  
  2747.  Emacs registers are places you can save text or positions for later use.  Text 
  2748. and rectangles saved in registers can be copied into the buffer once or many 
  2749. times; you can move point to a position saved in a register. 
  2750.  
  2751.  Each register has a name which is a single character.  A register can store a 
  2752. piece of text, a rectangle, a position, a window configuration or a file name, 
  2753. but only one thing at any given time.  Whatever you store in a register remains 
  2754. there until you store something else in that register.  To see what a register 
  2755. r contains, use M-x view-register. 
  2756.  
  2757. M-x view-register RET r 
  2758.           Display a description of what register r contains. 
  2759.  
  2760.  
  2761. ΓòÉΓòÉΓòÉ 14.1. Saving Positions in Registers ΓòÉΓòÉΓòÉ
  2762.  
  2763.  Saving a position records a spot in a buffer so that you can move back there 
  2764. later.  Moving to a saved position reselects that buffer and moves point to 
  2765. that spot. 
  2766.  
  2767. C-x r SPC r 
  2768.           Save position of point in register r (point-to-register). 
  2769.  
  2770. C-x r j r 
  2771.           Jump to the position saved in register r (jump-to-register). 
  2772.  
  2773.  To save the current position of point in a register, choose a name r and type 
  2774. C-x r SPC r.  The register r retains the position thus saved until you store 
  2775. something else in that register. 
  2776.  
  2777.  The command C-x r j r moves point to the position recorded in register r.  The 
  2778. register is not affected; it continues to record the same position.  You can 
  2779. jump to the same position using the same register any number of times. 
  2780.  
  2781.  
  2782. ΓòÉΓòÉΓòÉ 14.2. Saving Text in Registers ΓòÉΓòÉΓòÉ
  2783.  
  2784.  When you want to insert a copy of the same piece of text several times, it may 
  2785. be inconvenient to yank it from the kill ring, since each subsequent kill moves 
  2786. that entry further down the ring.  An alternative is to store the text in a 
  2787. register with C-x r s (copy-to-register) and then retrieve it with C-x r i 
  2788. (insert-register). 
  2789.  
  2790. C-x r s r 
  2791.           Copy region into register r (copy-to-register). 
  2792.  
  2793. C-x r i r 
  2794.           Insert text from register r (insert-register). 
  2795.  
  2796.  C-x r s r stores a copy of the text of the region into the register named r. 
  2797. Given a numeric argument, C-x r s r deletes the text from the buffer as well. 
  2798.  
  2799.  C-x r i r inserts in the buffer the text from register r.  Normally it leaves 
  2800. point before the text and places the mark after, but with a numeric argument 
  2801. (C-u) it puts point after the text and the mark before. 
  2802.  
  2803.  
  2804. ΓòÉΓòÉΓòÉ 14.3. Saving Rectangles in Registers ΓòÉΓòÉΓòÉ
  2805.  
  2806.  A register can contain a rectangle instead of linear text.  The rectangle is 
  2807. represented as a list of strings.  See Rectangles, for basic information on how 
  2808. to specify a rectangle in the buffer. 
  2809.  
  2810. C-x r r r 
  2811.           Copy the region-rectangle into register r (copy-region-to-rectangle). 
  2812.           With numeric argument, delete it as well. 
  2813.  
  2814. C-x r i r 
  2815.           Insert the rectangle stored in register r (if it contains a 
  2816.           rectangle) (insert-register). 
  2817.  
  2818.  The C-x r i r command inserts a text string if the register contains one, and 
  2819. inserts a rectangle if the register contains one. 
  2820.  
  2821.  
  2822. ΓòÉΓòÉΓòÉ 14.4. Saving Window Configurations in Registers ΓòÉΓòÉΓòÉ
  2823.  
  2824.  You can save the window configuration of the selected frame in a register, or 
  2825. even the configuration of all frames, and restore the configuration later. 
  2826.  
  2827. C-x r w r 
  2828.           Save the state of the selected frame's windows in register r 
  2829.           (window-configuration-to-register). 
  2830.  
  2831. C-x r f r 
  2832.           Save the state of all windows in all frames in register r 
  2833.           (frame-configuration-to-register). 
  2834.  
  2835.  Use C-x r j r to restore a window or frame configuration. This is the same 
  2836. command used to restore a cursor position. 
  2837.  
  2838.  
  2839. ΓòÉΓòÉΓòÉ 14.5. Keeping File Names in Registers ΓòÉΓòÉΓòÉ
  2840.  
  2841.  If you visit certain file names frequently, you can visit them more 
  2842. conveniently if you put their names in registers.  Here's the Lisp code used to 
  2843. put a file name in a register: 
  2844.  
  2845. (set-register ?r '(file . name))
  2846.  
  2847. For example, 
  2848.  
  2849. (set-register ?z '(file . "/gd/gnu/emacs/19.0/src/ChangeLog"))
  2850.  
  2851. puts the file name shown in register `z'. 
  2852.  
  2853.  To visit the file whose name is in register r, type C-x r j r.  (This is the 
  2854. same command used to jump to a position or restore a frame configuration.) 
  2855.  
  2856.  
  2857. ΓòÉΓòÉΓòÉ 15. Controlling the Display ΓòÉΓòÉΓòÉ
  2858.  
  2859.  Since only part of a large buffer fits in the window, Emacs tries to show the 
  2860. part that is likely to be interesting.  The display control commands allow you 
  2861. to specify which part of the text you want to see. 
  2862.  
  2863. C-l 
  2864.           Clear screen and redisplay, scrolling the selected window to center 
  2865.           point vertically within it (recenter). 
  2866.  
  2867. C-v 
  2868.           Scroll forward (a windowful or a specified number of lines) 
  2869.           (scroll-up). 
  2870.  
  2871. NEXT 
  2872.           Likewise, scroll forward. 
  2873.  
  2874. M-v 
  2875.           Scroll backward (scroll-down). 
  2876.  
  2877. PRIOR 
  2878.           Likewise, scroll backward. 
  2879.  
  2880. arg C-l 
  2881.           Scroll so point is on line arg (recenter). 
  2882.  
  2883. C-x < 
  2884.           Scroll text in current window to the left (scroll-left). 
  2885.  
  2886. C-x > 
  2887.           Scroll to the right (scroll-right). 
  2888.  
  2889. C-x $ 
  2890.           Make deeply indented lines invisible (set-selective-display). 
  2891.  
  2892.  The names of all scroll commands are based on the direction that the text 
  2893. moves in the window.  Thus, the command to scrolling forward is called 
  2894. scroll-up, since the text moves up. 
  2895.  
  2896.  
  2897. ΓòÉΓòÉΓòÉ 15.1. Scrolling ΓòÉΓòÉΓòÉ
  2898.  
  2899.  If a buffer contains text that is too large to fit entirely within a window 
  2900. that is displaying the buffer, Emacs shows a contiguous portion of the text. 
  2901. The portion shown always contains point. 
  2902.  
  2903.  Scrolling means moving text up or down in the window so that different parts 
  2904. of the text are visible.  Scrolling forward means that text moves up, and new 
  2905. text appears at the bottom.  Scrolling backward moves text down and new text 
  2906. appears at the top. 
  2907.  
  2908.  Scrolling happens automatically if you move point past the bottom or top of 
  2909. the window.  You can also explicitly request scrolling with the commands in 
  2910. this section. 
  2911.  
  2912. C-l 
  2913.           Clear screen and redisplay, scrolling the selected window to center 
  2914.           point vertically within it (recenter). 
  2915.  
  2916. C-v 
  2917.           Scroll forward (a windowful or a specified number of lines) 
  2918.           (scroll-up). 
  2919.  
  2920. NEXT 
  2921.           Likewise, scroll forward. 
  2922.  
  2923. M-v 
  2924.           Scroll backward (scroll-down). 
  2925.  
  2926. PRIOR 
  2927.           Likewise, scroll backward. 
  2928.  
  2929. arg C-l 
  2930.           Scroll so point is on line arg (recenter). 
  2931.  
  2932. C-M-l 
  2933.           Scroll heuristically to bring useful information onto the screen 
  2934.           (reposition-window). 
  2935.  
  2936.  The most basic scrolling command is C-l (recenter) with no argument.  It 
  2937. clears the entire screen and redisplays all windows. In addition, it scrolls 
  2938. the selected window so that point is halfway down from the top of the window. 
  2939.  
  2940.  The scrolling commands C-v and M-v let you move all the text in the window up 
  2941. or down a few lines.  C-v (scroll-up) with an argument shows you that many more 
  2942. lines at the bottom of the window, moving the text and point up together as C-l 
  2943. might.  C-v with a negative argument shows you more lines at the top of the 
  2944. window. M-v (scroll-down) is like C-v, but moves in the opposite direction. 
  2945. The function keys NEXT and PRIOR are equivalent to C-v and M-v. 
  2946.  
  2947.  To read the buffer a windowful at a time, use C-v with no argument. It takes 
  2948. the last two lines at the bottom of the window and puts them at the top, 
  2949. followed by nearly a whole windowful of lines not previously visible.  If point 
  2950. was in the text scrolled off the top, it moves to the new top of the window. 
  2951. M-v with no argument moves backward with overlap similarly.  The number of 
  2952. lines of overlap across a C-v or M-v is controlled by the variable 
  2953. next-screen-context-lines; by default, it is two. 
  2954.  
  2955.  Another way to do scrolling is with C-l with a numeric argument. C-l does not 
  2956. clear the screen when given an argument; it only scrolls the selected window. 
  2957. With a positive argument n, it repositions text to put point n lines down from 
  2958. the top.  An argument of zero puts point on the very top line.  Point does not 
  2959. move with respect to the text; rather, the text and point move rigidly on the 
  2960. screen.  C-l with a negative argument puts point that many lines from the 
  2961. bottom of the window. For example, C-u - 1 C-l puts point on the bottom line, 
  2962. and C-u - 5 C-l puts it five lines from the bottom.  Just C-u as argument, as 
  2963. in C-u C-l, scrolls point to the center of the screen. 
  2964.  
  2965.  The C-M-l command (reposition-window) scrolls the current window heuristically 
  2966. in a way designed to get useful information onto the screen.  For example, in a 
  2967. Lisp file, this command tries to get the entire current defun onto the screen 
  2968. if possible. 
  2969.  
  2970.  Scrolling happens automatically if point has moved out of the visible portion 
  2971. of the text when it is time to display.  Usually the scrolling is done so as to 
  2972. put point vertically centered within the window.  However, if the variable 
  2973. scroll-step has a nonzero value, an attempt is made to scroll the buffer by 
  2974. that many lines; if that is enough to bring point back into visibility, that is 
  2975. what is done. 
  2976.  
  2977.  
  2978. ΓòÉΓòÉΓòÉ 15.2. Horizontal Scrolling ΓòÉΓòÉΓòÉ
  2979.  
  2980. C-x < 
  2981.           Scroll text in current window to the left (scroll-left). 
  2982.  
  2983. C-x > 
  2984.           Scroll to the right (scroll-right). 
  2985.  
  2986.  The text in a window can also be scrolled horizontally.  This means that each 
  2987. line of text is shifted sideways in the window, and one or more characters at 
  2988. the beginning of each line are not displayed at all.  When a window has been 
  2989. scrolled horizontally in this way, text lines are truncated rather than 
  2990. continued (see Continuation Lines), with a `$' appearing in the first column 
  2991. when there is text truncated to the left, and in the last column when there is 
  2992. text truncated to the right. 
  2993.  
  2994.  The command C-x < (scroll-left) scrolls the selected window to the left by n 
  2995. columns with argument n.  This moves part of the beginning of each line off the 
  2996. left edge of the window. With no argument, it scrolls by almost the full width 
  2997. of the window (two columns less, to be precise). 
  2998.  
  2999.  C-x > (scroll-right) scrolls similarly to the right.  The window cannot be 
  3000. scrolled any farther to the right once it is displaying normally (with each 
  3001. line starting at the window's left margin); attempting to do so has no effect. 
  3002. This means that you don't have to calculate the argument precisely for C-x >; 
  3003. any sufficiently large argument will restore normally display. 
  3004.  
  3005.  
  3006. ΓòÉΓòÉΓòÉ 15.3. Selective Display ΓòÉΓòÉΓòÉ
  3007.  
  3008.  Emacs has the ability to hide lines indented more than a certain number of 
  3009. columns (you specify how many columns).  You can use this to get an overview of 
  3010. a part of a program. 
  3011.  
  3012.  To hide lines, type C-x $ (set-selective-display) with a numeric argument n. 
  3013. Then lines with at least n columns of indentation disappear from the screen. 
  3014. The only indication of their presence is that three dots (`...') appear at the 
  3015. end of each visible line that is followed by one or more invisible ones. 
  3016.  
  3017.  The commands C-n and C-p move across the invisible lines as if they were not 
  3018. there. 
  3019.  
  3020.  The invisible lines are still present in the buffer, and most editing commands 
  3021. see them as usual, so you may find point in the middle of invisible text.  When 
  3022. this happens, the cursor appears at the end of the previous line, after the 
  3023. three dots.  If point is at the end of the visible line, before the newline 
  3024. that ends it, the cursor appears before the three dots. 
  3025.  
  3026.  To make everything visible again, type C-x $ with no argument. 
  3027.  
  3028.  
  3029. ΓòÉΓòÉΓòÉ 15.4. European Character Set Display ΓòÉΓòÉΓòÉ
  3030.  
  3031.  Emacs can display accented characters, assuming the font in use supports them. 
  3032. The M-x standard-display-european command toggles European character display. 
  3033. When enabled, Emacs displays characters according to the ISO 8859 Latin-1 
  3034. encoding for European languages; when disabled, Emacs uses octal notation for 
  3035. all characters not specified by the ordinary ASCII standard.  Load the library 
  3036. iso-syntax to specify the correct syntactic properties for the character codes 
  3037. 128 and above. 
  3038.  
  3039.  With a prefix argument, M-x standard-display-european enables European 
  3040. character display if and only if the argument is positive. 
  3041.  
  3042.  If your terminal can send character codes 128 and up to represent ISO Latin-1 
  3043. characters, execute the following expression to enable Emacs to understand 
  3044. them: 
  3045.  
  3046. (set-input-mode (car (current-input-mode))
  3047.                 (nth 1 (current-input-mode))
  3048.                 0)
  3049.  
  3050. Otherwise, you can load the library iso-insert to turn the key C-x 8 into a 
  3051. ``compose character'' prefix for insertion of the extra ISO Latin-1 printing 
  3052. characters. 
  3053.  
  3054.  
  3055. ΓòÉΓòÉΓòÉ 15.5. Optional Display Features ΓòÉΓòÉΓòÉ
  3056.  
  3057.  To add the current line number of point to the mode line, enable Line Number 
  3058. mode with the command M-x line-number-mode.  The line number appears before 
  3059. pos, with the letter `L' to indicate what it is.  See Minor Modes, for more 
  3060. information about minor modes and about how to use this command. 
  3061.  
  3062.  If the buffer is very large (larger than the value of 
  3063. line-number-display-limit), then the line number doesn't appear. Emacs doesn't 
  3064. compute the line number when the buffer is large, because that would be too 
  3065. slow. 
  3066.  
  3067.  Emacs can optionally display the time and system load in all mode lines.  To 
  3068. enable this feature, type M-x display-time.  The information added to the mode 
  3069. line usually appears after the buffer name, before the mode names and their 
  3070. parentheses.  It looks like this: 
  3071.  
  3072. hh:mmpm l.ll [d]
  3073.  
  3074. Here hh and mm are the hour and minute, followed always by `am' or `pm'.  l.ll 
  3075. is the average number of running processes in the whole system recently.  d is 
  3076. an approximate index of the ratio of disk activity to cpu activity for all 
  3077. users.  (Some fields may be missing if your operating system cannot support 
  3078. them.) 
  3079.  
  3080.  The word `Mail' appears after the load level if there is mail for you that you 
  3081. have not read yet. 
  3082.  
  3083.  Customization note: the variable mode-line-inverse-video controls whether the 
  3084. mode line is displayed in inverse video (assuming the terminal supports it); 
  3085. nil means no inverse video.  The default is t. See Display Vars. 
  3086.  
  3087.  
  3088. ΓòÉΓòÉΓòÉ 15.6. Variables Controlling Display ΓòÉΓòÉΓòÉ
  3089.  
  3090.  This section contains information for customization only.  Beginning users 
  3091. should skip it. 
  3092.  
  3093.  The variable mode-line-inverse-video controls whether the mode line is 
  3094. displayed in inverse video (assuming the terminal supports it); nil means don't 
  3095. do so.  See Mode Line. 
  3096.  
  3097.  If the variable inverse-video is non-nil, Emacs attempts to invert all the 
  3098. lines of the display from what they normally are. 
  3099.  
  3100.  If the variable visible-bell is non-nil, Emacs attempts to make the whole 
  3101. screen blink when it would normally make an audible bell sound.  This variable 
  3102. has no effect if your terminal does not have a way to make the screen blink. 
  3103.  
  3104.  When you reenter Emacs after suspending, Emacs normally clears the screen and 
  3105. redraws the entire display.  On some terminals with more than one page of 
  3106. memory, it is possible to arrange the termcap entry so that the `ti' and `te' 
  3107. strings (output to the terminal when Emacs is entered and exited, respectively) 
  3108. switch between pages of memory so as to use one page for Emacs and another page 
  3109. for other output.  Then you might want to set the variable no-redraw-on-reenter 
  3110. non-nil; this tells Emacs to assume, when resumed, that the screen page it is 
  3111. using still contains what Emacs last wrote there. 
  3112.  
  3113.  The variable echo-keystrokes controls the echoing of multi-character keys; its 
  3114. value is the number of seconds of pause required to cause echoing to start, or 
  3115. zero meaning don't echo at all.  See Echo Area. 
  3116.  
  3117.  If the variable ctl-arrow is nil, control characters in the buffer are 
  3118. displayed with octal escape sequences, all except newline and tab.  Altering 
  3119. the value of ctl-arrow makes it local to the current buffer; until that time, 
  3120. the default value is in effect.  The default is initially t. See Display 
  3121. Tables. 
  3122.  
  3123.  Normally, a tab character in the buffer is displayed as whitespace which 
  3124. extends to the next display tab stop position, and display tab stops come at 
  3125. intervals equal to eight spaces.  The number of spaces per tab is controlled by 
  3126. the variable tab-width, which is made local by changing it, just like 
  3127. ctl-arrow.  Note that how the tab character in the buffer is displayed has 
  3128. nothing to do with the definition of TAB as a command.  The variable tab-width 
  3129. must have an integer value between 1 and 1000, inclusive. 
  3130.  
  3131.  If you set the variable selective-display-ellipses to nil, the three dots do 
  3132. not appear at the end of a line that precedes invisible lines.  Then there is 
  3133. no visible indication of the invisible lines. This variable too becomes local 
  3134. automatically when set. 
  3135.  
  3136.  If the variable truncate-lines is non-nil, then each line of text gets just 
  3137. one screen line for display; if the text line is too long, display shows only 
  3138. the part that fits.  If truncate-lines is nil, then long text lines display as 
  3139. more than one screen line, enough to show the whole text of the line. See 
  3140. Continuation Lines.  Altering the value of truncate-lines makes it local to the 
  3141. current buffer; until that time, the default value is in effect.  The default 
  3142. is initially nil. 
  3143.  
  3144.  If the variable truncate-partial-width-windows is non-nil, it forces 
  3145. truncation rather than continuation in any window less than the full width of 
  3146. the screen or frame, regardless of the value of truncate-lines.  For 
  3147. information about side-by-side windows, see Split Window.  See also Display. 
  3148.  
  3149.  The variable baud-rate holds the the output speed of the terminal, as far as 
  3150. Emacs knows.  Setting this variable does not change the speed of actual data 
  3151. transmission, but the value is used for calculations such as padding.  It also 
  3152. affects decisions about whether to scroll part of the screen or redraw it 
  3153. instead---even when using a window system, (We designed it this way, despite 
  3154. the fact that a window system has no true ``output speed'', to give you a way 
  3155. to tune these decisions.) 
  3156.  
  3157.  
  3158. ΓòÉΓòÉΓòÉ 16. Searching and Replacement ΓòÉΓòÉΓòÉ
  3159.  
  3160.  Like other editors, Emacs has commands for searching for occurrences of a 
  3161. string.  The principal search command is unusual in that it is incremental; it 
  3162. begins to search before you have finished typing the search string.  There are 
  3163. also nonincremental search commands more like those of other editors. 
  3164.  
  3165.  Besides the usual replace-string command that finds all occurrences of one 
  3166. string and replaces them with another, Emacs has a fancy replacement command 
  3167. called query-replace which asks interactively which occurrences to replace. 
  3168.  
  3169.  
  3170. ΓòÉΓòÉΓòÉ 16.1. Incremental Search ΓòÉΓòÉΓòÉ
  3171.  
  3172.  An incremental search begins searching as soon as you type the first character 
  3173. of the search string.  As you type in the search string, Emacs shows you where 
  3174. the string (as you have typed it so far) would be found.  When you have typed 
  3175. enough characters to identify the place you want, you can stop.  Depending on 
  3176. what you plan to do next, you may or may not need to terminate the search 
  3177. explicitly with RET. 
  3178.  
  3179. C-s 
  3180.           Incremental search forward (isearch-forward). 
  3181.  
  3182. C-r 
  3183.           Incremental search backward (isearch-backward). 
  3184.  
  3185.  C-s starts an incremental search.  C-s reads characters from the keyboard and 
  3186. positions the cursor at the first occurrence of the characters that you have 
  3187. typed.  If you type C-s and then F, the cursor moves right after the first `F'. 
  3188. Type an O, and see the cursor move to after the first `FO'.  After another O, 
  3189. the cursor is after the first `FOO' after the place where you started the 
  3190. search.  Meanwhile, the search string `FOO' has been echoed in the echo area. 
  3191.  
  3192.  If you make a mistake in typing the search string, you can cancel characters 
  3193. with DEL.  Each DEL cancels the last character of search string.  This does not 
  3194. happen until Emacs is ready to read another input character; first it must 
  3195. either find, or fail to find, the character you want to erase.  If you do not 
  3196. want to wait for this to happen, use C-g as described below. 
  3197.  
  3198.  When you are satisfied with the place you have reached, you can type RET, 
  3199. which stops searching, leaving the cursor where the search brought it.  Also, 
  3200. any command not specially meaningful in searches stops the searching and is 
  3201. then executed.  Thus, typing C-a would exit the search and then move to the 
  3202. beginning of the line.  RET is necessary only if the next command you want to 
  3203. type is a printing character, DEL, RET, or another control character that is 
  3204. special within searches (C-q, C-w, C-r, C-s, C-y, M-r, or M-s). 
  3205.  
  3206.  Sometimes you search for `FOO' and find it, but not the one you expected to 
  3207. find.  There was a second `FOO' that you forgot about, before the one you were 
  3208. looking for.  In this event, type another C-s to move to the next occurrence of 
  3209. the search string.  This can be done any number of times.  If you overshoot, 
  3210. you can cancel some C-s characters with DEL. 
  3211.  
  3212.  After you exit a search, you can search for the same string again by typing 
  3213. just C-s C-s: the first C-s is the key that invokes incremental search, and the 
  3214. second C-s means ``search again''. 
  3215.  
  3216.  To reuse earlier search strings, use the search ring.  The commands M-p and 
  3217. M-n move through the ring to pick a search string to reuse.  These commands 
  3218. leave the selected search ring element in the minibuffer, where you can edit 
  3219. it.  Type C-s or C-r to terminate editing the string and search for it. 
  3220.  
  3221.  If your string is not found at all, the echo area says `Failing I-Search'. 
  3222. The cursor is after the place where Emacs found as much of your string as it 
  3223. could.  Thus, if you search for `FOOT', and there is no `FOOT', you might see 
  3224. the cursor after the `FOO' in `FOOL'. At this point there are several things 
  3225. you can do.  If your string was mistyped, you can rub some of it out and 
  3226. correct it.  If you like the place you have found, you can type RET or some 
  3227. other Emacs command to ``accept what the search offered''.  Or you can type 
  3228. C-g, which removes from the search string the characters that could not be 
  3229. found (the `T' in `FOOT'), leaving those that were found (the `FOO' in `FOOT'). 
  3230. A second C-g at that point cancels the search entirely, returning point to 
  3231. where it was when the search started. 
  3232.  
  3233.  An upper-case letter in the search string makes the search case-sensitive.  If 
  3234. you delete the upper-case character from the search string, it ceases to have 
  3235. this effect.  See Search Case. 
  3236.  
  3237.  If a search is failing and you ask to repeat it by typing another C-s, it 
  3238. starts again from the beginning of the buffer.  Repeating a failing reverse 
  3239. search with C-r starts again from the end.  This is called wrapping around. 
  3240. `Wrapped' appears in the search prompt once this has happened. 
  3241.  
  3242.  The C-g ``quit'' character does special things during searches; just what it 
  3243. does depends on the status of the search.  If the search has found what you 
  3244. specified and is waiting for input, C-g cancels the entire search.  The cursor 
  3245. moves back to where you started the search.  If C-g is typed when there are 
  3246. characters in the search string that have not been found---because Emacs is 
  3247. still searching for them, or because it has failed to find them---then the 
  3248. search string characters which have not been found are discarded from the 
  3249. search string.  With them gone, the search is now successful and waiting for 
  3250. more input, so a second C-g will cancel the entire search. 
  3251.  
  3252.  To search for a newline, type LFD (also known as C-j).  To search for another 
  3253. control character such as control-S or carriage return, you must quote it by 
  3254. typing C-q first.  This function of C-q is analogous to its meaning as an Emacs 
  3255. command: it causes the following character to be treated the way a graphic 
  3256. character would normally be treated in the same context.  You can also specify 
  3257. a character by its octal code: enter C-q followed by three octal digits. 
  3258.  
  3259.  You can change to searching backwards with C-r.  If a search fails because the 
  3260. place you started was too late in the file, you should do this. Repeated C-r 
  3261. keeps looking for more occurrences backwards.  A C-s starts going forwards 
  3262. again.  C-r in a search can be cancelled with DEL. 
  3263.  
  3264.  If you know initially that you want to search backwards, you can use C-r 
  3265. instead of C-s to start the search, because C-r is also a key running a command 
  3266. (isearch-backward) to search backward. 
  3267.  
  3268.  The characters C-y and C-w can be used in incremental search to grab text from 
  3269. the buffer into the search string.  This makes it convenient to search for 
  3270. another occurrence of text at point.  C-w copies the word after point as part 
  3271. of the search string, advancing point over that word.  Another C-s to repeat 
  3272. the search will then search for a string including that word.  C-y is similar 
  3273. to C-w but copies all the rest of the current line into the search string. 
  3274.  
  3275.  To customize the special characters that incremental search understands, alter 
  3276. their bindings in the keymap isearch-mode-map. 
  3277.  
  3278.  
  3279. ΓòÉΓòÉΓòÉ 16.1.1. Slow Terminal Incremental Search ΓòÉΓòÉΓòÉ
  3280.  
  3281.  Incremental search on a slow terminal uses a modified style of display that is 
  3282. designed to take less time.  Instead of redisplaying the buffer at each place 
  3283. the search gets to, it creates a new single-line window and uses that to 
  3284. display the line that the search has found.  The single-line window comes into 
  3285. play as soon as point gets outside of the text that is already on the screen. 
  3286.  
  3287.  When you terminate the search, the single-line window is removed. Then Emacs 
  3288. redisplays the window in which the search was done, to show its new position of 
  3289. point. 
  3290.  
  3291.  The slow terminal style of display is used when the terminal baud rate is less 
  3292. than or equal to the value of the variable search-slow-speed, initially 1200. 
  3293.  
  3294.  The number of lines to use in slow terminal search display is controlled by 
  3295. the variable search-slow-window-lines.  1 is its normal value. 
  3296.  
  3297.  
  3298. ΓòÉΓòÉΓòÉ 16.2. Nonincremental Search ΓòÉΓòÉΓòÉ
  3299.  
  3300.  Emacs also has conventional nonincremental search commands, which require you 
  3301. to type the entire search string before searching begins. 
  3302.  
  3303. C-s RET string RET 
  3304.           Search for string. 
  3305.  
  3306. C-r RET string RET 
  3307.           Search backward for string. 
  3308.  
  3309.  To do a nonincremental search, first type C-s RET.  This enters the minibuffer 
  3310. to read the search string; terminate the string with RET, and then the search 
  3311. takes place.  If the string is not found, the search command gets an error. 
  3312.  
  3313.  The way C-s RET works is that the C-s invokes incremental search, which is 
  3314. specially programmed to invoke nonincremental search if the argument you give 
  3315. it is empty.  (Such an empty argument would otherwise be useless.)  C-r RET 
  3316. also works this way. 
  3317.  
  3318.  However, nonincremental searches performed using C-s RET do not call 
  3319. search-forward right away.  The first thing done is to see if the next 
  3320. character is C-w, which requests a word search. See Word Search. 
  3321.  
  3322.  Forward and backward nonincremental searches are implemented by the commands 
  3323. search-forward and search-backward.  These commands may be bound to keys in the 
  3324. usual manner.  The feature that you can get to them via the incremental search 
  3325. commands exists for historical reasons, and to avoid the need to find suitable 
  3326. key sequences for them. 
  3327.  
  3328.  
  3329. ΓòÉΓòÉΓòÉ 16.3. Word Search ΓòÉΓòÉΓòÉ
  3330.  
  3331.  Word search searches for a sequence of words without regard to how the words 
  3332. are separated.  More precisely, you type a string of many words, using single 
  3333. spaces to separate them, and the string can be found even if there are multiple 
  3334. spaces, newlines or other punctuation between the words. 
  3335.  
  3336.  Word search is useful for editing a printed document made with a text 
  3337. formatter.  If you edit while looking at the printed, formatted version, you 
  3338. can't tell where the line breaks are in the source file.  With word search, you 
  3339. can search without having to know them. 
  3340.  
  3341. C-s RET C-w words RET 
  3342.           Search for words, ignoring details of punctuation. 
  3343.  
  3344. C-r RET C-w words RET 
  3345.           Search backward for words, ignoring details of punctuation. 
  3346.  
  3347.  Word search is a special case of nonincremental search and is invoked with C-s 
  3348. RET C-w.  This is followed by the search string, which must always be 
  3349. terminated with RET.  Being nonincremental, this search does not start until 
  3350. the argument is terminated.  It works by constructing a regular expression and 
  3351. searching for that; see Regexp Search. 
  3352.  
  3353.  Use C-r RET C-w to do backward word search. 
  3354.  
  3355.  Forward and backward word searches are implemented by the commands 
  3356. word-search-forward and word-search-backward.  These commands may be bound to 
  3357. keys in the usual manner.  The feature that you can get to them via the 
  3358. incremental search commands exists for historical reasons, and to avoid the 
  3359. need to find suitable key sequences for them. 
  3360.  
  3361.  
  3362. ΓòÉΓòÉΓòÉ 16.4. Regular Expression Search ΓòÉΓòÉΓòÉ
  3363.  
  3364.  A regular expression (regexp, for short) is a pattern that denotes a class of 
  3365. alternative strings to match, possibly infinitely many.  In GNU Emacs, you can 
  3366. search for the next match for a regexp either incrementally or not. 
  3367.  
  3368.  Incremental search for a regexp is done by typing C-M-s 
  3369. (isearch-forward-regexp).  This command reads a search string incrementally 
  3370. just like C-s, but it treats the search string as a regexp rather than looking 
  3371. for an exact match against the text in the buffer.  Each time you add text to 
  3372. the search string, you make the regexp longer, and the new regexp is searched 
  3373. for.  To search backward in the buffer, use C-M-r (isearch-backward-regexp). 
  3374.  
  3375.  All of the control characters that do special things within an ordinary 
  3376. incremental search have the same function in incremental regexp search.  Typing 
  3377. C-s or C-r immediately after starting the search retrieves the last incremental 
  3378. search regexp used; that is to say, incremental regexp and non-regexp searches 
  3379. have independent defaults.  They also have separate search rings that you can 
  3380. access with M-p and M-n. 
  3381.  
  3382.  If you type SPC in incremental regexp search, it matches any sequence of 
  3383. whitespace characters, including newlines.  If you want to match just a space, 
  3384. type C-q SPC. 
  3385.  
  3386.  Note that adding characters to the regexp in an incremental regexp search can 
  3387. make the cursor move back and start again.  For example, if you have searched 
  3388. for `foo' and you add `\|bar', the cursor backs up in case the first `bar' 
  3389. precedes the first `foo'. 
  3390.  
  3391.  Nonincremental search for a regexp is done by the functions re-search-forward 
  3392. and re-search-backward.  You can invoke these with M-x, or bind them to keys, 
  3393. or invoke them by way of incremental regexp search with C-M-s RET and C-M-r 
  3394. RET. 
  3395.  
  3396.  
  3397. ΓòÉΓòÉΓòÉ 16.5. Syntax of Regular Expressions ΓòÉΓòÉΓòÉ
  3398.  
  3399.  Regular expressions have a syntax in which a few characters are special 
  3400. constructs and the rest are ordinary.  An ordinary character is a simple 
  3401. regular expression which matches that same character and nothing else.  The 
  3402. special characters are `$', `^', `.', `*', `+', `?', `[', `]' and `\'.  Any 
  3403. other character appearing in a regular expression is ordinary, unless a `\' 
  3404. precedes it. 
  3405.  
  3406.  For example, `f' is not a special character, so it is ordinary, and therefore 
  3407. `f' is a regular expression that matches the string `f' and no other string. 
  3408. (It does not match the string `ff'.)  Likewise, `o' is a regular expression 
  3409. that matches only `o'.  (When case distinctions are being ignored, these 
  3410. regexps also match `F' and `O', but we consider this a generalization of ``the 
  3411. same string'', rather than an exception.) 
  3412.  
  3413.  Any two regular expressions a and b can be concatenated.  The result is a 
  3414. regular expression which matches a string if a matches some amount of the 
  3415. beginning of that string and b matches the rest of the string. 
  3416.  
  3417.  As a simple example, we can concatenate the regular expressions `f' and `o' to 
  3418. get the regular expression `fo', which matches only the string `fo'.  Still 
  3419. trivial.  To do something nontrivial, you need to use one of the special 
  3420. characters.  Here is a list of them. 
  3421.  
  3422. . (Period) 
  3423.           is a special character that matches any single character except a 
  3424.           newline. Using concatenation, we can make regular expressions like 
  3425.           `a.b' which matches any three-character string which begins with `a' 
  3426.           and ends with `b'. 
  3427.  
  3428.           is not a construct by itself; it is a postfix operator, which means 
  3429.           to match the preceding regular expression repetitively as many times 
  3430.           as possible.  Thus, `o*' matches any number of `o's (including no 
  3431.           `o's). 
  3432.  
  3433.           `*' always applies to the smallest possible preceding expression. 
  3434.           Thus, `fo*' has a repeating `o', not a repeating `fo'.  It matches 
  3435.           `f', `fo', `foo', and so on. 
  3436.  
  3437.           The matcher processes a `*' construct by matching, immediately, as 
  3438.           many repetitions as can be found.  Then it continues with the rest of 
  3439.           the pattern.  If that fails, backtracking occurs, discarding some of 
  3440.           the matches of the `*'-modified construct in case that makes it 
  3441.           possible to match the rest of the pattern.  For example, matching 
  3442.           `ca*ar' against the string `caaar', the `a*' first tries to match all 
  3443.           three `a's; but the rest of the pattern is `ar' and there is only `r' 
  3444.           left to match, so this try fails. The next alternative is for `a*' to 
  3445.           match only two `a's. With this choice, the rest of the regexp matches 
  3446.           successfully. 
  3447.  
  3448.           is a postfix character, similar to `*' except that it must match the 
  3449.           preceding expression at least once.  So, for example, `ca+r' matches 
  3450.           the strings `car' and `caaaar' but not the string `cr', whereas 
  3451.           `ca*r' matches all three strings. 
  3452.  
  3453.           is a postfix character, similar to `*' except that it can match the 
  3454.           preceding expression either once or not at all.  For example, `ca?r' 
  3455.           matches `car' or `cr'; nothing else. 
  3456.  
  3457. [ ... ] 
  3458.           is a character set, which begins with `[' and is terminated by a `]'. 
  3459.           In the simplest case, the characters between the two brackets are 
  3460.           what this set can match. 
  3461.  
  3462.           Thus, `[ad]' matches either one `a' or one `d', and `[ad]*' matches 
  3463.           any string composed of just `a's and `d's (including the empty 
  3464.           string), from which it follows that `c[ad]*r' matches `cr', `car', 
  3465.           `cdr', `caddaar', etc. 
  3466.  
  3467.           You can also include character ranges a character set, by writing two 
  3468.           characters with a `-' between them.  Thus, `[a-z]' matches any 
  3469.           lower-case letter.  Ranges may be intermixed freely with individual 
  3470.           characters, as in `[a-z$%.]', which matches any lower case letter or 
  3471.           `$', `%' or period. 
  3472.  
  3473.           Note that the usual special characters are not special any more 
  3474.           inside a character set.  A completely different set of special 
  3475.           characters exists inside character sets: `]', `-' and `^'. 
  3476.  
  3477.           To include a `]' in a character set, you must make it the first 
  3478.           character.  For example, `[]a]' matches `]' or `a'.  To include a 
  3479.           `-', write `-' at the beginning or end of a range. To include `^', 
  3480.           make it other than the first character in the set. 
  3481.  
  3482. [^ ... ] 
  3483.           `[^' begins a complemented character set, which matches any character 
  3484.           except the ones specified.  Thus, `[^a-z0-9A-Z]' matches all 
  3485.           characters except letters and digits. 
  3486.  
  3487.           `^' is not special in a character set unless it is the first 
  3488.           character.  The character following the `^' is treated as if it were 
  3489.           first (`-' and `]' are not special there). 
  3490.  
  3491.           A complemented character set can match a newline, unless newline is 
  3492.           mentioned as one of the characters not to match.  This is in contrast 
  3493.           to the handling of regexps in programs such as grep. 
  3494.  
  3495.           is a special character that matches the empty string, but only at the 
  3496.           beginning of a line in the text being matched.  Otherwise it fails to 
  3497.           match anything.  Thus, `^foo' matches a `foo' which occurs at the 
  3498.           beginning of a line. 
  3499.  
  3500.           is similar to `^' but matches only at the end of a line.  Thus, 
  3501.           `xx*$' matches a string of one `x' or more at the end of a line. 
  3502.  
  3503.           has two functions: it quotes the special characters (including `\'), 
  3504.           and it introduces additional special constructs. 
  3505.  
  3506.           Because `\' quotes special characters, `\$' is a regular expression 
  3507.           which matches only `$', and `\[' is a regular expression which 
  3508.           matches only `[', etc. 
  3509.  
  3510. Note: for historical compatibility, special characters are treated as ordinary 
  3511. ones if they are in contexts where their special meanings make no sense.  For 
  3512. example, `*foo' treats `*' as ordinary since there is no preceding expression 
  3513. on which the `*' can act.  It is poor practice to depend on this behavior; 
  3514. better to quote the special character anyway, regardless of where is appears. 
  3515.  
  3516. For the most part, `\' followed by any character matches only that character. 
  3517. However, there are several exceptions: two-character sequences starting with 
  3518. `\' which have special meanings.  The second character in the sequence is 
  3519. always an ordinary character on their own.  Here is a table of `\' constructs. 
  3520.  
  3521. \| 
  3522.           specifies an alternative.  Two regular expressions a and b with `\|' 
  3523.           in between form an expression that matches anything that either a or 
  3524.           b matches. 
  3525.  
  3526.           Thus, `foo\|bar' matches either `foo' or `bar' but no other string. 
  3527.  
  3528.           `\|' applies to the largest possible surrounding expressions.  Only a 
  3529.           surrounding `\( ... \)' grouping can limit the scope of `\|'. 
  3530.  
  3531.           Full backtracking capability exists to handle multiple uses of `\|'. 
  3532.  
  3533. \( ... \) 
  3534.           is a grouping construct that serves three purposes: 
  3535.  
  3536.     1. To enclose a set of `\|' alternatives for other operations. Thus, 
  3537.        `\(foo\|bar\)x' matches either `foox' or `barx'. 
  3538.  
  3539.     2. To enclose a complicated expression for the postfix operators `*', `+' 
  3540.        and `?' to operate on.  Thus, `ba\(na\)*' matches `bananana', etc., with 
  3541.        any (zero or more) number of `na' strings. 
  3542.  
  3543.     3. To mark a matched substring for future reference. 
  3544.  
  3545.           This last application is not a consequence of the idea of a 
  3546.           parenthetical grouping; it is a separate feature which is assigned as 
  3547.           a second meaning to the same `\( ... \)' construct.  In practice 
  3548.           there is no conflict between the two meanings.  Here is an 
  3549.           explanation of this feature: 
  3550.  
  3551. \d 
  3552.           after the end of a `\( ... \)' construct, the matcher remembers the 
  3553.           beginning and end of the text matched by that construct.  Then, later 
  3554.           on in the regular expression, you can use `\' followed by the digit d 
  3555.           to mean ``match the same text matched the dth time by the `\( ... \)' 
  3556.           construct.'' 
  3557.  
  3558.           The strings matching the first nine `\( ... \)' constructs appearing 
  3559.           in a regular expression are assigned numbers 1 through 9 in order 
  3560.           that the open-parentheses appear in the regular expression. `\1' 
  3561.           through `\9' refer to the text previously matched by the 
  3562.           corresponding `\( ... \)' construct. 
  3563.  
  3564.           For example, `\(.*\)\1' matches any newline-free string that is 
  3565.           composed of two identical halves.  The `\(.*\)' matches the first 
  3566.           half, which may be anything, but the `\1' that follows must match the 
  3567.           same exact text. 
  3568.  
  3569. \` 
  3570.           matches the empty string, provided it is at the beginning of the 
  3571.           buffer. 
  3572.  
  3573. \' 
  3574.           matches the empty string, provided it is at the end of the buffer. 
  3575.  
  3576. \b 
  3577.           matches the empty string, provided it is at the beginning or end of a 
  3578.           word.  Thus, `\bfoo\b' matches any occurrence of `foo' as a separate 
  3579.           word.  `\bballs?\b' matches `ball' or `balls' as a separate word. 
  3580.  
  3581. \B 
  3582.           matches the empty string, provided it is not at the beginning or end 
  3583.           of a word. 
  3584.  
  3585. \< 
  3586.           matches the empty string, provided it is at the beginning of a word. 
  3587.  
  3588. \> 
  3589.           matches the empty string, provided it is at the end of a word. 
  3590.  
  3591. \w 
  3592.           matches any word-constituent character.  The syntax table determines 
  3593.           which characters these are. 
  3594.  
  3595. \W 
  3596.           matches any character that is not a word-constituent. 
  3597.  
  3598. \sc 
  3599.           matches any character whose syntax is c.  Here c is a character which 
  3600.           represents a syntax code: thus, `w' for word constituent, `(' for 
  3601.           open-parenthesis, etc.  Represent a character of whitespace (which 
  3602.           can be a newline) by either `-' or a space character. 
  3603.  
  3604. \Sc 
  3605.           matches any character whose syntax is not c. 
  3606.  
  3607.  The constructs that pertain to words and syntax are controlled by the setting 
  3608. of the syntax table (see Syntax). 
  3609.  
  3610.  Here is a complicated regexp, used by Emacs to recognize the end of a sentence 
  3611. together with any whitespace that follows.  It is given in Lisp syntax to 
  3612. enable you to distinguish the spaces from the tab characters.  In Lisp syntax, 
  3613. the string constant begins and ends with a double-quote. `\"' stands for a 
  3614. double-quote as part of the regexp, `\\' for a backslash as part of the regexp, 
  3615. `\t' for a tab and `\n' for a newline. 
  3616.  
  3617. "[.?!][]\"')]*\\($\\|\t\\|  \\)[ \t\n]*"
  3618.  
  3619. This contains four parts in succession: a character set matching period, `?', 
  3620. or `!'; a character set matching close-brackets, quotes, or parentheses, 
  3621. repeated any number of times; an alternative in backslash-parentheses that 
  3622. matches end-of-line, a tab, or two spaces; and a character set matching 
  3623. whitespace characters, repeated any number of times. 
  3624.  
  3625.  To enter the same regexp interactively, you would type TAB to enter a tab, and 
  3626. C-q C-j to enter a newline.  You would also type single slashes as themselves, 
  3627. instead of doubling them for Lisp syntax. 
  3628.  
  3629.  
  3630. ΓòÉΓòÉΓòÉ 16.6. Searching and Case ΓòÉΓòÉΓòÉ
  3631.  
  3632.  All sorts of searches in Emacs normally ignore the case of the text they are 
  3633. searching through, if you specify the text in lower case. Thus, if you specify 
  3634. searching for `foo', then `Foo' and `foo' are also considered a match. 
  3635. Regexps, and in particular character sets, are included: `[ab]' would match `a' 
  3636. or `A' or `b' or `B'. 
  3637.  
  3638.  An upper-case letter in the search string makes the search case-sensitive. 
  3639. Thus, searching for `Foo' does not find `foo' or `FOO'.  This applies to 
  3640. regular expression search also.  If you delete the upper-case character from 
  3641. the search string, it ceases to have this effect. 
  3642.  
  3643.  If you set the variable case-fold-search to nil, then all letters must match 
  3644. exactly, including case.  This is a per-buffer variable; altering the variable 
  3645. affects only the current buffer, but there is a default value which you can 
  3646. change as well.  See Locals. 
  3647.  
  3648.  
  3649. ΓòÉΓòÉΓòÉ 16.7. Replacement Commands ΓòÉΓòÉΓòÉ
  3650.  
  3651.  Global search-and-replace operations are not needed as often in Emacs as they 
  3652. are in other editors (In some editors, search-and-replace operations are the 
  3653. only convenient way to make a single change in the text.) , but they are 
  3654. available.  In addition to the simple M-x replace-string command which is like 
  3655. that found in most editors, there is a M-x query-replace command which asks 
  3656. you, for each occurrence of the pattern, whether to replace it. 
  3657.  
  3658.  The replace commands all replace one string (or regexp) with one replacement 
  3659. string.  It is possible to perform several replacements in parallel using the 
  3660. command expand-region-abbrevs. See Expanding Abbrevs. 
  3661.  
  3662.  
  3663. ΓòÉΓòÉΓòÉ 16.7.1. Unconditional Replacement ΓòÉΓòÉΓòÉ
  3664.  
  3665. M-x replace-string RET string RET newstring RET 
  3666.           Replace every occurrence of string with newstring. 
  3667.  
  3668. M-x replace-regexp RET regexp RET newstring RET 
  3669.           Replace every match for regexp with newstring. 
  3670.  
  3671.  To replace every instance of `foo' after point with `bar', use the command M-x 
  3672. replace-string with the two arguments `foo' and `bar'.  Replacement happens 
  3673. only in the text after point, so if you want to cover the whole buffer you must 
  3674. go to the beginning first.  All occurrences up to the end of the buffer are 
  3675. replaced; to limit replacement to part of the buffer, narrow to that part of 
  3676. the buffer before doing the replacement (see Narrowing). 
  3677.  
  3678.  When replace-string exits, point is left at the last occurrence replaced.  The 
  3679. position of point where the replace-string command was issued is remembered on 
  3680. the mark ring; use C-u C-SPC to move back there. 
  3681.  
  3682.  A numeric argument restricts replacement to matches that are surrounded by 
  3683. word boundaries. 
  3684.  
  3685.  
  3686. ΓòÉΓòÉΓòÉ 16.7.2. Regexp Replacement ΓòÉΓòÉΓòÉ
  3687.  
  3688.  The M-x replace-string command replaces exact matches for a single string. 
  3689. The similar command M-x replace-regexp replaces any match for a specified 
  3690. pattern. 
  3691.  
  3692.  In replace-regexp, the newstring need not be constant: it can refer to all or 
  3693. part of what is matched by the regexp. `\&' in newstring stands for the entire 
  3694. text being replaced. `\d' in newstring, where d is a digit, stands for whatever 
  3695. matched the dth parenthesized grouping in regexp. To include a `\' in the text 
  3696. to replace with, you must give `\\'.  For example, 
  3697.  
  3698. M-x replace-regexp RET c[ad]+r RET \&-safe RET
  3699.  
  3700. replaces (for example) `cadr' with `cadr-safe' and `cddr' with `cddr-safe'. 
  3701.  
  3702. M-x replace-regexp RET \(c[ad]+r\)-safe RET \1 RET
  3703.  
  3704. performs the inverse transformation. 
  3705.  
  3706.  
  3707. ΓòÉΓòÉΓòÉ 16.7.3. Replace Commands and Case ΓòÉΓòÉΓòÉ
  3708.  
  3709.  If the arguments to a replace command are in lower case, it preserves case 
  3710. when it makes a replacement.  Thus, the command 
  3711.  
  3712. M-x replace-string RET foo RET bar RET
  3713.  
  3714. replaces a lower case `foo' with a lower case `bar', `FOO' with `BAR', and 
  3715. `Foo' with `Bar'.  If upper case letters are used in the second argument, they 
  3716. remain upper case every time that argument is inserted.  If upper case letters 
  3717. are used in the first argument, the second argument is always substituted 
  3718. exactly as given, with no case conversion.  Likewise, if the variable 
  3719. case-replace is set to nil, replacement is done without case conversion.  If 
  3720. case-fold-search is set to nil, case is significant in matching occurrences of 
  3721. `foo' to replace; this also inhibits case conversion of the replacement string. 
  3722.  
  3723.  
  3724. ΓòÉΓòÉΓòÉ 16.7.4. Query Replace ΓòÉΓòÉΓòÉ
  3725.  
  3726. M-% string RET newstring RET 
  3727. M-x query-replace RET string RET newstring RET 
  3728.           Replace some occurrences of string with newstring. 
  3729.  
  3730. M-x query-replace-regexp RET regexp RET newstring RET 
  3731.           Replace some matches for regexp with newstring. 
  3732.  
  3733.  If you want to change only some of the occurrences of `foo' to `bar', not all 
  3734. of them, then you cannot use an ordinary replace-string.  Instead, use M-% 
  3735. (query-replace). This command finds occurrences of `foo' one by one, displays 
  3736. each occurrence and asks you whether to replace it.  A numeric argument to 
  3737. query-replace tells it to consider only occurrences that are bounded by 
  3738. word-delimiter characters.  This preserves case, just like replace-string, 
  3739. provided case-replace is non-nil, as it normally is. 
  3740.  
  3741.  Aside from querying, query-replace works just like replace-string, and 
  3742. query-replace-regexp works just like replace-regexp.  The shortest way to type 
  3743. this command name is M-x qu SPC SPC SPC RET. 
  3744.  
  3745.  The things you can type when you are shown an occurrence of string or a match 
  3746. for regexp are: 
  3747.  
  3748. SPC 
  3749.           to replace the occurrence with newstring. 
  3750.  
  3751. DEL 
  3752.           to skip to the next occurrence without replacing this one. 
  3753.  
  3754. , (Comma) 
  3755.           to replace this occurrence and display the result.  You are then 
  3756.           asked for another input character, except that since the replacement 
  3757.           has already been made, DEL and SPC are equivalent.  You could type 
  3758.           C-r at this point (see below) to alter the replaced text.  You could 
  3759.           also type C-x u to undo the replacement; this exits the 
  3760.           query-replace, so if you want to do further replacement you must use 
  3761.           C-x ESC RET to restart (see Repetition). 
  3762.  
  3763. RET 
  3764. ESC 
  3765.           to exit without doing any more replacements. 
  3766.  
  3767. . (Period) 
  3768.           to replace this occurrence and then exit without searching for more 
  3769.           occurrences. 
  3770.  
  3771.           to replace all remaining occurrences without asking again. 
  3772.  
  3773.           to go back to the position of the previous occurrence (or what used 
  3774.           to be an occurrence), in case you changed it by mistake.  This works 
  3775.           by popping the mark ring.  Only one ^ in a row is allowed, because 
  3776.           only one previous replacement position is kept during query-replace. 
  3777.  
  3778. C-r 
  3779.           to enter a recursive editing level, in case the occurrence needs to 
  3780.           be edited rather than just replaced with newstring.  When you are 
  3781.           done, exit the recursive editing level with C-M-c to proceed to the 
  3782.           next occurrence.  See Recursive Edit. 
  3783.  
  3784. C-w 
  3785.           to delete the occurrence, and then enter a recursive editing level as 
  3786.           in C-r.  Use the recursive edit to insert text to replace the deleted 
  3787.           occurrence of string.  When done, exit the recursive editing level 
  3788.           with C-M-c to proceed to the next occurrence. 
  3789.  
  3790. C-l 
  3791.           to redisplay the screen.  Then you must type another character to 
  3792.           specify what to do with this occurrence. 
  3793.  
  3794. C-h 
  3795.           to display a message summarizing these options.  Then you must type 
  3796.           another character to specify what to do with this occurrence. 
  3797.  
  3798.  Some other characters are aliases for the ones listed above: y, n and q are 
  3799. equivalent to SPC, DEL and ESC. 
  3800.  
  3801.  Aside from this, any other character exits the query-replace, and is then 
  3802. reread as part of a key sequence.  Thus, if you type C-k, it exits the 
  3803. query-replace and then kills to end of line. 
  3804.  
  3805.  To restart a query-replace once it is exited, use C-x ESC, which repeats the 
  3806. query-replace because it used the minibuffer to read its arguments.  See 
  3807. Repetition. 
  3808.  
  3809.  See also Transforming File Names, for Dired commands to rename, copy, or link 
  3810. files by replacing regexp matches in file names. 
  3811.  
  3812.  
  3813. ΓòÉΓòÉΓòÉ 16.8. Other Search-and-Loop Commands ΓòÉΓòÉΓòÉ
  3814.  
  3815.  Here are some other commands that find matches for a regular expression. They 
  3816. all operate from point to the end of the buffer. 
  3817.  
  3818. M-x occur RET regexp RET 
  3819.           Print each line that follows point and contains a match for regexp. 
  3820.           A numeric argument specifies the number of context lines to print 
  3821.           before and after each matching line; the default is none. 
  3822.  
  3823.           The buffer `*Occur*' containing the output serves as a menu for 
  3824.           finding the occurrences in their original context.  Find an 
  3825.           occurrence as listed in `*Occur*', position point there and type C-c 
  3826.           C-c; this switches to the buffer that was searched and moves point to 
  3827.           the original of the same occurrence. 
  3828.  
  3829. M-x list-matching-lines 
  3830.           Synonym for M-x occur. 
  3831.  
  3832. M-x count-matches RET regexp RET 
  3833.           Print the number of matches for regexp after point. 
  3834.  
  3835. M-x flush-lines RET regexp RET 
  3836.           Delete each line that follows point and does not contain a match for 
  3837.           regexp. 
  3838.  
  3839. M-x keep-lines RET regexp RET 
  3840.           Delete each line that follows point and contains a match for regexp. 
  3841.  
  3842.  
  3843. ΓòÉΓòÉΓòÉ 17. Commands for Fixing Typos ΓòÉΓòÉΓòÉ
  3844.  
  3845.  In this chapter we describe the commands that are especially useful for the 
  3846. times when you catch a mistake in your text just after you have made it, or 
  3847. change your mind while composing text on line. 
  3848.  
  3849.  
  3850. ΓòÉΓòÉΓòÉ 17.1. Killing Your Mistakes ΓòÉΓòÉΓòÉ
  3851.  
  3852. DEL 
  3853.           Delete last character (delete-backward-char). 
  3854.  
  3855. M-DEL 
  3856.           Kill last word (backward-kill-word). 
  3857.  
  3858. C-x DEL 
  3859.           Kill to beginning of sentence (backward-kill-sentence). 
  3860.  
  3861.  The DEL character (delete-backward-char) is the most important correction 
  3862. command.  When used among graphic (self-inserting) characters, it can be 
  3863. thought of as canceling the last character typed. 
  3864.  
  3865.  When your mistake is longer than a couple of characters, it might be more 
  3866. convenient to use M-DEL or C-x DEL. M-DEL kills back to the start of the last 
  3867. word, and C-x DEL kills back to the start of the last sentence.  C-x DEL is 
  3868. particularly useful when you change your mind about the phrasing of the text 
  3869. you are writing.  M-DEL and C-x DEL save the killed text for C-y and M-y to 
  3870. retrieve.  See Yanking. 
  3871.  
  3872.  M-DEL is often useful even when you have typed only a few characters wrong, if 
  3873. you know you are confused in your typing and aren't sure exactly what you 
  3874. typed.  At such a time, you cannot correct with DEL except by looking at the 
  3875. screen to see what you did.  It requires less thought to kill the whole word 
  3876. and start over again. 
  3877.  
  3878.  
  3879. ΓòÉΓòÉΓòÉ 17.2. Transposing Text ΓòÉΓòÉΓòÉ
  3880.  
  3881. C-t 
  3882.           Transpose two characters (transpose-chars). 
  3883.  
  3884. M-t 
  3885.           Transpose two words (transpose-words). 
  3886.  
  3887. C-M-t 
  3888.           Transpose two balanced expressions (transpose-sexps). 
  3889.  
  3890. C-x C-t 
  3891.           Transpose two lines (transpose-lines). 
  3892.  
  3893.  The common error of transposing two characters can be fixed, when they are 
  3894. adjacent, with the C-t command (transpose-chars).  Normally, C-t transposes the 
  3895. two characters on either side of point.  When given at the end of a line, 
  3896. rather than transposing the last character of the line with the newline, which 
  3897. would be useless, C-t transposes the last two characters on the line.  So, if 
  3898. you catch your transposition error right away, you can fix it with just a C-t. 
  3899. If you don't catch it so fast, you must move the cursor back to between the two 
  3900. transposed characters.  If you transposed a space with the last character of 
  3901. the word before it, the word motion commands are a good way of getting there. 
  3902. Otherwise, a reverse search (C-r) is often the best way. See Search. 
  3903.  
  3904.  M-t (transpose-words) transposes the word before point with the word after 
  3905. point.  It moves point forward over a word, dragging the word preceding or 
  3906. containing point forward as well.  The punctuation characters between the words 
  3907. do not move.  For example, `FOO, BAR' transposes into `BAR, FOO' rather than 
  3908. `BAR FOO,'. 
  3909.  
  3910.  C-M-t (transpose-sexps) is a similar command for transposing two expressions 
  3911. (see Lists), and C-x C-t (transpose-lines) exchanges lines.  They work like M-t 
  3912. except in determining the division of the text into syntactic units. 
  3913.  
  3914.  A numeric argument to a transpose command serves as a repeat count: it tells 
  3915. the transpose command to move the character (word, sexp, line) before or 
  3916. containing point across several other characters (words, sexps, lines).  For 
  3917. example, C-u 3 C-t moves the character before point forward across three other 
  3918. characters.  It would change `f-!-oobar' into `oobf-!-ar'.  This is equivalent 
  3919. to repeating C-t three times.  C-u - 4 M-t moves the word before point backward 
  3920. across four words.  C-u - C-M-t would cancel the effect of plain C-M-t. 
  3921.  
  3922.  A numeric argument of zero is assigned a special meaning (because otherwise a 
  3923. command with a repeat count of zero would do nothing): to transpose the 
  3924. character (word, sexp, line) ending after point with the one ending after the 
  3925. mark. 
  3926.  
  3927.  
  3928. ΓòÉΓòÉΓòÉ 17.3. Case Conversion ΓòÉΓòÉΓòÉ
  3929.  
  3930. M-- M-l 
  3931.           Convert last word to lower case.  Note Meta-- is Meta-minus. 
  3932.  
  3933. M-- M-u 
  3934.           Convert last word to all upper case. 
  3935.  
  3936. M-- M-c 
  3937.           Convert last word to lower case with capital initial. 
  3938.  
  3939.  A very common error is to type words in the wrong case.  Because of this, the 
  3940. word case-conversion commands M-l, M-u and M-c have a special feature when used 
  3941. with a negative argument: they do not move the cursor.  As soon as you see you 
  3942. have mistyped the last word, you can simply case-convert it and go on typing. 
  3943. See Case. 
  3944.  
  3945.  
  3946. ΓòÉΓòÉΓòÉ 17.4. Checking and Correcting Spelling ΓòÉΓòÉΓòÉ
  3947.  
  3948.  This section describes the commands to check the spelling of a single word or 
  3949. of a portion of a buffer. 
  3950.  
  3951. M-$ 
  3952.           Check and correct spelling of word at point (ispell-word). 
  3953.  
  3954. M-x ispell-buffer 
  3955.           Check and correct spelling of each word in the buffer. 
  3956.  
  3957. M-x ispell-region 
  3958.           Check and correct spelling of each word in the region. 
  3959.  
  3960. M-x ispell-string RET word RET 
  3961.           Check spelling of word. 
  3962.  
  3963. M-x reload-ispell 
  3964.           Make the Ispell subprocess reread your private dictionary. 
  3965.  
  3966. M-x kill-ispell 
  3967.           Kill the Ispell subprocess. 
  3968.  
  3969.  To check the spelling of the word around or next to point, and optionally 
  3970. correct it as well, use the command M-$  (ispell-word).  If the word is not 
  3971. correct, the command offers  you various alternatives for what to do about it. 
  3972.  
  3973.   To check the entire current buffer, use M-x ispell-buffer.  Use  M-x 
  3974. ispell-region to check just the current region.  Each time  these commands 
  3975. encounter an incorrect word, they ask you what to do. 
  3976.  
  3977.   Whenever one of these commands finds an incorrect word, it displays a  list 
  3978. of alternatives, usually including several ``near-misses''---words  that are 
  3979. close to the word being checked.  Here are the valid responses: 
  3980.  
  3981. SPC 
  3982.            Skip this word---continue to consider it incorrect, but don't change 
  3983.           it  here. 
  3984.  
  3985. r new RET 
  3986.            Replace the word (just this time) with new. 
  3987.  
  3988. digit 
  3989.            Replace the word (just this time) with one of the displayed 
  3990.           near-misses.  Each near-miss is listed with a digit; type that digit 
  3991.           to  select it. 
  3992.  
  3993.            Accept the incorrect word---treat it as correct, but only in this 
  3994.           editing session. 
  3995.  
  3996.            Insert this word in your private dictionary file so that Ispell will 
  3997.           consider it correct it from now on, even in future sessions. 
  3998.  
  3999. l regexp RET 
  4000.            Look in the dictionary for words that match regexp.  These words 
  4001.           become the new list of ``near-misses''; you can select one of them to 
  4002.           replace with by typing a digit. 
  4003.  
  4004. C-g 
  4005.            Quit interactive spell checking.  You can restart it again afterward 
  4006.           with C-u M-$. 
  4007.  
  4008.   The first time you use any of the spell checking commands, it starts  an 
  4009. Ispell subprocess.  The first thing the subprocess does is read your  private 
  4010. dictionary, which is the file `~/ispell.words'.  Words that  you ``insert'' 
  4011. with the i command are added to that file, but not  right away---only at the 
  4012. end of the interactive replacement procedure.  Use the M-x reload-ispell 
  4013. command to reload your private  dictionary from `~/ispell.words' if you edit 
  4014. the file outside of  Ispell. 
  4015.  
  4016.   Once started, the Ispell subprocess continues to run (waiting for  something 
  4017. to do), so that subsequent spell checking commands complete  more quickly.  If 
  4018. you want to get rid of the Ispell process, use  M-x kill-ispell.  This is not 
  4019. usually necessary, since the process  uses no time except when you do spelling 
  4020. correction. 
  4021.  
  4022.  
  4023. ΓòÉΓòÉΓòÉ 18. File Handling ΓòÉΓòÉΓòÉ
  4024.  
  4025.  The basic unit of stored data in Unix is the file.  To edit a file, you must 
  4026. tell Emacs to examine the file and prepare a buffer containing a copy of the 
  4027. file's text.  This is called visiting the file.  Editing commands apply 
  4028. directly to text in the buffer; that is, to the copy inside Emacs.  Your 
  4029. changes appear in the file itself only when you save the buffer back into the 
  4030. file. 
  4031.  
  4032.  In addition to visiting and saving files, Emacs can delete, copy, rename, and 
  4033. append to files, keep multiple versions of them, and operate on file 
  4034. directories. 
  4035.  
  4036.  
  4037. ΓòÉΓòÉΓòÉ 18.1. File Names ΓòÉΓòÉΓòÉ
  4038.  
  4039.  Most Emacs commands that operate on a file require you to specify the file 
  4040. name.  (Saving and reverting are exceptions; the buffer knows which file name 
  4041. to use for them.)  You enter the file name using the minibuffer (see 
  4042. Minibuffer).  Completion is available, to make it easier to specify long file 
  4043. names.  See Completion. 
  4044.  
  4045.  For most operations, there is a default file name which is used if you type 
  4046. just RET to enter an empty argument.  Normally the default file name is the 
  4047. name of the file visited in the current buffer; this makes it easy to operate 
  4048. on that file with any of the Emacs file commands. 
  4049.  
  4050.  Each buffer has a default directory, normally the same as the directory of the 
  4051. file visited in that buffer.  When you enter a file name without a directory, 
  4052. the default directory is used.  If you specify a directory in a relative 
  4053. fashion, with a name that does not start with a slash, it is interpreted with 
  4054. respect to the default directory.  The default directory is kept in the 
  4055. variable default-directory, which has a separate value in every buffer. 
  4056.  
  4057.  For example, if the default file name is `/u/rms/gnu/gnu.tasks' then the 
  4058. default directory is `/u/rms/gnu/'.  If you type just `foo', which does not 
  4059. specify a directory, it is short for `/u/rms/gnu/foo'. `../.login' would stand 
  4060. for `/u/rms/.login'.  `new/foo' would stand for the file name 
  4061. `/u/rms/gnu/new/foo'. 
  4062.  
  4063.  The command M-x pwd prints the current buffer's default directory, and the 
  4064. command M-x cd sets it (to a value read using the minibuffer).  A buffer's 
  4065. default directory changes only when the cd command is used.  A file-visiting 
  4066. buffer's default directory is initialized to the directory of the file that is 
  4067. visited there.  If you create a buffer with C-x b, its default directory is 
  4068. copied from that of the buffer that was current at the time. 
  4069.  
  4070.  The default directory actually appears in the minibuffer when the minibuffer 
  4071. becomes active to read a file name.  This serves two purposes: it shows you 
  4072. what the default is, so that you can type a relative file name and know with 
  4073. certainty what it will mean, and it allows you to edit the default to specify a 
  4074. different directory. This insertion of the default directory is inhibited if 
  4075. the variable insert-default-directory is set to nil. 
  4076.  
  4077.  Note that it is legitimate to type an absolute file name after you enter the 
  4078. minibuffer, ignoring the presence of the default directory name as part of the 
  4079. text.  The final minibuffer contents may look invalid, but that is not so.  For 
  4080. example, if the minibuffer starts out with `/usr/tmp/' and you add 
  4081. `/x1/rms/foo', the double slash says to ignore the default directory and use 
  4082. just the name that you typed.  See Minibuffer File. 
  4083.  
  4084.  You can refer to files on other machines using a special file name syntax: 
  4085.  
  4086. /host:filename
  4087. /user@host:filename
  4088.  
  4089.  When you do this, Emacs uses the FTP program to read and write files on the 
  4090. specified host.  It logs in through FTP using your user name or the name user. 
  4091. It may ask you for a password from time to time; this is used for logging in on 
  4092. host. 
  4093.  
  4094.  `$' in a file name is used to substitute environment variables.  For example, 
  4095. if you have used the shell command `setenv FOO rms/hacks' to set up an 
  4096. environment variable named `FOO', then you can use `/u/$FOO/test.c' or 
  4097. `/u/${FOO}/test.c' as an abbreviation for `/u/rms/hacks/test.c'.  The 
  4098. environment variable name consists of all the alphanumeric characters after the 
  4099. `$'; alternatively, it may be enclosed in braces after the `$'.  Note that the 
  4100. `setenv' command affects Emacs only if done before Emacs is started. 
  4101.  
  4102.  To access a file with `$' in its name, type `$$'.  This pair is converted to a 
  4103. single `$' at the same time as variable substitution is performed for single 
  4104. `$'.  The Lisp function that performs the substitution is called 
  4105. substitute-in-file-name.  The substitution is performed only on file names read 
  4106. as such using the minibuffer. 
  4107.  
  4108.  
  4109. ΓòÉΓòÉΓòÉ 18.2. Visiting Files ΓòÉΓòÉΓòÉ
  4110.  
  4111. C-x C-f 
  4112.           Visit a file (find-file). 
  4113.  
  4114. C-x C-r 
  4115.           Visit a file for viewing, without allowing changes to it 
  4116.           (find-file-read-only). 
  4117.  
  4118. C-x C-v 
  4119.           Visit a different file instead of the one visited last 
  4120.           (find-alternate-file). 
  4121.  
  4122. C-x 4 C-f 
  4123.           Visit a file, in another window (find-file-other-window).  Don't 
  4124.           change the selected window. 
  4125.  
  4126. C-x 5 C-f 
  4127.           Visit a file, in a new frame (find-file-other-frame).  Don't change 
  4128.           the selected frame. 
  4129.  
  4130.  Visiting a file means copying its contents into an Emacs buffer so you can 
  4131. edit them.  Emacs makes a new buffer for each file that you visit.  We say that 
  4132. this buffer is visiting the file that it was created to hold.  Emacs constructs 
  4133. the buffer name from the file name by throwing away the directory, keeping just 
  4134. the name proper.  For example, a file named `/usr/rms/emacs.tex' would get a 
  4135. buffer named `emacs.tex'.  If there is already a buffer with that name, a 
  4136. unique name is constructed by appending `<2>', `<3>', or so on, using the 
  4137. lowest number that makes a name that is not already in use. 
  4138.  
  4139.  Each window's mode line shows the name of the buffer that is being displayed 
  4140. in that window, so you can always tell what buffer you are editing. 
  4141.  
  4142.  The changes you make with Emacs are made in the Emacs buffer.  They do not 
  4143. take effect in the file that you visited, or any place permanent, until you 
  4144. save the buffer.  Saving the buffer means that Emacs writes the current 
  4145. contents of the buffer into its visited file.  See Saving. 
  4146.  
  4147.  If a buffer contains changes that have not been saved, we say the buffer is 
  4148. modified.  This is important because it implies that some changes will be lost 
  4149. if the buffer is not saved.  The mode line displays two stars near the left 
  4150. margin to indicate that the buffer is modified. 
  4151.  
  4152.  To visit a file, use the command C-x C-f (find-file).  Follow the command with 
  4153. the name of the file you wish to visit, terminated by a RET. 
  4154.  
  4155.  The file name is read using the minibuffer (see Minibuffer), with defaulting 
  4156. and completion in the standard manner (see File Names). While in the 
  4157. minibuffer, you can abort C-x C-f by typing C-g. 
  4158.  
  4159.  Your confirmation that C-x C-f has completed successfully is the appearance of 
  4160. new text on the screen and a new buffer name in the mode line.  If the 
  4161. specified file does not exist and could not be created, or cannot be read, then 
  4162. you get an error, with an error message displayed in the echo area. 
  4163.  
  4164.  If you visit a file that is already in Emacs, C-x C-f does not make another 
  4165. copy.  It selects the existing buffer containing that file. However, before 
  4166. doing so, it checks that the file itself has not changed since you visited or 
  4167. saved it last.  If the file has changed, a warning message is printed.  See 
  4168. Simultaneous Editing. 
  4169.  
  4170.  What if you want to create a new file?  Just visit it.  Emacs prints `(New 
  4171. File)' in the echo area, but in other respects behaves as if you had visited an 
  4172. existing empty file.  If you make any changes and save them, the file is 
  4173. created. 
  4174.  
  4175.  If the file you specify is actually a directory, Dired is called on that 
  4176. directory (see Dired).  This can be inhibited by setting the variable 
  4177. find-file-run-dired to nil; then it is an error to try to visit a directory. 
  4178.  
  4179.  If you visit a file that the operating system won't let you modify, Emacs 
  4180. makes the buffer read-only, so that you won't go ahead and make changes that 
  4181. you'll have trouble saving afterward.  You can make the buffer writable with 
  4182. C-x C-q (toggle-read-only). See Misc Buffer. 
  4183.  
  4184.  Occasionally you might want to visit a file as read-only in order to protect 
  4185. yourself from entering changes accidentally; do so by visiting the file with 
  4186. the command C-x C-r (find-file-read-only). 
  4187.  
  4188.  If you visit a nonexistent file unintentionally (because you typed the wrong 
  4189. file name), use the C-x C-v command (find-alternate-file) to visit the file you 
  4190. really wanted. C-x C-v is similar to C-x C-f, but it kills the current buffer 
  4191. (after first offering to save it if it is modified).  When it reads the file 
  4192. name to visit, it inserts the entire default file name in the buffer, with 
  4193. point just after the directory part; this is convenient if you made a slight 
  4194. error in typing the name. 
  4195.  
  4196.  C-x 4 f (find-file-other-window) is like C-x C-f except that the buffer 
  4197. containing the specified file is selected in another window.  The window that 
  4198. was selected before C-x 4 f continues to show the same buffer it was already 
  4199. showing.  If this command is used when only one window is being displayed, that 
  4200. window is split in two, with one window showing the same buffer as before, and 
  4201. the other one showing the newly requested file.  See Windows. 
  4202.  
  4203.  C-x 5 f (find-file-other-frame) is similar, but opens a new frame.  This 
  4204. feature is available only when you are using a window system.  See Frames. 
  4205.  
  4206.  Two special hook variables allow extensions to modify the operation of 
  4207. visiting files.  Visiting a file that does not exist runs the functions in the 
  4208. list find-file-not-found-hooks; this variable holds a list of functions, and 
  4209. the functions are called one by one until one of them returns non-nil.  Any 
  4210. visiting of a file, whether extant or not, expects find-file-hooks to contain a 
  4211. list of functions and calls them all, one by one.  In both cases the functions 
  4212. receive no arguments.  Of these two variables, find-file-not-found-hooks takes 
  4213. effect first.  These variables are not normal hooks, and their names end in 
  4214. `-hooks' rather than `-hook' to indicate that fact. 
  4215.  
  4216.  There are several ways to specify automatically the major mode for editing the 
  4217. file (see Choosing Modes), and to specify local variables defined for that file 
  4218. (see File Variables). 
  4219.  
  4220.  
  4221. ΓòÉΓòÉΓòÉ 18.3. Saving Files ΓòÉΓòÉΓòÉ
  4222.  
  4223.  Saving a buffer in Emacs means writing its contents back into the file that 
  4224. was visited in the buffer. 
  4225.  
  4226. C-x C-s 
  4227.           Save the current buffer in its visited file (save-buffer). 
  4228.  
  4229. C-x s 
  4230.           Save any or all buffers in their visited files (save-some-buffers). 
  4231.  
  4232. M-~ 
  4233.           Forget that the current buffer has been changed (not-modified). 
  4234.  
  4235. C-x C-w 
  4236.           Save the current buffer in a specified file (write-file). 
  4237.  
  4238. M-x set-visited-file-name 
  4239.           Change file the name under which the current buffer will be saved. 
  4240.  
  4241.  When you wish to save the file and make your changes permanent, type C-x C-s 
  4242. (save-buffer).  After saving is finished, C-x C-s prints a message such as 
  4243.  
  4244. Wrote /u/rms/gnu/gnu.tasks
  4245.  
  4246. If the selected buffer is not modified (no changes have been made in it since 
  4247. the buffer was created or last saved), saving is not really done, because it 
  4248. would have no effect.  Instead, C-x C-s prints a message in the echo area 
  4249. saying 
  4250.  
  4251. (No changes need to be written)
  4252.  
  4253.  The command C-x s (save-some-buffers) offers to save any or all modified 
  4254. buffers.  It asks you what to do with each buffer.  The options are analogous 
  4255. to those of query-replace: 
  4256.  
  4257.           Save this buffer and ask about the rest of the buffers. 
  4258.  
  4259.           Don't save this buffer, but ask about the rest of the buffers. 
  4260.  
  4261.           Save this buffer and all the rest with no more questions. 
  4262.  
  4263. ESC 
  4264.           Terminate save-some-buffers without any more saving. 
  4265.  
  4266.           Save this buffer, then exit save-some-buffers without even asking 
  4267.           about other buffers. 
  4268.  
  4269. C-r 
  4270.           View the buffer that you are currently being asked about.  When you 
  4271.           exit View mode, you get back to save-some-buffers, which asks the 
  4272.           question again. 
  4273.  
  4274. C-h 
  4275.           Display a help message about these options. 
  4276.  
  4277.  C-x C-c, the key sequence to exit Emacs, invokes save-some-buffers and 
  4278. therefore asks the same questions. 
  4279.  
  4280.  If you have changed a buffer and do not want the changes to be saved, you 
  4281. should take some action to prevent it.  Otherwise, each time you use C-x s or 
  4282. C-x C-c, you are liable to save it by mistake.  One thing you can do is type 
  4283. M-~ (not-modified), which clears out the indication that the buffer is 
  4284. modified.  If you do this, none of the save commands will believe that the 
  4285. buffer needs to be saved. (`~' is often used as a mathematical symbol for 
  4286. `not'; thus M-~ is `not', metafied.)  You could also use set-visited-file-name 
  4287. (see below) to mark the buffer as visiting a different file name, one which is 
  4288. not in use for anything important. Alternatively, you can cancel all the 
  4289. changes made since the file was visited or saved, by reading the text from the 
  4290. file again.  This is called reverting.  See Reverting.  You could also undo all 
  4291. the changes by repeating the undo command C-x u until you have undone all the 
  4292. changes; but reverting is easier. 
  4293.  
  4294.  M-x set-visited-file-name alters the name of the file that the current buffer 
  4295. is visiting.  It reads the new file name using the minibuffer.  Then it 
  4296. specifies the visited file name and changes the buffer name correspondingly (as 
  4297. long as the new name is not in use). set-visited-file-name does not save the 
  4298. buffer in the newly visited file; it just alters the records inside Emacs in 
  4299. case you do save later.  It also marks the buffer as ``modified'' so that C-x 
  4300. C-s in that buffer will save. 
  4301.  
  4302.  If you wish to mark the buffer as visiting a different file and save it right 
  4303. away, use C-x C-w (write-file).  It is precisely equivalent to 
  4304. set-visited-file-name followed by C-x C-s. C-x C-s used on a buffer that is not 
  4305. visiting with a file has the same effect as C-x C-w; that is, it reads a file 
  4306. name, marks the buffer as visiting that file, and saves it there.  The default 
  4307. file name in a buffer that is not visiting a file is made by combining the 
  4308. buffer name with the buffer's default directory. 
  4309.  
  4310.  If Emacs is about to save a file and sees that the date of the latest version 
  4311. on disk does not match what Emacs last read or wrote, Emacs notifies you of 
  4312. this fact, because it probably indicates a problem caused by simultaneous 
  4313. editing and requires your immediate attention. See Simultaneous Editing. 
  4314.  
  4315.  If the variable require-final-newline is non-nil, Emacs puts a newline at the 
  4316. end of any file that doesn't already end in one, every time a file is saved or 
  4317. written. 
  4318.  
  4319.  You can implement other ways to write files, and other things to be done 
  4320. before writing them, using the variable write-file-hooks.  The value of this 
  4321. variable should be a list of Lisp functions.  When a file is to be written, the 
  4322. functions in the list are called, one by one, with no arguments.  If one of 
  4323. them returns a non-nil value, Emacs takes this to mean that the file has been 
  4324. written in some suitable fashion; the rest of the functions are not called, and 
  4325. normal writing is not done.  If this variable is local to a buffer, changing 
  4326. major modes does not clear it.  However, changing the visited file name does 
  4327. clear this variable to nil. 
  4328.  
  4329.  The list local-write-file-hooks is used just like write-file-hooks.  This list 
  4330. is for use as a local variable.  It is a permanent local, so that switching 
  4331. major modes does not affect it. 
  4332.  
  4333.  The variable write-contents-hooks holds another list of functions to be called 
  4334. before writing out a buffer to a file.  These functions are used just like the 
  4335. ones in write-file-hooks.  The difference between this and write-file-hooks is 
  4336. that changing the major mode does clear this variable, and setting the visited 
  4337. file name does not clear it. 
  4338.  
  4339.  The hook variables described here are not normal hooks, because the values 
  4340. returned by the hook functions do matter.  This is why they have names ending 
  4341. in `-hooks' rather than `-hook'.  See Hooks. 
  4342.  
  4343.  
  4344. ΓòÉΓòÉΓòÉ 18.3.1. Backup Files ΓòÉΓòÉΓòÉ
  4345.  
  4346.  Because Unix does not provide version numbers in file names, rewriting a file 
  4347. in Unix automatically destroys all record of what the file used to contain. 
  4348. Thus, saving a file from Emacs throws away the old contents of the file---or it 
  4349. would, except that Emacs carefully copies the old contents to another file, 
  4350. called the backup file, before actually saving. (This assumes that the variable 
  4351. make-backup-files is non-nil. Backup files are not written if this variable is 
  4352. nil.) 
  4353.  
  4354.  At your option, Emacs can keep either a single backup file or a series of 
  4355. numbered backup files for each file that you edit. 
  4356.  
  4357.  Emacs makes a backup for a file only the first time the file is saved from one 
  4358. buffer.  No matter how many times you save a file, its backup file continues to 
  4359. contain the contents from before the file was visited. Normally this means that 
  4360. the backup file contains the contents from before the current editing session; 
  4361. however, if you kill the buffer and then visit the file again, a new backup 
  4362. file will be made by the next save. 
  4363.  
  4364.  
  4365. ΓòÉΓòÉΓòÉ 18.3.1.1. Single or Numbered Backups ΓòÉΓòÉΓòÉ
  4366.  
  4367.  If you choose to have a single backup file (this is the default), the backup 
  4368. file's name is constructed by appending `~' to the file name being edited; 
  4369. thus, the backup file for `eval.c' would be `eval.c~'. 
  4370.  
  4371.  If you choose to have a series of numbered backup files, backup file names are 
  4372. made by appending `.~', the number, and another `~' to the original file name. 
  4373. Thus, the backup files of `eval.c' would be called `eval.c.~1~', `eval.c.~2~', 
  4374. and so on, through names like `eval.c.~259~' and beyond. 
  4375.  
  4376.  If protection stops you from writing backup files under the usual names, the 
  4377. backup file is written as `%backup%~' in your home directory. Only one such 
  4378. file can exist, so only the most recently made such backup is available. 
  4379.  
  4380.  The choice of single backup or numbered backups is controlled by the variable 
  4381. version-control.  Its possible values are 
  4382.  
  4383.           Make numbered backups. 
  4384.  
  4385. nil 
  4386.           Make numbered backups for files that have numbered backups already. 
  4387.           Otherwise, make single backups. 
  4388.  
  4389. never 
  4390.           Do not in any case make numbered backups; always make single backups. 
  4391.  
  4392. You can set version-control locally in an individual buffer to control the 
  4393. making of backups for that buffer's file.  For example, Rmail mode locally sets 
  4394. version-control to never to make sure that there is only one backup for an 
  4395. Rmail file.  See Locals. 
  4396.  
  4397.  If you set the environment variable VERSION_CONTROL, to tell various GNU 
  4398. utilities what to do with backup files, Emacs also obeys the environment 
  4399. variable by setting the Lisp variable version-control accordingly at startup. 
  4400. If the environment variable's value is `t' or `numbered', then version-control 
  4401. becomes t; if the value is `nil' or `existing', then version-control becomes 
  4402. nil; if it is `never' or `simple', then version-control becomes never. 
  4403.  
  4404.  
  4405. ΓòÉΓòÉΓòÉ 18.3.1.2. Automatic Deletion of Backups ΓòÉΓòÉΓòÉ
  4406.  
  4407.  To prevent unlimited consumption of disk space, Emacs can delete numbered 
  4408. backup versions automatically.  Generally Emacs keeps the first few backups and 
  4409. the latest few backups, deleting any in between.  This happens every time a new 
  4410. backup is made. 
  4411.  
  4412.  The two variables kept-old-versions and kept-new-versions control this 
  4413. deletion.  Their values are, respectively the number of oldest 
  4414. (lowest-numbered) backups to keep and the number of newest (highest-numbered) 
  4415. ones to keep, each time a new backup is made.  Recall that these values are 
  4416. used just after a new backup version is made; that newly made backup is 
  4417. included in the count in kept-new-versions.  By default, both variables are 2. 
  4418.  
  4419.  If trim-versions-without-asking is non-nil, the excess middle versions are 
  4420. deleted without a murmur.  If it is nil, the default, then you are asked 
  4421. whether the excess middle versions should really be deleted. 
  4422.  
  4423.  Dired's . (Period) command can also be used to delete old versions. See Dired 
  4424. Deletion. 
  4425.  
  4426.  
  4427. ΓòÉΓòÉΓòÉ 18.3.1.3. Copying vs. Renaming ΓòÉΓòÉΓòÉ
  4428.  
  4429.  Backup files can be made by copying the old file or by renaming it.  This 
  4430. makes a difference when the old file has multiple names.  If the old file is 
  4431. renamed into the backup file, then the alternate names become names for the 
  4432. backup file.  If the old file is copied instead, then the alternate names 
  4433. remain names for the file that you are editing, and the contents accessed by 
  4434. those names will be the new contents. 
  4435.  
  4436.  The method of making a backup file may also affect the file's owner and group. 
  4437. If copying is used, these do not change.  If renaming is used, you become the 
  4438. file's owner, and the file's group becomes the default (different operating 
  4439. systems have different defaults for the group). 
  4440.  
  4441.  Having the owner change is usually a good idea, because then the owner always 
  4442. shows who last edited the file.  Also, the owners of the backups show who 
  4443. produced those versions.  Occasionally there is a file whose owner should not 
  4444. change; it is a good idea for such files to contain local variable lists to set 
  4445. backup-by-copying-when-mismatch locally (see File Variables). 
  4446.  
  4447.  The choice of renaming or copying is controlled by three variables. Renaming 
  4448. is the default choice.  If the variable backup-by-copying is non-nil, copying 
  4449. is used.  Otherwise, if the variable backup-by-copying-when-linked is non-nil, 
  4450. then copying is used for files that have multiple names, but renaming may still 
  4451. used when the file being edited has only one name.  If the variable 
  4452. backup-by-copying-when-mismatch is non-nil, then copying is used if renaming 
  4453. would cause the file's owner or group to change. 
  4454.  
  4455.  
  4456. ΓòÉΓòÉΓòÉ 18.3.2. Protection against Simultaneous Editing ΓòÉΓòÉΓòÉ
  4457.  
  4458.  Simultaneous editing occurs when two users visit the same file, both make 
  4459. changes, and then both save them.  If nobody were informed that this was 
  4460. happening, whichever user saved first would later find that his changes were 
  4461. lost.  On some systems, Emacs notices immediately when the second user starts 
  4462. to change the file, and issues an immediate warning. 
  4463.  
  4464.  For the sake of systems where that is not possible, and in case someone else 
  4465. proceeds to change the file despite the warning, Emacs also checks when the 
  4466. file is saved, and issues a second warning if you are about to overwrite a file 
  4467. containing another user's changes.  You can prevent loss of the other user's 
  4468. work by taking the proper corrective action at that time. 
  4469.  
  4470.  When you make the first modification in an Emacs buffer that is visiting a 
  4471. file, Emacs records that  the file is locked by you.  (It does this by writing 
  4472. another file in a directory reserved for this purpose.)  The lock is removed 
  4473. when you save the changes.  The idea is that the file is locked whenever an 
  4474. Emacs buffer visiting it has unsaved changes. 
  4475.  
  4476.  If you begin to modify the buffer while the visited file is locked by someone 
  4477. else, this constitutes a collision.  When Emacs detects a collision, it asks 
  4478. you what to do, by calling the Lisp function ask-user-about-lock.  You can 
  4479. redefine this function for the sake of customization.  The standard definition 
  4480. of this function asks you a question and accepts three possible answers: 
  4481.  
  4482.           Steal the lock.  Whoever was already changing the file loses the 
  4483.           lock, and you gain the lock. 
  4484.  
  4485.           Proceed.  Go ahead and edit the file despite its being locked by 
  4486.           someone else. 
  4487.  
  4488.           Quit.  This causes an error (file-locked) and the modification you 
  4489.           were trying to make in the buffer does not actually take place. 
  4490.  
  4491.  Note that locking works on the basis of a file name; if a file has multiple 
  4492. names, Emacs does not realize that the two names are the same file and cannot 
  4493. prevent two users from editing it simultaneously under different names. 
  4494. However, basing locking on names means that Emacs can interlock the editing of 
  4495. new files that will not really exist until they are saved. 
  4496.  
  4497.  Some systems are not configured to allow Emacs to make locks.  On these 
  4498. systems, Emacs cannot detect trouble in advance, but it still can detect the 
  4499. collision when you try to save a file and overwrite someone else's changes. 
  4500.  
  4501.  Every time Emacs saves a buffer, it first checks the last-modification date of 
  4502. the existing file on disk to verify that it has not changed since the file was 
  4503. last visited or saved.  If the date does not match, it implies that changes 
  4504. were made in the file in some other way, and these changes are about to be lost 
  4505. if Emacs actually does save.  To prevent this, Emacs prints a warning message 
  4506. and asks for confirmation before saving. Occasionally you will know why the 
  4507. file was changed and know that it does not matter; then you can answer yes and 
  4508. proceed.  Otherwise, you should cancel the save with C-g and investigate the 
  4509. situation. 
  4510.  
  4511.  The first thing you should do when notified that simultaneous editing has 
  4512. already taken place is to list the directory with C-u C-x C-d (see Directory 
  4513. Listing).  This  shows the file's current author.  You should attempt to 
  4514. contact him to warn him not to continue editing.  Often the next step is to 
  4515. save the contents of your Emacs buffer under a different name, and use diff to 
  4516. compare the two files. 
  4517.  
  4518.  Simultaneous editing checks are also made when you visit with C-x C-f a file 
  4519. that is already visited and when you start to modify a file.  This is not 
  4520. strictly necessary, but it can cause you to find out about the collision 
  4521. earlier, when perhaps correction takes less work. 
  4522.  
  4523.  
  4524. ΓòÉΓòÉΓòÉ 18.4. Reverting a Buffer ΓòÉΓòÉΓòÉ
  4525.  
  4526.  If you have made extensive changes to a file and then change your mind about 
  4527. them, you can get rid of them by reading in the previous version of the file. 
  4528. To do this, use M-x revert-buffer, which operates on the current buffer.  Since 
  4529. this is a very dangerous thing to do, you must confirm it with yes. 
  4530.  
  4531.  revert-buffer keeps point at the same distance (measured in characters) from 
  4532. the beginning of the file.  If the file was edited only slightly, you will be 
  4533. at approximately the same piece of text after reverting as before.  If you have 
  4534. made drastic changes, the same value of point in the old file may address a 
  4535. totally different piece of text. 
  4536.  
  4537.  Reverting marks the buffer as ``not modified'' until another change is made. 
  4538.  
  4539.  Some kinds of buffers whose contents reflect data bases other than files, such 
  4540. as Dired buffers, can also be reverted.  For them, reverting means 
  4541. recalculating their contents from the appropriate data base.  Buffers created 
  4542. randomly with C-x b cannot be reverted; revert-buffer reports an error when 
  4543. asked to do so. 
  4544.  
  4545.  
  4546. ΓòÉΓòÉΓòÉ 18.5. Auto-Saving: Protection Against Disasters ΓòÉΓòÉΓòÉ
  4547.  
  4548.  Emacs saves all the visited files from time to time (based on counting your 
  4549. keystrokes) without being asked.  This is called auto-saving. It prevents you 
  4550. from losing more than a limited amount of work if the system crashes. 
  4551.  
  4552.  When Emacs determines that it is time for auto-saving, each buffer is 
  4553. considered, and is auto-saved if auto-saving is turned on for it and it has 
  4554. been changed since the last time it was auto-saved.  If any auto-saving is 
  4555. done, the message `Auto-saving...' is displayed in the echo area until 
  4556. auto-saving is finished.  Errors occurring during auto-saving are caught so 
  4557. that they do not interfere with the execution of commands you have been typing. 
  4558.  
  4559.  
  4560. ΓòÉΓòÉΓòÉ 18.5.1. Auto-Save Files ΓòÉΓòÉΓòÉ
  4561.  
  4562.  Auto-saving does not normally save in the files that you visited, because it 
  4563. can be very undesirable to save a program that is in an inconsistent state when 
  4564. you have made half of a planned change.  Instead, auto-saving is done in a 
  4565. different file called the auto-save file, and the visited file is changed only 
  4566. when you request saving explicitly (such as with C-x C-s). 
  4567.  
  4568.  Normally, the auto-save file name is made by appending `#' to the front and 
  4569. rear of the visited file name.  Thus, a buffer visiting file `foo.c' is 
  4570. auto-saved in a file `#foo.c#'.  Most buffers that are not visiting files are 
  4571. auto-saved only if you request it explicitly; when they are auto-saved, the 
  4572. auto-save file name is made by appending `#%' to the front and `#' to the rear 
  4573. of buffer name.  For example, the `*mail*' buffer in which you compose messages 
  4574. to be sent is auto-saved in a file named `#%*mail*#'.  Auto-save file names are 
  4575. made this way unless you reprogram parts of Emacs to do something different 
  4576. (the functions make-auto-save-file-name and auto-save-file-name-p).  The file 
  4577. name to be used for auto-saving in a buffer is calculated when auto-saving is 
  4578. turned on in that buffer. 
  4579.  
  4580.  If you want auto-saving to be done in the visited file, set the variable 
  4581. auto-save-visited-file-name to be non-nil.  In this mode, there is really no 
  4582. difference between auto-saving and explicit saving. 
  4583.  
  4584.  A buffer's auto-save file is deleted when you save the buffer in its visited 
  4585. file.  To inhibit this, set the variable delete-auto-save-files to nil. 
  4586. Changing the visited file name with C-x C-w or set-visited-file-name renames 
  4587. any auto-save file to go with the new visited name. 
  4588.  
  4589.  When you delete a large amount of a buffer's text, auto-saving turns off in 
  4590. that buffer.  This is because if you deleted the text unintentionally, you 
  4591. might find the auto-save file more useful if it contains the deleted text.  To 
  4592. restart auto-saving in that buffer, use M-x auto-save with a positive argument. 
  4593.  
  4594.  
  4595. ΓòÉΓòÉΓòÉ 18.5.2. Controlling Auto-Saving ΓòÉΓòÉΓòÉ
  4596.  
  4597.  Each time you visit a file, auto-saving is turned on for that file's buffer if 
  4598. the variable auto-save-default is non-nil (but not in batch mode; see Entering 
  4599. Emacs).  The default for this variable is t, so auto-saving is the usual 
  4600. practice for file-visiting buffers. Auto-saving can be turned on or off for any 
  4601. existing buffer with the command M-x auto-save-mode.  Like other minor mode 
  4602. commands, M-x auto-save-mode turns auto-saving on with a positive argument, off 
  4603. with a zero or negative argument; with no argument, it toggles. 
  4604.  
  4605.  Emacs does auto-saving periodically based on counting how many characters you 
  4606. have typed since the last time auto-saving was done.  The variable 
  4607. auto-save-interval specifies how many characters there are between auto-saves. 
  4608. By default, it is 300. 
  4609.  
  4610.  Auto-saving also takes place when you stop typing for a while.  The variable 
  4611. auto-save-timeout says how many seconds Emacs should wait before it does an 
  4612. auto save (and perhaps also a garbage collection).  (The actual time period is 
  4613. longer if the current buffer is long; this is a heuristic which aims to keep 
  4614. out of your way when you are editing long buffers in which auto-save takes an 
  4615. appreciable amount of time.)  Auto-saving during idle periods accomplishes two 
  4616. things: first, it makes sure all your work is saved if you go away from the 
  4617. terminal for a while; second, it may avoid some auto-saving while you are 
  4618. actually typing. 
  4619.  
  4620.  Emacs also does auto-saving whenever it gets a fatal error.  This includes 
  4621. killing the Emacs job with a shell command such as kill %emacs, or 
  4622. disconnecting a phone line or network connection. 
  4623.  
  4624.  You can request an auto-save explicitly with the command M-x do-auto-save. 
  4625.  
  4626.  
  4627. ΓòÉΓòÉΓòÉ 18.5.3. Recovering Data from Auto-Saves ΓòÉΓòÉΓòÉ
  4628.  
  4629.  The way to use the contents of an auto-save file to recover from a loss of 
  4630. data is with the command M-x recover-file RET file RET.  This visits file and 
  4631. then (after your confirmation) restores the contents from from its auto-save 
  4632. file `#file#'.  You can then save with C-x C-s to put the recovered text into 
  4633. file itself.  For example, to recover file `foo.c' from its auto-save file 
  4634. `#foo.c#', do: 
  4635.  
  4636. M-x recover-file RET foo.c RET
  4637. yes RET
  4638. C-x C-s
  4639.  
  4640.  Before asking for confirmation, M-x recover-file displays a directory listing 
  4641. describing the specified file and the auto-save file, so you can compare their 
  4642. sizes and dates.  If the auto-save file is older, M-x recover-file does not 
  4643. offer to read it. 
  4644.  
  4645.  
  4646. ΓòÉΓòÉΓòÉ 18.6. File Name Aliases ΓòÉΓòÉΓòÉ
  4647.  
  4648.  Symbolic links and hard links both make it possible for several file names to 
  4649. refer to the same file.  For example, when `foo' is a symbolic link to `bar', 
  4650. the file has two names, but `bar' is the real name, and `foo' is just an alias. 
  4651. More complex cases occur when symbolic links point to directories. 
  4652.  
  4653.  If you visit two names for the same file, normally Emacs makes two different 
  4654. buffers, but it warns you about the situation. 
  4655.  
  4656.  If you wish to avoid visiting the same file in two buffers under different 
  4657. names, set the variable find-file-existing-other-name to a non-nil value.  Then 
  4658. find-file uses the existing buffer visiting the file, no matter which of the 
  4659. file's names you specify. 
  4660.  
  4661.  If the variable find-file-visit-truename is non-nil, then the file name 
  4662. recorded for a buffer is the file's truename (made by replacing all symbolic 
  4663. links with their target names), rather than the name you specify.  Setting 
  4664. find-file-visit-truename also implies the effect of 
  4665. find-file-existing-other-name. 
  4666.  
  4667.  
  4668. ΓòÉΓòÉΓòÉ 18.7. Version Control ΓòÉΓòÉΓòÉ
  4669.  
  4670.  Version control systems are packages that can record multiple versions of a 
  4671. source file, usually storing the unchanged parts of the file just once. 
  4672. Version control systems also record history information such as the creation 
  4673. time of each version, who created it, and a description of what was changed in 
  4674. that version. 
  4675.  
  4676.  The GNU project recommends the version control system known as RCS, which is 
  4677. free software and available from the Free Software Foundation. Emacs supports 
  4678. use of either RCS or SCCS (a proprietary, but widely used, version control 
  4679. system that is not quite as powerful as RCS) through a facility called VC.  The 
  4680. same Emacs commands work with either RCS or SCCS, so you hardly have to know 
  4681. which one of them you are using. 
  4682.  
  4683.  
  4684. ΓòÉΓòÉΓòÉ 18.7.1. Concepts of Version Control ΓòÉΓòÉΓòÉ
  4685.  
  4686.   When a file is under version control, we also say that it is registered in 
  4687. the version control system.  Each registered file has a corresponding master 
  4688. file which represents the file's present state plus its change history, so that 
  4689. you can reconstruct from it either the current version or any specified earlier 
  4690. version.  Usually the master file also records a log entry for each version 
  4691. describing what was changed in that version. 
  4692.  
  4693.  The file that is maintained under version control is sometimes called the work 
  4694. file corresponding to its master file. 
  4695.  
  4696.   To examine a file, you check it out.  This extracts a version of the source 
  4697. file (typically, the most recent) from the master file. If you want to edit the 
  4698. file, you must check it out locked.  Only one user can do this at a time for 
  4699. any given source file.  (This kind of locking is completely unrelated to the 
  4700. locking that Emacs uses to detect simultaneous editing of a file.) 
  4701.  
  4702.  When you are done with your editing, you must check in the new version.  This 
  4703. records the new version in the master file, and unlocks the source file so that 
  4704. other people can lock it and thus modify it. 
  4705.  
  4706.  Checkin and checkout are the basic operations of version control.  You can do 
  4707. both of them with a single Emacs command: C-x C-q (vc-toggle-read-only). 
  4708.  
  4709.  
  4710. ΓòÉΓòÉΓòÉ 18.7.2. Editing with Version Control ΓòÉΓòÉΓòÉ
  4711.  
  4712.  When you visit a file that is maintained using version control, the mode line 
  4713. displays `RCS' or `SCCS' to inform you that version control is in use, and also 
  4714. (in case you care) which low-level system the file is actually stored in. 
  4715. Normally, such a source file is read-only, and the mode line indicates this 
  4716. with `%%'.  With RCS, the mode line also indicates the head version, which is 
  4717. normally also the version you are looking at. 
  4718.  
  4719.  These are the commands for editing a file maintained with version control: 
  4720.  
  4721. C-x C-q 
  4722.           Check the visited file in or out. 
  4723.  
  4724. C-x v u 
  4725.           Revert the buffer and the file to the last checked in version. 
  4726.  
  4727. C-x v c 
  4728.           Remove the last-entered change from the master for the visited file. 
  4729.           This undoes your last check-in. 
  4730.  
  4731. C-x v i 
  4732.           Register the visited file in version control. 
  4733.  
  4734. (C-x v is the prefix key for version control commands; all of these commands 
  4735. except for C-x C-q start with C-x v.) 
  4736.  
  4737.  When you want to modify a file maintained with version control, type C-x C-q 
  4738. (vc-toggle-read-only).  This checks out the file, and tells RCS or SCCS to lock 
  4739. the file.  This means making the file writable for you (but not for anyone 
  4740. else).  The mode line indicates that you have locked the file by showing your 
  4741. name and a colon before the version number. 
  4742.  
  4743.  When you are finished editing the file, type C-x C-q again. When used on a 
  4744. file that is checked out, this command checks the file in.  But check-in does 
  4745. not start immediately; first, you must enter the log entry---a description of 
  4746. the changes in the new version. C-x C-q pops up a buffer for you to enter this 
  4747. in.  When you are finished typing in the log entry, type C-c C-c to terminate 
  4748. it; this is when actual check-in takes place. 
  4749.  
  4750.  Once you have checked in your changes, the file is unlocked, so that other 
  4751. users can lock it and modify it. 
  4752.  
  4753.  Emacs does not save backup files for source files that are maintained with 
  4754. version control.  If you want to make backup files despite version control, set 
  4755. the variable vc-make-backup-files to a non-nil value. 
  4756.  
  4757.  Normally the work file exists all the time, whether it is locked or not.  If 
  4758. you set vc-keep-workfiles to nil, then checking in a new version with C-x C-q 
  4759. deletes the work file; but any attempt to visit the file with Emacs creates it 
  4760. again. 
  4761.  
  4762.  It is not impossible to lock a file that someone else has locked.  If you try 
  4763. to check out a file that is locked, C-x C-q asks you whether you want to 
  4764. ``steal the lock.''  If you say yes, the file becomes locked by you, but a 
  4765. message is sent to the person who had formerly locked the file, to inform him 
  4766. of what has happened.  The mode line indicates that a file is locked by someone 
  4767. else by displaying the login name of that person, before the version number. 
  4768.  
  4769.  If you want to discard your current set of changes and revert to the last 
  4770. version checked in, use C-x v u (vc-revert-buffer). This cancels your last 
  4771. check-out, leaving the file unlocked.  If you want to make a different set of 
  4772. changes, you must first check the file out again.  C-x v u requires 
  4773. confirmation, unless it sees that you haven't made any changes since the last 
  4774. checked-in version. 
  4775.  
  4776.  C-x v u is also the command to use if you lock a file and then don't actually 
  4777. change it. 
  4778.  
  4779.  You can cancel a change after checking it in, with C-x v c 
  4780. (vc-cancel-version).  This command discards all record of the most recent 
  4781. checked in version, so be careful about using it.  It requires confirmation 
  4782. with yes.  By default, C-x v c reverts your workfile and buffer to the previous 
  4783. version (the one that precedes the version that is deleted), but you can 
  4784. prevent the reversion by giving the command a prefix argument.  Then the buffer 
  4785. does not change. 
  4786.  
  4787.  This command with a prefix argument is useful when you have checked in a 
  4788. change and then discover a trivial error in it; you can cancel the erroneous 
  4789. check-in, fix the error, and repeat the check-in. 
  4790.  
  4791.  Be careful when invoking C-x v c, as it is easy to throw away a lot of work 
  4792. with it.  To help you be careful, this command always asks for confirmation 
  4793. with `yes'. 
  4794.  
  4795.  You can register the visited file for version control using C-x v i 
  4796. (vc-register).  This uses RCS if RCS is installed on your system; otherwise, it 
  4797. uses SCCS.  After C-x v i, the file is unlocked and read-only.  Type C-x C-q if 
  4798. you wish to edit it. 
  4799.  
  4800.  By default, the initial version number is 1.1.  If you want to use a different 
  4801. number, give C-x v i a prefix argument; then it reads the initial version 
  4802. number using the minibuffer. 
  4803.  
  4804.  If vc-initial-comment is non-nil, C-x v i reads an initial comment (much like 
  4805. a log entry) to describe the purpose of this source file. 
  4806.  
  4807.  
  4808. ΓòÉΓòÉΓòÉ 18.7.3. Variables Affecting Check-in and Check-out ΓòÉΓòÉΓòÉ
  4809.  
  4810.  If vc-suppress-confirm is non-nil, then C-x C-q and C-x v i can save the 
  4811. current buffer without asking, and C-x v u also operates without asking for 
  4812. confirmation. (This variable does not affect C-x v c; that is so drastic that 
  4813. it should always ask for confirmation.) 
  4814.  
  4815.  VC mode does much of its work by running the shell commands for RCS and SCCS. 
  4816. If vc-command-messages is non-nil, VC displays messages to indicate which shell 
  4817. commands it runs, and additional messages when the commands finish. 
  4818.  
  4819.  Normally, VC assumes that it can deduce the locked/unlocked state of files by 
  4820. looking at the file permissions of the work file; this is fast.  However, if 
  4821. the `RCS' or `SCCS' subdirectory is actually a symbolic link, then VC does not 
  4822. trust the file permissions to reflect this status. 
  4823.  
  4824. You can specify the criterion for whether to trust the file permissions by 
  4825. setting the variable vc-mistrust-permissions.  Its value may be t (always 
  4826. mistrust the file permissions and check the master file), nil (always trust the 
  4827. file permissions), or a function of one argument which makes the decision.  The 
  4828. argument is the directory name of the `RCS' or `SCCS' subdirectory.  A non-nil 
  4829. value from the function says to mistrust the file permissions. 
  4830.  
  4831.  If you find that the file permissions of work files are changed erroneously, 
  4832. set vc-mistrust-permissions to t.  Then VC always checks the master file to 
  4833. determine the file's status. 
  4834.  
  4835.  
  4836. ΓòÉΓòÉΓòÉ 18.7.4. Log Entries ΓòÉΓòÉΓòÉ
  4837.  
  4838.  When you're editing an initial comment or log entry for inclusion in a master 
  4839. file, finish your entry by typing C-c C-c. 
  4840.  
  4841. C-c C-c 
  4842.           Finish the comment edit normally (vc-finish-logentry). This finishes 
  4843.           check-in. 
  4844.  
  4845.  To abort check-in, just don't type C-c C-c in that buffer.  You can switch 
  4846. buffers and do other editing.  As long as you don't try to check in another 
  4847. file, the entry you were editing remains in its buffer, and you can go back to 
  4848. that buffer at any time to complete the check-in. 
  4849.  
  4850.  If you change several source files for the same reason, it is often convenient 
  4851. to specify the same log entry for many of the files.  To do this, use the 
  4852. history of previous log entries.  The commands M-n, M-p, M-s and M-r for doing 
  4853. this work just like the minibuffer history commands (except that these versions 
  4854. are used outside the minibuffer). 
  4855.  
  4856.  Each time you check in a file, the log entry buffer is put into VC Log mode, 
  4857. which involves running two hooks: text-mode-hook and vc-log-mode-hook.  See 
  4858. Hooks. 
  4859.  
  4860.  
  4861. ΓòÉΓòÉΓòÉ 18.7.5. Change Logs and VC ΓòÉΓòÉΓòÉ
  4862.  
  4863.  If you use RCS for a program and also maintain a change log file for it (see 
  4864. Change Log), you can generate change log entries automatically from the version 
  4865. control log entries: 
  4866.  
  4867. C-x v a 
  4868.           Visit the current directory's change log file and create new entries 
  4869.           for versions checked in since the most recent entry in the change log 
  4870.           file (vc-update-change-log). 
  4871.  
  4872.           This command works with RCS only; it does not work with SCCS. 
  4873.  
  4874.  For example, suppose the first line of `ChangeLog' is dated 10 April 1992, and 
  4875. that the only check-in since then was by Nathaniel Bowditch to `rcs2log' on 8 
  4876. May 1992 with log text `Ignore log messages that start with `#'.'.  Then C-x v 
  4877. a visits `ChangeLog' and inserts text like this: 
  4878.  
  4879. Fri May  8 21:45:00 1992  Nathaniel Bowditch  (nat@apn.org)
  4880.  
  4881.         * rcs2log: Ignore log messages that start with `#'.
  4882.  
  4883. You can then edit the new change log entry further as you wish. 
  4884.  
  4885.  Normally, the log entry for file `foo' is displayed as `* foo: text of log 
  4886. entry'.  The `:' after `foo' is omitted if the text of the log entry starts 
  4887. with `(functionname): '.  For example, if the log entry for `vc.el' is 
  4888. `(vc-do-command): Check call-process status.', then the text in `ChangeLog' 
  4889. looks like this: 
  4890.  
  4891. Wed May  6 10:53:00 1992  Nathaniel Bowditch  (nat@apn.org)
  4892.  
  4893.         * vc.el (vc-do-command): Check call-process status.
  4894.  
  4895.  When C-x v a adds several change log entries at once, it groups related log 
  4896. entries together if they all are checked in by the same author at nearly the 
  4897. same time.  If the log entries for several such files all have the same text, 
  4898. it coalesces them into a single entry. For example, suppose the most recent 
  4899. checkins have the following log entries: 
  4900.  
  4901. For `vc.texinfo':
  4902. Fix expansion typos.
  4903. For `vc.el':
  4904. Don't call expand-file-name.
  4905. For `vc-hooks.el':
  4906. Don't call expand-file-name.
  4907.  
  4908.  They appear like this in `ChangeLog': 
  4909.  
  4910. Wed Apr  1 08:57:59 1992  Nathaniel Bowditch  (nat@apn.org)
  4911.  
  4912.         * vc.texinfo: Fix expansion typos.
  4913.  
  4914.         * vc.el, vc-hooks.el: Don't call expand-file-name.
  4915.  
  4916.  Normally, C-x v a separates log entries by a blank line, but you can mark 
  4917. several related log entries to be clumped together (without an intervening 
  4918. blank line) by starting the text of each related log entry with a label of the 
  4919. form `{clumpname} '.  The label itself is not copied to `ChangeLog'.  For 
  4920. example, suppose the log entries are: 
  4921.  
  4922. For `vc.texinfo':
  4923. {expand} Fix expansion typos.
  4924. For `vc.el':
  4925. {expand} Don't call expand-file-name.
  4926. For `vc-hooks.el':
  4927. {expand} Don't call expand-file-name.
  4928.  
  4929. Then the text in `ChangeLog' looks like this: 
  4930.  
  4931. Wed Apr  1 08:57:59 1992  Nathaniel Bowditch  (nat@apn.org)
  4932.  
  4933.         * vc.texinfo: Fix expansion typos.
  4934.         * vc.el, vc-hooks.el: Don't call expand-file-name.
  4935.  
  4936.  A log entry whose text begins with `#' is not copied to `ChangeLog'.  For 
  4937. example, if you merely fix some misspellings in comments, you can log the 
  4938. change with an entry beginning with `#' to avoid putting such trivia into 
  4939. `ChangeLog'. 
  4940.  
  4941.  
  4942. ΓòÉΓòÉΓòÉ 18.7.6. Comparing Versions ΓòÉΓòÉΓòÉ
  4943.  
  4944.  To compare two versions of a file, use the command C-x v = (vc-diff). 
  4945.  
  4946.  Plain C-x v = compares the current buffer contents (saving them in the file if 
  4947. necessary) with the last checked-in version of the file. With a prefix 
  4948. argument, C-x v = reads a file name and two version numbers, then compares 
  4949. those versions of the specified file. 
  4950.  
  4951.  If you supply a directory name instead of the name of a work file, this 
  4952. command compares the two specified versions of all registered files in that 
  4953. directory and its subdirectories.  You can also specify a snapshot name (see 
  4954. Snapshots) instead of one or both version numbers. 
  4955.  
  4956.  You can specify a checked-in version by its number; you can specify the most 
  4957. recent checked-in version with an empty version number. 
  4958.  
  4959.  This command works by running the diff utility, getting the options from the 
  4960. variable diff-switches.  It displays the output in a special buffer in another 
  4961. window.  Unlike the M-x diff command, C-x v = does not try to find the changes 
  4962. in the old and new versions.  This is because one or both versions normally do 
  4963. not exist as files.  They exist only in the records of the master file. See 
  4964. Comparing Files, for more information about M-x diff. 
  4965.  
  4966.  
  4967. ΓòÉΓòÉΓòÉ 18.7.7. VC Status Commands ΓòÉΓòÉΓòÉ
  4968.  
  4969.  To view the detailed version control status and history of a file, type C-x v 
  4970. l (vc-print-log).  It displays the history of changes to the current file, 
  4971. including the text of the log entries.  The output appears in a separate 
  4972. window. 
  4973.  
  4974.  When you are working on a large program, it's often useful to find all the 
  4975. files that are currently locked, or all the files maintained in version control 
  4976. at all.  You can use C-x v d (vc-directory) to show all the locked files in or 
  4977. beneath the current directory.  This includes all files that are locked by any 
  4978. user.  C-u C-x v d lists all files in or beneath the current directory that are 
  4979. maintained with version control. 
  4980.  
  4981.  The list of files is displayed as a buffer that uses an augmented Dired mode. 
  4982. The names of the users locking various files are shown (in parentheses) in 
  4983. place of the owner and group.  All the normal Dired commands work in this 
  4984. buffer.  Most interactive VC commands work also, and apply to the file name on 
  4985. the current line. 
  4986.  
  4987.  The vc-next-action command, when used in the augmented Dired buffer, operates 
  4988. on all the marked files (or the file on the current line).  If it operates on 
  4989. more than one file, it handles each file according to its current state; thus, 
  4990. it may check in one file and check in another (which is already checked out). 
  4991. If it has to check in any files, it reads a single log entry, then uses that 
  4992. text for all the files being checked in.  This can be convenient for 
  4993. registering or checking in several files at once, as part of the same change. 
  4994.  
  4995.  
  4996. ΓòÉΓòÉΓòÉ 18.7.8. Renaming VC Work Files and Master Files ΓòÉΓòÉΓòÉ
  4997.  
  4998.  When you rename a registered file, you must also rename its master file 
  4999. correspondingly to get proper results.  Use vc-rename-file to rename the source 
  5000. file as you specify, and rename its master file accordingly.  It also updates 
  5001. any snapshots (see Snapshots) that mention the file, so that they use the new 
  5002. name; despite this, the snapshot thus modified may not completely work ( see 
  5003. Snapshot Caveats). 
  5004.  
  5005.  You cannot use vc-rename-file on a file that is locked by someone else. 
  5006.  
  5007.  
  5008. ΓòÉΓòÉΓòÉ 18.7.9. Snapshots ΓòÉΓòÉΓòÉ
  5009.  
  5010.  A snapshot is a named set of file versions (one for each registered file) that 
  5011. you can treat as a unit.  One important kind of snapshot is a release, a 
  5012. (theoretically) stable version of the system that is ready for distribution to 
  5013. users. 
  5014.  
  5015.  
  5016. ΓòÉΓòÉΓòÉ 18.7.9.1. Making and Using Snapshots ΓòÉΓòÉΓòÉ
  5017.  
  5018.  There are two basic commands for snapshots; one makes a snapshot with a given 
  5019. name, the other retrieves a named snapshot. 
  5020.  
  5021. C-x v s name RET 
  5022.           Define the last saved versions of every registered file in or under 
  5023.           the current directory as a snapshot named name (vc-create-snapshot). 
  5024.  
  5025. C-x v r name RET 
  5026.           Check out all registered files at or below the current directory 
  5027.           level using whatever versions correspond to the snapshot name 
  5028.           (vc-retrieve-snapshot). 
  5029.  
  5030.           This command reports an error if any files are locked at or below the 
  5031.           current directory, without changing anything; this is to avoid 
  5032.           overwriting work in progress. 
  5033.  
  5034.  A snapshot uses a very small amount of resources---just enough to record the 
  5035. list of file names and which version belongs to the snapshot.  Thus, you need 
  5036. not hesitate to create snapshots whenever they are useful. 
  5037.  
  5038.  You can give a snapshot name as an argument to C-x v = (see Comparing 
  5039. Versions).  Thus, you can use it to compare a snapshot against the current 
  5040. files, or two snapshots against each other, or a snapshot against a named 
  5041. version. 
  5042.  
  5043.  
  5044. ΓòÉΓòÉΓòÉ 18.7.9.2. Snapshot Caveats ΓòÉΓòÉΓòÉ
  5045.  
  5046. VC's snapshot facilities are modeled on RCS's named-configuration support. 
  5047. They use RCS's native facilities for this, so under VC snapshots made using RCS 
  5048. are visible even when you bypass VC. 
  5049.  
  5050. For SCCS, VC implements snapshots itself.  The files it uses contain 
  5051. name/file/version-number triples.  These snapshots are visible only through VC. 
  5052.  
  5053.  File renaming and deletion can create some difficulties with snapshots. This 
  5054. is not a VC-specific problem, but a general design issue in version control 
  5055. systems that no one has solved very well yet. 
  5056.  
  5057.  If you rename a registered file, you need to rename its master along with it 
  5058. (the command vc-rename-file does this automatically).  If you are using SCCS, 
  5059. you must also update the records of the snapshot, to mention the file by its 
  5060. new name (vc-rename-file does this, too).  An old snapshot that refers to a 
  5061. master file that no longer exists under the recorded name is invalid; VC can no 
  5062. longer retrieve it.  It would be beyond the scope of this manual to explain 
  5063. enough about RCS and SCCS to explain how to update the snapshots by hand. 
  5064.  
  5065.  Using vc-rename-file makes the snapshot remain valid for retrieval, but it 
  5066. does not solve all problems.  For example, some of the files in the program 
  5067. probably refer to others by name.  At the very least, the makefile probably 
  5068. mentions the file that you renamed.  If you retrieve an old snapshot, the 
  5069. renamed file is retrieved under its new name, which is not the name that the 
  5070. makefile expects.  So the program won't really work as retrieved. 
  5071.  
  5072.  
  5073. ΓòÉΓòÉΓòÉ 18.7.10. Inserting Version Control Headers ΓòÉΓòÉΓòÉ
  5074.  
  5075.   Sometimes it is convenient to put version identification strings directly 
  5076. into working files.  Certain special strings called version headers are 
  5077. replaced in each successive version by the number of that version. 
  5078.  
  5079.  You can use the C-x v h command (vc-insert-headers) to insert a suitable 
  5080. header string. 
  5081.  
  5082. C-x v h 
  5083.           Insert headers in a file for use with your version-control system. 
  5084.  
  5085.  The default header string is `$Id$' for RCS and `%W%' for SCCS.  You can 
  5086. specify other headers to insert by setting the variable vc-header-alist.  Its 
  5087. value is a list of elements of the form (program . string) where program is RCS 
  5088. or SCCS and string is the string to use. 
  5089.  
  5090.  Instead of a single string, you can specify a list of strings; then each 
  5091. string in the list is inserted as a separate header on a line of its own. 
  5092.  
  5093.  It is often necessary to use ``superfluous'' backslashes when writing the 
  5094. strings that you put in this variable.  This is to prevent the string in the 
  5095. constant from being interpreted as a header itself if the Emacs Lisp file 
  5096. containing it is maintained with version control. 
  5097.  
  5098.  Each header is inserted surrounded by tabs, inside comment delimiters, on a 
  5099. new line at the start of the buffer.  Normally the ordinary comment start and 
  5100. comment end strings of the current mode are used, but for certain modes, there 
  5101. are special comment delimiters for this purpose; the variable vc-comment-alist 
  5102. specifies them.  Each element of this list has the form (mode starter ender). 
  5103.  
  5104.  The variable vc-static-header-alist specifies further strings to add based on 
  5105. the name of the buffer.  Its value should be a list of elements of the form 
  5106. (regexp . format).  Whenever regexp matches the buffer name, format is inserted 
  5107. as part of the header.  A header line is inserted for each element that matches 
  5108. the buffer name, and for each string specified by vc-header-alist.  The header 
  5109. line is made by processing the string from vc-header-alist with the format 
  5110. taken from the element.  The default value for vc-static-header-alist is: 
  5111.  
  5112. (("\\.c$" .
  5113.   "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\
  5114. #endif /* lint */\n"))
  5115.  
  5116. which specifies insertion of a string of this form: 
  5117.  
  5118.  
  5119. #ifndef lint
  5120. static char vcid[] = "string";
  5121. #endif /* lint */
  5122.  
  5123.  
  5124. ΓòÉΓòÉΓòÉ 18.8. Listing a File Directory ΓòÉΓòÉΓòÉ
  5125.  
  5126.  The file system groups files into directories.  A directory listing is a list 
  5127. of all the files in a directory.  Emacs provides directory listings in brief 
  5128. format (file names only) and verbose format (sizes, dates, and authors 
  5129. included). 
  5130.  
  5131. C-x C-d dir-or-pattern 
  5132.           Print a brief directory listing (list-directory). 
  5133.  
  5134. C-u C-x C-d dir-or-pattern 
  5135.           Print a verbose directory listing. 
  5136.  
  5137.  The command to display a directory listing is C-x C-d (list-directory).  It 
  5138. reads using the minibuffer a file name which is either a directory to be listed 
  5139. or a wildcard-containing pattern for the files to be listed.  For example, 
  5140.  
  5141. C-x C-d /u2/emacs/etc RET
  5142.  
  5143. lists all the files in directory `/u2/emacs/etc'.  An example of specifying a 
  5144. file name pattern is 
  5145.  
  5146. C-x C-d /u2/emacs/src/*.c RET
  5147.  
  5148.  Normally, C-x C-d prints a brief directory listing containing just file names. 
  5149. A numeric argument (regardless of value) tells it to print a verbose listing 
  5150. (like `ls -l'). 
  5151.  
  5152.  The text of a directory listing is obtained by running ls in an inferior 
  5153. process.  Two Emacs variables control the switches passed to ls: 
  5154. list-directory-brief-switches is a string giving the switches to use in brief 
  5155. listings ("-CF" by default), and list-directory-verbose-switches is a string 
  5156. giving the switches to use in a verbose listing ("-l" by default). 
  5157.  
  5158.  
  5159. ΓòÉΓòÉΓòÉ 18.9. Comparing Files ΓòÉΓòÉΓòÉ
  5160.  
  5161.  The command M-x diff compares two files, displaying the differences in an 
  5162. Emacs buffer named `*Diff*'.  It works by running the diff program, using 
  5163. options taken from the variable diff-switches, whose value should be a string. 
  5164.  
  5165.  The buffer `*Diff*' has Compilation mode as its major mode, so you can use C-x 
  5166. ` to visit successive changed locations in the two source files.  You can also 
  5167. move to a particular hunk of changes and type C-c C-c to find the corresponding 
  5168. source location.  You can also use the other special commands of Compilation 
  5169. mode: SPC and DEL for scrolling, and M-p and M-n for cursor motion. See 
  5170. Compilation. 
  5171.  
  5172.  The command M-x diff-backup compares a specified file with its most recent 
  5173. backup.  If you specify the name of a backup file, diff-backup compares it with 
  5174. the source file that it is a backup of. 
  5175.  
  5176.  The command M-x compare-windows compares the text in the current window with 
  5177. that in the next window.  Comparison starts at point in each window.  Point 
  5178. moves forward in each window, a character at a time in each window, until the 
  5179. next characters in the two windows are different.  Then the command is 
  5180. finished.  For more information about windows in Emacs, Windows. 
  5181.  
  5182.  With a numeric argument, compare-windows ignores changes in whitespace.  If 
  5183. the variable compare-ignore-case is non-nil, it ignores differences in case as 
  5184. well. 
  5185.  
  5186.  See also Emerge, for convenient facilities for merging two similar files. 
  5187.  
  5188.  
  5189. ΓòÉΓòÉΓòÉ 18.10. Miscellaneous File Operations ΓòÉΓòÉΓòÉ
  5190.  
  5191.  Emacs has commands for performing many other operations on files. All operate 
  5192. on one file; they do not accept wild card file names. 
  5193.  
  5194.  M-x view-file allows you to scan or read a file by sequential screenfuls.  It 
  5195. reads a file name argument using the minibuffer.  After reading the file into 
  5196. an Emacs buffer, view-file displays the beginning.  You can then type SPC to 
  5197. scroll forward one windowful, or DEL to scroll backward.  Various other 
  5198. commands are provided for moving around in the file, but none for changing it; 
  5199. type C-h while viewing for a list of them.  They are mostly the same as normal 
  5200. Emacs cursor motion commands.  To exit from viewing, type C-c. The commands for 
  5201. viewing are defined by a special major mode called View mode. 
  5202.  
  5203.  A related command, M-x view-buffer, views a buffer already present in Emacs. 
  5204. See Misc Buffer. 
  5205.  
  5206.  M-x insert-file inserts a copy of the contents of the specified file into the 
  5207. current buffer at point, leaving point unchanged before the contents and the 
  5208. mark after them. 
  5209.  
  5210.  M-x write-region is the inverse of M-x insert-file; it copies the contents of 
  5211. the region into the specified file.  M-x append-to-file adds the text of the 
  5212. region to the end of the specified file.  See Accumulating Text. 
  5213.  
  5214.  M-x delete-file deletes the specified file, like the rm command in the shell. 
  5215. If you are deleting many files in one directory, it may be more convenient to 
  5216. use Dired (see Dired). 
  5217.  
  5218.  M-x rename-file reads two file names old and new using the minibuffer, then 
  5219. renames file old as new.  If a file named new already exists, you must confirm 
  5220. with yes or renaming is not done; this is because renaming causes the old 
  5221. meaning of the name new to be lost.  If old and new are on different file 
  5222. systems, the file old is copied and deleted. 
  5223.  
  5224.  The similar command M-x add-name-to-file is used to add an additional name to 
  5225. an existing file without removing its old name. The new name must belong on the 
  5226. same file system that the file is on. 
  5227.  
  5228.  M-x copy-file reads the file old and writes a new file named new with the same 
  5229. contents.  Confirmation is required if a file named new already exists, because 
  5230. copying has the consequence of overwriting the old contents of the file new. 
  5231.  
  5232.  M-x make-symbolic-link reads two file names old and linkname, then creates a 
  5233. symbolic link named linkname and pointing at old.  The effect is that future 
  5234. attempts to open file linkname will refer to whatever file is named old at the 
  5235. time the opening is done, or will get an error if the name old is not in use at 
  5236. that time.  This command does not expand the argument filename, so that it 
  5237. allows you to specify a relative name as the target of the link. 
  5238.  
  5239.  Confirmation is required when creating the link if linkname is in use.  Note 
  5240. that not all systems support symbolic links. 
  5241.  
  5242.  
  5243. ΓòÉΓòÉΓòÉ 19. Using Multiple Buffers ΓòÉΓòÉΓòÉ
  5244.  
  5245.  The text you are editing in Emacs resides in an object called a buffer.  Each 
  5246. time you visit a file, a buffer is created to hold the file's text.  Each time 
  5247. you invoke Dired, a buffer is created to hold the directory listing.  If you 
  5248. send a message with C-x m, a buffer named `*mail*' is used to hold the text of 
  5249. the message.  When you ask for a command's documentation, that appears in a 
  5250. buffer called `*Help*'. 
  5251.  
  5252.  At any time, one and only one buffer is selected.  It is also called the 
  5253. current buffer.  Often we say that a command operates on ``the buffer'' as if 
  5254. there were only one; but really this means that the command operates on the 
  5255. selected buffer (most commands do). 
  5256.  
  5257.  When Emacs has multiple windows, each window has a chosen buffer which is 
  5258. displayed there, but at any time only one of the windows is selected and its 
  5259. chosen buffer is the selected buffer.  Each window's mode line displays the 
  5260. name of the buffer that the window is displaying (see Windows). 
  5261.  
  5262.  Each buffer has a name, which can be of any length, and you can select any 
  5263. buffer by giving its name.  Most buffers are made by visiting files, and their 
  5264. names are derived from the files' names.  But you can also create an empty 
  5265. buffer with any name you want.  A newly started Emacs has a buffer named 
  5266. `*scratch*' which can be used for evaluating Lisp expressions in Emacs.  The 
  5267. distinction between upper and lower case matters in buffer names. 
  5268.  
  5269.  Each buffer records individually what file it is visiting, whether it is 
  5270. modified, and what major mode and minor modes are in effect in it (see Major 
  5271. Modes).  Any Emacs variable can be made local to a particular buffer, meaning 
  5272. its value in that buffer can be different from the value in other buffers.  See 
  5273. Locals. 
  5274.  
  5275.  
  5276. ΓòÉΓòÉΓòÉ 19.1. Creating and Selecting Buffers ΓòÉΓòÉΓòÉ
  5277.  
  5278. C-x b buffer RET 
  5279.           Select or create a buffer named buffer (switch-to-buffer). 
  5280.  
  5281. C-x 4 b buffer RET 
  5282.           Similar, but select buffer in another window 
  5283.           (switch-to-buffer-other-window). 
  5284.  
  5285.  To select the buffer named bufname, type C-x b bufname RET.  This runs the 
  5286. command switch-to-buffer with argument bufname.  You can use completion on an 
  5287. abbreviation for the buffer name you want (see Completion).  An empty argument 
  5288. to C-x b specifies the most recently selected buffer that is not displayed in 
  5289. any window. 
  5290.  
  5291.  Most buffers are created by visiting files, or by Emacs commands that want to 
  5292. display some text, but you can also create a buffer explicitly by typing C-x b 
  5293. bufname RET.  This makes a new, empty buffer which is not visiting any file, 
  5294. and selects it for editing.  Such buffers are used for making notes to 
  5295. yourself.  If you try to save one, you are asked for the file name to use.  The 
  5296. new buffer's major mode is determined by the value of default-major-mode (see 
  5297. Major Modes). 
  5298.  
  5299.  Note that C-x C-f, and any other command for visiting a file, can also be used 
  5300. to switch buffers.  See Visiting. 
  5301.  
  5302.  
  5303. ΓòÉΓòÉΓòÉ 19.2. Listing Existing Buffers ΓòÉΓòÉΓòÉ
  5304.  
  5305. C-x C-b 
  5306.           List the existing buffers (list-buffers). 
  5307.  
  5308.  To print a list of all the buffers that exist, type C-x C-b.  Each line in the 
  5309. list shows one buffer's name, major mode and visited file.  The buffers are 
  5310. listed in the order, most recently visited first. 
  5311.  
  5312.  `*' at the beginning of a line indicates the buffer is ``modified''. If 
  5313. several buffers are modified, it may be time to save some with C-x s (see 
  5314. Saving).  `%' indicates a read-only buffer.  `.' marks the selected buffer. 
  5315. Here is an example of a buffer list: 
  5316.  
  5317.  MR Buffer         Size  Mode           File
  5318.  -- ------         ----  ----           ----
  5319. .*  emacs.tex      383402 Texinfo       /u2/emacs/man/emacs.tex
  5320.     *Help*         1287  Fundamental
  5321.     files.el       23076 Emacs-Lisp     /u2/emacs/lisp/files.el
  5322.   % RMAIL          64042 RMAIL          /u/rms/RMAIL
  5323.  *% man            747   Dired          /u2/emacs/man/
  5324.     net.emacs      343885 Fundamental   /u/rms/net.emacs
  5325.     fileio.c       27691 C              /u2/emacs/src/fileio.c
  5326.     NEWS           67340 Text           /u2/emacs/etc/NEWS
  5327.     *scratch*      0     Lisp Interaction
  5328.  
  5329. Note that the buffer `*Help*' was made by a help request; it is not visiting 
  5330. any file.  The buffer man was made by Dired on the directory `/u2/emacs/man/'. 
  5331.  
  5332.  
  5333. ΓòÉΓòÉΓòÉ 19.3. Miscellaneous Buffer Operations ΓòÉΓòÉΓòÉ
  5334.  
  5335. C-x C-q 
  5336.           Toggle read-only status of buffer (toggle-read-only). 
  5337.  
  5338. M-x rename-buffer RET name RET 
  5339.           Change the name of the current buffer. 
  5340.  
  5341. M-x rename-uniquely 
  5342.           Rename the current buffer by adding `<number>' to the end. 
  5343.  
  5344. M-x view-buffer RET buffer RET 
  5345.           Scroll through buffer buffer. 
  5346.  
  5347.  A buffer can be read-only, which means that commands to change its contents 
  5348. are not allowed.  The mode line indicates read-only buffers with `%%' near the 
  5349. left margin. 
  5350.  
  5351.  Read-only buffers are made by subsystems such as Dired and Rmail that have 
  5352. special commands to operate on the text; also if you visit a file that is 
  5353. protected so you cannot write it.  If you wish to make changes in a read-only 
  5354. buffer, use the command C-x C-q (vc-toggle-read-only).  It makes a read-only 
  5355. buffer writable, and makes a writable buffer read-only.  This works by setting 
  5356. the variable buffer-read-only, which has a local value in each buffer and makes 
  5357. the buffer read-only if its value is non-nil. 
  5358.  
  5359.  If the file is maintained with version control, C-x C-q works through the 
  5360. version control system to change the read-only status of the buffer. 
  5361.  
  5362.  M-x rename-buffer changes the name of the current buffer.  Specify the new 
  5363. name as a minibuffer argument.  There is no default.  If you specify a name 
  5364. that is in use for some other buffer, an error happens and no renaming is done. 
  5365.  
  5366.  M-x rename-uniquely renames the current buffer to a similar name with a 
  5367. numeric suffix added to make it both different and unique.  This command does 
  5368. not need an argument.  It is useful for creating multiple shell buffers: if you 
  5369. rename the `*Shell*', then do M-x shell again, it makes a new shell buffer 
  5370. named `*Shell*'; meanwhile, the old shell buffer continues to exist under its 
  5371. altered name.  This method is also good for mail buffers, compilation buffers, 
  5372. and any Emacs feature which creates a special buffer with a particular name. 
  5373.  
  5374.  M-x view-buffer is much like M-x view-file ( see Misc File Ops) except that it 
  5375. examines an already existing Emacs buffer. View mode provides commands for 
  5376. scrolling through the buffer conveniently but not for changing it.  When you 
  5377. exit View mode, the value of point that resulted from your perusal remains in 
  5378. effect. 
  5379.  
  5380.  The commands M-x append-to-buffer and M-x insert-buffer can be used to copy 
  5381. text from one buffer to another. See Accumulating Text. 
  5382.  
  5383.  
  5384. ΓòÉΓòÉΓòÉ 19.4. Killing Buffers ΓòÉΓòÉΓòÉ
  5385.  
  5386.  If you continue an Emacs session for a while, you may accumulate a large 
  5387. number of buffers.  You may then find it convenient to kill the buffers you no 
  5388. longer need.  On most operating systems, killing a buffer releases its space 
  5389. back to the operating system so that other programs can use it.  There are 
  5390. several commands for killing buffers: 
  5391.  
  5392. C-x k bufname RET 
  5393.           Kill buffer bufname (kill-buffer). 
  5394.  
  5395. M-x kill-some-buffers 
  5396.           Offer to kill each buffer, one by one. 
  5397.  
  5398.  C-x k (kill-buffer) kills one buffer, whose name you specify in the 
  5399. minibuffer.  The default, used if you type just RET in the minibuffer, is to 
  5400. kill the current buffer.  If you kill the current buffer, another buffer is 
  5401. selected; one that has been selected recently but does not appear in any window 
  5402. now.  If you ask to kill a buffer that is modified (has unsaved editing), then 
  5403. you must confirm with yes before the buffer is killed. 
  5404.  
  5405.  The command M-x kill-some-buffers asks about each buffer, one by one.  An 
  5406. answer of y means to kill the buffer.  Killing the current buffer or a buffer 
  5407. containing unsaved changes selects a new buffer or asks for confirmation just 
  5408. like kill-buffer. 
  5409.  
  5410.  If you want to do something special every time a buffer is killed, you can add 
  5411. hook functions to the hook kill-buffer-hook (see Hooks). 
  5412.  
  5413.  
  5414. ΓòÉΓòÉΓòÉ 19.5. Operating on Several Buffers ΓòÉΓòÉΓòÉ
  5415.  
  5416.  The buffer-menu facility is like a ``Dired for buffers''; it allows you to 
  5417. request operations on various Emacs buffers by editing an Emacs buffer 
  5418. containing a list of them.  You can save buffers, kill them (here called 
  5419. deleting them, for consistency with Dired), or display them. 
  5420.  
  5421. M-x buffer-menu 
  5422.           Begin editing a buffer listing all Emacs buffers. 
  5423.  
  5424.  The command buffer-menu writes a list of all Emacs buffers into the buffer 
  5425. `*Buffer List*', and selects that buffer in Buffer Menu mode.  The buffer is 
  5426. read-only, and can be changed only through the special commands described in 
  5427. this section.  The usual Emacs cursor motion commands can be used in the 
  5428. `*Buffer List*' buffer.  The following commands apply to the buffer described 
  5429. on the current line. 
  5430.  
  5431.           Request to delete (kill) the buffer, then move down.  The request 
  5432.           shows as a `D' on the line, before the buffer name.  Requested 
  5433.           deletions take place when you type the x command. 
  5434.  
  5435. C-d 
  5436.           Like d but move up afterwards instead of down. 
  5437.  
  5438.           Request to save the buffer.  The request shows as an `S' on the line. 
  5439.           Requested saves take place when you type the x command. You may 
  5440.           request both saving and deletion for the same buffer. 
  5441.  
  5442.           Perform previously requested deletions and saves. 
  5443.  
  5444.           Remove any request made for the current line, and move down. 
  5445.  
  5446. DEL 
  5447.           Move to previous line and remove any request made for that line. 
  5448.  
  5449.  The d, s and u commands to add or remove flags also move down a line.  They 
  5450. accept a numeric argument as a repeat count. 
  5451.  
  5452.  These commands operate immediately on the buffer listed on the current line: 
  5453.  
  5454.           Mark the buffer ``unmodified''.  The command ~ does this immediately 
  5455.           when you type it. 
  5456.  
  5457.           Toggle the buffer's read-only flag.  The command % does this 
  5458.           immediately when you type it. 
  5459.  
  5460.           Visit the buffer as a tag table. 
  5461.  
  5462.  There are also commands to select another buffer or buffers: 
  5463.  
  5464.           Quit the buffer menu---immediately display the most recent formerly 
  5465.           visible buffer in its place. 
  5466.  
  5467.           Immediately select this line's buffer in place of the `*Buffer List*' 
  5468.           buffer. 
  5469.  
  5470.           Immediately select this line's buffer in another window as if by C-x 
  5471.           4 b, leaving `*Buffer List*' visible. 
  5472.  
  5473. C-o 
  5474.           Immediately display this line's buffer in another window, but don't 
  5475.           select the window. 
  5476.  
  5477.           Immediately select this line's buffer in a full-screen window. 
  5478.  
  5479.           Immediately set up two windows, with this line's buffer in one, and 
  5480.           the previously selected buffer (aside from the buffer `*Buffer 
  5481.           List*') in the other. 
  5482.  
  5483.           Mark this line's buffer to be displayed in another window if the q 
  5484.           command is used.  The request shows as a `>' at the beginning of the 
  5485.           line.  The same buffer may not have both a delete request and a 
  5486.           display request. 
  5487.  
  5488.           Immediately select this line's buffer, and also display in other 
  5489.           windows any buffers previously marked with the m command.  If you 
  5490.           have not marked any buffers, this command is equivalent to 1. 
  5491.  
  5492.  All that buffer-menu does directly is create and select a suitable buffer, and 
  5493. turn on Buffer Menu mode.  Everything else described above is implemented by 
  5494. the special commands provided in Buffer Menu mode.  One consequence of this is 
  5495. that you can switch from the `*Buffer List*' buffer to another Emacs buffer, 
  5496. and edit there.  You can reselect the buffer-menu buffer later, to perform the 
  5497. operations already requested, or you can kill it, or pay no further attention 
  5498. to it. 
  5499.  
  5500.  The only difference between buffer-menu and list-buffers is that buffer-menu 
  5501. selects the `*Buffer List*' buffer and list-buffers does not.  If you run 
  5502. list-buffers (that is, type C-x C-b) and select the buffer list manually, you 
  5503. can use all of the commands described here. 
  5504.  
  5505.  The buffer `*Buffer List*' is not updated automatically; its contents are just 
  5506. text.  If you have created, deleted or renamed buffers, the way to update 
  5507. `*Buffer List*' to show what you have done is to repeat the buffer-menu 
  5508. command. 
  5509.  
  5510.  
  5511. ΓòÉΓòÉΓòÉ 20. Multiple Windows ΓòÉΓòÉΓòÉ
  5512.  
  5513.  Emacs can split a frame into two or many windows.  Multiple windows can 
  5514. display parts of different buffers, or different parts of one buffer.  Multiple 
  5515. frames always imply multiple windows, because each window belongs to one and 
  5516. only one frame. 
  5517.  
  5518.  
  5519. ΓòÉΓòÉΓòÉ 20.1. Concepts of Emacs Windows ΓòÉΓòÉΓòÉ
  5520.  
  5521.  When multiple windows are being displayed, each window has an Emacs buffer 
  5522. designated for display in it.  The same buffer may appear in more than one 
  5523. window; if it does, any changes in its text are displayed in all the windows 
  5524. where it appears.  But the windows showing the same buffer can show different 
  5525. parts of it, because each window has its own value of point. 
  5526.  
  5527.  At any time, one of the windows is the selected window; the buffer this window 
  5528. is displaying is the current buffer.  The terminal's cursor shows the location 
  5529. of point in this window.  Each other window has a location of point as well, 
  5530. but since the terminal has only one cursor there is no way to show where those 
  5531. locations are.  When you make multiple frames, each frame has a cursor which 
  5532. appears in the frame's selected window. 
  5533.  
  5534.  Commands to move point affect the value of point for the selected Emacs window 
  5535. only.  They do not change the value of point in any other Emacs window, even 
  5536. one showing the same buffer.  The same is true for commands such as C-x b to 
  5537. change the selected buffer in the selected window; they do not affect other 
  5538. windows at all.  However, there are other commands such as C-x 4 b that select 
  5539. a different window and switch buffers in it.  Also, all commands that display 
  5540. information in a window, including (for example) C-h f (describe-function) and 
  5541. C-x C-b (list-buffers), work by switching buffers in a nonselected window 
  5542. without affecting the selected window. 
  5543.  
  5544.  When multiple windows show the same buffer, they can have different regions, 
  5545. because they can have different values of point.  This means that in Transient 
  5546. Mark mode, each window highlights a different part of the buffer.  The part 
  5547. that is highlighted in the selected window is the region that editing commands 
  5548. use. 
  5549.  
  5550.  Each window has its own mode line, which displays the buffer name, 
  5551. modification status and major and minor modes of the buffer that is displayed 
  5552. in the window.  See Mode Line, for full details on the mode line. 
  5553.  
  5554.  
  5555. ΓòÉΓòÉΓòÉ 20.2. Splitting Windows ΓòÉΓòÉΓòÉ
  5556.  
  5557. C-x 2 
  5558.           Split the selected window into two windows, one above the other 
  5559.           (split-window-vertically). 
  5560.  
  5561. C-x 3 
  5562.           Split the selected window into two windows positioned side by side 
  5563.           (split-window-horizontally). 
  5564.  
  5565.  The command C-x 2 (split-window-vertically) breaks the selected window into 
  5566. two windows, one above the other.  Both windows start out displaying the same 
  5567. buffer, with the same value of point.  By default the two windows each get half 
  5568. the height of the window that was split; a numeric argument specifies how many 
  5569. lines to give to the top window. 
  5570.  
  5571.  C-x 3 (split-window-horizontally) breaks the selected window into two 
  5572. side-by-side windows.  A numeric argument specifies how many columns to give 
  5573. the one on the left.  A line of vertical bars separates the two windows. 
  5574. Windows that are not the full width of the screen have mode lines, but they are 
  5575. truncated; also, they do not always appear in inverse video, because the Emacs 
  5576. display routines have not been taught how to display a region of inverse video 
  5577. that is only part of a line on the screen. 
  5578.  
  5579.  When a window is less than the full width, text lines too long to fit are 
  5580. frequent.  Continuing all those lines might be confusing.  The variable 
  5581. truncate-partial-width-windows can be set non-nil to force truncation in all 
  5582. windows less than the full width of the screen, independent of the buffer being 
  5583. displayed and its value for truncate-lines.  See Continuation Lines. 
  5584.  
  5585.  Horizontal scrolling is often used in side-by-side windows. See Display. 
  5586.  
  5587.  If split-window-keep-point is non-nil, C-x 2 tries to avoid shifting any text 
  5588. on the screen by putting point in whichever window happens to contain the 
  5589. screen line the cursor is already on.  The default is that 
  5590. split-window-keep-point is non-nil on slow terminals. 
  5591.  
  5592.  
  5593. ΓòÉΓòÉΓòÉ 20.3. Using Other Windows ΓòÉΓòÉΓòÉ
  5594.  
  5595. C-x o 
  5596.           Select another window (other-window).  That is o, not zero. 
  5597.  
  5598. C-M-v 
  5599.           Scroll the next window (scroll-other-window). 
  5600.  
  5601. M-x compare-windows 
  5602.           Find next place where the text in the selected window does not match 
  5603.           the text in the next window. 
  5604.  
  5605.  To select a different window, use C-x o (other-window). That is an o, for 
  5606. `other', not a zero.  When there are more than two windows, this command moves 
  5607. through all the windows in a cyclic order, generally top to bottom and left to 
  5608. right.  After the rightmost and bottommost window, it goes back to the one at 
  5609. the upper left corner.  A numeric argument means to move several steps in the 
  5610. cyclic order of windows.  A negative argument moves around the cycle in the 
  5611. opposite order. When the minibuffer is active, the minibuffer is the last 
  5612. window in the cycle; you can switch from the minibuffer window to one of the 
  5613. other windows, and later switch back and finish supplying the minibuffer 
  5614. argument that is requested.  See Minibuffer Edit. 
  5615.  
  5616.  The usual scrolling commands (see Display) apply to the selected window only, 
  5617. but there is one command to scroll the next window. C-M-v (scroll-other-window) 
  5618. scrolls the window that C-x o would select.  It takes arguments, positive and 
  5619. negative, like C-v.  (In the minibuffer, C-M-v scrolls the window that contains 
  5620. the minibuffer help display, if any, rather than the next window in the 
  5621. standard cyclic order.) 
  5622.  
  5623.  The command M-x compare-windows lets you compare two files or buffers visible 
  5624. in two windows, by moving through them to the next mismatch.  See Comparing 
  5625. Files. 
  5626.  
  5627.  
  5628. ΓòÉΓòÉΓòÉ 20.4. Displaying in Another Window ΓòÉΓòÉΓòÉ
  5629.  
  5630.  C-x 4 is a prefix key for commands that select another window (splitting the 
  5631. window if there is only one) and select a buffer in that window.  Different C-x 
  5632. 4 commands have different ways of finding the buffer to select. 
  5633.  
  5634. C-x 4 b bufname RET 
  5635.           Select buffer bufname in another window.  This runs 
  5636.           switch-to-buffer-other-window. 
  5637.  
  5638. C-x 4 C-o bufname RET 
  5639.           Display buffer bufname in another window, but don't select that 
  5640.           buffer or that window.  This runs display-buffer. 
  5641.  
  5642. C-x 4 f filename RET 
  5643.           Visit file filename and select its buffer in another window.  This 
  5644.           runs find-file-other-window.  See Visiting. 
  5645.  
  5646. C-x 4 d directory RET 
  5647.           Select a Dired buffer for directory directory in another window. This 
  5648.           runs dired-other-window.  See Dired. 
  5649.  
  5650. C-x 4 m 
  5651.           Start composing a mail message in another window.  This runs 
  5652.           mail-other-window; its same-window analogue is C-x m (see Sending 
  5653.           Mail). 
  5654.  
  5655. C-x 4 . 
  5656.           Find a tag in the current tag table in another window.  This runs 
  5657.           find-tag-other-window, the multiple-window variant of M-. (see Tags). 
  5658.  
  5659. C-x 4 r filename RET 
  5660.           Visit file filename read-only, and select its buffer in another 
  5661.           window.  This runs find-file-read-only-other-window. See Visiting. 
  5662.  
  5663.  
  5664. ΓòÉΓòÉΓòÉ 20.5. Deleting and Rearranging Windows ΓòÉΓòÉΓòÉ
  5665.  
  5666. C-x 0 
  5667.           Get rid of the selected window (delete-window).  That is a zero. 
  5668.  
  5669. C-x 1 
  5670.           Get rid of all windows except the selected one 
  5671.           (delete-other-windows). 
  5672.  
  5673. C-x ^ 
  5674.           Make selected window taller (enlarge-window). 
  5675.  
  5676. C-x } 
  5677.           Make selected window wider (enlarge-window-horizontally). 
  5678.  
  5679.  To delete a window, type C-x 0 (delete-window).  (That is a zero.)  The space 
  5680. occupied by the deleted window is given to an adjacent window (but not the 
  5681. minibuffer window, even if that is active at the time).  Once a window is 
  5682. deleted, its attributes are forgotten; only restoring a window configuration 
  5683. can bring it back.  Deleting the window has no effect on the buffer it used to 
  5684. display; the buffer continues to exist, and you can select it in any window 
  5685. with C-x b. 
  5686.  
  5687.  C-x 1 (delete-other-windows) is more powerful than C-x 0; it deletes all the 
  5688. windows except the selected one (and the minibuffer); the selected window 
  5689. expands to use the whole frame except for the echo area. 
  5690.  
  5691.  To readjust the division of space among vertically adjacent windows, use C-x ^ 
  5692. (enlarge-window).  It makes the currently selected window get one line bigger, 
  5693. or as many lines as is specified with a numeric argument.  With a negative 
  5694. argument, it makes the selected window smaller.  C-x } 
  5695. (enlarge-window-horizontally) makes the selected window wider by the specified 
  5696. number of columns.  The extra screen space given to a window comes from one of 
  5697. its neighbors, if that is possible.  If this makes any window too small, it is 
  5698. deleted and its space is given to an adjacent window.  The minimum size is 
  5699. specified by the variables window-min-height and window-min-width. 
  5700.  
  5701.  
  5702. ΓòÉΓòÉΓòÉ 21. Frames and X Windows ΓòÉΓòÉΓòÉ
  5703.  
  5704.  When using the X Window System, you can create multiple windows at the X level 
  5705. in a single Emacs session.  Each X window that belongs to Emacs displays a 
  5706. frame which can contain one or several Emacs windows. A frame initially 
  5707. contains a single general-purpose Emacs window which you can subdivide 
  5708. vertically or horizontally into smaller windows.  A frame normally contains its 
  5709. own echo area and minibuffer, but you can make frames that don't have 
  5710. these---they use the echo area and minibuffer of another frame. 
  5711.  
  5712.  Anything you do in one frame also affects the other frames.  For instance, if 
  5713. you put text in the kill ring in one frame, you can yank it in another frame. 
  5714. If you exit emacs through C-x C-c in one frame, it terminates all the frames. 
  5715. To delete just one frame, use C-x 5 0. 
  5716.  
  5717.  To avoid confusion, we reserve the word ``window'' for the subdivisions that 
  5718. Emacs implements, and never use it to refer to a frame. 
  5719.  
  5720.  
  5721. ΓòÉΓòÉΓòÉ 21.1. Mouse Commands ΓòÉΓòÉΓòÉ
  5722.  
  5723. mouse-1 
  5724.           Move point to where you click (mouse-set-point). This is normally the 
  5725.           left button. 
  5726.  
  5727. drag-mouse-1 
  5728.           Move point to where you release the mouse, and set the mark where you 
  5729.           initially clicked the mouse (mouse-set-region).  Thus, you can 
  5730.           specify both ends of the region.  In Transient Mark mode, the region 
  5731.           highlighting appears and changes as you drag. 
  5732.  
  5733.           If you move the mouse off the top or bottom of the window while 
  5734.           dragging, the window scrolls at a steady rate until you move the 
  5735.           mouse back into the window.  This way, you can mark regions that 
  5736.           don't fit entirely on the screen. 
  5737.  
  5738. mouse-2 
  5739.           Yank the last kill text, where you click (mouse-yank-at-click). This 
  5740.           is normally the middle button. 
  5741.  
  5742. mouse-3 
  5743.           Copy text to the kill ring (mouse-save-then-click).  This is normally 
  5744.           the right button.  If you click it a second time at the same place, 
  5745.           that kills the text. 
  5746.  
  5747.           This operation applies to the text between point and the place where 
  5748.           you click. 
  5749.  
  5750.  Thus, to kill a section of text, you can press Mouse-1 at one end, then press 
  5751. Mouse-3 twice at the other end.  To select the text for copying without 
  5752. deleting it from the buffer, press Mouse-3 just once.  Then you can copy it 
  5753. elsewhere by yanking it. See Killing. 
  5754.  
  5755.  To yank the killed or copied text somewhere else, move the mouse there and 
  5756. press Mouse-2.  See Yanking. 
  5757.  
  5758.  To copy text to another X window, kill it or save it in the kill ring. Under 
  5759. X, this also sets the primary selection.  Then use the ``paste'' or ``yank'' 
  5760. command of the program operating the other window to insert the text from the 
  5761. selection. 
  5762.  
  5763.  To copy text from another X window, use the ``cut'' or ``copy'' command of the 
  5764. program operating the other window, to select the text you want. Then yank it 
  5765. in Emacs with C-y or Mouse-2. 
  5766.  
  5767.  
  5768. ΓòÉΓòÉΓòÉ 21.2. Creating Frames ΓòÉΓòÉΓòÉ
  5769.  
  5770.  The prefix key C-x 5 is analogous to C-x 4, with parallel subcommands.  The 
  5771. difference is that C-x 5 commands create a new frame rather than just a new 
  5772. window in the selected frame.  ( See Pop Up Window.)  Different C-x 4 commands 
  5773. have different ways of finding the buffer to select. 
  5774.  
  5775. C-x 5 b bufname RET 
  5776.           Select buffer bufname in another window.  This runs 
  5777.           switch-to-buffer-other-frame. 
  5778.  
  5779. C-x 5 f filename RET 
  5780.           Visit file filename and select its buffer in another frame.  This 
  5781.           runs find-file-other-frame.  See Visiting. 
  5782.  
  5783. C-x 5 d directory RET 
  5784.           Select a Dired buffer for directory directory in another frame. This 
  5785.           runs dired-other-frame.  See Dired. 
  5786.  
  5787. C-x 5 m 
  5788.           Start composing a mail message in another frame.  This runs 
  5789.           mail-other-frame, and its same-frame version is C-x m. See Sending 
  5790.           Mail. 
  5791.  
  5792. C-x 5 . 
  5793.           Find a tag in the current tag table in another frame.  This runs 
  5794.           find-tag-other-frame, the multiple-frame variant of M-.. See Tags. 
  5795.  
  5796. C-x 5 r filename RET 
  5797.           Visit file filename read-only, and select its buffer in another 
  5798.           frame.  This runs find-file-read-only-other-frame. See Visiting. 
  5799.  
  5800.  
  5801. ΓòÉΓòÉΓòÉ 21.3. Setting Frame Parameters ΓòÉΓòÉΓòÉ
  5802.  
  5803.  This section describes commands for altering the display style and window 
  5804. management behavior of the selected frame. 
  5805.  
  5806. M-x set-foreground-color RET color RET 
  5807.           Specify color color for the foreground of the selected frame. 
  5808.  
  5809. M-x set-background-color RET color RET 
  5810.           Specify color color for the background of the selected frame. 
  5811.  
  5812. M-x set-cursor-color RET color RET 
  5813.           Specify color color for the cursor of the selected frame. 
  5814.  
  5815. M-x set-mouse-color RET color RET 
  5816.           Specify color color for the mouse cursor when it is over the selected 
  5817.           frame. 
  5818.  
  5819. M-x set-border-color RET color RET 
  5820.           Specify color color for the border of the selected frame. 
  5821.  
  5822. M-x auto-raise-mode 
  5823.           Toggle whether or not the selected frame should auto-raise. 
  5824.           Auto-raise means that every time you move the mouse onto the frame, 
  5825.           it raises the frame. 
  5826.  
  5827. M-x auto-lower-mode 
  5828.           Toggle whether or not the selected frame should auto-lower. 
  5829.           Auto-lower means that every time you move the mouse off of the frame, 
  5830.           the frame moves to the bottom of the stack of X windows. 
  5831.  
  5832. M-x set-default-font RET font RET 
  5833.           Specify font font as the default for the selected frame. See Font X, 
  5834.           for ways to list the available fonts on your system. 
  5835.  
  5836.           You can also set a frame's default font through a pop-up menu. Press 
  5837.           C-Mouse-3 to activate this menu. 
  5838.  
  5839.  
  5840. ΓòÉΓòÉΓòÉ 21.4. Scroll Bars ΓòÉΓòÉΓòÉ
  5841.  
  5842.  When using X, Emacs normally makes a scroll bar at the right of each Emacs 
  5843. window.  The scroll bar runs the height of the window, and shows a moving 
  5844. rectangular inner box which represents the portion of the buffer currently 
  5845. displayed.  The entire height of the scroll bar represents the entire length of 
  5846. the buffer. 
  5847.  
  5848.  You can use Mouse-2 (normally, the middle button) in the scroll bar to move or 
  5849. drag the inner box up and down.  If you move it to the top of the scroll bar, 
  5850. you see the top of the buffer.  If you move it to the bottom of the scroll bar, 
  5851. you see the bottom of the buffer. 
  5852.  
  5853.  The left and right buttons in the scroll bar scroll by controlled increments. 
  5854. Mouse-1 (normally, the left button) moves the line at the level where you click 
  5855. up to the top of the window.  Mouse-3 (normally, the right button) moves the 
  5856. line at the top of the window down to the level where you click.  By clicking 
  5857. repeatedly in the same place, you can scroll by the same distance over and 
  5858. over. 
  5859.  
  5860.  You can enable or disable Scroll Bar mode with the command M-x 
  5861. scroll-bar-mode.  With no argument, it toggles the use of scroll bars. With an 
  5862. argument, it turns use of scroll bars on if and only if the argument is 
  5863. positive.  This command applies to all frames, including frames yet to be 
  5864. created. 
  5865.  
  5866.  To enable or disable scroll bars for just the selected frame, use the M-x 
  5867. toggle-scroll-bar command. 
  5868.  
  5869.  
  5870. ΓòÉΓòÉΓòÉ 21.5. Menu Bars ΓòÉΓòÉΓòÉ
  5871.  
  5872.  By default, each Emacs frame has a menu bar at the top which you can use to 
  5873. perform certain common operations.  There's no need to describe them in detail 
  5874. here, as you can more easily see for yourself; also, we may change them and add 
  5875. to them in subsequent Emacs versions. 
  5876.  
  5877.  Each of the operations in the menu bar is bound to an ordinary Emacs command 
  5878. which you can invoke equally well with M-x or with its own key bindings.  To 
  5879. see the command's name and documentation, type C-h k and then select the menu 
  5880. bar item you are interested in. 
  5881.  
  5882.  You can turn display of menu bars on or off with M-x menu-bar-mode. With no 
  5883. argument, this command toggles Menu Bar mode, a minor mode. With an argument, 
  5884. the command turns Menu Bar mode on if the argument is positive, off if the 
  5885. argument is not positive. 
  5886.  
  5887.  
  5888. ΓòÉΓòÉΓòÉ 21.6. Using Multiple Typefaces ΓòÉΓòÉΓòÉ
  5889.  
  5890.  When using Emacs with X, you can set up multiple styles of displaying 
  5891. characters.  The aspects of style that you can control are the type font, the 
  5892. foreground color, the background color, and whether to underline. 
  5893.  
  5894.  The way you control display style is by defining named faces. Each face can 
  5895. specify a type font, a foreground color, a background color, and an underline 
  5896. flag; but it does not have to specify all of them. 
  5897.  
  5898.  The style of display used for a given character in the text is determined by 
  5899. combining several faces.  Which faces to use is always set up by Lisp programs, 
  5900. at present, by means of text properties and overlays.  Any aspect of the 
  5901. display style that isn't specified by overlays or text properties comes from 
  5902. the frame itself. 
  5903.  
  5904.  To see what faces are currently defined, and what they look like, type M-x 
  5905. list-faces-display.  It's possible for a given face to look different in 
  5906. different frames; this command shows the appearance in the frame in which you 
  5907. type it. 
  5908.  
  5909.  When Transient Mark mode is enabled, the text of the region is highlighted 
  5910. when the mark is active.  This uses a face named region; you can control the 
  5911. style of highlighting by changing the style of this face with the commands 
  5912. below.  See Setting Mark, for more information about Transient Mark mode and 
  5913. activation and deactivation of the mark. 
  5914.  
  5915.  Here are the commands for users to change the font of a face. 
  5916.  
  5917. M-x set-face-font RET face RET font RET 
  5918.           Use font font in face face. 
  5919.  
  5920. M-x make-face-bold RET face RET 
  5921.           Convert face face to use a bold version of its current font. 
  5922.  
  5923. M-x make-face-italic RET face RET 
  5924.           Convert face face to use a italic version of its current font. 
  5925.  
  5926. M-x make-face-bold-italic RET face RET 
  5927.           Convert face face to use a bold-italic version of its current font. 
  5928.  
  5929. M-x make-face-unbold RET face RET 
  5930.           Convert face face to use a non-bold version of its current font. 
  5931.  
  5932. M-x make-face-unitalic RET face RET 
  5933.           Convert face face to use a non-italic version of its current font. 
  5934.  
  5935.  Here are the commands for users to set the colors and underline flag of a 
  5936. face: 
  5937.  
  5938. M-x set-face-foreground RET face RET color RET 
  5939.           Use color color for the foreground of characters in face face. 
  5940.  
  5941. M-x set-face-background RET face RET color RET 
  5942.           Use color color for the background of characters in face face. 
  5943.  
  5944. M-x set-face-underline-p RET face RET flag RET 
  5945.           Specify whether to underline characters in face face. 
  5946.  
  5947. M-x invert-face RET face RET 
  5948.           Swap the foreground and background colors of face face. 
  5949.  
  5950.  
  5951. ΓòÉΓòÉΓòÉ 21.7. Miscellaneous X Window Features ΓòÉΓòÉΓòÉ
  5952.  
  5953.  To iconify the selected Emacs frame, type C-z.  The normal meaning of C-z, to 
  5954. suspend Emacs, is not useful under a window system, so it has a different 
  5955. binding in that case (the command iconify-frame). 
  5956.  
  5957.  To delete the selected frame, type C-x 5 0. 
  5958.  
  5959.  Under X Windows, when Transient Mark mode is enabled, Emacs highlights the 
  5960. region when the mark is active.  This is the main motive for using Transient 
  5961. Mark mode.  To enable this mode, use the command M-x transient-mark-mode.  See 
  5962. Mark. 
  5963.  
  5964.  
  5965. ΓòÉΓòÉΓòÉ 22. Major Modes ΓòÉΓòÉΓòÉ
  5966.  
  5967.  Emacs provides many alternative major modes, each of which customizes Emacs 
  5968. for editing text of a particular sort.  The major modes are mutually exclusive, 
  5969. and each buffer has one major mode at any time. The mode line normally shows 
  5970. the name of the current major mode, in parentheses (see Mode Line). 
  5971.  
  5972.  The least specialized major mode is called Fundamental mode.  This mode has no 
  5973. mode-specific redefinitions or variable settings, so that each Emacs command 
  5974. behaves in its most general manner, and each option is in its default state. 
  5975. For editing any specific type of text, such as Lisp code or English text, you 
  5976. should switch to the appropriate major mode, such as Lisp mode or Text mode. 
  5977.  
  5978.  Selecting a major mode changes the meanings of a few keys to become more 
  5979. specifically adapted to the language being edited.  The ones which are changed 
  5980. frequently are TAB, DEL, and LFD.  In addition, the commands which handle 
  5981. comments use the mode to determine how comments are to be delimited.  Many 
  5982. major modes redefine the syntactical properties of characters appearing in the 
  5983. buffer.  See Syntax. 
  5984.  
  5985.  The major modes fall into three major groups.  Lisp mode (which has several 
  5986. variants), C mode, Fortran mode and others are for specific programming 
  5987. languages.  Text mode, Nroff mode, TeX mode and Outline mode are for editing 
  5988. English text.  The remaining major modes are not intended for use on users' 
  5989. files; they are used in buffers created for specific purposes by Emacs, such as 
  5990. Dired mode for buffers made by Dired (see Dired), and Mail mode for buffers 
  5991. made by C-x m (see Sending Mail), and Shell mode for buffers used for 
  5992. communicating with an inferior shell process ( see Interactive Shell). 
  5993.  
  5994.  Most programming language major modes specify that only blank lines separate 
  5995. paragraphs.  This is so that the paragraph commands remain useful. (See 
  5996. Paragraphs.)  They also cause Auto Fill mode to use the definition of TAB to 
  5997. indent the new lines it creates.  This is because most lines in a program are 
  5998. usually indented.  (See Indentation.) 
  5999.  
  6000.  
  6001. ΓòÉΓòÉΓòÉ 22.1. How Major Modes are Chosen ΓòÉΓòÉΓòÉ
  6002.  
  6003.  You can select a major mode explicitly for the current buffer, but most of the 
  6004. time Emacs determines which mode to use based on the file name or on special 
  6005. text in the file. 
  6006.  
  6007.  Explicit selection of a new major mode is done with a M-x command. From the 
  6008. name of a major mode, add -mode to get the name of a command to select that 
  6009. mode.  Thus, you can enter Lisp mode by executing M-x lisp-mode. 
  6010.  
  6011.  When you visit a file, Emacs usually chooses the right major mode based on the 
  6012. file's name.  For example, files whose names end in `.c' are edited in C mode. 
  6013. The correspondence between file names and major mode is controlled by the 
  6014. variable auto-mode-alist.  Its value is a list in which each element has the 
  6015. form 
  6016.  
  6017. (regexp . mode-function)
  6018.  
  6019. For example, one element normally found in the list has the form ("\\.c$" . 
  6020. c-mode), and it is responsible for selecting C mode for files whose names end 
  6021. in `.c'.  (Note that `\\' is needed in Lisp syntax to include a `\' in the 
  6022. string, which is needed to suppress the special meaning of `.' in regexps.) 
  6023. The only practical way to change this variable is with Lisp code. 
  6024.  
  6025.  You can specify which major mode should be used for editing a certain file by 
  6026. a special sort of text in the first nonblank line of the file.  The mode name 
  6027. should appear in this line both preceded and followed by `-*-'.  Other text may 
  6028. appear on the line as well.  For example, 
  6029.  
  6030. ;-*-Lisp-*-
  6031.  
  6032. tells Emacs to use Lisp mode.  Such an explicit specification overrides any 
  6033. defaulting based on the file name.  Note how the semicolon is used to make Lisp 
  6034. treat this line as a comment. 
  6035.  
  6036.  Another format of mode specification is 
  6037.  
  6038. -*-Mode: modename;-*-
  6039.  
  6040. which allows you to specify local variables as well, like this: 
  6041.  
  6042. -*- mode: modename; var: value; ... -*-
  6043.  
  6044. See File Variables, for more information about this. 
  6045.  
  6046.  When you visit a file that does not specify a major mode to use, or when you 
  6047. create a new buffer with C-x b, the variable default-major-mode specifies which 
  6048. major mode to use.  Normally its value is the symbol fundamental-mode, which 
  6049. specifies Fundamental mode.  If default-major-mode is nil, the major mode is 
  6050. taken from the previously selected buffer. 
  6051.  
  6052.  If you change the major mode of a buffer, you can go back to the major mode 
  6053. Emacs would choose automatically: use the command M-x normal-mode to do this. 
  6054. This is the same function that find-file calls to choose the major mode.  It 
  6055. also processes the file's local variables list if any. 
  6056.  
  6057.  
  6058. ΓòÉΓòÉΓòÉ 23. Indentation ΓòÉΓòÉΓòÉ
  6059.  
  6060.  This chapter describes the Emacs commands that add, remove, or adjust 
  6061. indentation. 
  6062.  
  6063. TAB 
  6064.           Indent current line ``appropriately'' in a mode-dependent fashion. 
  6065.  
  6066. LFD 
  6067.           Perform RET followed by TAB (newline-and-indent). 
  6068.  
  6069. M-^ 
  6070.           Merge two lines (delete-indentation).  This would cancel out the 
  6071.           effect of LFD. 
  6072.  
  6073. C-M-o 
  6074.           Split line at point; text on the line after point becomes a new line 
  6075.           indented to the same column that it now starts in (split-line). 
  6076.  
  6077. M-m 
  6078.           Move (forward or back) to the first nonblank character on the current 
  6079.           line (back-to-indentation). 
  6080.  
  6081. C-M-\ 
  6082.           Indent several lines to same column (indent-region). 
  6083.  
  6084. C-x TAB 
  6085.           Shift block of lines rigidly right or left (indent-rigidly). 
  6086.  
  6087. M-i 
  6088.           Indent from point to the next prespecified tab stop column 
  6089.           (tab-to-tab-stop). 
  6090.  
  6091. M-x indent-relative 
  6092.           Indent from point to under an indentation point in the previous line. 
  6093.  
  6094.  Most programming languages have some indentation convention.  For Lisp code, 
  6095. lines are indented according to their nesting in parentheses.  The same general 
  6096. idea is used for C code, though many details are different. 
  6097.  
  6098.  Whatever the language, to indent a line, use the TAB command.  Each major mode 
  6099. defines this command to perform the sort of indentation appropriate for the 
  6100. particular language.  In Lisp mode, TAB aligns the line according to its depth 
  6101. in parentheses.  No matter where in the line you are when you type TAB, it 
  6102. aligns the line as a whole.  In C mode, TAB implements a subtle and 
  6103. sophisticated indentation style that knows about many aspects of C syntax. 
  6104.  
  6105.  In Text mode, TAB runs the command tab-to-tab-stop, which indents to the next 
  6106. tab stop column.  You can set the tab stops with M-x edit-tab-stops. 
  6107.  
  6108.  
  6109. ΓòÉΓòÉΓòÉ 23.1. Indentation Commands and Techniques ΓòÉΓòÉΓòÉ
  6110.  
  6111.  If you just want to insert a tab character in the buffer, you can type C-q 
  6112. TAB. 
  6113.  
  6114.  To move over the indentation on a line, do M-m (back-to-indentation).  This 
  6115. command, given anywhere on a line, positions point at the first nonblank 
  6116. character on the line. 
  6117.  
  6118.  To insert an indented line before the current line, do C-a C-o TAB.  To make 
  6119. an indented line after the current line, use C-e LFD. 
  6120.  
  6121.  C-M-o (split-line) moves the text from point to the end of the line vertically 
  6122. down, so that the current line becomes two lines. C-M-o first moves point 
  6123. forward over any spaces and tabs.  Then it inserts after point a newline and 
  6124. enough indentation to reach the same column point is on.  Point remains before 
  6125. the inserted newline; in this regard, C-M-o resembles C-o. 
  6126.  
  6127.  To join two lines cleanly, use the M-^ (delete-indentation) command.  It 
  6128. deletes the indentation at the front of the current line, and the line boundary 
  6129. as well, replacing them with a single space.  As a special case (useful for 
  6130. Lisp code) the single space is omitted if the characters to be joined are 
  6131. consecutive open parentheses or closing parentheses, or if the junction follows 
  6132. another newline.  To delete just the indentation of a line, go to the beginning 
  6133. of the line and use M-\ (delete-horizontal-space), which deletes all spaces and 
  6134. tabs around the cursor. 
  6135.  
  6136.  If you have a fill prefix, M-^ deletes the fill prefix if it appears after the 
  6137. newline that is deleted.  See Fill Prefix. 
  6138.  
  6139.  There are also commands for changing the indentation of several lines at once. 
  6140. C-M-\ (indent-region) gives each line which begins in the region the ``usual'' 
  6141. indentation by invoking TAB at the beginning of the line.  A numeric argument 
  6142. specifies the column to indent to, and each line is shifted left or right so 
  6143. that its first nonblank character appears in that column.  C-x TAB 
  6144. (indent-rigidly) moves all of the lines in the region right by its argument 
  6145. (left, for negative arguments).  The whole group of lines moves rigidly 
  6146. sideways, which is how the command gets its name. 
  6147.  
  6148.  M-x indent-relative indents at point based on the previous line (actually, the 
  6149. last nonempty line).  It inserts whitespace at point, moving point, until it is 
  6150. underneath an indentation point in the previous line. An indentation point is 
  6151. the end of a sequence of whitespace or the end of the line.  If point is 
  6152. farther right than any indentation point in the previous line, the whitespace 
  6153. before point is deleted and the first indentation point then applicable is 
  6154. used.  If no indentation point is applicable even then, indent-relative runs 
  6155. tab-to-tab-stop (see Tab Stops). 
  6156.  
  6157.  indent-relative is the definition of TAB in Indented Text mode.  See Text. 
  6158.  
  6159.  
  6160. ΓòÉΓòÉΓòÉ 23.2. Tab Stops ΓòÉΓòÉΓòÉ
  6161.  
  6162.  For typing in tables, you can use Text mode's definition of TAB, 
  6163. tab-to-tab-stop.  This command inserts indentation before point, enough to 
  6164. reach the next tab stop column.  If you are not in Text mode, this command can 
  6165. be found on the key M-i. 
  6166.  
  6167.  You can specify the tab stops used by M-i.  They are stored in a variable 
  6168. called tab-stop-list, as a list of column-numbers in increasing order. 
  6169.  
  6170.  The convenient way to set the tab stops is with M-x edit-tab-stops, which 
  6171. creates and selects a buffer containing a description of the tab stop settings. 
  6172. You can edit this buffer to specify different tab stops, and then type C-c C-c 
  6173. to make those new tab stops take effect.  In the tab stop buffer, C-c C-c runs 
  6174. the function edit-tab-stops-note-changes rather than its usual definition 
  6175. save-buffer.  edit-tab-stops records which buffer was current when you invoked 
  6176. it, and stores the tab stops back in that buffer; normally all buffers share 
  6177. the same tab stops and changing them in one buffer affects all, but if you 
  6178. happen to make tab-stop-list local in one buffer then edit-tab-stops in that 
  6179. buffer will edit the local settings. 
  6180.  
  6181.  Here is what the text representing the tab stops looks like for ordinary tab 
  6182. stops every eight columns. 
  6183.  
  6184.         :       :       :       :       :       :
  6185. 0         1         2         3         4
  6186. 0123456789012345678901234567890123456789012345678
  6187. To install changes, type C-c C-c
  6188.  
  6189.  The first line contains a colon at each tab stop.  The remaining lines are 
  6190. present just to help you see where the colons are and know what to do. 
  6191.  
  6192.  Note that the tab stops that control tab-to-tab-stop have nothing to do with 
  6193. displaying tab characters in the buffer.  See Display Vars, for more 
  6194. information on that. 
  6195.  
  6196.  
  6197. ΓòÉΓòÉΓòÉ 23.3. Tabs vs. Spaces ΓòÉΓòÉΓòÉ
  6198.  
  6199.  Emacs normally uses both tabs and spaces to indent lines.  If you prefer, all 
  6200. indentation can be made from spaces only.  To request this, set 
  6201. indent-tabs-mode to nil.  This is a per-buffer variable; altering the variable 
  6202. affects only the current buffer, but there is a default value which you can 
  6203. change as well.  See Locals. 
  6204.  
  6205.  There are also commands to convert tabs to spaces or vice versa, always 
  6206. preserving the columns of all nonblank text.  M-x tabify scans the region for 
  6207. sequences of spaces, and converts sequences of at least three spaces to tabs if 
  6208. that can be done without changing indentation.  M-x untabify changes all tabs 
  6209. in the region to appropriate numbers of spaces. 
  6210.  
  6211.  
  6212. ΓòÉΓòÉΓòÉ 24. Commands for Human Languages ΓòÉΓòÉΓòÉ
  6213.  
  6214.  The term text has two widespread meanings in our area of the computer field. 
  6215. One is data that is a sequence of characters.  Any file that you edit with 
  6216. Emacs is text, in this sense of the word.  The other meaning is more 
  6217. restrictive: a sequence of characters in a human language for humans to read 
  6218. (possibly after processing by a text formatter), as opposed to a program or 
  6219. commands for a program. 
  6220.  
  6221.  Human languages have syntactic/stylistic conventions that can be supported or 
  6222. used to advantage by editor commands: conventions involving words, sentences, 
  6223. paragraphs, and capital letters.  This chapter describes Emacs commands for all 
  6224. of these things.  There are also commands for filling, which means rearranging 
  6225. the lines of a paragraph to be approximately equal in length.  The commands for 
  6226. moving over and killing words, sentences and paragraphs, while intended 
  6227. primarily for editing text, are also often useful for editing programs. 
  6228.  
  6229.  Emacs has several major modes for editing human language text. If the file 
  6230. contains text pure and simple, use Text mode, which customizes Emacs in small 
  6231. ways for the syntactic conventions of text.  For text which contains embedded 
  6232. commands for text formatters, Emacs has other major modes, each for a 
  6233. particular text formatter.  Thus, for input to TeX, you would use TeX mode; for 
  6234. input to nroff, Nroff mode. 
  6235.  
  6236.  
  6237. ΓòÉΓòÉΓòÉ 24.1. Words ΓòÉΓòÉΓòÉ
  6238.  
  6239.  Emacs has commands for moving over or operating on words.  By convention, the 
  6240. keys for them are all Meta characters. 
  6241.  
  6242. M-f 
  6243.           Move forward over a word (forward-word). 
  6244.  
  6245. M-b 
  6246.           Move backward over a word (backward-word). 
  6247.  
  6248. M-d 
  6249.           Kill up to the end of a word (kill-word). 
  6250.  
  6251. M-DEL 
  6252.           Kill back to the beginning of a word (backward-kill-word). 
  6253.  
  6254. M-@ 
  6255.           Mark the end of the next word (mark-word). 
  6256.  
  6257. M-t 
  6258.           Transpose two words or drag a word across other words 
  6259.           (transpose-words). 
  6260.  
  6261.  Notice how these keys form a series that parallels the character-based C-f, 
  6262. C-b, C-d, C-t and DEL.  M-@ is related to C-@, which is an alias for C-SPC. 
  6263.  
  6264.  The commands M-f (forward-word) and M-b (backward-word) move forward and 
  6265. backward over words.  These Meta characters are thus analogous to the 
  6266. corresponding control characters, C-f and C-b, which move over single 
  6267. characters in the text.  The analogy extends to numeric arguments, which serve 
  6268. as repeat counts.  M-f with a negative argument moves backward, and M-b with a 
  6269. negative argument moves forward.  Forward motion stops right after the last 
  6270. letter of the word, while backward motion stops right before the first letter. 
  6271.  
  6272.  M-d (kill-word) kills the word after point.  To be precise, it kills 
  6273. everything from point to the place M-f would move to.  Thus, if point is in the 
  6274. middle of a word, M-d kills just the part after point.  If some punctuation 
  6275. comes between point and the next word, it is killed along with the word.  (If 
  6276. you wish to kill only the next word but not the punctuation before it, simply 
  6277. do M-f to get the end, and kill the word backwards with M-DEL.) M-d takes 
  6278. arguments just like M-f. 
  6279.  
  6280.  M-DEL (backward-kill-word) kills the word before point.  It kills everything 
  6281. from point back to where M-b would move to.  If point is after the space in 
  6282. `FOO, BAR', then `FOO, ' is killed.  (If you wish to kill just `FOO', do M-b 
  6283. M-d instead of M-DEL.) 
  6284.  
  6285.  M-t (transpose-words) exchanges the word before or containing point with the 
  6286. following word.  The delimiter characters between the words do not move.  For 
  6287. example, `FOO, BAR' transposes into `BAR, FOO' rather than `BAR FOO,'.  See 
  6288. Transpose, for more on transposition and on arguments to transposition 
  6289. commands. 
  6290.  
  6291.  To operate on the next n words with an operation which applies between point 
  6292. and mark, you can either set the mark at point and then move over the words, or 
  6293. you can use the command M-@ (mark-word) which does not move point, but sets the 
  6294. mark where M-f would move to.  M-@ accepts a numeric argument that says how 
  6295. many words to scan for the place to put the mark. 
  6296.  
  6297.  The word commands' understanding of syntax is completely controlled by the 
  6298. syntax table.  Any character can, for example, be declared to be a word 
  6299. delimiter.  See Syntax. 
  6300.  
  6301.  
  6302. ΓòÉΓòÉΓòÉ 24.2. Sentences ΓòÉΓòÉΓòÉ
  6303.  
  6304.  The Emacs commands for manipulating sentences and paragraphs are mostly on 
  6305. Meta keys, so as to be like the word-handling commands. 
  6306.  
  6307. M-a 
  6308.           Move back to the beginning of the sentence (backward-sentence). 
  6309.  
  6310. M-e 
  6311.           Move forward to the end of the sentence (forward-sentence). 
  6312.  
  6313. M-k 
  6314.           Kill forward to the end of the sentence (kill-sentence). 
  6315.  
  6316. C-x DEL 
  6317.           Kill back to the beginning of the sentence (backward-kill-sentence). 
  6318.  
  6319.  The commands M-a and M-e (backward-sentence and forward-sentence) move to the 
  6320. beginning and end of the current sentence, respectively.  They were chosen to 
  6321. resemble C-a and C-e, which move to the beginning and end of a line.  Unlike 
  6322. them, M-a and M-e if repeated or given numeric arguments move over successive 
  6323. sentences.  Emacs assumes that the typist's convention is followed, and thus 
  6324. considers a sentence to end wherever there is a `.', `?' or `!' followed by the 
  6325. end of a line or two spaces, with any number of `)', `]', `'', or `"' 
  6326. characters allowed in between.  A sentence also begins or ends wherever a 
  6327. paragraph begins or ends. 
  6328.  
  6329.  Neither M-a nor M-e moves past the newline or spaces beyond the sentence edge 
  6330. at which it is stopping. 
  6331.  
  6332.  Just as C-a and C-e have a kill command, C-k, to go with them, so M-a and M-e 
  6333. have a corresponding kill command M-k (kill-sentence) which kills from point to 
  6334. the end of the sentence.  With minus one as an argument it kills back to the 
  6335. beginning of the sentence.  Larger arguments serve as a repeat count. 
  6336.  
  6337.  There is a special command, C-x DEL (backward-kill-sentence) for killing back 
  6338. to the beginning of a sentence, because this is useful when you change your 
  6339. mind in the middle of composing text. 
  6340.  
  6341.  The variable sentence-end controls recognition of the end of a sentence.  It 
  6342. is a regexp that matches the last few characters of a sentence, together with 
  6343. the whitespace following the sentence.  Its normal value is 
  6344.  
  6345. "[.?!][]\"')]*\\($\\|\t\\|  \\)[ \t\n]*"
  6346.  
  6347. This example is explained in the section on regexps.  See Regexps. 
  6348.  
  6349.  
  6350. ΓòÉΓòÉΓòÉ 24.3. Paragraphs ΓòÉΓòÉΓòÉ
  6351.  
  6352.  The Emacs commands for manipulating paragraphs are also Meta keys. 
  6353.  
  6354. M-{ 
  6355.           Move back to previous paragraph beginning (backward-paragraph). 
  6356.  
  6357. M-} 
  6358.           Move forward to next paragraph end (forward-paragraph). 
  6359.  
  6360. M-h 
  6361.           Put point and mark around this or next paragraph (mark-paragraph). 
  6362.  
  6363.  M-{ moves to the beginning of the current or previous paragraph, while M-} 
  6364. moves to the end of the current or next paragraph. Blank lines and text 
  6365. formatter command lines separate paragraphs and are not part of any paragraph. 
  6366. Also, an indented line starts a new paragraph. 
  6367.  
  6368.  In major modes for programs (as opposed to Text mode), paragraphs begin and 
  6369. end only at blank lines.  This makes the paragraph commands continue to be 
  6370. useful even though there are no paragraphs per se. 
  6371.  
  6372.  When there is a fill prefix, then paragraphs are delimited by all lines which 
  6373. don't start with the fill prefix.  See Filling. 
  6374.  
  6375.  When you wish to operate on a paragraph, you can use the command M-h 
  6376. (mark-paragraph) to set the region around it.  This command puts point at the 
  6377. beginning and mark at the end of the paragraph point was in.  If point is 
  6378. between paragraphs (in a run of blank lines, or at a boundary), the paragraph 
  6379. following point is surrounded by point and mark.  If there are blank lines 
  6380. preceding the first line of the paragraph, one of these blank lines is included 
  6381. in the region.  Thus, for example, M-h C-w kills the paragraph around or after 
  6382. point. 
  6383.  
  6384.  The precise definition of a paragraph boundary is controlled by the variables 
  6385. paragraph-separate and paragraph-start.  The value of paragraph-start is a 
  6386. regexp that should match any line that either starts or separates paragraphs. 
  6387. The value of paragraph-separate is another regexp that should match only lines 
  6388. that separate paragraphs without being part of any paragraph.  Lines that start 
  6389. a new paragraph and are contained in it must match both regexps.  For example, 
  6390. normally paragraph-start is "^[ \t\n\f]" and paragraph-separate is "^[ 
  6391. \t\f]*$". 
  6392.  
  6393.  Normally it is desirable for page boundaries to separate paragraphs. The 
  6394. default values of these variables recognize the usual separator for pages. 
  6395.  
  6396.  
  6397. ΓòÉΓòÉΓòÉ 24.4. Pages ΓòÉΓòÉΓòÉ
  6398.  
  6399.  Files are often thought of as divided into pages by the formfeed character 
  6400. (ASCII control-L, octal code 014).  For example, if a file is printed on a line 
  6401. printer, each page of the file, in this sense, will start on a new page of 
  6402. paper.  Emacs treats a page-separator character just like any other character. 
  6403. You can insert it with C-q C-l, or delete it with DEL.  Thus, you are free to 
  6404. paginate your file or not.  However, since pages are often meaningful divisions 
  6405. of the file, Emacs provides commands to move over them and operate on them. 
  6406.  
  6407. C-x [ 
  6408.           Move point to previous page boundary (backward-page). 
  6409.  
  6410. C-x ] 
  6411.           Move point to next page boundary (forward-page). 
  6412.  
  6413. C-x C-p 
  6414.           Put point and mark around this page (or another page) (mark-page). 
  6415.  
  6416. C-x l 
  6417.           Count the lines in this page (count-lines-page). 
  6418.  
  6419.  The C-x [ (backward-page) command moves point to immediately after the 
  6420. previous page delimiter.  If point is already right after a page delimiter, it 
  6421. skips that one and stops at the previous one.  A numeric argument serves as a 
  6422. repeat count.  The C-x ] (forward-page) command moves forward past the next 
  6423. page delimiter. 
  6424.  
  6425.  The C-x C-p command (mark-page) puts point at the beginning of the current 
  6426. page and the mark at the end.  The page delimiter at the end is included (the 
  6427. mark follows it).  The page delimiter at the front is excluded (point follows 
  6428. it).  This command can be followed by C-w to kill a page which is to be moved 
  6429. elsewhere.  If it is inserted after a page delimiter, at a place where C-x ] or 
  6430. C-x [ would take you, then the page will be properly delimited before and after 
  6431. once again. 
  6432.  
  6433.  A numeric argument to C-x C-p is used to specify which page to go to, relative 
  6434. to the current one.  Zero means the current page.  One means the next page, and 
  6435. -1 means the previous one. 
  6436.  
  6437.  The C-x l command (count-lines-page) is good for deciding where to break a 
  6438. page in two.  It prints in the echo area the total number of lines in the 
  6439. current page, and then divides it up into those preceding the current line and 
  6440. those following, as in 
  6441.  
  6442. Page has 96 (72+25) lines
  6443.  
  6444.  Notice that the sum is off by one; this is correct if point is not at the 
  6445. beginning of a line. 
  6446.  
  6447.  The variable page-delimiter controls where pages begin.  Its value is a regexp 
  6448. that matches the beginning of a line that separates pages.  The normal value of 
  6449. this variable is "^\f", which matches a formfeed character at the beginning of 
  6450. a line. 
  6451.  
  6452.  
  6453. ΓòÉΓòÉΓòÉ 24.5. Filling Text ΓòÉΓòÉΓòÉ
  6454.  
  6455.  With Auto Fill mode, text can be filled (broken up into lines that fit in a 
  6456. specified width) as you insert it.  If you alter existing text it may no longer 
  6457. be properly filled; then you can use the explicit fill commands to fill the 
  6458. paragraph again. 
  6459.  
  6460.  
  6461. ΓòÉΓòÉΓòÉ 24.5.1. Auto Fill Mode ΓòÉΓòÉΓòÉ
  6462.  
  6463.  Auto Fill mode is a minor mode in which lines are broken automatically when 
  6464. they become too wide.  Breaking happens only when you type a SPC or RET. 
  6465.  
  6466. M-x auto-fill-mode 
  6467.           Enable or disable Auto Fill mode. 
  6468.  
  6469. SPC 
  6470. RET 
  6471.           In Auto Fill mode, break lines when appropriate. 
  6472.  
  6473.  M-x auto-fill-mode turns Auto Fill mode on if it was off, or off if it was on. 
  6474. With a positive numeric argument it always turns Auto Fill mode on, and with a 
  6475. negative argument always turns it off.  You can see when Auto Fill mode is in 
  6476. effect by the presence of the word `Fill' in the mode line, inside the 
  6477. parentheses.  Auto Fill mode is a minor mode, turned on or off for each buffer 
  6478. individually.  See Minor Modes. 
  6479.  
  6480.  In Auto Fill mode, lines are broken automatically at spaces when they get 
  6481. longer than the desired width.  Line breaking and rearrangement takes place 
  6482. only when you type SPC or RET.  If you wish to insert a space or newline 
  6483. without permitting line-breaking, type C-q SPC or C-q LFD (recall that a 
  6484. newline is really a linefeed).  Also, C-o inserts a newline without line 
  6485. breaking. 
  6486.  
  6487.  Auto Fill mode works well with Lisp mode, because when it makes a new line in 
  6488. Lisp mode it indents that line with TAB.  If a line ending in a comment gets 
  6489. too long, the text of the comment is split into two comment lines.  Optionally 
  6490. new comment delimiters are inserted at the end of the first line and the 
  6491. beginning of the second so that each line is a separate comment; the variable 
  6492. comment-multi-line controls the choice (see Comments). 
  6493.  
  6494.  Auto Fill mode does not refill entire paragraphs.  It can break lines but 
  6495. cannot merge lines.  So editing in the middle of a paragraph can result in a 
  6496. paragraph that is not correctly filled.  The easiest way to make the paragraph 
  6497. properly filled again is usually with the explicit fill commands. See Fill 
  6498. Commands. 
  6499.  
  6500.  Many users like Auto Fill mode and want to use it in all text files. The 
  6501. section on init files says how to arrange this permanently for yourself. See 
  6502. Init File. 
  6503.  
  6504.  
  6505. ΓòÉΓòÉΓòÉ 24.5.2. Explicit Fill Commands ΓòÉΓòÉΓòÉ
  6506.  
  6507. M-q 
  6508.           Fill current paragraph (fill-paragraph). 
  6509.  
  6510. C-x f 
  6511.           Set the fill column (set-fill-column). 
  6512.  
  6513. M-x fill-region 
  6514.           Fill each paragraph in the region (fill-region). 
  6515.  
  6516. M-x fill-region-as-paragraph. 
  6517.           Fill the region, considering it as one paragraph. 
  6518.  
  6519. M-s 
  6520.           Center a line. 
  6521.  
  6522.  To refill a paragraph, use the command M-q (fill-paragraph).  This operates on 
  6523. the paragraph that point is inside, or the one after point if point is between 
  6524. paragraphs. Refilling works by removing all the line-breaks, then inserting new 
  6525. ones where necessary. 
  6526.  
  6527.  The command M-s (center-line) centers the current line within the current fill 
  6528. column.  With an argument, it centers several lines individually and moves past 
  6529. them. 
  6530.  
  6531.  To refill many paragraphs, use M-x fill-region, which divides the region into 
  6532. paragraphs and fills each of them. 
  6533.  
  6534.  M-q and fill-region use the same criteria as M-h for finding paragraph 
  6535. boundaries (see Paragraphs).  For more control, you can use M-x 
  6536. fill-region-as-paragraph, which refills everything between point and mark. 
  6537. This command deletes any blank lines within the region, so separate blocks of 
  6538. text end up combined into one block. 
  6539.  
  6540.  A numeric argument to M-q causes it to justify the text as well as filling it. 
  6541. This means that extra spaces are inserted to make the right margin line up 
  6542. exactly at the fill column.  To remove the extra spaces, use M-q with no 
  6543. argument.  (Likewise for fill-region.) 
  6544.  
  6545.  When adaptive-fill-mode is non-nil (which is normally the case), if you use 
  6546. fill-region-as-paragraph on an indented paragraph and you don't have a fill 
  6547. prefix, it uses the indentation of the second line of the paragraph as the fill 
  6548. prefix.  The effect of adaptive filling is not noticeable in Text mode, because 
  6549. an indented line counts as a paragraph starter and thus each line of an 
  6550. indented paragraph is considered a paragraph of its own.  But you do notice the 
  6551. effect in Indented Text mode and some other major modes. 
  6552.  
  6553.  The maximum line width for filling is in the variable fill-column. Altering 
  6554. the value of fill-column makes it local to the current buffer; until that time, 
  6555. the default value is in effect.  The default is initially 70.  See Locals. 
  6556.  
  6557.  The easiest way to set fill-column is to use the command C-x f 
  6558. (set-fill-column).  With no argument, it sets fill-column to the current 
  6559. horizontal position of point.  With a numeric argument, it uses that as the new 
  6560. fill column. 
  6561.  
  6562.  
  6563. ΓòÉΓòÉΓòÉ 24.5.3. The Fill Prefix ΓòÉΓòÉΓòÉ
  6564.  
  6565.  To fill a paragraph in which each line starts with a special marker (which 
  6566. might be a few spaces, giving an indented paragraph), use the fill prefix 
  6567. feature.  The fill prefix is a string which Emacs expects every line to start 
  6568. with, and which is not included in filling. 
  6569.  
  6570. C-x . 
  6571.           Set the fill prefix (set-fill-prefix). 
  6572.  
  6573. M-q 
  6574.           Fill a paragraph using current fill prefix (fill-paragraph). 
  6575.  
  6576. M-x fill-individual-paragraphs 
  6577.           Fill the region, considering each change of indentation as starting a 
  6578.           new paragraph. 
  6579.  
  6580. M-x fill-nonuniform-paragraphs 
  6581.           Fill the region, considering only paragraph-separator lines as 
  6582.           starting a new paragraph. 
  6583.  
  6584.  To specify a fill prefix, move to a line that starts with the desired prefix, 
  6585. put point at the end of the prefix, and give the command C-x . 
  6586. (set-fill-prefix).  That's a period after the C-x.  To turn off the fill 
  6587. prefix, specify an empty prefix: type C-x . with point at the beginning of a 
  6588. line. 
  6589.  
  6590.  When a fill prefix is in effect, the fill commands remove the fill prefix from 
  6591. each line before filling and insert it on each line after filling. The fill 
  6592. prefix is also inserted on new lines made automatically by Auto Fill mode. 
  6593. Lines that do not start with the fill prefix are considered to start 
  6594. paragraphs, both in M-q and the paragraph commands; this is just right if you 
  6595. are using paragraphs with hanging indentation (every line indented except the 
  6596. first one).  Lines which are blank or indented once the prefix is removed also 
  6597. separate or start paragraphs; this is what you want if you are writing 
  6598. multi-paragraph comments with a comment delimiter on each line. 
  6599.  
  6600.  For example, if fill-column is 40 and you set the fill prefix to `;; ', then 
  6601. M-q in the following text 
  6602.  
  6603. ;; This is an
  6604. ;; example of a paragraph
  6605. ;; inside a Lisp-style comment.
  6606.  
  6607. produces this: 
  6608.  
  6609. ;; This is an example of a paragraph
  6610. ;; inside a Lisp-style comment.
  6611.  
  6612.  The C-o command inserts the fill prefix on new lines it creates, when you use 
  6613. it at the beginning of a line (see Blank Lines). Conversely, the command M-^ 
  6614. deletes the prefix (if it occurs) after the newline that it deletes (see 
  6615. Indentation). 
  6616.  
  6617.  You can use M-x fill-individual-paragraphs to set the fill prefix for each 
  6618. paragraph automatically.  This command divides the region into paragraphs, 
  6619. treating every change in the amount of indentation as the start of a new 
  6620. paragraph, and fills each of these paragraphs.  Thus, all the lines in one 
  6621. ``paragraph'' have the same amount of indentation.  That indentation serves as 
  6622. the fill prefix for that paragraph. 
  6623.  
  6624.  M-x fill-nonuniform-paragraphs is a similar command that divides the region 
  6625. into paragraphs in a different way.  It considers only paragraph-separating 
  6626. lines (as defined by paragraph-separate) as starting a new paragraph.  Since 
  6627. this means that the lines of one paragraph may have different amounts of 
  6628. indentation, the fill prefix used is the smallest amount of indentation of any 
  6629. of the lines of the paragraph. 
  6630.  
  6631.  The fill prefix is stored in the variable fill-prefix.  Its value is a string, 
  6632. or nil when there is no fill prefix.  This is a per-buffer variable; altering 
  6633. the variable affects only the current buffer, but there is a default value 
  6634. which you can change as well.  See Locals. 
  6635.  
  6636.  
  6637. ΓòÉΓòÉΓòÉ 24.6. Case Conversion Commands ΓòÉΓòÉΓòÉ
  6638.  
  6639.  Emacs has commands for converting either a single word or any arbitrary range 
  6640. of text to upper case or to lower case. 
  6641.  
  6642. M-l 
  6643.           Convert following word to lower case (downcase-word). 
  6644.  
  6645. M-u 
  6646.           Convert following word to upper case (upcase-word). 
  6647.  
  6648. M-c 
  6649.           Capitalize the following word (capitalize-word). 
  6650.  
  6651. C-x C-l 
  6652.           Convert region to lower case (downcase-region). 
  6653.  
  6654. C-x C-u 
  6655.           Convert region to upper case (upcase-region). 
  6656.  
  6657.  The word conversion commands are the most useful.  M-l (downcase-word) 
  6658. converts the word after point to lower case, moving past it.  Thus, repeating 
  6659. M-l converts successive words. M-u (upcase-word) converts to all capitals 
  6660. instead, while M-c (capitalize-word) puts the first letter of the word into 
  6661. upper case and the rest into lower case.  All these commands convert several 
  6662. words at once if given an argument.  They are especially convenient for 
  6663. converting a large amount of text from all upper case to mixed case, because 
  6664. you can move through the text using M-l, M-u or M-c on each word as 
  6665. appropriate, occasionally using M-f instead to skip a word. 
  6666.  
  6667.  When given a negative argument, the word case conversion commands apply to the 
  6668. appropriate number of words before point, but do not move point. This is 
  6669. convenient when you have just typed a word in the wrong case: you can give the 
  6670. case conversion command and continue typing. 
  6671.  
  6672.  If a word case conversion command is given in the middle of a word, it applies 
  6673. only to the part of the word which follows point.  This is just like what M-d 
  6674. (kill-word) does.  With a negative argument, case conversion applies only to 
  6675. the part of the word before point. 
  6676.  
  6677.  The other case conversion commands are C-x C-u (upcase-region) and C-x C-l 
  6678. (downcase-region), which convert everything between point and mark to the 
  6679. specified case.  Point and mark do not move. 
  6680.  
  6681.  The region case conversion commands upcase-region and downcase-region are 
  6682. normally disabled.  This means that they ask for confirmation if you try to use 
  6683. them.  When you confirm, you may enable the command, which means it will not 
  6684. ask for confirmation again. See Disabling. 
  6685.  
  6686.  
  6687. ΓòÉΓòÉΓòÉ 24.7. Text Mode ΓòÉΓòÉΓòÉ
  6688.  
  6689.  When you edit files of text in a human language, it's more convenient to use 
  6690. Text mode rather than Fundamental mode.  Invoke M-x text-mode to enter Text 
  6691. mode.  In Text mode, TAB runs the function tab-to-tab-stop, which allows you to 
  6692. use arbitrary tab stops set with M-x edit-tab-stops (see Tab Stops).  Features 
  6693. concerned with comments in programs are turned off except when explicitly 
  6694. invoked.  The syntax table is changed so that periods are not considered part 
  6695. of a word, while apostrophes, backspaces and underlines are. 
  6696.  
  6697.  A similar variant mode is Indented Text mode, intended for editing text in 
  6698. which most lines are indented.  This mode defines TAB to run indent-relative 
  6699. (see Indentation), and makes Auto Fill indent the lines it creates.  The result 
  6700. is that normally a line made by Auto Filling, or by LFD, is indented just like 
  6701. the previous line.  Use M-x indented-text-mode to select this mode. 
  6702.  
  6703.  Entering Text mode or Indented Text mode runs the hook text-mode-hook.  Other 
  6704. major modes related to Text mode also run this hook, followed by hooks of their 
  6705. own; this includes Nroff mode, TeX mode, Outline mode and Mail mode.  Hook 
  6706. functions on text-mode-hook can look at the value of major-mode to see which of 
  6707. these modes is actually being entered.  See Hooks. 
  6708.  
  6709.  
  6710. ΓòÉΓòÉΓòÉ 24.8. Outline Mode ΓòÉΓòÉΓòÉ
  6711.  
  6712.  Outline mode is a major mode much like Text mode but intended for editing 
  6713. outlines.  It allows you to make parts of the text temporarily invisible so 
  6714. that you can see just the overall structure of the outline.  Type M-x 
  6715. outline-mode to switch to Outline mode as the major mode of the current buffer. 
  6716. Type M-x outline-minor-mode to enable Outline mode as a minor mode in the 
  6717. current buffer. When Outline minor mode is enabled, the C-c commands of Outline 
  6718. mode replace those of the major mode. 
  6719.  
  6720.  When a line is invisible in outline mode, it does not appear on the screen. 
  6721. The screen appears exactly as if the invisible line were deleted, except that 
  6722. an ellipsis (three periods in a row) appears at the end of the previous visible 
  6723. line (only one ellipsis no matter how many invisible lines follow). 
  6724.  
  6725.  All editing commands treat the text of the invisible line as part of the 
  6726. previous visible line.  For example, C-n moves onto the next visible line. 
  6727. Killing an entire visible line, including its terminating newline, really kills 
  6728. all the following invisible lines along with it; yanking it all back yanks the 
  6729. invisible lines and they remain invisible. 
  6730.  
  6731.  Entering Outline mode runs the hook text-mode-hook followed by the hook 
  6732. outline-mode-hook (see Hooks). 
  6733.  
  6734.  
  6735. ΓòÉΓòÉΓòÉ 24.8.1. Format of Outlines ΓòÉΓòÉΓòÉ
  6736.  
  6737.  Outline mode assumes that the lines in the buffer are of two types: heading 
  6738. lines and body lines.  A heading line represents a topic in the outline. 
  6739. Heading lines start with one or more stars; the number of stars determines the 
  6740. depth of the heading in the outline structure.  Thus, a heading line with one 
  6741. star is a major topic; all the heading lines with two stars between it and the 
  6742. next one-star heading are its subtopics; and so on.  Any line that is not a 
  6743. heading line is a body line.  Body lines belong with the preceding heading 
  6744. line.  Here is an example: 
  6745.  
  6746. * Food
  6747.  
  6748. This is the body,
  6749. which says something about the topic of food.
  6750.  
  6751. ** Delicious Food
  6752.  
  6753. This is the body of the second-level header.
  6754.  
  6755. ** Distasteful Food
  6756.  
  6757. This could have
  6758. a body too, with
  6759. several lines.
  6760.  
  6761. *** Dormitory Food
  6762.  
  6763. * Shelter
  6764.  
  6765. A second first-level topic with its header line.
  6766.  
  6767.  A heading line together with all following body lines is called collectively 
  6768. an entry.  A heading line together with all following deeper heading lines and 
  6769. their body lines is called a subtree. 
  6770.  
  6771.  You can customize the criterion for distinguishing heading lines by setting 
  6772. the variable outline-regexp.  Any line whose beginning has a match for this 
  6773. regexp is considered a heading line. Matches that start within a line (not at 
  6774. the beginning) do not count. The length of the matching text determines the 
  6775. level of the heading; longer matches make a more deeply nested level.  Thus, 
  6776. for example, if a text formatter has commands `@chapter', `@section' and 
  6777. `@subsection' to divide the document into chapters and sections, you could make 
  6778. those lines count as heading lines by setting outline-regexp to 
  6779. `"@chap\\|@\\(sub\\)*section"'. Note the trick: the two words `chapter' and 
  6780. `section' are equally long, but by defining the regexp to match only `chap' we 
  6781. ensure that the length of the text matched on a chapter heading is shorter, so 
  6782. that Outline mode will know that sections are contained in chapters. This works 
  6783. as long as no other command starts with `@chap'. 
  6784.  
  6785.  Outline mode makes a line invisible by changing the newline before it into an 
  6786. ASCII control-M (code 015).  Most editing commands that work on lines treat an 
  6787. invisible line as part of the previous line because, strictly speaking, it is 
  6788. part of that line, since there is no longer a newline in between.  When you 
  6789. save the file in Outline mode, control-M characters are saved as newlines, so 
  6790. the invisible lines become ordinary lines in the file.  But saving does not 
  6791. change the visibility status of a line inside Emacs. 
  6792.  
  6793.  
  6794. ΓòÉΓòÉΓòÉ 24.8.2. Outline Motion Commands ΓòÉΓòÉΓòÉ
  6795.  
  6796.  There are some special motion commands in Outline mode that move backward and 
  6797. forward to heading lines. 
  6798.  
  6799. C-c C-n 
  6800.           Move point to the next visible heading line 
  6801.           (outline-next-visible-heading). 
  6802.  
  6803. C-c C-p 
  6804.           Move point to the previous visible heading line 
  6805.           (outline-previous-visible-heading). 
  6806.  
  6807. C-c C-f 
  6808.           Move point to the next visible heading line at the same level as the 
  6809.           one point is on (outline-forward-same-level). 
  6810.  
  6811. C-c C-b 
  6812.           Move point to the previous visible heading line at the same level 
  6813.           (outline-backward-same-level). 
  6814.  
  6815. C-c C-u 
  6816.           Move point up to a lower-level (more inclusive) visible heading line 
  6817.           (outline-up-heading). 
  6818.  
  6819.  C-c C-n (next-visible-heading) moves down to the next heading line.  C-c C-p 
  6820. (previous-visible-heading) moves similarly backward.  Both accept numeric 
  6821. arguments as repeat counts.  The names emphasize that invisible headings are 
  6822. skipped, but this is not really a special feature.  All editing commands that 
  6823. look for lines ignore the invisible lines automatically. 
  6824.  
  6825.  More powerful motion commands understand the level structure of headings. C-c 
  6826. C-f (outline-forward-same-level) and C-c C-b (outline-backward-same-level) move 
  6827. from one heading line to another visible heading at the same depth in the 
  6828. outline.  C-c C-u (outline-up-heading) moves backward to another heading that 
  6829. is less deeply nested. 
  6830.  
  6831.  
  6832. ΓòÉΓòÉΓòÉ 24.8.3. Outline Visibility Commands ΓòÉΓòÉΓòÉ
  6833.  
  6834.  The other special commands of outline mode are used to make lines visible or 
  6835. invisible.  Their names all start with hide or show. Most of them fall into 
  6836. pairs of opposites.  They are not undoable; instead, you can undo right past 
  6837. them.  Making lines visible or invisible is simply not recorded by the undo 
  6838. mechanism. 
  6839.  
  6840. M-x hide-body 
  6841.           Make all body lines in the buffer invisible. 
  6842.  
  6843. M-x show-all 
  6844.           Make all lines in the buffer visible. 
  6845.  
  6846. C-c C-h 
  6847.           Make everything under this heading invisible, not including this 
  6848.           heading itself 
  6849.            (hide-subtree). 
  6850.  
  6851. C-c C-s 
  6852.           Make everything under this heading visible, including body, 
  6853.           subheadings, and their bodies (show-subtree). 
  6854.  
  6855. M-x hide-leaves 
  6856.           Make the body of this heading line, and of all its subheadings, 
  6857.           invisible. 
  6858.  
  6859. M-x show-branches 
  6860.           Make all subheadings of this heading line, at all levels, visible. 
  6861.  
  6862. C-c C-i 
  6863.           Make immediate subheadings (one level down) of this heading line 
  6864.           visible (show-children). 
  6865.  
  6866. M-x hide-entry 
  6867.           Make this heading line's body invisible. 
  6868.  
  6869. M-x show-entry 
  6870.           Make this heading line's body visible. 
  6871.  
  6872.  Two commands that are exact opposites are M-x hide-entry and M-x show-entry. 
  6873. They are used with point on a heading line, and apply only to the body lines of 
  6874. that heading.  The subtopics and their bodies are not affected. 
  6875.  
  6876.  Two more powerful opposites are C-c C-h (hide-subtree) and C-c C-s 
  6877. (show-subtree).  Both expect to be used when point is on a heading line, and 
  6878. both apply to all the lines of that heading's subtree: its body, all its 
  6879. subheadings, both direct and indirect, and all of their bodies.  In other 
  6880. words, the subtree contains everything following this heading line, up to and 
  6881. not including the next heading of the same or higher rank. 
  6882.  
  6883.  Intermediate between a visible subtree and an invisible one is having all the 
  6884. subheadings visible but none of the body.  There are two commands for doing 
  6885. this, depending on whether you want to hide the bodies or make the subheadings 
  6886. visible.  They are M-x hide-leaves and M-x show-branches. 
  6887.  
  6888.  A little weaker than show-branches is C-c C-i (show-children).  It makes just 
  6889. the direct subheadings visible---those one level down.  Deeper subheadings 
  6890. remain invisible, if they were invisible. 
  6891.  
  6892.  Two commands have a blanket effect on the whole file.  M-x hide-body makes all 
  6893. body lines invisible, so that you see just the outline structure. M-x show-all 
  6894. makes all lines visible.  These commands can be thought of as a pair of 
  6895. opposites even though M-x show-all applies to more than just body lines. 
  6896.  
  6897.  You can turn off the use of ellipses at the ends of visible lines by setting 
  6898. selective-display-ellipses to nil.  Then there is no visible indication of the 
  6899. presence of invisible lines. 
  6900.  
  6901.  
  6902. ΓòÉΓòÉΓòÉ 24.9. Mode ΓòÉΓòÉΓòÉ
  6903.  
  6904.  TeX is a powerful text formatter written by Donald Knuth; it is also free, 
  6905. like GNU Emacs.  LaTeX is a simplified input format for TeX, implemented by TeX 
  6906. macros; it comes with TeX.  SliTeX is a special form of LaTeX. 
  6907.  
  6908.  Emacs has a special TeX mode for editing TeX input files. It provides 
  6909. facilities for checking the balance of delimiters and for invoking TeX on all 
  6910. or part of the file. 
  6911.  
  6912.  TeX mode has three variants, Plain TeX mode, LaTeX mode, and SliTeX mode 
  6913. (these three distinct major modes differ only slightly). They are designed for 
  6914. editing the three different formats.  The command M-x tex-mode looks at the 
  6915. contents of the buffer to determine whether the contents appear to be either 
  6916. LaTeX input or SliTeX input; it then selects the appropriate mode.  If it can't 
  6917. tell which is right (e.g., the buffer is empty), the variable tex-default-mode 
  6918. controls which mode is used. 
  6919.  
  6920.  When M-x tex-mode does not guess right, you can use the commands M-x 
  6921. plain-tex-mode, M-x latex-mode, and M-x slitex-mode to select explicitly the 
  6922. particular variants of TeX mode. 
  6923.  
  6924.  
  6925. ΓòÉΓòÉΓòÉ 24.9.1. Editing Commands ΓòÉΓòÉΓòÉ
  6926.  
  6927.  Here are the special commands provided in TeX mode for editing the text of the 
  6928. file. 
  6929.  
  6930.           Insert, according to context, either ```' or `"' or `''' 
  6931.           (tex-insert-quote). 
  6932.  
  6933. LFD 
  6934.           Insert a paragraph break (two newlines) and check the previous 
  6935.           paragraph for unbalanced braces or dollar signs 
  6936.           (tex-terminate-paragraph). 
  6937.  
  6938. M-x validate-tex-region 
  6939.           Check each paragraph in the region for unbalanced braces or dollar 
  6940.           signs. 
  6941.  
  6942. C-c { 
  6943.           Insert `{}' and position point between them (tex-insert-braces). 
  6944.  
  6945. C-c } 
  6946.           Move forward past the next unmatched close brace (up-list). 
  6947.  
  6948.  In TeX, the character `"' is not normally used; we use ```' to start a 
  6949. quotation and `''' to end one.  To make editing easier under this formatting 
  6950. convention, TeX mode overrides the normal meaning of the key " with a command 
  6951. that inserts a pair of single-quotes or backquotes (tex-insert-quote).  To be 
  6952. precise, this command inserts ```' after whitespace or an open brace, `"' after 
  6953. a backslash, and `''' after any other character. 
  6954.  
  6955.  If you need the character `"' itself in unusual contexts, use C-q to insert 
  6956. it.  Also, " with a numeric argument always inserts that number of `"' 
  6957. characters. 
  6958.  
  6959.  In TeX mode, `$' has a special syntax code which attempts to understand the 
  6960. way TeX math mode delimiters match.  When you insert a `$' that is meant to 
  6961. exit math mode, the position of the matching `$' that entered math mode is 
  6962. displayed for a second.  This is the same feature that displays the open brace 
  6963. that matches a close brace that is inserted.  However, there is no way to tell 
  6964. whether a `$' enters math mode or leaves it; so when you insert a `$' that 
  6965. enters math mode, the previous `$' position is shown as if it were a match, 
  6966. even though they are actually unrelated. 
  6967.  
  6968.  TeX uses braces as delimiters that must match.  Some users prefer to keep 
  6969. braces balanced at all times, rather than inserting them singly.  Use C-c { 
  6970. (tex-insert-braces) to insert a pair of braces.  It leaves point between the 
  6971. two braces so you can insert the text that belongs inside.  Afterward, use the 
  6972. command C-c } (up-list) to move forward past the close brace. 
  6973.  
  6974.  There are two commands for checking the matching of braces.  LFD 
  6975. (tex-terminate-paragraph) checks the paragraph before point, and inserts two 
  6976. newlines to start a new paragraph.  It prints a message in the echo area if any 
  6977. mismatch is found.  M-x validate-tex-region checks a region, paragraph by 
  6978. paragraph.  When it finds a paragraph that contains a mismatch, it displays 
  6979. point at the beginning of the paragraph for a few seconds and pushes a mark at 
  6980. that spot.  Scanning continues until the whole buffer has been checked or until 
  6981. you type another key. The positions of the last several paragraphs with 
  6982. mismatches can be found in the mark ring (see Mark Ring). 
  6983.  
  6984.  Note that Emacs commands count square brackets and parentheses in TeX mode, 
  6985. not just braces.  This is not strictly correct for the purpose of checking TeX 
  6986. syntax.  However, parentheses and square brackets are likely to be used in text 
  6987. as matching delimiters and it is useful for the various motion commands and 
  6988. automatic match display to work with them. 
  6989.  
  6990.  
  6991. ΓòÉΓòÉΓòÉ 24.9.2. La Editing Commands ΓòÉΓòÉΓòÉ
  6992.  
  6993.  LaTeX mode provides a few extra features not applicable to plain TeX. 
  6994.  
  6995. C-c C-o 
  6996.           Insert `\begin' and `\end' for LaTeX block and position point on a 
  6997.           line between them. (tex-latex-block). 
  6998.  
  6999. C-c C-e 
  7000.           Close the last unended block for LaTeX (tex-close-latex-block). 
  7001.  
  7002.  In LaTeX input, `\begin' and `\end' commands are used to group blocks of text. 
  7003. To insert a `\begin' and a matching `\end' (on a new line following the 
  7004. `\begin'), use C-c C-o (tex-latex-block).  A blank line is inserted between the 
  7005. two, and point is left there. 
  7006.  
  7007.  Emacs knows all of the standard LaTeX block names and will permissively 
  7008. complete a partially entered block name (see Completion).  You can add your own 
  7009. list of block names to those known by Emacs with the variable 
  7010. latex-block-names.  For example, to add `theorem', `corollary', and `proof', 
  7011. include the line 
  7012.  
  7013. (setq latex-block-names '("theorem" "corollary" "proof"))
  7014.  
  7015. to your `.emacs' file. 
  7016.  
  7017.  In LaTeX input, `\begin' and `\end' commands must balance. You can use C-c C-e 
  7018. (tex-close-latex-block) to insert automatically a matching `\end' to match the 
  7019. last unmatched `\begin'. The `\end' will be indented to match the corresponding 
  7020. `\begin'. The `\end' will be followed by a newline if point is at the beginning 
  7021. of a line. 
  7022.  
  7023.  
  7024. ΓòÉΓòÉΓòÉ 24.9.3. Printing Commands ΓòÉΓòÉΓòÉ
  7025.  
  7026.  You can invoke TeX as an inferior of Emacs on either the entire contents of 
  7027. the buffer or just a region at a time.  Running TeX in this way on just one 
  7028. chapter is a good way to see what your changes look like without taking the 
  7029. time to format the entire file. 
  7030.  
  7031. C-c C-r 
  7032.           Invoke TeX on the current region, together with the buffer's header 
  7033.           (tex-region). 
  7034.  
  7035. C-c C-b 
  7036.           Invoke TeX on the entire current buffer (tex-buffer). 
  7037.  
  7038. C-c TAB 
  7039.           Invoke BibTeX on the current file (tex-bibtex-file). 
  7040.  
  7041. C-c C-f 
  7042.           Invoke TeX on the current file (tex-file). 
  7043.  
  7044. C-c C-l 
  7045.           Recenter the window showing output from the inferior TeX so that the 
  7046.           last line can be seen (tex-recenter-output-buffer). 
  7047.  
  7048. C-c C-k 
  7049.           Kill the TeX subprocess (tex-kill-job). 
  7050.  
  7051. C-c C-p 
  7052.           Print the output from the last C-c C-r, C-c C-b, or C-c C-f command 
  7053.           (tex-print). 
  7054.  
  7055. C-c C-v 
  7056.           Preview the output from the last C-c C-r, C-c C-b, or C-c C-f command 
  7057.           (tex-view). 
  7058.  
  7059. C-c C-q 
  7060.           Show the printer queue (tex-show-print-queue). 
  7061.  
  7062.  You can pass the current buffer through an inferior TeX by means of C-c C-b 
  7063. (tex-buffer).  The formatted output appears in a temporary; to print it, type 
  7064. C-c C-p (tex-print). Afterward use C-c C-q (tex-show-print-queue) to view the 
  7065. progress of your output towards being printed. If your terminal has the ability 
  7066. to display TeX output files, you can preview the output on the terminal with 
  7067. C-c C-v (tex-view). 
  7068.  
  7069.  You can specify the directory to use for running TeX by setting the variable 
  7070. tex-directory.  "." is the default value.  If your environment variable 
  7071. TEXINPUTS contains relative directory names, or if your files contains `\input' 
  7072. commands with relative file names, then tex-directory must be "." or you will 
  7073. get the wrong results.  Otherwise, it is safe to specify some other directory, 
  7074. such as `/tmp'. 
  7075.  
  7076.  If you want to specify which shell commands are used in the inferior TeX, you 
  7077. can do so by setting the values of the variables tex-run-command, 
  7078. latex-run-command, slitex-run-command, tex-dvi-print-command, 
  7079. tex-dvi-view-command, and tex-show-queue-command.  You must set the value of 
  7080. tex-dvi-view-command for your particular terminal; this variable has no default 
  7081. value.  The other variables have default values that may (or may not) be 
  7082. appropriate for your system. 
  7083.  
  7084.  Normally, the file name given to these commands comes at the end of the 
  7085. command string; for example, `latex filename'.  In some cases, however, the 
  7086. file name needs to be embedded in the command; an example is when you need to 
  7087. provide the file name as an argument to one command whose output is piped to 
  7088. another.  You can specify where to put the file name with `*' in the command 
  7089. string.  For example, 
  7090.  
  7091. (setq tex-dvi-print-command "dvips -f * | lpr")
  7092.  
  7093.  The terminal output from TeX, including any error messages, appears in a 
  7094. buffer called `*tex-shell*'.  If TeX gets an error, you can switch to this 
  7095. buffer and feed it input (this works as in Shell mode; see Interactive Shell). 
  7096. Without switching to this buffer you can scroll it so that its last line is 
  7097. visible by typing C-c C-l. 
  7098.  
  7099.  Type C-c C-k (tex-kill-job) to kill the TeX process if you see that its output 
  7100. is no longer useful.  Using C-c C-b or C-c C-r also kills any TeX process still 
  7101. running. 
  7102.  
  7103.  You can also pass an arbitrary region through an inferior TeX by typing C-c 
  7104. C-r (tex-region).  This is tricky, however, because most files of TeX input 
  7105. contain commands at the beginning to set parameters and define macros, without 
  7106. which no later part of the file will format correctly.  To solve this problem, 
  7107. C-c C-r allows you to designate a part of the file as containing essential 
  7108. commands; it is included before the specified region as part of the input to 
  7109. TeX.  The designated part of the file is called the header. 
  7110.  
  7111.  To indicate the bounds of the header in Plain TeX mode, you insert two special 
  7112. strings in the file.  Insert `%**start of header' before the header, and 
  7113. `%**end of header' after it.  Each string must appear entirely on one line, but 
  7114. there may be other text on the line before or after.  The lines containing the 
  7115. two strings are included in the header. If `%**start of header' does not appear 
  7116. within the first 100 lines of the buffer, C-c C-r assumes that there is no 
  7117. header. 
  7118.  
  7119.  In LaTeX mode, the header begins with `\documentstyle' and ends with 
  7120. `\begin{document}'.  These are commands that LaTeX requires you to use in any 
  7121. case, so nothing special needs to be done to identify the header. 
  7122.  
  7123.  The commands (tex-buffer) and (tex-region) do all of their work in a temporary 
  7124. directory, and do not have available any of the auxiliary files needed by TeX 
  7125. for cross-references; these commands are generally not suitable for running the 
  7126. final copy in which all of the cross-references need to be correct.  When you 
  7127. want the auxiliary files, use C-c C-f (tex-file) which runs TeX on the current 
  7128. buffer's file, in that file's directory.  Before TeX runs, you will be asked 
  7129. about saving any modified buffers.  Generally, you need to use (tex-file) twice 
  7130. to get cross-references correct. 
  7131.  
  7132.  For LaTeX files, you can use BibTeX to process the auxiliary file for the 
  7133. current buffer's file.  BibTeX looks up bibliographic citations in a data base 
  7134. and prepares the cited references for the bibliography section.  The command 
  7135. C-c TAB (tex-bibtex-file) runs the shell command (tex-bibtex-command) to 
  7136. produce a `.bbl' file for the current buffer's file.  Generally, you need to do 
  7137. C-c C-f (tex-file) once to generate the `.aux' file, then do C-c TAB 
  7138. (tex-bibtex-file), and then repeat C-c C-f (tex-file) twice more to get the 
  7139. cross-references correct. 
  7140.  
  7141.  Entering any kind of TeX mode runs the hooks text-mode-hook and tex-mode-hook. 
  7142. Then it runs either plain-tex-mode-hook or latex-mode-hook, whichever is 
  7143. appropriate.  For SliTeX files, it calls slitex-mode-hook. Starting the TeX 
  7144. shell runs the hook tex-shell-hook. See Hooks. 
  7145.  
  7146.  
  7147. ΓòÉΓòÉΓòÉ 24.9.4. Unix  Distribution ΓòÉΓòÉΓòÉ
  7148.  
  7149. TeX for Unix systems can be obtained from the University of Washington for a 
  7150. distribution fee. 
  7151.  
  7152. To order a full distribution, send $200.00 for a 1/2-inch 9-track 1600 bpi (tar 
  7153. or cpio) tape reel, or $210.00 for a 1/4-inch 4-track QIC-24 (tar or cpio) 
  7154. cartridge, payable to the University of Washington to: 
  7155.  
  7156. Northwest Computing Support Center
  7157. DR-10, Thomson Hall 35
  7158. University of Washington
  7159. Seattle, Washington 98195
  7160.  
  7161. Purchase orders are acceptable, but there is an extra charge of $10.00, to pay 
  7162. for processing charges. 
  7163.  
  7164. For overseas orders please add $20.00 to the base cost for shipment via air 
  7165. parcel post, or $30.00 for shipment via courier. 
  7166.  
  7167.  The normal distribution is a tar tape, blocked 20, 1600 bpi, on an industry 
  7168. standard 2400 foot half-inch reel.  The physical format for the 1/4 inch 
  7169. streamer cartridges uses QIC-11, 8000 bpi, 4-track serpentine recording for the 
  7170. SUN.  Also, System V tapes can be written in cpio format, blocked 5120 bytes, 
  7171. ASCII headers. 
  7172.  
  7173.  
  7174. ΓòÉΓòÉΓòÉ 24.10. Nroff Mode ΓòÉΓòÉΓòÉ
  7175.  
  7176.  Nroff mode is a mode like Text mode but modified to handle nroff commands 
  7177. present in the text.  Invoke M-x nroff-mode to enter this mode.  It differs 
  7178. from Text mode in only a few ways.  All nroff command lines are considered 
  7179. paragraph separators, so that filling will never garble the nroff commands. 
  7180. Pages are separated by `.bp' commands.  Comments start with 
  7181. backslash-doublequote.  Also, three special commands are provided that are not 
  7182. in Text mode: 
  7183.  
  7184. M-n 
  7185.           Move to the beginning of the next line that isn't an nroff command 
  7186.           (forward-text-line).  An argument is a repeat count. 
  7187.  
  7188. M-p 
  7189.           Like M-n but move up (backward-text-line). 
  7190.  
  7191. M-? 
  7192.           Prints in the echo area the number of text lines (lines that are not 
  7193.           nroff commands) in the region (count-text-lines). 
  7194.  
  7195.  The other feature of Nroff mode is that you can turn on Electric Nroff mode. 
  7196. This is a minor mode that you can turn on or off with M-x electric-nroff-mode 
  7197. (see Minor Modes).  When the mode is on, each time you use RET to end a line 
  7198. that contains an nroff command that opens a kind of grouping, the matching 
  7199. nroff command to close that grouping is automatically inserted on the following 
  7200. line.  For example, if you are at the beginning of a line and type . ( b RET, 
  7201. this inserts the matching command `.)b' on a new line following point. 
  7202.  
  7203.  Entering Nroff mode runs the hook text-mode-hook, followed by the hook 
  7204. nroff-mode-hook (see Hooks). 
  7205.  
  7206.  
  7207. ΓòÉΓòÉΓòÉ 25. Editing Programs ΓòÉΓòÉΓòÉ
  7208.  
  7209.  Emacs has many commands designed to understand the syntax of programming 
  7210. languages such as Lisp and C.  These commands can 
  7211.  
  7212. o Move over or kill balanced expressions or sexps (see Lists). 
  7213.  
  7214. o Move over or mark top-level expressions---defuns, in Lisp; functions, in C 
  7215.   (see Defuns). 
  7216.  
  7217. o Show how parentheses balance (see Matching). 
  7218.  
  7219. o Insert, kill or align comments (see Comments). 
  7220.  
  7221. o Follow the usual indentation conventions of the language (see Program 
  7222.   Indent). 
  7223.  
  7224.  The commands for words, sentences and paragraphs are very useful in editing 
  7225. code even though their canonical application is for editing human language 
  7226. text.  Most symbols contain words (see Words); sentences can be found in 
  7227. strings and comments (see Sentences). Paragraphs per se don't exist in code, 
  7228. but the paragraph commands are useful anyway, because programming language 
  7229. major modes define paragraphs to begin and end at blank lines (see Paragraphs). 
  7230. Judicious use of blank lines to make the program clearer will also provide 
  7231. interesting chunks of text for the paragraph commands to work on. 
  7232.  
  7233.  The selective display feature is useful for looking at the overall structure 
  7234. of a function (see Selective Display).  This feature causes only the lines that 
  7235. are indented less than a specified amount to appear on the screen. 
  7236.  
  7237.  
  7238. ΓòÉΓòÉΓòÉ 25.1. Major Modes for Programming Languages ΓòÉΓòÉΓòÉ
  7239.  
  7240.  Emacs also has major modes for the programming languages Lisp, Scheme (a 
  7241. variant of Lisp), Awk, C, C++, Perl, Icon, Fortran and Muddle (another variant 
  7242. of Lisp).  There is also a major mode for makefiles, called Makefile mode. 
  7243.  
  7244.  Ideally, a major mode should be implemented for each programming language that 
  7245. you might want to edit with Emacs; but often the mode for one language can 
  7246. serve for other syntactically similar languages.  The language modes that exist 
  7247. are those that someone decided to take the trouble to write. 
  7248.  
  7249.  There are several forms of Lisp mode, which differ in the way they interface 
  7250. to Lisp execution.  See Executing Lisp. 
  7251.  
  7252.  Each of the programming language modes defines the TAB key to run an 
  7253. indentation function that knows the indentation conventions of that language 
  7254. and updates the current line's indentation accordingly.  For example, in C mode 
  7255. TAB is bound to c-indent-line.  LFD is normally defined to do RET followed by 
  7256. TAB; thus, it too indents in a mode-specific fashion. 
  7257.  
  7258.  In most programming languages, indentation is likely to vary from line to 
  7259. line.  So the major modes for those languages rebind DEL to treat a tab as if 
  7260. it were the equivalent number of spaces (using the command 
  7261. backward-delete-char-untabify).  This makes it possible to rub out indentation 
  7262. one column at a time without worrying whether it is made up of spaces or tabs. 
  7263. Use C-b C-d to delete a tab character before point, in these modes. 
  7264.  
  7265.  Programming language modes define paragraphs to be separated only by blank 
  7266. lines, so that the paragraph commands remain useful.  Auto Fill mode, if 
  7267. enabled in a programming language major mode, indents the new lines which it 
  7268. creates. 
  7269.  
  7270.  Turning on a major mode runs a normal hook called the mode hook, which is the 
  7271. value of a Lisp variable.  For example, turning on C mode runs the hook 
  7272. c-mode-hook.  Mode hook variables for other programming language modes include 
  7273. lisp-mode-hook, emacs-lisp-mode-hook, lisp-interaction-mode-hook, 
  7274. scheme-mode-hook and muddle-mode-hook.  See Hooks. 
  7275.  
  7276.  
  7277. ΓòÉΓòÉΓòÉ 25.2. Lists and Sexps ΓòÉΓòÉΓòÉ
  7278.  
  7279.  By convention, Emacs keys for dealing with balanced expressions are usually 
  7280. Control-Meta characters.  They tend to be analogous in function to their 
  7281. Control and Meta equivalents.  These commands are usually thought of as 
  7282. pertaining to expressions in programming languages, but can be useful with any 
  7283. language in which some sort of parentheses exist (including human languages). 
  7284.  
  7285.  These commands fall into two classes.  Some deal only with lists 
  7286. (parenthetical groupings).  They see nothing except parentheses, brackets, 
  7287. braces (whichever ones must balance in the language you are working with), and 
  7288. escape characters that might be used to quote those. 
  7289.  
  7290.  The other commands deal with expressions or sexps.  The word `sexp' is derived 
  7291. from s-expression, the ancient term for an expression in Lisp.  But in Emacs, 
  7292. the notion of `sexp' is not limited to Lisp.  It refers to an expression in 
  7293. whatever language your program is written in. Each programming language has its 
  7294. own major mode, which customizes the syntax tables so that expressions in that 
  7295. language count as sexps. 
  7296.  
  7297.  Sexps typically include symbols, numbers, and string constants, as well as 
  7298. anything contained in parentheses, brackets or braces. 
  7299.  
  7300.  In languages that use prefix and infix operators, such as C, it is not 
  7301. possible for all expressions to be sexps.  For example, C mode does not 
  7302. recognize `foo + bar' as a sexp, even though it is a C expression; it 
  7303. recognizes `foo' as one sexp and `bar' as another, with the `+' as punctuation 
  7304. between them.  This is a fundamental ambiguity: both `foo + bar' and `foo' are 
  7305. legitimate choices for the sexp to move over if point is at the `f'.  Note that 
  7306. `(foo + bar)' is a single sexp in C mode. 
  7307.  
  7308.  Some languages have obscure forms of syntax for expressions that nobody has 
  7309. bothered to make Emacs understand properly. 
  7310.  
  7311.  
  7312. ΓòÉΓòÉΓòÉ 25.3. List And Sexp Commands ΓòÉΓòÉΓòÉ
  7313.  
  7314. C-M-f 
  7315.           Move forward over a sexp (forward-sexp). 
  7316.  
  7317. C-M-b 
  7318.           Move backward over a sexp (backward-sexp). 
  7319.  
  7320. C-M-k 
  7321.           Kill sexp forward (kill-sexp). 
  7322.  
  7323. C-M-u 
  7324.           Move up and backward in list structure (backward-up-list). 
  7325.  
  7326. C-M-d 
  7327.           Move down and forward in list structure (down-list). 
  7328.  
  7329. C-M-n 
  7330.           Move forward over a list (forward-list). 
  7331.  
  7332. C-M-p 
  7333.           Move backward over a list (backward-list). 
  7334.  
  7335. C-M-t 
  7336.           Transpose expressions (transpose-sexps). 
  7337.  
  7338. C-M-@ 
  7339.           Put mark after following expression (mark-sexp). 
  7340.  
  7341.  To move forward over a sexp, use C-M-f (forward-sexp).  If the first 
  7342. significant character after point is an opening delimiter (`(' in Lisp; `(', 
  7343. `[' or `{' in C), C-M-f moves past the matching closing delimiter.  If the 
  7344. character begins a symbol, string, or number, C-M-f moves over that. 
  7345.  
  7346.  The command C-M-b (backward-sexp) moves backward over a sexp.  The detailed 
  7347. rules are like those above for C-M-f, but with directions reversed.  If there 
  7348. are any prefix characters (single-quote, backquote and comma, in Lisp) 
  7349. preceding the sexp, C-M-b moves back over them as well.  The sexp commands move 
  7350. across comments as if they were whitespace in most modes. 
  7351.  
  7352.  C-M-f or C-M-b with an argument repeats that operation the specified number of 
  7353. times; with a negative argument, it moves in the opposite direction. 
  7354.  
  7355.  Killing a sexp at a time can be done with C-M-k (kill-sexp). C-M-k kills the 
  7356. characters that C-M-f would move over. 
  7357.  
  7358.  The list commands move over lists like the sexp commands but skip blithely 
  7359. over any number of other kinds of sexps (symbols, strings, etc). They are C-M-n 
  7360. (forward-list) and C-M-p (backward-list).  The main reason they are useful is 
  7361. that they usually ignore comments (since the comments usually do not contain 
  7362. any lists). 
  7363.  
  7364.  C-M-n and C-M-p stay at the same level in parentheses, when that's possible. 
  7365. To move up one (or n) levels, use C-M-u (backward-up-list). C-M-u moves 
  7366. backward up past one unmatched opening delimiter.  A positive argument serves 
  7367. as a repeat count; a negative argument reverses direction of motion and also 
  7368. requests repetition, so it moves forward and up one or more levels. 
  7369.  
  7370.  To move down in list structure, use C-M-d (down-list).  In Lisp mode, where 
  7371. `(' is the only opening delimiter, this is nearly the same as searching for a 
  7372. `('.  An argument specifies the number of levels of parentheses to go down. 
  7373.  
  7374.  A somewhat random-sounding command which is nevertheless handy is C-M-t 
  7375. (transpose-sexps), which drags the previous sexp across the next one.  An 
  7376. argument serves as a repeat count, and a negative argument drags backwards 
  7377. (thus canceling out the effect of C-M-t with a positive argument).  An argument 
  7378. of zero, rather than doing nothing, transposes the sexps ending after point and 
  7379. the mark. 
  7380.  
  7381.  To make the region be the next sexp in the buffer, use C-M-@ (mark-sexp) which 
  7382. sets mark at the same place that C-M-f would move to.  C-M-@ takes arguments 
  7383. like C-M-f.  In particular, a negative argument is useful for putting the mark 
  7384. at the beginning of the previous sexp. 
  7385.  
  7386.  The list and sexp commands' understanding of syntax is completely controlled 
  7387. by the syntax table.  Any character can, for example, be declared to be an 
  7388. opening delimiter and act like an open parenthesis. See Syntax. 
  7389.  
  7390.  
  7391. ΓòÉΓòÉΓòÉ 25.4. Defuns ΓòÉΓòÉΓòÉ
  7392.  
  7393.  In Emacs, a parenthetical grouping at the top level in the buffer is called a 
  7394. defun.  The name derives from the fact that most top-level lists in a Lisp file 
  7395. are instances of the special form defun, but any top-level parenthetical 
  7396. grouping counts as a defun in Emacs parlance regardless of what its contents 
  7397. are, and regardless of the programming language in use.  For example, in C, the 
  7398. body of a function definition is a defun. 
  7399.  
  7400. C-M-a 
  7401.           Move to beginning of current or preceding defun (beginning-of-defun). 
  7402.  
  7403. C-M-e 
  7404.           Move to end of current or following defun (end-of-defun). 
  7405.  
  7406. C-M-h 
  7407.           Put region around whole current or following defun (mark-defun). 
  7408.  
  7409.  The commands to move to the beginning and end of the current defun are C-M-a 
  7410. (beginning-of-defun) and C-M-e (end-of-defun). 
  7411.  
  7412.  If you wish to operate on the current defun, use C-M-h (mark-defun) which puts 
  7413. point at the beginning and mark at the end of the current or next defun.  For 
  7414. example, this is the easiest way to get ready to move the defun to a different 
  7415. place in the text.  In C mode, C-M-h runs the function mark-c-function, which 
  7416. is almost the same as mark-defun; the difference is that it backs up over the 
  7417. argument declarations, function name and returned data type so that the entire 
  7418. C function is inside the region.  See Marking Objects. 
  7419.  
  7420.  Emacs assumes that any open-parenthesis found in the leftmost column is the 
  7421. start of a defun.  Therefore, *never put an open-parenthesis at the left margin 
  7422. in a Lisp file unless it is the start of a top level list.  Never put an 
  7423. open-brace or other opening delimiter at the beginning of a line of C code 
  7424. unless it starts the body of a function.*  The most likely problem case is when 
  7425. you want an opening delimiter at the start of a line inside a string.  To avoid 
  7426. trouble, put an escape character (`\', in C and Emacs Lisp, `/' in some other 
  7427. Lisp dialects) before the opening delimiter.  It will not affect the contents 
  7428. of the string. 
  7429.  
  7430.  In the remotest past, the original Emacs found defuns by moving upward a level 
  7431. of parentheses until there were no more levels to go up.  This always required 
  7432. scanning all the way back to the beginning of the buffer, even for a small 
  7433. function.  To speed up the operation, Emacs was changed to assume that any `(' 
  7434. (or other character assigned the syntactic class of opening-delimiter) at the 
  7435. left margin is the start of a defun.  This heuristic is nearly always right and 
  7436. avoids the costly scan; however, it mandates the convention described above. 
  7437.  
  7438.  
  7439. ΓòÉΓòÉΓòÉ 25.5. Indentation for Programs ΓòÉΓòÉΓòÉ
  7440.  
  7441.  The best way to keep a program properly indented is to use Emacs to re-indent 
  7442. it as you change it.  Emacs has commands to indent properly either a single 
  7443. line, a specified number of lines, or all of the lines inside a single 
  7444. parenthetical grouping. 
  7445.  
  7446.  
  7447. ΓòÉΓòÉΓòÉ 25.5.1. Basic Program Indentation Commands ΓòÉΓòÉΓòÉ
  7448.  
  7449. TAB 
  7450.           Adjust indentation of current line. 
  7451.  
  7452. LFD 
  7453.           Equivalent to RET followed by TAB (newline-and-indent). 
  7454.  
  7455.  The basic indentation command is TAB, which gives the current line the correct 
  7456. indentation as determined from the previous lines.  The function that TAB runs 
  7457. depends on the major mode; it is lisp-indent-line in Lisp mode, c-indent-line 
  7458. in C mode, etc.  These functions understand different syntaxes for different 
  7459. languages, but they all do about the same thing.  TAB in any programming 
  7460. language major mode inserts or deletes whitespace at the beginning of the 
  7461. current line, independent of where point is in the line.  If point is inside 
  7462. the whitespace at the beginning of the line, TAB leaves it at the end of that 
  7463. whitespace; otherwise, TAB leaves point fixed with respect to the characters 
  7464. around it. 
  7465.  
  7466.  Use C-q TAB to insert a tab at point. 
  7467.  
  7468.  When entering a large amount of new code, use LFD (newline-and-indent), which 
  7469. is equivalent to a RET followed by a TAB.  LFD creates a blank line, and then 
  7470. gives it the appropriate indentation. 
  7471.  
  7472.  TAB indents the second and following lines of the body of a parenthetical 
  7473. grouping each under the preceding one; therefore, if you alter one line's 
  7474. indentation to be nonstandard, the lines below will tend to follow it.  This is 
  7475. the right behavior in cases where the standard result of TAB is unaesthetic. 
  7476.  
  7477.  Remember that an open-parenthesis, open-brace or other opening delimiter at 
  7478. the left margin is assumed by Emacs (including the indentation routines) to be 
  7479. the start of a function.  Therefore, you must never have an opening delimiter 
  7480. in column zero that is not the beginning of a function, not even inside a 
  7481. string.  This restriction is vital for making the indentation commands fast; 
  7482. you must simply accept it.  See Defuns, for more information on this. 
  7483.  
  7484.  
  7485. ΓòÉΓòÉΓòÉ 25.5.2. Indenting Several Lines ΓòÉΓòÉΓòÉ
  7486.  
  7487.  When you wish to re-indent several lines of code which have been altered or 
  7488. moved to a different level in the list structure, you have several commands 
  7489. available. 
  7490.  
  7491. C-M-q 
  7492.           Re-indent all the lines within one list (indent-sexp). 
  7493.  
  7494. C-u TAB 
  7495.           Shift an entire list rigidly sideways so that its first line is 
  7496.           properly indented. 
  7497.  
  7498. C-M-\ 
  7499.           Re-indent all lines in the region (indent-region). 
  7500.  
  7501.  You can re-indent the contents of a single list by positioning point before 
  7502. the beginning of it and typing C-M-q (indent-sexp in Lisp mode, indent-c-exp in 
  7503. C mode; also bound to other suitable commands in other modes).  The indentation 
  7504. of the line the sexp starts on is not changed; therefore, only the relative 
  7505. indentation within the list, and not its position, is changed.  To correct the 
  7506. position as well, type a TAB before the C-M-q. 
  7507.  
  7508.  If the relative indentation within a list is correct but the indentation of 
  7509. its beginning is not, go to the line the list begins on and type C-u TAB.  When 
  7510. TAB is given a numeric argument, it moves all the lines in the grouping 
  7511. starting on the current line sideways the same amount that the current line 
  7512. moves.  It is clever, though, and does not move lines that start inside 
  7513. strings, or C preprocessor lines when in C mode. 
  7514.  
  7515.  Another way to specify the range to be re-indented is with point and mark. 
  7516. The command C-M-\ (indent-region) applies TAB to every line whose first 
  7517. character is between point and mark. 
  7518.  
  7519.  
  7520. ΓòÉΓòÉΓòÉ 25.5.3. Customizing Lisp Indentation ΓòÉΓòÉΓòÉ
  7521.  
  7522.  The indentation pattern for a Lisp expression can depend on the function 
  7523. called by the expression.  For each Lisp function, you can choose among several 
  7524. predefined patterns of indentation, or define an arbitrary one with a Lisp 
  7525. program. 
  7526.  
  7527.  The standard pattern of indentation is as follows: the second line of the 
  7528. expression is indented under the first argument, if that is on the same line as 
  7529. the beginning of the expression; otherwise, the second line is indented 
  7530. underneath the function name.  Each following line is indented under the 
  7531. previous line whose nesting depth is the same. 
  7532.  
  7533.  If the variable lisp-indent-offset is non-nil, it overrides the usual 
  7534. indentation pattern for the second line of an expression, so that such lines 
  7535. are always indented lisp-indent-offset more columns than the containing list. 
  7536.  
  7537.  The standard pattern is overridden for certain functions.  Functions whose 
  7538. names start with def always indent the second line by lisp-body-indent extra 
  7539. columns beyond the open-parenthesis starting the expression. 
  7540.  
  7541.  The standard pattern can be overridden in various ways for individual 
  7542. functions, according to the lisp-indent-hook property of the function name. 
  7543. There are four possibilities for this property: 
  7544.  
  7545. nil 
  7546.           This is the same as no property; the standard indentation pattern is 
  7547.           used. 
  7548.  
  7549. defun 
  7550.           The pattern used for function names that start with def is used for 
  7551.           this function also. 
  7552.  
  7553. a number, number 
  7554.           The first number arguments of the function are distinguished 
  7555.           arguments; the rest are considered the body of the expression.  A 
  7556.           line in the expression is indented according to whether the first 
  7557.           argument on it is distinguished or not.  If the argument is part of 
  7558.           the body, the line is indented lisp-body-indent more columns than the 
  7559.           open-parenthesis starting the containing expression.  If the argument 
  7560.           is distinguished and is either the first or second argument, it is 
  7561.           indented twice that many extra columns. If the argument is 
  7562.           distinguished and not the first or second argument, the standard 
  7563.           pattern is followed for that line. 
  7564.  
  7565. a symbol, symbol 
  7566.           symbol should be a function name; that function is called to 
  7567.           calculate the indentation of a line within this expression.  The 
  7568.           function receives two arguments: 
  7569.  
  7570.    state 
  7571.              The value returned by parse-partial-sexp (a Lisp primitive for 
  7572.              indentation and nesting computation) when it parses up to the 
  7573.              beginning of this line. 
  7574.  
  7575.    pos 
  7576.              The position at which the line being indented begins. 
  7577.  
  7578.           It should return either a number, which is the number of columns of 
  7579.           indentation for that line, or a list whose car is such a number.  The 
  7580.           difference between returning a number and returning a list is that a 
  7581.           number says that all following lines at the same nesting level should 
  7582.           be indented just like this one; a list says that following lines 
  7583.           might call for different indentations.  This makes a difference when 
  7584.           the indentation is being computed by C-M-q; if the value is a number, 
  7585.           C-M-q need not recalculate indentation for the following lines until 
  7586.           the end of the list. 
  7587.  
  7588.  
  7589. ΓòÉΓòÉΓòÉ 25.5.4. Customizing C Indentation ΓòÉΓòÉΓòÉ
  7590.  
  7591.  Two variables control which commands perform C indentation and when. 
  7592.  
  7593.  If c-auto-newline is non-nil, newlines are inserted both before and after 
  7594. braces that you insert, and after colons and semicolons. Correct C indentation 
  7595. is done on all the lines that are made this way. 
  7596.  
  7597.  If c-tab-always-indent is nil, the TAB command in C mode does indentation only 
  7598. if point is at the left margin or within the line's indentation.  If there is 
  7599. non-whitespace to the left of point, then TAB just inserts a tab character in 
  7600. the buffer. Normally, this variable is t, and TAB always reindents the current 
  7601. line.  The default behavior means that to insert a real tab character you must 
  7602. quote it by typing C-q TAB. 
  7603.  
  7604.  C does not have anything analogous to particular function names for which 
  7605. special forms of indentation are desirable.  However, it has a different need 
  7606. for customization facilities: many different styles of C indentation are in 
  7607. common use. 
  7608.  
  7609.  There are six variables you can set to control the style that Emacs C mode 
  7610. uses. 
  7611.  
  7612. c-indent-level 
  7613.           Indentation of C statements within surrounding block.  The 
  7614.           surrounding block's indentation is the indentation of the line on 
  7615.           which the open-brace appears. 
  7616.  
  7617. c-continued-statement-offset 
  7618.           Extra indentation given to a substatement, such as the then-clause of 
  7619.           an if or body of a while. 
  7620.  
  7621. c-brace-offset 
  7622.           Extra indentation for line if it starts with an open brace. 
  7623.  
  7624. c-brace-imaginary-offset 
  7625.           An open brace following other text is treated as if it were this far 
  7626.           to the right of the start of its line. 
  7627.  
  7628. c-argdecl-indent 
  7629.           Indentation level of declarations of C function arguments. 
  7630.  
  7631. c-label-offset 
  7632.           Extra indentation for line that is a label, or case or default. 
  7633.  
  7634.  The variable c-indent-level controls the indentation for C statements with 
  7635. respect to the surrounding block.  In the example 
  7636.  
  7637.     {
  7638.       foo ();
  7639.  
  7640. the difference in indentation between the lines is c-indent-level. Its standard 
  7641. value is 2. 
  7642.  
  7643. If the open-brace beginning the compound statement is not at the beginning of 
  7644. its line, the c-indent-level is added to the indentation of the line, not the 
  7645. column of the open-brace.  For example, 
  7646.  
  7647. if (losing) {
  7648.   do_this ();
  7649.  
  7650. One popular indentation style is that which results from setting c-indent-level 
  7651. to 8 and putting open-braces at the end of a line in this way.  I prefer to put 
  7652. the open-brace on a separate line. 
  7653.  
  7654.  In fact, the value of the variable c-brace-imaginary-offset is also added to 
  7655. the indentation of such a statement.  Normally this variable is zero.  Think of 
  7656. this variable as the imaginary position of the open brace, relative to the 
  7657. first nonblank character on the line.  By setting this variable to 4 and 
  7658. c-indent-level to 0, you can get this style: 
  7659.  
  7660. if (x == y) {
  7661.     do_it ();
  7662.     }
  7663.  
  7664.  When c-indent-level is zero, the statements inside most braces will line up 
  7665. right under the open brace.  But there is an exception made for braces in 
  7666. column zero, such as surrounding a function's body.  The statements just inside 
  7667. it do not go at column zero.  Instead, c-brace-offset and 
  7668. c-continued-statement-offset (see below) are added to produce a typical offset 
  7669. between brace levels, and the statements are indented that far. 
  7670.  
  7671.  c-continued-statement-offset controls the extra indentation for a line that 
  7672. starts within a statement (but not within parentheses or brackets).  These 
  7673. lines are usually statements that are within other statements, such as the 
  7674. then-clauses of if statements and the bodies of while statements.  This 
  7675. parameter is the difference in indentation between the two lines in 
  7676.  
  7677. if (x == y)
  7678.   do_it ();
  7679.  
  7680. Its standard value is 2.  Some popular indentation styles correspond to a value 
  7681. of zero for c-continued-statement-offset. 
  7682.  
  7683.  c-brace-offset is the extra indentation given to a line that starts with an 
  7684. open-brace.  Its standard value is zero; compare 
  7685.  
  7686. if (x == y)
  7687.   {
  7688.  
  7689. with 
  7690.  
  7691. if (x == y)
  7692.   do_it ();
  7693.  
  7694. if c-brace-offset were set to 4, the first example would become 
  7695.  
  7696. if (x == y)
  7697.       {
  7698.  
  7699.  c-argdecl-indent controls the indentation of declarations of the arguments of 
  7700. a C function.  It is absolute: argument declarations receive exactly 
  7701. c-argdecl-indent spaces.  The standard value is 5, resulting in code like this: 
  7702.  
  7703. char *
  7704. index (string, c)
  7705.      char *string;
  7706.      int c;
  7707.  
  7708.  c-label-offset is the extra indentation given to a line that contains a label, 
  7709. a case statement, or a default: statement.  Its standard value is -2, resulting 
  7710. in code like this 
  7711.  
  7712. switch (c)
  7713.   {
  7714.   case 'x':
  7715.  
  7716. If c-label-offset were zero, the same code would be indented as 
  7717.  
  7718. switch (c)
  7719.   {
  7720.     case 'x':
  7721.  
  7722. This example assumes that the other variables above also have their standard 
  7723. values. 
  7724.  
  7725.  I strongly recommend that you try out the indentation style produced by the 
  7726. standard settings of these variables, together with putting open braces on 
  7727. separate lines.  You can see how it looks in all the C source files of GNU 
  7728. Emacs. 
  7729.  
  7730.  
  7731. ΓòÉΓòÉΓòÉ 25.6. Automatic Display Of Matching Parentheses ΓòÉΓòÉΓòÉ
  7732.  
  7733.  The Emacs parenthesis-matching feature is designed to show automatically how 
  7734. parentheses match in the text.  Whenever you type a self-inserting character 
  7735. that is a closing delimiter, the cursor moves momentarily to the location of 
  7736. the matching opening delimiter, provided that is on the screen.  If it is not 
  7737. on the screen, some text near it is displayed in the echo area.  Either way, 
  7738. you can tell what grouping is being closed off. 
  7739.  
  7740.  In Lisp, automatic matching applies only to parentheses.  In C, it applies to 
  7741. braces and brackets too.  Emacs knows which characters to regard as matching 
  7742. delimiters based on the syntax table, which is set by the major mode.  See 
  7743. Syntax. 
  7744.  
  7745.  If the opening delimiter and closing delimiter are mismatched---such as in 
  7746. `[x)'---a warning message is displayed in the echo area.  The correct matches 
  7747. are specified in the syntax table. 
  7748.  
  7749.  Two variables control parenthesis match display.  blink-matching-paren turns 
  7750. the feature on or off; nil turns it off, but the default is t to turn match 
  7751. display on.  blink-matching-paren-distance specifies how many characters back 
  7752. to search to find the matching opening delimiter.  If the match is not found in 
  7753. that far, scanning stops, and nothing is displayed.  This is to prevent 
  7754. scanning for the matching delimiter from wasting lots of time when there is no 
  7755. match.  The default is 12,000. 
  7756.  
  7757.  When using X Windows, you can request a more powerful kind of automatic 
  7758. parenthesis matching by loading the paren library. To load it, type M-x 
  7759. load-library RET paren RET. This library turns off the usual kind of matching 
  7760. parenthesis display and substitutes another: whenever point is after a close 
  7761. parenthesis, the close parenthesis and its matching open parenthesis are both 
  7762. highlighted; otherwise, if point is before an open parenthesis, the matching 
  7763. close parenthesis is highlighted.  (There is no need to highlight the open 
  7764. parenthesis after point because the cursor appears on top of that character.) 
  7765.  
  7766.  
  7767. ΓòÉΓòÉΓòÉ 25.7. Manipulating Comments ΓòÉΓòÉΓòÉ
  7768.  
  7769.  The comment commands insert, kill and align comments. 
  7770.  
  7771. M-; 
  7772.           Insert or align comment (indent-for-comment). 
  7773.  
  7774. C-x ; 
  7775.           Set comment column (set-comment-column). 
  7776.  
  7777. C-u - C-x ; 
  7778.           Kill comment on current line (kill-comment). 
  7779.  
  7780. M-LFD 
  7781.           Like RET followed by inserting and aligning a comment 
  7782.           (indent-new-comment-line). 
  7783.  
  7784. M-x comment-region 
  7785.           Add or remove comment delimiters on all the lines in the region. 
  7786.  
  7787.  The command that creates a comment is M-; (indent-for-comment). If there is no 
  7788. comment already on the line, a new comment is created, aligned at a specific 
  7789. column called the comment column.  The comment is created by inserting the 
  7790. string Emacs thinks comments should start with (the value of comment-start; see 
  7791. below).  Point is left after that string.  If the text of the line extends past 
  7792. the comment column, then the indentation is done to a suitable boundary 
  7793. (usually, at least one space is inserted).  If the major mode has specified a 
  7794. string to terminate comments, that is inserted after point, to keep the syntax 
  7795. valid. 
  7796.  
  7797.  M-; can also be used to align an existing comment.  If a line already contains 
  7798. the string that starts comments, then M-; just moves point after it and 
  7799. re-indents it to the conventional place.  Exception: comments starting in 
  7800. column 0 are not moved. 
  7801.  
  7802.  Some major modes have special rules for indenting certain kinds of comments in 
  7803. certain contexts.  For example, in Lisp code, comments which start with two 
  7804. semicolons are indented as if they were lines of code, instead of at the 
  7805. comment column.  Comments which start with three semicolons are supposed to 
  7806. start at the left margin.  Emacs understands these conventions by indenting a 
  7807. double-semicolon comment using TAB, and by not changing the indentation of a 
  7808. triple-semicolon comment at all. 
  7809.  
  7810. ;; This function is just an example
  7811. ;;; Here either two or three semicolons are appropriate.
  7812. (defun foo (x)
  7813. ;;; And now, the first part of the function:
  7814.   ;; The following line adds one.
  7815.   (1+ x))           ; This line adds one.
  7816.  
  7817.  In C code, a comment preceded on its line by nothing but whitespace is 
  7818. indented like a line of code. 
  7819.  
  7820.  Even when an existing comment is properly aligned, M-; is still useful for 
  7821. moving directly to the start of the comment. 
  7822.  
  7823.  C-u - C-x ; (kill-comment) kills the comment on the current line, if there is 
  7824. one.  The indentation before the start of the comment is killed as well.  If 
  7825. there does not appear to be a comment in the line, nothing is done.  To 
  7826. reinsert the comment on another line, move to the end of that line, do C-y, and 
  7827. then do M-; to realign it.  Note that C-u - C-x ; is not a distinct key; it is 
  7828. C-x ; (set-comment-column) with a negative argument.  That command is 
  7829. programmed so that when it receives a negative argument it calls kill-comment. 
  7830. However, kill-comment is a valid command which you could bind directly to a key 
  7831. if you wanted to. 
  7832.  
  7833.  The M-x comment-region command adds comment delimiters to the lines that start 
  7834. in the region, thus commenting them out.  With a negative argument, it does the 
  7835. opposite---it deletes comment delimiters from the lines in the region. 
  7836.  
  7837.  With a positive argument, comment-region adds comment delimiters and 
  7838. duplicates the last character of the comment start sequence as many times as 
  7839. the argument specifies.  Thus, in Lisp mode, C-u 2 M-x comment-region adds `;;' 
  7840. to each line. 
  7841.  
  7842.  Duplicating the comment delimiter is a way of calling attention to the 
  7843. comment.  It can also affect how the comment is indented.  In Lisp, for proper 
  7844. indentation, you should use an argument of two, if between defuns, and three, 
  7845. if within a defun. 
  7846.  
  7847.  
  7848. ΓòÉΓòÉΓòÉ 25.7.1. Multiple Lines of Comments ΓòÉΓòÉΓòÉ
  7849.  
  7850.  If you are typing a comment and find that you wish to continue it on another 
  7851. line, you can use the command M-LFD (indent-new-comment-line), which terminates 
  7852. the comment you are typing, creates a new blank line afterward, and begins a 
  7853. new comment indented under the old one.  When Auto Fill mode is on, going past 
  7854. the fill column while typing a comment causes the comment to be continued in 
  7855. just this fashion.  If point is not at the end of the line when M-LFD is typed, 
  7856. the text on the rest of the line becomes part of the new comment line. 
  7857.  
  7858.  
  7859. ΓòÉΓòÉΓòÉ 25.7.2. Options Controlling Comments ΓòÉΓòÉΓòÉ
  7860.  
  7861.  The comment column is stored in the variable comment-column.  You can set it 
  7862. to a number explicitly.  Alternatively, the command C-x ; (set-comment-column) 
  7863. sets the comment column to the column point is at.  C-u C-x ; sets the comment 
  7864. column to match the last comment before point in the buffer, and then does a 
  7865. M-; to align the current line's comment under the previous one.  Note that C-u 
  7866. - C-x ; runs the function kill-comment as described above. 
  7867.  
  7868.  The variable comment-column is per-buffer: setting the variable in the normal 
  7869. fashion affects only the current buffer, but there is a default value which you 
  7870. can change with setq-default. See Locals.  Many major modes initialize this 
  7871. variable for the current buffer. 
  7872.  
  7873.  The comment commands recognize comments based on the regular expression that 
  7874. is the value of the variable comment-start-skip.  This regexp should not match 
  7875. the null string.  It may match more than the comment starting delimiter in the 
  7876. strictest sense of the word; for example, in C mode the value of the variable 
  7877. is "/\\*+ *", which matches extra stars and spaces after the `/*' itself. 
  7878. (Note that `\\' is needed in Lisp syntax to include a `\' in the string, which 
  7879. is needed to deny the first star its special meaning in regexp syntax.  See 
  7880. Regexps.) 
  7881.  
  7882.  When a comment command makes a new comment, it inserts the value of 
  7883. comment-start to begin it.  The value of comment-end is inserted after point, 
  7884. so that it will follow the text that you will insert into the comment.  In C 
  7885. mode, comment-start has the value "/* " and comment-end has the value " */". 
  7886.  
  7887.  The variable comment-multi-line controls how M-LFD (indent-new-comment-line) 
  7888. behaves when used inside a comment.  If comment-multi-line is nil, as it 
  7889. normally is, then the comment on the starting line is terminated and a new 
  7890. comment is started on the new following line.  If comment-multi-line is not 
  7891. nil, then the new following line is set up as part of the same comment that was 
  7892. found on the starting line.  This is done by not inserting a terminator on the 
  7893. old line, and not inserting a starter on the new line.  In languages where 
  7894. multi-line comments work, the choice of value for this variable is a matter of 
  7895. taste. 
  7896.  
  7897.  The variable comment-indent-function should contain a function that will be 
  7898. called to compute the indentation for a newly inserted comment or for aligning 
  7899. an existing comment.  It is set differently by various major modes.  The 
  7900. function is called with no arguments, but with point at the beginning of the 
  7901. comment, or at the end of a line if a new comment is to be inserted.  It should 
  7902. return the column in which the comment ought to start.  For example, in Lisp 
  7903. mode, the indent hook function bases its decision on how many semicolons begin 
  7904. an existing comment, and on the code in the preceding lines. 
  7905.  
  7906.  
  7907. ΓòÉΓòÉΓòÉ 25.8. Editing Without Unbalanced Parentheses ΓòÉΓòÉΓòÉ
  7908.  
  7909. M-( 
  7910.           Put parentheses around next sexp(s) (insert-parentheses). 
  7911.  
  7912. M-) 
  7913.           Move past next close parenthesis and re-indent 
  7914.           (move-over-close-and-reindent). 
  7915.  
  7916.  The commands M-( (insert-parentheses) and M-) (move-over-close-and-reindent) 
  7917. are designed to facilitate a style of editing which keeps parentheses balanced 
  7918. at all times.  M-( inserts a pair of parentheses, either together as in `()', 
  7919. or, if given an argument, around the next several sexps, and leaves point after 
  7920. the open parenthesis.  Instead of typing ( F O O ), you can type M-( F O O, 
  7921. which has the same effect except for leaving the cursor before the close 
  7922. parenthesis.  Then you can type M-), which moves past the close parenthesis, 
  7923. deleting any indentation preceding it (in this example there is none), and 
  7924. indenting with LFD after it. 
  7925.  
  7926.  
  7927. ΓòÉΓòÉΓòÉ 25.9. Completion for Symbol Names ΓòÉΓòÉΓòÉ
  7928.  
  7929.  Usually completion happens in the minibuffer.  But one kind of completion is 
  7930. available in all buffers: completion for symbol names. 
  7931.  
  7932.  The character M-TAB runs a command to complete the partial symbol before point 
  7933. against the set of meaningful symbol names.  Any additional characters 
  7934. determined by the partial name are inserted at point. 
  7935.  
  7936.  If the partial name in the buffer has more than one possible completion and 
  7937. they have no additional characters in common, a list of all possible 
  7938. completions is displayed in another window. 
  7939.  
  7940.  There are two ways of determining the set of legitimate symbol names to 
  7941. complete against.  In most major modes, this uses a tag table (see Tags); the 
  7942. legitimate symbol names are the tag names listed in the tag table file.  The 
  7943. command which implements this is complete-tag. 
  7944.  
  7945.  In Emacs-Lisp mode, the name space for completion normally consists of 
  7946. nontrivial symbols present in Emacs---those that have function definitions, 
  7947. values or properties.  However, if there is an open-parenthesis immediately 
  7948. before the beginning of the partial symbol, only symbols with function 
  7949. definitions are considered as completions. The command which implements this is 
  7950. lisp-complete-symbol. 
  7951.  
  7952.  
  7953. ΓòÉΓòÉΓòÉ 25.10. Documentation Commands ΓòÉΓòÉΓòÉ
  7954.  
  7955.  As you edit Lisp code to be run in Emacs, the commands C-h f 
  7956. (describe-function) and C-h v (describe-variable) can be used to print 
  7957. documentation of functions and variables that you want to call.  These commands 
  7958. use the minibuffer to read the name of a function or variable to document, and 
  7959. display the documentation in a window. 
  7960.  
  7961.  For extra convenience, these commands provide default arguments based on the 
  7962. code in the neighborhood of point.  C-h f sets the default to the function 
  7963. called in the innermost list containing point.  C-h v uses the symbol name 
  7964. around or adjacent to point as its default. 
  7965.  
  7966.  Documentation on Unix commands, system calls and libraries can be obtained 
  7967. with the M-x manual-entry command.  This reads a topic as an argument, and 
  7968. displays the text on that topic from the Unix manual. manual-entry starts a 
  7969. background process that formats the manual page, by running the man program. 
  7970. The result goes in a buffer named `*man topic*'.  These buffers have a special 
  7971. major mode that facilitates scrolling and examining other manual pages. 
  7972.  
  7973.  Eventually the GNU project hopes to replace most man pages with 
  7974. better-organized manuals that you can browse with Info. See Misc Help.  Since 
  7975. this process is only partially completed, it is still useful to read manual 
  7976. pages. 
  7977.  
  7978.  
  7979. ΓòÉΓòÉΓòÉ 25.11. Change Logs ΓòÉΓòÉΓòÉ
  7980.  
  7981.  The Emacs command C-x 4 a adds a new entry to the change log file for the file 
  7982. you are editing (add-change-log-entry-other-window). 
  7983.  
  7984.  A change log file contains a chronological record of when and why you have 
  7985. changed a program, consisting of a sequence of entries describing individual 
  7986. changes.  Normally it is kept in a file called `ChangeLog' in the same 
  7987. directory as the file you are editing, or one of its parent directories.  A 
  7988. single `ChangeLog' file can record changes for all the files in its directory 
  7989. and all its subdirectories. 
  7990.  
  7991.  A change log entry starts with a header line that contains your name and the 
  7992. current date.  Aside from these header lines, every line in the change log 
  7993. starts with a space or a tab.  The bulk of the entry consists of items, each of 
  7994. which starts with a line starting with whitespace and a star.  Here are two 
  7995. entries, each with two items: 
  7996.  
  7997. Wed May  5 14:11:45 1993  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
  7998.  
  7999.         * man.el: Rename functions and variables `man-*' to `Man-*'.
  8000.         (manual-entry): Make prompt string clearer.
  8001.  
  8002.         * simple.el (blink-matching-paren-distance): Change default to 12,000.
  8003.  
  8004. Tue May  4 12:42:19 1993  Richard Stallman  (rms@mole.gnu.ai.mit.edu)
  8005.  
  8006.         * vc.el (minor-mode-map-alist): Don't use it if it's void.
  8007.         (vc-cancel-version): Doc fix.
  8008.  
  8009.  One entry can describe several changes; each change should have its own item. 
  8010. Normally there should be a blank line between items.  When items are related 
  8011. (parts of the same change, in different places), group them by leaving no blank 
  8012. line between them.  The second entry above contains two items grouped in this 
  8013. way. 
  8014.  
  8015.  C-x 4 a visits the change log file and creates a new entry unless the most 
  8016. recent entry is for today's date and your name.  It also creates a new item for 
  8017. the current file.  For many languages, it can even guess the name of the 
  8018. function or other object that was changed. 
  8019.  
  8020.  The change log file is visited in Change Log mode.  Each bunch of grouped item 
  8021. counts as one paragraph, and each entry is considered a page.  This facilitates 
  8022. editing the entries.  LFD and auto-fill indent each new line like the previous 
  8023. line; this is convenient for entering the contents of an entry. 
  8024.  
  8025.  
  8026. ΓòÉΓòÉΓòÉ 25.12. Tag Tables ΓòÉΓòÉΓòÉ
  8027.  
  8028.  A tag table is a description of how a multi-file program is broken up into 
  8029. files.  It lists the names of the component files and the names and positions 
  8030. of the functions (or other named subunits) in each file.  Grouping the related 
  8031. files makes it possible to search or replace through all the files with one 
  8032. command.  Recording the function names and positions makes possible the M-. 
  8033. command which you can use to find the definition of a function without having 
  8034. to know which of the files it is in. 
  8035.  
  8036.  Tag tables are stored in files called tag table files.  The conventional name 
  8037. for a tag table file is `TAGS'. 
  8038.  
  8039.  Each entry in the tag table records the name of one tag, the name of the file 
  8040. that the tag is defined in (implicitly), and the position in that file of the 
  8041. tag's definition. 
  8042.  
  8043.  Just what names from the described files are recorded in the tag table depends 
  8044. on the programming language of the described file.  They normally include all 
  8045. functions and subroutines, and may also include global variables, data types, 
  8046. and anything else convenient.  Each name recorded is called a tag. 
  8047.  
  8048.  
  8049. ΓòÉΓòÉΓòÉ 25.12.1. Source File Tag Syntax ΓòÉΓòÉΓòÉ
  8050.  
  8051.  In Lisp code, any function defined with defun, any variable defined with 
  8052. defvar or defconst, and in general the first argument of any expression that 
  8053. starts with `(def' in column zero, is a tag. 
  8054.  
  8055.  In Scheme code, tags include anything defined with def or with a construct 
  8056. whose name starts with `def'.  They also include variables set with set! at top 
  8057. level in the file. 
  8058.  
  8059.  In C code, any C function is a tag, and so is any typedef if -t is specified 
  8060. when the tag table is constructed. 
  8061.  
  8062.  In Yacc or Bison input files, each rule defines as a tag the nonterminal it 
  8063. constructs.  The portions of the file that contain C code are parsed as C code. 
  8064.  
  8065.  In Fortran code, functions and subroutines are tags. 
  8066.  
  8067.  In Prolog code, a tag name appears at the left margin. 
  8068.  
  8069.  In assembler code, labels appearing at the beginning of a line, followed by a 
  8070. colon, are tags. 
  8071.  
  8072.  In LaTeX text, the argument of any of the commands \chapter, \section, 
  8073. \subsection, \subsubsection, \eqno, \label, \ref, \cite, \bibitem and \typeout 
  8074. is a tag. 
  8075.  
  8076.  
  8077. ΓòÉΓòÉΓòÉ 25.12.2. Creating Tag Tables ΓòÉΓòÉΓòÉ
  8078.  
  8079.  The etags program is used to create a tag table file.  It knows the syntax of 
  8080. several languages, as described in Tag Syntax. Here is how to run etags: 
  8081.  
  8082. etags inputfiles...
  8083.  
  8084. The etags program reads the specified files, and writes a tag table named 
  8085. `TAGS' in the current working directory.  etags recognizes the language used in 
  8086. an input file based on its file name and contents; there are no switches for 
  8087. specifying the language.  The -t switch tells etags to record typedefs in C 
  8088. code as tags. 
  8089.  
  8090.  If the tag table data become outdated due to changes in the files described in 
  8091. the table, the way to update the tag table is the same way it was made in the 
  8092. first place.  It is not necessary to do this often. 
  8093.  
  8094.  If the tag table fails to record a tag, or records it for the wrong file, then 
  8095. Emacs cannot possibly find its definition.  However, if the position recorded 
  8096. in the tag table becomes a little bit wrong (due to some editing in the file 
  8097. that the tag definition is in), the only consequence is a slight delay in 
  8098. finding the tag.  Even if the stored position is very wrong, Emacs will still 
  8099. find the tag, but it must search the entire file for it. 
  8100.  
  8101.  So you should update a tag table when you define new tags that you want to 
  8102. have listed, or when you move tag definitions from one file to another, or when 
  8103. changes become substantial.  Normally there is no need to update the tag table 
  8104. after each edit, or even every day. 
  8105.  
  8106.  
  8107. ΓòÉΓòÉΓòÉ 25.12.3. Selecting a Tag Table ΓòÉΓòÉΓòÉ
  8108.  
  8109.  Emacs has at any time one selected tag table, and all the commands for working 
  8110. with tag tables use the selected one.  To select a tag table, type M-x 
  8111. visit-tags-table, which reads the tag table file name as an argument.  The name 
  8112. `TAGS' in the default directory is used as the default file name. 
  8113.  
  8114.  All this command does is store the file name in the variable tags-file-name. 
  8115. Emacs does not actually read in the tag table contents until you try to use 
  8116. them.  Setting this variable yourself is just as good as using 
  8117. visit-tags-table.  The variable's initial value is nil; that value tells all 
  8118. the commands for working with tag tables that they must ask for a tag table 
  8119. file name to use. 
  8120.  
  8121.  Using visit-tags-table to load a new tag table does not discard the other 
  8122. tables previously loaded.  The other tags commands use all the tag tables that 
  8123. are loaded; the first one they use is the one that mentions the current visited 
  8124. file. 
  8125.  
  8126.  You can specify a precise list of tag tables by setting the variable 
  8127. tags-table-list to a list of strings, like this: 
  8128.  
  8129. (setq tags-table-list
  8130.       '("~/emacs" "/usr/local/lib/emacs/src"))
  8131.  
  8132. This tells the tags commands to look at the `TAGS' files in your `~/emacs' 
  8133. directory and in the `/usr/local/lib/emacs/src' directory.  The order depends 
  8134. on which file you are in and which tags table mentions that file, as explained 
  8135. above. 
  8136.  
  8137.  
  8138. ΓòÉΓòÉΓòÉ 25.12.4. Finding a Tag ΓòÉΓòÉΓòÉ
  8139.  
  8140.  The most important thing that a tag table enables you to do is to find the 
  8141. definition of a specific tag. 
  8142.  
  8143. M-. tag RET 
  8144.           Find first definition of tag (find-tag). 
  8145.  
  8146. C-u M-. 
  8147.           Find next alternate definition of last tag specified. 
  8148.  
  8149. C-u - M-. 
  8150.           Go back to previous tag found. 
  8151.  
  8152. M-x find-tag-regexp RET pattern RET 
  8153.           Find a tag whose name matches pattern. 
  8154.  
  8155. C-u M-x find-tag-regexp 
  8156.           Find the next tag whose name matches the last pattern used. 
  8157.  
  8158. C-x 4 . tag RET 
  8159.           Find first definition of tag, but display it in another window 
  8160.           (find-tag-other-window). 
  8161.  
  8162. C-x 5 . tag RET 
  8163.           Find first definition of tag, and create a new frame to select the 
  8164.           buffer (find-tag-other-frame). 
  8165.  
  8166.  M-. (find-tag) is the command to find the definition of a specified tag.  It 
  8167. searches through the tag table for that tag, as a string, and then uses the tag 
  8168. table info to determine the file that the definition is in and the approximate 
  8169. character position in the file of the definition.  Then find-tag visits that 
  8170. file, moves point to the approximate character position, and searches 
  8171. ever-increasing distances away to find the tag definition. 
  8172.  
  8173.  If an empty argument is given (just type RET), the sexp in the buffer before 
  8174. or around point is used as the tag argument. See Lists, for info on sexps. 
  8175.  
  8176.  You don't need to give M-. the full name of the tag; a part will do.  This is 
  8177. because M-. finds tags in the table which contain tag as a substring.  However, 
  8178. it prefers an exact match to a substring match. 
  8179.  
  8180.  To find other tags that match the same substring, give find-tag a numeric 
  8181. argument, as in C-u M-.; this does not read a tag name, but continues searching 
  8182. the tag table's text for another tag containing the same substring last used. 
  8183. If you have a real META key, M-0 M-. is an easier alternative to C-u M-.. 
  8184.  
  8185.  Like most commands that can switch buffers, find-tag has a variant that 
  8186. displays the new buffer in another window, and one that makes a new frame for 
  8187. it.  The former is C-x 4 ., which invokes the command find-tag-other-window. 
  8188. The latter is C-x 5 ., which invokes find-tag-other-frame. 
  8189.  
  8190.  To move back to places you've found tags recently, use C-u - M-.; more 
  8191. generally, M-. with a negative numeric argument.  This command can take you to 
  8192. another buffer.  C-x 4 . with a negative argument finds the previous tag 
  8193. location in another window. 
  8194.  
  8195.  The new command M-x find-tag-regexp visits the tags that match a specified 
  8196. regular expression.  It is just like M-. except that it does regexp matching 
  8197. instead of substring matching. 
  8198.  
  8199.  Emacs comes with a tag table file `src/TAGS' that includes all the Lisp 
  8200. libraries and all the C sources of Emacs.  By specifying this file with 
  8201. visit-tags-table and then using M-. you can quickly find the source for any 
  8202. Emacs function. 
  8203.  
  8204.  
  8205. ΓòÉΓòÉΓòÉ 25.12.5. Searching and Replacing with Tag Tables ΓòÉΓòÉΓòÉ
  8206.  
  8207.  The commands in this section visit and search all the files listed in the 
  8208. selected tag table, one by one.  For these commands, the tag table serves only 
  8209. to specify a sequence of files to search.  A related command is M-x grep (see 
  8210. Compilation). 
  8211.  
  8212. M-x tags-search 
  8213.           Search for the specified regexp through the files in the selected tag 
  8214.           table. 
  8215.  
  8216. M-x tags-query-replace 
  8217.           Perform a query-replace on each file in the selected tag table. 
  8218.  
  8219. M-, 
  8220.           Restart one of the commands above, from the current location of point 
  8221.           (tags-loop-continue). 
  8222.  
  8223.  M-x tags-search reads a regexp using the minibuffer, then searches for matches 
  8224. in all the files in the selected tag table, one file at a time.  It displays 
  8225. the name of the file being searched so you can follow its progress.  As soon as 
  8226. it finds an occurrence, tags-search returns. 
  8227.  
  8228.  Having found one match, you probably want to find all the rest.  To find one 
  8229. more match, type M-, (tags-loop-continue) to resume the tags-search.  This 
  8230. searches the rest of the current buffer, followed by the remaining files of the 
  8231. tag table. 
  8232.  
  8233.  M-x tags-query-replace performs a single query-replace through all the files 
  8234. in the tag table.  It reads a regexp to search for and a string to replace 
  8235. with, just like ordinary M-x query-replace-regexp.  It searches much like M-x 
  8236. tags-search but repeatedly, processing matches according to your input.  See 
  8237. Replace, for more information on query replace. 
  8238.  
  8239.  It is possible to get through all the files in the tag table with a single 
  8240. invocation of M-x tags-query-replace.  But since any unrecognized character 
  8241. causes the command to exit, you may need to continue where you left off.  M-, 
  8242. can be used for this.  It resumes the last tags search or replace command that 
  8243. you did. 
  8244.  
  8245.  The commands in this section carry out much broader searches than the 
  8246. find-tags family.  The find-tags commands search only for definitions of tags 
  8247. that match your substring or regexp.  The commands tags-search and 
  8248. tags-query-replace find every occurrence of the regexp, as ordinary search 
  8249. commands and replace commands do in the current buffer. 
  8250.  
  8251.  These commands create buffers only temporarily for the files that they have to 
  8252. search (those which are not already visited in Emacs buffers). Buffers in which 
  8253. no match is found are quickly killed; the others continue to exist. 
  8254.  
  8255.  It may have struck you that tags-search is a lot like grep. You can also run 
  8256. grep itself as an inferior of Emacs and have Emacs show you the matching lines 
  8257. one by one.  This works mostly the same as running a compilation and having 
  8258. Emacs show you where the errors were. See Compilation. 
  8259.  
  8260.  
  8261. ΓòÉΓòÉΓòÉ 25.12.6. Stepping Through a Tag Table ΓòÉΓòÉΓòÉ
  8262.  
  8263.  If you wish to process all the files in the selected tag table, but not in the 
  8264. specific ways that M-x tags-search and M-x tags-query-replace do, you can use 
  8265. M-x next-file to visit the files one by one. 
  8266.  
  8267. C-u M-x next-file 
  8268.           Visit the first file in the tag table, and prepare to advance 
  8269.           sequentially by files. 
  8270.  
  8271. M-x next-file 
  8272.           Visit the next file in the selected tag table. 
  8273.  
  8274.  
  8275. ΓòÉΓòÉΓòÉ 25.12.7. Tag Table Inquiries ΓòÉΓòÉΓòÉ
  8276.  
  8277. M-x list-tags 
  8278.           Display a list of the tags defined in a specific program file. 
  8279.  
  8280. M-x tags-apropos 
  8281.           Display a list of all tags matching a specified regexp. 
  8282.  
  8283.  M-x list-tags reads the name of one of the files described by the selected tag 
  8284. table, and displays a list of all the tags defined in that file.  The ``file 
  8285. name'' argument is really just a string to compare against the names recorded 
  8286. in the tag table; it is read as a string rather than as a file name. 
  8287. Therefore, completion and defaulting are not available, and you must enter the 
  8288. string the same way it appears in the tag table.  Do not include a directory as 
  8289. part of the file name unless the file name recorded in the tag table includes a 
  8290. directory. 
  8291.  
  8292.  M-x tags-apropos is like apropos for tags.  It reads a regexp, then finds all 
  8293. the tags in the selected tag table whose entries match that regexp, and 
  8294. displays the tag names found. 
  8295.  
  8296.  You can also perform completion in the buffer on the name space of tag names 
  8297. in the current tag tables.  See Symbol Completion. 
  8298.  
  8299.  
  8300. ΓòÉΓòÉΓòÉ 25.13. Merging Files with Emerge ΓòÉΓòÉΓòÉ
  8301.  
  8302. It's not unusual for programmers to get their signals crossed and modify the 
  8303. same program in two different directions.  To recover from this confusion, you 
  8304. need to merge the two versions.  Emerge makes this easier.  See also Comparing 
  8305. Files. 
  8306.  
  8307.  
  8308. ΓòÉΓòÉΓòÉ 25.13.1. Overview of Emerge ΓòÉΓòÉΓòÉ
  8309.  
  8310. To start Emerge, run one of these four commands: 
  8311.  
  8312. M-x emerge-files 
  8313.           Merge two specified files. 
  8314.  
  8315. M-x emerge-files-with-ancestor 
  8316.           Merge two specified files, with reference to a common ancestor. 
  8317.  
  8318. M-x emerge-buffers 
  8319.           Merge two buffers. 
  8320.  
  8321. M-x emerge-buffers-with-ancestor 
  8322.           Merge two buffers with reference to a common ancestor in a third 
  8323.           buffer. 
  8324.  
  8325.  The Emerge commands compare two files or buffers, and display the comparison 
  8326. in three buffers: one for each input text (the A buffer and the B buffer), and 
  8327. one (the merge buffer) where merging takes place.  The merge buffer shows the 
  8328. full merged text, not just the differences.  Wherever the two input texts 
  8329. differ, you can choose which one of them to include in the merge buffer. 
  8330.  
  8331.  The Emerge commands that take input from existing buffers use only the 
  8332. accessible portions of those buffers, if they are narrowed (see Narrowing). 
  8333.  
  8334.  If a common ancestor version is available, from which the two texts to be 
  8335. merged were both derived, Emerge can use it to guess which alternative is 
  8336. right.  Wherever one current version agrees with the ancestor, Emerge presumes 
  8337. that the other current version is a deliberate change which should be kept in 
  8338. the merged version.  Use the `with-ancestor' commands if you want to specify a 
  8339. common ancestor text.  These commands read three file or buffer names---variant 
  8340. A, variant B, and the common ancestor. 
  8341.  
  8342.  After the comparison is done and the buffers are prepared, the interactive 
  8343. merging starts.  You control the merging by typing special commands in the 
  8344. merge buffer.  The merge buffer shows you a full merged text, not just 
  8345. differences.  For each run of differences between the input texts, you can 
  8346. choose which one of them to keep, or edit them both together. 
  8347.  
  8348.  The merge buffer uses a special major mode, Emerge mode, with commands for 
  8349. making these choices.  But you can also edit the buffer with ordinary Emacs 
  8350. commands. 
  8351.  
  8352.  At any given time, the attention of Emerge is focused on one particular 
  8353. difference, called the selected difference.  This difference is marked off in 
  8354. the three buffers like this: 
  8355.  
  8356. vvvvvvvvvvvvvvvvvvvv
  8357. text that differs
  8358. ^^^^^^^^^^^^^^^^^^^^
  8359.  
  8360. Emerge numbers all the differences sequentially and the mode line always shows 
  8361. the number of the selected difference. 
  8362.  
  8363.  Normally, the merge buffer starts out with the A version of the text. But when 
  8364. the A version of a part of the buffer agrees with the common ancestor, then the 
  8365. B version is preferred for that part. 
  8366.  
  8367.  Emerge leaves the merged text in the merge buffer when you exit.  At that 
  8368. point, you can save it in a file with C-x C-w.  If you give a prefix argument 
  8369. to emerge-files or emerge-files-with-ancestor, it reads the name of the output 
  8370. file using the minibuffer.  (This is the last file name those commands read.) 
  8371. Then exiting from Emerge saves the merged text in the output file. 
  8372.  
  8373.  If you abort Emerge with C-], the output is not saved. 
  8374.  
  8375.  
  8376. ΓòÉΓòÉΓòÉ 25.13.2. Submodes of Emerge ΓòÉΓòÉΓòÉ
  8377.  
  8378.  You can choose between two modes for giving merge commands: Fast mode and Edit 
  8379. mode.  In Fast mode, basic Emerge commands are single characters, but ordinary 
  8380. Emacs commands are disabled.  This is convenient if you use only Emerge 
  8381. commands. 
  8382.  
  8383.  In Edit mode, all Emerge commands start with the prefix key C-c C-c, and the 
  8384. normal Emacs commands are also available.  This allows editing the merge 
  8385. buffer, but slows down Emerge operations. 
  8386.  
  8387.  Use e to switch to Edit mode, and C-c C-c f to switch to Fast mode.  The mode 
  8388. line indicates Edit and Fast modes with `E' and `F'. 
  8389.  
  8390.  Emerge has two additional submodes that affect how particular merge commands 
  8391. work: Auto Advance mode and Skip Prefers mode. 
  8392.  
  8393.  If Auto Advance mode is in effect, the a and b commands advance to the next 
  8394. difference.  This lets you go through the merge faster as long as you simply 
  8395. choose one of the alternatives from the input.  The mode line indicates Auto 
  8396. Advance mode with `A'. 
  8397.  
  8398.  If Skip Prefers mode is in effect, the n and p commands skip over differences 
  8399. in states prefer-A and prefer-B.  Thus you see only differences for which 
  8400. neither version is presumed ``correct''.  The mode line indicates Skip Prefers 
  8401. mode with `S'. 
  8402.  
  8403.  Use the command s a (emerge-auto-advance-mode) to set or clear Auto Advance 
  8404. mode.  Use s s (emerge-skip-prefers-mode) to set or clear Skip Prefers mode. 
  8405. These commands turn on the mode with a positive argument, turns it off with a 
  8406. negative or zero argument, and toggle the mode with no argument. 
  8407.  
  8408.  
  8409. ΓòÉΓòÉΓòÉ 25.13.3. State of a Difference ΓòÉΓòÉΓòÉ
  8410.  
  8411.  In the merge buffer, a difference is marked with lines of `v' and `^' 
  8412. characters.  Each difference has one of these seven states: 
  8413.  
  8414.           The difference is showing the A version.  The a command always 
  8415.           produces this state; the mode line indicates it with `A'. 
  8416.  
  8417.           The difference is showing the B version.  The b command always 
  8418.           produces this state; the mode line indicates it with `B'. 
  8419.  
  8420. default-A 
  8421. default-B 
  8422.           The difference is showing the A or the B state by default, because 
  8423.           you haven't made a choice.  All differences start in the default-A 
  8424.           state (and thus the merge buffer is a copy of the A buffer), except 
  8425.           those for which one alternative is ``preferred'' (see below). 
  8426.  
  8427.           When you select a difference, its state changes from default-A or 
  8428.           default-B to plain A or B.  Thus, the selected difference never has 
  8429.           state default-A or default-B, and these states are never displayed in 
  8430.           the mode line. 
  8431.  
  8432.           The command d a chooses default-A as the default state, and d b 
  8433.           chooses default-B.  This chosen default applies to all differences 
  8434.           which you haven't selected and for which no alternative is preferred. 
  8435.           If you are moving through the merge sequentially, the differences you 
  8436.           haven't selected are those following the selected one.  Thus, while 
  8437.           moving sequentially, you can effectively make the A version the 
  8438.           default for some sections of the merge buffer and the B version the 
  8439.           default for others by using d a and d b at the end of each section. 
  8440.  
  8441. prefer-A 
  8442. prefer-B 
  8443.           The difference is showing the A or B state because it is preferred. 
  8444.           This means that you haven't made an explicit choice, but one 
  8445.           alternative seems likely to be right because the other alternative 
  8446.           agrees with the common ancestor.  Thus, where the A buffer agrees 
  8447.           with the common ancestor, the B version is preferred, because chances 
  8448.           are it is the one that was actually changed. 
  8449.  
  8450.           These two states are displayed in the mode line as `A*' and `B*'. 
  8451.  
  8452. combined 
  8453.           The difference is showing a combination of the A and B states, as a 
  8454.           result of the x c or x C commands. 
  8455.  
  8456.           Once a difference is in this state, the a and b commands don't do 
  8457.           anything to it unless you give them a prefix argument. 
  8458.  
  8459.           The mode line displays this state as `comb'. 
  8460.  
  8461.  
  8462. ΓòÉΓòÉΓòÉ 25.13.4. Merge Commands ΓòÉΓòÉΓòÉ
  8463.  
  8464.  Here are the Merge commands for Fast mode; in Edit mode, precede them with C-c 
  8465. C-c: 
  8466.  
  8467.           Select the previous difference. 
  8468.  
  8469.           Select the next difference. 
  8470.  
  8471.           Choose the A version of this difference. 
  8472.  
  8473.           Choose the B version of this difference. 
  8474.  
  8475.           Select a particular difference; specify the sequence number of that 
  8476.           difference as a prefix argument. 
  8477.  
  8478.           Select the difference containing point.  You can use this command in 
  8479.           the merge buffer or in the A or B buffer. 
  8480.  
  8481.           Quit---finish the merge. 
  8482.  
  8483. C-] 
  8484.           Abort---exit merging and do not save the output. 
  8485.  
  8486.           Go into Fast mode.  (In Edit mode, this is actually C-c C-c f.) 
  8487.  
  8488.           Go into Edit mode. 
  8489.  
  8490.           Recenter (like C-l) all three windows. 
  8491.  
  8492.           Specify part of a prefix numeric argument. 
  8493.  
  8494. digit 
  8495.           Also specify part of a prefix numeric argument. 
  8496.  
  8497. d a 
  8498.           Choose the A version as the default from here down in the merge 
  8499.           buffer. 
  8500.  
  8501. d b 
  8502.           Choose the B version as the default from here down in the merge 
  8503.           buffer. 
  8504.  
  8505. c a 
  8506.           Copy the A version of this difference into the kill ring. 
  8507.  
  8508. c b 
  8509.           Copy the B version of this difference into the kill ring. 
  8510.  
  8511. i a 
  8512.           Insert the A version of this difference at the point. 
  8513.  
  8514. i b 
  8515.           Insert the B version of this difference at the point. 
  8516.  
  8517.           Put the point and mark around the difference region. 
  8518.  
  8519.           Scroll all three windows down (like M-v). 
  8520.  
  8521.           Scroll all three windows up (like C-v). 
  8522.  
  8523.           Scroll all three windows left (like C-x <). 
  8524.  
  8525.           Scroll all three windows right (like C-x >). 
  8526.  
  8527.           Reset horizontal scroll on all three windows. 
  8528.  
  8529. x 1 
  8530.           Shrink the merge window to one line.  (Use C-u l to restore it to 
  8531.           full size.) 
  8532.  
  8533. x c 
  8534.           Combine the two versions of this difference. 
  8535.  
  8536. x f 
  8537.           Show the files/buffers Emerge is operating on in Help window. (Use 
  8538.           C-u l to restore windows.) 
  8539.  
  8540. x j 
  8541.           Join this difference with the following one. (C-u x j joins this 
  8542.           difference with the previous one.) 
  8543.  
  8544. x s 
  8545.           Split this difference into two differences.  Before you use this 
  8546.           command, position point in each of the three buffers to the place 
  8547.           where you want to split the difference. 
  8548.  
  8549. x t 
  8550.           Trim identical lines off top and bottom of the difference. Such lines 
  8551.           occur when the A and B versions are identical but differ from the 
  8552.           ancestor version. 
  8553.  
  8554.  
  8555. ΓòÉΓòÉΓòÉ 25.13.5. Exiting Emerge ΓòÉΓòÉΓòÉ
  8556.  
  8557.  The q command (emerge-quit) finishes the merge, storing the results into the 
  8558. output file if you specified one.  It restores the A and B buffers to their 
  8559. proper contents, or kills them if they were created by Emerge and you haven't 
  8560. changed them.  It also disables the Emerge commands in the merge buffer, since 
  8561. executing them later could damage the contents of the various buffers. 
  8562.  
  8563.  C-] aborts the merge.  This means exiting without writing the output file.  If 
  8564. you didn't specify an output file, then there is no real difference between 
  8565. aborting and finishing the merge. 
  8566.  
  8567.  If Emerge was called from another Lisp program, then its return value is t for 
  8568. successful completion, or nil if you abort. 
  8569.  
  8570.  
  8571. ΓòÉΓòÉΓòÉ 25.13.6. Combining the Two Versions ΓòÉΓòÉΓòÉ
  8572.  
  8573.  Sometimes you want to keep both alternatives for a particular locus.  To do 
  8574. this, use x c, which edits the merge buffer like this: 
  8575.  
  8576. #ifdef NEW
  8577. version from A file
  8578. #else /* NEW */
  8579. version from B file
  8580. #endif /* NEW */
  8581.  
  8582. While this example shows C preprocessor conditionals delimiting the two 
  8583. alternative versions, you can specify the strings you want by setting the 
  8584. variable emerge-combine-versions-template to a string of your choice.  In the 
  8585. string, `%a' says where to put version A, and `%b' says where to put version B. 
  8586. The default setting, which produces the results shown above, looks like this: 
  8587.  
  8588. "#ifdef NEW\n%a#else /* NEW */\n%b#endif /* NEW */\n"
  8589.  
  8590.  
  8591. ΓòÉΓòÉΓòÉ 25.13.7. Fine Points of Emerge ΓòÉΓòÉΓòÉ
  8592.  
  8593.  During the merge, you mustn't try to edit the A and B buffers yourself. Emerge 
  8594. modifies them temporarily, but ultimately puts them back the way they were. 
  8595.  
  8596.  You can have any number of merges going at once---just don't use any one 
  8597. buffer as input to more than one merge at once, since the temporary changes 
  8598. made in these buffers would get in each other's way. 
  8599.  
  8600.  Starting Emerge can take a long time because it needs to compare the files 
  8601. fully.  Emacs can't do anything else until diff finishes. Perhaps in the future 
  8602. someone will change Emerge to do the comparison in the background when the 
  8603. input files are large---then you could keep on doing other things with Emacs 
  8604. until Emerge gets ready to accept commands. 
  8605.  
  8606.  After setting up the merge, Emerge runs the hook emerge-startup-hook (see 
  8607. Hooks). 
  8608.  
  8609.  
  8610. ΓòÉΓòÉΓòÉ 25.14. C Mode ΓòÉΓòÉΓòÉ
  8611.  
  8612.  In addition to the facilities of typical programming language major modes (see 
  8613. Program Modes), C mode has various special facilities. 
  8614.  
  8615. M-a 
  8616. M-e 
  8617.           In C mode, M-a and M-e now move by complete C statements 
  8618.           (c-beginning-of-statement and c-end-of-statement).  These commands do 
  8619.           ordinary, textual sentence motion when in or next to a comment. 
  8620.  
  8621. M-q 
  8622.           M-q in C mode runs c-fill-paragraph, which is designed for filling C 
  8623.           comments.  (We assume you don't want to fill the actual C code in a C 
  8624.           program.) 
  8625.  
  8626. C-c C-u 
  8627.           Move back to the containing preprocessor conditional, setting the 
  8628.           mark at the starting point (c-up-conditional). 
  8629.  
  8630.           A prefix argument acts as a repeat count.  With a negative argument, 
  8631.           this command moves forward to the end of the containing preprocessor 
  8632.           conditional.  When going backwards, `#elif' acts like `#else' 
  8633.           followed by `#if'.  When going forwards, `#elif' is ignored. 
  8634.  
  8635. C-c C-n 
  8636.           Move forward across the next preprocessor conditional, setting the 
  8637.           mark at the starting point (c-forward-conditional). 
  8638.  
  8639. C-c C-p 
  8640.           Move backward across the previous preprocessor conditional, setting 
  8641.           the at the starting point (c-backward-conditional). 
  8642.  
  8643. M-x c-macro-expand 
  8644.           When you are debugging C code that uses macros, sometimes it is hard 
  8645.           to figure out precisely how the macros expand.  The command M-x 
  8646.           c-macro-expand runs the C preprocessor and shows you what expansion 
  8647.           results from the region.  The portion of the buffer before the region 
  8648.           is also included in preprocessing, for the sake of macros defined 
  8649.           there, but the output from this part isn't shown. 
  8650.  
  8651. M-x c-backslash-region 
  8652.           Insert or align `\' characters at the ends of the lines of the 
  8653.           region, except for the last such line.  This is useful after writing 
  8654.           or editing a C macro definition. 
  8655.  
  8656.           If a line already ends in `\', this command adjusts the amount of 
  8657.           whitespace before it.  Otherwise, it inserts a new `\'. 
  8658.  
  8659.  C++ mode is like C mode, except that it understands C++ comment syntax and 
  8660. certain other differences between C and C++.  It also has a command M-x 
  8661. fill-c++-comment, which fills a paragraph made of C++ comment lines. 
  8662.  
  8663.  The command comment-region is useful in C++ mode for commenting out several 
  8664. consecutive lines, or removing the commenting out of such lines.  (You don't 
  8665. need this command with C comment syntax because you don't need to put comment 
  8666. delimiters on each line.)  See Comments. 
  8667.  
  8668.  
  8669. ΓòÉΓòÉΓòÉ 25.15. Fortran Mode ΓòÉΓòÉΓòÉ
  8670.  
  8671.  Fortran mode provides special motion commands for Fortran statements and 
  8672. subprograms, and indentation commands that understand Fortran conventions of 
  8673. nesting, line numbers and continuation statements.  Fortran mode has it's own 
  8674. Auto Fill mode that breaks long lines into proper Fortran continuation lines. 
  8675.  
  8676.  Special commands for comments are provided because Fortran comments are unlike 
  8677. those of other languages. 
  8678.  
  8679.  Built-in abbrevs optionally save typing when you insert Fortran keywords. 
  8680.  
  8681.  Use M-x fortran-mode to switch to this major mode.  This command runs the hook 
  8682. fortran-mode-hook (see Hooks). 
  8683.  
  8684.  Fortran mode was contributed by Michael Prange.  It has been updated by 
  8685. Stephen A. Wood who has collated the contributions and suggestions of many 
  8686. users. 
  8687.  
  8688.  
  8689. ΓòÉΓòÉΓòÉ 25.15.1. Motion Commands ΓòÉΓòÉΓòÉ
  8690.  
  8691.  Fortran mode provides special commands to move by subprograms (functions and 
  8692. subroutines) and by statements.  There is also a command to put the region 
  8693. around one subprogram, convenient for killing it or moving it. 
  8694.  
  8695. C-M-a 
  8696.           Move to beginning of subprogram (beginning-of-fortran-subprogram). 
  8697.  
  8698. C-M-e 
  8699.           Move to end of subprogram (end-of-fortran-subprogram). 
  8700.  
  8701. C-M-h 
  8702.           Put point at beginning of subprogram and mark at end 
  8703.           (mark-fortran-subprogram). 
  8704.  
  8705. C-c C-n 
  8706.           Move to beginning of current or next statement 
  8707.           (fortran-next-statement). 
  8708.  
  8709. C-c C-p 
  8710.           Move to beginning of current or previous statement 
  8711.           (fortran-previous-statement). 
  8712.  
  8713.  
  8714. ΓòÉΓòÉΓòÉ 25.15.2. Fortran Indentation ΓòÉΓòÉΓòÉ
  8715.  
  8716.  Special commands and features are needed for indenting Fortran code in order 
  8717. to make sure various syntactic entities (line numbers, comment line indicators 
  8718. and continuation line flags) appear in the columns that are required for 
  8719. standard Fortran. 
  8720.  
  8721.  
  8722. ΓòÉΓòÉΓòÉ 25.15.2.1. Fortran Indentation Commands ΓòÉΓòÉΓòÉ
  8723.  
  8724. TAB 
  8725.           Indent the current line (fortran-indent-line). 
  8726.  
  8727. LFD 
  8728.           Indent the current and start a new indented line 
  8729.           (fortran-indent-new-line). 
  8730.  
  8731. M-LFD 
  8732.           Break the current line and set up a continuation line. 
  8733.  
  8734. C-M-q 
  8735.           Indent all the lines of the subprogram point is in 
  8736.           (fortran-indent-subprogram). 
  8737.  
  8738.  Fortran mode redefines TAB to reindent the current line for Fortran 
  8739. (fortran-indent-line).  This command indents Line numbers and continuation 
  8740. markers to their required columns, and independently indents the body of the 
  8741. statement based on its nesting in the program. 
  8742.  
  8743.  The key LFD runs the command fortran-indent-new-line, which reindents the 
  8744. current line then makes and indents a new line. This command is useful to 
  8745. reindent the closing statement of `do' loops and other blocks before starting a 
  8746. new line. 
  8747.  
  8748.  The key C-M-q runs fortran-indent-subprogram, a command to reindent all the 
  8749. lines of the Fortran subprogram (function or subroutine) containing point. 
  8750.  
  8751.  The key M-LFD runs fortran-split-line, which splits a line in the appropriate 
  8752. fashion for Fortran.  In a non-comment line, the second half becomes a 
  8753. continuation line and is indented accordingly.  In a comment line, both halves 
  8754. become separate comment lines. 
  8755.  
  8756.  
  8757. ΓòÉΓòÉΓòÉ 25.15.2.2. Continuation Lines ΓòÉΓòÉΓòÉ
  8758.  
  8759.  Most modern Fortran compilers allow two ways of writing continuation lines. 
  8760. If the first non-space character on a line is in column 5, then that line is a 
  8761. continuation of the previous line.  We call this fixed format.  (In GNU Emacs 
  8762. we always count columns from 0.)  A line that starts with a tab character 
  8763. followed by any digit except `0' is also a continuation line.  We call this 
  8764. style of continuation tab format. 
  8765.  
  8766.  Fortran mode can make either style of continuation line, but you must specify 
  8767. which one you prefer.  The value of the variable indent-tabs-mode controls the 
  8768. choice: nil for fixed format, and non-nil for tab format.  You can tell which 
  8769. style is presently in effect by the presence or absence of the string `Tab' in 
  8770. the mode line. 
  8771.  
  8772.  If the text on a line starts with the conventional Fortran continuation marker 
  8773. `$', or if it begins with any non-whitespace character in column 5, Fortran 
  8774. mode treats it as a continuation line. When you indent a continuation line with 
  8775. TAB, it converts the line to the current continuation style.  When you split a 
  8776. Fortran statement with M-LFD, the continuation marker on the newline is created 
  8777. according to the continuation style. 
  8778.  
  8779.  The setting of continuation style affects several other aspects of editing in 
  8780. Fortran mode.  In fixed format mode, the minimum column number for the body of 
  8781. a statement is 6.  Lines inside of Fortran blocks that are indented to larger 
  8782. column numbers always use only the space character for whitespace.  In tab 
  8783. format mode, the minimum column number for the statement body is 8, and the 
  8784. whitespace before column 8 must always consist of one tab character. 
  8785.  
  8786.  When you enter Fortran mode for an existing file, it tries to deduce the 
  8787. proper continuation style automatically from the file contents.  The first line 
  8788. that begins with either a tab character or six spaces determines the choice. 
  8789. The variable fortran-analyze-depth specifies how many lines to consider (at the 
  8790. beginning of the file); if none of those lines indicates a style, then the 
  8791. variable fortran-tab-mode-default specifies the style.  If it is nil, that 
  8792. specifies fixed format, and non-nil specifies tab format. 
  8793.  
  8794.  
  8795. ΓòÉΓòÉΓòÉ 25.15.2.3. Line Numbers ΓòÉΓòÉΓòÉ
  8796.  
  8797.  If a number is the first non-whitespace in the line, Fortran indentation 
  8798. assumes it is a line number and moves it to columns 0 through 4.  (Columns 
  8799. always count from 0 in GNU Emacs.) 
  8800.  
  8801.  Line numbers of four digits or less are normally indented one space. The 
  8802. variable fortran-line-number-indent controls this; it specifies the maximum 
  8803. indentation a line number can have.  Line numbers are indented to right-justify 
  8804. them to end in column 4 unless that would require more than this maximum 
  8805. indentation.  The default value of the variable is 1. 
  8806.  
  8807.  Simply inserting a line number is enough to indent it according to these 
  8808. rules.  As each digit is inserted, the indentation is recomputed. To turn off 
  8809. this feature, set the variable fortran-electric-line-number to nil.  Then 
  8810. inserting line numbers is like inserting anything else. 
  8811.  
  8812.  
  8813. ΓòÉΓòÉΓòÉ 25.15.2.4. Syntactic Conventions ΓòÉΓòÉΓòÉ
  8814.  
  8815.  Fortran mode assumes that you follow certain conventions that simplify the 
  8816. task of understanding a Fortran program well enough to indent it properly: 
  8817.  
  8818. o Two nested `do' loops never share a `continue' statement. 
  8819.  
  8820. o Fortran keywords such as `if', `else', `then', `do' and others are written 
  8821.   without embedded whitespace or line breaks. 
  8822.  
  8823.   Fortran compilers generally ignore whitespace outside of string constants, 
  8824.   but Fortran mode does not recognize these keywords if they are not 
  8825.   contiguous.  Constructs such as `else if' or `end do' are acceptable, but the 
  8826.   second word should be on the same line as the first and not on a continuation 
  8827.   line. 
  8828.  
  8829. If you fail to follow these conventions, the indentation commands may indent 
  8830. some lines unaesthetically.  However, a correct Fortran program retains its 
  8831. meaning when reindented even if the conventions are not followed. 
  8832.  
  8833.  
  8834. ΓòÉΓòÉΓòÉ 25.15.2.5. Variables for Fortran Indentation ΓòÉΓòÉΓòÉ
  8835.  
  8836.  Several additional variables control how Fortran indentation works: 
  8837.  
  8838. fortran-do-indent 
  8839.           Extra indentation within each level of `do' statement (default 3). 
  8840.  
  8841. fortran-if-indent 
  8842.           Extra indentation within each level of `if' statement (default 3). 
  8843.           This value is also used for extra indentation within each level of 
  8844.           the Fortran 90 `where' statement. 
  8845.  
  8846. fortran-structure-indent 
  8847.           Extra indentation within each level of `structure', `union', or `map' 
  8848.           statements (default 3). 
  8849.  
  8850. fortran-continuation-indent 
  8851.           Extra indentation for bodies of continuation lines (default 5). 
  8852.  
  8853. fortran-check-all-num-for-matching-do 
  8854.           If this is nil, indentation assumes that each `do' statement ends on 
  8855.           a `continue' statement.  Therefore, when computing indentation for a 
  8856.           statement other than `continue', it can save time by not checking for 
  8857.           a `do' statement ending there.  If this is non-nil, indenting any 
  8858.           numbered statement must check for a `do' that ends there.  The 
  8859.           default is nil. 
  8860.  
  8861. fortran-blink-matching-if 
  8862.           If this is t, indenting an `endif' statement moves the cursor 
  8863.           momentarily to the matching `if' statement to show where it is.  The 
  8864.           default is nil. 
  8865.  
  8866. fortran-minimum-statement-indent-fixed 
  8867.           Minimum indentation for fortran statements when using fixed format 
  8868.           continuation line style.  Statement bodies are never indented less 
  8869.           than this much.  The default is 6. 
  8870.  
  8871. fortran-minimum-statement-indent-tab 
  8872.           Minimum indentation for fortran statements for tab format 
  8873.           continuation line style.  Statement bodies are never indented less 
  8874.           than this much.  The default is 8. 
  8875.  
  8876.  
  8877. ΓòÉΓòÉΓòÉ 25.15.3. Comments ΓòÉΓòÉΓòÉ
  8878.  
  8879.  The usual Emacs comment commands assume that a comment can follow a line of 
  8880. code.  In Fortran, the standard comment syntax requires an entire line to be 
  8881. just a comment.  Therefore, Fortran mode replaces the standard Emacs comment 
  8882. commands and defines some new variables. 
  8883.  
  8884.  Fortran mode can also handle a nonstandard comment syntax where comments start 
  8885. with `!' and can follow other text.  Because only some Fortran compilers accept 
  8886. this syntax, Fortran mode will not insert such comments unless you have said in 
  8887. advance to do so.  To do this, set the variable comment-start to `"!"' (see 
  8888. Variables). 
  8889.  
  8890. M-; 
  8891.           Align comment or insert new comment (fortran-comment-indent). 
  8892.  
  8893. C-x ; 
  8894.           Applies to nonstandard `!' comments only. 
  8895.  
  8896. C-c ; 
  8897.           Turn all lines of the region into comments, or (with argument) turn 
  8898.           them back into real code (fortran-comment-region). 
  8899.  
  8900.  M-; in Fortran mode is redefined as the command fortran-comment-indent.  Like 
  8901. the usual M-; command, this recognizes any kind of existing comment and aligns 
  8902. its text appropriately; if there is no existing comment, a comment is inserted 
  8903. and aligned.  But inserting and aligning comments are not the same in Fortran 
  8904. mode as in other modes. 
  8905.  
  8906.  When a new comment must be inserted, if the current line is blank, a full-line 
  8907. comment is inserted.  On a non-blank line, a nonstandard `!' comment is 
  8908. inserted if you have said you want to use them.  Otherwise a full-line comment 
  8909. is inserted on a new line before the current line. 
  8910.  
  8911.  Nonstandard `!' comments are aligned like comments in other languages, but 
  8912. full-line comments are different.  In a standard full-line comment, the comment 
  8913. delimiter itself must always appear in column zero. What can be aligned is the 
  8914. text within the comment.  You can choose from three styles of alignment by 
  8915. setting the variable fortran-comment-indent-style to one of these values: 
  8916.  
  8917. fixed 
  8918.           Align the text at a fixed column, which is the sum of 
  8919.           fortran-comment-line-extra-indent and the minimum statement 
  8920.           indentation.  This is the default. 
  8921.  
  8922.           The minimum statement indentation is 
  8923.           fortran-minimum-statement-indent-fixed for fixed format continuation 
  8924.           line style and fortran-minimum-statement-indent-tab for tab format 
  8925.           style. 
  8926.  
  8927. relative 
  8928.           Align the text as if it were a line of code, but with an additional 
  8929.           fortran-comment-line-extra-indent columns of indentation. 
  8930.  
  8931. nil 
  8932.           Don't move text in full-line columns automatically at all. 
  8933.  
  8934.  In addition, you can specify the character to be used to indent within 
  8935. full-line comments by setting the variable fortran-comment-indent-char to the 
  8936. single-character string you want to use. 
  8937.  
  8938.  Fortran mode introduces two variables comment-line-start and 
  8939. comment-line-start-skip which play for full-line comments the same roles played 
  8940. by comment-start and comment-start-skip for ordinary text-following comments. 
  8941. Normally these are set properly by Fortran mode so you do not need to change 
  8942. them. 
  8943.  
  8944.  The normal Emacs comment command C-x ; has not been redefined.  If you use `!' 
  8945. comments, this command can be used with them.  Otherwise it is useless in 
  8946. Fortran mode. 
  8947.  
  8948.  The command C-c ; (fortran-comment-region) turns all the lines of the region 
  8949. into comments by inserting the string `C$$$' at the front of each one.  With a 
  8950. numeric argument, it turns the region back into live code by deleting `C$$$' 
  8951. from the front of each line in it.  The string used for these comments can be 
  8952. controlled by setting the variable fortran-comment-region.  Note that here we 
  8953. have an example of a command and a variable with the same name; these two uses 
  8954. of the name never conflict because in Lisp and in Emacs it is always clear from 
  8955. the context which one is meant. 
  8956.  
  8957.  
  8958. ΓòÉΓòÉΓòÉ 25.15.4. Fortran Auto Fill Mode ΓòÉΓòÉΓòÉ
  8959.  
  8960.  Fortran Auto Fill mode is a minor mode which automatically splits Fortran 
  8961. statements as you insert them when they become too wide.  Splitting a statement 
  8962. involves making continuation lines.  This splitting happens when you type SPC, 
  8963. RET, or TAB, and also in the Fortran indentation commands. 
  8964.  
  8965.  M-x fortran-auto-fill-mode turns Fortran Auto Fill mode on if it was off, or 
  8966. off if it was on.  This command works the same as M-x auto-fill-mode does for 
  8967. normal Auto Fill mode (see Filling).  A positive numeric argument turns Fortran 
  8968. Auto Fill mode on, and a negative argument turns it off.  You can see when 
  8969. Fortran Auto Fill mode is in effect by the presence of the word `Fill' in the 
  8970. mode line, inside the parentheses.  Fortran Auto Fill mode is a minor mode, 
  8971. turned on or off for each buffer individually.  See Minor Modes. 
  8972.  
  8973.   Fortran Auto Fill mode breaks lines at spaces or delimiters when the lines 
  8974. get longer than the desired width (the value of fill-column). The delimiters 
  8975. that Fortran Auto Fill mode may break at are `,', `'', `+', `-', `/', `*', `=', 
  8976. and `)'. The line break comes after the delimiter if the variable 
  8977. fortran-break-before-delimiters is nil.  Otherwise (and by default), the break 
  8978. comes before the delimiter. 
  8979.  
  8980.  By default, Fortran Auto Fill mode is not enabled.  If you want this feature 
  8981. turned on permanently, add a hook function to fortran-mode-hook to execute 
  8982. (fortran-auto-fill-mode 1). See Hooks. 
  8983.  
  8984.  
  8985. ΓòÉΓòÉΓòÉ 25.15.5. Columns ΓòÉΓòÉΓòÉ
  8986.  
  8987. C-c C-r 
  8988.           Display a ``column ruler'' momentarily above the current line 
  8989.           (fortran-column-ruler). 
  8990.  
  8991. C-c C-w 
  8992.           Split the current window horizontally temporarily so that it is 72 
  8993.           columns wide.  This may help you avoid making lines longer than the 
  8994.           72 character limit that some fortran compilers impose 
  8995.           (fortran-window-create-momentarily). 
  8996.  
  8997.  The command C-c C-r (fortran-column-ruler) shows a column ruler momentarily 
  8998. above the current line.  The comment ruler is two lines of text that show you 
  8999. the locations of columns with special significance in Fortran programs.  Square 
  9000. brackets show the limits of the columns for line numbers, and curly brackets 
  9001. show the limits of the columns for the statement body.  Column numbers appear 
  9002. above them. 
  9003.  
  9004.  Note that the column numbers count from zero, as always in GNU Emacs. As a 
  9005. result, the numbers may be one less than those you are familiar with; but the 
  9006. positions they indicate in the line are standard for Fortran. 
  9007.  
  9008.  The text used to display the column ruler is the value of the variable 
  9009. fortran-comment-ruler.  By changing this variable, you can change the display. 
  9010.  
  9011.  For even more help, use C-c C-w (fortran-window-create), a command which 
  9012. splits the current window horizontally, making a window 72 columns wide.  By 
  9013. editing in this window you can immediately see when you make a line too wide to 
  9014. be correct Fortran. 
  9015.  
  9016.  
  9017. ΓòÉΓòÉΓòÉ 25.15.6. Fortran Keyword Abbrevs ΓòÉΓòÉΓòÉ
  9018.  
  9019.  Fortran mode provides many built-in abbrevs for common keywords and 
  9020. declarations.  These are the same sort of abbrev that you can define yourself. 
  9021. To use them, you must turn on Abbrev mode.  See Abbrevs. 
  9022.  
  9023.  The built-in abbrevs are unusual in one way: they all start with a semicolon. 
  9024. You cannot normally use semicolon in an abbrev, but Fortran mode makes this 
  9025. possible by changing the syntax of semicolon to ``word constituent.'' 
  9026.  
  9027.  For example, one built-in Fortran abbrev is `;c' for `continue'.  If you 
  9028. insert `;c' and then insert a punctuation character such as a space or a 
  9029. newline, the `;c' expands automatically to `continue', provided Abbrev mode is 
  9030. enabled. 
  9031.  
  9032.  Type `;?' or `;C-h' to display a list of all the built-in Fortran abbrevs and 
  9033. what they stand for. 
  9034.  
  9035.  
  9036. ΓòÉΓòÉΓòÉ 25.16. Asm Mode ΓòÉΓòÉΓòÉ
  9037.  
  9038. Asm mode is a major mode for editing files of assembler code.  It defines these 
  9039. commands: 
  9040.  
  9041. TAB 
  9042.           tab-to-tab-stop. 
  9043.  
  9044. LFD 
  9045.           Insert a newline and then indent using tab-to-tab-stop. 
  9046.  
  9047.           Insert a colon and then remove the indentation from before the label 
  9048.           preceding colon.  Then do tab-to-tab-stop. 
  9049.  
  9050.           Insert or align a comment. 
  9051.  
  9052.  The variable asm-comment-char specifies which character starts comments in 
  9053. assembler syntax. 
  9054.  
  9055.  
  9056. ΓòÉΓòÉΓòÉ 26. Compiling and Testing Programs ΓòÉΓòÉΓòÉ
  9057.  
  9058.  The previous chapter discusses the Emacs commands that are useful for making 
  9059. changes in programs.  This chapter deals with commands that assist in the 
  9060. larger process of developing and maintaining programs. 
  9061.  
  9062.  
  9063. ΓòÉΓòÉΓòÉ 26.1. Running `make', or Compilers Generally ΓòÉΓòÉΓòÉ
  9064.  
  9065.  Emacs can run compilers for noninteractive languages such as C and Fortran as 
  9066. inferior processes, feeding the error log into an Emacs buffer. It can also 
  9067. parse the error messages and show you the source lines where compilation errors 
  9068. occurred. 
  9069.  
  9070. M-x compile 
  9071.           Run a compiler asynchronously under Emacs, with error messages to 
  9072.           `*compilation*' buffer. 
  9073.  
  9074. M-x grep 
  9075.           Run grep asynchronously under Emacs, with matching lines listed in 
  9076.           the buffer named `*grep*'. 
  9077.  
  9078. M-x kill-compilation 
  9079. M-x kill-grep 
  9080.           Kill the running compilation or grep subprocess. 
  9081.  
  9082. C-x ` 
  9083.           Visit the locus of the next compiler error message or grep match. 
  9084.  
  9085.  To run make or another compilation command, do M-x compile.  This command 
  9086. reads a shell command line using the minibuffer, and then executes the command 
  9087. in an inferior shell, putting output in the buffer named `*compilation*'.  The 
  9088. current buffer's default directory is used as the working directory for the 
  9089. execution of the command; normally, therefore, the compilation happens in this 
  9090. directory. 
  9091.  
  9092.  When the shell command line is read, the minibuffer appears containing a 
  9093. default command line, which is the command you used the last time you did M-x 
  9094. compile.  If you type just RET, the same command line is used again.  For the 
  9095. first M-x compile, the default is `make -k'. 
  9096.  
  9097.  The default compilation command comes from the variable compile-command; if 
  9098. the appropriate compilation command for a file is something other than `make 
  9099. -k', it can be useful for the file to specify a local value for compile-command 
  9100. ( see File Variables). 
  9101.  
  9102.  Starting a compilation displays the buffer `*compilation*' in another window 
  9103. but does not select it.  The buffer's mode line tells you whether compilation 
  9104. is finished, with the word `run' or `exit' inside the parentheses.  You do not 
  9105. have to keep this buffer visible; compilation continues in any case.  While a 
  9106. compilation is going on, the string `Compiling' appears in the mode lines of 
  9107. all windows.  When this string disappears, the compilation is finished. 
  9108.  
  9109.  To kill the compilation process, do M-x kill-compilation.  When the compiler 
  9110. process terminates, the mode line of the `*compilation*' buffer changes to say 
  9111. `signal' instead of `run'.  Starting a new compilation also kills any running 
  9112. compilation, as only one can exist at any time.  However, M-x compile asks for 
  9113. confirmation before actually killing a compilation that is running. 
  9114.  
  9115.  The `*compilation*' buffer uses a special major mode, Compilation mode.  This 
  9116. mode provides the keys SPC and DEL to scroll by screenfuls, and M-n and M-p to 
  9117. move to the next or previous error message.  You can also use M-{ and M-} to 
  9118. move up or down to an error message for a different source file. You can visit 
  9119. the source for any particular error message by moving point in `*compilation*' 
  9120. to that error message and typing C-c C-c (compile-goto-error). 
  9121.  
  9122.  To parse the compiler error messages sequentially, type C-x ` (next-error). 
  9123. The character following the C-x is the backquote or ``grave accent,'' not the 
  9124. single-quote.  This command is available in all buffers, not just in 
  9125. `*compilation*'.  It displays the next error message at the top of one window 
  9126. and source location of the error in another window. 
  9127.  
  9128.  The first time C-x ` is used after the start of a compilation, it moves to the 
  9129. first error's location.  Subsequent uses of C-x ` advance down the data set up 
  9130. by the first use.  When the preparsed error messages are exhausted, the next 
  9131. C-x ` checks for any more error messages that have come in; this is useful if 
  9132. you start editing the compilation errors while the compilation is still going 
  9133. on.  If no more error messages have come in, C-x ` reports an error. 
  9134.  
  9135.  C-u C-x ` discards the preparsed error message data and parses the 
  9136. `*compilation*' buffer over again, then displaying the first error. This way, 
  9137. you can process the same set of errors again. 
  9138.  
  9139.  Instead of running a compiler, you can run grep and see the lines on which 
  9140. matches were found.  To do this, type M-x grep with an argument line that 
  9141. contains the same arguments you would give grep when running it normally: a 
  9142. grep-style regexp (usually in single-quotes to quote the shell's special 
  9143. characters) followed by file names which may use wildcards. The output from 
  9144. grep goes in the `*grep*' buffer and the lines that matched can be found with 
  9145. C-x ` as if they were compilation errors. 
  9146.  
  9147.  Note: a shell is used to run the compile command, but the shell is told that 
  9148. it should be noninteractive.  This means in particular that the shell starts up 
  9149. with no prompt.  If you find your usual shell prompt making an unsightly 
  9150. appearance in the `*compilation*' buffer, it means you have made a mistake in 
  9151. your shell's init file (`.cshrc' or `.shrc' or ...) by setting the prompt 
  9152. unconditionally.  The shell init file should set the prompt only if there 
  9153. already is a prompt.  In csh, here is how to do it: 
  9154.  
  9155. if ($?prompt) set prompt = ...
  9156.  
  9157.  
  9158. ΓòÉΓòÉΓòÉ 26.2. Running Debuggers Under Emacs ΓòÉΓòÉΓòÉ
  9159.  
  9160. The GUD (Grand Unified Debugger) library provides an interface to various 
  9161. symbolic debuggers from within Emacs.  We recommend the debugger GDB, which is 
  9162. free software, but you can also run DBX or SDB if you have them. 
  9163.  
  9164.  
  9165. ΓòÉΓòÉΓòÉ 26.2.1. Starting GUD ΓòÉΓòÉΓòÉ
  9166.  
  9167.  There are three commands for starting a debugger, each corresponding to a 
  9168. particular debugger program. 
  9169.  
  9170. M-x gdb RET file RET 
  9171.           Run GDB as a subprocess of Emacs.  This command creates a buffer for 
  9172.           input and output to GDB, and switches to it.  If a GDB buffer already 
  9173.           exists, it just switches to that buffer. 
  9174.  
  9175. M-x dbx RET file RET 
  9176.           Similar, but run DBX instead of GDB. 
  9177.  
  9178. M-x sdb RET file RET 
  9179.           Similar, but run SDB instead of GDB. 
  9180.  
  9181.            Some versions of SDB do not mention source file names in their 
  9182.           messages.  When you use them, you need to have a valid tags table 
  9183.           (see Tags) in order for GUD to find functions in the source code. If 
  9184.           you have not visited a tags table or the tags table doesn't list one 
  9185.           of the functions, you get a message saying `The sdb support requires 
  9186.           a valid tags table to work'.  If this happens, generate a valid tags 
  9187.           table in the working directory and try again. 
  9188.  
  9189. M-x xdb 
  9190.           Similar, but run XDB instead of GDB. 
  9191.  
  9192.  You can only run one debugger process at a time. 
  9193.  
  9194.  Each of these commands takes one argument: a command line to invoke the 
  9195. debugger.  In the simplest case, specify just the name of the executable file 
  9196. you want to debug.  You may also use options that the debugger supports. 
  9197. However, shell wild cards and variables are not allowed.  GUD assumes that the 
  9198. first argument not preceded by a `-' is the executable file name. 
  9199.  
  9200.  
  9201. ΓòÉΓòÉΓòÉ 26.2.2. Debugger Operation ΓòÉΓòÉΓòÉ
  9202.  
  9203.  When you run a debugger with GUD, the debugger uses an Emacs buffer for its 
  9204. ordinary input and output.  This is called the GUD buffer.  The debugger uses 
  9205. other Emacs buffers to display the source files of the program.  An arrow 
  9206. (`=>') in one of these buffers indicates the current execution line.  Moving 
  9207. point in this buffer does not move the arrow. 
  9208.  
  9209.  You can start editing these source files at any time in the buffers that were 
  9210. made to display them.  The arrow is not part of the file's text; it appears 
  9211. only on the screen.  If you do modify a source file, keep in mind that 
  9212. inserting or deleting lines will throw off the arrow's positioning; GUD has no 
  9213. way of figuring out which line corresponded before your changes to the line 
  9214. number in a debugger message.  Also, you'll typically have to recompile and 
  9215. restart the program for your changes to be reflected in the debugger's tables. 
  9216.  
  9217. If you wish, you can control your debugger process entirely through the 
  9218. debugger buffer, which uses a variant of Shell mode.  All the usual commands 
  9219. for your debugger are available, and you can use the Shell mode history 
  9220. commands to repeat them. 
  9221.  
  9222.  
  9223. ΓòÉΓòÉΓòÉ 26.2.3. Commands of GUD ΓòÉΓòÉΓòÉ
  9224.  
  9225.  GUD provides a command available in all buffers for setting breakpoints.  This 
  9226. command is defined globally because you need to use it in the source files' 
  9227. buffers. 
  9228.  
  9229. C-x SPC 
  9230.           Set a breakpoint on the line that point is on. 
  9231.  
  9232.  Here are the other commands provided by GUD.  The keys starting with C-c are 
  9233. available only in the GUD interaction buffer.  The bindings that start with C-x 
  9234. C-a are available in the GUD buffer and also in source files. 
  9235.  
  9236. C-c C-l 
  9237. C-x C-a C-l 
  9238.           Display in another window the last line referred to in the GUD buffer 
  9239.           (that is, the line indicated in the last location message). This runs 
  9240.           the command gud-refresh. 
  9241.  
  9242. C-c C-s 
  9243. C-x C-a C-s 
  9244.           Execute a single line of code (gud-step).  If the code contains a 
  9245.           function call, execution stops after entering the called function. 
  9246.  
  9247. C-c C-n 
  9248. C-x C-a C-n 
  9249.           Execute a single line of code, stepping across entire function calls 
  9250.           at full speed (gud-next). 
  9251.  
  9252. C-c C-i 
  9253. C-x C-a C-i 
  9254.           Execute a single machine instruction (gud-stepi). 
  9255.  
  9256. C-c C-c 
  9257. C-x C-a C-c 
  9258.           Continue execution until the next breakpoint, or other event that 
  9259.           would normally stop the program (gud-cont). 
  9260.  
  9261. C-c C-d 
  9262. C-x C-a C-d 
  9263.           Delete the breakpoint(s) on the current source line, if any 
  9264.           (gud-remove).  If you use this command in the GUD interaction buffer, 
  9265.           it applies to the line where the program last stopped. 
  9266.  
  9267. C-c C-t 
  9268. C-x C-a C-t 
  9269.           Set a temporary breakpoint on the current source line, if any. If you 
  9270.           use this command in the GUD interaction buffer, it applies to the 
  9271.           line where the program last stopped. 
  9272.  
  9273.  The above commands are common to all supported debuggers.  If you are using 
  9274. GDB or (some versions of) DBX, these additional commands are available: 
  9275.  
  9276. C-c < 
  9277. C-x C-a < 
  9278.           Select the next enclosing stack frame (gud-up).  This is equivalent 
  9279.           to the `up' command. 
  9280.  
  9281. C-c > 
  9282. C-x C-a > 
  9283.           Select the next inner stack frame (gud-down).  This is equivalent to 
  9284.           the `down' command. 
  9285.  
  9286.  If you are using GDB, two additional keybindings are available: 
  9287.  
  9288. C-c C-f 
  9289. C-x C-a C-f 
  9290.           Run the program until the selected stack frame returns (or until it 
  9291.           stops for some other reason). 
  9292.  
  9293.  These commands interpret a prefix argument as a repeat count, when that makes 
  9294. sense. 
  9295.  
  9296.  
  9297. ΓòÉΓòÉΓòÉ 26.2.4. GUD Customization ΓòÉΓòÉΓòÉ
  9298.  
  9299.  On startup, GUD runs one of the following hooks: gdb-mode-hook, if you are 
  9300. using GDB; dbx-mode-hook, if you are using DBX; sdb-mode-hook, if you are using 
  9301. SDB; and xdb-mode-hook, if you are using XDB.  You can use these hooks to 
  9302. define custom keybindings for the debugger interaction buffer.  See Hooks. 
  9303.  
  9304.  Here is a convenient way to define a command that sends a particular command 
  9305. string to the debugger, and set up a key binding for it in the debugger 
  9306. interaction buffer: 
  9307.  
  9308. (gud-def function cmdstring binding docstring)
  9309.  
  9310.  This defines a command named function which sends cmdstring to the debugger 
  9311. process, with documentation string docstring.  You can use the command thus 
  9312. defined in any buffer. If binding is non-nil, gud-def also binds the command to 
  9313. C-c binding in the GUD buffer's mode and to C-x C-a binding generally. 
  9314.  
  9315.  The command string cmdstring may contain certain escape sequences that are 
  9316. filled in with varying data at the time function is called: 
  9317.  
  9318. `%f' 
  9319.           Name of the current source file.  If the current buffer is the GUD 
  9320.           buffer, then the ``current source file'' is the file that the program 
  9321.           stopped in. 
  9322.  
  9323. `%l' 
  9324.           Number of the current source line.  If the current buffer is the GUD 
  9325.           buffer, then the ``current source line'' is the line that the program 
  9326.           stopped in. 
  9327.  
  9328. `%e' 
  9329.           Text of the C lvalue or function-call expression surrounding point. 
  9330.  
  9331. `%a' 
  9332.           Text of the hexadecimal address surrounding point. 
  9333.  
  9334. `%p' 
  9335.           Prefix (numeric) argument of the called function (if any) as a 
  9336.           number. (If you don't use `%p' in the command string, the command you 
  9337.           define ignores any prefix argument.) 
  9338.  
  9339.  
  9340. ΓòÉΓòÉΓòÉ 26.3. Executing Lisp Expressions ΓòÉΓòÉΓòÉ
  9341.  
  9342.  Emacs has several different major modes for Lisp and Scheme.  They are the 
  9343. same in terms of editing commands, but differ in the commands for executing 
  9344. Lisp expressions. 
  9345.  
  9346. Emacs-Lisp mode 
  9347.           The mode for editing source files of programs to run in Emacs Lisp. 
  9348.           This mode defines C-M-x to evaluate the current defun. See Lisp 
  9349.           Libraries. 
  9350.  
  9351. Lisp Interaction mode 
  9352.           The mode for an interactive session with Emacs Lisp.  It defines LFD 
  9353.           to evaluate the sexp before point and insert its value in the buffer. 
  9354.           See Lisp Interaction. 
  9355.  
  9356. Lisp mode 
  9357.           The mode for editing source files of programs that run in Lisps other 
  9358.           than Emacs Lisp.  This mode defines C-M-x to send the current defun 
  9359.           to an inferior Lisp process.  See External Lisp. 
  9360.  
  9361. Inferior Lisp mode 
  9362.           The mode for an interactive session with an inferior Lisp process. 
  9363.           This mode combines the special features of Lisp mode and Shell mode 
  9364.           (see Shell Mode). 
  9365.  
  9366. Scheme mode 
  9367.           Like Lisp mode but for Scheme programs. 
  9368.  
  9369. Inferior Scheme mode 
  9370.           The mode for an interactive session with an inferior Scheme process. 
  9371.  
  9372.  
  9373. ΓòÉΓòÉΓòÉ 26.4. Libraries of Lisp Code for Emacs ΓòÉΓòÉΓòÉ
  9374.  
  9375.  Lisp code for Emacs editing commands is stored in files whose names 
  9376. conventionally end in `.el'.  This ending tells Emacs to edit them in 
  9377. Emacs-Lisp mode (see Executing Lisp). 
  9378.  
  9379.  To execute a file of Emacs Lisp code, use M-x load-file.  This command reads a 
  9380. file name using the minibuffer and then executes the contents of that file as 
  9381. Lisp code.  It is not necessary to visit the file first; in any case, this 
  9382. command reads the file as found on disk, not text in an Emacs buffer. 
  9383.  
  9384.  Once a file of Lisp code is installed in the Emacs Lisp library directories, 
  9385. users can load it using M-x load-library.  Programs can load it by calling 
  9386. load-library, or with load, a more primitive function that is similar but 
  9387. accepts some additional arguments. 
  9388.  
  9389.  M-x load-library differs from M-x load-file in that it searches a sequence of 
  9390. directories and tries three file names in each directory.  Suppose your 
  9391. argument is lib; the three names are `lib.elc', `lib.el', and lastly just 
  9392. `lib'.  If `lib.elc' exists, it is by convention the result of compiling 
  9393. `lib.el'; it is better to load the compiled file, since it will load and run 
  9394. faster. 
  9395.  
  9396.  If load-library finds that `lib.el' is newer than `lib.elc' file, it prints a 
  9397. warning, because it's likely that somebody made changes to the `.el' file and 
  9398. forgot to recompile it. 
  9399.  
  9400.  Because the argument to load-library is usually not in itself a valid file 
  9401. name, file name completion is not available.  Indeed, when using this command, 
  9402. you usually do not know exactly what file name will be used. 
  9403.  
  9404.  The sequence of directories searched by M-x load-library is specified by the 
  9405. variable load-path, a list of strings that are directory names.  The default 
  9406. value of the list contains the directory where the Lisp code for Emacs itself 
  9407. is stored.  If you have libraries of your own, put them in a single directory 
  9408. and add that directory to load-path.  nil in this list stands for the current 
  9409. default directory, but it is probably not a good idea to put nil in the list. 
  9410. If you find yourself wishing that nil were in the list, most likely what you 
  9411. really want to do is use M-x load-file this once. 
  9412.  
  9413.  Often you do not have to give any command to load a library, because the 
  9414. commands defined in the library are set up to autoload that library. Running 
  9415. any of those commands causes load to be called to load the library; this 
  9416. replaces the autoload definitions with the real ones from the library. 
  9417.  
  9418.  If autoloading a file does not finish, either because of an error or because 
  9419. of a C-g quit, all function definitions made by the file are undone 
  9420. automatically.  So are any calls to provide.  As a consequence, if you use one 
  9421. of the autoloadable commands again, the entire file will be loaded a second 
  9422. time.  This prevents problems where the command is no longer autoloading but it 
  9423. works wrong because not all the file was loaded. Function definitions are 
  9424. undone only for autoloading; explicit calls to load do not undo anything if 
  9425. loading is not completed. 
  9426.  
  9427.  Emacs Lisp code can be compiled into byte-code which loads faster, takes up 
  9428. less space when loaded, and executes faster. See Byte Compilation. 
  9429.  
  9430.  By convention, the compiled code for a library goes in a separate file whose 
  9431. name consists of the library source file with `c' appended. Thus, the compiled 
  9432. code for `foo.el' goes in `foo.elc'. That's why load-library searches for 
  9433. `.elc' files first. 
  9434.  
  9435.  
  9436. ΓòÉΓòÉΓòÉ 26.5. Evaluating Emacs-Lisp Expressions ΓòÉΓòÉΓòÉ
  9437.  
  9438.  Lisp programs intended to be run in Emacs should be edited in Emacs-Lisp mode; 
  9439. this happens automatically for file names ending in `.el'.  By contrast, Lisp 
  9440. mode itself is used for editing Lisp programs intended for other Lisp systems. 
  9441. To switch to Emacs-Lisp mode explicitly, use the command M-x emacs-lisp-mode. 
  9442.  
  9443.  For testing of Lisp programs to run in Emacs, it is often useful to evaluate 
  9444. part of the program as it is found in the Emacs buffer.  For example, after 
  9445. changing the text of a Lisp function definition, evaluating the definition 
  9446. installs the change for future calls to the function.  Evaluation of Lisp 
  9447. expressions is also useful in any kind of editing, for invoking noninteractive 
  9448. functions (functions that are not commands). 
  9449.  
  9450. M-ESC 
  9451.           Read a single Lisp expression in the minibuffer, evaluate it, and 
  9452.           print the value in the echo area (eval-expression). 
  9453.  
  9454. C-x C-e 
  9455.           Evaluate the Lisp expression before point, and print the value in the 
  9456.           echo area (eval-last-sexp). 
  9457.  
  9458. C-M-x 
  9459.           Evaluate the defun containing or after point, and print the value in 
  9460.           the echo area (eval-defun). 
  9461.  
  9462. M-x eval-region 
  9463.           Evaluate all the Lisp expressions in the region. 
  9464.  
  9465. M-x eval-current-buffer 
  9466.           Evaluate all the Lisp expressions in the buffer. 
  9467.  
  9468.  M-ESC (eval-expression) is the most basic command for evaluating a Lisp 
  9469. expression interactively.  It reads the expression using the minibuffer, so you 
  9470. can execute any expression on a buffer regardless of what the buffer contains. 
  9471. When the expression is evaluated, the current buffer is once again the buffer 
  9472. that was current when M-ESC was typed. 
  9473.  
  9474.  M-ESC can easily confuse users who do not understand it, especially on 
  9475. keyboards with autorepeat where it can result from holding down the ESC key for 
  9476. too long.  Therefore, eval-expression is normally a disabled command. 
  9477. Attempting to use this command asks for confirmation and gives you the option 
  9478. of enabling it; once you enable the command, confirmation will no longer be 
  9479. required for it. See Disabling. 
  9480.  
  9481.  In Emacs-Lisp mode, the key C-M-x is bound to the command eval-defun, which 
  9482. parses the defun containing or following point as a Lisp expression and 
  9483. evaluates it.  The value is printed in the echo area.  This command is 
  9484. convenient for installing in the Lisp environment changes that you have just 
  9485. made in the text of a function definition. 
  9486.  
  9487.  The command C-x C-e (eval-last-sexp) performs a similar job but is available 
  9488. in all major modes, not just Emacs-Lisp mode.  It finds the sexp before point, 
  9489. reads it as a Lisp expression, evaluates it, and prints the value in the echo 
  9490. area.  It is sometimes useful to type in an expression and then, with point 
  9491. still after it, type C-x C-e. 
  9492.  
  9493.  If C-M-x or C-x C-e is given a numeric argument, it prints the value by 
  9494. insertion into the current buffer at point, rather than in the echo area.  The 
  9495. argument value does not matter. 
  9496.  
  9497.  The most general command for evaluating Lisp expressions from a buffer is 
  9498. eval-region.  M-x eval-region parses the text of the region as one or more Lisp 
  9499. expressions, evaluating them one by one. M-x eval-current-buffer is similar but 
  9500. evaluates the entire buffer.  This is a reasonable way to install the contents 
  9501. of a file of Lisp code that you are just ready to test.  After finding and 
  9502. fixing a bug, use C-M-x on each function that you change, to keep the Lisp 
  9503. world in step with the source file. 
  9504.  
  9505.  
  9506. ΓòÉΓòÉΓòÉ 26.6. Lisp Interaction Buffers ΓòÉΓòÉΓòÉ
  9507.  
  9508.  The buffer `*scratch*' which is selected when Emacs starts up is provided for 
  9509. evaluating Lisp expressions interactively inside Emacs. 
  9510.  
  9511.  Thus, the way to use the `*scratch*' buffer is to insert Lisp expressions at 
  9512. the end, ending each one with LFD so that it will be evaluated.  This command 
  9513. reads the Lisp expression before point, evaluates it, and inserts the value in 
  9514. printed representation before point.  The result is a complete typescript of 
  9515. the expressions you have evaluated and their values. 
  9516.  
  9517.  The `*scratch*' buffer's major mode is Lisp Interaction mode, which is the 
  9518. same as Emacs-Lisp mode except for the binding of LFD. 
  9519.  
  9520.  The rationale for this feature is that Emacs must have a buffer when it starts 
  9521. up, but that buffer is not useful for editing files since a new buffer is made 
  9522. for every file that you visit.  The Lisp interpreter typescript is the most 
  9523. useful thing I can think of for the initial buffer to do.  Type M-x 
  9524. lisp-interaction-mode to put the current buffer in Lisp Interaction mode. 
  9525.  
  9526.  
  9527. ΓòÉΓòÉΓòÉ 26.7. Running an External Lisp ΓòÉΓòÉΓòÉ
  9528.  
  9529.  Emacs has facilities for running programs in other Lisp systems.  You can run 
  9530. a Lisp process as an inferior of Emacs, and pass expressions to it to be 
  9531. evaluated.  You can also pass changed function definitions directly from the 
  9532. Emacs buffers in which you edit the Lisp programs to the inferior Lisp process. 
  9533.  
  9534.  To run an inferior Lisp process, type M-x run-lisp.  This runs the program 
  9535. named lisp, the same program you would run by typing lisp as a shell command, 
  9536. with both input and output going through an Emacs buffer named `*lisp*'.  That 
  9537. is to say, any ``terminal output'' from Lisp will go into the buffer, advancing 
  9538. point, and any ``terminal input'' for Lisp comes from text in the buffer.  (You 
  9539. can change the name of the Lisp executable file by setting the variable 
  9540. inferior-lisp-program.) 
  9541.  
  9542.  To give input to Lisp, go to the end of the buffer and type the input, 
  9543. terminated by RET.  The `*lisp*' buffer is in Inferior Lisp mode, which 
  9544. combines the special characteristics of Lisp mode and Shell mode (see Shell 
  9545. Mode). 
  9546.  
  9547.  For the source files of programs to run in external Lisps, use Lisp mode. This 
  9548. mode can be selected with M-x lisp-mode, and is used automatically for files 
  9549. whose names end in `.l' or `.lisp', as most Lisp systems usually expect. 
  9550.  
  9551.  When you edit a function in a Lisp program you are running, the easiest way to 
  9552. send the changed definition to the inferior Lisp process is the key C-M-x.  In 
  9553. Lisp mode, this runs the function lisp-send-defun, which finds the defun around 
  9554. or following point and sends it as input to the Lisp process.  (Emacs can send 
  9555. input to any inferior process regardless of what buffer is current.) 
  9556.  
  9557.  Contrast the meanings of C-M-x in Lisp mode (for editing programs to be run in 
  9558. another Lisp system) and Emacs-Lisp mode (for editing Lisp programs to be run 
  9559. in Emacs): in both modes it has the effect of installing the function 
  9560. definition that point is in, but the way of doing so is different according to 
  9561. where the relevant Lisp environment is found. See Executing Lisp. 
  9562.  
  9563.  
  9564. ΓòÉΓòÉΓòÉ 27. Abbrevs ΓòÉΓòÉΓòÉ
  9565.  
  9566.  An abbrev is a word which expands, if you insert it, into some different text. 
  9567. Abbrevs are defined by the user to expand in specific ways.  For example, you 
  9568. might define `foo' as an abbrev expanding to `find outer otter'.  With this 
  9569. abbrev defined, you would be able to get `find outer otter ' into the buffer by 
  9570. typing f o o SPC. 
  9571.  
  9572.  Abbrevs expand only when Abbrev mode (a minor mode) is enabled. Disabling 
  9573. Abbrev mode does not cause abbrev definitions to be forgotten, but they do not 
  9574. expand until Abbrev mode is enabled again.  The command M-x abbrev-mode toggles 
  9575. Abbrev mode; with a numeric argument, it turns Abbrev mode on if the argument 
  9576. is positive, off otherwise. See Minor Modes.  abbrev-mode is also a variable; 
  9577. Abbrev mode is on when the variable is non-nil.  The variable abbrev-mode 
  9578. automatically becomes local to the current buffer when it is set. 
  9579.  
  9580.  Abbrev definitions can be mode-specific---active only in one major mode. 
  9581. Abbrevs can also have global definitions that are active in all major modes. 
  9582. The same abbrev can have a global definition and various mode-specific 
  9583. definitions for different major modes.  A mode specific definition for the 
  9584. current major mode overrides a global definition. 
  9585.  
  9586.  Abbrevs can be defined interactively during the editing session.  Lists of 
  9587. abbrev definitions can also be saved in files and reloaded in later sessions. 
  9588. Some users keep extensive lists of abbrevs that they load in every session. 
  9589.  
  9590.  A second kind of abbreviation facility is called the dynamic expansion. 
  9591. Dynamic abbrev expansion happens only when you give an explicit command and the 
  9592. result of the expansion depends only on the current contents of the buffer. 
  9593. See Dynamic Abbrevs. 
  9594.  
  9595.  
  9596. ΓòÉΓòÉΓòÉ 27.1. Defining Abbrevs ΓòÉΓòÉΓòÉ
  9597.  
  9598. C-x a g 
  9599.           Define an abbrev, using one or more words before point as its 
  9600.           expansion (add-global-abbrev). 
  9601.  
  9602. C-x a l 
  9603.           Similar, but define an abbrev specific to the current major mode 
  9604.           (add-mode-abbrev). 
  9605.  
  9606. C-x a i g 
  9607.           Define a word in the buffer as an abbrev (inverse-add-global-abbrev). 
  9608.  
  9609. C-x a i l 
  9610.           Define a word in the buffer as a mode-specific abbrev 
  9611.           (inverse-add-mode-abbrev). 
  9612.  
  9613. M-x kill-all-abbrevs 
  9614.           After this command, there are no abbrev definitions in effect. 
  9615.  
  9616.  The usual way to define an abbrev is to enter the text you want the abbrev to 
  9617. expand to, position point after it, and type C-x a g (add-global-abbrev).  This 
  9618. reads the abbrev itself using the minibuffer, and then defines it as an abbrev 
  9619. for one or more words before point.  Use a numeric argument to say how many 
  9620. words before point should be taken as the expansion.  For example, to define 
  9621. the abbrev `foo' as mentioned above, insert the text `find outer otter' and 
  9622. then type C-u 3 C-x a g f o o RET. 
  9623.  
  9624.  An argument of zero to C-x a g means to use the contents of the region as the 
  9625. expansion of the abbrev being defined. 
  9626.  
  9627.  The command C-x a l (add-mode-abbrev) is similar, but defines a mode-specific 
  9628. abbrev.  Mode specific abbrevs are active only in a particular major mode.  C-x 
  9629. a l defines an abbrev for the major mode in effect at the time C-x a l is 
  9630. typed.  The arguments work the same as for C-x a g. 
  9631.  
  9632.  If the text of the abbrev you want is already in the buffer instead of the 
  9633. expansion, use command C-x a i g (inverse-add-global-abbrev) instead of C-x a 
  9634. g, or use C-x a i l (inverse-add-mode-abbrev) instead of C-x a l.  These 
  9635. commands are called ``inverse'' because they invert the meaning of the argument 
  9636. found in the buffer and the argument read using the minibuffer. 
  9637.  
  9638.  To change the definition of an abbrev, just add the new definition. You will 
  9639. be asked to confirm if the abbrev has a prior definition.  To remove an abbrev 
  9640. definition, give a negative argument to C-x a g or C-x a l.  You must choose 
  9641. the command to specify whether to kill a global definition or a mode-specific 
  9642. definition for the current mode, since those two definitions are independent 
  9643. for one abbrev. 
  9644.  
  9645.  M-x kill-all-abbrevs removes all the abbrev definitions there are. 
  9646.  
  9647.  
  9648. ΓòÉΓòÉΓòÉ 27.2. Controlling Abbrev Expansion ΓòÉΓòÉΓòÉ
  9649.  
  9650.  An abbrev expands whenever it is present in the buffer just before point and a 
  9651. self-inserting punctuation character (SPC, comma, etc.) is typed.  Most often 
  9652. the way an abbrev is used is to insert the abbrev followed by punctuation. 
  9653.  
  9654.  Abbrev expansion preserves case; thus, `foo' expands into `find outer otter'; 
  9655. `Foo' into `Find outer otter', and `FOO' into `FIND OUTER OTTER' or `Find Outer 
  9656. Otter' according to the variable abbrev-all-caps (a non-nil value chooses the 
  9657. first of the two expansions). 
  9658.  
  9659.  These two commands are used to control abbrev expansion: 
  9660.  
  9661. M-' 
  9662.           Separate a prefix from a following abbrev to be expanded 
  9663.           (abbrev-prefix-mark). 
  9664.  
  9665. C-x a e 
  9666.           Expand the abbrev before point (expand-abbrev). This is effective 
  9667.           even when Abbrev mode is not enabled. 
  9668.  
  9669. M-x unexpand-abbrev 
  9670.           Undo last abbrev expansion. 
  9671.  
  9672. M-x expand-region-abbrevs 
  9673.           Expand some or all abbrevs found in the region. 
  9674.  
  9675.  You may wish to expand an abbrev with a prefix attached; for example, if 
  9676. `cnst' expands into `construction', you might want to use it to enter 
  9677. `reconstruction'.  It does not work to type recnst, because that is not 
  9678. necessarily a defined abbrev.  What does work is to use the command M-' 
  9679. (abbrev-prefix-mark) in between the prefix `re' and the abbrev `cnst'.  First, 
  9680. insert `re'.  Then type M-'; this inserts a minus sign in the buffer to 
  9681. indicate that it has done its work.  Then insert the abbrev `cnst'; the buffer 
  9682. now contains `re-cnst'.  Now insert a punctuation character to expand the 
  9683. abbrev `cnst' into `construction'.  The minus sign is deleted at this point, 
  9684. because M-' left word for this to be done.  The resulting text is the desired 
  9685. `reconstruction'. 
  9686.  
  9687.  If you actually want the text of the abbrev in the buffer, rather than its 
  9688. expansion, you can accomplish this by inserting the following punctuation with 
  9689. C-q.  Thus, foo C-q - leaves `foo-' in the buffer. 
  9690.  
  9691.  If you expand an abbrev by mistake, you can undo the expansion (replace the 
  9692. expansion by the original abbrev text) with M-x unexpand-abbrev.  C-_ (undo) 
  9693. can also be used to undo the expansion; but first it undoes the insertion of 
  9694. the following punctuation character.  Therefore, if you want both the 
  9695. punctuation character and the unexpanded abbrev, you must reinsert the 
  9696. punctuation character, quoting it with C-q. 
  9697.  
  9698.  M-x expand-region-abbrevs searches through the region for defined abbrevs, and 
  9699. for each one found offers to replace it with its expansion. This command is 
  9700. useful if you have typed in text using abbrevs but forgot to turn on Abbrev 
  9701. mode first.  It may also be useful together with a special set of abbrev 
  9702. definitions for making several global replacements at once.  This command is 
  9703. effective even if Abbrev mode is not enabled. 
  9704.  
  9705.  Expanding an abbrev runs the hook pre-abbrev-expand-hook (see Hooks). 
  9706.  
  9707.  
  9708. ΓòÉΓòÉΓòÉ 27.3. Examining and Editing Abbrevs ΓòÉΓòÉΓòÉ
  9709.  
  9710. M-x list-abbrevs 
  9711.           Print a list of all abbrev definitions. 
  9712.  
  9713. M-x edit-abbrevs 
  9714.           Edit a list of abbrevs; you can add, alter or remove definitions. 
  9715.  
  9716.  The output from M-x list-abbrevs looks like this: 
  9717.  
  9718. (lisp-mode-abbrev-table)
  9719. "dk"           0    "define-key"
  9720. (global-abbrev-table)
  9721. "dfn"          0    "definition"
  9722.  
  9723. (Some blank lines of no semantic significance, and some other abbrev tables, 
  9724. have been omitted.) 
  9725.  
  9726.  A line containing a name in parentheses is the header for abbrevs in a 
  9727. particular abbrev table; global-abbrev-table contains all the global abbrevs, 
  9728. and the other abbrev tables that are named after major modes contain the 
  9729. mode-specific abbrevs. 
  9730.  
  9731.  Within each abbrev table, each nonblank line defines one abbrev.  The word at 
  9732. the beginning is the abbrev.  The number that appears is the number of times 
  9733. the abbrev has been expanded.  Emacs keeps track of this to help you see which 
  9734. abbrevs you actually use, in case you decide to eliminate those that you don't 
  9735. use often.  The string at the end of the line is the expansion. 
  9736.  
  9737.  M-x edit-abbrevs allows you to add, change or kill abbrev definitions by 
  9738. editing a list of them in an Emacs buffer.  The list has the same format 
  9739. described above.  The buffer of abbrevs is called `*Abbrevs*', and is in 
  9740. Edit-Abbrevs mode.  This mode redefines the key C-c C-c to install the abbrev 
  9741. definitions as specified in the buffer.  The command that does this is 
  9742. edit-abbrevs-redefine.  Any abbrevs not described in the buffer are eliminated 
  9743. when this is done. 
  9744.  
  9745.  The command edit-abbrevs is actually the same as list-abbrevs except that it 
  9746. selects the buffer `*Abbrevs*' whereas list-abbrevs merely displays it in 
  9747. another window. 
  9748.  
  9749.  
  9750. ΓòÉΓòÉΓòÉ 27.4. Saving Abbrevs ΓòÉΓòÉΓòÉ
  9751.  
  9752.  These commands allow you to keep abbrev definitions between editing sessions. 
  9753.  
  9754. M-x write-abbrev-file 
  9755.           Write a file describing all defined abbrevs. 
  9756.  
  9757. M-x read-abbrev-file 
  9758.           Read such a file and define abbrevs as specified there. 
  9759.  
  9760. M-x quietly-read-abbrev-file 
  9761.           Similar but do not display a message about what is going on. 
  9762.  
  9763. M-x define-abbrevs 
  9764.           Define abbrevs from definitions in current buffer. 
  9765.  
  9766. M-x insert-abbrevs 
  9767.           Insert all abbrevs and their expansions into current buffer. 
  9768.  
  9769.  M-x write-abbrev-file reads a file name using the minibuffer and writes a 
  9770. description of all current abbrev definitions into that file.  The text stored 
  9771. in the file looks like the output of M-x list-abbrevs. This is used to save 
  9772. abbrev definitions for use in a later session. 
  9773.  
  9774.  M-x read-abbrev-file reads a file name using the minibuffer and reads the 
  9775. file, defining abbrevs according to the contents of the file. M-x 
  9776. quietly-read-abbrev-file is the same except that it does not display a message 
  9777. in the echo area saying that it is doing its work; it is actually useful 
  9778. primarily in the `.emacs' file.  If an empty argument is given to either of 
  9779. these functions, the file name used is the value of the variable 
  9780. abbrev-file-name, which is by default "~/.abbrev_defs". 
  9781.  
  9782.  Emacs will offer to save abbrevs automatically if you have changed any of 
  9783. them, whenever it offers to save all files (for C-x s or C-x C-c).  This 
  9784. feature can be inhibited by setting the variable save-abbrevs to nil. 
  9785.  
  9786.  The commands M-x insert-abbrevs and M-x define-abbrevs are similar to the 
  9787. previous commands but work on text in an Emacs buffer. M-x insert-abbrevs 
  9788. inserts text into the current buffer before point, describing all current 
  9789. abbrev definitions; M-x define-abbrevs parses the entire current buffer and 
  9790. defines abbrevs accordingly. 
  9791.  
  9792.  
  9793. ΓòÉΓòÉΓòÉ 27.5. Dynamic Abbrev Expansion ΓòÉΓòÉΓòÉ
  9794.  
  9795.  The abbrev facility described above operates automatically as you insert text, 
  9796. but all abbrevs must be defined explicitly.  By contrast, dynamic abbrevs allow 
  9797. the meanings of abbrevs to be determined automatically from the contents of the 
  9798. buffer, but dynamic abbrev expansion happens only when you request it 
  9799. explicitly. 
  9800.  
  9801. M-/ 
  9802.           Expand the word in the buffer before point as a dynamic abbrev, by 
  9803.           searching in the buffer for words starting with that abbreviation 
  9804.           (dabbrev-expand). 
  9805.  
  9806.  For example, if the buffer contains `does this follow ' and you type f o M-/, 
  9807. the effect is to insert `follow' because that is the last word in the buffer 
  9808. that starts with `fo'.  A numeric argument to M-/ says to take the second, 
  9809. third, etc. distinct expansion found looking backward from point.  Repeating 
  9810. M-/ searches for an alternative expansion by looking farther back.  After the 
  9811. entire buffer before point has been considered, the buffer after point is 
  9812. searched. 
  9813.  
  9814.  Dynamic abbrev expansion is completely independent of Abbrev mode; the 
  9815. expansion of a word with M-/ is completely independent of whether it has a 
  9816. definition as an ordinary abbrev. 
  9817.  
  9818.  
  9819. ΓòÉΓòÉΓòÉ 28. Editing Pictures ΓòÉΓòÉΓòÉ
  9820.  
  9821.  If you want to create a picture made out of text characters (for example, a 
  9822. picture of the division of a register into fields, as a comment in a program), 
  9823. use the command M-x edit-picture to enter Picture mode. 
  9824.  
  9825.  In Picture mode, editing is based on the quarter-plane model of text, 
  9826. according to which the text characters lie studded on an area that stretches 
  9827. infinitely far to the right and downward.  The concept of the end of a line 
  9828. does not exist in this model; the most you can say is where the last nonblank 
  9829. character on the line is found. 
  9830.  
  9831.  Of course, Emacs really always considers text as a sequence of characters, and 
  9832. lines really do have ends.  But in Picture mode most frequently-used keys are 
  9833. rebound to commands that simulate the quarter-plane model of text.  They do 
  9834. this by inserting spaces or by converting tabs to spaces. 
  9835.  
  9836.  Most of the basic editing commands of Emacs are redefined by Picture mode to 
  9837. do essentially the same thing but in a quarter-plane way.  In addition, Picture 
  9838. mode defines various keys starting with the C-c prefix to run special picture 
  9839. editing commands. 
  9840.  
  9841.  One of these keys, C-c C-c, is pretty important.  Often a picture is part of a 
  9842. larger file that is usually edited in some other major mode.  M-x edit-picture 
  9843. records the name of the previous major mode so you can use the C-c C-c command 
  9844. (picture-mode-exit) later to go back to that mode.  C-c C-c also deletes spaces 
  9845. from the ends of lines, unless given a numeric argument. 
  9846.  
  9847.  The commands used in Picture mode all work in other modes (provided the 
  9848. `picture' library is loaded), but are not bound to keys except in Picture mode. 
  9849. Note that the descriptions below talk of moving ``one column'' and so on, but 
  9850. all the picture mode commands handle numeric arguments as their normal 
  9851. equivalents do. 
  9852.  
  9853.  Turning on Picture mode runs the hook picture-mode-hook (see Hooks). 
  9854.  
  9855.  
  9856. ΓòÉΓòÉΓòÉ 28.1. Basic Editing in Picture Mode ΓòÉΓòÉΓòÉ
  9857.  
  9858.  Most keys do the same thing in Picture mode that they usually do, but do it in 
  9859. a quarter-plane style.  For example, C-f is rebound to run 
  9860. picture-forward-column, a command which moves point one column to the right, 
  9861. inserting a space if necessary so that the actual end of the line makes no 
  9862. difference.  C-b is rebound to run picture-backward-column, which always moves 
  9863. point left one column, converting a tab to multiple spaces if necessary.  C-n 
  9864. and C-p are rebound to run picture-move-down and picture-move-up, which can 
  9865. either insert spaces or convert tabs as necessary to make sure that point stays 
  9866. in exactly the same column. C-e runs picture-end-of-line, which moves to after 
  9867. the last nonblank character on the line.  There is no need to change C-a, as 
  9868. the choice of screen model does not affect beginnings of lines. 
  9869.  
  9870.  Insertion of text is adapted to the quarter-plane screen model through the use 
  9871. of Overwrite mode (see Minor Modes).  Self-inserting characters replace 
  9872. existing text, column by column, rather than pushing existing text to the 
  9873. right.  RET runs picture-newline, which just moves to the beginning of the 
  9874. following line so that new text will replace that line. 
  9875.  
  9876.  Picture mode provides erasure instead of deletion and killing of text.  DEL 
  9877. (picture-backward-clear-column) replaces the preceding character with a space 
  9878. rather than removing it; this moves point backwards.  C-d 
  9879. (picture-clear-column) replaces the next character or characters with spaces, 
  9880. but does not move point.  (If you want to clear characters to spaces and move 
  9881. forward over them, use SPC.)  C-k (picture-clear-line) really kills the 
  9882. contents of lines, but does not delete the newlines from the buffer. 
  9883.  
  9884.  To do actual insertion, you must use special commands.  C-o 
  9885. (picture-open-line) still creates a blank line, but does so after the current 
  9886. line; it never splits a line.  C-M-o, split-line, makes sense in Picture mode, 
  9887. so it is not changed.  LFD (picture-duplicate-line) inserts below the current 
  9888. line another line with the same contents. 
  9889.  
  9890.  If you want to do real deletion in Picture mode, use C-w, C-c C-d (which is 
  9891. defined as delete-char, as C-d is in other modes), or one of the picture 
  9892. rectangle commands (see Rectangles in Picture). 
  9893.  
  9894.  
  9895. ΓòÉΓòÉΓòÉ 28.2. Controlling Motion after Insert ΓòÉΓòÉΓòÉ
  9896.  
  9897.  Since ``self-inserting'' characters in Picture mode just overwrite and move 
  9898. point, there is no essential restriction on how point should be moved. Normally 
  9899. point moves right, but you can specify any of the eight orthogonal or diagonal 
  9900. directions for motion after a ``self-inserting'' character. This is useful for 
  9901. drawing lines in the buffer. 
  9902.  
  9903. C-c < 
  9904.           Move left after insertion (picture-movement-left). 
  9905.  
  9906. C-c > 
  9907.           Move right after insertion (picture-movement-right). 
  9908.  
  9909. C-c ^ 
  9910.           Move up after insertion (picture-movement-up). 
  9911.  
  9912. C-c . 
  9913.           Move down after insertion (picture-movement-down). 
  9914.  
  9915. C-c ` 
  9916.           Move up and left (``northwest'') after insertion 
  9917.           (picture-movement-nw). 
  9918.  
  9919. C-c ' 
  9920.           Move up and right (``northeast'') after insertion 
  9921.           (picture-movement-ne). 
  9922.  
  9923. C-c / 
  9924.           Move down and left (``southwest'') after insertion 
  9925.           (picture-movement-sw). 
  9926.  
  9927. C-c \ 
  9928.           Move down and right (``southeast'') after insertion 
  9929.           (picture-movement-se). 
  9930.  
  9931.  Two motion commands move based on the current Picture insertion direction. 
  9932. The command C-c C-f (picture-motion) moves in the same direction as motion 
  9933. after ``insertion'' currently does, while C-c C-b (picture-motion-reverse) 
  9934. moves in the opposite direction. 
  9935.  
  9936.  
  9937. ΓòÉΓòÉΓòÉ 28.3. Picture Mode Tabs ΓòÉΓòÉΓòÉ
  9938.  
  9939.  Two kinds of tab-like action are provided in Picture mode.  Use M-TAB 
  9940. (picture-tab-search) for context-based tabbing.  With no argument, it moves to 
  9941. a point underneath the next ``interesting'' character that follows whitespace 
  9942. in the previous nonblank line.  ``Next'' here means ``appearing at a horizontal 
  9943. position greater than the one point starts out at''.  With an argument, as in 
  9944. C-u M-TAB, this command moves to the next such interesting character in the 
  9945. current line.  M-TAB does not change the text; it only moves point. 
  9946. ``Interesting'' characters are defined by the variable picture-tab-chars, which 
  9947. contains a string whose characters are all considered interesting.  Its default 
  9948. value is "!-~". 
  9949.  
  9950.  TAB itself runs picture-tab, which operates based on the current tab stop 
  9951. settings; it is the Picture mode equivalent of tab-to-tab-stop.  Normally it 
  9952. just moves point, but with a numeric argument it clears the text that it moves 
  9953. over. 
  9954.  
  9955.  The context-based and tab-stop-based forms of tabbing are brought together by 
  9956. the command C-c TAB, picture-set-tab-stops. This command sets the tab stops to 
  9957. the positions which M-TAB would consider significant in the current line.  The 
  9958. use of this command, together with TAB, can get the effect of context-based 
  9959. tabbing.  But M-TAB is more convenient in the cases where it is sufficient. 
  9960.  
  9961.  
  9962. ΓòÉΓòÉΓòÉ 28.4. Picture Mode Rectangle Commands ΓòÉΓòÉΓòÉ
  9963.  
  9964.  Picture mode defines commands for working on rectangular pieces of the text in 
  9965. ways that fit with the quarter-plane model.  The standard rectangle commands 
  9966. may also be useful (see Rectangles). 
  9967.  
  9968. C-c C-k 
  9969.           Clear out the region-rectangle (picture-clear-rectangle).  With 
  9970.           argument, kill it. 
  9971.  
  9972. C-c C-w r 
  9973.           Similar but save rectangle contents in register r first 
  9974.           (picture-clear-rectangle-to-register). 
  9975.  
  9976. C-c C-y 
  9977.           Copy last killed rectangle into the buffer by overwriting, with upper 
  9978.           left corner at point (picture-yank-rectangle).  With argument, insert 
  9979.           instead. 
  9980.  
  9981. C-c C-x r 
  9982.           Similar, but use the rectangle in register r 
  9983.           (picture-yank-rectangle-from-register). 
  9984.  
  9985.  The picture rectangle commands C-c C-k (picture-clear-rectangle) and C-c C-w 
  9986. (picture-clear-rectangle-to-register) differ from the standard rectangle 
  9987. commands in that they normally clear the rectangle instead of deleting it; this 
  9988. is analogous with the way C-d is changed in Picture mode. 
  9989.  
  9990.  However, deletion of rectangles can be useful in Picture mode, so these 
  9991. commands delete the rectangle if given a numeric argument. 
  9992.  
  9993.  The Picture mode commands for yanking rectangles differ from the standard ones 
  9994. in overwriting instead of inserting.  This is the same way that Picture mode 
  9995. insertion of other text differs from other modes. C-c C-y 
  9996. (picture-yank-rectangle) inserts (by overwriting) the rectangle that was most 
  9997. recently killed, while C-c C-x (picture-yank-rectangle-from-register) does 
  9998. likewise for the rectangle found in a specified register. 
  9999.  
  10000.  
  10001. ΓòÉΓòÉΓòÉ 29. Sending Mail ΓòÉΓòÉΓòÉ
  10002.  
  10003.  To send a message in Emacs, you start by typing a command (C-x m) to select 
  10004. and initialize the `*mail*' buffer.  Then you edit the text and headers of the 
  10005. message in this buffer, and type another command (C-c C-c) to send the message. 
  10006.  
  10007. C-x m 
  10008.           Begin composing a message to send (mail). 
  10009.  
  10010. C-x 4 m 
  10011.           Likewise, but display the message in another window 
  10012.           (mail-other-window). 
  10013.  
  10014. C-x 5 m 
  10015.           Likewise, but make a new frame (mail-other-frame). 
  10016.  
  10017. C-c C-c 
  10018.           In Mail mode, send the message and switch to another buffer 
  10019.           (mail-send-and-exit). 
  10020.  
  10021.  The command C-x m (mail) selects a buffer named `*mail*' and initializes it 
  10022. with the skeleton of an outgoing message.  C-x 4 m (mail-other-window) selects 
  10023. the `*mail*' buffer in a different window, leaving the previous current buffer 
  10024. visible.  C-x 5 m (mail-other-frame) creates a new frame to select the `*mail*' 
  10025. buffer. 
  10026.  
  10027.  Because the mail composition buffer is an ordinary Emacs buffer, you can 
  10028. switch to other buffers while in the middle of composing mail, and switch back 
  10029. later (or never).  If you use the C-x m command again when you have been 
  10030. composing another message but have not sent it, you are asked to confirm before 
  10031. the old message is erased.  If you answer n, the `*mail*' buffer is left 
  10032. selected with its old contents, so you can finish the old message and send it. 
  10033. C-u C-x m is another way to do this.  Sending the message marks the `*mail*' 
  10034. buffer ``unmodified'', which avoids the need for confirmation when C-x m is 
  10035. next used. 
  10036.  
  10037.  If you are composing a message in the `*mail*' buffer and want to send another 
  10038. message before finishing the first, rename the `*mail*' buffer using M-x 
  10039. rename-uniquely ( see Misc Buffer).  Then you can use C-x m or its variants 
  10040. described above to make a new `*mail' buffer.  Once you've done that, you can 
  10041. work with each mail buffer independently. 
  10042.  
  10043.  
  10044. ΓòÉΓòÉΓòÉ 29.1. The Format of the Mail Buffer ΓòÉΓòÉΓòÉ
  10045.  
  10046.  In addition to the text or body, a message has header fields which say who 
  10047. sent it, when, to whom, why, and so on.  Some header fields such as the date 
  10048. and sender are created automatically after the message is sent.  Others, such 
  10049. as the recipient names, must be specified by you in order to send the message 
  10050. properly. 
  10051.  
  10052.  Mail mode provides a few commands to help you edit some header fields, and 
  10053. some are preinitialized in the buffer automatically at times.  You can insert 
  10054. or edit any header fields using ordinary editing commands. 
  10055.  
  10056.  The line in the buffer that says 
  10057.  
  10058. --text follows this line--
  10059.  
  10060. is a special delimiter that separates the headers you have specified from the 
  10061. text.  Whatever follows this line is the text of the message; the headers 
  10062. precede it.  The delimiter line itself does not appear in the message actually 
  10063. sent.  The text used for the delimiter line is controlled by the variable 
  10064. mail-header-separator. 
  10065.  
  10066. Here is an example of what the headers and text in the `*mail*' buffer might 
  10067. look like. 
  10068.  
  10069. To: gnu@prep.ai.mit.edu
  10070. CC: lungfish@spam.org, byob@spam.org
  10071. Subject: The Emacs Manual
  10072. --Text follows this line--
  10073. Please ignore this message.
  10074.  
  10075.  
  10076. ΓòÉΓòÉΓòÉ 29.2. Mail Header Fields ΓòÉΓòÉΓòÉ
  10077.  
  10078.  There are several header fields you can use in the `*mail*' buffer.  Each 
  10079. header field starts with a field name at the beginning of a line, terminated by 
  10080. a colon.  Upper and lower case are equivalent in field names (and in mailing 
  10081. addresses also).  After the colon and optional whitespace comes the contents of 
  10082. the field. 
  10083.  
  10084. `To' 
  10085.           This field contains the mailing addresses to which the message is 
  10086.           addressed. 
  10087.  
  10088. `Subject' 
  10089.           The contents of the `Subject' field should be a piece of text that 
  10090.           says what the message is about.  The reason `Subject' fields are 
  10091.           useful is that most mail-reading programs can provide a summary of 
  10092.           messages, listing the subject of each message but not its text. 
  10093.  
  10094. `CC' 
  10095.           This field contains additional mailing addresses to send the message 
  10096.           to, but whose readers should not regard the message as addressed to 
  10097.           them. 
  10098.  
  10099. `BCC' 
  10100.           This field contains additional mailing addresses to send the message 
  10101.           to, which should not appear in the header of the message actually 
  10102.           sent. Copies sent this way are called blind carbon copies. 
  10103.  
  10104.           To send a blind carbon copy of every outgoing message to yourself, 
  10105.           set the variable mail-self-blind to t. 
  10106.  
  10107. `FCC' 
  10108.           This field contains the name of one file (in system mail file format) 
  10109.           to which a copy of the message should be appended when the message is 
  10110.           sent.  Do not output directly into an Rmail file with FCC; instead, 
  10111.           output to an inbox file and ``get new mail'' from that inbox file 
  10112.           into the Rmail file.  See Rmail Inbox. 
  10113.  
  10114. `From' 
  10115.           Use the `From' field to say who you are, when the account you are 
  10116.           using to send the mail is not your own.  The contents of the `From' 
  10117.           field should be a valid mailing address, since replies will normally 
  10118.           go there. 
  10119.  
  10120. `Reply-to' 
  10121.           Use this field to direct replies to a different address.  Most 
  10122.           mail-reading programs (including Rmail) automatically send replies to 
  10123.           the `Reply-to' address in preference to the `From' address. By adding 
  10124.           a `Reply-to' field to your header, you can work around any problems 
  10125.           your `From' address may cause for replies. 
  10126.  
  10127.           If you want to put the same `Reply-to' address into every outgoing 
  10128.           message, set the variable mail-default-reply-to to that address (as a 
  10129.           string). 
  10130.  
  10131. `In-reply-to' 
  10132.           This field contains a piece of text describing a message you are 
  10133.           replying to.  Some mail systems can use this information to correlate 
  10134.           related pieces of mail.  Normally this field is filled in by Rmail 
  10135.           when you are replying to a message in Rmail, and you never need to 
  10136.           think about it (see Rmail). 
  10137.  
  10138. The `To', `CC', `BCC' and `FCC' fields can appear any number of times, to 
  10139. specify many places to send the message. 
  10140.  
  10141. The `To', `CC', and `BCC' fields can have continuation lines.  All the lines 
  10142. starting with whitespace, following the line on which the field starts, are 
  10143. considered part of the field.  For example, 
  10144.  
  10145. To: foo@here.net, this@there.net,
  10146.   me@gnu.cambridge.mass.usa.earth.spiral3281
  10147.  
  10148.  If the variable mail-archive-file-name is non-nil, it should be a string 
  10149. naming a file; every time you start to edit a message to send, the message 
  10150. starts out with an `FCC' field specifying that file.  Unless you remove the 
  10151. `FCC' field before sending, the message will be written into that file when it 
  10152. is sent. 
  10153.  
  10154.  
  10155. ΓòÉΓòÉΓòÉ 29.3. Mail Aliases ΓòÉΓòÉΓòÉ
  10156.  
  10157.  You can define mail aliases in a file named `~/.mailrc'. These are short 
  10158. mnemonic names stand for mail addresses or groups of mail addresses.  Like many 
  10159. other mail programs, Emacs expands aliases when they occur in the `To', `CC', 
  10160. and `BCC' fields. 
  10161.  
  10162.  To define an alias in `~/.mailrc', write a line in the following format: 
  10163.  
  10164. alias shortaddress fulladdress
  10165.  
  10166. For instance, if you send want to use maingnu as a short form of the address 
  10167. gnu@prep.ai.mit.edu, put in the line: 
  10168.  
  10169. alias maingnu gnu@prep.ai.mit.edu
  10170.  
  10171. The file `~/.mailrc' is used primarily by other mail-reading programs; it can 
  10172. contain various other commands.  Emacs ignores everything in it except for 
  10173. alias definitions. 
  10174.  
  10175.  Another way to define a mail alias, within Emacs alone, is with the 
  10176. define-mail-alias command.  It prompts for the alias and then the full address. 
  10177. You can use it to define aliases in your `.emacs' file, like this: 
  10178.  
  10179. (define-mail-alias "maingnu" "gnu@prep.ai.mit.edu")
  10180.  
  10181.  define-mail-alias records aliases by adding them to a variable named 
  10182. mail-aliases.  If your are comfortable with manipulating Lisp lists, you can 
  10183. set mail-aliases directly.  The initial value of mail-aliases is t, which means 
  10184. that Emacs should read `.mailrc' to get the proper value. 
  10185.  
  10186.  Normally, Emacs expands aliases when you send the message.  If you like, you 
  10187. can have mail aliases expand as abbrevs, as soon as you type them in.  To 
  10188. enable this feature, execute the following: 
  10189.  
  10190. (add-hook 'mail-setup-hook 'mail-abbrevs-setup)
  10191.  
  10192. This can go in your `.emacs' file.  See Hooks. 
  10193.  
  10194.  Note that abbrevs expand only if you insert a word-separator character 
  10195. afterward.  However, any mail aliases that you didn't expand in the mail buffer 
  10196. are expanded subsequently when you send the message. See Abbrevs. 
  10197.  
  10198.  
  10199. ΓòÉΓòÉΓòÉ 29.4. Mail Mode ΓòÉΓòÉΓòÉ
  10200.  
  10201.  The major mode used in the `*mail*' buffer is Mail mode, which is much like 
  10202. Text mode except that various special commands are provided on the C-c prefix. 
  10203. These commands all have to do specifically with editing or sending the message. 
  10204.  
  10205. C-c C-s 
  10206.           Send the message, and leave the `*mail*' buffer selected (mail-send). 
  10207.  
  10208. C-c C-c 
  10209.           Send the message, and select some other buffer (mail-send-and-exit). 
  10210.  
  10211. C-c C-f C-t 
  10212.           Move to the `To' header field, creating one if there is none 
  10213.           (mail-to). 
  10214.  
  10215. C-c C-f C-s 
  10216.           Move to the `Subject' header field, creating one if there is none 
  10217.           (mail-subject). 
  10218.  
  10219. C-c C-f C-c 
  10220.           Move to the `CC' header field, creating one if there is none 
  10221.           (mail-cc). 
  10222.  
  10223. C-c C-w 
  10224.           Insert the file `~/.signature' at the end of the message text 
  10225.           (mail-signature). 
  10226.  
  10227. C-c C-y 
  10228.           Yank the selected message from Rmail (mail-yank-original). This 
  10229.           command does nothing unless your command to start sending a message 
  10230.           was issued with Rmail. 
  10231.  
  10232. C-c C-q 
  10233.           Fill all paragraphs of yanked old messages, each individually 
  10234.           (mail-fill-yanked-message). 
  10235.  
  10236.  There are two ways to send the message.  C-c C-s (mail-send) sends the message 
  10237. and marks the `*mail*' buffer unmodified, but leaves that buffer selected so 
  10238. that you can modify the message (perhaps with new recipients) and send it 
  10239. again.  C-c C-c (mail-send-and-exit) sends and then deletes the window or 
  10240. switches to another buffer.  It puts the `*mail*' buffer at the lowest priority 
  10241. for reselection by default, since you are finished with using it.  This is the 
  10242. usual way to send the message. 
  10243.  
  10244.  Mail mode provides some other special commands that are useful for editing the 
  10245. headers and text of the message before you send it.  There are three commands 
  10246. defined to move point to particular header fields, all based on the prefix C-c 
  10247. C-f (`C-f' is for ``field'').  They are C-c C-f C-t (mail-to) to move to the 
  10248. `To' field, C-c C-f C-s (mail-subject) for the `Subject' field, and C-c C-f C-c 
  10249. (mail-cc) for the `CC' field.  These fields have special motion commands 
  10250. because they are the most common fields for the user to want to edit. 
  10251.  
  10252.  C-c C-w (mail-signature) adds a standard piece text at the end of the message 
  10253. to say more about who you are.  The text comes from the file `.signature' in 
  10254. your home directory. 
  10255.  
  10256.  To insert signatures automatically, set the variable mail-signature non-nil; 
  10257. then starting a mail message automatically inserts the contents of your 
  10258. `.signature' file.  If you want to omit your signature from a particular 
  10259. message, delete it from the buffer before you send the message. 
  10260.  
  10261.  When mail sending is invoked from the Rmail mail reader using an Rmail 
  10262. command, C-c C-y can be used inside the `*mail*' buffer to insert the text of 
  10263. the message you are replying to.  Normally it indents each line of that message 
  10264. four spaces and eliminates most header fields.  A numeric argument specifies 
  10265. the number of spaces to indent.  An argument of just C-u says not to indent at 
  10266. all and not to eliminate anything. C-c C-y always uses the current message from 
  10267. the `RMAIL' buffer, so you can insert several old messages by selecting one in 
  10268. `RMAIL', switching to `*mail*' and yanking it, then switching back to `RMAIL' 
  10269. to select another. 
  10270.  
  10271.  You can specify the text for C-c C-y to insert at the beginning of each line: 
  10272. set mail-yank-prefix to the desired string.  (A value of nil means to use 
  10273. indentation; this is the default.) However, C-u C-c C-y never adds anything at 
  10274. the beginning of the inserted lines, regardless of the value of 
  10275. mail-yank-prefix. 
  10276.  
  10277.  After using C-c C-y, you can use the command C-c C-q 
  10278. (mail-fill-yanked-message) to fill the paragraphs of the yanked old message or 
  10279. messages.  One use of C-c C-q fills all such paragraphs, each one individually. 
  10280.  
  10281.  Mail mode defines the character `%' as part of a word; this is helpful for 
  10282. using the word commands to edit mail addresses. 
  10283.  
  10284.  Turning on Mail mode (which C-x m does automatically) runs the normal hooks 
  10285. text-mode-hook and mail-mode-hook. Initializing a new outgoing message runs the 
  10286. normal hook mail-setup-hook; if you want to add special fields to your mail 
  10287. header or make other changes to the appearance of the mail buffer, use that 
  10288. hook.  See Hooks. 
  10289.  
  10290.  The main difference between these hooks is just when they are invoked. 
  10291. Whenever you type M-x mail, mail-mode-hook runs as soon as the `*mail*' buffer 
  10292. is created.  Then the mail-setup function puts in the default contents of the 
  10293. buffer. After these default contents are inserted, mail-setup-hook runs. 
  10294.  
  10295.  
  10296. ΓòÉΓòÉΓòÉ 29.5. Distracting the NSA ΓòÉΓòÉΓòÉ
  10297.  
  10298.  M-x spook adds a line of randomly chosen keywords to an outgoing mail message. 
  10299. The keywords are chosen from a list of words that suggest you are discussing 
  10300. something subversive. 
  10301.  
  10302.  The idea behind this feature is that the suspicion that the NSA snoops on all 
  10303. electronic mail messages that contain keywords suggesting they might be 
  10304. interested.  (The NSA says they don't, but there is no way to be certain.)  The 
  10305. idea is that if lots of people add suspicious words to their messages, the NSA 
  10306. will get so busy with spurious input that they will have to give up reading it 
  10307. all. 
  10308.  
  10309.  Whether or not this confuses the NSA, it at least amuses people. 
  10310.  
  10311.  
  10312. ΓòÉΓòÉΓòÉ 30. Reading Mail with Rmail ΓòÉΓòÉΓòÉ
  10313.  
  10314.  Rmail is an Emacs subsystem for reading and disposing of mail that you 
  10315. receive.  Rmail stores mail messages in files called Rmail files. Reading the 
  10316. message in an Rmail file is done in a special major mode, Rmail mode, which 
  10317. redefines most letters to run commands for managing mail.  To enter Rmail, type 
  10318. M-x rmail.  This reads your primary mail file, merges new mail in from your 
  10319. inboxes, displays the first message you haven't read yet, and lets you begin 
  10320. reading. 
  10321.  
  10322.  Using Rmail in the simplest fashion, you have one Rmail file `~/RMAIL' in 
  10323. which all of your mail is saved.  It is called your primary mail file.  In more 
  10324. sophisticated usage, you can copy messages into other Rmail files and then edit 
  10325. those files with Rmail. 
  10326.  
  10327.  Rmail uses narrowing to hide all but one message in the Rmail file. The 
  10328. message that is shown is called the current message.  Rmail mode's special 
  10329. commands can do such things as delete the current message, copy into another 
  10330. file, send a reply, or move to another message. 
  10331.  
  10332.  Within the Rmail file, messages are arranged sequentially in order of receipt. 
  10333. They are also assigned consecutive integers as their message numbers.  The 
  10334. number of the current message is displayed in Rmail's mode line, followed by 
  10335. the total number of messages in the file.  You can move to a message by 
  10336. specifying its message number using the j key (see Rmail Motion). 
  10337.  
  10338.  Following the usual conventions of Emacs, changes in an Rmail file become 
  10339. permanent only when the file is saved.  You can do this with s (rmail-save), 
  10340. which also expunges deleted messages from the file first (see Rmail Deletion). 
  10341. To save the file without expunging, use C-x C-s.  Rmail saves the Rmail file 
  10342. spontaneously when moving new mail from an inbox file (see Rmail Inbox). 
  10343.  
  10344.  You can exit Rmail with q (rmail-quit); this expunges and saves the Rmail file 
  10345. and then switches to another buffer.  But there is no need to `exit' formally. 
  10346. If you switch from Rmail to editing in other buffers, and never happen to 
  10347. switch back, you have exited.  (The Rmail command b, rmail-bury, does this for 
  10348. you.)  Just make sure to save the Rmail file eventually (like any other file 
  10349. you have changed).  C-x s is a good enough way to do this (see Saving). 
  10350.  
  10351.  
  10352. ΓòÉΓòÉΓòÉ 30.1. Scrolling Within a Message ΓòÉΓòÉΓòÉ
  10353.  
  10354.  When Rmail displays a message that does not fit on the screen, it is necessary 
  10355. to scroll through it.  This could be done with C-v, M-v and M-<, but in Rmail 
  10356. scrolling is so frequent that it deserves to be easier to type. 
  10357.  
  10358. SPC 
  10359.           Scroll forward (scroll-up). 
  10360.  
  10361. DEL 
  10362.           Scroll backward (scroll-down). 
  10363.  
  10364.           Scroll to start of message (rmail-beginning-of-message). 
  10365.  
  10366.  Since the most common thing to do while reading a message is to scroll through 
  10367. it by screenfuls, Rmail makes SPC and DEL synonyms of C-v (scroll-up) and M-v 
  10368. (scroll-down) 
  10369.  
  10370.  The command . (rmail-beginning-of-message) scrolls back to the beginning of 
  10371. the selected message.  This is not quite the same as M-<: for one thing, it 
  10372. does not set the mark; for another, it resets the buffer boundaries to the 
  10373. current message if you have changed them. 
  10374.  
  10375.  
  10376. ΓòÉΓòÉΓòÉ 30.2. Moving Among Messages ΓòÉΓòÉΓòÉ
  10377.  
  10378.  The most basic thing to do with a message is to read it.  The way to do this 
  10379. in Rmail is to make the message current.  The usual practice is to move 
  10380. sequentially through the file, since this is the order of receipt of messages. 
  10381. When you enter Rmail, you are positioned at the first message that you have not 
  10382. yet made current (that is, the first one that has the `unseen' attribute; see 
  10383. Rmail Labels).  Move forward to see the other new messages; move backward to 
  10384. reexamine old messages. 
  10385.  
  10386.           Move to the next nondeleted message, skipping any intervening deleted 
  10387.           messages (rmail-next-undeleted-message). 
  10388.  
  10389.           Move to the previous nondeleted message 
  10390.           (rmail-previous-undeleted-message). 
  10391.  
  10392. M-n 
  10393.           Move to the next message, including deleted messages 
  10394.           (rmail-next-message). 
  10395.  
  10396. M-p 
  10397.           Move to the previous message, including deleted messages 
  10398.           (rmail-previous-message). 
  10399.  
  10400.           Move to the first message.  With argument n, move to message number n 
  10401.           (rmail-show-message). 
  10402.  
  10403.           Move to the last message (rmail-last-message). 
  10404.  
  10405.           Move to the first message (rmail-first-message). 
  10406.  
  10407. M-s regexp RET 
  10408.           Move to the next message containing a match for regexp 
  10409.           (rmail-search). 
  10410.  
  10411. - M-s regexp RET 
  10412.           Move to the previous message containing a match for regexp. 
  10413.  
  10414.  n and p are the usual way of moving among messages in Rmail.  They move 
  10415. through the messages sequentially, but skip over deleted messages, which is 
  10416. usually what you want to do.  Their command definitions are named 
  10417. rmail-next-undeleted-message and rmail-previous-undeleted-message.  If you do 
  10418. not want to skip deleted messages---for example, if you want to move to a 
  10419. message to undelete it---use the variants M-n and M-p (rmail-next-message and 
  10420. rmail-previous-message).  A numeric argument to any of these commands serves as 
  10421. a repeat count. 
  10422.  
  10423.  In Rmail, you can specify a numeric argument by typing just the digits.  You 
  10424. don't need to type C-u first. 
  10425.  
  10426.  The M-s (rmail-search) command is Rmail's version of search.  The usual 
  10427. incremental search command C-s works in Rmail, but it searches only within the 
  10428. current message.  The purpose of M-s is to search for another message.  It 
  10429. reads a regular expression (see Regexps) nonincrementally, then searches 
  10430. starting at the beginning of the following message for a match.  The message 
  10431. containing the match is selected. 
  10432.  
  10433.  If regexp is empty, M-s reuses the regexp used the previous time. 
  10434.  
  10435.  To search backward in the file for another message, give M-s a negative 
  10436. argument.  In Rmail you can do this with - M-s. 
  10437.  
  10438.  It is also possible to search for a message based on labels. See Rmail Labels. 
  10439.  
  10440.  To move to a message specified by absolute message number, use j 
  10441. (rmail-show-message) with the message number as argument.  With no argument, j 
  10442. selects the first message.  > (rmail-last-message) selects the last message.  < 
  10443. (rmail-first-message) selects the first message. 
  10444.  
  10445.  
  10446. ΓòÉΓòÉΓòÉ 30.3. Deleting Messages ΓòÉΓòÉΓòÉ
  10447.  
  10448.  When you no longer need to keep a message, you can delete it.  This flags it 
  10449. as ignorable, and some Rmail commands pretend it is no longer present; but it 
  10450. still has its place in the Rmail file, and still has its message number. 
  10451.  
  10452.  Expunging the Rmail file actually removes the deleted messages. The remaining 
  10453. messages are renumbered consecutively.  Expunging is the only action that 
  10454. changes the message number of any message, except for undigestifying (see Rmail 
  10455. Digest). 
  10456.  
  10457.           Delete the current message, and move to the next nondeleted message 
  10458.           (rmail-delete-forward). 
  10459.  
  10460. C-d 
  10461.           Delete the current message, and move to the previous nondeleted 
  10462.           message (rmail-delete-backward). 
  10463.  
  10464.           Undelete the current message, or move back to a deleted message and 
  10465.           undelete it (rmail-undelete-previous-message). 
  10466.  
  10467.           Expunge the Rmail file (rmail-expunge). 
  10468.  
  10469.  There are two Rmail commands for deleting messages.  Both delete the current 
  10470. message and select another message.  d (rmail-delete-forward) moves to the 
  10471. following message, skipping messages already deleted, while C-d 
  10472. (rmail-delete-backward) moves to the previous nondeleted message. If there is 
  10473. no nondeleted message to move to in the specified direction, the message that 
  10474. was just deleted remains current. 
  10475.  
  10476.  To make all the deleted messages finally vanish from the Rmail file, type x 
  10477. (rmail-expunge).  Until you do this, you can still undelete the deleted 
  10478. messages. 
  10479.  
  10480.  To undelete, type u (rmail-undelete-previous-message), which is designed to 
  10481. cancel the effect of a d command (usually).  It undeletes the current message 
  10482. if the current message is deleted.  Otherwise it moves backward to previous 
  10483. messages until a deleted message is found, and undeletes that message. 
  10484.  
  10485.  You can usually undo a d with a u because the u moves back to and undeletes 
  10486. the message that the d deleted.  But this does not work when the d skips a few 
  10487. already-deleted messages that follow the message being deleted; then the u 
  10488. command undeletes the last of the messages that were skipped.  There is no 
  10489. clean way to avoid this problem.  However, by repeating the u command, you can 
  10490. eventually get back to the message that you intend to undelete.  You can also 
  10491. select a particular deleted message with M-p command, then type u to undelete 
  10492. it. 
  10493.  
  10494.  A deleted message has the `deleted' attribute, and as a result `deleted' 
  10495. appears in the mode line when the current message is deleted.  In fact, 
  10496. deleting or undeleting a message is nothing more than adding or removing this 
  10497. attribute.  See Rmail Labels. 
  10498.  
  10499.  
  10500. ΓòÉΓòÉΓòÉ 30.4. Rmail Files and Inboxes ΓòÉΓòÉΓòÉ
  10501.  
  10502.  Unix places incoming mail for you in a file that we call your inbox.  When you 
  10503. start up Rmail, it copies the new messages from your inbox into your primary 
  10504. mail file, an Rmail file, which also contains other messages saved from 
  10505. previous Rmail sessions.  It is in this file that you actually read the mail 
  10506. with Rmail.  This operation is called getting new mail.  It can be repeated at 
  10507. any time using the g key in Rmail.  The inbox file name is 
  10508. `/usr/spool/mail/username' on some systems (typically Berkeley-derived ones) 
  10509. and `/usr/mail/username' on other systems. 
  10510.  
  10511.  There are three reason for having separate Rmail files and inboxes. 
  10512.  
  10513.  1. The inbox file format varies between operating systems and according to the 
  10514.     other mail software in use.  Only one part of Rmail needs to know about the 
  10515.     alternatives, and it need only understand how to convert all of them to 
  10516.     Rmail's own format. 
  10517.  
  10518.  2. The inbox file format usually doesn't provide a place for all the 
  10519.     information that Rmail records. 
  10520.  
  10521.  3. It is very cumbersome to access an inbox file without danger of losing 
  10522.     mail, because it is necessary to interlock with mail delivery. Moreover, 
  10523.     different operating systems use different interlocking techniques.  The 
  10524.     strategy of moving mail out of the inbox once and for all into a separate 
  10525.     Rmail file avoids the need for interlocking in all the rest of Rmail, since 
  10526.     only Rmail operates on the Rmail file. 
  10527.  
  10528.  When getting new mail, Rmail first copies the new mail from the inbox file to 
  10529. the Rmail file; then it saves the Rmail file; then it truncates the inbox file. 
  10530. This way, a system crash may cause duplication of mail between the inbox and 
  10531. the Rmail file, but cannot lose mail. 
  10532.  
  10533.  Copying mail from an inbox in the system's mailer directory actually puts it 
  10534. in an intermediate file `~/.newmail'.  This is because the interlocking is done 
  10535. by a C program that copies to another file. `~/.newmail' is deleted after mail 
  10536. merging is successful.  If there is a crash at the wrong time, this file 
  10537. continues to exist and will be used as an inbox the next time you get new mail. 
  10538.  
  10539.  
  10540. ΓòÉΓòÉΓòÉ 30.5. Multiple Mail Files ΓòÉΓòÉΓòÉ
  10541.  
  10542.  Rmail operates by default on your primary mail file, which is named `~/RMAIL' 
  10543. and receives your incoming mail from your system inbox file. But you can also 
  10544. have other mail files and edit them with Rmail.  These files can receive mail 
  10545. through their own inboxes, or you can move messages into them with explicit 
  10546. Rmail commands (see Rmail Output). 
  10547.  
  10548. i file RET 
  10549.           Read file into Emacs and run Rmail on it (rmail-input). 
  10550.  
  10551. M-x set-rmail-inbox-list RET files RET 
  10552.           Specify inbox file names for current Rmail file to get mail from. 
  10553.  
  10554.           Merge new mail from current Rmail file's inboxes 
  10555.           (rmail-get-new-mail). 
  10556.  
  10557. C-u g file RET 
  10558.           Merge new mail from inbox file file. 
  10559.  
  10560.  To run Rmail on a file other than your primary mail file, you may use the i 
  10561. (rmail-input) command in Rmail.  This visits the file, puts it in Rmail mode, 
  10562. and then gets new mail from the file's inboxes if any.  The file should be in 
  10563. Rmail format.  You can use M-x rmail-input even when not in Rmail. 
  10564.  
  10565.  The file you read with i should usually be a valid Rmail file. If it is not, 
  10566. then Rmail tries to decompose it into a stream of messages in various known 
  10567. formats.  If it succeeds, it converts the whole file to an Rmail file. 
  10568.  
  10569.  Each Rmail file can contain a list of inbox file names; you can specify this 
  10570. list with M-x set-rmail-inbox-list RET files RET.  The argument can contain any 
  10571. number of file names, separated by commas.  It can also be empty, which 
  10572. specifies that this file should have no inboxes.  Once a list of inboxes is 
  10573. specified, the Rmail file remembers it permanently until it is explicitly 
  10574. changed. 
  10575.  
  10576.  If an Rmail file has inboxes, new mail is merged in from the inboxes when the 
  10577. Rmail file is brought into Rmail, and when you use the g (rmail-get-new-mail) 
  10578. command.  If the Rmail file specifies no inboxes, then no new mail is merged in 
  10579. at these times.  As a special exception, if your primary mail file does not 
  10580. specify any inbox files, it uses the standard system inbox. 
  10581.  
  10582.  To merge mail from a file that is not the usual inbox, give the g key a 
  10583. numeric argument, as in C-u g.  Then it reads a file name and merges mail from 
  10584. that file.  The inbox file is not deleted or changed in any way when g with an 
  10585. argument is used.  This is, therefore, a general way of merging one file of 
  10586. messages into another. 
  10587.  
  10588.  
  10589. ΓòÉΓòÉΓòÉ 30.6. Copying Messages Out to Files ΓòÉΓòÉΓòÉ
  10590.  
  10591. o file RET 
  10592.           Append a copy of the current message to the file file, writing it in 
  10593.           Rmail file format (rmail-output-to-rmail-file). 
  10594.  
  10595. C-o file RET 
  10596.           Append a copy of the current message to the file file, writing it in 
  10597.           Unix mail file format (rmail-output). 
  10598.  
  10599.  If an Rmail file has no inboxes, the only way messages get into it is by means 
  10600. of explicit o commands. 
  10601.  
  10602.  o (rmail-output-to-rmail-file) appends the current message in Rmail format to 
  10603. the end of the specified file.  This is the best command to use to move 
  10604. messages between Rmail files.  If the other Rmail file is currently visited, 
  10605. the copying is done into the other file's Emacs buffer instead.  You should 
  10606. eventually save it on disk. 
  10607.  
  10608.  The C-o (rmail-output) command in Rmail appends a copy of the current message 
  10609. to a specified file, in inbox file format.  This is useful for moving messages 
  10610. into files to be read by other mail processors that do not understand Rmail 
  10611. format. 
  10612.  
  10613.  The o and C-o commands are actually equivalent when you specify an existing 
  10614. file; both commands check the file's contents to determine which format to use 
  10615. (Rmail or inbox).  Which command you use makes a difference when you specify a 
  10616. nonexistent file. 
  10617.  
  10618.  Copying a message with o or C-o gives the original copy of the message the 
  10619. `filed' attribute, so that `filed' appears in the mode line when such a message 
  10620. is current.  If you like to keep just a single copy of every mail message, set 
  10621. the variable rmail-delete-after-output to t; then the o and C-o commands delete 
  10622. the original message after copying it. (You can undelete the original 
  10623. afterward.) 
  10624.  
  10625.  The variable rmail-output-file-alist lets you specify intelligent defaults for 
  10626. the output file, based on the contents of the current message.  The value 
  10627. should be a list whose elements have this form: 
  10628.  
  10629. (regexp . filename)
  10630.  
  10631. If there's a match for regexp in the current message, then the default file 
  10632. name for output is filename.  If multiple elements match the message, the first 
  10633. matching element decides the default file name. 
  10634.  
  10635.  
  10636. ΓòÉΓòÉΓòÉ 30.7. Labels ΓòÉΓòÉΓòÉ
  10637.  
  10638.  Each message can have various labels assigned to it as a means of 
  10639. classification.  A label has a name; different names mean different labels. Any 
  10640. given label is either present or absent on a particular message.  A few label 
  10641. names have standard meanings and are given to messages automatically by Rmail 
  10642. when appropriate; these special labels are called attributes. All other labels 
  10643. are assigned only by users. 
  10644.  
  10645. a label RET 
  10646.           Assign the label label to the current message (rmail-add-label). 
  10647.  
  10648. k label RET 
  10649.           Remove the label label from the current message (rmail-kill-label). 
  10650.  
  10651. C-M-n labels RET 
  10652.           Move to the next message that has one of the labels labels 
  10653.           (rmail-next-labeled-message). 
  10654.  
  10655. C-M-p labels RET 
  10656.           Move to the previous message that has one of the labels labels 
  10657.           (rmail-previous-labeled-message). 
  10658.  
  10659. C-M-l labels RET 
  10660.           Make a summary of all messages containing any of the labels labels 
  10661.           (rmail-summary-by-labels). 
  10662.  
  10663. Specifying an empty string for one these commands means to use the last label 
  10664. specified for any of these commands. 
  10665.  
  10666.  The a (rmail-add-label) and k (rmail-kill-label) commands allow you to assign 
  10667. or remove any label on the current message.  If the label argument is empty, it 
  10668. means to assign or remove the same label most recently assigned or removed. 
  10669.  
  10670.  Once you have given messages labels to classify them as you wish, there are 
  10671. two ways to use the labels: in moving and in summaries. 
  10672.  
  10673.  The command C-M-n labels RET (rmail-next-labeled-message) moves to the next 
  10674. message that has one of the labels labels.  The argument labels specifies one 
  10675. or more label names, separated by commas.  C-M-p 
  10676. (rmail-previous-labeled-message) is similar, but moves backwards to previous 
  10677. messages.  A preceding numeric argument to either one serves as a repeat count. 
  10678.  
  10679.  The command C-M-l labels RET (rmail-summary-by-labels) displays a summary 
  10680. containing only the messages that have at least one of a specified set of 
  10681. messages.  The argument labels is one or more label names, separated by commas. 
  10682. See Rmail Summary, for information on summaries. 
  10683.  
  10684.  If the labels argument to C-M-n, C-M-p or C-M-l is empty, it means to use the 
  10685. last set of labels specified for any of these commands. 
  10686.  
  10687.  Some labels such as `deleted' and `filed' have built-in meanings and are 
  10688. assigned to or removed from messages automatically at appropriate times; these 
  10689. labels are called attributes.  Here is a list of Rmail attributes: 
  10690.  
  10691. `unseen' 
  10692.           Means the message has never been current.  Assigned to messages when 
  10693.           they come from an inbox file, and removed when a message is made 
  10694.           current.  When you start Rmail, it initially shows the first message 
  10695.           that has this attribute. 
  10696.  
  10697. `deleted' 
  10698.           Means the message is deleted.  Assigned by deletion commands and 
  10699.           removed by undeletion commands (see Rmail Deletion). 
  10700.  
  10701. `filed' 
  10702.           Means the message has been copied to some other file.  Assigned by 
  10703.           the file output commands (see Rmail Files). 
  10704.  
  10705. `answered' 
  10706.           Means you have mailed an answer to the message.  Assigned by the r 
  10707.           command (rmail-reply).  See Rmail Reply. 
  10708.  
  10709. `forwarded' 
  10710.           Means you have forwarded the message to other users.  Assigned by the 
  10711.           f command (rmail-forward).  See Rmail Reply. 
  10712.  
  10713. `edited' 
  10714.           Means you have edited the text of the message within Rmail. See Rmail 
  10715.           Editing. 
  10716.  
  10717. `resent' 
  10718.           Means you have resent the message to other users.  Assigned by the 
  10719.           command M-x rmail-resend.  See Rmail Reply. 
  10720.  
  10721.  All other labels are assigned or removed only by the user, and have no 
  10722. standard meaning. 
  10723.  
  10724.  
  10725. ΓòÉΓòÉΓòÉ 30.8. Sending Replies ΓòÉΓòÉΓòÉ
  10726.  
  10727.  Rmail has several commands that use Mail mode to send outgoing mail. See 
  10728. Sending Mail, for information on using Mail mode.  What are documented here are 
  10729. the special commands of Rmail for entering Mail mode. Note that the usual keys 
  10730. for sending mail, C-x m and C-x 4 m, are available in Rmail mode and work just 
  10731. as they usually do. 
  10732.  
  10733.           Send a message (rmail-mail). 
  10734.  
  10735.           Continue editing already started outgoing message 
  10736.           (rmail-continue). 
  10737.  
  10738.           Send a reply to the current Rmail message (rmail-reply). 
  10739.  
  10740.           Forward current message to other users (rmail-forward). 
  10741.  
  10742. C-u f 
  10743.           Resend the current message to other users (rmail-resend). 
  10744.  
  10745. M-m 
  10746.           Try sending a bounced message a second time (rmail-retry-failure). 
  10747.  
  10748.  The most common reason to send a message while in Rmail is to reply to the 
  10749. message you are reading.  To do this, type r (rmail-reply).  This displays the 
  10750. `*mail*' buffer in another window, much like C-x 4 m, but preinitializes the 
  10751. `Subject', `To', `CC' and `In-reply-to' header fields based on the message you 
  10752. are replying to.  The `To' field is starts out as the address of the person who 
  10753. sent the message you received, and the `CC' field starts out with all the other 
  10754. recipients of that message. 
  10755.  
  10756.  You can exclude certain recipients from being placed automatically in the 
  10757. `CC', using the variable rmail-dont-reply-to-names.  Its value should be a 
  10758. regular expression (as a string); any recipient that the regular expression 
  10759. matches, is excluded from the `CC' field. The default value matches your own 
  10760. name, and any name starting with `info-'.  (Those names are excluded because 
  10761. there is a convention of using them for large mailing lists to broadcast 
  10762. announcements.) 
  10763.  
  10764.  To omit the `CC' field completely for a particular reply, enter the reply 
  10765. command with a prefix argument: C-u r. 
  10766.  
  10767.  Once the `*mail*' buffer has been initialized, editing and sending the mail 
  10768. goes as usual (see Sending Mail).  You can edit the presupplied header fields 
  10769. if they are not right for you.  You can also use the commands of Mail mode, 
  10770. including C-c C-y to yank in the message that you are replying to, and C-c C-q 
  10771. to fill what was thus yanked.  You can also switch to the Rmail buffer, select 
  10772. a different message, switch back, and yank the new current message. 
  10773.  
  10774.  Sometimes a message does not reach its destination.  Mailers usually send the 
  10775. failed message back to you, enclosed in a failure message.  The Rmail command 
  10776. M-m (rmail-retry-failure) prepares to send the same message a second time: it 
  10777. sets up a `*mail*' buffer with the same text and header fields as before.  If 
  10778. you type C-c C-c right away, you send the message again exactly the same as the 
  10779. first time.  Alternatively, you can edit the text or headers and then send it. 
  10780.  
  10781.  Another frequent reason to send mail in Rmail is to forward the current 
  10782. message to other users.  f (rmail-forward) makes this easy by preinitializing 
  10783. the `*mail*' buffer with the current message as the text, and a subject 
  10784. designating a forwarded message.  All you have to do is fill in the recipients 
  10785. and send.  When you forward a message, recipients get a message which is 
  10786. ``from'' you, and which has the original message in its contents. 
  10787.  
  10788.  Resending is an alternative similar to forwarding; the difference is that 
  10789. resending sends a message that is ``from'' the original sender, just as it 
  10790. reached you---with a few added header fields `Resent-from' and `Resent-to' to 
  10791. indicate that it came via you.  To resend a message in Rmail, use C-u f.  (f 
  10792. runs rmail-forward, which is programmed to invoke rmail-resend if you provide a 
  10793. numeric argument.) 
  10794.  
  10795.  The m (rmail-mail) command is used to start editing an outgoing message that 
  10796. is not a reply.  It leaves the header fields empty. Its only difference from 
  10797. C-x 4 m is that it makes the Rmail buffer accessible for C-c C-y, just as r 
  10798. does.  Thus, m can be used to reply to or forward a message; it can do anything 
  10799. r or f can do. 
  10800.  
  10801.  The c (rmail-continue) command resumes editing the `*mail*' buffer, to finish 
  10802. editing an outgoing message you were already composing, or to alter a message 
  10803. you have sent. 
  10804.  
  10805.  If you set the variable rmail-mail-new-frame to a non-nil value, then all the 
  10806. Rmail commands to start sending a message create a new frame to edit it in. 
  10807. This frame is deleted when you send the message, or when you use the `Don't 
  10808. Send' item in the `Mail' menu. 
  10809.  
  10810.  
  10811. ΓòÉΓòÉΓòÉ 30.9. Summaries ΓòÉΓòÉΓòÉ
  10812.  
  10813.  A summary is a buffer containing one line per message to give you an overview 
  10814. of the mail in an Rmail file.  Each line shows the message number, the sender, 
  10815. the labels, and the subject.  When the summary buffer is selected, you can use 
  10816. almost all Rmail commands; these apply to the message described by the current 
  10817. line of the summary.  Moving point in the summary buffer selects messages as 
  10818. you move to their summary lines. 
  10819.  
  10820.  A summary buffer applies to a single Rmail file only; if you are editing 
  10821. multiple Rmail files, each one has its own summary buffer (if you have asked 
  10822. for one).  The summary buffer name is made by appending `-summary' to the Rmail 
  10823. buffer's name.  Normally only one summary buffer is displayed at a time. 
  10824.  
  10825.  
  10826. ΓòÉΓòÉΓòÉ 30.9.1. Making Summaries ΓòÉΓòÉΓòÉ
  10827.  
  10828.  Here are the commands to create a summary for the current Rmail file. Once the 
  10829. Rmail file has a summary buffer, changes in the Rmail file (such as deleting or 
  10830. expunging messages, and getting new mail) automatically update the summary. 
  10831.  
  10832. C-M-h 
  10833.           Summarize all messages (rmail-summary). 
  10834.  
  10835. l labels RET 
  10836. C-M-l labels RET 
  10837.           Summarize message that have one or more of the specified labels 
  10838.           (rmail-summary-by-labels). 
  10839.  
  10840. C-M-r rcpts RET 
  10841.           Summarize messages that have one or more of the specified recipients 
  10842.           (rmail-summary-by-recipients). 
  10843.  
  10844. C-M-t topic RET 
  10845.           Summarize messages that have a match for the specified regexp topic 
  10846.           in their subjects (rmail-summary-by-topic). 
  10847.  
  10848.  The h or C-M-h (rmail-summary) command fills the summary buffer for the 
  10849. current Rmail file with a summary of all the messages in the file. It then 
  10850. displays and selects the summary buffer in another window. 
  10851.  
  10852.  C-M-l labels RET (rmail-summary-by-labels) makes a partial summary mentioning 
  10853. only the messages that have one or more of the labels labels.  labels should 
  10854. contain label names separated by commas. 
  10855.  
  10856.  C-M-r rcpts RET (rmail-summary-by-recipients) makes a partial summary 
  10857. mentioning only the messages that have one or more of the recipients rcpts. 
  10858. rcpts should contain mailing addresses separated by commas. 
  10859.  
  10860.  C-M-t topic RET (rmail-summary-by-topic) makes a partial summary mentioning 
  10861. only the messages whose subjects have a match for the regular expression topic. 
  10862.  
  10863.  Note that there is only one summary buffer for any Rmail file; making one kind 
  10864. of summary discards any previously made summary. 
  10865.  
  10866.  
  10867. ΓòÉΓòÉΓòÉ 30.9.2. Editing in Summaries ΓòÉΓòÉΓòÉ
  10868.  
  10869.  You can use the Rmail summary buffer to do almost anything you can do in the 
  10870. Rmail buffer itself.  In fact, once you have a summary buffer, there's no need 
  10871. to switch back to the Rmail buffer. 
  10872.  
  10873.  You can select and display various messages in the Rmail buffer, from the 
  10874. summary buffer, just by moving point in the summary buffer to different lines. 
  10875. It doesn't matter what Emacs command you use to move point; whichever line 
  10876. point is on at the end of the command, that message is selected in the Rmail 
  10877. buffer. 
  10878.  
  10879.  Almost all Rmail commands work in the summary buffer as well as in the Rmail 
  10880. buffer.  Thus, d in the summary buffer deletes the current message, u 
  10881. undeletes, and x expunges.  o and C-o output the current message to a file; r 
  10882. starts a reply to it.  You can scroll the current message while remaining in 
  10883. the summary buffer using SPC and DEL. 
  10884.  
  10885.  The Rmail commands to move between messages also work in the summary buffer, 
  10886. but with a twist: they move through the set of messages included in the 
  10887. summary.  They also redisplay the Rmail buffer on the screen (unlike cursor 
  10888. motion commands, which update the contents of the Rmail buffer but don't 
  10889. display it in a window unless it already appears). Here is a list of these 
  10890. commands: 
  10891.  
  10892.           Move to next line, skipping lines saying `deleted', and select its 
  10893.           message. 
  10894.  
  10895.           Move to previous line, skipping lines saying `deleted', and select 
  10896.           its message. 
  10897.  
  10898. M-n 
  10899.           Move to next line and select its message. 
  10900.  
  10901. M-p 
  10902.           Move to previous line and select its message. 
  10903.  
  10904.           Move to the last line, and select its message. 
  10905.  
  10906.           Move to the first line, and select its message. 
  10907.  
  10908. M-s pattern RET 
  10909.           Search through messages for pattern starting with the current 
  10910.           message; select the message found, and move point in the summary 
  10911.           buffer to that message's line. 
  10912.  
  10913.  Deletion, undeletion, and getting new mail, and even selection of a different 
  10914. message all update the summary buffer when you do them in the Rmail buffer.  If 
  10915. the variable rmail-redisplay-summary is non-nil, these actions also bring the 
  10916. summary buffer back onto the screen. 
  10917.  
  10918.  When you are finished using the summary, type w (rmail-summary-wipe) to kill 
  10919. the summary buffer's window.  You can also exit Rmail while in the summary.  q 
  10920. (rmail-summary-quit) kills the summary window, then saves the Rmail file and 
  10921. switches to another buffer. 
  10922.  
  10923.  
  10924. ΓòÉΓòÉΓòÉ 30.10. Editing Within a Message ΓòÉΓòÉΓòÉ
  10925.  
  10926.  Rmail mode provides a few special commands for moving within and editing the 
  10927. current message.  In addition, the usual Emacs commands are available (except 
  10928. for a few, such as C-M-n and C-M-h, that are redefined by Rmail for other 
  10929. purposes).  However, the Rmail buffer is normally read-only, and to alter it 
  10930. you must use the Rmail command e described below. 
  10931.  
  10932.           Toggle display of original headers (rmail-toggle-headers). 
  10933.  
  10934.           Edit current message (rmail-edit-current-message). 
  10935.  
  10936.  Rmail reformats the header of each message before displaying it. Normally this 
  10937. involves deleting most header fields, on the grounds that they are not 
  10938. interesting.  The variable rmail-ignored-headers specifies a regexp that 
  10939. matches the header fields to discard in this way.  The original headers are 
  10940. saved permanently, and to see what they look like, use the t command 
  10941. (rmail-toggle-headers).  This discards the reformatted headers of the current 
  10942. message and displays it with the original headers.  Repeating t reformats the 
  10943. message again.  Selecting the message again also reformats. 
  10944.  
  10945.  The Rmail buffer is normally read only, and most of the characters you would 
  10946. type to modify it (including most letters) are redefined as Rmail commands. 
  10947. This is usually not a problem since it is rare to want to change the text of a 
  10948. message.  When you do want to do this, the way is to type e 
  10949. (rmail-edit-current-message), which changes from Rmail mode into Rmail Edit 
  10950. mode, another major mode which is nearly the same as Text mode. The mode line 
  10951. indicates this change. 
  10952.  
  10953.  In Rmail Edit mode, letters insert themselves as usual and the Rmail commands 
  10954. are not available.  When you are finished editing the message and are ready to 
  10955. go back to Rmail, type C-c C-c, which switches back to Rmail mode. 
  10956. Alternatively, you can return to Rmail mode but cancel all the editing that you 
  10957. have done by typing C-c C-]. 
  10958.  
  10959.  Entering Rmail Edit mode runs the hook text-mode-hook; then it runs the hook 
  10960. rmail-edit-mode-hook (see Hooks).  It adds the attribute `edited' to the 
  10961. message. 
  10962.  
  10963.  
  10964. ΓòÉΓòÉΓòÉ 30.11. Digest Messages ΓòÉΓòÉΓòÉ
  10965.  
  10966.  A digest message is a message which exists to contain and carry several other 
  10967. messages.  Digests are used on some moderated mailing lists; all the messages 
  10968. that arrive for the list during a period of time such as one day are put inside 
  10969. a single digest which is then sent to the subscribers.  Transmitting the single 
  10970. digest uses much less computer time than transmitting the individual messages 
  10971. even though the total size is the same, because the per-message overhead in 
  10972. network mail transmission is considerable. 
  10973.  
  10974.  When you receive a digest message, the most convenient way to read it is to 
  10975. undigestify it: to turn it back into many individual messages. Then you can 
  10976. read and delete the individual messages as it suits you. 
  10977.  
  10978.  To do this, type M-x undigestify-rmail-message after selecting the digest 
  10979. message.  This extracts the submessages as separate Rmail messages, and inserts 
  10980. them following the digest.  The digest message itself is flagged as deleted. 
  10981.  
  10982.  
  10983. ΓòÉΓòÉΓòÉ 30.12. Converting an Rmail File to Mailbox Format ΓòÉΓòÉΓòÉ
  10984.  
  10985.  The command M-x unrmail converts a file in Rmail format to ordinary system 
  10986. mailbox format, so that you can use it with other mail-editing tools.  You must 
  10987. specify two arguments, the name of the Rmail file and the name to use for the 
  10988. converted file. M-x unrmail does not alter the Rmail file itself. 
  10989.  
  10990.  
  10991. ΓòÉΓòÉΓòÉ 30.13. Reading Rot13 Messages ΓòÉΓòÉΓòÉ
  10992.  
  10993.  Mailing list messages that might offend some readers are sometimes encoded in 
  10994. a simple code called rot13---so named because it rotates the alphabet by 13 
  10995. letters.  This code is not for secrecy, as it provides none; rather, it enables 
  10996. those who might be offended to avoid ever seeing the real text of the message. 
  10997.  
  10998.  To view a buffer using the rot13 code, use the command M-x rot13-other-window. 
  10999. This displays the current buffer in another window which applies the code when 
  11000. displaying the text. 
  11001.  
  11002.  
  11003. ΓòÉΓòÉΓòÉ 31. Dired, the Directory Editor ΓòÉΓòÉΓòÉ
  11004.  
  11005.  Dired makes an Emacs buffer containing a listing of a directory, and 
  11006. optionally some of its subdirectories as well.  You can use the normal Emacs 
  11007. commands to move around in this buffer, and special Dired commands to operate 
  11008. on the files listed. 
  11009.  
  11010.  
  11011. ΓòÉΓòÉΓòÉ 31.1. Entering Dired ΓòÉΓòÉΓòÉ
  11012.  
  11013.  To invoke Dired, do C-x d or M-x dired.  The command reads a directory name or 
  11014. wildcard file name pattern as a minibuffer argument to specify which files to 
  11015. list.  Where dired differs from list-directory is in putting the buffer into 
  11016. Dired mode so that the special commands of Dired are available. 
  11017.  
  11018.  The variable dired-listing-switches specifies the options to give to ls for 
  11019. listing directory; this string must contain `-l'.  If you use a numeric prefix 
  11020. argument with the dired command, you can specify the ls switches with the 
  11021. minibuffer after you finish entering the directory specification. 
  11022.  
  11023.  To display the Dired buffer in another window rather than in the selected 
  11024. window, use C-x 4 d (dired-other-window) instead of C-x d. 
  11025.  
  11026.  
  11027. ΓòÉΓòÉΓòÉ 31.2. Commands in the Dired Buffer ΓòÉΓòÉΓòÉ
  11028.  
  11029.   The Dired buffer is ``read-only'', and inserting text in it is not useful, so 
  11030. ordinary printing characters such as d and x are used for special Dired 
  11031. commands.  Some Dired commands mark or flag the current file (that is, the file 
  11032. on the current line); other commands operate on the marked files or on the 
  11033. flagged files. 
  11034.  
  11035.  All the usual Emacs cursor motion commands are available in Dired buffers. 
  11036. Some special purpose cursor motion commands are also provided.  The keys C-n 
  11037. and C-p are redefined to put the cursor at the beginning of the file name on 
  11038. the line, rather than at the beginning of the line. 
  11039.  
  11040.  For extra convenience, SPC and n in Dired are equivalent to C-n.  p is 
  11041. equivalent to C-p.  (Moving by lines is so common in Dired that it deserves to 
  11042. be easy to type.)  DEL (move up and unflag) is often useful simply for moving 
  11043. up. 
  11044.  
  11045.  
  11046. ΓòÉΓòÉΓòÉ 31.3. Deleting Files with Dired ΓòÉΓòÉΓòÉ
  11047.  
  11048.  The primary use of Dired is to flag files for deletion and then delete the 
  11049. files previously flagged. 
  11050.  
  11051.           Flag this file for deletion. 
  11052.  
  11053.           Remove deletion flag on this line. 
  11054.  
  11055. DEL 
  11056.           Move point to previous line and remove the deletion flag on that 
  11057.           line. 
  11058.  
  11059.           Delete the files that are flagged for deletion. 
  11060.  
  11061.           Flag all auto-save files (files whose names start and end with `#') 
  11062.           for deletion (see Auto Save). 
  11063.  
  11064.           Flag all backup files (files whose names end with `~') for deletion 
  11065.           (see Backup). 
  11066.  
  11067. . (Period) 
  11068.           Flag excess numeric backup files for deletion.  The oldest and newest 
  11069.           few backup files of any one file are exempt; the middle ones are 
  11070.           flagged. 
  11071.  
  11072. % d regexp RET 
  11073.           Flag for deletion all files whose names match the regular expression 
  11074.           regexp (dired-flag-files-regexp).  This is just like % m except that 
  11075.           it uses `D' instead of `*' to mark the files. 
  11076.  
  11077.           Only the non-directory part of the file name is used in matching. 
  11078.           Use `^' and `$' to anchor matches.  Exclude subdirectories by hiding 
  11079.           them (see Hiding Subdirectories). 
  11080.  
  11081.  You can flag a file for deletion by moving to the line describing the file and 
  11082. typing d.  The deletion flag is visible as a `D' at the beginning of the line. 
  11083. This command moves point to the beginning of the next line, so that repeated d 
  11084. commands flag successive files. 
  11085.  
  11086.  The files are flagged for deletion rather than deleted immediately to reduce 
  11087. the danger of deleting a file accidentally.  Until you direct Dired to expunge 
  11088. the flagged files, you can remove deletion flags using the commands u and DEL. 
  11089. u works just like d, but removes flags rather than making flags.  DEL moves 
  11090. upward, removing flags; it is like u with numeric argument automatically 
  11091. negated. 
  11092.  
  11093.  To delete the flagged files, type x (dired-expunge). This command first 
  11094. displays a list of all the file names flagged for deletion, and requests 
  11095. confirmation with yes.  Once you confirm, x deletes all the flagged files, then 
  11096. deletes their lines from the text of the Dired buffer.  The shortened Dired 
  11097. buffer remains selected. 
  11098.  
  11099.  If you answer no or quit with C-g when asked to confirm, you return 
  11100. immediately to Dired, with the deletion flags still present in the buffer, and 
  11101. no files actually deleted. 
  11102.  
  11103.  The #, ~ and . commands flag many files for deletion, based on their file 
  11104. names.  These commands are useful precisely because they do not actually delete 
  11105. any files; you can remove the deletion flags from any flagged files that you 
  11106. really wish to keep. 
  11107.  
  11108.  # flags for deletion all files whose names look like auto-save files (see Auto 
  11109. Save)---that is, files whose names begin and end with `#'.  ~ flags for 
  11110. deletion all files whose names say they are backup files (see Backup)---that 
  11111. is, whose names end in `~'. 
  11112.  
  11113.  . (Period) flags just some of the backup files for deletion: all but the 
  11114. oldest few and newest few backups of any one file.  Normally 
  11115. dired-kept-versions (*not* kept-new-versions; that applies only when saving) 
  11116. specifies the number of newest versions of each file to keep, and 
  11117. kept-old-versions specifies the number of oldest versions to keep. 
  11118.  
  11119.  Period with a positive numeric argument, as in C-u 3 ., specifies the number 
  11120. of newest versions to keep, overriding dired-kept-versions.  A negative numeric 
  11121. argument overrides kept-old-versions, using minus the value of the argument to 
  11122. specify the number of oldest versions of each file to keep. 
  11123.  
  11124.  The % d command flags all files whose names match a specified regular 
  11125. expression (dired-flag-files-regexp).  Only the non-directory part of the file 
  11126. name is used in matching.  You can use `^' and `$' to anchor matches.  You can 
  11127. exclude subdirectories by hiding them (see Hiding Subdirectories). 
  11128.  
  11129.  
  11130. ΓòÉΓòÉΓòÉ 31.4. Visiting Files in Dired ΓòÉΓòÉΓòÉ
  11131.  
  11132.  There are several Dired commands for visiting or examining the files listed in 
  11133. the Dired buffer.  All of them apply to the current line's file; if that file 
  11134. is really a directory, these commands invoke Dired on that subdirectory (using 
  11135. a separate Dired buffer). 
  11136.  
  11137.           Visit the file described on the current line, like typing C-x C-f and 
  11138.           supplying that file name (dired-find-file).  See Visiting. 
  11139.  
  11140.           Like f, but uses another window to display the file's buffer 
  11141.           (dired-find-file-other-window).  The Dired buffer remains visible in 
  11142.           the first window.  This is like using C-x 4 C-f to visit the file. 
  11143.           See Windows. 
  11144.  
  11145. C-o 
  11146.           Visit the file described on the current line, and display the buffer 
  11147.           in another window, but do not select that window 
  11148.           (dired-display-file). 
  11149.  
  11150.           View the file described on the current line, using M-x view-file 
  11151.           (dired-view-file). 
  11152.  
  11153.           Viewing a file is like visiting it, but is slanted toward moving 
  11154.           around in the file conveniently and does not allow changing the file. 
  11155.           See Misc File Ops. 
  11156.  
  11157.  
  11158. ΓòÉΓòÉΓòÉ 31.5. Dired Marks vs. Flags ΓòÉΓòÉΓòÉ
  11159.  
  11160.  Instead of flagging a file with `D', you can mark the file with some other 
  11161. character (usually `*').  Most Dired commands other than ``expunge'' (x) 
  11162. operate on files marked with `*'. 
  11163.  
  11164.  Here are some commands for marking with `*' (and also for unmarking).  (See 
  11165. Dired Deletion, for commands to flag and unflag files.) 
  11166.  
  11167.           Mark the current file with `*' (dired-mark).  With a numeric argument 
  11168.           n, mark the next n files starting with the current file.  (If n is 
  11169.           negative, mark the previous -n files.) 
  11170.  
  11171.           Mark all executable files with `*' (dired-mark-executables).  With a 
  11172.           prefix argument, unmark all those files. 
  11173.  
  11174.           Mark all symbolic links with `*' (dired-mark-symlinks). With a prefix 
  11175.           argument, unmark all those files. 
  11176.  
  11177.           Mark with `*' all files which are actually directories, except for 
  11178.           `.' and `..' (dired-mark-directories).  With a prefix argument, 
  11179.           unmark all those files. 
  11180.  
  11181. M-DEL markchar 
  11182.           Remove all marks that use the character markchar 
  11183.           (dired-unmark-all-files).  If you specify RET as markchar, this 
  11184.           command removes all marks, no matter what the marker character is. 
  11185.  
  11186.           With a numeric argument, this command queries about each marked file, 
  11187.           asking whether to remove its mark.  You can answer y meaning yes, n 
  11188.           meaning no, ! to remove the marks from the remaining files without 
  11189.           asking about them. 
  11190.  
  11191. c old new 
  11192.           Replace all marks that use the character old with marks that use the 
  11193.           character new (dired-change-marks).  This command is the only way to 
  11194.           create or use marks other than `*' or `D'. The arguments are single 
  11195.           characters---do not use RET to terminate them. 
  11196.  
  11197.           You can use almost any character as a mark character by means of this 
  11198.           command, to distinguish various classes of files.  If old is a space 
  11199.           (`'), then the command operates on all unmarked files; if new is a 
  11200.           space, then the command unmarks the files it acts on. 
  11201.  
  11202.           To illustrate the power of this command, here is how to put `*' marks 
  11203.           on all the files that are unmarked, while unmarking all those that 
  11204.           have `*' marks: 
  11205.  
  11206.                     c * t  c SPC *  c t SPC
  11207.  
  11208. % m regexp RET 
  11209.           Mark (with `*') all files whose names match the regular expression 
  11210.           regexp (dired-mark-files-regexp). 
  11211.  
  11212.           Only the non-directory part of the file name is used in matching. 
  11213.           Use `^' and `$' to anchor matches.  Exclude subdirectories by hiding 
  11214.           them (see Hiding Subdirectories). 
  11215.  
  11216.  
  11217. ΓòÉΓòÉΓòÉ 31.6. Operating on Files ΓòÉΓòÉΓòÉ
  11218.  
  11219.  This section describes the basic Dired commands to operate on one file or 
  11220. several files.  All of these commands are capital letters; all of them use the 
  11221. minibuffer, either to read an argument or to ask for confirmation, before they 
  11222. act.  All use the following convention to decide which files to manipulate: 
  11223.  
  11224. o If you give the command a numeric prefix argument n, it operates on the next 
  11225.   n files, starting with the current file.  (If n is negative, the command 
  11226.   operates on the -n files preceding the current line.) 
  11227.  
  11228. o Otherwise, if some files are marked with `*', the command operates on all 
  11229.   those files. 
  11230.  
  11231. o Otherwise, the command operates on the current file only. 
  11232.  
  11233. Here are the commands that operate on files in this way: 
  11234.  
  11235. C new RET 
  11236.           Copy the specified files (dired-do-copy).  The argument new is the 
  11237.           directory to copy into, or (if copying a single file) the new name. 
  11238.  
  11239.           If dired-copy-preserve-time is non-nil, then copying with this 
  11240.           command sets the modification time of the new file to be the same as 
  11241.           that of the old file. 
  11242.  
  11243. R new RET 
  11244.           Rename the specified files (dired-do-rename).  The argument new is 
  11245.           the directory to rename into, or (if renaming a single file) the new 
  11246.           name. 
  11247.  
  11248.           Dired automatically changes the visited file name of buffers 
  11249.           associated with renamed files so that they refer to the new names. 
  11250.  
  11251. H new RET 
  11252.           Make hard links to the specified files (dired-do-hardlink).  The 
  11253.           argument new is the directory to make the links in, or (if making 
  11254.           just one link) the name to give the link. 
  11255.  
  11256. S new RET 
  11257.           Make symbolic links to the specified files (dired-do-symlink). The 
  11258.           argument new is the directory to make the links in, or (if making 
  11259.           just one link) the name to give the link. 
  11260.  
  11261. M modespec RET 
  11262.           Change the mode (also called ``permission bits'') of the specified 
  11263.           files (dired-do-chmod).  This calls the chmod program, so modespec 
  11264.           can be any argument that chmod can handle. 
  11265.  
  11266. G newgroup RET 
  11267.           Change the group of the specified files to newgroup (dired-do-chgrp). 
  11268.  
  11269. O newowner RET 
  11270.           Change the owner of the specified files to newowner (dired-do-chown). 
  11271.           (On most systems, only the superuser can do this.) 
  11272.  
  11273.           The variable dired-chown-program specifies the name of the program to 
  11274.           use to do the work (different systems put chown in different places). 
  11275.  
  11276. P command RET 
  11277.           Print the specified files (dired-do-print).  You must specify the 
  11278.           command to print them with, but the minibuffer starts out with a 
  11279.           suitable guess made using the variables lpr-command and lpr-switches 
  11280.           (the same variables that lpr-file uses; see Hardcopy). 
  11281.  
  11282.           Compress or uncompress the specified files (dired-do-compress). If 
  11283.           the file appears to be a compressed file, it is uncompressed; 
  11284.           otherwise, it is compressed. 
  11285.  
  11286.           Load the specified Emacs Lisp files (dired-do-load). See Lisp 
  11287.           Libraries. 
  11288.  
  11289.           Byte compile the specified Emacs Lisp files (dired-do-byte-compile). 
  11290.           See Byte Compilation. 
  11291.  
  11292.  
  11293. ΓòÉΓòÉΓòÉ 31.7. Shell Commands in Dired ΓòÉΓòÉΓòÉ
  11294.  
  11295. The dired command ! (dired-do-shell-command) reads a shell command string in 
  11296. the minibuffer and runs the shell command on all the specified files.  There 
  11297. are two ways of applying a shell command to multiple files: 
  11298.  
  11299. o If you use `*' in the shell command, then it runs just once, with the list of 
  11300.   file names substituted for the `*'.  The order of file names is the order of 
  11301.   appearance in the Dired buffer. 
  11302.  
  11303.   Thus, ! tar cf foo.tar * RET runs tar on the entire list of file names, 
  11304.   putting them into one tar file `foo.tar'. 
  11305.  
  11306. o If the command string doesn't contain `*', then it runs once for each file, 
  11307.   with the file name added at the end. 
  11308.  
  11309.   For example, ! uudecode RET runs uudecode on each file. 
  11310.  
  11311. What if you want to run the shell command once for each file but with the file 
  11312. name inserted in the middle?  Or if you want to use the file names in a more 
  11313. complicated fashion?  Use a shell loop.  For example, this shell command would 
  11314. run uuencode on each of the specified files, writing the output into a 
  11315. corresponding `.uu' file: 
  11316.  
  11317. for file in *; uuencode $file $file >$file.uu; done
  11318.  
  11319. The working directory for the shell command is the top level directory of the 
  11320. Dired buffer. 
  11321.  
  11322. The ! command does not attempt to update the Dired buffer to show new or 
  11323. modified files, because it doesn't really understand shell commands, and does 
  11324. not know what files the shell command changed.  Use the g command to update the 
  11325. Dired buffer ( see Dired Updating). 
  11326.  
  11327.  
  11328. ΓòÉΓòÉΓòÉ 31.8. Transforming File Names in Dired ΓòÉΓòÉΓòÉ
  11329.  
  11330.  Here are commands that alter file names in a systematic way: 
  11331.  
  11332. % u 
  11333.           Rename each of the selected files to an upper case name 
  11334.           (dired-upcase).  If the old file names are `Foo' and `bar', the new 
  11335.           names are `FOO' and `BAR'. 
  11336.  
  11337. % l 
  11338.           Rename each of the selected files to a lower case name 
  11339.           (dired-downcase).  If the old file names are `Foo' and `bar', the new 
  11340.           names are `foo' and `bar'. 
  11341.  
  11342. % R from RET to RET 
  11343. % C from RET to RET 
  11344. % H from RET to RET 
  11345. % S from RET to RET 
  11346.           These four commands rename, copy, make hard links and make soft 
  11347.           links, in each case computing the new name by regular expression 
  11348.           substitution from the name of the old file. 
  11349.  
  11350.  The four regular expression substitution commands effectively perform 
  11351. query-replace-regexp on the selected file names in the Dired buffer.  They read 
  11352. two arguments: a regular expression from, and a substitution pattern to. 
  11353.  
  11354.  The commands match each ``old'' file name against the regular expression from, 
  11355. and then replace the matching part with to.  You can use `\&' and `\digit' in 
  11356. to to refer to all or part of the old file name, as in query-replace (see Query 
  11357. Replace). 
  11358.  
  11359.  For example, % R ^.*$ RET x-\& RET renames each selected file by prepending 
  11360. `x-' to its name.  The inverse of this, removing `x-' from the front of each 
  11361. file name, is also possible: one method is % R ^x-.*$ RET \& RET; another is % 
  11362. R ^x- RET RET.  (Use `^' and `$' to anchor matches that should span the whole 
  11363. filename.) 
  11364.  
  11365.  If the regular expression matches more than once in a file name, only the 
  11366. first match is replaced. 
  11367.  
  11368.  Normally, the replacement process does not consider the files' directory 
  11369. names; it operates on the file name within the directory.  If you specify a 
  11370. prefix argument of zero, then replacement affects the entire absolute file name 
  11371. including directory name. 
  11372.  
  11373.  Often you will want to apply the command to all files matching the same regexp 
  11374. that you use in the command.  To do this, mark those files with % m regexp RET, 
  11375. then use the same regular expression in the command to operate on the files. 
  11376. To make this easier, the commands to operate use the last regular expression 
  11377. specified in a % command as a default. 
  11378.  
  11379.  
  11380. ΓòÉΓòÉΓòÉ 31.9. File Comparison with Dired ΓòÉΓòÉΓòÉ
  11381.  
  11382.  Here are two Dired commands that compare specified files using diff. 
  11383.  
  11384.           Compare the current file (the file at point) with another file (the 
  11385.           file at the mark) using the diff program (dired-diff).  The file at 
  11386.           the mark is the first argument of diff, and the file at point is the 
  11387.           second argument. 
  11388.  
  11389. M-= 
  11390.           Compare the current file with its latest backup file 
  11391.           (dired-backup-diff).  If the current file is itself a backup, compare 
  11392.           it with the file it is a backup of; this way, you can compare a file 
  11393.           with any backup version of your choice. 
  11394.  
  11395.           The backup file is the first file given to diff. 
  11396.  
  11397.  
  11398. ΓòÉΓòÉΓòÉ 31.10. Subdirectories in Dired ΓòÉΓòÉΓòÉ
  11399.  
  11400.  A Dired buffer displays just one directory in the normal case; but you can 
  11401. optionally include its subdirectories as well. 
  11402.  
  11403.  The simplest way to include multiple directories in one Dired buffer is to 
  11404. specify the options `-lR' for running ls.  (If you give a numeric argument when 
  11405. you run Dired, then you can specify these options in the minibuffer.)  That 
  11406. produces a recursive directory listing showing all subdirectories at all 
  11407. levels. 
  11408.  
  11409.  But usually all the subdirectories are too many; usually you will prefer to 
  11410. include specific subdirectories only.  You can do this with the i command: 
  11411.  
  11412.           Insert the contents of a subdirectory later in the buffer. 
  11413.  
  11414.           Use the i (dired-maybe-insert-subdir) command on a line that 
  11415.           describes a file which is a directory.  It inserts the contents of 
  11416.           that directory into the same Dired buffer, and moves there.  Inserted 
  11417.           subdirectory contents follow the top-level directory of the Dired 
  11418.           buffer, just as they do in `ls -lR' output. 
  11419.  
  11420.           If the subdirectory's contents are already present in the buffer, the 
  11421.           i command just moves to it. 
  11422.  
  11423.           In either case, i sets the Emacs mark before moving, so C-x C-x takes 
  11424.           you back to the old position in the buffer (the line describing that 
  11425.           subdirectory). 
  11426.  
  11427.           Use the l command (dired-do-redisplay) to update the subdirectory's 
  11428.           contents.  Use k to delete the subdirectory. See Dired Updating. 
  11429.  
  11430.  
  11431. ΓòÉΓòÉΓòÉ 31.11. Moving Over Subdirectories ΓòÉΓòÉΓòÉ
  11432.  
  11433.  When a Dired buffer lists subdirectories, you can use the page motion commands 
  11434. C-x [ and C-x ] to move by entire directories. 
  11435.  
  11436.  The following commands move across, up and down in the tree of directories 
  11437. within one Dired buffer.  They move to directory header lines, which are the 
  11438. lines that give a directory's name, at the beginning of the directory's 
  11439. contents. 
  11440.  
  11441. C-M-n 
  11442.           Go to next subdirectory header line, regardless of level 
  11443.           (dired-next-subdir). 
  11444.  
  11445. C-M-p 
  11446.           Go to previous subdirectory header line, regardless of level 
  11447.           (dired-prev-subdir). 
  11448.  
  11449. C-M-u 
  11450.           Go up to the parent directory's header line (dired-tree-up). 
  11451.  
  11452. C-M-d 
  11453.           Go down in the directory tree, to the first subdirectory's header 
  11454.           line (dired-tree-down). 
  11455.  
  11456.  
  11457. ΓòÉΓòÉΓòÉ 31.12. Hiding Subdirectories ΓòÉΓòÉΓòÉ
  11458.  
  11459.  Hiding a subdirectory means to make it invisible, except for its header line, 
  11460. via selective display (see Selective Display). 
  11461.  
  11462.           Hide or reveal the subdirectory that point is in, and move point to 
  11463.           the next subdirectory (dired-hide-subdir).  A numeric argument serves 
  11464.           as a repeat count. 
  11465.  
  11466. M-$ 
  11467.           Hide all subdirectories in this Dired buffer, leaving only their 
  11468.           header lines (dired-hide-all).  Or, if any subdirectory is currently 
  11469.           hidden, make all subdirectories visible again.  You can use this 
  11470.           command to get an overview in very deep directory trees or to move 
  11471.           quickly to subdirectories far away. 
  11472.  
  11473.  Ordinary Dired commands never consider files inside a hidden subdirectory. 
  11474. For example, the commands to operate on marked files ignore files in hidden 
  11475. directories even if they are marked.  Thus you can use hiding to temporarily 
  11476. exclude subdirectories from operations without having to remove the markers. 
  11477.  
  11478.  The subdirectory hiding commands toggle; that is they unhide what was hidden 
  11479. and vice versa. 
  11480.  
  11481.  
  11482. ΓòÉΓòÉΓòÉ 31.13. Updating the Dired Buffer ΓòÉΓòÉΓòÉ
  11483.  
  11484.  This section describes commands to update the Dired buffer to reflect outside 
  11485. (non-Dired) changes in the directories and files, and to delete part of the 
  11486. Dired buffer. 
  11487.  
  11488.           Update the entire contents of the Dired buffer (revert-buffer). 
  11489.  
  11490.           Update the specified files (dired-do-redisplay). 
  11491.  
  11492.           Delete the specified file lines---not the files, just the lines 
  11493.           (dired-do-kill-lines). 
  11494.  
  11495.  Type g (revert-buffer) to update the contents of the Dired buffer, based on 
  11496. changes in the files and directories listed. This preserves all marks except 
  11497. for those on files that have vanished. Hidden subdirectories are updated but 
  11498. remain hidden. 
  11499.  
  11500.  To update only some of the files, type l (dired-do-redisplay).  This command 
  11501. applies to the next n files, or to the marked files if any, or to the current 
  11502. file.  Updating them means reading their current status from the file system 
  11503. and changing the buffer to reflect it properly. 
  11504.  
  11505.  If you use l on a subdirectory header line, it updates the contents of the 
  11506. corresponding subdirectory. 
  11507.  
  11508.  To delete the specified file lines---not the files, just the lines---type k 
  11509. (dired-do-kill-lines).  This command applies to the next n files, or to the 
  11510. marked files if any, or to the current file. 
  11511.  
  11512.  If you kill the line for a file that is a directory, the directory's contents 
  11513. are also deleted from the buffer.  Typing C-u k on the header line for a 
  11514. subdirectory is another way to delete a subdirectory from the Dired buffer. 
  11515.  
  11516.  The g command brings back any individual lines that you have killed in this 
  11517. way, but not subdirectories---you must use i to reinsert each subdirectory. 
  11518.  
  11519.  
  11520. ΓòÉΓòÉΓòÉ 31.14. Dired and find ΓòÉΓòÉΓòÉ
  11521.  
  11522.  You can select a set of files for display in a Dired buffer more flexibly by 
  11523. using the find utility to choose the files. 
  11524.  
  11525.  To search for files with names matching a wildcard pattern use M-x 
  11526. find-name-dired.  It reads arguments directory and pattern, and chooses all the 
  11527. files in directory or its subdirectories whose individual names match pattern. 
  11528.  
  11529.  The files thus chosen are displayed in a Dired buffer in which the ordinary 
  11530. Dired commands are available. 
  11531.  
  11532.  If you want to test the contents of files, rather than their names, use M-x 
  11533. find-grep-dired.  This command reads two minibuffer arguments, directory and 
  11534. regexp; it chooses all the files in directory or its subdirectories that 
  11535. contain a match for regexp.  It works by running the programs find and grep. 
  11536.  
  11537.  The most general command in this series is M-x find-dired, which lets you 
  11538. specify any condition that find can test.  It takes two minibuffer arguments, 
  11539. directory and find-args; it runs find in directory, passing find-args to tell 
  11540. find what condition to test.  To use this command, you need to know how to use 
  11541. find. 
  11542.  
  11543.  
  11544. ΓòÉΓòÉΓòÉ 32. The Calendar and the Diary ΓòÉΓòÉΓòÉ
  11545.  
  11546.  Emacs provides the functions of a desk calendar, with a diary of planned or 
  11547. past events.  To enter the calendar, type M-x calendar; this displays a 
  11548. three-month calendar centered on the current month, with point on the current 
  11549. date.  If you use prefix argument as in C-u M-x calendar, it prompts you for 
  11550. the month and year to be the center of the three-month calendar.  The calendar 
  11551. uses its own buffer and the major mode is Calendar mode. 
  11552.  
  11553.  To exit the calendar, type q. 
  11554.  
  11555.  
  11556. ΓòÉΓòÉΓòÉ 32.1. Movement in the Calendar ΓòÉΓòÉΓòÉ
  11557.  
  11558.  Calendar mode lets you move in logical units of time such as days, weeks, 
  11559. months, and years.  If you move outside the three months originally displayed, 
  11560. the calendar display scrolls automatically through time.  Moving to a date lets 
  11561. you view its holidays or diary entries, convert it to other calendars; moving 
  11562. longer time periods is useful simply to scroll the calendar. 
  11563.  
  11564.  
  11565. ΓòÉΓòÉΓòÉ 32.1.1. Motion by Integral Days, Weeks, Months, Years ΓòÉΓòÉΓòÉ
  11566.  
  11567.  The commands for movement in the calendar buffer parallel the commands for 
  11568. movement in text.  You can move forward and backward by days, weeks, months, 
  11569. and years. 
  11570.  
  11571. C-f 
  11572.           Move point one day forward (calendar-forward-day). 
  11573.  
  11574. C-b 
  11575.           Move point one day backward (calendar-backward-day). 
  11576.  
  11577. C-n 
  11578.           Move point one week forward (calendar-forward-week). 
  11579.  
  11580. C-p 
  11581.           Move point one week backward (calendar-backward-week). 
  11582.  
  11583. M-} 
  11584.           Move point one month forward (calendar-forward-month). 
  11585.  
  11586. M-{ 
  11587.           Move point one month backward (calendar-backward-month). 
  11588.  
  11589. C-x ] 
  11590.           Move point one year forward (calendar-forward-year). 
  11591.  
  11592. C-x [ 
  11593.           Move point one year backward (calendar-forward-year). 
  11594.  
  11595.  The day and week commands are natural analogues of the usual Emacs commands 
  11596. for moving by characters and by lines.  Just as C-n usually moves to the same 
  11597. column in the following line, in Calendar mode it moves to the same day in the 
  11598. following week.  And C-p moves to the same day in the previous week. 
  11599.  
  11600.  The arrow keys are equivalent to C-f, C-b, C-n and C-p, just as they normally 
  11601. are in other modes. 
  11602.  
  11603.  The commands for motion by months and years work like those for weeks, but 
  11604. move a larger distance.  The month commands M-} and M-{ move forward or 
  11605. backward by an entire month's time.  The year commands C-x ] and C-x [ move 
  11606. forward or backward a whole year. 
  11607.  
  11608.  The easiest way to remember these commands is to consider months and years 
  11609. analogous to paragraphs and pages of text, respectively.  But the commands 
  11610. themselves are not quite analogous.  The ordinary Emacs paragraph commands move 
  11611. to the beginning or end of a paragraph, whereas these month and year commands 
  11612. move by an entire month or an entire year, which usually involves skipping 
  11613. across the end of a month or year. 
  11614.  
  11615.  All these commands accept a numeric argument as a repeat count. For 
  11616. convenience, the digit keys and the minus sign specify numeric arguments in 
  11617. Calendar mode even without the Meta modifier.  For example, 100 C-f moves point 
  11618. 100 days forward from its present location. 
  11619.  
  11620.  
  11621. ΓòÉΓòÉΓòÉ 32.1.2. Beginning or End of Week, Month or Year ΓòÉΓòÉΓòÉ
  11622.  
  11623.  A week (or month, or year) is not just a quantity of days; we think of new 
  11624. weeks (months, years) as starting on particular days.  So Calendar mode 
  11625. provides commands to move to the beginning or end of a week, month or year: 
  11626.  
  11627. C-a 
  11628.           Move point to beginning of week (calendar-beginning-of-week). 
  11629.  
  11630. C-e 
  11631.           Move point to end of week (calendar-end-of-week). 
  11632.  
  11633. M-a 
  11634.           Move point to beginning of month (calendar-beginning-of-month). 
  11635.  
  11636. M-e 
  11637.           Move point to end of month (calendar-end-of-month). 
  11638.  
  11639. M-< 
  11640.           Move point to beginning of year (calendar-beginning-of-year). 
  11641.  
  11642. M-> 
  11643.           Move point to end of year (calendar-end-of-year). 
  11644.  
  11645.  These commands also take numeric arguments as repeat counts, with the repeat 
  11646. count indicating how many weeks, months, or years to move backward or forward. 
  11647.  
  11648.  
  11649. ΓòÉΓòÉΓòÉ 32.1.3. Particular Dates ΓòÉΓòÉΓòÉ
  11650.  
  11651.  Calendar mode provides commands for getting to a particular date specified 
  11652. absolutely. 
  11653.  
  11654. g d 
  11655.           Move point to specified date (calendar-goto-date). 
  11656.  
  11657.           Center calendar around specified month (calendar-other-month). 
  11658.  
  11659.           Move point to today's date (calendar-current-month). 
  11660.  
  11661.  g d (calendar-goto-date) prompts for a year, a month, and a day of the month, 
  11662. and then moves to that date.  Because the calendar includes all dates from the 
  11663. beginning of the current era, you must type the year in its entirety; that is, 
  11664. type `1990', not `90'. 
  11665.  
  11666.  o (calendar-other-month) prompts for a month and year, then centers the 
  11667. three-month calendar around that month. 
  11668.  
  11669.  You can return to today's date with . (calendar-current-month). 
  11670.  
  11671.  
  11672. ΓòÉΓòÉΓòÉ 32.2. Scrolling in the Calendar ΓòÉΓòÉΓòÉ
  11673.  
  11674.  The calendar display scrolls automatically through time when you move out of 
  11675. the visible portion.  You can also scroll it manually.  Imagine that the 
  11676. calendar window contains a long strip of paper with the months on it. Scrolling 
  11677. it means moving the strip so that new months become visible in the window. 
  11678.  
  11679. C-x < 
  11680.           Scroll calendar one month forward (scroll-calendar-left). 
  11681.  
  11682. C-x > 
  11683.           Scroll calendar one month backward (scroll-calendar-right). 
  11684.  
  11685. C-v 
  11686. NEXT 
  11687.           Scroll calendar three months forward 
  11688.           (scroll-calendar-left-three-months). 
  11689.  
  11690. M-v 
  11691. PRIOR 
  11692.           Scroll calendar three months backward 
  11693.           (scroll-calendar-right-three-months). 
  11694.  
  11695. SPC 
  11696.           Scroll the next window (scroll-other-window). 
  11697.  
  11698.  The most basic calendar scroll commands scroll by one month at a time.  This 
  11699. means that there are two months of overlap between the display before the 
  11700. command and the display after.  C-x < scrolls the calendar contents one month 
  11701. to the left; that is, it moves the display forward in time.  C-x > scrolls the 
  11702. contents to the right, which moves backwards in time. 
  11703.  
  11704.  The commands C-v and M-v scroll the calendar by an entire 
  11705. ``screenful''---three months---in analogy with the usual meaning of these 
  11706. commands.  C-v makes later dates visible and M-v makes earlier dates visible. 
  11707. These commands take a numeric argument as a repeat count; in particular, since 
  11708. C-u (universal-argument) multiplies the next command by four, typing C-u C-v 
  11709. scrolls the calendar forward by a year and typing C-u M-v scrolls the calendar 
  11710. backward by a year. 
  11711.  
  11712.  The function keys NEXT and PRIOR are equivalent to C-v and M-v, just as they 
  11713. are in other modes. 
  11714.  
  11715.  In Calendar mode, you can use SPC (scroll-other-window) to scroll the other 
  11716. window.  This is handy when you display a list of holidays or diary entries in 
  11717. another window. 
  11718.  
  11719.  
  11720. ΓòÉΓòÉΓòÉ 32.3. Counting Days ΓòÉΓòÉΓòÉ
  11721.  
  11722. M-= 
  11723.           Display the number of days in the current region 
  11724.           (calendar-count-days-region). 
  11725.  
  11726.  To determine the number of days in the region, type M-= 
  11727. (calendar-count-days-region).  The numbers of days printed is inclusive; that 
  11728. is, it includes the days specified by mark and point. 
  11729.  
  11730.  
  11731. ΓòÉΓòÉΓòÉ 32.4. Miscellaneous Calendar Commands ΓòÉΓòÉΓòÉ
  11732.  
  11733. p d 
  11734.           Display day-in-year (calendar-print-day-of-year). 
  11735.  
  11736. C-c C-l 
  11737.           Regenerate the calendar window (redraw-calendar). 
  11738.  
  11739.           Exit from calendar (exit-calendar). 
  11740.  
  11741.  To print the number of days elapsed since the start of the year, or the number 
  11742. of days remaining in the year, type the p d command 
  11743. (calendar-print-day-of-year).  This displays both of those numbers in the echo 
  11744. area.  The number of days elapsed includes the selected date.  The number of 
  11745. days remaining does not include that date. 
  11746.  
  11747.  If the calendar window gets corrupted, type C-c C-l (redraw-calendar) to 
  11748. redraw it. 
  11749.  
  11750.  To exit from the calendar, type q (exit-calendar).  This buries all buffers 
  11751. related to the calendar and returns the window display to what it was when you 
  11752. entered the calendar. 
  11753.  
  11754.  
  11755. ΓòÉΓòÉΓòÉ 32.5. Holidays ΓòÉΓòÉΓòÉ
  11756.  
  11757.  The Emacs calendar knows about all major and many minor holidays, and can 
  11758. display them. 
  11759.  
  11760.           Display holidays for the selected date (calendar-cursor-holidays). 
  11761.  
  11762.           Mark holidays in the calendar window (mark-calendar-holidays). 
  11763.  
  11764.           Unmark calendar window (calendar-unmark). 
  11765.  
  11766.           List all holidays for the displayed three months in another window 
  11767.           (list-calendar-holidays). 
  11768.  
  11769. M-x holidays 
  11770.           List all holidays for three months around today's date in another 
  11771.           window. 
  11772.  
  11773.  To see if any holidays fall on a given date, position point on that date in 
  11774. the calendar window and use the h command.  This names the holidays for that 
  11775. date, in the echo area if they fit there, otherwise in a separate window. 
  11776.  
  11777.  To find the distribution of holidays for a wider period, use the x command. 
  11778. This displays a `*' after each date on which a holiday falls.  The command 
  11779. applies both to the currently visible months and to other months that 
  11780. subsequently become visible by scrolling.  To turn marking off and erase the 
  11781. current marks, type u, which also erases any diary marks (see Diary). 
  11782.  
  11783.  To get even more detailed information, use the a command, which displays a 
  11784. separate buffer containing a list of all holidays in the current three-month 
  11785. range. 
  11786.  
  11787.  The command M-x holidays displays the list of holidays for the current month 
  11788. and the preceding and succeeding months; this works even if you don't have a 
  11789. calendar window.  If you want the list of holidays centered around a different 
  11790. month, use C-u M-x holidays, which prompts for the month and year. 
  11791.  
  11792.  The holidays known to Emacs include American holidays and the major Christian, 
  11793. Jewish, and Islamic holidays; when floating point is available, the calendar 
  11794. also knows about solstices and equinoxes. 
  11795.  
  11796.  The dates used by Emacs for holidays are based on current practice, not 
  11797. historical fact.  Historically, for instance, the start of daylight savings 
  11798. time and even its existence have varied from year to year, but present American 
  11799. law mandates that daylight savings time begins on the first Sunday in April. 
  11800. Emacs always uses this definition, even though it is wrong for some prior 
  11801. years. 
  11802.  
  11803.  
  11804. ΓòÉΓòÉΓòÉ 32.6. Times of Sunrise and Sunset ΓòÉΓòÉΓòÉ
  11805.  
  11806.  Emacs can tell you, to within a minute or two, the times of sunrise and sunset 
  11807. for any date, if floating point is available. 
  11808.  
  11809.           Display times of sunrise and sunset for the selected date 
  11810.           (calendar-sunrise-sunset). 
  11811.  
  11812. M-x sunrise-sunset 
  11813.           Display times of sunrise and sunset for today's date. 
  11814.  
  11815. C-u M-x sunrise-sunset 
  11816.           Display times of sunrise and sunset for a specified date. 
  11817.  
  11818.  Within the calendar, to display the local times of sunrise and sunset in the 
  11819. echo area, move point to the date you want, and type S. 
  11820.  
  11821.  The command M-x sunrise-sunset is available outside the calendar to print this 
  11822. information for today's date or a specified date.  To specify a date other than 
  11823. today, use C-u M-x sunrise-sunset, which prompts for the year, month, and day. 
  11824.  
  11825.  Because the times of sunrise and sunset depend on the location on earth, you 
  11826. need to tell Emacs your latitude, longitude, and location name before using 
  11827. these commands.  Here is an example of what to set: 
  11828.  
  11829. (setq calendar-latitude 40.1)
  11830. (setq calendar-longitude -88.2)
  11831. (setq calendar-location-name "Urbana, IL")
  11832.  
  11833. Use one decimal place in the values of calendar-latitude and 
  11834. calendar-longitude. 
  11835.  
  11836.  Your time zone also affects the local time of sunrise and sunset. Emacs 
  11837. usually gets this information from the operating system, but if these values 
  11838. are not what you want (or if the operating system does not supply them), you 
  11839. must set them yourself.  Here is an example: 
  11840.  
  11841. (setq calendar-time-zone -360)
  11842. (setq calendar-standard-time-zone-name "CST")
  11843. (setq calendar-daylight-time-zone-name "CDT")
  11844.  
  11845. The value of calendar-time-zone is the number of minutes difference between 
  11846. your local standard time and Coordinated Universal Time (Greenwich time).  The 
  11847. values of calendar-standard-time-zone-name and calendar-daylight-time-zone-name 
  11848. are the abbreviations used in your time zone. 
  11849.  
  11850.  Emacs displays the times of sunrise and sunset corrected for daylight savings 
  11851. time.  The default rule for the starting and stopping dates of daylight savings 
  11852. time is the American rule. See Daylight Savings, for how to specify a different 
  11853. rule. 
  11854.  
  11855.  You can display the times of sunrise and sunset for any location and any date 
  11856. with C-u C-u M-x sunrise-sunset.  This asks you for a longitude, latitude, 
  11857. number of minutes difference from Coordinated Universal Time, and date, and 
  11858. then tells you the times of sunrise and sunset for that location on that date. 
  11859.  
  11860.  
  11861. ΓòÉΓòÉΓòÉ 32.7. Phases of the Moon ΓòÉΓòÉΓòÉ
  11862.  
  11863.  Emacs can tell you the dates and times of the phases of the moon (new moon, 
  11864. first quarter, full moon, last quarter), if floating point is available.  This 
  11865. feature is useful for debugging problems that ``depend on the phase of the 
  11866. moon.'' 
  11867.  
  11868.           Display the dates and times for all the quarters of the moon for the 
  11869.           three-month period shown (calendar-phases-of-moon). 
  11870.  
  11871. M-x phases-of-moon 
  11872.           Display dates and times of the quarters of the moon for three months 
  11873.           around today's date. 
  11874.  
  11875.  Within the calendar, use the M command to display a separate buffer of the 
  11876. phases of the moon for the current three-month range.  The dates and times 
  11877. listed are accurate to within a few minutes. 
  11878.  
  11879.  Outside the calendar, use the command M-x phases-of-moon to display the list 
  11880. of the phases of the moon for the current month and the preceding and 
  11881. succeeding months.  For information about a different month, use C-u M-x 
  11882. phases-of-moon, which prompts for the month and year. 
  11883.  
  11884.  The dates and times given for the phases of the moon are given in local time 
  11885. (corrected for daylight savings, when appropriate); but if the variable 
  11886. calendar-time-zone is void, Coordinated Universal Time (the Greenwich time 
  11887. zone) is used.  See Daylight Savings. 
  11888.  
  11889.  
  11890. ΓòÉΓòÉΓòÉ 32.8. Conversion To and From Other Calendars ΓòÉΓòÉΓòÉ
  11891.  
  11892.  The Emacs calendar displayed is always the Gregorian calendar, sometimes 
  11893. called the ``new style'' calendar, which is used in most of the world today. 
  11894. However, this calendar did not exist before the sixteenth century and was not 
  11895. widely used before the eighteenth century; it did not fully displace the Julian 
  11896. calendar and gain universal acceptance until the early twentieth century.  The 
  11897. Emacs calendar can display any month since January, year 1 of the current era, 
  11898. but the calendar displayed is the Gregorian, even for a date at which the 
  11899. Gregorian calendar did not exist. 
  11900.  
  11901.  While Emacs cannot display other calendars, it can convert dates to and from 
  11902. several other calendars. 
  11903.  
  11904.  
  11905. ΓòÉΓòÉΓòÉ 32.8.1. Supported Calendar Systems ΓòÉΓòÉΓòÉ
  11906.  
  11907.  The ISO commercial calendar is used largely in Europe. 
  11908.  
  11909.  The Julian calendar, named after Julius Caesar, was the one used in Europe 
  11910. throughout medieval times, and in many countries up until the nineteenth 
  11911. century. 
  11912.  
  11913.  Astronomers use a simple counting of days elapsed since noon, Monday, January 
  11914. 1, 4713 B.C. on the Julian calendar.  The number of days elapsed is called the 
  11915. Julian day number or the Astronomical day number. 
  11916.  
  11917.  The Hebrew calendar is the one used to determine the dates of Jewish holidays. 
  11918. Hebrew calendar dates begin and end at sunset. 
  11919.  
  11920.  The Islamic (Moslem) calendar is the one used to determine the dates of Moslem 
  11921. holidays.  There is no universal agreement in the Islamic world about the 
  11922. calendar; Emacs uses a widely accepted version, but the precise dates of 
  11923. Islamic holidays often depend on proclamation by religious authorities, not on 
  11924. calculations.  As a consequence, the actual dates of occurrence can vary 
  11925. slightly from the dates computed by Emacs.  Islamic calendar dates begin and 
  11926. end at sunset. 
  11927.  
  11928.  The French Revolutionary calendar was created by the Jacobins after the 1789 
  11929. revolution, to represent a more secular and nature-based view of the annual 
  11930. cycle, and to install a 10-day week in a rationalization measure similar to the 
  11931. metric system.  The French government officially abandoned this calendar at the 
  11932. end of 1805. 
  11933.  
  11934.  The Maya of Central America used three separate, overlapping calendar systems, 
  11935. the long count, the tzolkin, and the haab. Emacs knows about all three of these 
  11936. calendars.  Experts dispute the exact correlation between the Mayan calendar 
  11937. and our calendar; Emacs uses the Goodman-Martinez-Thompson correlation in its 
  11938. calculations. 
  11939.  
  11940.  
  11941. ΓòÉΓòÉΓòÉ 32.8.2. Converting To Other Calendars ΓòÉΓòÉΓòÉ
  11942.  
  11943.  The following commands describe the selected date (the date at point) in 
  11944. various other calendar systems: 
  11945.  
  11946. p c 
  11947.           Display ISO commercial calendar equivalent for selected day 
  11948.           (calendar-print-iso-date). 
  11949.  
  11950. p j 
  11951.           Display Julian date for selected day (calendar-print-julian-date). 
  11952.  
  11953. p a 
  11954.           Display astronomical (Julian) day number for selected day 
  11955.           (calendar-print-astro-day-number). 
  11956.  
  11957. p h 
  11958.           Display Hebrew date for selected day (calendar-print-hebrew-date). 
  11959.  
  11960. p i 
  11961.           Display Islamic date for selected day (calendar-print-islamic-date). 
  11962.  
  11963. p f 
  11964.           Display French Revolutionary date for selected day 
  11965.           (calendar-print-french-date). 
  11966.  
  11967. p m 
  11968.           Display Mayan date for selected day (calendar-print-mayan-date). 
  11969.  
  11970.  Put point on the desired date of the Gregorian calendar, then type the 
  11971. appropriate keys.  The p is a mnemonic for ``print'' since Emacs ``prints'' the 
  11972. equivalent date in the echo area. 
  11973.  
  11974.  
  11975. ΓòÉΓòÉΓòÉ 32.8.3. Converting From Other Calendars ΓòÉΓòÉΓòÉ
  11976.  
  11977.  You can move to dates that you specify on the Commercial, Julian, 
  11978. astronomical, Hebrew, Islamic, or French calendars: 
  11979.  
  11980. g c 
  11981.           Move to a date specified in the ISO commercial calendar 
  11982.           (calendar-goto-iso-date). 
  11983.  
  11984. g j 
  11985.           Move to a date specified in the Julian calendar 
  11986.           (calendar-goto-julian-date). 
  11987.  
  11988. g a 
  11989.           Move to a date specified in astronomical (Julian) day number 
  11990.           (calendar-goto-astro-day-number). 
  11991.  
  11992. g h 
  11993.           Move to a date specified in the Hebrew calendar 
  11994.           (calendar-goto-hebrew-date). 
  11995.  
  11996. g i 
  11997.           Move to a date specified in the Islamic calendar 
  11998.           (calendar-goto-islamic-date). 
  11999.  
  12000. g f 
  12001.           Move to a date specified in the French Revolutionary calendar 
  12002.           (calendar-goto-french-date). 
  12003.  
  12004.  These commands ask you for a date on the other calendar, move point to the 
  12005. Gregorian calendar date equivalent to that date, and display the other 
  12006. calendar's date in the echo area.  Emacs uses strict completion (see 
  12007. Completion) whenever it asks you to type a month name, so you don't have to 
  12008. worry about the spelling of Hebrew, Islamic, or French names. 
  12009.  
  12010.  One common question concerning the Hebrew calendar is the computation of the 
  12011. anniversary of a date of death, called a ``yahrzeit.''  The Emacs calendar 
  12012. includes a facility for such calculations.  If you are in the calendar, the 
  12013. command M-x list-yahrzeit-dates asks you for a range of years and then displays 
  12014. a list of the yahrzeit dates for those years for the date given by point.  If 
  12015. you are not in the calendar, this command first asks you for the date of death 
  12016. and the range of years, and then displays the list of yahrzeit dates. 
  12017.  
  12018.  
  12019. ΓòÉΓòÉΓòÉ 32.8.4. Converting from the Mayan Calendar ΓòÉΓòÉΓòÉ
  12020.  
  12021.  Here are the commands to select dates based on the Mayan calendar: 
  12022.  
  12023. g m l 
  12024.           Move to a date specified by the long count calendar 
  12025.           (calendar-goto-mayan-long-count-date). 
  12026.  
  12027. g m p t 
  12028.           Move to the previous occurrence of a place in the tzolkin calendar 
  12029.           (calendar-previous-tzolkin-date). 
  12030.  
  12031. g m n t 
  12032.           Move to the next occurrence of a place in the tzolkin calendar 
  12033.           (calendar-next-tzolkin-date). 
  12034.  
  12035. g m p h 
  12036.           Move to the previous occurrence of a place in the haab calendar 
  12037.           (calendar-previous-haab-date). 
  12038.  
  12039. g m n h 
  12040.           Move to the next occurrence of a place in the haab calendar 
  12041.           (calendar-next-haab-date). 
  12042.  
  12043. g m p c 
  12044.           Move to the previous occurrence of a place in the calendar round 
  12045.           (calendar-previous-calendar-round-date). 
  12046.  
  12047. g m n c 
  12048.           Move to the next occurrence of a place in the calendar round 
  12049.           (calendar-next-calendar-round-date). 
  12050.  
  12051.  To understand these commands, you need to understand the Mayan calendars. The 
  12052. long count is a counting of days with these units: 
  12053.  
  12054. 1 kin = 1 day@ @ @ 1 uinal = 20 kin@ @ @ 1 tun = 18 uinal
  12055. 1 katun = 20 tun@ @ @ 1 baktun = 20 katun
  12056.  
  12057. Thus, the long count date 12.16.11.16.6 means 12 baktun, 16 katun, 11 tun, 16 
  12058. uinal, and 6 kin.  The Emacs calendar can handle Mayan long count dates as 
  12059. early as 7.17.18.13.1, but no earlier.  When you use the g m l command, type 
  12060. the Mayan long count date with the baktun, katun, tun, uinal, and kin separated 
  12061. by periods. 
  12062.  
  12063.  The Mayan tzolkin calendar is a cycle of 260 days formed by a pair of 
  12064. independent cycles of 13 and 20 days.  Since this cycle repeats endlessly, 
  12065. Emacs provides commands to move backward and forward to the previous or next 
  12066. point in the cycle.  Type g m p t to go to the previous tzolkin date; Emacs 
  12067. asks you for a tzolkin date and moves point to the previous occurrence of that 
  12068. date.  Similarly, type g m n t to go to the next occurrence of a tzolkin date. 
  12069.  
  12070.  The Mayan haab calendar is a cycle of 365 days arranged as 18 months of 20 
  12071. days each, followed a 5-day monthless period.  Like the tzolkin cycle, this 
  12072. cycle repeats endlessly, and there are commands to move backward and forward to 
  12073. the previous or next point in the cycle.  Type g m p h to go to the previous 
  12074. haab date; Emacs asks you for a haab date and moves point to the previous 
  12075. occurrence of that date. Similarly, type g m n h to go to the next occurrence 
  12076. of a haab date. 
  12077.  
  12078.  The Maya also used the combination of the tzolkin date and the haab date. 
  12079. This combination is a cycle of about 52 years called a calendar round.  If you 
  12080. type g m p c, Emacs asks you for both a haab and a tzolkin date and then moves 
  12081. point to the previous occurrence of that combination.  Use g m p c to move 
  12082. point to the next occurrence of a combination.  Emacs signals an error if the 
  12083. haab/tzolkin date you have typed is impossible. 
  12084.  
  12085.  Emacs uses strict completion (see Completion) whenever it asks you to type a 
  12086. Mayan name, so you don't have to worry about spelling. 
  12087.  
  12088.  
  12089. ΓòÉΓòÉΓòÉ 32.9. The Diary ΓòÉΓòÉΓòÉ
  12090.  
  12091.  The Emacs diary keeps track of appointments or other events on a daily basis, 
  12092. in conjunction with the calendar.  To use the diary feature, you must first 
  12093. create a diary file containing a list of events and their dates.  Then Emacs 
  12094. can automatically pick out and display the events for today, for the immediate 
  12095. future, or for any specified date. 
  12096.  
  12097.  By default, Emacs uses `~/diary' as the diary file.  This is the same file 
  12098. that the calendar utility uses.  A sample `~/diary' file is: 
  12099.  
  12100. 12/22/1988 Twentieth wedding anniversary!!
  12101. &1/1. Happy New Year!
  12102. 10/22 Ruth's birthday.
  12103. * 21, *: Payday
  12104. Tuesday--weekly meeting with grad students at 10am
  12105.          Supowit, Shen, Bitner, and Kapoor to attend.
  12106. 1/13/89 Friday the thirteenth!!
  12107. &thu 4pm squash game with Lloyd.
  12108. mar 16 Dad's birthday
  12109. April 15, 1989 Income tax due.
  12110. &* 15 time cards due.
  12111.  
  12112.  Although you probably will start by creating a diary manually, Emacs provides 
  12113. a number of commands to let you view, add, and change diary entries. 
  12114.  
  12115.  
  12116. ΓòÉΓòÉΓòÉ 32.9.1. Commands Displaying Diary Entries ΓòÉΓòÉΓòÉ
  12117.  
  12118.  Once you have created a `~/diary' file, you can view it from within the 
  12119. calendar.  You can also view today's events outside of Calendar mode. 
  12120.  
  12121.           Display any diary entries for the selected date (view-diary-entries). 
  12122.  
  12123.           Display entire diary file (show-all-diary-entries). 
  12124.  
  12125.           Mark all visible dates that have diary entries (mark-diary-entries). 
  12126.  
  12127.           Unmark calendar window (calendar-unmark). 
  12128.  
  12129. M-x print-diary-entries 
  12130.           Print hard copy of the diary display as it appears. 
  12131.  
  12132. M-x diary 
  12133.           Display any diary entries for today's date. 
  12134.  
  12135.  Displaying the diary entries with d shows in a separate window the diary 
  12136. entries for the selected date in the calendar.  The mode line of the new window 
  12137. shows the date of the diary entries and any holidays that fall on that date. 
  12138.  
  12139.  If you specify a numeric argument with d, it shows all the diary entries for 
  12140. that many successive days.  Thus, 2 d displays all the entries for the selected 
  12141. date and for the following day. 
  12142.  
  12143.  To get a broader view of which days are mentioned in the diary, use the m 
  12144. command.  This places a `+' after each date which has a diary entry.  The 
  12145. command applies both to the currently visible months and to other months that 
  12146. subsequently become visible by scrolling.  To turn marking off and erase the 
  12147. current marks, type u, which also turns off holiday marks (see Holidays). 
  12148.  
  12149.  To see the full diary file, rather than just some of the entries, use the s 
  12150. command. 
  12151.  
  12152.  Display of selected diary entries uses the selective display feature to hide 
  12153. entries that don't apply.  This is the same feature that Outline mode uses to 
  12154. show part of an outline (see Outline Mode).  The diary buffer as you see it is 
  12155. an illusion, so simply printing the buffer does not print what you see on your 
  12156. screen. 
  12157.  
  12158.   There is a special command to print hard copy of the diary buffer as it 
  12159. appears; this command is M-x print-diary-entries.  It sends the data directly 
  12160. to the printer.  You can customize it like lpr-region (see Hardcopy). 
  12161.  
  12162.  The command M-x diary displays the diary entries for the current date, 
  12163. independently of the calendar display, and optionally for the next few days as 
  12164. well; the variable number-of-diary-entries specifies how many days to include. 
  12165. See Calendar/Diary Options. 
  12166.  
  12167.  If you put (diary) in your `.emacs' file, this automatically displays a window 
  12168. with the day's diary entries, when you enter Emacs.  The mode line of the 
  12169. displayed window shows the date and any holidays that fall on that date. 
  12170.  
  12171.  
  12172. ΓòÉΓòÉΓòÉ 32.9.2. The Diary File ΓòÉΓòÉΓòÉ
  12173.  
  12174.  Your diary file is a file that records events associated with particular 
  12175. dates.  The name of the diary file is specified by the variable diary-file; 
  12176. `~/diary' is the default.  You can use the same file for the calendar utility 
  12177. program, since its formats are a subset of the ones allowed by the Emacs diary 
  12178. facilities. 
  12179.  
  12180.  Each entry in the diary file describes one event and consists of one or more 
  12181. lines.  An entry always begins with a date specification at the left margin. 
  12182. The rest of the entry is simply text to describe the event.  If the entry has 
  12183. more than one line, then the lines after the first must begin with whitespace 
  12184. to indicate they continue a previous entry.  Lines that do not begin with valid 
  12185. dates and do not continue a preceding entry are ignored. 
  12186.  
  12187.  You can inhibit the marking of certain diary entries in the calendar window; 
  12188. to do this, insert an ampersand (`&') at the beginning of the entry, before the 
  12189. date.  This has no effect on display of the entry in the diary window; it 
  12190. affects only marks on dates in the calendar window.  Nonmarking entries are 
  12191. especially useful for generic entries that would otherwise mark many different 
  12192. dates. 
  12193.  
  12194.  If the first line of a diary entry consists only of the date or day name with 
  12195. no following blanks or punctuation, then the diary window display doesn't 
  12196. include that line; only the continuation lines appear. For example: 
  12197.  
  12198. 02/11/1989
  12199.       Bill B. visits Princeton today
  12200.       2pm Cognitive Studies Committee meeting
  12201.       2:30-5:30 Liz at Lawrenceville
  12202.       4:00pm Dentist appt
  12203.       7:30pm Dinner at George's
  12204.       8:00-10:00pm concert
  12205.  
  12206. appears in the diary window without the date line at the beginning. This style 
  12207. of entry looks neater when you display just a single day's entries, but can 
  12208. cause confusion if you ask for more than one day's entries. 
  12209.  
  12210.  You can edit the diary entries as they appear in the window, but it is 
  12211. important to remember that the buffer displayed contains the entire diary file, 
  12212. with portions of it concealed from view.  This means, for instance, that the 
  12213. C-f (forward-char) command can put point at what appears to be the end of the 
  12214. line, but what is in reality the middle of some concealed line. 
  12215.  
  12216.  Be careful when editing the diary entries!  Inserting additional lines or 
  12217. adding/deleting characters in the middle of a visible line cannot cause 
  12218. problems, but editing at the end of a line may not do what you expect. 
  12219. Deleting a line may delete other invisible entries that follow it.  Before 
  12220. editing the diary, it is best to display the entire file with s 
  12221. (show-all-diary-entries). 
  12222.  
  12223.  
  12224. ΓòÉΓòÉΓòÉ 32.9.3. Date Formats ΓòÉΓòÉΓòÉ
  12225.  
  12226.  Here are some sample diary entries, illustrating different ways of formatting 
  12227. a date.  The examples all show dates in American order (month, day, year), but 
  12228. Calendar mode supports European order (day, month, year) as an option. 
  12229.  
  12230. 4/20/93  Switch-over to new tabulation system
  12231. apr. 25  Start tabulating annual results
  12232. 4/30  Results for April are due
  12233. */25  Monthly cycle finishes
  12234. Friday  Don't leave without backing up files
  12235.  
  12236.  The first entry appears only once, on April 20, 1993.  The second and third 
  12237. appear every year on the specified dates, and the fourth uses a wildcard 
  12238. (asterisk) for the month, so it appears on the 25th of every month.  The final 
  12239. entry appears every week on Friday. 
  12240.  
  12241.  You can use just numbers to express a date, as in `month/day' or 
  12242. `month/day/year'.  This must be followed by a nondigit.  In the date itself, 
  12243. month and day are numbers of one or two digits.  year is a number and may be 
  12244. abbreviated to the last two digits; that is, you can use `11/12/1989' or 
  12245. `11/12/89'. 
  12246.  
  12247.  Dates can also have the form `monthname day' or `monthname day, year', where 
  12248. the month's name can be spelled in full or abbreviated to three characters 
  12249. (with or without a period).  Case is not significant. 
  12250.  
  12251.  A date may be generic, or partially unspecified.  Then the entry applies to 
  12252. all dates that match the specification.  If the date does not contain a year, 
  12253. it is generic and applies to any year.  Alternatively, month, day, or year can 
  12254. be a `*'; this matches any month, day, or year, respectively.  Thus, a diary 
  12255. entry `3/*/*' matches any day in March of any year; so does `march *'. 
  12256.  
  12257.  If you prefer the European style of writing dates---in which the day comes 
  12258. before the month---type M-x european-calendar while in the calendar, or set the 
  12259. variable european-calendar-style to t before using any calendar or diary 
  12260. command.  This mode interprets all dates in the diary in the European manner, 
  12261. and also uses European style for displaying diary dates.  (Note that there is 
  12262. no comma after the monthname in the European style.)  To go back to the 
  12263. (default) American style of writing dates, type M-x american-calendar. 
  12264.  
  12265.  You can use the name of a day of the week as a generic date which applies to 
  12266. any date falling on that day of the week.  You can abbreviate the day of the 
  12267. week to three letters (with or without a period) or spell it in full; case is 
  12268. not significant. 
  12269.  
  12270.  
  12271. ΓòÉΓòÉΓòÉ 32.9.4. Commands to Add to the Diary ΓòÉΓòÉΓòÉ
  12272.  
  12273.  While in the calendar, there are several commands to create diary entries: 
  12274.  
  12275. i d 
  12276.           Add a diary entry for the selected date (insert-diary-entry). 
  12277.  
  12278. i w 
  12279.           Add a diary entry for the selected day of the week 
  12280.           (insert-weekly-diary-entry). 
  12281.  
  12282. i m 
  12283.           Add a diary entry for the selected day of the month 
  12284.           (insert-monthly-diary-entry). 
  12285.  
  12286. i y 
  12287.           Add a diary entry for the selected day of the year 
  12288.           (insert-yearly-diary-entry). 
  12289.  
  12290.  You can make a diary entry for a specific date by selecting that date in the 
  12291. calendar window and typing the i d command.  This command displays the end of 
  12292. your diary file in another window and inserts the date; you can then type the 
  12293. rest of the diary entry. 
  12294.  
  12295.  If you want to make a diary entry that applies to a specific day of the week, 
  12296. select that day of the week (any occurrence will do) and type i w.  This 
  12297. inserts the day-of-week as a generic date; you can then type the rest of the 
  12298. diary entry. 
  12299.  
  12300.  You can make a monthly diary entry in the same fashion.  Select the day of the 
  12301. month, use the i m command, and type rest of the entry.  Similarly, you can 
  12302. insert a yearly diary entry with the i y command. 
  12303.  
  12304.  All of the above commands make marking diary entries.  If you want the diary 
  12305. entry to be nonmarking, give a prefix argument to the command. For example, C-u 
  12306. i w makes a nonmarking, weekly diary entry. 
  12307.  
  12308.  When you modify the diary file, be sure to save the file before exiting Emacs. 
  12309.  
  12310.  
  12311. ΓòÉΓòÉΓòÉ 32.9.5. Special Diary Entries ΓòÉΓòÉΓòÉ
  12312.  
  12313.  In addition to entries based on calendar dates, your diary file can contain 
  12314. special entries for regular events such as anniversaries. These entries are 
  12315. based on Lisp expressions (sexps) that Emacs evaluates as it scans the diary 
  12316. file.  Instead of a date, a special entry contains `%%' followed by a Lisp 
  12317. expression which must begin and end with parentheses.  The Lisp expression 
  12318. determines which dates the entry applies to. 
  12319.  
  12320.  Calendar mode provides commands to insert certain commonly used special 
  12321. entries: 
  12322.  
  12323. i a 
  12324.           Add an anniversary diary entry for the selected date 
  12325.           (insert-anniversary-diary-entry). 
  12326.  
  12327. i b 
  12328.           Add a block diary entry for the current region 
  12329.           (insert-block-diary-entry). 
  12330.  
  12331. i c 
  12332.           Add a cyclic diary entry starting at the date 
  12333.           (insert-cyclic-diary-entry). 
  12334.  
  12335.  If you want to make a diary entry that applies to the anniversary of a 
  12336. specific date, move point to that date and use the i a command. This displays 
  12337. the end of your diary file in another window and inserts the anniversary 
  12338. description; you can then type the rest of the diary entry.  The entry looks 
  12339. like this: 
  12340.  
  12341. %%(diary-anniversary 10 31 1948) Arthur's birthday
  12342.  
  12343. This entry applies to October 31 in any year after 1948; `10 31 1948' specifies 
  12344. the date.  (If you are using the European calendar style, the month and day are 
  12345. interchanged.)  The reason this expression requires a beginning year is that 
  12346. advanced diary functions can use it to calculate the number of elapsed years. 
  12347.  
  12348.  You can make a diary entry entry for a block of dates by setting the mark at 
  12349. the date at one end of the block, moving point to the date at the other end of 
  12350. the block, and using the i b command.  This command causes the end of your 
  12351. diary file to be displayed in another window and the block description to be 
  12352. inserted; you can then type the diary entry.  Here is a block diary entry that 
  12353. applies to all dates from June 24, 1990 through July 10, 1990: 
  12354.  
  12355. %%(diary-block 6 24 1990 7 10 1990) Vacation
  12356.  
  12357. The `6 24 1990' indicates the starting date and the `7 10 1990' indicates the 
  12358. stopping date.  (Again, if you are using the European calendar style, the month 
  12359. and day are interchanged.) 
  12360.  
  12361.   Cyclic diary entries repeat after a fixed interval of days.  To create one, 
  12362. select the starting date and use the i c command.  The command prompts for the 
  12363. length of interval, then inserts the entry. It looks like this: 
  12364.  
  12365. %%(diary-cyclic 50 3 1 1990) Renew medication
  12366.  
  12367. which applies to March 1, 1990 and every 50th day following; `3 1 1990' 
  12368. specifies the starting date.  (If you are using the European calendar style, 
  12369. the month and day are interchanged.) 
  12370.  
  12371.  All three of the these commands make marking diary entries.  If you want the 
  12372. diary entry to be nonmarking, give a numeric argument to the command.  For 
  12373. example, C-u i a makes a nonmarking anniversary diary entry. 
  12374.  
  12375.  Marking sexp diary entries in the calendar is extremely time-consuming, since 
  12376. every date visible in the calendar window must be individually checked.  So 
  12377. it's a good idea to make sexp diary entries nonmarking (with `&') when 
  12378. possible. 
  12379.  
  12380.  Another sophisticated kind of sexp entry, a floating diary entry, specifies a 
  12381. regularly-occurring event by offsets specified in days, weeks, and months.  It 
  12382. is comparable to a crontab entry interpreted by the cron utility.  Here is a 
  12383. nonmarking, floating diary entry that applies to the last Thursday in November: 
  12384.  
  12385. &%%(diary-float 11 4 -1) American Thanksgiving
  12386.  
  12387. The 11 specifies November (the eleventh month), the 4 specifies Thursday (the 
  12388. fourth day of the week, where Sunday is numbered zero), and the -1 specifies 
  12389. ``last'' (1 would mean ``first'', 2 would mean ``second'', -2 would mean 
  12390. ``second-to-last'', and so on).  The month can be a single month or a list of 
  12391. months.  Thus you could change the 11 above to `'(1 2 3)' and have the entry 
  12392. apply to the last Thursday of January, February, and March.  If the month is t, 
  12393. the entry applies to all months of the year. 
  12394.  
  12395.  Most generally, special diary entries can perform arbitrary computations to 
  12396. determine when they apply. See Sexp Diary Entries. 
  12397.  
  12398.  
  12399. ΓòÉΓòÉΓòÉ 32.10. Appointments ΓòÉΓòÉΓòÉ
  12400.  
  12401.  If you have a diary entry for an appointment, and that diary entry begins with 
  12402. a recognizable time of day, Emacs can warn you, several minutes beforehand, 
  12403. that that appointment is pending.  Emacs alerts you to the appointment by 
  12404. displaying a message in the mode line. 
  12405.  
  12406.  To enable appointment notification, you must enable the time display feature 
  12407. of Emacs, M-x display-time (see Mode Line).  You must also add the function 
  12408. appt-make-list to the diary-display-hook, like this: 
  12409.  
  12410. (add-hook 'diary-display-hook 'appt-make-list)
  12411.  
  12412.  With these preparations done, when you display the diary (either with the d 
  12413. command in the calendar window or with the M-x diary command), it sets up an 
  12414. appointment list of all the diary entries found with recognizable times of day, 
  12415. and reminds you just before each of them. 
  12416.  
  12417.  For example, if you the diary file contains these lines: 
  12418.  
  12419. Monday
  12420.   9:30am Coffee break
  12421.  12:00pm Lunch
  12422.  
  12423. Then on Mondays, after you have displayed the diary, you will be reminded at 
  12424. 9:20am about your coffee break and at 11:50am about lunch. 
  12425.  
  12426.  Diary entries can have the time in the conventional American style, or in 
  12427. ``military'' style.  You need not be consistent; your diary file can have a 
  12428. mixture of the two styles. 
  12429.  
  12430.  Emacs updates the appointments list automatically just after midnight.  This 
  12431. also displays the next days' diary entries in the diary buffer, unless you set 
  12432. appt-display-diary to nil. 
  12433.  
  12434.  You can also use the appointment notification facility like an alarm clock. 
  12435. The command M-x appt-add adds entries to the appointment list without affecting 
  12436. your diary file.  You delete entries from the appointment list with M-x 
  12437. appt-delete. 
  12438.  
  12439.  You can turn off the appointment notification feature at any time by setting 
  12440. appt-issue-message to nil. 
  12441.  
  12442.  
  12443. ΓòÉΓòÉΓòÉ 32.11. Daylight Savings Time ΓòÉΓòÉΓòÉ
  12444.  
  12445.  Emacs understands the difference between standard time and daylight savings 
  12446. time---the times given for sunrise, sunset, solstices, equinoxes, and the 
  12447. phases of the moon take that into account.  The rules for daylight savings time 
  12448. vary from place to place and have also varied historically from year to year. 
  12449. To do the job properly, Emacs needs to know which rules to use. 
  12450.  
  12451.  Some operating systems keep track of the rules that apply to the place where 
  12452. you are; on these systems, Emacs gets the information it needs from the system 
  12453. automatically.  If the system does not know the rules, you can tell Emacs the 
  12454. rules to use by setting certain variables. 
  12455.  
  12456.  If the system's data indicate that your area currently uses daylight savings 
  12457. time, the default starting and stopping dates for daylight savings time are the 
  12458. present-day American rules of the first Sunday in April until the last Sunday 
  12459. in October.  If this isn't right, you can specify whatever rules you want by 
  12460. setting calendar-daylight-savings-starts and calendar-daylight-savings-ends. 
  12461. Their values should be Lisp expressions that refer to the variable year, and 
  12462. evaluate to the Gregorian date on which daylight savings time starts or 
  12463. (respectively) ends, in the form of a list (month day year). The values should 
  12464. be nil if your area does not use daylight savings time. 
  12465.  
  12466.  Emacs uses these expressions to determine the starting date of daylight 
  12467. savings time for the holiday list and for correcting times of day in the solar 
  12468. and lunar calculations. 
  12469.  
  12470.  The default value of calendar-daylight-savings-starts is this, 
  12471.  
  12472. (calendar-nth-named-day 1 0 4 year)
  12473.  
  12474. which computes the first 0th day (Sunday) of the fourth month (April) in the 
  12475. year specified by year.  If daylight savings time were changed to start on 
  12476. October 1, you would set calendar-daylight-savings-starts to this: 
  12477.  
  12478. (list 10 1 year)
  12479.  
  12480.  If there is no daylight savings time at your location, or if you want all 
  12481. times in standard time, set calendar-daylight-savings-starts and 
  12482. calendar-daylight-savings-ends to nil. 
  12483.  
  12484.  In some areas, the difference between daylight savings time and standard time 
  12485. is not one hour.  If this is so in your location, set the variable 
  12486. calendar-daylight-time-offset to the difference, measured in minutes. 
  12487.  
  12488.  If the transition to or from daylight savings time does not take place at 2AM, 
  12489. you can specify when it takes place by setting the variable 
  12490. calendar-daylight-savings-switchover-time.  Its value is the number of minutes 
  12491. after midnight of the time when the transition should occur. 
  12492.  
  12493.  
  12494. ΓòÉΓòÉΓòÉ 32.12. GNUS ΓòÉΓòÉΓòÉ
  12495.  
  12496.  gnus is an Emacs subsystem for reading and responding to netnews.  You can use 
  12497. gnus to browse through news groups, look at summaries of articles in specific 
  12498. group, and read articles of interest.  You can respond to authors or write 
  12499. replies to all the readers of a news group. 
  12500.  
  12501.  This section introduces gnus and describes several basic features.  Full 
  12502. documentation will appear elsewhere. 
  12503.  
  12504. To start gnus, type M-x gnus RET. 
  12505.  
  12506.  
  12507. ΓòÉΓòÉΓòÉ 32.12.1. GNUS's Three Buffers ΓòÉΓòÉΓòÉ
  12508.  
  12509. gnus creates and uses three Emacs buffers, each with its own particular purpose 
  12510. and its own major mode. 
  12511.  
  12512. The Newsgroup buffer contains a list of newsgroups.  This is the first buffer 
  12513. that gnus displays when it starts up.  Normally the list contains only the 
  12514. newsgroups to which you subscribe (which are listed in your `.newsrc' file) and 
  12515. which contain unread articles.  Use this buffer to select a specific newsgroup. 
  12516.  
  12517. The Summary buffer lists the articles in a single newsgroup, including their 
  12518. subjects, their numbers, and who posted them.  gnus creates a Summary buffer 
  12519. for a newsgroup when you select the group in the Newsgroup buffer.  Use this 
  12520. buffer to select an article, and to move around in an article. 
  12521.  
  12522. The Article buffer displays the text of an article.  You rarely need to select 
  12523. this buffer because you can read the text while keeping the Summary buffer 
  12524. selected. 
  12525.  
  12526.  
  12527. ΓòÉΓòÉΓòÉ 32.12.2. When GNUS Starts Up ΓòÉΓòÉΓòÉ
  12528.  
  12529. At startup, gnus reads your `.newsrc' news initialization file and attempts to 
  12530. communicate with the local news server, which is a repository of news articles. 
  12531. The news server need not be the same computer you are logged in on. 
  12532.  
  12533. If you start gnus and connect to the server, but do not see any newsgroups 
  12534. listed in the Newsgroup buffer, type L to get a listing of all the newsgroups. 
  12535. Then type u to unsubscribe from particular newsgroups.  (Move the cursor using 
  12536. n and p or the usual Emacs commands.) 
  12537.  
  12538. When you quit gnus with q, it automatically records in your `.newsrc' 
  12539. initialization file the subscribed or unsubscribed status of all newsgroups, 
  12540. except for groups you have ``killed''.  (You do not need to edit this file 
  12541. yourself, but you may.)  When new newsgroups come into existence, gnus adds 
  12542. them automatically. 
  12543.  
  12544.  
  12545. ΓòÉΓòÉΓòÉ 32.12.3. Summary of GNUS Commands ΓòÉΓòÉΓòÉ
  12546.  
  12547. Reading news is a two step process: 
  12548.  
  12549.  1. Choose a newsgroup in the Newsgroup buffer. 
  12550.  
  12551.  2. Select articles from the Summary buffer.  Each article selected is 
  12552.     displayed in the Article buffer in a large window, below the Summary buffer 
  12553.     in its small window. 
  12554.  
  12555. Each buffer has commands particular to it, but commands that do the same things 
  12556. have similar keybindings.  Here are commands for the Newsgroup and Summary 
  12557. buffers: 
  12558.  
  12559.           In the Newsgroup buffer, suspend gnus.  You can return to gnus later 
  12560.           by selecting the Newsgroup buffer and typing g to get newly arrived 
  12561.           articles. 
  12562.  
  12563.           In the Newsgroup buffer, update your `.newsrc' initialization file 
  12564.           and quit gnus. 
  12565.  
  12566.           In the Summary buffer, exit the current newsgroup and return to the 
  12567.           Newsgroup buffer.  Thus, typing q twice quits gnus. 
  12568.  
  12569.           In the Newsgroup buffer, list all the newsgroups available on your 
  12570.           news server.  This may be a long list! 
  12571.  
  12572.           In the Newsgroup buffer, list only the newsgroups to which you 
  12573.           subscribe and which contain unread articles. 
  12574.  
  12575.           In the Newsgroup buffer, unsubscribe from (or subscribe to) the 
  12576.           newsgroup listed in the line that point is on.  When you quit gnus by 
  12577.           typing q, gnus lists your subscribed-to newsgroups in your `.newsrc' 
  12578.           file.  The next time you start gnus, you see only the newsgroups 
  12579.           listed in your `.newsrc' file. 
  12580.  
  12581. C-k 
  12582.           In the Newsgroup buffer, ``kill'' the current line's 
  12583.           newsgroup---don't show it in the Newsgroup buffer from now on.  This 
  12584.           affects future GNUS sessions as well as the present session. 
  12585.  
  12586.           When you quit gnus by typing q, gnus writes information in the file 
  12587.           `.newsrc' describing all newsgroups except those you have ``killed.'' 
  12588.  
  12589. SPC 
  12590.           In the Newsgroup buffer, select the group on the line under the 
  12591.           cursor and display the first unread article in that group. 
  12592.  
  12593.           In the Summary buffer, 
  12594.  
  12595.    o Select the article on the line under the cursor if none is selected. 
  12596.  
  12597.    o Scroll the text of the selected article (if there is one). 
  12598.  
  12599.    o Select the next unread article if at the end of the current article. 
  12600.  
  12601.           Thus, you can move through all the articles by repeatedly typing SPC. 
  12602.  
  12603. DEL 
  12604.           In the Newsgroup Buffer, move point to the previous newsgroup 
  12605.           containing unread articles. 
  12606.  
  12607.           In the Summary buffer, scroll the text of the article backwards. 
  12608.  
  12609.           Move point to the next unread newsgroup, or select the next unread 
  12610.           article. 
  12611.  
  12612.           Move point to the previous unread newsgroup, or select the previous 
  12613.           unread article. 
  12614.           C-n 
  12615.  
  12616. C-p 
  12617.           Move point to the next or previous item, even if it is marked as 
  12618.           read. This does not select the article or newsgroup on that line. 
  12619.  
  12620.           In the Summary buffer, do an incremental search of the current text 
  12621.           in the Article buffer, just as if you switched to the Article buffer 
  12622.           and typed C-s. 
  12623.  
  12624. M-s regexp RET 
  12625.           In the Summary buffer, search forward for articles containing a match 
  12626.           for regexp. 
  12627.  
  12628. C-c C-s C-n 
  12629. C-c C-s C-s 
  12630. C-c C-s C-d 
  12631. C-c C-s C-a 
  12632.           In the Summary buffer, sort the list of articles by number, subject, 
  12633.           date, or author. 
  12634.  
  12635. C-M-n 
  12636. C-M-p 
  12637.           In the Summary buffer, read the next or previous article with the 
  12638.           same subject as the current article. 
  12639.  
  12640.  
  12641. ΓòÉΓòÉΓòÉ 32.13. Sorting Text ΓòÉΓòÉΓòÉ
  12642.  
  12643.  Emacs provides several commands for sorting text in the buffer.  All operate 
  12644. on the contents of the region (the text between point and the mark).  They 
  12645. divide the text of the region into many sort records, identify a sort key for 
  12646. each record, and then reorder the records into the order determined by the sort 
  12647. keys.  The records are ordered so that their keys are in alphabetical order, 
  12648. or, for numeric sorting, in numeric order.  In alphabetic sorting, all upper 
  12649. case letters `A' through `Z' come before lower case `a', in accord with the 
  12650. ASCII character sequence. 
  12651.  
  12652.  The various sort commands differ in how they divide the text into sort records 
  12653. and in which part of each record is used as the sort key.  Most of the commands 
  12654. make each line a separate sort record, but some commands use paragraphs or 
  12655. pages as sort records.  Most of the sort commands use each entire sort record 
  12656. as its own sort key, but some use only a portion of the record as the sort key. 
  12657.  
  12658. M-x sort-lines 
  12659.           Divide the region into lines, and sort by comparing the entire text 
  12660.           of a line.  A prefix argument means sort into descending order. 
  12661.  
  12662. M-x sort-paragraphs 
  12663.           Divide the region into paragraphs, and sort by comparing the entire 
  12664.           text of a paragraph (except for leading blank lines).  A prefix 
  12665.           argument means sort into descending order. 
  12666.  
  12667. M-x sort-pages 
  12668.           Divide the region into pages, and sort by comparing the entire text 
  12669.           of a page (except for leading blank lines).  A prefix argument means 
  12670.           sort into descending order. 
  12671.  
  12672. M-x sort-fields 
  12673.           Divide the region into lines, and sort by comparing the contents of 
  12674.           one field in each line.  Fields are defined as separated by 
  12675.           whitespace, so the first run of consecutive non-whitespace characters 
  12676.           in a line constitutes field 1, the second such run constitutes field 
  12677.           2, etc. 
  12678.  
  12679.           Specify which field to sort by with a numeric argument: 1 to sort by 
  12680.           field 1, etc.  A negative argument means sort into descending order. 
  12681.           Thus, minus 2 means sort by field 2 in reverse-alphabetical order. 
  12682.           If several lines have identical contents in the field being sorted, 
  12683.           they keep same relative order that they had in the original buffer. 
  12684.  
  12685. M-x sort-numeric-fields 
  12686.           Like M-x sort-fields except the specified field is converted to a 
  12687.           number for each line, and the numbers are compared.  `10' comes 
  12688.           before `2' when considered as text, but after it when considered as a 
  12689.           number. 
  12690.  
  12691. M-x sort-columns 
  12692.           Like M-x sort-fields except that the text within each line used for 
  12693.           comparison comes from a fixed range of columns.  See below for an 
  12694.           explanation. 
  12695.  
  12696.  For example, if the buffer contains this: 
  12697.  
  12698. On systems where clash detection (locking of files being edited) is
  12699. implemented, Emacs also checks the first time you modify a buffer
  12700. whether the file has changed on disk since it was last visited or
  12701. saved.  If it has, you are asked to confirm that you want to change
  12702. the buffer.
  12703.  
  12704. then applying M-x sort-lines to the entire buffer produces this: 
  12705.  
  12706. On systems where clash detection (locking of files being edited) is
  12707. implemented, Emacs also checks the first time you modify a buffer
  12708. saved.  If it has, you are asked to confirm that you want to change
  12709. the buffer.
  12710. whether the file has changed on disk since it was last visited or
  12711.  
  12712. where the upper case `O' sorts before all lower case letters.  If you use C-u 2 
  12713. M-x sort-fields instead, you get this: 
  12714.  
  12715. implemented, Emacs also checks the first time you modify a buffer
  12716. saved.  If it has, you are asked to confirm that you want to change
  12717. the buffer.
  12718. On systems where clash detection (locking of files being edited) is
  12719. whether the file has changed on disk since it was last visited or
  12720.  
  12721. where the sort keys were `Emacs', `If', `buffer', `systems' and `the'. 
  12722.  
  12723.  M-x sort-columns requires more explanation.  You specify the columns by 
  12724. putting point at one of the columns and the mark at the other column.  Because 
  12725. this means you cannot put point or the mark at the beginning of the first line 
  12726. to sort, this command uses an unusual definition of `region': all of the line 
  12727. point is in is considered part of the region, and so is all of the line the 
  12728. mark is in. 
  12729.  
  12730.  For example, to sort a table by information found in columns 10 to 15, you 
  12731. could put the mark on column 10 in the first line of the table, and point on 
  12732. column 15 in the last line of the table, and then run sort-columns. 
  12733. Equivalently, you could run it with the mark on column 15 in the first line and 
  12734. point on column 10 in the last line. 
  12735.  
  12736.  This can be thought of as sorting the rectangle specified by point and the 
  12737. mark, except that the text on each line to the left or right of the rectangle 
  12738. moves along with the text inside the rectangle. See Rectangles. 
  12739.  
  12740.  
  12741. ΓòÉΓòÉΓòÉ 32.14. Running Shell Commands from Emacs ΓòÉΓòÉΓòÉ
  12742.  
  12743.  Emacs has commands for passing single command lines to inferior shell 
  12744. processes; it can also run a shell interactively with input and output to an 
  12745. Emacs buffer `*shell*'. 
  12746.  
  12747. M-! 
  12748.           Run a specified shell command line and display the output 
  12749.           (shell-command). 
  12750.  
  12751. M-| 
  12752.           Run a specified shell command line with region contents as input; 
  12753.           optionally replace the region with the output 
  12754.           (shell-command-on-region). 
  12755.  
  12756. M-x shell 
  12757.           Run a subshell with input and output through an Emacs buffer. You can 
  12758.           then give commands interactively. 
  12759.  
  12760.  
  12761. ΓòÉΓòÉΓòÉ 32.14.1. Single Shell Commands ΓòÉΓòÉΓòÉ
  12762.  
  12763.  M-! (shell-command) reads a line of text using the minibuffer executes it as a 
  12764. shell command in a subshell made just for this command.  Standard input for the 
  12765. command comes from the null device.  If the shell command produces any output, 
  12766. the output goes into an Emacs buffer named `*Shell Command Output*', which is 
  12767. displayed in another window but not selected.  A numeric argument, as in M-1 
  12768. M-!, directs this command to insert any output into the current buffer.  In 
  12769. that case, point is left before the output and the mark is set after the 
  12770. output. 
  12771.  
  12772.  If the shell command line ends in `&', it runs asynchronously. 
  12773.  
  12774.  M-| (shell-command-on-region) is like M-! but passes the contents of the 
  12775. region as input to the shell command, instead of no input.  If a numeric 
  12776. argument is used, meaning insert output in the current buffer, then the old 
  12777. region is deleted first and the output replaces it as the contents of the 
  12778. region. 
  12779.  
  12780.  Both M-! and M-| use shell-file-name to specify the shell to use.  This 
  12781. variable is initialized based on your SHELL environment variable when Emacs is 
  12782. started.  If the file name does not specify a directory, the directories in the 
  12783. list exec-path are searched; this list is initialized based on the environment 
  12784. variable PATH when Emacs is started.  Your `.emacs' file can override either or 
  12785. both of these default initializations. 
  12786.  
  12787.  With M-! and M-|, Emacs has to wait until the shell command completes.  To 
  12788. stop waiting, type C-g to quit; that also kills the shell command. 
  12789.  
  12790.  
  12791. ΓòÉΓòÉΓòÉ 32.14.2. Interactive Inferior Shell ΓòÉΓòÉΓòÉ
  12792.  
  12793.  To run a subshell interactively, putting its typescript in an Emacs buffer, 
  12794. use M-x shell.  This creates (or reuses) a buffer named `*shell*' and runs a 
  12795. subshell with input coming from and output going to that buffer.  That is to 
  12796. say, any ``terminal output'' from the subshell goes into the buffer, advancing 
  12797. point, and any ``terminal input'' for the subshell comes from text in the 
  12798. buffer.  To give input to the subshell, go to the end of the buffer and type 
  12799. the input, terminated by RET. 
  12800.  
  12801.  Emacs does not wait for the subshell to do anything.  You can switch windows 
  12802. or buffers and edit them while the shell is waiting, or while it is running a 
  12803. command.  Output from the subshell waits until Emacs has time to process it; 
  12804. this happens whenever Emacs is waiting for keyboard input or for time to 
  12805. elapse. 
  12806.  
  12807.  To make multiple subshells, rename the buffer `*shell*' to something different 
  12808. using M-x rename-uniquely.  Then type M-x shell again to create a new buffer 
  12809. `*shell*' with its own subshell.  If you rename this buffer as well, you can 
  12810. create a third one, and so on.  All the subshells run independently and in 
  12811. parallel. 
  12812.  
  12813.  The file name used to load the subshell is the value of the variable 
  12814. explicit-shell-file-name, if that is non-nil.  Otherwise, the environment 
  12815. variable ESHELL is used, or the environment variable SHELL if there is no 
  12816. ESHELL.  If the file name specified is relative, the directories in the list 
  12817. exec-path are searched (see Single Shell). 
  12818.  
  12819.  As soon as the subshell is started, it is sent as input the contents of the 
  12820. file `~/.emacs_shellname', if that file exists, where shellname is the name of 
  12821. the file that the shell was loaded from. For example, if you use bash, the file 
  12822. sent to it is `~/.emacs_bash'. 
  12823.  
  12824.  cd, pushd and popd commands given to the inferior shell are watched by Emacs 
  12825. so it can keep the `*shell*' buffer's default directory the same as the shell's 
  12826. working directory.  These commands are recognized syntactically by examining 
  12827. lines of input that are sent.  If you use aliases for these commands, you can 
  12828. tell Emacs to recognize them also.  For example, if the value of the variable 
  12829. shell-pushd-regexp matches the beginning of a shell command line, that line is 
  12830. regarded as a pushd command.  Change this variable when you add aliases for 
  12831. `pushd'.  Likewise, shell-popd-regexp and shell-cd-regexp are used to recognize 
  12832. commands with the meaning of `popd' and `cd'.  These commands are recognized 
  12833. only at the beginning of a shell command line. 
  12834.  
  12835.  If Emacs gets an error while trying to handle what it believes is a `cd', 
  12836. `pushd' or `popd' command, it runs the hook shell-set-directory-error-hook (see 
  12837. Hooks). 
  12838.  
  12839.  If Emacs does not properly track changes in the current directory of the 
  12840. subshell, use the command M-x dirs to ask the shell what its current directory 
  12841. is.  This command works for shells that support the most common command syntax; 
  12842. it may not work for unusual shells. 
  12843.  
  12844.  
  12845. ΓòÉΓòÉΓòÉ 32.14.3. Shell Mode ΓòÉΓòÉΓòÉ
  12846.  
  12847.  The shell buffer uses Shell mode, which defines several special keys attached 
  12848. to the C-c prefix.  They are chosen to resemble the usual editing and job 
  12849. control characters present in shells that are not under Emacs, except that you 
  12850. must type C-c first.  Here is a complete list of the special key bindings of 
  12851. Shell mode: 
  12852.  
  12853. RET 
  12854.           At end of buffer send line as input; otherwise, copy current line to 
  12855.           end of buffer and send it (comint-send-input).  When a line is 
  12856.           copied, any text at the beginning of the line that matches the 
  12857.           variable shell-prompt-pattern is left out; this variable's value 
  12858.           should be a regexp string that matches the prompts that your shell 
  12859.           uses. 
  12860.  
  12861. TAB 
  12862.           Complete the file name before point in the shell buffer 
  12863.           (comint-dynamic-complete). 
  12864.  
  12865. M-? 
  12866.           Display temporarily a list of the possible completions of the file 
  12867.           name before point in the shell buffer 
  12868.           (comint-dynamic-list-completions). 
  12869.  
  12870. C-a 
  12871.           Move to the beginning of the line, but after the prompt if any 
  12872.           (comint-bol). 
  12873.  
  12874. C-d 
  12875.           Either delete a character or send EOF (comint-delchar-or-maybe-eof). 
  12876.           Typed at the end of the shell buffer, C-d sends EOF to the subshell. 
  12877.           Typed at any other position in the buffer, C-d deletes a character as 
  12878.           usual. 
  12879.  
  12880. C-c C-u 
  12881.           Kill all text pending at end of buffer to be sent as input 
  12882.           (comint-kill-input). 
  12883.  
  12884. C-c C-w 
  12885.           Kill a word before point (backward-kill-word). 
  12886.  
  12887. C-c C-c 
  12888.           Interrupt the shell or its current subjob if any 
  12889.           (comint-interrupt-subjob). 
  12890.  
  12891. C-c C-z 
  12892.           Stop the shell or its current subjob if any (comint-stop-subjob). 
  12893.  
  12894. C-c C-\ 
  12895.           Send quit signal to the shell or its current subjob if any 
  12896.           (comint-quit-subjob). 
  12897.  
  12898. C-c C-o 
  12899.           Kill the last batch of output from a shell command 
  12900.           (comint-kill-output).  This is useful if a shell command spews out 
  12901.           lots of output that just gets in the way. 
  12902.  
  12903. C-c C-r 
  12904.           Scroll to display the beginning of the last batch of output at the 
  12905.           top of the window; also move the cursor there (comint-show-output). 
  12906.  
  12907. M-x dirs 
  12908.           Ask the shell what its current directory is, so that Emacs can agree 
  12909.           with the shell. 
  12910.  
  12911. M-x send-invisible RET text RET 
  12912.           Send text as input to the shell, after reading it without echoing. 
  12913.           This is useful when a shell command runs a program that asks for a 
  12914.           password. 
  12915.  
  12916. M-x comint-continue-subjob 
  12917.           Continue the shell process.  This is useful if you accidentally 
  12918.           suspend the shell process. (You should not suspend the shell process. 
  12919.           Suspending a subjob of the shell is a completely different 
  12920.           matter--that is normal practice, but you must use the shell to 
  12921.           continue the subjob; this command won't do it.) 
  12922.  
  12923.  
  12924. ΓòÉΓòÉΓòÉ 32.14.4. Shell Command History ΓòÉΓòÉΓòÉ
  12925.  
  12926.  Shell buffers support history commands much like the minibuffer history 
  12927. commands. 
  12928.  
  12929. M-p 
  12930.           Fetch the next earlier old shell command. 
  12931.  
  12932. M-n 
  12933.           Fetch the next later old shell command. 
  12934.  
  12935. M-r regexp RET 
  12936. M-s regexp RET 
  12937.           Search backwards or forwards for old shell commands that match 
  12938.           regexp. 
  12939.  
  12940.  Shell buffers provide a history of previously entered shell commands.  To 
  12941. reuse shell commands from the history, use the editing commands M-p, M-n, M-r 
  12942. and M-s.  These work just like the minibuffer history commands except that they 
  12943. operate on the text at the end of the shell buffer, the text that typing RET 
  12944. will send to the shell. 
  12945.  
  12946.  M-p fetches an earlier shell command to the end of the shell buffer. 
  12947. Successive use of M-p fetches successively earlier shell commands, each 
  12948. replacing any text that was already present as potential shell input. M-n does 
  12949. likewise except that it finds successively more recent shell commands from the 
  12950. buffer. 
  12951.  
  12952.  The history search commands M-r and M-s read a regular expression and search 
  12953. through the history for a matching command.  Aside from the choice of which 
  12954. command to fetch, they work just like M-p and M-r.  If you enter an empty 
  12955. regexp, these commands reuse the same regexp used last time. 
  12956.  
  12957.  When you find the previous input you want, you can resubmit it by typing RET, 
  12958. or you can edit it first and then resubmit it if you wish. 
  12959.  
  12960.  These commands get the text of previous shell commands from a special history 
  12961. list, not from the shell buffer itself.  Thus, editing the shell buffer, or 
  12962. even killing large parts of it, does not affect the history that these commands 
  12963. access. 
  12964.  
  12965.  
  12966. ΓòÉΓòÉΓòÉ 32.15. Narrowing ΓòÉΓòÉΓòÉ
  12967.  
  12968.  Narrowing means focusing in on some portion of the buffer, making the rest 
  12969. temporarily inaccessible.  The portion which you can still get to is called the 
  12970. accessible portion.  Cancelling the narrowing, and making the entire buffer 
  12971. once again accessible, is called widening.  The amount of narrowing in effect 
  12972. in a buffer at any time is called the buffer's restriction. 
  12973.  
  12974. C-x n n 
  12975.           Narrow down to between point and mark (narrow-to-region). 
  12976.  
  12977. C-x n w 
  12978.           Widen to make the entire buffer accessible again (widen). 
  12979.  
  12980. C-x n p 
  12981.           Narrow down to the current page (narrow-to-page). 
  12982.  
  12983.  When you have narrowed down to a part of the buffer, that part appears to be 
  12984. all there is.  You can't see the rest, you can't move into it (motion commands 
  12985. won't go outside the accessible part), you can't change it in any way. 
  12986. However, it is not gone, and if you save the file all the inaccessible text 
  12987. will be saved.  In addition to sometimes making it easier to concentrate on a 
  12988. single subroutine or paragraph by eliminating clutter, narrowing can be used to 
  12989. restrict the range of operation of a replace command or repeating keyboard 
  12990. macro.  The word `Narrow' appears in the mode line whenever narrowing is in 
  12991. effect. 
  12992.  
  12993.  The primary narrowing command is C-x n n (narrow-to-region). It sets the 
  12994. current buffer's restrictions so that the text in the current region remains 
  12995. accessible but all text before the region or after the region is invisible. 
  12996. Point and mark do not change. 
  12997.  
  12998.  Alternatively, use C-x n p (narrow-to-page) to narrow down to the current 
  12999. page.  See Pages, for the definition of a page. 
  13000.  
  13001.  The way to undo narrowing is to widen with C-x n w (widen). This makes all 
  13002. text in the buffer accessible again. 
  13003.  
  13004.  You can get information on what part of the buffer you are narrowed down to 
  13005. using the C-x = command.  See Position Info. 
  13006.  
  13007.  Because narrowing can easily confuse users who do not understand it, 
  13008. narrow-to-region is normally a disabled command.  Attempting to use this 
  13009. command asks for confirmation and gives you the option of enabling it; once you 
  13010. enable the command, confirmation will no longer be required for it.  See 
  13011. Disabling. 
  13012.  
  13013.  
  13014. ΓòÉΓòÉΓòÉ 32.16. Hardcopy Output ΓòÉΓòÉΓòÉ
  13015.  
  13016.  The Emacs commands for making hardcopy let you print either an entire buffer 
  13017. or just part of one, either with or without page headers. See also the hardcopy 
  13018. commands of Dired (see Misc File Ops) and the diary (see Diary Commands). 
  13019.  
  13020. M-x print-buffer 
  13021.           Print hardcopy of current buffer using Unix command `print' (`lpr 
  13022.           -p').  This makes page headings containing the file name and page 
  13023.           number. 
  13024.  
  13025. M-x lpr-buffer 
  13026.           Print hardcopy of current buffer using Unix command `lpr'. This makes 
  13027.           no page headings. 
  13028.  
  13029. M-x print-region 
  13030.           Like print-buffer but prints only the current region. 
  13031.  
  13032. M-x lpr-region 
  13033.           Like lpr-buffer but prints only the current region. 
  13034.  
  13035.  All the hardcopy commands pass extra switches to the lpr program based on the 
  13036. value of the variable lpr-switches.  Its value should be a list of strings, 
  13037. each string an option starting with `-'.  For example, to use a printer named 
  13038. `nearme', set lpr-switches like this: 
  13039.  
  13040. (setq lpr-switches '("-Pnearme"))
  13041.  
  13042.  
  13043. ΓòÉΓòÉΓòÉ 32.17. Two-Column Editing ΓòÉΓòÉΓòÉ
  13044.  
  13045.  Two-column mode lets you conveniently edit two side-by-side columns of text. 
  13046. It uses two side-by-side windows, each showing its own buffer. 
  13047.  
  13048.  There are three ways to enter two-column mode: 
  13049.  
  13050. C-x 6 2 
  13051.           Enter two-column mode with the current buffer on the left, and on the 
  13052.           right, a buffer whose name is based on the current buffer's name 
  13053.           (tc-two-columns).  If the right-hand buffer doesn't already exist, it 
  13054.           starts out empty; the current buffer's contents are not changed. 
  13055.  
  13056.           This command is appropriate when the current buffer contains just one 
  13057.           column and you want to add another column. 
  13058.  
  13059. C-x 6 s 
  13060.           Split the current buffer, which contains two-column text, into two 
  13061.           buffers, and display them side by side (tc-split).  The current 
  13062.           buffer becomes the left-hand buffer, but the text in the right-hand 
  13063.           column is moved into the right-hand buffer.  The current column 
  13064.           specifies the split point.  Splitting starts with the current line 
  13065.           and continues to the end of the buffer. 
  13066.  
  13067.           This command is appropriate when you have a buffer that already 
  13068.           contains two-column text, and you wish to separate the columns 
  13069.           temporarily. 
  13070.  
  13071. C-x 6 b buffer RET 
  13072.           Enter two-column mode using the current buffer as the left-hand 
  13073.           buffer, and using buffer buffer as the right-hand buffer 
  13074.           (tc-associate-buffer). 
  13075.  
  13076.  C-x 6 s looks for a column separator which is a string that appears on each 
  13077. line between the two columns.  You can specify the width of the separator with 
  13078. a numeric argument to C-x 6 s; that many characters, before point, constitute 
  13079. the separator string.  By default, the width is 1, so the column separator is 
  13080. the character before point. 
  13081.  
  13082.  When a line has the separator at the proper place, C-x 6 s puts the text after 
  13083. the separator into the right-hand buffer, and deletes the separator.  Lines 
  13084. that don't have the column separator at the proper place remain unsplit; they 
  13085. stay in the left-hand buffer, and the right-hand buffer gets an empty line to 
  13086. correspond.  (This is the way to write a line which ``spans both columns while 
  13087. in two-column mode: write it in the left-hand buffer, and put an empty line in 
  13088. the right-hand buffer.) 
  13089.  
  13090.  It's not a good idea to use ordinary scrolling commands during two-column 
  13091. editing, because that separates the two parts of each split line.  Instead, use 
  13092. these special scroll commands: 
  13093.  
  13094. C-x 6 SPC 
  13095.           Scroll both buffers up, in lockstep (tc-scroll-up). 
  13096.  
  13097. C-x 6 DEL 
  13098.           Scroll both buffers down, in lockstep (tc-scroll-down). 
  13099.  
  13100. C-x 6 C-l 
  13101.           Recenter both buffers, in lockstep (tc-recenter). 
  13102.  
  13103.  When you have edited both buffers as you wish, merge them with C-x 6 1 
  13104. (tc-merge).  This copies the text from the right-hand buffer as a second column 
  13105. in the other buffer.  To go back to two-column editing, use C-x 6 s. 
  13106.  
  13107.  Use C-x 6 d to disassociate the two buffers, leaving each as it stands 
  13108. (tc-dissociate).  If the other buffer, the one not current when you type C-x 6 
  13109. d, is empty, C-x 6 d kills it. 
  13110.  
  13111.  
  13112. ΓòÉΓòÉΓòÉ 32.18. Editing Binary Files ΓòÉΓòÉΓòÉ
  13113.  
  13114.  There is a special major mode for editing binary files: Hexl mode.  To use it, 
  13115. use M-x hexl-find-file instead of C-x C-f to visit the file.  This command 
  13116. converts the file's contents to hexadecimal and lets you edit the translation. 
  13117. When you save the file, it is converted automatically back to binary. 
  13118.  
  13119.  You can also use M-x hexl-mode to translate an existing buffer into hex.  This 
  13120. is useful if you visit a file normally and then discover it is a binary file. 
  13121.  
  13122.  Ordinary text characters overwrite in Hexl mode.  This is to reduce the risk 
  13123. of accidentally spoiling the alignment of data in the file. There are special 
  13124. commands for insertion.  Here is a list of the commands of Hexl mode: 
  13125.  
  13126. C-M-d 
  13127.           Insert a byte with a code typed in decimal. 
  13128.  
  13129. C-M-o 
  13130.           Insert a byte with a code typed in octal. 
  13131.  
  13132. C-M-x 
  13133.           Insert a byte with a code typed in hex. 
  13134.  
  13135. C-x [ 
  13136.           Move to the beginning of a 1k-byte ``page''. 
  13137.  
  13138. C-x ] 
  13139.           Move to the end of a 1k-byte ``page''. 
  13140.  
  13141. M-g 
  13142.           Move to an address specified in hex. 
  13143.  
  13144. M-j 
  13145.           Move to an address specified in decimal. 
  13146.  
  13147. C-c C-c 
  13148.           Leave Hexl mode, going back to the major mode this buffer had before 
  13149.           you invoked hexl-mode. 
  13150.  
  13151.  
  13152. ΓòÉΓòÉΓòÉ 32.19. Using Emacs as a Server ΓòÉΓòÉΓòÉ
  13153.  
  13154.  Various programs such as mail can invoke your choice of editor to edit a 
  13155. particular piece of text, such as a message that you are sending.  By 
  13156. convention, these programs use the environment variable EDITOR to specify which 
  13157. editor to run.  If you set EDITOR to `emacs', they invoke Emacs---but in an 
  13158. inconvenient fashion, by starting a new, separate Emacs process.  This is 
  13159. inconvenient because it takes time and because the new Emacs process doesn't 
  13160. share the buffers in the existing Emacs process. 
  13161.  
  13162.  You can arrange to use your existing Emacs process as the editor for programs 
  13163. like mail by using the Emacs client and Emacs server programs.  Here is how. 
  13164.  
  13165.  First, the preparation.  Within Emacs, call the function server-start.  (Your 
  13166. `.emacs' file can do this automatically if you add the expression 
  13167. (server-start) to it.)  Then, outside Emacs, set the EDITOR environment 
  13168. variable to `emacsclient'. 
  13169.  
  13170.  Then, whenever any program invokes your specified EDITOR program, the effect 
  13171. is to send a message to your principal Emacs telling it to visit a file. 
  13172. (That's what the program emacsclient does.) Emacs obeys silently; it does not 
  13173. immediately switch to the new file's buffer.  When you want to do that, type 
  13174. C-x # (server-edit). 
  13175.  
  13176.  When you've finished editing that buffer, type C-x # again. This saves the 
  13177. file and sends a message back to the emacsclient program telling it to exit. 
  13178. The programs that use EDITOR wait for the ``editor'' (actually, emacsclient) to 
  13179. exit.  C-x # also checks to see if any other files are pending for you to edit, 
  13180. and selects the next one. 
  13181.  
  13182.  You can switch to a server buffer manually if you wish; you don't have to 
  13183. arrive at it with C-x #.  But C-x # is the only way to say that you are 
  13184. ``finished'' with one. 
  13185.  
  13186.  While mail or another application is waiting for emacsclient to finish, 
  13187. emacsclient does not read terminal input.  So the terminal that mail was using 
  13188. is effectively blocked for the duration.  In order to edit with your principal 
  13189. Emacs, you need to be able to use it without using that terminal.  There are 
  13190. two ways to do this: 
  13191.  
  13192. o Using a window system, run mail and the principal Emacs in two separate 
  13193.   windows.  While mail is waiting for emacsclient, the window where it was 
  13194.   running is blocked, but you can use Emacs by switching windows. 
  13195.  
  13196. o Use Shell mode in Emacs to run the other program such as mail; then, 
  13197.   emacsclient blocks only the subshell under Emacs; you can still use Emacs to 
  13198.   edit the file. 
  13199.  
  13200.  
  13201. ΓòÉΓòÉΓòÉ 32.20. Recursive Editing Levels ΓòÉΓòÉΓòÉ
  13202.  
  13203.  A recursive edit is a situation in which you are using Emacs commands to 
  13204. perform arbitrary editing while in the middle of another Emacs command.  For 
  13205. example, when you type C-r inside of a query-replace, you enter a recursive 
  13206. edit in which you can change the current buffer.  On exiting from the recursive 
  13207. edit, you go back to the query-replace. 
  13208.  
  13209.  Exiting the recursive edit means returning to the unfinished command, which 
  13210. continues execution.  To exit, type C-M-c (exit-recursive-edit). 
  13211.  
  13212.  You can also abort the recursive edit.  This is like exiting, but also quits 
  13213. the unfinished command immediately.  Use the command C-] (abort-recursive-edit) 
  13214. for this.  See Quitting. 
  13215.  
  13216.  The mode line shows you when you are in a recursive edit by displaying square 
  13217. brackets around the parentheses that always surround the major and minor mode 
  13218. names.  Every window's mode line shows this, in the same way, since being in a 
  13219. recursive edit is true of Emacs as a whole rather than any particular window or 
  13220. buffer. 
  13221.  
  13222.  It is possible to be in recursive edits within recursive edits.  For example, 
  13223. after typing C-r in a query-replace, you may type a command that enters the 
  13224. debugger.  This begins a recursive editing level for the debugger, within the 
  13225. recursive editing level for C-r. Mode lines display a pair of square brackets 
  13226. for each recursive editing level currently in progress. 
  13227.  
  13228.  Exiting the inner recursive edit (such as, with the debugger c command) 
  13229. resumes the command running in the next level up.  When that command finishes, 
  13230. you can then use C-M-c to exit another recursive editing level, and so on. 
  13231. Exiting applies to the innermost level only. Aborting also gets out of only one 
  13232. level of recursive edit; it returns immediately to the command level of the 
  13233. previous recursive edit.  If you wish, you can then abort the next recursive 
  13234. editing level. 
  13235.  
  13236.  Alternatively, the command M-x top-level aborts all levels of recursive edits, 
  13237. returning immediately to the top level command reader. 
  13238.  
  13239.  The text being edited inside the recursive edit need not be the same text that 
  13240. you were editing at top level.  It depends on what the recursive edit is for. 
  13241. If the command that invokes the recursive edit selects a different buffer 
  13242. first, that is the buffer you will edit recursively.  In any case, you can 
  13243. switch buffers within the recursive edit in the normal manner (as long as the 
  13244. buffer-switching keys have not been rebound).  You could probably do all the 
  13245. rest of your editing inside the recursive edit, visiting files and all.  But 
  13246. this could have surprising effects (such as stack overflow) from time to time. 
  13247. So remember to exit or abort the recursive edit when you no longer need it. 
  13248.  
  13249.  In general, we try to minimize the use of recursive editing levels in GNU 
  13250. Emacs.  This is because they constrain you to ``go back'' in a particular 
  13251. order--from the innermost level toward the top level.  When possible, we 
  13252. present different activities in separate buffers.  Some commands switch to a 
  13253. new major mode but provide a way to switch back. These approaches give you more 
  13254. flexibility to go back to unfinished tasks in the order you choose. 
  13255.  
  13256.  
  13257. ΓòÉΓòÉΓòÉ 32.21. Dissociated Press ΓòÉΓòÉΓòÉ
  13258.  
  13259.  M-x dissociated-press is a command for scrambling a file of text either word 
  13260. by word or character by character.  Starting from a buffer of straight English, 
  13261. it produces extremely amusing output.  The input comes from the current Emacs 
  13262. buffer.  Dissociated Press writes its output in a buffer named 
  13263. `*Dissociation*', and redisplays that buffer after every couple of lines 
  13264. (approximately) to facilitate reading it. 
  13265.  
  13266.  Dissociated Press asks every so often whether to continue operating. Answer n 
  13267. to stop it.  You can also stop at any time by typing C-g.  The dissociation 
  13268. output remains in the `*Dissociation*' buffer for you to copy elsewhere if you 
  13269. wish. 
  13270.  
  13271.  Dissociated Press operates by jumping at random from one point in the buffer 
  13272. to another.  In order to produce plausible output rather than gibberish, it 
  13273. insists on a certain amount of overlap between the end of one run of 
  13274. consecutive words or characters and the start of the next. That is, if it has 
  13275. just printed out `president' and then decides to jump to a different point in 
  13276. the file, it might spot the `ent' in `pentagon' and continue from there, 
  13277. producing `presidentagon'. (This dissociword actually appeared during the 
  13278. Vietnam War, when it was very appropriate.)  Long sample texts produce the best 
  13279. results. 
  13280.  
  13281.  A positive argument to M-x dissociated-press tells it to operate character by 
  13282. character, and specifies the number of overlap characters.  A negative argument 
  13283. tells it to operate word by word and specifies the number of overlap words.  In 
  13284. this mode, whole words are treated as the elements to be permuted, rather than 
  13285. characters.  No argument is equivalent to an argument of two.  For your 
  13286. againformation, the output goes only into the buffer `*Dissociation*'.  The 
  13287. buffer you start with is not changed. 
  13288.  
  13289.  Dissociated Press produces nearly the same results as a Markov chain based on 
  13290. a frequency table constructed from the sample text.  It is, however, an 
  13291. independent, ignoriginal invention.  Dissociated Press techniquitously copies 
  13292. several consecutive characters from the sample between random choices, whereas 
  13293. a Markov chain would choose randomly for each word or character.  This makes 
  13294. for more plausible sounding results, and runs faster. 
  13295.  
  13296.  It is a mustatement that too much use of Dissociated Press can be a 
  13297. developediment to your real work.  Sometimes to the point of outragedy. And 
  13298. keep dissociwords out of your documentation, if you want it to be well 
  13299. userenced and properbose.  Have fun.  Your buggestions are welcome. 
  13300.  
  13301.  
  13302. ΓòÉΓòÉΓòÉ 32.22. Other Amusements ΓòÉΓòÉΓòÉ
  13303.  
  13304.  If you are a little bit bored, you can try M-x hanoi.  If you are considerably 
  13305. bored, give it a numeric argument.  If you are very very bored, try an argument 
  13306. of 9.  Sit back and watch. 
  13307.  
  13308.  If you want a little more personal involvement, try M-x gomoku, which plays 
  13309. the game Go Moku with you. 
  13310.  
  13311.  M-x blackbox and M-x mpuz are two kinds of puzzles. blackbox challenges you to 
  13312. determine the location of objects inside a box by tomography.  mpuz displays a 
  13313. multiplication puzzle with letters standing for digits in a code that you must 
  13314. guess---to guess a value, type a letter and then the digit you think it stands 
  13315. for. 
  13316.  
  13317.  When you are frustrated, try the famous Eliza program.  Just do M-x doctor. 
  13318. End each input by typing RET twice. 
  13319.  
  13320.  When you are feeling strange, type M-x yow. 
  13321.  
  13322.  
  13323. ΓòÉΓòÉΓòÉ 32.23. Emulation ΓòÉΓòÉΓòÉ
  13324.  
  13325.  GNU Emacs can be programmed to emulate (more or less) most other editors. 
  13326. Standard facilities can emulate these: 
  13327.  
  13328. EDT (DEC VMS editor) 
  13329.           Turn on EDT emulation with M-x edt-emulation-on.  M-x 
  13330.           edt-emulation-off restores normal Emacs command bindings. 
  13331.  
  13332.           Most of the EDT emulation commands are keypad keys, and most standard 
  13333.           Emacs key bindings are still available.  The EDT emulation rebindings 
  13334.           are done in the global keymap, so there is no problem switching 
  13335.           buffers or major modes while in EDT emulation. 
  13336.  
  13337. Gosling Emacs 
  13338.           To turn on emulation of Gosling Emacs (alias Unipress Emacs), type 
  13339.           the command M-x set-gosmacs-bindings.  This redefines many keys, 
  13340.           mostly on the C-x and ESC prefixes, to work as they do in Gosmacs. 
  13341.           M-x set-gnu-bindings returns to normal GNU Emacs by rebinding the 
  13342.           same keys to the definitions they had before you used M-x 
  13343.           set-gosmacs-bindings. 
  13344.  
  13345. vi (Berkeley Unix editor) 
  13346.           Turn on vi emulation with M-x vi-mode.  This is a major mode that 
  13347.           replaces the previously established major mode.  All of the vi 
  13348.           commands that, in real vi, enter ``input'' mode are programmed in the 
  13349.           Emacs emulator to return to the previous major mode.  Thus, ordinary 
  13350.           Emacs serves as vi's ``input'' mode. 
  13351.  
  13352.           Because vi emulation works through major modes, it does not work to 
  13353.           switch buffers during emulation.  Return to normal Emacs first. 
  13354.  
  13355.           If you plan to use vi emulation much, you probably want to bind a key 
  13356.           to the vi-mode command. 
  13357.  
  13358. vi (alternate emulator) 
  13359.           Another vi emulator said to resemble real vi more thoroughly is 
  13360.           invoked by M-x vip-mode.  ``Input'' mode in this emulator is changed 
  13361.           from ordinary Emacs so you can use ESC to go back to emulated vi 
  13362.           command mode.  To get from emulated vi command mode back to ordinary 
  13363.           Emacs, type C-z. 
  13364.  
  13365.           This emulation does not work through major modes, and it is possible 
  13366.           to switch buffers in various ways within the emulator.  It is not so 
  13367.           necessary to assign a key to the command vip-mode as it is with 
  13368.           vi-mode because terminating insert mode does not use it. 
  13369.  
  13370.           For full information, see the long comment at the beginning of the 
  13371.           source file, which is `lisp/vip.el' in the Emacs distribution. 
  13372.  
  13373. I am interested in hearing which vi emulator users prefer, as well as in 
  13374. receiving more complete user documentation for either or both emulators. 
  13375. Warning: loading both at once may cause name conflicts; no one has checked. 
  13376.  
  13377.  
  13378. ΓòÉΓòÉΓòÉ 33. Customization ΓòÉΓòÉΓòÉ
  13379.  
  13380.  This chapter talks about various topics relevant to adapting the behavior of 
  13381. Emacs in minor ways.  See The Emacs Lisp Reference Manual for how to make more 
  13382. far-reaching changes. 
  13383.  
  13384.  All kinds of customization affect only the particular Emacs job that you do 
  13385. them in.  They are completely lost when you kill the Emacs job, and have no 
  13386. effect on other Emacs jobs you may run at the same time or later.  The only way 
  13387. an Emacs job can affect anything outside of it is by writing a file; in 
  13388. particular, the only way to make a customization `permanent' is to put 
  13389. something in your `.emacs' file or other appropriate file to do the 
  13390. customization in each session.  See Init File. 
  13391.  
  13392.  
  13393. ΓòÉΓòÉΓòÉ 33.1. Minor Modes ΓòÉΓòÉΓòÉ
  13394.  
  13395.  Minor modes are optional features which you can turn on or off.  For example, 
  13396. Auto Fill mode is a minor mode in which SPC breaks lines between words as you 
  13397. type.  All the minor modes are independent of each other and of the selected 
  13398. major mode.  Most minor modes say in the mode line when they are on; for 
  13399. example, `Fill' in the mode line means that Auto Fill mode is on. 
  13400.  
  13401.  Append -mode to the name of a minor mode to get the name of a command function 
  13402. that turns the mode on or off.  Thus, the command to enable or disable Auto 
  13403. Fill mode is called M-x auto-fill-mode.  These commands are usually invoked 
  13404. with M-x, but you can bind keys to them if you wish.  With no argument, the 
  13405. function turns the mode on if it was off and off if it was on.  This is known 
  13406. as toggling.  A positive argument always turns the mode on, and an explicit 
  13407. zero argument or a negative argument always turns it off. 
  13408.  
  13409.  Enabling or disabling some minor modes applies only to the current buffer; 
  13410. each buffer is independent of the other buffers.  Therefore, you can enable the 
  13411. mode in particular buffers and disable it in others. 
  13412.  
  13413.  Auto Fill mode allows you to enter filled text without breaking lines 
  13414. explicitly.  Emacs inserts newlines as necessary to prevent lines from becoming 
  13415. too long.  See Filling. 
  13416.  
  13417.  Outline minor mode provides the same facilities as the major mode called 
  13418. Outline mode; but since it is a minor mode instead, you can combine it with any 
  13419. major mode.  See Outline Mode. 
  13420.  
  13421.  Overwrite mode causes ordinary printing characters to replace existing text 
  13422. instead of shoving it over.  For example, if the point is in front of the `B' 
  13423. in `FOOBAR', then in Overwrite mode typing a G changes it to `FOOGAR', instead 
  13424. of making it `FOOGBAR' as usual. 
  13425.  
  13426.  Auto Save mode causes the contents of a buffer to be saved periodically to 
  13427. reduce the amount you will lose in case of a system crash.  See Auto Save. 
  13428.  
  13429.  The following minor modes normally apply to all buffers at once. Since each is 
  13430. enabled or disabled by the value of a variable, you can set them differently 
  13431. for particular buffers, by explicitly making the corresponding variables local 
  13432. in those buffers. See Locals. 
  13433.  
  13434.  Abbrev mode allows you to define abbreviations that automatically expand as 
  13435. you type them.  For example, `amd' might expand to `abbrev mode'.  See Abbrevs, 
  13436. for full information. 
  13437.  
  13438.  Line Number mode enables continuous display in the mode line of the line 
  13439. number of point.  See Mode Line. 
  13440.  
  13441.  Scroll Bar mode gives each window a scroll bar (see Scroll Bars). Menu Bar 
  13442. mode gives each frame a menu bar (see Menu Bars).  Both of these modes are 
  13443. enabled by default when you use the X Window System. 
  13444.  
  13445.  In Transient Mark mode, every change in the buffer ``deactivates'' the mark, 
  13446. so that commands that operate on the region will get an error. This means you 
  13447. must either set the mark, or explicitly ``reactivate'' it, before each command 
  13448. that uses the region.  The advantage of Transient Mark mode is that Emacs can 
  13449. display the region highlighted (currently only when using X).  See Setting 
  13450. Mark. 
  13451.  
  13452.  
  13453. ΓòÉΓòÉΓòÉ 33.2. Variables ΓòÉΓòÉΓòÉ
  13454.  
  13455.  A variable is a Lisp symbol which has a value.  The symbol's name is also 
  13456. called the name of the variable.  A variable name can contain any characters 
  13457. that can appear in a file, but conventionally variable names consist of words 
  13458. separated by hyphens.  A variable can have a documentation string which 
  13459. describes what kind of value it should have and how the value will be used. 
  13460.  
  13461.  Lisp allows any variable to have any kind of value, but most variables that 
  13462. Emacs uses require a value of a certain type.  Often the value should always be 
  13463. a string, or should always be a number.  Sometimes we say that a certain 
  13464. feature is turned on if a variable is ``non-nil,'' meaning that if the 
  13465. variable's value is nil, the feature is off, but the feature is on for any 
  13466. other value.  The conventional value to use to turn on the feature---since you 
  13467. have to pick one particular value when you set the variable---is t. 
  13468.  
  13469.  Emacs uses many Lisp variables for internal recordkeeping, as any Lisp program 
  13470. must, but the most interesting variables for you are the ones that exist for 
  13471. the sake of customization.  Emacs does not (usually) change the values of these 
  13472. variables; instead, you set the values, and thereby alter and control the 
  13473. behavior of certain Emacs commands.  These variables are called options.  Most 
  13474. options are documented in this manual, and appear in the Variable Index (see 
  13475. Variable Index). 
  13476.  
  13477.  One example of a variable which is an option is fill-column, which specifies 
  13478. the position of the right margin (as a number of characters from the left 
  13479. margin) to be used by the fill commands (see Filling). 
  13480.  
  13481.  
  13482. ΓòÉΓòÉΓòÉ 33.2.1. Examining and Setting Variables ΓòÉΓòÉΓòÉ
  13483.  
  13484. C-h v var RET 
  13485.           Print the value and documentation of variable var 
  13486.           (describe-variable). 
  13487.  
  13488. M-x set-variable RET var RET value RET 
  13489.           Change the value of variable var to value. 
  13490.  
  13491.  To examine the value of a single variable, use C-h v (describe-variable), 
  13492. which reads a variable name using the minibuffer, with completion.  It prints 
  13493. both the value and the documentation of the variable.  For example, 
  13494.  
  13495. C-h v fill-column RET
  13496.  
  13497. prints something like this: 
  13498.  
  13499. fill-column's value is 75
  13500.  
  13501. Documentation:
  13502. *Column beyond which automatic line-wrapping should happen.
  13503. Automatically becomes buffer-local when set in any fashion.
  13504.  
  13505. The star at the beginning of the documentation indicates that this variable is 
  13506. an option.  C-h v is not restricted to options; it allows any variable name. 
  13507.  
  13508.  The most convenient way to set a specific option is with M-x set-variable. 
  13509. This reads the variable name with the minibuffer (with completion), and then 
  13510. reads a Lisp expression for the new value using the minibuffer a second time. 
  13511. For example, 
  13512.  
  13513. M-x set-variable RET fill-column RET 75 RET
  13514.  
  13515. sets fill-column to 75. 
  13516.  
  13517.  You can set any variable with a Lisp expression using the function setq. 
  13518. Here's how to use it to set fill-column: 
  13519.  
  13520. (setq fill-column 75)
  13521.  
  13522.  Setting variables, like all means of customizing Emacs except where explicitly 
  13523. stated, affects only the current Emacs session. 
  13524.  
  13525.  
  13526. ΓòÉΓòÉΓòÉ 33.2.2. Editing Variable Values ΓòÉΓòÉΓòÉ
  13527.  
  13528. These two functions make it easy to display all the user edit options and 
  13529. change some of them. 
  13530.  
  13531. M-x list-options 
  13532.           Display a buffer listing names, values and documentation of all 
  13533.           options. 
  13534.  
  13535. M-x edit-options 
  13536.           Change option values by editing a list of options. 
  13537.  
  13538.  M-x list-options displays a list of all Emacs option variables, in an Emacs 
  13539. buffer named `*List Options*'.  Each option is shown with its documentation and 
  13540. its current value.  Here is what a portion of it might look like: 
  13541.  
  13542. ;; exec-path:
  13543. ("." "/usr/local/bin" "/usr/ucb" "/bin" "/usr/bin" "/u2/emacs/etc")
  13544. *List of directories to search programs to run in subprocesses.
  13545. Each element is a string (directory name)
  13546. or nil (try the default directory).
  13547. ;;
  13548. ;; fill-column:
  13549. 75
  13550. *Column beyond which automatic line-wrapping should happen.
  13551. Automatically becomes buffer-local when set in any fashion.
  13552. ;;
  13553.  
  13554.  M-x edit-options goes one step further and immediately selects the `*List 
  13555. Options*' buffer; this buffer uses the major mode Options mode, which provides 
  13556. commands that allow you to point at an option and change its value: 
  13557.  
  13558.           Set the variable point is in or near to a new value read using the 
  13559.           minibuffer. 
  13560.  
  13561.           Toggle the variable point is in or near: if the value was nil, it 
  13562.           becomes t; otherwise it becomes nil. 
  13563.  
  13564.           Set the variable point is in or near to t. 
  13565.  
  13566.           Set the variable point is in or near to nil. 
  13567.  
  13568.           Move to the next or previous variable. 
  13569.  
  13570.  Any changes take effect immediately, and last until you exit from Emacs. 
  13571.  
  13572.  
  13573. ΓòÉΓòÉΓòÉ 33.2.3. Hooks ΓòÉΓòÉΓòÉ
  13574.  
  13575.  A hook is a variable where you can store a function or functions to be called 
  13576. on a particular occasion by an existing program.  Emacs provides a number of 
  13577. hooks for the sake of customization. 
  13578.  
  13579.  Most of the hooks in Emacs are normal hooks.  These variables contain lists of 
  13580. functions to be called with no arguments.  The reason most hooks are normal 
  13581. hooks is so that you can use them in a uniform way.  Every variable in Emacs 
  13582. whose name ends in `-hook' is a normal hook. 
  13583.  
  13584.  Most major modes run hooks as the last step of initialization.  This makes it 
  13585. easy for a user to customize the behavior of the mode, by overriding the local 
  13586. variable assignments already made by the mode.  But hooks may also be used in 
  13587. other contexts.  For example, the hook suspend-hook runs just before Emacs 
  13588. suspends itself (see Exiting). 
  13589.  
  13590.  The recommended way to add a hook function to a normal hook is by calling 
  13591. add-hook.  You can use any valid Lisp function as the hook function.  For 
  13592. example, here's how to set up a hook to turn on Auto Fill mode when entering 
  13593. Text mode and other modes based on Text mode: 
  13594.  
  13595. (add-hook 'text-mode-hook 'turn-on-auto-fill)
  13596.  
  13597.  The next example shows how to use a hook to customize the indentation of C 
  13598. code.  (People often have strong personal preferences for one format compared 
  13599. to another.)  Here the hook function is an anonymous lambda expression. 
  13600.  
  13601. (add-hook 'c-mode-hook
  13602.   (function (lambda ()
  13603.               (setq c-indent-level 4
  13604.                     c-argdecl-indent 0
  13605.                     c-label-offset -4
  13606.                     c-continued-statement-indent 0
  13607.                     c-brace-offset 0
  13608.                     comment-column 40))))
  13609.  
  13610. (setq c++-mode-hook c-mode-hook)
  13611.  
  13612.  It is best to design your hook functions so that the order in which they are 
  13613. executed does not matter.  Any dependence on the order is ``asking for 
  13614. trouble.''  However, the order is predictable: the most recently added hook 
  13615. functions are executed first. 
  13616.  
  13617.  
  13618. ΓòÉΓòÉΓòÉ 33.2.4. Local Variables ΓòÉΓòÉΓòÉ
  13619.  
  13620. M-x make-local-variable RET var RET 
  13621.           Make variable var have a local value in the current buffer. 
  13622.  
  13623. M-x kill-local-variable RET var RET 
  13624.           Make variable var use its global value in the current buffer. 
  13625.  
  13626. M-x make-variable-buffer-local RET var RET 
  13627.           Mark variable var so that setting it will make it local to the buffer 
  13628.           that is current at that time. 
  13629.  
  13630.  Any variable can be made local to a specific Emacs buffer.  This means that 
  13631. its value in that buffer is independent of its value in other buffers.  A few 
  13632. variables are always local in every buffer.  Every other Emacs variable has a 
  13633. global value which is in effect in all buffers that have not made the variable 
  13634. local. 
  13635.  
  13636.  M-x make-local-variable reads the name of a variable and makes it local to the 
  13637. current buffer.  Further changes in this buffer will not affect others, and 
  13638. further changes in the global value will not affect this buffer. 
  13639.  
  13640.  M-x make-variable-buffer-local reads the name of a variable and changes the 
  13641. future behavior of the variable so that it will become local automatically when 
  13642. it is set.  More precisely, once a variable has been marked in this way, the 
  13643. usual ways of setting the variable automatically do make-local-variable first. 
  13644. We call such variables per-buffer variables. 
  13645.  
  13646.  Major modes (see Major Modes) always make the variables they set local to the 
  13647. buffer.  This is why changing major modes in one buffer has no effect on other 
  13648. buffers.  Minor modes also work by setting variables---normally, each minor 
  13649. mode has one controlling variable which is non-nil when the mode is enabled 
  13650. (see Minor Modes). For most minor modes, the controlling variable is per 
  13651. buffer. 
  13652.  
  13653.  Emacs contains a number of variables that are always per-buffer. These include 
  13654. abbrev-mode, auto-fill-function, case-fold-search, comment-column, ctl-arrow, 
  13655. fill-column, fill-prefix, indent-tabs-mode, left-margin, mode-line-format, 
  13656. overwrite-mode, 
  13657. selective-display-ellipses, selective-display, tab-width, and truncate-lines. 
  13658. Some other variables are always local in every buffer, but they are used for 
  13659. internal purposes. 
  13660.  
  13661.  M-x kill-local-variable reads the name of a variable and makes it cease to be 
  13662. local to the current buffer.  The global value of the variable henceforth is in 
  13663. effect in this buffer.  Setting the major mode kills all the local variables of 
  13664. the buffer except for a few specially marked variables that are permanent 
  13665. locals. 
  13666.  
  13667.  To set the global value of a variable, regardless of whether the variable has 
  13668. a local value in the current buffer, you can use the Lisp function 
  13669. setq-default.  It works like setq. If there is a local value in the current 
  13670. buffer, the local value is not affected by setq-default; thus, the new global 
  13671. value may not be visible until you switch to another buffer.  For example, 
  13672.  
  13673. (setq-default fill-column 75)
  13674.  
  13675. setq-default is the only way to set the global value of a variable that has 
  13676. been marked with make-variable-buffer-local. 
  13677.  
  13678.  Lisp programs can look at a variable's default value with default-value.  This 
  13679. function takes a symbol as argument and returns its default value.  The 
  13680. argument is evaluated; usually you must quote it explicitly.  For example, 
  13681.  
  13682. (default-value 'fill-column)
  13683.  
  13684.  
  13685. ΓòÉΓòÉΓòÉ 33.2.5. Local Variables in Files ΓòÉΓòÉΓòÉ
  13686.  
  13687.  A file can specify local variable values for use when you edit the file with 
  13688. Emacs.  Visiting the file checks for local variables specifications; it 
  13689. automatically makes these variables local to the buffer, and sets them to the 
  13690. values specified in the file. 
  13691.  
  13692.  There are two ways to specify local variable values: in the first line, or 
  13693. with a local variables list.  Here's how to do this with the first line: 
  13694.  
  13695. -*- mode: modename; var: value; ... -*-
  13696.  
  13697. You can specify any number of variables/value pairs in this way, each pair with 
  13698. a colon and semicolon as shown above.  The major mode should come first, if it 
  13699. is mentioned at all.  Here is an example that specifies Lisp mode and sets two 
  13700. variables with numeric values: 
  13701.  
  13702. ;; -*-Mode: Lisp; fill-column: 75; comment-column: 50; -*-
  13703.  
  13704.  A local variables list goes near the end of the file, in the last page.  (It 
  13705. is often best to put it on a page by itself.)  The local variables list starts 
  13706. with a line containing the string `Local Variables:', and ends with a line 
  13707. containing the string `End:'.  In between come the variable names and values, 
  13708. one set per line, as `variable: value'.  The values are not evaluated; they are 
  13709. used literally. 
  13710.  
  13711. Here is an example of a local variables list: 
  13712.  
  13713. ;;; Local Variables: ***
  13714. ;;; mode:lisp ***
  13715. ;;; comment-column:0 ***
  13716. ;;; comment-start: ";;; "  ***
  13717. ;;; comment-end:"***" ***
  13718. ;;; End: ***
  13719.  
  13720.  As you see, each line starts with the prefix `;;; ' and each line ends with 
  13721. the suffix `***'.  Emacs recognizes these as the prefix and suffix based on the 
  13722. first line of the list, by finding them surrounding the magic string `Local 
  13723. Variables:'; so it automatically discards them from the other lines of the 
  13724. list. 
  13725.  
  13726.  The usual reason for using a prefix and/or suffix is to embed the local 
  13727. variables list in a comment, so it won't confuse other programs that the file 
  13728. is intended as input for.  The example above is for a language where comment 
  13729. lines start with `;;; ' and end with `***'; the local values for comment-start 
  13730. and comment-end customize the rest of Emacs for this unusual syntax. Don't use 
  13731. a prefix (or a suffix) if you don't need one. 
  13732.  
  13733.  Two ``variable names'' have special meanings in a local variables list: a 
  13734. value for the variable mode really sets the major mode, and a value for the 
  13735. variable eval is simply evaluated as an expression and the value is ignored. 
  13736. mode and eval are not real variables; setting such variables in any other 
  13737. context has no such effect.  If mode is used in a local variables list, it 
  13738. should be the first entry in the list. 
  13739.  
  13740.  The start of the local variables list must be no more than 3000 characters 
  13741. from the end of the file, and must be in the last page if the file is divided 
  13742. into pages.  Otherwise, Emacs will not notice it is there. The purpose of this 
  13743. is so that a stray `Local Variables:' not in the last page does not confuse 
  13744. Emacs, and so that visiting a long file that is all one page and has no local 
  13745. variables list need not take the time to search the whole file. 
  13746.  
  13747.  You may be tempted to try to turn on Auto Fill mode with a local variable 
  13748. list.  That is a mistake.  The choice of Auto Fill mode or not is a matter of 
  13749. individual taste, not a matter of the contents of particular files. If you want 
  13750. to use Auto Fill, set up major mode hooks with your `.emacs' file to turn it on 
  13751. (when appropriate) for you alone (see Init File). Don't try to use a local 
  13752. variable list that would impose your taste on everyone. 
  13753.  
  13754.  The variable enable-local-variables controls whether to process local 
  13755. variables lists, and thus gives you a chance to override them. Its default 
  13756. value is t, which means to process local variables lists.  If you set the value 
  13757. to nil, Emacs simply ignores local variables lists.  Any other value says to 
  13758. query you about each local variables list, showing you the local variables list 
  13759. to consider. 
  13760.  
  13761.  The eval ``variable'' creates special risks, so there is a separate variable 
  13762. enable-local-eval to control whether Emacs processes eval variables.  The three 
  13763. possibilities for the value are t, nil, and anything else, just as for 
  13764. enable-local-variables.  The default is maybe, which is neither t nor nil, so 
  13765. normally Emacs queries about eval variable settings. 
  13766.  
  13767.  Use the command normal-mode to reset the local variables and major mode of a 
  13768. buffer according to the file name and contents, including the local variables 
  13769. list if any.  See Choosing Modes. 
  13770.  
  13771.  
  13772. ΓòÉΓòÉΓòÉ 33.3. Keyboard Macros ΓòÉΓòÉΓòÉ
  13773.  
  13774.  A keyboard macro is a command defined by the user to abbreviate a sequence of 
  13775. keys.  For example, if you discover that you are about to type C-n C-d forty 
  13776. times, you can speed your work by defining a keyboard macro to do C-n C-d and 
  13777. calling it with a repeat count of forty. 
  13778.  
  13779. C-x ( 
  13780.           Start defining a keyboard macro (start-kbd-macro). 
  13781.  
  13782. C-x ) 
  13783.           End the definition of a keyboard macro (end-kbd-macro). 
  13784.  
  13785. C-x e 
  13786.           Execute the most recent keyboard macro (call-last-kbd-macro). 
  13787.  
  13788. C-u C-x ( 
  13789.           Re-execute last keyboard macro, then add more keys to its definition. 
  13790.  
  13791. C-x q 
  13792.           When this point is reached during macro execution, ask for 
  13793.           confirmation (kbd-macro-query). 
  13794.  
  13795. M-x name-last-kbd-macro 
  13796.           Give a command name (for the duration of the session) to the most 
  13797.           recently defined keyboard macro. 
  13798.  
  13799. M-x insert-kbd-macro 
  13800.           Insert in the buffer a keyboard macro's definition, as Lisp code. 
  13801.  
  13802.  Keyboard macros differ from ordinary Emacs commands in that they are written 
  13803. in the Emacs command language rather than in Lisp.  This makes it easier for 
  13804. the novice to write them, and makes them more convenient as temporary hacks. 
  13805. However, the Emacs command language is not powerful enough as a programming 
  13806. language to be useful for writing anything intelligent or general.  For such 
  13807. things, Lisp must be used. 
  13808.  
  13809.  You define a keyboard macro while executing the commands which are the 
  13810. definition.  Put differently, as you define a keyboard macro, the definition is 
  13811. being executed for the first time.  This way, you can see what the effects of 
  13812. your commands are, so that you don't have to figure them out in your head. 
  13813. When you are finished, the keyboard macro is defined and also has been, in 
  13814. effect, executed once.  You can then do the whole thing over again by invoking 
  13815. the macro. 
  13816.  
  13817.  
  13818. ΓòÉΓòÉΓòÉ 33.3.1. Basic Use ΓòÉΓòÉΓòÉ
  13819.  
  13820.  To start defining a keyboard macro, type the C-x ( command (start-kbd-macro). 
  13821. From then on, your keys continue to be executed, but also become part of the 
  13822. definition of the macro.  `Def' appears in the mode line to remind you of what 
  13823. is going on.  When you are finished, the C-x ) command (end-kbd-macro) 
  13824. terminates the definition (without becoming part of it!).  For example 
  13825.  
  13826. C-x ( M-f foo C-x )
  13827.  
  13828. defines a macro to move forward a word and then insert `foo'. 
  13829.  
  13830.  The macro thus defined can be invoked again with the C-x e command 
  13831. (call-last-kbd-macro), which may be given a repeat count as a numeric argument 
  13832. to execute the macro many times.  C-x ) can also be given a repeat count as an 
  13833. argument, in which case it repeats the macro that many times right after 
  13834. defining it, but defining the macro counts as the first repetition (since it is 
  13835. executed as you define it).  So, giving C-x ) an argument of 4 executes the 
  13836. macro immediately 3 additional times.  An argument of zero to C-x e or C-x ) 
  13837. means repeat the macro indefinitely (until it gets an error or you type C-g). 
  13838.  
  13839.  If you wish to repeat an operation at regularly spaced places in the text, 
  13840. define a macro and include as part of the macro the commands to move to the 
  13841. next place you want to use it.  For example, if you want to change each line, 
  13842. you should position point at the start of a line, and define a macro to change 
  13843. that line and leave point at the start of the next line. Then repeating the 
  13844. macro will operate on successive lines. 
  13845.  
  13846.  After you have terminated the definition of a keyboard macro, you can add to 
  13847. the end of its definition by typing C-u C-x (.  This is equivalent to plain C-x 
  13848. ( followed by retyping the whole definition so far.  As a consequence it 
  13849. re-executes the macro as previously defined. 
  13850.  
  13851.  You can use function keys in a keyboard macro, just like keyboard keys.  You 
  13852. can even use mouse events, but be careful about that: when the macro replays 
  13853. the mouse event, it uses the original mouse position of that event, the 
  13854. position that the mouse had while you were defining the macro.  The effect of 
  13855. this may be hard to predict.  (Using the current mouse position would be even 
  13856. less predictable.) 
  13857.  
  13858.  One thing that doesn't always work well in a keyboard macro is the command 
  13859. C-M-c (exit-recursive-edit).  When this command exits a recursive edit that 
  13860. started within the macro, it works as you'd expect.  But if it exits a 
  13861. recursive edit that started before you invoked the keyboard macro, it also 
  13862. necessarily exits the keyboard macro as part of the process. 
  13863.  
  13864.  
  13865. ΓòÉΓòÉΓòÉ 33.3.2. Naming and Saving Keyboard Macros ΓòÉΓòÉΓòÉ
  13866.  
  13867.  If you wish to save a keyboard macro for longer than until you define the next 
  13868. one, you must give it a name using M-x name-last-kbd-macro. This reads a name 
  13869. as an argument using the minibuffer and defines that name to execute the macro. 
  13870. The macro name is a Lisp symbol, and defining it in this way makes it a valid 
  13871. command name for calling with M-x or for binding a key to with global-set-key 
  13872. (see Keymaps).  If you specify a name that has a prior definition other than 
  13873. another keyboard macro, an error message is printed and nothing is changed. 
  13874.  
  13875.  Once a macro has a command name, you can save its definition in a file. Then 
  13876. it can be used in another editing session.  First, visit the file you want to 
  13877. save the definition in.  Then use this command: 
  13878.  
  13879. M-x insert-kbd-macro RET macroname RET
  13880.  
  13881. This inserts some Lisp code that, when executed later, will define the same 
  13882. macro with the same definition it has now.  (You need not understand Lisp code 
  13883. to do this, because insert-kbd-macro writes the Lisp code for you.)  Then save 
  13884. the file.  You can load the file later with load-file (see Lisp Libraries).  If 
  13885. the file you save in is your init file `~/.emacs' (see Init File) then the 
  13886. macro will be defined each time you run Emacs. 
  13887.  
  13888.  If you give insert-kbd-macro a prefix argument, it makes additional Lisp code 
  13889. to record the keys (if any) that you have bound to the keyboard macro, so that 
  13890. the macro will be reassigned the same keys when you load the file. 
  13891.  
  13892.  
  13893. ΓòÉΓòÉΓòÉ 33.3.3. Executing Macros with Variations ΓòÉΓòÉΓòÉ
  13894.  
  13895.  Using C-x q (kbd-macro-query), you can get an effect similar to that of 
  13896. query-replace, where the macro asks you each time around whether to make a 
  13897. change.  When you are defining the macro, type C-x q at the point where you 
  13898. want the query to occur.  During macro definition, the C-x q does nothing, but 
  13899. when you run the macro later, C-x q asks you interactively whether to continue. 
  13900.  
  13901.  The valid responses when C-x q asks are SPC (or y), DEL (or n), ESC (or q), 
  13902. C-l and C-r.  The answers are the same as in query replace, though not all of 
  13903. the query-replace options are meaningful. 
  13904.  
  13905.  Specifically, SPC means to continue.  DEL means to skip the remainder of this 
  13906. repetition of the macro and start right away with the next repetition.  ESC 
  13907. means to skip the remainder of this repetition and cancel further repetition. 
  13908. C-l redraws the screen and asks you again for a character to say what to do. 
  13909.  
  13910.  C-r enters a recursive editing level, in which you can perform editing which 
  13911. is not part of the macro.  When you exit the recursive edit using C-M-c, you 
  13912. are asked again how to continue with the keyboard macro.  If you type a SPC at 
  13913. this time, the rest of the macro definition is executed.  It is up to you to 
  13914. leave point and the text in a state such that the rest of the macro will do 
  13915. what you want. 
  13916.  
  13917.  C-u C-x q, which is C-x q with a numeric argument, performs a different 
  13918. function.  It enters a recursive edit reading input from the keyboard, both 
  13919. when you type it during the definition of the macro, and when it is executed 
  13920. from the macro.  During definition, the editing you do inside the recursive 
  13921. edit does not become part of the macro.  During macro execution, the recursive 
  13922. edit gives you a chance to do some particularized editing.  See Recursive Edit. 
  13923.  
  13924.  
  13925. ΓòÉΓòÉΓòÉ 33.4. Customizing Key Bindings ΓòÉΓòÉΓòÉ
  13926.  
  13927.  This section describes key bindings which map keys to commands, and the 
  13928. keymaps which record key bindings.  It also explains how to customize key 
  13929. bindings. 
  13930.  
  13931.  Recall that a command is a Lisp function whose definition provides for 
  13932. interactive use.  Like every Lisp function, a command has a function name which 
  13933. usually consists of lower case letters and hyphens. 
  13934.  
  13935.  
  13936. ΓòÉΓòÉΓòÉ 33.4.1. Keymaps ΓòÉΓòÉΓòÉ
  13937.  
  13938.  The bindings between key sequences and command functions are recorded in data 
  13939. structures called keymaps.  Emacs has many of these, each used on particular 
  13940. occasions. 
  13941.  
  13942.  Recall that a key sequence (key, for short) is a sequence of input events that 
  13943. have a meaning as a unit.  Input events include characters, function keys and 
  13944. mouse buttons---all the inputs that you can send to the computer with your 
  13945. terminal.  A key sequence gets its meaning from its binding, which says what 
  13946. command it runs.  The function of keymaps is to record these bindings. 
  13947.  
  13948.  The global keymap is the most important keymap because it is always in effect. 
  13949. The global keymap defines keys for Fundamental mode; most of these definitions 
  13950. are common to all (or most) major modes.  Each major or minor mode can have its 
  13951. own keymap which overrides the definitions of some keys. 
  13952.  
  13953.  For example, a self-inserting character such as g is self-inserting because 
  13954. the global keymap binds it to the command self-insert-command.  The standard 
  13955. Emacs editing characters such as C-a also get their standard meanings from the 
  13956. global keymap. Commands to rebind keys, such as M-x global-set-key, actually 
  13957. work by storing the new binding in the proper place in the global map. See 
  13958. Rebinding. 
  13959.  
  13960.   Meta characters work differently; Emacs translates each Meta character into a 
  13961. pair of characters starting with ESC.  When you type the character M-a in a key 
  13962. sequence, Emacs replaces it with ESC a.  A meta key comes in as a single input 
  13963. event, but becomes two events for purposes of key bindings.  The reason for 
  13964. this is historical, and we might change in someday. 
  13965.  
  13966.  Most modern keyboards have function keys as well as character keys. Function 
  13967. keys send input events just as character keys do, and keymaps can have bindings 
  13968. for them. 
  13969.  
  13970.  On many terminals, typing a function key actually sends the computer a 
  13971. sequence of characters; the precise details of the sequence depends on which 
  13972. function key and on the model of terminal you are using.  (Often he sequence 
  13973. starts with ESC [.)  If Emacs understands your terminal type properly, it 
  13974. recognizes the character sequences forming function keys wherever they occur in 
  13975. a key sequence (not just at the beginning).  Thus, for most purposes, you can 
  13976. pretend the function keys reach Emacs directly and ignore their encoding as 
  13977. character sequences. 
  13978.  
  13979.  Mouse buttons also produce input events.  These events come with other 
  13980. data---the window and position where you pressed or released the button, and a 
  13981. timestamp.  But only the choice of button matters for key bindings; the other 
  13982. data matters only if a command looks at it. (Commands designed for mouse 
  13983. invocation usually do look at the other data.) 
  13984.  
  13985.  A keymap records definitions for single events.  Interpreting a key sequence 
  13986. of multiple events involves a chain of keymaps.  The first keymap gives a 
  13987. definition for the first event; this definition is another keymap, which is 
  13988. used to look up the second event in the sequence, and so on. 
  13989.  
  13990.  Key sequences can mix function keys and characters.  For example, C-x SELECT 
  13991. makes sense.  If you make SELECT a prefix key, then SELECT C-n makes sense. 
  13992. You can even mix mouse events with keyboard events, but we recommend against 
  13993. it, because such sequences are inconvenient to type in. 
  13994.  
  13995.  
  13996. ΓòÉΓòÉΓòÉ 33.4.2. Prefix Keymaps ΓòÉΓòÉΓòÉ
  13997.  
  13998.  A prefix key such as C-x or ESC has its own keymap, which holds the definition 
  13999. for the event that immediately follows that prefix. 
  14000.  
  14001.  The definition of a prefix key is the keymap to use for looking up the 
  14002. following event.  The definition can also be a Lisp symbol whose function 
  14003. definition is the following keymap; the effect is the same, but it provides a 
  14004. command name for the prefix key that can be used as a description of what the 
  14005. prefix key is for.  Thus, the binding of C-x is the symbol Ctl-X-Prefix, whose 
  14006. function definition is the keymap for C-x commands.  The definitions of C-c, 
  14007. C-x, C-h and ESC as prefix keys appear in the global map, so these prefix keys 
  14008. are always available. 
  14009.  
  14010.  Some prefix keymaps are stored in variables with names: 
  14011.  
  14012. o ctl-x-map is the variable name for the map used for characters that follow 
  14013.   C-x. 
  14014.  
  14015. o help-map is for characters that follow C-h. 
  14016.  
  14017. o esc-map is for characters that follow ESC.  Thus, all Meta characters are 
  14018.   actually defined by this map. 
  14019.  
  14020. o ctl-x-4-map is for characters that follow C-x 4. 
  14021.  
  14022. o mode-specific-map is for characters that follow C-c. 
  14023.  
  14024.  
  14025. ΓòÉΓòÉΓòÉ 33.4.3. Local Keymaps ΓòÉΓòÉΓòÉ
  14026.  
  14027.  So far we have explained the ins and outs of the global map.  Major modes 
  14028. customize Emacs by providing their own key bindings in local keymaps.  For 
  14029. example, C mode overrides TAB to make it indent the current line for C code. 
  14030. Portions of text in the buffer can specify their own keymaps to substitute for 
  14031. the keymap of the buffer's major mode. 
  14032.  
  14033.  Minor modes can also have local keymaps.  Whenever a minor mode is in effect, 
  14034. the definitions in its keymap override both the major mode's local keymap and 
  14035. the global keymap. 
  14036.  
  14037.  The local keymaps for Lisp mode, C mode, and several other major modes always 
  14038. exist even when not in use.  These are kept in variables named lisp-mode-map, 
  14039. c-mode-map, and so on.  For major modes less often used, the local keymap is 
  14040. normally constructed only when the mode is used for the first time in a 
  14041. session.  This is to save space. 
  14042.  
  14043.  All minor mode keymaps are created in advance.  There is no way to defer their 
  14044. creation until the minor mode is enabled. 
  14045.  
  14046.  A local keymap can locally redefine a key as a prefix key by defining it as a 
  14047. prefix keymap.  If the key is also defined globally as a prefix, then its local 
  14048. and global definitions (both keymaps) effectively combine: both of them are 
  14049. used to look up the event that follows the prefix key.  Thus, if the mode's 
  14050. local keymap defines C-c as another keymap, and that keymap defines C-z as a 
  14051. command, this provides a local meaning for C-c C-z.  This does not affect other 
  14052. sequences that start with C-c; If those sequences don't have their own local 
  14053. bindings, their global bindings remain in effect. 
  14054.  
  14055.  Another way to think of this is that Emacs handles a multi-event key sequence 
  14056. by looking in several keymaps, one by one, for a binding of the whole key 
  14057. sequence.  First it checks the minor mode keymaps for minor modes that are 
  14058. enabled, then it checks the major mode's keymap, and then it checks the global 
  14059. keymap.  This is not precisely how key lookup works, but it's good enough for 
  14060. understanding ordinary circumstances. 
  14061.  
  14062.  
  14063. ΓòÉΓòÉΓòÉ 33.4.4. Minibuffer Keymaps ΓòÉΓòÉΓòÉ
  14064.  
  14065.  The minibuffer has its own set of local keymaps; they contain various 
  14066. completion and exit commands. 
  14067.  
  14068. o minibuffer-local-map is used for ordinary input (no completion). 
  14069.  
  14070. o minibuffer-local-ns-map is similar, except that SPC exits just like RET. 
  14071.   This is used mainly for Mocklisp compatibility. 
  14072.  
  14073. o minibuffer-local-completion-map is for permissive completion. 
  14074.  
  14075. o minibuffer-local-must-match-map is for strict completion and for cautious 
  14076.   completion. 
  14077.  
  14078.  
  14079. ΓòÉΓòÉΓòÉ 33.4.5. Changing Key Bindings Interactively ΓòÉΓòÉΓòÉ
  14080.  
  14081.  The way to redefine an Emacs key is to change its entry in a keymap. You can 
  14082. change the global keymap, in which case the change is effective in all major 
  14083. modes (except those that have their own overriding local definitions for the 
  14084. same key).  Or you can change the current buffer's local map, which affects all 
  14085. buffers using the same major mode. 
  14086.  
  14087. M-x global-set-key RET key cmd RET 
  14088.           Define key globally to run cmd. 
  14089.  
  14090. M-x local-set-key RET key cmd RET 
  14091.           Define key locally (in the major mode now in effect) to run cmd. 
  14092.  
  14093. M-x global-unset-key RET key 
  14094.           Make key undefined in the global map. 
  14095.  
  14096. M-x local-unset-key RET key 
  14097.           Make key undefined locally (in the major mode now in effect). 
  14098.  
  14099.  For example, suppose you like to execute commands in a subshell within an 
  14100. Emacs buffer, instead of suspending Emacs and executing commands in your login 
  14101. shell.  Normally, C-z is bound to the function suspend-emacs, but you can 
  14102. change C-z to invoke an interactive subshell within Emacs, by binding it to 
  14103. shell as follows: 
  14104.  
  14105. M-x global-set-key RET C-z shell RET
  14106.  
  14107. global-set-key reads the command name after the key.  After you press the key, 
  14108. a message like this appears so that you can confirm that you are binding the 
  14109. key you want: 
  14110.  
  14111. Set key C-z to command:
  14112.  
  14113.  You can redefine function keys and mouse events in the same way; just type the 
  14114. function key or click the mouse when it's time to specify the key to rebind. 
  14115.  
  14116.  You can rebind a key that contains more than one event in the same way.  Emacs 
  14117. keeps reading the key to rebind until it is a complete key (that is, not a 
  14118. prefix key).  Thus, if you type C-f for key, that's the end; the minibuffer is 
  14119. entered immediately to read cmd.  But if you type C-x, another character is 
  14120. read; if that is 4, another character is read, and so on.  For example, 
  14121.  
  14122. M-x global-set-key RET C-x 4 $ spell-other-window RET
  14123.  
  14124. would redefine C-x 4 $ to run the (fictitious) command spell-other-window. 
  14125.  
  14126.  You can remove the global definition of a key with global-unset-key.  This 
  14127. makes the key undefined; if you type it, Emacs will just beep.  Similarly, 
  14128. local-unset-key makes a key undefined in the current major mode keymap, which 
  14129. makes the global definition (or lack of one) come back into effect in that 
  14130. major mode. 
  14131.  
  14132.  If you have redefined (or undefined) a key and you subsequently wish to 
  14133. retract the change, undefining the key will not do the job---you need to 
  14134. redefine the key with its standard definition.  To find the name of the 
  14135. standard definition of a key, go to a Fundamental mode buffer and use C-h c. 
  14136. The documentation of keys in this manual also lists their command names. 
  14137.  
  14138.  If you want to prevent yourself from invoking a command by mistake, it is 
  14139. better to disable the command than to undefine the key.  A disabled command is 
  14140. less work to invoke when you really want to. See Disabling. 
  14141.  
  14142.  
  14143. ΓòÉΓòÉΓòÉ 33.4.6. Rebinding Keys in Your Init File ΓòÉΓòÉΓòÉ
  14144.  
  14145.  If you have a set of default definitions that you like to use all the time, 
  14146. you can put commands in your `.emacs' file by using their Lisp syntax. Thus, 
  14147. the first global-set-key command in this section could be put in an `.emacs' 
  14148. file in either of the two following formats: 
  14149.  
  14150. (global-set-key "\C-z" 'shell)
  14151.  
  14152. or as: 
  14153.  
  14154. (global-set-key [?\C-z] 'shell)
  14155.  
  14156. When the key sequence consists of characters, like this one, you can write it 
  14157. as a string or as a vector.  The first format specifies the key sequence as a 
  14158. string, "\C-z".  The second format uses a vector to specify the key sequence. 
  14159. The square brackets (`[...]') delimit the contents of the vector.  The vector 
  14160. in this example contains just one element, which is the integer code 
  14161. corresponding to C-z. The question mark is the Lisp syntax for a character 
  14162. constant; the character must follow with no intervening spaces. 
  14163.  
  14164.  The single-quote before shell marks it as a constant symbol rather than a 
  14165. variable.  If you omit the quote, Emacs tries to evaluate shell immediately as 
  14166. a variable.  This probably causes an error; it certainly isn't what you want. 
  14167.  
  14168.  Here is another example that binds a key sequence two characters long: 
  14169.  
  14170. (global-set-key "\C-xl" 'make-symbolic-link)
  14171.  
  14172. or: 
  14173.  
  14174. (global-set-key [?\C-x ?l] 'make-symbolic-link)
  14175.  
  14176.  
  14177. ΓòÉΓòÉΓòÉ 33.4.7. Rebinding Function Keys ΓòÉΓòÉΓòÉ
  14178.  
  14179.  Key sequences can contain function keys as well as ordinary characters. Just 
  14180. as Lisp characters (actually integers) represent keyboard characters, Lisp 
  14181. symbols represent function keys.  If the function key has a word as its label, 
  14182. then that word is also the name of the corresponding Lisp symbol.  Here are the 
  14183. Lisp names for other function keys: 
  14184.  
  14185. left, up, right, down 
  14186.           Cursor arrow keys. 
  14187.  
  14188. begin, end, home, next, prior 
  14189.           Other cursor repositioning keys. 
  14190.  
  14191. select, print, execute, backtab 
  14192. insert, undo, redo, clearline 
  14193. insertline, deleteline, insertchar, deletechar, 
  14194.           Miscellaneous function keys. 
  14195.  
  14196. f1 ... f35 
  14197.           Numbered function keys (across the top of the keyboard). 
  14198.  
  14199. kp-add, kp-subtract, kp-multiply, kp-divide 
  14200. kp-backtab, kp-space, kp-tab, kp-enter 
  14201. kp-separator, kp-decimal, kp-equal 
  14202.           Keypad keys (to the right of the regular keyboard), with names or 
  14203.           punctuation. 
  14204.  
  14205. kp-0, kp-1, ... kp-9 
  14206.           Keypad keys with digits. 
  14207.  
  14208. kp-f1, kp-f2, kp-f3, kp-f4 
  14209.           Keypad PF keys. 
  14210.  
  14211. A key sequence which contains non-characters must be a vector rather than a 
  14212. string.  To write a vector, write square brackets containing the vector 
  14213. elements.  Write spaces to separate the elements.  If an element is a symbol, 
  14214. simply write the symbol's name---no delimiters or punctuation are needed.  If 
  14215. an element is a character, write a Lisp character constant, which is `?' 
  14216. followed by the character as it would appear in a string. 
  14217.  
  14218. Thus, to bind function key `f1' to the command rmail, write the following: 
  14219.  
  14220. (global-set-key [f1] 'rmail)
  14221.  
  14222. To bind the right-arrow key to the command forward-char, you can use this 
  14223. expression: 
  14224.  
  14225. (global-set-key [right] 'forward-char)
  14226.  
  14227. using the Lisp syntax for a vector containing the symbol right. (This binding 
  14228. is present in Emacs by default.) 
  14229.  
  14230.  You can mix function keys and characters in a key sequence.  This example 
  14231. binds C-x RIGHT to the command forward-page. 
  14232.  
  14233. (global-set-key [?\C-x right] 'forward-page)
  14234.  
  14235. where ?\C-x is the Lisp character constant for the character C-x.  The vector 
  14236. element right is a symbol and therefore does not take a question mark. 
  14237.  
  14238.  You can use the modifier keys CTRL, META, HYPER, SUPER, ALT and SHIFT with 
  14239. function keys.  To represent these modifiers, prepend the strings `C-', `M-', 
  14240. `H-', `s-', `A-' and `S-' to the symbol name.  Thus, here is how to make 
  14241. Hyper-Meta-RIGHT move forward a word: 
  14242.  
  14243. (global-set-key [H-M-right] 'forward-word)
  14244.  
  14245.  
  14246. ΓòÉΓòÉΓòÉ 33.4.8. Rebinding Mouse Buttons ΓòÉΓòÉΓòÉ
  14247.  
  14248.  Emacs uses Lisp symbols to designate mouse buttons, too.  The ordinary mouse 
  14249. events in Emacs are click events; these happen when you press a button and 
  14250. release it without moving the mouse.  You can also get drag events, when you 
  14251. move the mouse while holding the button down.  Drag events happen when you 
  14252. finally let go of the button. 
  14253.  
  14254.  The symbols for basic click events are mouse-1 for the leftmost button, 
  14255. mouse-2 for the next, and so on.  Here is how you can redefine the second mouse 
  14256. button to split the current window: 
  14257.  
  14258. (global-set-key [mouse-2] 'split-window-vertically)
  14259.  
  14260.  The symbols for drag events are similar, but have the prefix `drag-' before 
  14261. the word `mouse'.  For example, dragging the left button generates a 
  14262. drag-mouse-1 event. 
  14263.  
  14264.  You can also request events when the mouse button is pressed down. These 
  14265. events start with `down-' instead of `drag-'.  Such events are generated only 
  14266. if they have key bindings.  When you get a button-down event, a corresponding 
  14267. click or drag event will always follow. 
  14268.  
  14269.  The symbols for mouse events also indicate the status of the modifier keys, 
  14270. with the usual prefixes `C-', `M-', `H-', `s-', `A-' and `S-'.  These always 
  14271. follow `drag-' or `down-'. 
  14272.  
  14273.  A frame includes areas that don't show text from the buffer, such as the mode 
  14274. line and the scroll bar.  You can tell whether a mouse button comes from a 
  14275. special area of the screen by means of dummy ``prefix keys.''  For example, if 
  14276. you click the mouse in the mode line, you get the prefix key mode-line before 
  14277. the ordinary mouse-button symbol.  Thus, here is how to define the command for 
  14278. clicking the left button in a mode line to run scroll-up: 
  14279.  
  14280. (global-set-key [mode-line mouse-1] 'scroll-up)
  14281.  
  14282.  Here is the complete list of these dummy prefix keys and their meanings: 
  14283.  
  14284. mode-line 
  14285.           The mouse was in the mode line of a window. 
  14286.  
  14287. vertical-line 
  14288.           The mouse was in the vertical line separating side-by-side windows. 
  14289.  
  14290. vertical-scroll-bar 
  14291.           The mouse was in a horizontal scroll bar.  This is the kind of scroll 
  14292.           bar people normally use. 
  14293.  
  14294. horizontal-scroll-bar 
  14295.           The mouse was in a horizontal scroll bar.  Horizontal scroll bars do 
  14296.           horizontal scrolling, and people don't use them often. 
  14297.  
  14298.  You can put more than one mouse button in a key sequence, but it isn't usual 
  14299. to do so. 
  14300.  
  14301.  
  14302. ΓòÉΓòÉΓòÉ 33.4.9. Disabling Commands ΓòÉΓòÉΓòÉ
  14303.  
  14304.  Disabling a command marks the command as requiring confirmation before it can 
  14305. be executed.  The purpose of disabling a command is to prevent beginning users 
  14306. from executing it by accident and being confused. 
  14307.  
  14308.  Attempting to invoke a disabled command interactively in Emacs causes the 
  14309. display of a window containing the command's name, its documentation, and some 
  14310. instructions on what to do immediately; then Emacs asks for input saying 
  14311. whether to execute the command as requested, enable it and execute, or cancel 
  14312. it.  If you decide to enable the command, you are asked whether to do this 
  14313. permanently or just for the current session.  Enabling permanently works by 
  14314. automatically editing your `.emacs' file. 
  14315.  
  14316.  The direct mechanism for disabling a command is to have a non-nil disabled 
  14317. property on the Lisp symbol for the command.  Here is the Lisp program to do 
  14318. this: 
  14319.  
  14320. (put 'delete-region 'disabled t)
  14321.  
  14322.  If the value of the disabled property is a string, that string is included in 
  14323. the message printed when the command is used: 
  14324.  
  14325. (put 'delete-region 'disabled
  14326.      "Text deleted this way cannot be yanked back!\n")
  14327.  
  14328.  You can make a command disabled either by editing the `.emacs' file directly 
  14329. or with the command M-x disable-command, which edits the `.emacs' file for you. 
  14330. Likewise, M-x enable-command edits `.emacs' to enable a command permanently. 
  14331. See Init File. 
  14332.  
  14333.  Whether a command is disabled is independent of what key is used to invoke it; 
  14334. it also applies if the command is invoked using M-x. Disabling a command has no 
  14335. effect on calling it as a function from Lisp programs. 
  14336.  
  14337.  
  14338. ΓòÉΓòÉΓòÉ 33.5. Keyboard Translations ΓòÉΓòÉΓòÉ
  14339.  
  14340.  Some keyboards do not make it convenient to send all the special characters 
  14341. that Emacs uses.  The most common problem case is the DEL character.  Some 
  14342. keyboards provide no convenient way to type this very important 
  14343. character---usually because they were designed to expect the character C-h to 
  14344. be used for deletion.  On these keyboard, if you press the key normally used 
  14345. for deletion, Emacs handles the C-h as a prefix character and offers you a list 
  14346. of help options, which is not what you want. 
  14347.  
  14348.  You can work around this problem within Emacs by setting up keyboard 
  14349. translations to turn C-h into DEL and DEL into C-h, as follows: 
  14350.  
  14351. ;; Translate C-h to DEL.
  14352. (keyboard-translate ?\C-h ?\C-?)
  14353. ;; Translate DEL to C-h.
  14354. (keyboard-translate ?\C-? ?\C-h)
  14355.  
  14356.  Keyboard translations are not the same as key bindings in keymaps (see 
  14357. Keymaps).  Emacs contains numerous keymaps that apply in different situations, 
  14358. but there is only one set of keyboard translations, and it applies to every 
  14359. character that Emacs reads from the terminal.  Keyboard translations take place 
  14360. at the lowest level of input processing; the keys that are looked up in keymaps 
  14361. contain the characters that result from keyboard translation. 
  14362.  
  14363.  For full information about how to use keyboard translations, see Translating 
  14364. Input. 
  14365.  
  14366.  
  14367. ΓòÉΓòÉΓòÉ 33.6. The Syntax Table ΓòÉΓòÉΓòÉ
  14368.  
  14369.  All the Emacs commands which parse words or balance parentheses are controlled 
  14370. by the syntax table.  The syntax table says which characters are opening 
  14371. delimiters, which are parts of words, which are string quotes, and so on.  Each 
  14372. major mode has its own syntax table (though sometimes related major modes use 
  14373. the same one) which it installs in each buffer that uses that major mode.  The 
  14374. syntax table installed in the current buffer is the one that all commands use, 
  14375. so we call it ``the'' syntax table.  A syntax table is a Lisp object, a vector 
  14376. of length 256 whose elements are numbers. 
  14377.  
  14378.  To display a description of the contents of the current syntax table, type C-h 
  14379. s (describe-syntax).  The description of each character includes both the 
  14380. string you would have to give to modify-syntax-entry to set up that character's 
  14381. current syntax, and some English to explain that string if necessary. 
  14382.  
  14383.  For full information on the syntax table, see Syntax Table. 
  14384.  
  14385.  
  14386. ΓòÉΓòÉΓòÉ 33.7. The Init File, ~/.emacs ΓòÉΓòÉΓòÉ
  14387.  
  14388.  When Emacs is started, it normally loads a Lisp program from the file `.emacs' 
  14389. in your home directory.  We call this file your init file because it specifies 
  14390. how to initialize Emacs for you.  You can use the command line switches `-q' 
  14391. and `-u' to tell Emacs whether to load an init file, and which one (see 
  14392. Entering Emacs). 
  14393.  
  14394.  There can also be a default init file, which is the library named 
  14395. `default.el', found via the standard search path for libraries.  The Emacs 
  14396. distribution contains no such library; your site may create one for local 
  14397. customizations.  If this library exists, it is loaded whenever you start Emacs 
  14398. (except when you specify `-q'). But your init file, if any, is loaded first; if 
  14399. it sets inhibit-default-init non-nil, then `default' is not loaded. 
  14400.  
  14401.  If you have a large amount of code in your `.emacs' file, you should move it 
  14402. into another file such as `~/something.el', byte-compile it, and make your 
  14403. `.emacs' file load it with (load "~/something"). See Byte Compilation, for more 
  14404. information about compiling Emacs Lisp programs. 
  14405.  
  14406.  
  14407. ΓòÉΓòÉΓòÉ 33.7.1. Init File Syntax ΓòÉΓòÉΓòÉ
  14408.  
  14409.  The `.emacs' file contains one or more Lisp function call expressions.  Each 
  14410. of these consists of a function name followed by arguments, all surrounded by 
  14411. parentheses.  For example, (setq fill-column 60) calls the function setq to set 
  14412. the variable fill-column (see Filling) to 60. 
  14413.  
  14414.  The second argument to setq is an expression for the new value of the 
  14415. variable.  This can be a constant, a variable, or a function call expression. 
  14416. In `.emacs', constants are used most of the time.  They can be: 
  14417.  
  14418. Numbers: 
  14419.           Numbers are written in decimal, with an optional initial minus sign. 
  14420.  
  14421. Strings: 
  14422.           Lisp string syntax is the same as C string syntax with a few extra 
  14423.           features.  Use a double-quote character to begin and end a string 
  14424.           constant. 
  14425.  
  14426.           In a string, you can include newlines and special characters 
  14427.           literally. But often it is cleaner to use backslash sequences for 
  14428.           them: `\n' for newline, `\b' for backspace, `\r' for carriage return, 
  14429.           `\t' for tab, `\f' for formfeed (control-L), `\e' for escape, `\\' 
  14430.           for a backslash, `\"' for a double-quote, or `\ooo' for the character 
  14431.           whose octal code is ooo. Backslash and double-quote are the only 
  14432.           characters for which backslash sequences are mandatory. 
  14433.  
  14434.           `\C-' can be used as a prefix for a control character, as in `\C-s' 
  14435.           for ASCII control-S, and `\M-' can be used as a prefix for a Meta 
  14436.           character, as in `\M-a' for Meta-A or `\M-\C-a' for Control-Meta-A. 
  14437.  
  14438. Characters: 
  14439.           Lisp character constant syntax consists of a `?' followed by either a 
  14440.           character or an escape sequence starting with `\'. Examples: ?x, ?\n, 
  14441.           ?\", ?\).  Note that strings and characters are not interchangeable 
  14442.           in Lisp; some contexts require one and some contexts require the 
  14443.           other. 
  14444.  
  14445. True: 
  14446.           t stands for `true'. 
  14447.  
  14448. False: 
  14449.           nil stands for `false'. 
  14450.  
  14451. Other Lisp objects: 
  14452.           Write a single-quote (') followed by the Lisp object you want. 
  14453.  
  14454.  
  14455. ΓòÉΓòÉΓòÉ 33.7.2. Init File Examples ΓòÉΓòÉΓòÉ
  14456.  
  14457.  Here are some examples of doing certain commonly desired things with Lisp 
  14458. expressions: 
  14459.  
  14460. o Make TAB in C mode just insert a tab if point is in the middle of a line. 
  14461.  
  14462.     (setq c-tab-always-indent nil)
  14463.  
  14464.   Here we have a variable whose value is normally t for `true' and the 
  14465.   alternative is nil for `false'. 
  14466.  
  14467. o Make searches case sensitive by default (in all buffers that do not override 
  14468.   this). 
  14469.  
  14470.     (setq-default case-fold-search nil)
  14471.  
  14472.   This sets the default value, which is effective in all buffers that do not 
  14473.   have local values for the variable.  Setting case-fold-search with setq 
  14474.   affects only the current buffer's local value, which is not what you probably 
  14475.   want to do in an init file. 
  14476.  
  14477. o Make Text mode the default mode for new buffers. 
  14478.  
  14479.     (setq default-major-mode 'text-mode)
  14480.  
  14481.   Note that text-mode is used because it is the command for entering Text mode. 
  14482.   The single-quote before it makes the symbol a constant; otherwise, text-mode 
  14483.   would be treated as a variable name. 
  14484.  
  14485. o Turn on Auto Fill mode automatically in Text mode and related modes. 
  14486.  
  14487.     (add-hook 'text-mode-hook
  14488.       '(lambda () (auto-fill-mode 1)))
  14489.  
  14490.   This shows how to add a hook function to a normal hook variable (see Hooks). 
  14491.   The function we supply is a list starting with lambda, with a single-quote in 
  14492.   front of it to make it a list constant rather than an expression. 
  14493.  
  14494.   It's beyond the scope of this manual to explain Lisp functions, but for this 
  14495.   example it is enough to know that the effect is to execute (auto-fill-mode 1) 
  14496.   when Text mode is entered.  You can replace it with any other expression that 
  14497.   you like, or with several expressions in a row. 
  14498.  
  14499.   Emacs comes with a function named turn-on-auto-fill whose definition is 
  14500.   (lambda () (auto-fill-mode 1)).  Thus, a simpler way to write the above 
  14501.   example is as follows: 
  14502.  
  14503.     (add-hook 'text-mode-hook 'turn-on-auto-fill)
  14504.  
  14505. o Load the installed Lisp library named `foo' (actually a file `foo.elc' or 
  14506.   `foo.el' in a standard Emacs directory). 
  14507.  
  14508.     (load "foo")
  14509.  
  14510.   When the argument to load is a relative file name, not starting with `/' or 
  14511.   `~', load searches the directories in load-path (see Lisp Libraries). 
  14512.  
  14513. o Load the compiled Lisp file `foo.elc' from your home directory. 
  14514.  
  14515.     (load "~/foo.elc")
  14516.  
  14517.   Here an absolute file name is used, so no searching is done. 
  14518.  
  14519. o Rebind the key C-x l to run the function make-symbolic-link. 
  14520.  
  14521.     (global-set-key "\C-xl" 'make-symbolic-link)
  14522.  
  14523.   or 
  14524.  
  14525.     (define-key global-map "\C-xl" 'make-symbolic-link)
  14526.  
  14527.   Note once again the single-quote used to refer to the symbol 
  14528.   make-symbolic-link instead of its value as a variable. 
  14529.  
  14530. o Do the same thing for C mode only. 
  14531.  
  14532.     (define-key c-mode-map "\C-xl" 'make-symbolic-link)
  14533.  
  14534. o Redefine all keys which now run next-line in Fundamental mode so that they 
  14535.   run forward-line instead. 
  14536.  
  14537.     (substitute-key-definition 'next-line 'forward-line
  14538.                                global-map)
  14539.  
  14540. o Make C-x C-v undefined. 
  14541.  
  14542.     (global-unset-key "\C-x\C-v")
  14543.  
  14544.   One reason to undefine a key is so that you can make it a prefix. Simply 
  14545.   defining C-x C-v anything will make C-x C-v a prefix, but C-x C-v must first 
  14546.   be freed of its usual non-prefix definition. 
  14547.  
  14548. o Make `$' have the syntax of punctuation in Text mode. Note the use of a 
  14549.   character constant for `$'. 
  14550.  
  14551.     (modify-syntax-entry ?\$ "." text-mode-syntax-table)
  14552.  
  14553. o Enable the use of the command eval-expression without confirmation. 
  14554.  
  14555.     (put 'eval-expression 'disabled nil)
  14556.  
  14557.  
  14558. ΓòÉΓòÉΓòÉ 33.7.3. Terminal-specific Initialization ΓòÉΓòÉΓòÉ
  14559.  
  14560.  Each terminal type can have a Lisp library to be loaded into Emacs when it is 
  14561. run on that type of terminal.  For a terminal type named termtype, the library 
  14562. is called `term/termtype' and it is found by searching the directories 
  14563. load-path as usual and trying the suffixes `.elc' and `.el'.  Normally it 
  14564. appears in the subdirectory `term' of the directory where most Emacs libraries 
  14565. are kept. 
  14566.  
  14567.  The usual purpose of the terminal-specific library is to define the escape 
  14568. sequences used by the terminal's function keys using the library `keypad.el'. 
  14569. See the file `term/vt100.el' for an example of how this is done. 
  14570.  
  14571.  When the terminal type contains a hyphen, only the part of the name before the 
  14572. first hyphen is significant in choosing the library name. Thus, terminal types 
  14573. `aaa-48' and `aaa-30-rv' both use the library `term/aaa'.  The code in the 
  14574. library can use (getenv "TERM") to find the full terminal type name. 
  14575.  
  14576.  The library's name is constructed by concatenating the value of the variable 
  14577. term-file-prefix and the terminal type.  Your `.emacs' file can prevent the 
  14578. loading of the terminal-specific library by setting term-file-prefix to nil. 
  14579.  
  14580.  Emacs runs the hook term-setup-hook at the end of initialization, after both 
  14581. your `.emacs' file and any terminal-specific library have been read in.  Add 
  14582. hook functions to this hook if you wish to override part of any of the 
  14583. terminal-specific libraries and to define initializations for terminals that do 
  14584. not have a library.  See Hooks. 
  14585.  
  14586.  
  14587. ΓòÉΓòÉΓòÉ 33.7.4. How Emacs Finds Your Init File ΓòÉΓòÉΓòÉ
  14588.  
  14589.  Normally Emacs uses the environment variable HOME to find `.emacs'; that's 
  14590. what `~' means in a file name.  But if you have done su, Emacs tries to find 
  14591. your own `.emacs', not that of the user you are currently pretending to be. 
  14592. The idea is that you should get your own editor customizations even if you are 
  14593. running as the super user. 
  14594.  
  14595.  More precisely, Emacs first determines which user's init file to use. It gets 
  14596. the user name from the environment variables USER and LOGNAME; if neither of 
  14597. those exists, it uses effective user-ID. If that user name matches the real 
  14598. user-ID, then Emacs uses HOME; otherwise, it looks up the home directory 
  14599. corresponding to that user name in the system's data base of users. 
  14600.  
  14601.  
  14602. ΓòÉΓòÉΓòÉ 33.8. Quitting and Aborting ΓòÉΓòÉΓòÉ
  14603.  
  14604. C-g 
  14605.           Quit.  Cancel running or partially typed command. 
  14606.  
  14607. C-] 
  14608.           Abort innermost recursive editing level and cancel the command which 
  14609.           invoked it (abort-recursive-edit). 
  14610.  
  14611. M-x top-level 
  14612.           Abort all recursive editing levels that are currently executing. 
  14613.  
  14614. C-x u 
  14615.           Cancel an already-executed command, usually (undo). 
  14616.  
  14617.  There are two ways of cancelling commands which are not finished executing: 
  14618. quitting with C-g, and aborting with C-] or M-x top-level.  Quitting cancels a 
  14619. partially typed command or one which is already running.  Aborting exits a 
  14620. recursive editing level and cancels the command that invoked the recursive 
  14621. edit. (See Recursive Edit.) 
  14622.  
  14623.  Quitting with C-g is used for getting rid of a partially typed command, or a 
  14624. numeric argument that you don't want.  It also stops a running command in the 
  14625. middle in a relatively safe way, so you can use it if you accidentally give a 
  14626. command which takes a long time.  In particular, it is safe to quit out of 
  14627. killing; either your text will all still be in the buffer, or it will all be in 
  14628. the kill ring (or maybe both).  Quitting an incremental search does special 
  14629. things documented under searching; in general, it may take two successive C-g 
  14630. characters to get out of a search. 
  14631.  
  14632.  C-g works by setting the variable quit-flag to t the instant C-g is typed; 
  14633. Emacs Lisp checks this variable frequently and quits if it is non-nil.  C-g is 
  14634. only actually executed as a command if you type it while Emacs is waiting for 
  14635. input. 
  14636.  
  14637.  If you quit with C-g a second time before the first C-g is recognized, you 
  14638. activate the ``emergency escape'' feature and return to the shell.  See 
  14639. Emergency Escape. 
  14640.  
  14641.  There may be times when you cannot quit.  When Emacs is waiting for the 
  14642. operating system to do something, quitting is impossible unless special pains 
  14643. are taken for the particular system call within Emacs where the waiting occurs. 
  14644. We have done this for the system calls that users are likely to want to quit 
  14645. from, but it's possible you will find another.  In one very common 
  14646. case---waiting for file input or output using NFS---Emacs itself knows how to 
  14647. quit, but most NFS implementations simply do not allow user programs to stop 
  14648. waiting for NFS when the NFS server is hung. 
  14649.  
  14650.  Aborting with C-] (abort-recursive-edit) is used to get out of a recursive 
  14651. editing level and cancel the command which invoked it.  Quitting with C-g does 
  14652. not do this, and could not do this, because it is used to cancel a partially 
  14653. typed command within the recursive editing level.  Both operations are useful. 
  14654. For example, if you are in a recursive edit and type C-u 8 to enter a numeric 
  14655. argument, you can cancel that argument with C-g and remain in the recursive 
  14656. edit. 
  14657.  
  14658.  The command M-x top-level is equivalent to ``enough'' C-] commands to get you 
  14659. out of all the levels of recursive edits that you are in.  C-] gets you out one 
  14660. level at a time, but M-x top-level goes out all levels at once.  Both C-] and 
  14661. M-x top-level are like all other commands, and unlike C-g, in that they are 
  14662. effective only when Emacs is ready for a command.  C-] is an ordinary key and 
  14663. has its meaning only because of its binding in the keymap. See Recursive Edit. 
  14664.  
  14665.  C-x u (undo) is not strictly speaking a way of cancelling a command, but you 
  14666. can think of it as cancelling a command already finished executing.  See Undo. 
  14667.  
  14668.  
  14669. ΓòÉΓòÉΓòÉ 33.9. Dealing with Emacs Trouble ΓòÉΓòÉΓòÉ
  14670.  
  14671.  This section describes various conditions in which Emacs fails to work 
  14672. normally, and how to recognize them and correct them. 
  14673.  
  14674.  
  14675. ΓòÉΓòÉΓòÉ 33.9.1. If DEL Fails to Delete ΓòÉΓòÉΓòÉ
  14676.  
  14677.  If you find that DEL enters Help like Control-h instead of deleting a 
  14678. character, your terminal is sending the wrong code for DEL.  You can work 
  14679. around this problem by changing the keyboard translation table (see Keyboard 
  14680. Translations). 
  14681.  
  14682.  
  14683. ΓòÉΓòÉΓòÉ 33.9.2. Recursive Editing Levels ΓòÉΓòÉΓòÉ
  14684.  
  14685.  Recursive editing levels are important and useful features of Emacs, but they 
  14686. can seem like malfunctions to the user who does not understand them. 
  14687.  
  14688.  If the mode line has square brackets `[...]' around the parentheses that 
  14689. contain the names of the major and minor modes, you have entered a recursive 
  14690. editing level.  If you did not do this on purpose, or if you don't understand 
  14691. what that means, you should just get out of the recursive editing level.  To do 
  14692. so, type M-x top-level.  This is called getting back to top level.  See 
  14693. Recursive Edit. 
  14694.  
  14695.  
  14696. ΓòÉΓòÉΓòÉ 33.9.3. Garbage on the Screen ΓòÉΓòÉΓòÉ
  14697.  
  14698.  If the data on the screen looks wrong, the first thing to do is see whether 
  14699. the text is really wrong.  Type C-l, to redisplay the entire screen.  If the 
  14700. screen appears correct after this, the problem was entirely in the previous 
  14701. screen update. 
  14702.  
  14703.  Display updating problems often result from an incorrect termcap entry for the 
  14704. terminal you are using.  The file `etc/TERMS' in the Emacs distribution gives 
  14705. the fixes for known problems of this sort. `INSTALL' contains general advice 
  14706. for these problems in one of its sections.  Very likely there is simply 
  14707. insufficient padding for certain display operations.  To investigate the 
  14708. possibility that you have this sort of problem, try Emacs on another terminal 
  14709. made by a different manufacturer. If problems happen frequently on one kind of 
  14710. terminal but not another kind, it is likely to be a bad termcap entry, though 
  14711. it could also be due to a bug in Emacs that appears for terminals that have or 
  14712. that lack specific features. 
  14713.  
  14714.  
  14715. ΓòÉΓòÉΓòÉ 33.9.4. Garbage in the Text ΓòÉΓòÉΓòÉ
  14716.  
  14717.  If C-l shows that the text is wrong, try undoing the changes to it using C-x u 
  14718. until it gets back to a state you consider correct.  Also try C-h l to find out 
  14719. what command you typed to produce the observed results. 
  14720.  
  14721.  If a large portion of text appears to be missing at the beginning or end of 
  14722. the buffer, check for the word `Narrow' in the mode line. If it appears, the 
  14723. text is still present, but temporarily off-limits. To make it accessible again, 
  14724. type C-x n w.  See Narrowing. 
  14725.  
  14726.  
  14727. ΓòÉΓòÉΓòÉ 33.9.5. Spontaneous Entry to Incremental Search ΓòÉΓòÉΓòÉ
  14728.  
  14729.  If Emacs spontaneously displays `I-search:' at the bottom of the screen, it 
  14730. means that the terminal is sending C-s and C-q according to the poorly designed 
  14731. xon/xoff ``flow control'' protocol. 
  14732.  
  14733.  If this happens to you, your best recourse is to put the terminal in a mode 
  14734. where it will not use flow control, or give it so much padding that it will 
  14735. never send a C-s.  (One way to increase the amount of padding is to set the 
  14736. variable baud-rate to a larger value.  Its value is the terminal output speed, 
  14737. measured in the conventional units of baud.) 
  14738.  
  14739.  If you don't succeed in turning off flow control, the next best thing is to 
  14740. tell Emacs to cope with it.  To do this, call the function enable-flow-control. 
  14741.  
  14742.  Typically there are particular terminal types with which you must use flow 
  14743. control.  You can conveniently ask for flow control on those terminal types 
  14744. only, using enable-flow-control-on.  For example, if you find you must use flow 
  14745. control on VT-100 and H19 terminals, put the following in your `.emacs' file: 
  14746.  
  14747. (enable-flow-control-on "vt100" "h19")
  14748.  
  14749.  When flow control is enabled, you must type C-\ to get the effect of a C-s, 
  14750. and type C-^ to get the effect of a C-q.  (These aliases work by means of 
  14751. keyboard translations; see Keyboard Translations.) 
  14752.  
  14753.  
  14754. ΓòÉΓòÉΓòÉ 33.9.6. Emergency Escape ΓòÉΓòÉΓòÉ
  14755.  
  14756.  Because at times there have been bugs causing Emacs to loop without checking 
  14757. quit-flag, a special feature causes Emacs to be suspended immediately if you 
  14758. type a second C-g while the flag is already set, so you can always get out of 
  14759. GNU Emacs.  Normally Emacs recognizes and clears quit-flag (and quits!) quickly 
  14760. enough to prevent this from happening. 
  14761.  
  14762.  When you resume Emacs after a suspension caused by multiple C-g, it asks two 
  14763. questions before going back to what it had been doing: 
  14764.  
  14765. Auto-save? (y or n)
  14766. Abort (and dump core)? (y or n)
  14767.  
  14768. Answer each one with y or n followed by RET. 
  14769.  
  14770.  Saying y to `Auto-save?' causes immediate auto-saving of all modified buffers 
  14771. in which auto-saving is enabled. 
  14772.  
  14773.  Saying y to `Abort (and dump core)?' causes an illegal instruction to be 
  14774. executed, dumping core.  This is to enable a wizard to figure out why Emacs was 
  14775. failing to quit in the first place.  Execution does not continue after a core 
  14776. dump.  If you answer n, execution does continue.  With luck, GNU Emacs will 
  14777. ultimately check quit-flag and quit normally. If not, and you type another C-g, 
  14778. it is suspended again. 
  14779.  
  14780.  If Emacs is not really hung, just slow, you may invoke the double C-g feature 
  14781. without really meaning to.  Then just resume and answer n to both questions, 
  14782. and you will arrive at your former state. Presumably the quit you requested 
  14783. will happen soon. 
  14784.  
  14785.  The double-C-g feature is turned off when Emacs is running under the X Window 
  14786. System, since the you can use the window manager to kill Emacs or to create 
  14787. another window and run another program. 
  14788.  
  14789.  
  14790. ΓòÉΓòÉΓòÉ 33.9.7. Help for Total Frustration ΓòÉΓòÉΓòÉ
  14791.  
  14792.  If using Emacs (or something else) becomes terribly frustrating and none of 
  14793. the techniques described above solve the problem, Emacs can still help you. 
  14794.  
  14795.  First, if the Emacs you are using is not responding to commands, type C-g C-g 
  14796. to get out of it and then start a new one. 
  14797.  
  14798.  Second, type M-x doctor RET. 
  14799.  
  14800.  The doctor will help you feel better.  Each time you say something to the 
  14801. doctor, you must end it by typing RET RET.  This lets the doctor know you are 
  14802. finished. 
  14803.  
  14804.  
  14805. ΓòÉΓòÉΓòÉ 33.10. Reporting Bugs ΓòÉΓòÉΓòÉ
  14806.  
  14807.  Sometimes you will encounter a bug in Emacs.  Although we cannot promise we 
  14808. can or will fix the bug, and we might not even agree that it is a bug, we want 
  14809. to hear about bugs you encounter in case we do want to fix them. 
  14810.  
  14811.  To make it possible for us to fix a bug, you must report it.  In order to do 
  14812. so effectively, you must know when and how to do it. 
  14813.  
  14814.  
  14815. ΓòÉΓòÉΓòÉ 33.10.1. When Is There a Bug ΓòÉΓòÉΓòÉ
  14816.  
  14817.  If Emacs executes an illegal instruction, or dies with an operating system 
  14818. error message that indicates a problem in the program (as opposed to something 
  14819. like ``disk full''), then it is certainly a bug. 
  14820.  
  14821.  If Emacs updates the display in a way that does not correspond to what is in 
  14822. the buffer, then it is certainly a bug.  If a command seems to do the wrong 
  14823. thing but the problem corrects itself if you type C-l, it is a case of 
  14824. incorrect display updating. 
  14825.  
  14826.  Taking forever to complete a command can be a bug, but you must make certain 
  14827. that it was really Emacs's fault.  Some commands simply take a long time.  Type 
  14828. C-g and then C-h l to see whether the input Emacs received was what you 
  14829. intended to type; if the input was such that you know it should have been 
  14830. processed quickly, report a bug.  If you don't know whether the command should 
  14831. take a long time, find out by looking in the manual or by asking for 
  14832. assistance. 
  14833.  
  14834.  If a command you are familiar with causes an Emacs error message in a case 
  14835. where its usual definition ought to be reasonable, it is probably a bug. 
  14836.  
  14837.  If a command does the wrong thing, that is a bug.  But be sure you know for 
  14838. certain what it ought to have done.  If you aren't familiar with the command, 
  14839. or don't know for certain how the command is supposed to work, then it might 
  14840. actually be working right.  Rather than jumping to conclusions, show the 
  14841. problem to someone who knows for certain. 
  14842.  
  14843.  Finally, a command's intended definition may not be best for editing with. 
  14844. This is a very important sort of problem, but it is also a matter of judgment. 
  14845. Also, it is easy to come to such a conclusion out of ignorance of some of the 
  14846. existing features.  It is probably best not to complain about such a problem 
  14847. until you have checked the documentation in the usual ways, feel confident that 
  14848. you understand it, and know for certain that what you want is not available. 
  14849. If you are not sure what the command is supposed to do after a careful reading 
  14850. of the manual, check the index and glossary for any terms that may be unclear. 
  14851.  
  14852.  If you still do not understand, that indicates a bug in the manual, which you 
  14853. should report.  The manual's job is to make everything clear to people who are 
  14854. not Emacs experts---including you.  It is just as important to report 
  14855. documentation bugs as program bugs. 
  14856.  
  14857.  If the on-line documentation string of a function or variable disagrees with 
  14858. the manual, one of them must be wrong; that is a bug. 
  14859.  
  14860.  
  14861. ΓòÉΓòÉΓòÉ 33.10.2. Understanding Bug Reporting ΓòÉΓòÉΓòÉ
  14862.  
  14863.  When you decide that there is a bug, it is important to report it and to 
  14864. report it in a way which is useful.  What is most useful is an exact 
  14865. description of what commands you type, starting with the shell command to run 
  14866. Emacs, until the problem happens. 
  14867.  
  14868.  The most important principle in reporting a bug is to report facts, not 
  14869. hypotheses or categorizations.  It is always easier to report the facts, but 
  14870. people seem to prefer to strain to posit explanations and report them instead. 
  14871. If the explanations are based on guesses about how Emacs is implemented, they 
  14872. will be useless; we will have to try to figure out what the facts must have 
  14873. been to lead to such speculations.  Sometimes this is impossible.  But in any 
  14874. case, it is unnecessary work for us. 
  14875.  
  14876.  For example, suppose that you type C-x C-f /glorp/baz.ugh RET, visiting a file 
  14877. which (you know) happens to be rather large, and Emacs prints out `I feel 
  14878. pretty today'.  The best way to report the bug is with a sentence like the 
  14879. preceding one, because it gives all the facts and nothing but the facts. 
  14880.  
  14881.  Do not assume that the problem is due to the size of the file and say, ``When 
  14882. I visit a large file, Emacs prints out `I feel pretty today'.'' This is what we 
  14883. mean by ``guessing explanations''.  The problem is just as likely to be due to 
  14884. the fact that there is a `z' in the file name.  If this is so, then when we got 
  14885. your report, we would try out the problem with some ``large file'', probably 
  14886. with no `z' in its name, and not find anything wrong.  There is no way in the 
  14887. world that we could guess that we should try visiting a file with a `z' in its 
  14888. name. 
  14889.  
  14890.  Alternatively, the problem might be due to the fact that the file starts with 
  14891. exactly 25 spaces.  For this reason, you should make sure that you inform us of 
  14892. the exact contents of any file that is needed to reproduce the bug.  What if 
  14893. the problem only occurs when you have typed the C-x C-a command previously? 
  14894. This is why we ask you to give the exact sequence of characters you typed since 
  14895. starting to use Emacs. 
  14896.  
  14897.  You should not even say ``visit a file'' instead of C-x C-f unless you know 
  14898. that it makes no difference which visiting command is used. Similarly, rather 
  14899. than saying ``if I have three characters on the line,'' say ``after I type RET 
  14900. A B C RET C-p,'' if that is the way you entered the text. 
  14901.  
  14902.  
  14903. ΓòÉΓòÉΓòÉ 33.10.3. Checklist for Bug Reports ΓòÉΓòÉΓòÉ
  14904.  
  14905.  The best way to send a bug report is to mail it electronically to the Emacs 
  14906. maintainers at `bug-gnu-emacs@prep.ai.mit.edu'. 
  14907.  
  14908.  If you'd like to read the bug reports, you can find them on the repeater 
  14909. newsgroup `gnu.emacs.bugs'; keep in mind, however, that as a spectator you 
  14910. should not criticize anything about what you see there. The purpose of bug 
  14911. reports is to give information to the Emacs maintainers.  Spectators are 
  14912. welcome only as long as they do not interfere with this. 
  14913.  
  14914.  Please do not post bug reports using netnews; mail is more reliable than 
  14915. netnews about reporting your correct address, which we may need in order to ask 
  14916. you for more information. 
  14917.  
  14918.  If you can't send electronic mail, then mail the bug report on paper to this 
  14919. address: 
  14920.  
  14921. GNU Emacs Bugs Free Software Foundation 675 Mass Ave Cambridge, MA 02139 
  14922.  
  14923.  We do not promise to fix the bug; but if the bug is serious, or ugly, or easy 
  14924. to fix, chances are we will want to. 
  14925.  
  14926.  To enable maintainers to investigate a bug, your report should include all 
  14927. these things: 
  14928.  
  14929. o The version number of Emacs.  Without this, we won't know whether there is 
  14930.   any point in looking for the bug in the current version of GNU Emacs. 
  14931.  
  14932.   You can get the version number by typing M-x emacs-version RET.  If that 
  14933.   command does not work, you probably have something other than GNU Emacs, so 
  14934.   you will have to report the bug somewhere else. 
  14935.  
  14936. o The type of machine you are using, and the operating system name and version 
  14937.   number. 
  14938.  
  14939. o The operands you gave to the configure command when you installed Emacs. 
  14940.  
  14941. o A complete list of any modifications you have made to the Emacs source. (We 
  14942.   may not have time to investigate the bug unless it happens in an unmodified 
  14943.   Emacs.  But if you've made modifications and don't tell us, then you are 
  14944.   sending us on a wild goose chase.) 
  14945.  
  14946.   Be precise about these changes.  A description in English is not 
  14947.   enough---send a context diff for them. 
  14948.  
  14949.   Adding files of your own (such as a machine description for a machine we 
  14950.   don't support) is a modification of the source. 
  14951.  
  14952. o Details of any other deviations from the standard procedure for installing 
  14953.   GNU Emacs. 
  14954.  
  14955. o The complete text of any files needed to reproduce the bug. 
  14956.  
  14957.    If you can tell us a way to cause the problem without visiting any files, 
  14958.   please do so.  This makes it much easier to debug.  If you do need files, 
  14959.   make sure you arrange for us to see their exact contents.  For example, it 
  14960.   can often matter whether there are spaces at the ends of lines, or a newline 
  14961.   after the last line in the buffer (nothing ought to care whether the last 
  14962.   line is terminated, but try telling the bugs that). 
  14963.  
  14964. o The precise commands we need to type to reproduce the bug. 
  14965.  
  14966.    The easy way to record the input to Emacs precisely is to to write a dribble 
  14967.   file.  To start the file, execute the Lisp expression 
  14968.  
  14969.     (open-dribble-file "~/dribble")
  14970.  
  14971.   using M-ESC or from the `*scratch*' buffer just after starting Emacs.  From 
  14972.   then on, Emacs copies all your input to the specified dribble file until the 
  14973.   Emacs process is killed. 
  14974.  
  14975. o For possible display bugs, the terminal type (the value of environment 
  14976.   variable TERM), the complete termcap entry for the terminal from 
  14977.   `/etc/termcap' (since that file is not identical on all machines), and the 
  14978.   output that Emacs actually sent to the terminal. 
  14979.  
  14980.   The way to collect the terminal output is to execute the Lisp expression 
  14981.  
  14982.     (open-termscript "~/termscript")
  14983.  
  14984.   using M-ESC or from the `*scratch*' buffer just after starting Emacs.  From 
  14985.   then on, Emacs copies all terminal output to the specified termscript file as 
  14986.   well, until the Emacs process is killed. If the problem happens when Emacs 
  14987.   starts up, put this expression into your `.emacs' file so that the termscript 
  14988.   file will be open when Emacs displays the screen for the first time. 
  14989.  
  14990.   Be warned: it is often difficult, and sometimes impossible, to fix a 
  14991.   terminal-dependent bug without access to a terminal of the type that 
  14992.   stimulates the bug. 
  14993.  
  14994. o A description of what behavior you observe that you believe is incorrect. 
  14995.   For example, ``The Emacs process gets a fatal signal,'' or, ``The resulting 
  14996.   text is as follows, which I think is wrong.'' 
  14997.  
  14998.   Of course, if the bug is that Emacs gets a fatal signal, then one can't miss 
  14999.   it.  But if the bug is incorrect text, the maintainer might fail to notice 
  15000.   what is wrong.  Why leave it to chance? 
  15001.  
  15002.   Even if the problem you experience is a fatal signal, you should still say so 
  15003.   explicitly.  Suppose something strange is going on, such as, your copy of the 
  15004.   source is out of sync, or you have encountered a bug in the C library on your 
  15005.   system.  (This has happened!)  Your copy might crash and the copy here would 
  15006.   not.  If you said to expect a crash, then when Emacs here fails to crash, we 
  15007.   would know that the bug was not happening.  If you don't say to expect a 
  15008.   crash, then we would not know whether the bug was happening.  We would not be 
  15009.   able to draw any conclusion from our observations. 
  15010.  
  15011.   If the manifestation of the bug is an Emacs error message, it is important to 
  15012.   report not just the text of the error message but a backtrace showing how the 
  15013.   Lisp program in Emacs arrived at the error. To make the backtrace, execute 
  15014.   the Lisp expression (setq debug-on-error t) before the error happens (that is 
  15015.   to say, you must execute that expression and then make the bug happen).  This 
  15016.   causes the Lisp debugger to run, showing you a backtrace.  Copy the text of 
  15017.   the debugger's backtrace into the bug report. 
  15018.  
  15019.   This use of the debugger is possible only if you know how to make the bug 
  15020.   happen again.  Do note the error message the first time the bug happens, so 
  15021.   if you can't make it happen again, you can report at least the error message. 
  15022.  
  15023. o Check whether any programs you have loaded into the Lisp world, including 
  15024.   your `.emacs' file, set any variables that may affect the functioning of 
  15025.   Emacs.  Also, see whether the problem happens in a freshly started Emacs 
  15026.   without loading your `.emacs' file (start Emacs with the -q switch to prevent 
  15027.   loading the init file.)  If the problem does not occur then, you must report 
  15028.   the precise contents of any programs that you must load into the Lisp world 
  15029.   in order to cause the problem to occur. 
  15030.  
  15031. o If the problem does depend on an init file or other Lisp programs that are 
  15032.   not part of the standard Emacs system, then you should make sure it is not a 
  15033.   bug in those programs by complaining to their maintainers first.  After they 
  15034.   verify that they are using Emacs in a way that is supposed to work, they 
  15035.   should report the bug. 
  15036.  
  15037. o If you wish to mention something in the GNU Emacs source, show the portion in 
  15038.   its context.  Don't just give a line number. 
  15039.  
  15040.   The line numbers in the development sources don't match those in your 
  15041.   sources.  It would take extra work for the maintainers to determine what code 
  15042.   is in your version at a given line number, and we could not be certain. 
  15043.  
  15044. o Additional information from a debugger might enable someone to find a problem 
  15045.   on a machine which he does not have available.  However, you need to think 
  15046.   when you collect this information if you want it to be useful. 
  15047.  
  15048.   For example, many people send just a backtrace, but that is never useful by 
  15049.   itself.  A simple backtrace with arguments conveys little about what is 
  15050.   happening inside GNU Emacs, because most of the arguments listed in the 
  15051.   backtrace are pointers to Lisp objects.  The numeric values of these pointers 
  15052.   have no significance whatever; all that matters is the contents of the 
  15053.   objects they point to (and most of the contents are themselves pointers). 
  15054.  
  15055.   To provide useful information, you need to show the values of Lisp objects in 
  15056.   Lisp notation.  Do this for each variable which is a Lisp object, in several 
  15057.   stack frames near the bottom of the stack.  Look at the source to see which 
  15058.   variables are Lisp objects, because the debugger thinks of them as integers. 
  15059.  
  15060.   To show a variable's value in Lisp syntax, first print its value, then use 
  15061.   the GDB command pr to print the Lisp object in Lisp syntax. (If you must use 
  15062.   another debugger, call the function debug_print with the object as an 
  15063.   argument.) 
  15064.  
  15065. Here are some things that are not necessary: 
  15066.  
  15067. o A description of the envelope of the bug---this is not necessary for a 
  15068.   reproducible bug. 
  15069.  
  15070.   Often people who encounter a bug spend a lot of time investigating which 
  15071.   changes to the input file will make the bug go away and which changes will 
  15072.   not affect it. 
  15073.  
  15074.   This is often time consuming and not very useful, because the way we will 
  15075.   find the bug is by running a single example under the debugger with 
  15076.   breakpoints, not by pure deduction from a series of examples.  You might as 
  15077.   well save time by not doing this. 
  15078.  
  15079.   Of course, if you can find a simpler example to report instead of the 
  15080.   original one, that is a convenience.  Errors in the output will be easier to 
  15081.   spot, running under the debugger will take less time, etc. 
  15082.  
  15083.   However, simplification is not vital; if you don't want to do this, please 
  15084.   report the bug with your original test case. 
  15085.  
  15086. o A patch for the bug. 
  15087.  
  15088.   A patch for the bug is useful if it is a good one.  But don't omit the 
  15089.   necessary information, such as the test case, on the assumption that a patch 
  15090.   is all we need.  We might see problems with your patch and decide to fix the 
  15091.   problem another way, or we might not understand it at all. 
  15092.  
  15093.   And if we can't understand what bug you are trying to fix, or why your patch 
  15094.   should be an improvement, we mustn't install it.  A test case will help us to 
  15095.   understand. 
  15096.  
  15097.   See Sending Patches, for guidelines on how to make it easy for us to 
  15098.   understand and install your patches. 
  15099.  
  15100. o A guess about what the bug is or what it depends on. 
  15101.  
  15102.   Such guesses are usually wrong.  Even experts can't guess right about such 
  15103.   things without first using the debugger to find the facts. 
  15104.  
  15105.  
  15106. ΓòÉΓòÉΓòÉ 33.10.4. Sending Patches for GNU Emacs ΓòÉΓòÉΓòÉ
  15107.  
  15108.  If you would like to write bug fixes or improvements for GNU Emacs, that is 
  15109. very helpful.  When you send your changes, please follow these guidelines to 
  15110. make it easy for the maintainers to use them. 
  15111.  
  15112.  If you don't follow these guidelines, your information might still be useful, 
  15113. but using it will take extra work.  Maintaining GNU Emacs is a lot of work in 
  15114. the best of circumstances, and we can't keep up unless you do your best to 
  15115. help. 
  15116.  
  15117. o Send an explanation with your changes of what problem they fix or what 
  15118.   improvement they bring about.  For a bug fix, just include a copy of the bug 
  15119.   report, and explain why the change fixes the bug. 
  15120.  
  15121.   (Referring to a bug report is not as good as including it, because then we 
  15122.   will have to look it up, and we have probably already deleted it if we've 
  15123.   already fixed the bug.) 
  15124.  
  15125. o Always include a proper bug report for the problem you think you have fixed. 
  15126.   We need to convince ourselves that the change is right before installing it. 
  15127.   Even if it is correct, we might have trouble understanding it if we don't 
  15128.   have a way to reproduce the problem. 
  15129.  
  15130. o Include all the comments that are appropriate to help people reading the 
  15131.   source in the future understand why this change was needed. 
  15132.  
  15133. o Don't mix together changes made for different reasons. Send them 
  15134.   individually. 
  15135.  
  15136.   If you make two changes for separate reasons, then we might not want to 
  15137.   install them both.  We might want to install just one.  If you send them all 
  15138.   jumbled together in a single set of diffs, we have to do extra work to 
  15139.   disentangle them---to figure out which parts of the change serve which 
  15140.   purpose.  If we don't have time for this, we might have to ignore your 
  15141.   changes entirely. 
  15142.  
  15143.   If you send each change as soon as you have written it, with its own 
  15144.   explanation, then the two changes never get tangled up, and we can consider 
  15145.   each one properly without any extra work to disentangle them. 
  15146.  
  15147. o Send each change as soon as that change is finished.  Sometimes people think 
  15148.   they are helping us by accumulating many changes to send them all together. 
  15149.   As explained above, this is absolutely the worst thing you could do. 
  15150.  
  15151.   Since you should send each change separately, you might as well send it right 
  15152.   away.  That gives us the option of installing it immediately if it is 
  15153.   important. 
  15154.  
  15155. o Use `diff -c' to make your diffs.  Diffs without context are hard to install 
  15156.   reliably.  More than that, they are hard to study; we must always study a 
  15157.   patch to decide whether we want to install it.  Unidiff format is better than 
  15158.   contextless diffs, but not as easy to read as `-c' format. 
  15159.  
  15160.   If you have GNU diff, use `diff -cp', which shows the name of the function 
  15161.   that each change occurs in. 
  15162.  
  15163. o Write the change log entries for your changes.  This is both to save us the 
  15164.   extra work of writing them, and to help explain your changes so we can 
  15165.   understand them. 
  15166.  
  15167.   The purpose of the change log is to show people where to find what was 
  15168.   changed.  So you need to be specific about what functions you changed; in 
  15169.   large functions, it's often helpful to indicate where within the function the 
  15170.   change was. 
  15171.  
  15172.   On the other hand, once you have shown people where to find the change, you 
  15173.   need not explain its purpose. Thus, if you add a new function, all you need 
  15174.   to say about it is that it is new.  If you feel that the purpose needs 
  15175.   explaining, it probably does---but the explanation will be much more useful 
  15176.   if you put it in comments in the code. 
  15177.  
  15178.   Please read the `ChangeLog' file to see what sorts of information to put in, 
  15179.   and to learn the style that we use.  If you would like your name to appear in 
  15180.   the header line showing who made the change, send us the header line. 
  15181.  
  15182. o When you write the fix, keep in mind that we can't install a change that 
  15183.   would break other systems.  Please think about what effect your change will 
  15184.   have if compiled on another type of system. 
  15185.  
  15186.   Sometimes people send fixes that might be an improvement in general---but it 
  15187.   is hard to be sure of this.  It's hard to install such changes because we 
  15188.   have to study them very carefully.  Of course, a good explanation of the 
  15189.   reasoning by which you concluded the change was correct can help convince us. 
  15190.  
  15191.   The safest changes are changes to the configuration files for a particular 
  15192.   machine.  These are safe because they can't create new bugs on other 
  15193.   machines. 
  15194.  
  15195.   Please help us keep up with the workload by designing the patch in a form 
  15196.   that is clearly safe to install. 
  15197.  
  15198.  
  15199. ΓòÉΓòÉΓòÉ 33.11. How To Get Help with GNU Emacs ΓòÉΓòÉΓòÉ
  15200.  
  15201. If you need help installing, using or changing GNU Emacs, there are two ways to 
  15202. find it: 
  15203.  
  15204. o Send a message to a suitable network mailing list.  First try 
  15205.   bug-gnu-emacs@prep.ai.mit.edu, and if that brings no response, try 
  15206.   help-gnu-emacs@prep.ai.mit.edu. 
  15207.  
  15208. o Look in the service directory for someone who might help you for a fee. The 
  15209.   service directory is found in the file named `etc/SERVICE' in the Emacs 
  15210.   distribution. 
  15211.  
  15212.  
  15213. ΓòÉΓòÉΓòÉ 34. Command Line Options and Arguments ΓòÉΓòÉΓòÉ
  15214.  
  15215.  GNU Emacs supports command line arguments to request various actions when 
  15216. invoking Emacs.  These are for compatibility with other editors and for 
  15217. sophisticated activities.  We don't recommend using them for ordinary editing. 
  15218.  
  15219.  Arguments that are not options specify files to visit.  Emacs visits the 
  15220. specified files while it starts up.  (The last file name on your command line 
  15221. is the one you see displayed, but the rest are all there in other buffers.) 
  15222.  
  15223.  You can use options to specify other things, such as the size and position of 
  15224. the Emacs window if you are running it under the X Window System.  A few 
  15225. arguments support advanced usage, like running Lisp functions on files in batch 
  15226. mode. 
  15227.  
  15228.  There are two kinds of options: ordinary options and initial options. 
  15229. Ordinary options can appear in any order and can be intermixed with file names 
  15230. to visit.  These and file names are called ordinary arguments.  Emacs processes 
  15231. all of these in the order they are written.  Initial options must come at the 
  15232. beginning of the command line. 
  15233.  
  15234.  
  15235. ΓòÉΓòÉΓòÉ 34.1. Ordinary Arguments ΓòÉΓòÉΓòÉ
  15236.  
  15237.  Here is a table of the ordinary arguments and options: 
  15238.  
  15239. `file' 
  15240.           Visit file using find-file.  See Visiting. 
  15241.  
  15242. `+linenum file' 
  15243.           Visit file using find-file, then go to line number linenum in it. 
  15244.  
  15245. `-l file' 
  15246. `-load file' 
  15247.           Load a file file of Lisp code with the function load. See Lisp 
  15248.           Libraries. 
  15249.  
  15250. `-f function' 
  15251. `-funcall function' 
  15252.           Call Lisp function function with no arguments. 
  15253.  
  15254. `-insert file' 
  15255.           Insert the contents of file into the current buffer. This is like 
  15256.           what M-x insert-buffer does; See Misc File Ops. 
  15257.  
  15258. `-kill' 
  15259.           Exit from Emacs without asking for confirmation. 
  15260.  
  15261.  
  15262. ΓòÉΓòÉΓòÉ 34.2. Initial Options ΓòÉΓòÉΓòÉ
  15263.  
  15264.  The initial options are recognized only at the beginning of the command line. 
  15265. If you use more than one of them, they must appear in the order that they 
  15266. appear in this table. 
  15267.  
  15268. `-t device' 
  15269.           Use device as the device for terminal input and output. 
  15270.  
  15271. `-d display' 
  15272.           When running with the X window system, use the display named display 
  15273.           to make the window that serves as Emacs's terminal. 
  15274.  
  15275. `-batch' 
  15276.           Run Emacs in batch mode, which means that the text being edited is 
  15277.           not displayed and the standard Unix interrupt characters such as C-z 
  15278.           and C-c continue to have their normal effect.  Emacs in batch mode 
  15279.           outputs to stdout only what would normally be printed in the echo 
  15280.           area under program control. 
  15281.  
  15282.           Batch mode is used for running programs written in Emacs Lisp from 
  15283.           shell scripts, makefiles, and so on.  Normally the `-l' option or 
  15284.           `-f' option will be used as well, to invoke a Lisp program to do the 
  15285.           batch processing. 
  15286.  
  15287.           `-batch' implies `-q' (do not load an init file).  It also causes 
  15288.           Emacs to kill itself after all command options have been processed. 
  15289.           In addition, auto-saving is not done except in buffers for which it 
  15290.           has been explicitly requested. 
  15291.  
  15292. `-q' 
  15293. `-no-init-file' 
  15294.           Do not load your Emacs init file `~/.emacs'. 
  15295.  
  15296. `-u user' 
  15297. `-user user' 
  15298.           Load user's Emacs init file `~user/.emacs' instead of your own. 
  15299.  
  15300.  The init file can get access to the values of the command line arguments as 
  15301. the elements of a list in the variable command-line-args.  (The list contains 
  15302. only the arguments from the first table above.  Emacs processes the arguments 
  15303. from the second table before building the list.)  The init file can override 
  15304. the normal processing of the other arguments by setting this variable. 
  15305.  
  15306.  
  15307. ΓòÉΓòÉΓòÉ 34.3. Command Argument Example ΓòÉΓòÉΓòÉ
  15308.  
  15309.  Here is an example of using Emacs with arguments and options.  It assumes you 
  15310. have a Lisp program file called `hack-c.el' which, when loaded, performs some 
  15311. useful operation on current buffer, expected to be a C program. 
  15312.  
  15313. emacs -batch foo.c -l hack-c -f save-buffer -kill > log
  15314.  
  15315. This says to visit `foo.c', load `hack-c.el' (which makes changes in the 
  15316. visited file), save `foo.c' (note that save-buffer is the function that C-x C-s 
  15317. is bound to), and then exit to the shell that this command was done with.  The 
  15318. initial option `-batch' guarantees there will be no problem redirecting output 
  15319. to `log', because Emacs will not assume that it has a display terminal to work 
  15320. with. 
  15321.  
  15322.  
  15323. ΓòÉΓòÉΓòÉ 34.4. Resuming Emacs with Arguments ΓòÉΓòÉΓòÉ
  15324.  
  15325.  You can specify ordinary arguments for Emacs when you resume it after a 
  15326. suspension.  To prepare for this, put the following code in your `.emacs' file 
  15327. (see Hooks): 
  15328.  
  15329. (add-hook 'suspend-hook 'resume-suspend-hook)
  15330.  
  15331.  As further preparation, you must execute the shell script `emacs.csh' (if you 
  15332. use CSH as your shell) or `emacs.bash' (if you use BASH as your shell).  These 
  15333. scripts define an alias named edit, which will resume Emacs give it new command 
  15334. line arguments such as files to visit. 
  15335.  
  15336.  Only ordinary arguments work properly when you resume Emacs.  Initial 
  15337. arguments are not recognized.  It's too late to execute them anyway. 
  15338.  
  15339.  Note that resuming Emacs (with or without arguments) must be done from within 
  15340. the shell that is the parent of the Emacs job.  This is why edit is an alias 
  15341. rather than a program or a shell script.  It is not possible to implement a 
  15342. resumption command that could be run from other subjobs of the shell; no way to 
  15343. define a command that could be made the value of EDITOR, for example. 
  15344. Therefore, this feature does not take the place of the the Emacs Server 
  15345. feature. See Emacs Server. 
  15346.  
  15347.  The aliases use the Emacs Server feature if you appear to have a server Emacs 
  15348. running.  However, they cannot determine this with complete accuracy.  They may 
  15349. think that a server is still running when in actuality you have killed that 
  15350. Emacs, because the file `/tmp/.esrv...' still exists.  If this happens, find 
  15351. that file and delete it. 
  15352.  
  15353.  
  15354. ΓòÉΓòÉΓòÉ 34.5. Specifying the Display Name ΓòÉΓòÉΓòÉ
  15355.  
  15356.  The environment variable DISPLAY tells all X clients where to display their 
  15357. windows.  Its value is set up by default in ordinary circumstances, when you 
  15358. start an X server and run jobs locally. Occasionally you may need to specify 
  15359. the display yourself; for example, if you do a remote login and want to run a 
  15360. client program remotely, displaying on your local screen. 
  15361.  
  15362.  With Emacs, the main reason people change the default display is to let them 
  15363. log into another system, run Emacs on that system, but have the window 
  15364. displayed at their local terminal.  You might need to use login to another 
  15365. system because the files you want to edit are there, or because the Emacs 
  15366. executable file you want to run is there. 
  15367.  
  15368.  The syntax of the DISPLAY environment variable is: 
  15369.  
  15370. host:display.screen
  15371.  
  15372. where host is the host name of the X Window System server machine, display is 
  15373. an arbitrarily-assigned number that distinguishes your server (X terminal) from 
  15374. other servers on the same machine, and screen is a rarely-used field that 
  15375. allows an X server to control multiple terminal screens.  The period and the 
  15376. screen field are optional.  If included, screen is usually zero. 
  15377.  
  15378.  If your host is named `glasperle' and your server is the first (or perhaps the 
  15379. only) server listed in the configuration, your DISPLAY is `glasperle:0.0'. 
  15380.  
  15381.  You can specify the display name explicitly when you run Emacs, either by 
  15382. changing the DISPLAY variable, or with the option `-d display' or `-display 
  15383. display'.  These are initial options; they must come at the beginning of the 
  15384. command line. See Initial Options.  Here is an example: 
  15385.  
  15386. emacs -display glasperle:0 &
  15387.  
  15388.  You can inhibit the direct use of X with the `-nw' option.  This is also an 
  15389. initial option.  This option tells Emacs to display using ordinary ASCII on its 
  15390. controlling terminal. 
  15391.  
  15392.  Sometimes, security arrangements prevent a program on a remote system from 
  15393. displaying on your local system.  In this case, trying to run Emacs produces 
  15394. messages like: 
  15395.  
  15396. Xlib:  connection to "glasperle:0.0" refused by server
  15397.  
  15398.  You might be able to overcome this problem by using the xhost command on the 
  15399. local system to give permission for access from your remote machine. 
  15400.  
  15401.  
  15402. ΓòÉΓòÉΓòÉ 34.6. Font Specification Options ΓòÉΓòÉΓòÉ
  15403.  
  15404.  By default, Emacs displays text in the font named `9x15', which makes each 
  15405. character nine pixels wide and fifteen pixels high.  You can specify a 
  15406. different font on your command line through the option `-fn name'.  The `-font' 
  15407. option is a synonym for `-fn'. 
  15408.  
  15409.  Here is how to specify the font `6x13': 
  15410.  
  15411. emacs -fn 6x13 &
  15412.  
  15413. You can also do this in your `.Xdefaults' file: 
  15414.  
  15415. emacs.font:      6x13
  15416.  
  15417.  Use only fixed width fonts---that is, fonts in which all characters have the 
  15418. same width.  Emacs cannot yet handle display properly for variable width fonts. 
  15419. Fixed width fonts include the one named `fixed', and fonts with names in the 
  15420. form nxn, such as `6x13', `8x13', and `9x15'.  Under the font-naming 
  15421. conventions in X11 Release 4 or later, any font with `m' or `c' in the eleventh 
  15422. field of the name is a fixed width font. 
  15423.  
  15424.  Here's how to use the xlsfonts program to list all the fixed width fonts 
  15425. available on your system: 
  15426.  
  15427. xlsfonts -fn '*x*'
  15428. xlsfonts -fn '*-*-*-*-*-*-*-*-*-*-*-m*'
  15429. xlsfonts -fn '*-*-*-*-*-*-*-*-*-*-*-c*'
  15430.  
  15431. To see what a particular font looks like, use the xfd command. For example: 
  15432.  
  15433. xfd -fn 6x13
  15434.  
  15435. displays the entire font `6x13'. 
  15436.  
  15437.  While running Emacs, you can set the font of the current frame (see Frame 
  15438. Parameters) or for a specific kind of text (see Faces). 
  15439.  
  15440.  
  15441. ΓòÉΓòÉΓòÉ 34.7. Window Color Options ΓòÉΓòÉΓòÉ
  15442.  
  15443.  On a color display, you can specify which color to use for various parts of 
  15444. the Emacs display.  To find out what colors are available on your system, look 
  15445. at the `/usr/lib/X11/rgb.txt' file.  If you do not specify colors, the default 
  15446. for the background is white and the default for all other colors is black. 
  15447.  
  15448.  On a monochrome (black and white) display, the foreground is black, the 
  15449. background is white, and the border is grey.  You can reverse the foreground 
  15450. and background colors through the `-r' option or the `reverseVideo' resource. 
  15451.  
  15452.  Here is a list of the options for specifying colors: 
  15453.  
  15454. `-fg color' 
  15455.           Specify the foreground color. 
  15456.  
  15457. `-bg color' 
  15458.           Specify the background color. 
  15459.  
  15460. `-bd color' 
  15461.           Specify the color of the border of the X window. 
  15462.  
  15463. `-cr color' 
  15464.           Specify the color of the Emacs cursor which indicates where point is. 
  15465.  
  15466. `-ms color' 
  15467.           Specify the color for the mouse cursor when the mouse is in the Emacs 
  15468.           window. 
  15469.  
  15470.  For example, to use a coral mouse cursor and a slate blue text cursor, enter: 
  15471.  
  15472. emacs -ms coral -cr 'slate blue' &
  15473.  
  15474.  
  15475. ΓòÉΓòÉΓòÉ 34.8. Options for Window Geometry ΓòÉΓòÉΓòÉ
  15476.  
  15477.  The `-geometry' option controls the size and position of the initial Emacs 
  15478. frame.  Here is the format for specifying the window geometry: 
  15479.  
  15480. widthxheight{+-}xoffset{+-}yoffset
  15481.  
  15482. where width specifies the number of characters displayed on a line, height 
  15483. specifies the number of lines displayed, a positive xoffset specifies the 
  15484. distance from the left side of the screen, a negative xoffset specifies the 
  15485. distance from the right side of the screen, a positive yoffset specifies the 
  15486. distance from the top of the screen, and a negative yoffset specifies the 
  15487. distance from the bottom of the screen. 
  15488.  
  15489.  Emacs uses the same units as xterm does to interpret the geometry. The width 
  15490. and height are measured in characters, so a large font creates a larger frame 
  15491. than a small font.  The xoffset and yoffset are measured in pixels. 
  15492.  
  15493.  Since the the mode line and the echo area occupy the last 2 lines of the 
  15494. frame, the height of the initial text window is 2 less than the height 
  15495. specified in your geometry. 
  15496.  
  15497.  You do not have to specify all of the fields in the geometry specification. 
  15498. The default width for Emacs is 80 characters and the default height is 24 
  15499. characters.  You can omit either the width or the height or both. 
  15500.  
  15501.  If you omit both xoffset nor yoffset, the window manager decides where to put 
  15502. the Emacs frame, possibly by letting you place it with the mouse.  For example, 
  15503. `164x55' specifies a window 164 columns wide, enough for two ordinary width 
  15504. windows side by side, and 55 lines tall. 
  15505.  
  15506.  If you start the geometry with an integer, Emacs interprets it as the width. 
  15507. If you start with an `x' followed by an integer, Emacs interprets it as the 
  15508. height.  Thus, `81' specifies just the width; `x45' specifies just the height. 
  15509.  
  15510.  If you start with `+' or `-', that introduces an offset, which means both 
  15511. sizes are omitted.  Thus, `-3' specifies the xoffset only.  (If you give just 
  15512. one offset, it is always xoffset.)  `+3-3' specifies both the xoffset and the 
  15513. yoffset, placing the frame near the bottom left of the screen. 
  15514.  
  15515.  You can specify a default for any or all of the fields in `.Xdefaults' file, 
  15516. and then override selected fields through a `-geometry' option. 
  15517.  
  15518.  
  15519. ΓòÉΓòÉΓòÉ 34.9. Internal and External Borders ΓòÉΓòÉΓòÉ
  15520.  
  15521.  An Emacs frame has an internal border and an external border.  The internal 
  15522. border is an extra strip of the background color around all four edges of the 
  15523. frame.  Emacs itself adds the internal border.  The external border is added by 
  15524. the window manager outside the internal border; it may contain various boxes 
  15525. you can click on to move or iconify the window. 
  15526.  
  15527.  When you specify the size of the frame, that does not count the borders.  The 
  15528. frame's position is measured from the outside edge of the external border. 
  15529.  
  15530.  Use the `-ib n' option to specify an internal border n pixels wide.  The 
  15531. default is 1.  Use `-b n' to specify the width of the external border (though 
  15532. the window manager may add to this on certain edges).  The default width of the 
  15533. external border is 2. 
  15534.  
  15535.  
  15536. ΓòÉΓòÉΓòÉ 34.10. Icons ΓòÉΓòÉΓòÉ
  15537.  
  15538.  Most window managers allow the user to ``iconify'' a frame, removing it from 
  15539. sight, and leaving a small, distinctive ``icon'' window in its place.  Clicking 
  15540. on the icon window will make the original frame visible again.  If a user has 
  15541. many clients running at once, they can avoid cluttering up their screen by 
  15542. iconifying all but the clients currently in use. 
  15543.  
  15544.  The `-i' and `-itype' option tells Emacs to use an icon window containing a 
  15545. picture of the GNU gnu.  If omitted, Emacs lets the window manager choose what 
  15546. sort of icon to use --- usually just a small rectangle containing the frame's 
  15547. title. 
  15548.  
  15549.  The `-iconic' option tells Emacs to begin running as an icon, rather than 
  15550. opening a frame right away.  In this situation, the icon window provides only 
  15551. indication that Emacs has started; the usual text frame doesn't appear until 
  15552. you de-iconify it. 
  15553.  
  15554.  
  15555. ΓòÉΓòÉΓòÉ 34.11. X Resources ΓòÉΓòÉΓòÉ
  15556.  
  15557.  Programs running under the X Window System organize their user options under a 
  15558. hierarchy of classes and resources.  You can specify default values for these 
  15559. options in your X resources file, usually named `~/.Xdefaults'. 
  15560.  
  15561.  Each line in the file specifies a value for one option or for a collection of 
  15562. related options, for one program or for several programs (perhaps even all 
  15563. programs). 
  15564.  
  15565.  Programs define named resources with particular meanings.  They also define 
  15566. how to group resources into named classes.  For instance, in Emacs, the 
  15567. `internalBorder' resource controls the width of the internal border, and the 
  15568. `borderWidth' resource controls the width of the external border.  Both of 
  15569. these resources are part of the `BorderWidth' class.  Case distinctions are 
  15570. significant in these names. 
  15571.  
  15572.  In `~/.Xdefaults', you can specify a value for a single resource on one line, 
  15573. like this: 
  15574.  
  15575. emacs.borderWidth: 2
  15576.  
  15577. Or you can use a class name to specify the same value for all resources in that 
  15578. class.  Here's an example: 
  15579.  
  15580. emacs.BorderWidth: 2
  15581.  
  15582.  If you specify a value for a class, it becomes the default for all resources 
  15583. in that class.  You can specify values for individual resources as well; these 
  15584. override the class value, for those particular resources.  Thus, this example 
  15585. specifies 2 as the default width for all borders, but overrides this value with 
  15586. 4 for the external border: 
  15587.  
  15588. emacs.Borderwidth: 2
  15589. emacs.borderwidth: 4
  15590.  
  15591.  The order in which the lines appear in the file does not matter. Also, 
  15592. command-line options always override the X resources file. 
  15593.  
  15594.  The string `emacs' in the examples above is also a resource name.  It actually 
  15595. represents the name of the executable file that you invoke to run Emacs.  If 
  15596. Emacs is installed under a different name, it look for resources under that 
  15597. name instead of `emacs'. 
  15598.  
  15599.  You can tell Emacs to use a different name instead of the name of the 
  15600. executable file, with the option `-rn name'.  Then that Emacs job uses name 
  15601. instead of `Emacs' to look up all of its option values in the X resource file. 
  15602.  
  15603.  The resources that name Emacs invocations also belong to a class; its name is 
  15604. `Emacs'.  To specify options for all Emacs jobs, no matter what name is used to 
  15605. run them, write `Emacs' instead of `emacs', like this: 
  15606.  
  15607. Emacs.BorderWidth: 2
  15608. Emacs.borderWidth: 4
  15609.  
  15610.  The following table lists the resource names that designate options for Emacs, 
  15611. each with the class that it belongs to: 
  15612.  
  15613. background (class Background) 
  15614.           Background color name. 
  15615.  
  15616. bitmapIcon (class BitMapIcon) 
  15617.           Use kitchen sink icon if `on', let the window manager choose an icon 
  15618.           if `off'. 
  15619.  
  15620. borderColor (class BorderColor) 
  15621.           Color name for external border. 
  15622.  
  15623. borderWidth (class BorderWidth) 
  15624.           Width in pixels of external border. 
  15625.  
  15626. cursorColor (class Foreground) 
  15627.           Color name for text cursor (point). 
  15628.  
  15629. font (class Font) 
  15630.           Font name for text. 
  15631.  
  15632. foreground (class Foreground) 
  15633.           Color name for text. 
  15634.  
  15635. geometry (class Geometry) 
  15636.           Window size and position. 
  15637.  
  15638. iconName (class Title) 
  15639.           Name to display in icon. 
  15640.  
  15641. internalBorder (class BorderWidth) 
  15642.           Width in pixels of internal border. 
  15643.  
  15644. paneFont (class Font) 
  15645.           Font name for menu pane titles. 
  15646.  
  15647. pointerColor (class Foreground) 
  15648.           Color of mouse cursor. 
  15649.  
  15650. reverseVideo (class ReverseVideo) 
  15651.           Switch foreground and background default colors if `on', use colors 
  15652.           as specified if `off'. 
  15653.  
  15654. selectionFont (class Font) 
  15655.           Font name for menu items. 
  15656.  
  15657. title (class Title) 
  15658.           Name to display in title bar of initial Emacs frame. 
  15659.  
  15660.  
  15661. ΓòÉΓòÉΓòÉ 35. Emacs 18 Antinews ΓòÉΓòÉΓòÉ
  15662.  
  15663. For those users who live backwards in time, here is information about 
  15664. downgrading to Emacs version 18.  We hope you will enjoy the greater simplicity 
  15665. that results from the absence of many Emacs 19 features. 
  15666.  
  15667.  
  15668. ΓòÉΓòÉΓòÉ 35.1. Packages Removed ΓòÉΓòÉΓòÉ
  15669.  
  15670. To reduce the size of the distribution, we have eliminated numerous packages 
  15671. including GNUS, VC (version control), Hexl (for editing binary files), Edebug, 
  15672. Emerge, Mpuz, Spook, and Gomoku. 
  15673.  
  15674. Major modes removed in Emacs 18 include C++ mode, Awk mode, Icon mode, Asm 
  15675. mode, Makefile mode, Perl mode and SGML mode. 
  15676.  
  15677. The function enable-flow-control does not exist; see the file `PROBLEMS' in the 
  15678. Emacs distribution for directions for coping with flow control. 
  15679.  
  15680. The Calendar feature provided is a very simple one.  All it can do is display 
  15681. three months, by default centered around the current month. If you give it a 
  15682. numeric argument, that specifies the number of months forward or back. 
  15683.  
  15684.  
  15685. ΓòÉΓòÉΓòÉ 35.2. Fundamental Changes ΓòÉΓòÉΓòÉ
  15686.  
  15687. Auto save and garbage collection happen only while you are typing, never while 
  15688. you are idle.  This is to make them more like affectionate pets.  Think of them 
  15689. as cats that like to sit on your terminal only when you are working there. 
  15690.  
  15691. Transient Mark mode and Line Number mode are absent in Emacs 18.  If you are an 
  15692. Emacs user, you are smart enough to keep track of the mark in your head, and 
  15693. you don't need line numbers because you can search for precisely the text you 
  15694. want. 
  15695.  
  15696. There are no menu bars or scroll bars; no faces, text properties or overlays. 
  15697.  
  15698. There are no minibuffer history commands. 
  15699.  
  15700. There is only one frame, so the Emacs 19 C-x 5 command series is meaningless. 
  15701. Instead, C-x 5 in Emacs 18 splits the selected window horizontally (like C-x 3 
  15702. in Emacs 19). 
  15703.  
  15704. Another simplification in Emacs 18 is that all input events are characters. 
  15705. Function keys and arrow keys are represented as sequences of characters; the 
  15706. terminal-specific Emacs Lisp file for your terminal is responsible for defining 
  15707. them.  Mouse buttons are defined by a special keymap, mouse-map.  See the file 
  15708. `x-mouse.el' for how to bind mouse clicks. 
  15709.  
  15710. Character codes 128 and above always display using `\nnn' notation.  For codes 
  15711. 0 through 31, you can choose between `\nnn' and `^c' by setting the variable 
  15712. ctl-arrow; but that is the only thing you can specify about how character codes 
  15713. should display. 
  15714.  
  15715. You can't refer to files on other machines using special ``magic'' file names. 
  15716. Instead, you must use the ftp library with commands such as M-x ftp-find-file 
  15717. and M-x ftp-write-file. 
  15718.  
  15719. The character for terminating an incremental search is now ESC, not RET as in 
  15720. Emacs 19.  If you type RET, that searches for a newline; thus, you can insert a 
  15721. newline in the search string just as you would insert it in the text. 
  15722.  
  15723.  
  15724. ΓòÉΓòÉΓòÉ 35.3. Key Binding Changes ΓòÉΓòÉΓòÉ
  15725.  
  15726. The key for backward-paragraph is now M-[.  The key for forward-paragraph is 
  15727. now M-]. 
  15728.  
  15729. The command repeat-complex-command is now on C-x ESC. 
  15730.  
  15731. The register commands have different key bindings: 
  15732.  
  15733. C-x / 
  15734.           point-to-register 
  15735.  
  15736. C-x j 
  15737.           jump-to-register 
  15738.  
  15739. C-x x 
  15740.           copy-to-register 
  15741.  
  15742. C-x g 
  15743.           insert-register 
  15744.  
  15745. C-x r 
  15746.           copy-rectangle-to-register 
  15747.  
  15748. The narrowing commands have also been moved: 
  15749.  
  15750. C-x n 
  15751.           narrow-to-region 
  15752.  
  15753. C-x p 
  15754.           narrow-to-page 
  15755.  
  15756. C-x w 
  15757.           widen 
  15758.  
  15759. And the abbrev commands as well: 
  15760.  
  15761. C-x C-a 
  15762.           add-mode-abbrev 
  15763.  
  15764. C-x + 
  15765.           add-global-abbrev 
  15766.  
  15767. C-x C-h 
  15768.           inverse-add-mode-abbrev 
  15769.  
  15770. C-x - 
  15771.           inverse-add-global-abbrev 
  15772.  
  15773. C-x ` 
  15774.           expand-abbrev 
  15775.  
  15776. There are no key bindings for the rectangle commands. 
  15777.  
  15778. C-x a now runs the command append-to-buffer. 
  15779.  
  15780. The key bindings C-x 4 r and C-x 4 C-o do not exist. 
  15781.  
  15782. The help commands C-h C-f, C-h C-k and C-h p do not exist in Emacs 18. 
  15783.  
  15784. The command C-M-l (reposition-window) is absent. Likewise C-M-r 
  15785. (isearch-backward-regexp). 
  15786.  
  15787. The ``two column'' commands starting with C-x 6 don't exist in Emacs 18. 
  15788.  
  15789. The TeX mode bindings of C-c { and C-c } have been moved to M-{ and M-}. 
  15790. (These commands are up-list and tex-insert-braces; they are the TeX equivalents 
  15791. of M-( and M-).) 
  15792.  
  15793.  
  15794. ΓòÉΓòÉΓòÉ 35.4. Incremental Search Changes ΓòÉΓòÉΓòÉ
  15795.  
  15796. As mentioned above, the character for terminating an incremental search is now 
  15797. ESC, not RET as in Emacs 19.  If you type RET, that searches for a newline; 
  15798. thus, you can insert a newline in the search string just as you would insert it 
  15799. in the text. 
  15800.  
  15801. There is no ring of previous search strings in Emacs 18.  You can reuse the 
  15802. most recent search string, but that's all. 
  15803.  
  15804. If case-fold-search is non-nil, then incremental search is always 
  15805. case-insensitive.  Typing an upper-case letter in the search string has no 
  15806. effect on this. 
  15807.  
  15808. Spaces in the incremental search string match only spaces. 
  15809.  
  15810. The meanings of the special search characters are no longer controlled by a 
  15811. keymap.  Instead, particular variables named search-...-char specify the 
  15812. character that should have a particular function. For example, C-s repeats the 
  15813. search because the value of search-repeat-char is ?\C-s. 
  15814.  
  15815.  
  15816. ΓòÉΓòÉΓòÉ 35.5. Editing Command Changes ΓòÉΓòÉΓòÉ
  15817.  
  15818. C-n (next-line) does not check the variable next-line-add-newlines. 
  15819.  
  15820. The sexp commands such as C-M-f no longer know anything about comments, in 
  15821. modes such as Lisp mode where the end of a comment is the end of the line. 
  15822. They treat the text inside a comment as if it were actual code.  If comments 
  15823. containing unbalanced parentheses cause trouble, you can use the commands C-M-n 
  15824. and C-M-p, which do ignore comments. 
  15825.  
  15826. You can't store file names in registers, and there are no frame configurations 
  15827. at all.  The command M-x string-rectangle does not exist either. 
  15828.  
  15829. The undo command in Emacs 18 is not careful about where to leave point when you 
  15830. undo a deletion.  It ends up at one end or the other of the text just 
  15831. undeleted.  You must be on the lookout for this, and move point appropriately. 
  15832.  
  15833. Kill commands do nothing useful in read-only buffers.  They just beep. 
  15834.  
  15835. M-z c in Emacs 18 kills up to but not including the first occurrence of c.  If 
  15836. c does not occur in the buffer after point, M-z kills the whole rest of the 
  15837. buffer. 
  15838.  
  15839. The function erase-buffer is not a command in Emacs 18.  You can call it from a 
  15840. Lisp program, but not interactively.  The motivation for this is to protect you 
  15841. from accidentally deleting (not killing) the entire text of a buffer that you 
  15842. want to keep.  With subsequent changes in even earlier Emacs versions (such as 
  15843. version 18.54), you might be unable to undo the erase-buffer. 
  15844.  
  15845. M-x fill-nonuniform-paragraphs and Adaptive Fill mode do not exist. 
  15846.  
  15847.  
  15848. ΓòÉΓòÉΓòÉ 35.6. Other Brief Notes ΓòÉΓòÉΓòÉ
  15849.  
  15850. Outline mode exists only as a major mode, not as a minor mode. 
  15851.  
  15852. M-! (shell-command) always runs the command synchronously, even if the command 
  15853. ends with `&'. 
  15854.  
  15855. Emacs 18 has no special mode for change log files.  It is a good idea to use 
  15856. Indented Text mode, and specify 8 as the value of the variable left-margin. 
  15857.  
  15858. The command M-x comment-region does not exist. The command M-x super-apropos 
  15859. does not exist. 
  15860.  
  15861. C-x q (kbd-macro-query) now uses C-d to terminate all iterations of the 
  15862. keyboard macro, rather than ESC. 
  15863.  
  15864. The M-x setenv command is missing in Emacs 18. 
  15865.  
  15866. M-$ now uses the Unix spell program instead of the GNU program Ispell.  If the 
  15867. word around point is a misspelling, it asks you for a replacement. 
  15868.  
  15869. To check spelling of larger units of text, use M-x spell-region or M-x 
  15870. spell-buffer.  These commands check all words in the specified piece of text. 
  15871. For each word that is not correct, they ask you to specify a replacement, and 
  15872. then replace each occurrence. 
  15873.  
  15874. M-x gdb still exists in Emacs 18.  M-x dbx exists, but is somewhat different 
  15875. (use C-h m to find the details).  M-x sdb does not exist at all, but who wants 
  15876. to use SDB? 
  15877.  
  15878. In Buffer Menu mode, the commands % and C-o don't work in Emacs 18.  The v 
  15879. command has been eliminated and merged with the q command, which now exits the 
  15880. buffer menu, displaying all the buffers that you have marked. 
  15881.  
  15882. The View commands (such as M-x view-buffer and M-x view-file) now use recursive 
  15883. edits.  When you exit viewing, the recursive edit returns to its caller. 
  15884.  
  15885. Emacs 18, like most programs, interprets command line options only when it is 
  15886. started--not later on. 
  15887.  
  15888. The variable to control whether files can set local variables is called 
  15889. inhibit-local-variables.  A non-nil value means ask the user before obeying any 
  15890. local variables lists. 
  15891.  
  15892. The user option for controlling use of the eval local variable is now called 
  15893. inhibit-local-eval.  A non-nil value means to ask the user before obeying any 
  15894. eval local variable. 
  15895.  
  15896.  
  15897. ΓòÉΓòÉΓòÉ 35.7. File Handling Changes ΓòÉΓòÉΓòÉ
  15898.  
  15899. As mentioned above, you can't refer to files on other machines using special 
  15900. ``magic'' file names.  Instead, you must use the ftp library with commands such 
  15901. as M-x ftp-find-file and M-x ftp-write-file. 
  15902.  
  15903. When you run M-x revert-buffer with no prefix argument, if the buffer has an 
  15904. auto save file more recent that the visited file, revert-buffer asks whether to 
  15905. revert from the auto save file instead. 
  15906.  
  15907. When C-x s (save-some-buffers) offers to save each buffer, you have only two 
  15908. choices: save it, or don't save it. 
  15909.  
  15910. M-x recover-file turns off Auto Save mode in the current buffer. To turn it on 
  15911. again, use M-x auto-save-mode. 
  15912.  
  15913. The command M-x rename-uniquely does not exist; instead, use M-x rename-buffer 
  15914. and try various names until you find one that isn't in use.  Completion can 
  15915. make this easier. 
  15916.  
  15917. The directory name abbreviation feature is gone in Emacs 18. 
  15918.  
  15919. Emacs 18 has no idea of file truenames, and does not try to detect when you 
  15920. visit a file via a symbolic link.  You should check manually when you visit a 
  15921. file, so as to edit it in the directory where it is actually stored.  This way 
  15922. you can make sure that backup files and change log entries go in the proper 
  15923. directory. 
  15924.  
  15925. M-x compare-windows ignores any prefix argument and always considers case and 
  15926. whitespace differences significant.  As for the other ways of comparing files, 
  15927. M-x diff and M-x diff-backup, they don't exist at all. 
  15928.  
  15929.  
  15930. ΓòÉΓòÉΓòÉ 35.8. Mail Changes ΓòÉΓòÉΓòÉ
  15931.  
  15932. `%' is now a word-component character in Mail mode.  This is to be compatible 
  15933. with Text mode. 
  15934.  
  15935. The variable mail-signature is not meaningful; if you wish to insert your 
  15936. signature in a mail message, you must type C-c C-w. 
  15937.  
  15938. Mail aliases expand only when you send the message---never when you type them 
  15939. in. 
  15940.  
  15941. Rmail now gets new mail into your primary mail file from `~/mbox' as well as 
  15942. from your system inbox file.  This is handy if you occasionally check your 
  15943. newest mail with the mail program; whatever you have looked at and saved with 
  15944. mail will be brought into Rmail the next time you run Rmail. 
  15945.  
  15946. The Rmail summary buffer is now much simpler.  Only a few special commands are 
  15947. available there: n, p, and j for motion, d and u for deletion, and SPC and DEL 
  15948. for scrolling the message.  To do anything else, you must go to the Rmail 
  15949. buffer.  Also, changes in the Rmail buffer don't update the summary; to do 
  15950. that, you must make a new summary. 
  15951.  
  15952. The Rmail command rmail-resend (accessible via f with a prefix argument in 
  15953. Emacs 19) does not exist in Emacs 18.  Neither does rmail-retry-failure (M-m in 
  15954. Emacs 19). 
  15955.  
  15956. The e command is now ``expunge'', just like x.  To edit the current message, 
  15957. type w, which works in Emacs 19 as well. If you type e meaning to edit, and it 
  15958. expunges instead---well, you shouldn't have deleted those messages if you still 
  15959. wanted them. 
  15960.  
  15961. The < and b commands have been removed in Emacs 18. Likewise C-M-t 
  15962. (rmail-summarize-by-topic) and M-x unrmail.  Rmail in Emacs 18 is so good, that 
  15963. we can't imagine anyone who has tried it would ever wish to use another mail 
  15964. reader. 
  15965.  
  15966. The default output file for o is now always the last file that you used with o. 
  15967. The variable rmail-output-file-alist has no special meaning. 
  15968.  
  15969. Emacs 18 Rmail does not know anything about Content Length fields in messages. 
  15970.  
  15971.  
  15972. ΓòÉΓòÉΓòÉ 35.9. C Mode Changes ΓòÉΓòÉΓòÉ
  15973.  
  15974. In C mode, the keys M-a and M-e now have their usual meanings: motion by 
  15975. sentences.  This is useful while editing the comments in a C program, but not 
  15976. useful for editing code.  We hope this will encourage you to write lots of 
  15977. comments. 
  15978.  
  15979. The commands M-x c-up-conditional and M-x c-backslash-region have been removed 
  15980. entirely in Emacs 18. 
  15981.  
  15982.  
  15983. ΓòÉΓòÉΓòÉ 35.10. Compilation Changes ΓòÉΓòÉΓòÉ
  15984.  
  15985. M-x compile now has a much simpler and faster parser for error messages. 
  15986. However, it understands fewer different formats for error messages, and is not 
  15987. as easy to customize. 
  15988.  
  15989. There is no special mode for compilation buffers.  When you select the 
  15990. compilation buffer itself, it is just ordinary text. 
  15991.  
  15992. Speaking of selecting the compilation buffer, you do need to do that from time 
  15993. to time to see whether the compilation has finished, because Emacs 18 does not 
  15994. display `Compiling' in the mode line to tell you the compilation is still 
  15995. going. 
  15996.  
  15997.  
  15998. ΓòÉΓòÉΓòÉ 35.11. Shell Mode ΓòÉΓòÉΓòÉ
  15999.  
  16000. Shell mode in Emacs 18 does nothing special for the keys TAB, M-?, C-a, C-d. 
  16001. The commands M-x dirs and M-x send-invisible are also gone. 
  16002.  
  16003. The history commands M-p and so on are not available either; instead, use C-c 
  16004. C-y (copy-last-shell-input).  This copies the previous bunch of shell input, 
  16005. and inserts it into the buffer before point.  No final newline is inserted, and 
  16006. the input copied is not resubmitted until you type RET. 
  16007.  
  16008. Use C-c C-d to send an ``end of file'' to the shell process. 
  16009.  
  16010.  
  16011. ΓòÉΓòÉΓòÉ 35.12. Dired Changes ΓòÉΓòÉΓòÉ
  16012.  
  16013. For simplicity, Dired in Emacs 18 supports just one kind of mark: the deletion 
  16014. flag, `*'.  The Emacs 19 Dired commands for flagging files do work in Emacs 18, 
  16015. but all the other mark-related commands do not. 
  16016.  
  16017. The Dired subdirectory commands don't exist in Emacs 18.  A Dired buffer can 
  16018. contain only one directory.  In particular, this means that the variable 
  16019. dired-listing-switches must not contain the `R' option.  (The `F' option is 
  16020. also not allowed.) 
  16021.  
  16022. The commands for using find with Dired have been removed for simplicity, also. 
  16023.  
  16024. Emacs 18 Dired provides the following commands for manipulating files 
  16025. immediately, and no others.  All of these commands apply to the file listed on 
  16026. the current line. 
  16027.  
  16028.           Copies the file described on the current line.  You must supply a 
  16029.           file name to copy to, using the minibuffer. 
  16030.  
  16031.           Visits the file described on the current line.  It is just like 
  16032.           typing C-x C-f and supplying that file name.  If the file on this 
  16033.           line is a subdirectory, f actually causes Dired to be invoked on that 
  16034.           subdirectory. 
  16035.  
  16036.           Change the group of the file described on the current line. 
  16037.  
  16038.           Change the file mode of the file described on the current line. 
  16039.  
  16040.           Like f, but uses another window to display the file's buffer.  The 
  16041.           Dired buffer remains visible in the first window.  This is like using 
  16042.           C-x 4 C-f to visit the file. 
  16043.  
  16044.           Change the owner of the file described on the current line. (On most 
  16045.           systems, you must be a superuser to do this.) 
  16046.  
  16047.           Renames the file described on the current line.  You must supply a 
  16048.           file name to rename to, using the minibuffer. 
  16049.  
  16050.           Views the file described on this line using M-x view-file.  Viewing a 
  16051.           file is like visiting it, but is slanted toward moving around in the 
  16052.           file conveniently and does not allow changing the file. 
  16053.  
  16054.  
  16055. ΓòÉΓòÉΓòÉ 36. The GNU Manifesto ΓòÉΓòÉΓòÉ
  16056.  
  16057. The GNU Manifesto which appears below was written by Richard Stallman at the 
  16058. beginning of the GNU project, to ask for participation and support. For the 
  16059. first few years, it was updated in minor ways to account for developments, but 
  16060. now it seems best to leave it unchanged as most people have seen it. 
  16061.  
  16062. Since that time, we have learned about certain common misunderstandings that 
  16063. different wording could help avoid.  Footnotes help clarify these points. 
  16064.  
  16065. For up-to-date information about the available GNU software, please see the 
  16066. latest issue of the GNU's Bulletin.  The list is much too long to include here. 
  16067.  
  16068.  
  16069. ΓòÉΓòÉΓòÉ 36.1. What's GNU?  Gnu's Not Unix! ΓòÉΓòÉΓòÉ
  16070.  
  16071. GNU, which stands for Gnu's Not Unix, is the name for the complete 
  16072. Unix-compatible software system which I am writing so that I can give it away 
  16073. free to everyone who can use it. (The wording here was careless.  The intention 
  16074. was that nobody would have to pay for permission to use the GNU system.  But 
  16075. the words don't make this clear, and people often interpret them as saying that 
  16076. copies of GNU should always be distributed at little or no charge.  That was 
  16077. never the intent; later on, the manifesto mentions the possibility of companies 
  16078. providing the service of distribution for a profit.  Subsequently I have 
  16079. learned to distinguish carefully between ``free'' in the sense of freedom and 
  16080. ``free'' in the sense of price.  Free software is software that users have the 
  16081. freedom to distribute and change.  Some users may obtain copies at no charge, 
  16082. while others pay to obtain copies---and if the funds help support improving the 
  16083. software, so much the better.  The important thing is that everyone who has a 
  16084. copy has the freedom to cooperate with others in using it.)  Several other 
  16085. volunteers are helping me.  Contributions of time, money, programs and 
  16086. equipment are greatly needed. 
  16087.  
  16088. So far we have an Emacs text editor with Lisp for writing editor commands, a 
  16089. source level debugger, a yacc-compatible parser generator, a linker, and around 
  16090. 35 utilities.  A shell (command interpreter) is nearly completed.  A new 
  16091. portable optimizing C compiler has compiled itself and may be released this 
  16092. year.  An initial kernel exists but many more features are needed to emulate 
  16093. Unix.  When the kernel and compiler are finished, it will be possible to 
  16094. distribute a GNU system suitable for program development.  We will use TeX as 
  16095. our text formatter, but an nroff is being worked on.  We will use the free, 
  16096. portable X window system as well.  After this we will add a portable Common 
  16097. Lisp, an Empire game, a spreadsheet, and hundreds of other things, plus on-line 
  16098. documentation.  We hope to supply, eventually, everything useful that normally 
  16099. comes with a Unix system, and more. 
  16100.  
  16101. GNU will be able to run Unix programs, but will not be identical to Unix. We 
  16102. will make all improvements that are convenient, based on our experience with 
  16103. other operating systems.  In particular, we plan to have longer file names, 
  16104. file version numbers, a crashproof file system, file name completion perhaps, 
  16105. terminal-independent display support, and perhaps eventually a Lisp-based 
  16106. window system through which several Lisp programs and ordinary Unix programs 
  16107. can share a screen.  Both C and Lisp will be available as system programming 
  16108. languages.  We will try to support UUCP, MIT Chaosnet, and Internet protocols 
  16109. for communication. 
  16110.  
  16111. GNU is aimed initially at machines in the 68000/16000 class with virtual 
  16112. memory, because they are the easiest machines to make it run on.  The extra 
  16113. effort to make it run on smaller machines will be left to someone who wants to 
  16114. use it on them. 
  16115.  
  16116. To avoid horrible confusion, please pronounce the `G' in the word `GNU' when it 
  16117. is the name of this project. 
  16118.  
  16119.  
  16120. ΓòÉΓòÉΓòÉ 36.2. Why I Must Write GNU ΓòÉΓòÉΓòÉ
  16121.  
  16122. I consider that the golden rule requires that if I like a program I must share 
  16123. it with other people who like it.  Software sellers want to divide the users 
  16124. and conquer them, making each user agree not to share with others.  I refuse to 
  16125. break solidarity with other users in this way.  I cannot in good conscience 
  16126. sign a nondisclosure agreement or a software license agreement.  For years I 
  16127. worked within the Artificial Intelligence Lab to resist such tendencies and 
  16128. other inhospitalities, but eventually they had gone too far: I could not remain 
  16129. in an institution where such things are done for me against my will. 
  16130.  
  16131. So that I can continue to use computers without dishonor, I have decided to put 
  16132. together a sufficient body of free software so that I will be able to get along 
  16133. without any software that is not free.  I have resigned from the AI lab to deny 
  16134. MIT any legal excuse to prevent me from giving GNU away. 
  16135.  
  16136.  
  16137. ΓòÉΓòÉΓòÉ 36.3. Why GNU Will Be Compatible with Unix ΓòÉΓòÉΓòÉ
  16138.  
  16139. Unix is not my ideal system, but it is not too bad.  The essential features of 
  16140. Unix seem to be good ones, and I think I can fill in what Unix lacks without 
  16141. spoiling them.  And a system compatible with Unix would be convenient for many 
  16142. other people to adopt. 
  16143.  
  16144.  
  16145. ΓòÉΓòÉΓòÉ 36.4. How GNU Will Be Available ΓòÉΓòÉΓòÉ
  16146.  
  16147. GNU is not in the public domain.  Everyone will be permitted to modify and 
  16148. redistribute GNU, but no distributor will be allowed to restrict its further 
  16149. redistribution.  That is to say, proprietary modifications will not be allowed. 
  16150. I want to make sure that all versions of GNU remain free. 
  16151.  
  16152.  
  16153. ΓòÉΓòÉΓòÉ 36.5. Why Many Other Programmers Want to Help ΓòÉΓòÉΓòÉ
  16154.  
  16155. I have found many other programmers who are excited about GNU and want to help. 
  16156.  
  16157. Many programmers are unhappy about the commercialization of system software. 
  16158. It may enable them to make more money, but it requires them to feel in conflict 
  16159. with other programmers in general rather than feel as comrades.  The 
  16160. fundamental act of friendship among programmers is the sharing of programs; 
  16161. marketing arrangements now typically used essentially forbid programmers to 
  16162. treat others as friends.  The purchaser of software must choose between 
  16163. friendship and obeying the law.  Naturally, many decide that friendship is more 
  16164. important.  But those who believe in law often do not feel at ease with either 
  16165. choice.  They become cynical and think that programming is just a way of making 
  16166. money. 
  16167.  
  16168. By working on and using GNU rather than proprietary programs, we can be 
  16169. hospitable to everyone and obey the law.  In addition, GNU serves as an example 
  16170. to inspire and a banner to rally others to join us in sharing. This can give us 
  16171. a feeling of harmony which is impossible if we use software that is not free. 
  16172. For about half the programmers I talk to, this is an important happiness that 
  16173. money cannot replace. 
  16174.  
  16175.  
  16176. ΓòÉΓòÉΓòÉ 36.6. How You Can Contribute ΓòÉΓòÉΓòÉ
  16177.  
  16178. I am asking computer manufacturers for donations of machines and money. I'm 
  16179. asking individuals for donations of programs and work. 
  16180.  
  16181. One consequence you can expect if you donate machines is that GNU will run on 
  16182. them at an early date.  The machines should be complete, ready to use systems, 
  16183. approved for use in a residential area, and not in need of sophisticated 
  16184. cooling or power. 
  16185.  
  16186. I have found very many programmers eager to contribute part-time work for GNU. 
  16187. For most projects, such part-time distributed work would be very hard to 
  16188. coordinate; the independently-written parts would not work together. But for 
  16189. the particular task of replacing Unix, this problem is absent.  A complete Unix 
  16190. system contains hundreds of utility programs, each of which is documented 
  16191. separately.  Most interface specifications are fixed by Unix compatibility.  If 
  16192. each contributor can write a compatible replacement for a single Unix utility, 
  16193. and make it work properly in place of the original on a Unix system, then these 
  16194. utilities will work right when put together. Even allowing for Murphy to create 
  16195. a few unexpected problems, assembling these components will be a feasible task. 
  16196. (The kernel will require closer communication and will be worked on by a small, 
  16197. tight group.) 
  16198.  
  16199. If I get donations of money, I may be able to hire a few people full or part 
  16200. time.  The salary won't be high by programmers' standards, but I'm looking for 
  16201. people for whom building community spirit is as important as making money.  I 
  16202. view this as a way of enabling dedicated people to devote their full energies 
  16203. to working on GNU by sparing them the need to make a living in another way. 
  16204.  
  16205.  
  16206. ΓòÉΓòÉΓòÉ 36.7. Why All Computer Users Will Benefit ΓòÉΓòÉΓòÉ
  16207.  
  16208. Once GNU is written, everyone will be able to obtain good system software free, 
  16209. just like air. (This is another place I failed to distinguish carefully between 
  16210. the two different meanings of ``free''. The statement as it stands is not 
  16211. false---you can get copies of GNU software at no charge, from your friends or 
  16212. over the net.  But it does suggest the wrong idea.) 
  16213.  
  16214. This means much more than just saving everyone the price of a Unix license. It 
  16215. means that much wasteful duplication of system programming effort will be 
  16216. avoided.  This effort can go instead into advancing the state of the art. 
  16217.  
  16218. Complete system sources will be available to everyone.  As a result, a user who 
  16219. needs changes in the system will always be free to make them himself, or hire 
  16220. any available programmer or company to make them for him.  Users will no longer 
  16221. be at the mercy of one programmer or company which owns the sources and is in 
  16222. sole position to make changes. 
  16223.  
  16224. Schools will be able to provide a much more educational environment by 
  16225. encouraging all students to study and improve the system code.  Harvard's 
  16226. computer lab used to have the policy that no program could be installed on the 
  16227. system if its sources were not on public display, and upheld it by actually 
  16228. refusing to install certain programs.  I was very much inspired by this. 
  16229.  
  16230. Finally, the overhead of considering who owns the system software and what one 
  16231. is or is not entitled to do with it will be lifted. 
  16232.  
  16233. Arrangements to make people pay for using a program, including licensing of 
  16234. copies, always incur a tremendous cost to society through the cumbersome 
  16235. mechanisms necessary to figure out how much (that is, which programs) a person 
  16236. must pay for.  And only a police state can force everyone to obey them. 
  16237. Consider a space station where air must be manufactured at great cost: charging 
  16238. each breather per liter of air may be fair, but wearing the metered gas mask 
  16239. all day and all night is intolerable even if everyone can afford to pay the air 
  16240. bill.  And the TV cameras everywhere to see if you ever take the mask off are 
  16241. outrageous.  It's better to support the air plant with a head tax and chuck the 
  16242. masks. 
  16243.  
  16244. Copying all or parts of a program is as natural to a programmer as breathing, 
  16245. and as productive.  It ought to be as free. 
  16246.  
  16247.  
  16248. ΓòÉΓòÉΓòÉ 36.8. Some Easily Rebutted Objections to GNU's Goals ΓòÉΓòÉΓòÉ
  16249.  
  16250. ``Nobody will use it if it is free, because that means they can't rely on any 
  16251. support.'' 
  16252.  
  16253. ``You have to charge for the program to pay for providing the support.'' 
  16254.  
  16255. If people would rather pay for GNU plus service than get GNU free without 
  16256. service, a company to provide just service to people who have obtained GNU free 
  16257. ought to be profitable. (Several such companies now exist.) 
  16258.  
  16259. We must distinguish between support in the form of real programming work and 
  16260. mere handholding.  The former is something one cannot rely on from a software 
  16261. vendor.  If your problem is not shared by enough people, the vendor will tell 
  16262. you to get lost. 
  16263.  
  16264. If your business needs to be able to rely on support, the only way is to have 
  16265. all the necessary sources and tools.  Then you can hire any available person to 
  16266. fix your problem; you are not at the mercy of any individual. With Unix, the 
  16267. price of sources puts this out of consideration for most businesses.  With GNU 
  16268. this will be easy.  It is still possible for there to be no available competent 
  16269. person, but this problem cannot be blamed on distribution arrangements.  GNU 
  16270. does not eliminate all the world's problems, only some of them. 
  16271.  
  16272. Meanwhile, the users who know nothing about computers need handholding: doing 
  16273. things for them which they could easily do themselves but don't know how. 
  16274.  
  16275. Such services could be provided by companies that sell just hand-holding and 
  16276. repair service.  If it is true that users would rather spend money and get a 
  16277. product with service, they will also be willing to buy the service having got 
  16278. the product free.  The service companies will compete in quality and price; 
  16279. users will not be tied to any particular one.  Meanwhile, those of us who don't 
  16280. need the service should be able to use the program without paying for the 
  16281. service. 
  16282.  
  16283. ``You cannot reach many people without advertising, and you must charge for the 
  16284. program to support that.'' 
  16285.  
  16286. ``It's no use advertising a program people can get free.'' 
  16287.  
  16288. There are various forms of free or very cheap publicity that can be used to 
  16289. inform numbers of computer users about something like GNU.  But it may be true 
  16290. that one can reach more microcomputer users with advertising.  If this is 
  16291. really so, a business which advertises the service of copying and mailing GNU 
  16292. for a fee ought to be successful enough to pay for its advertising and more. 
  16293. This way, only the users who benefit from the advertising pay for it. 
  16294.  
  16295. On the other hand, if many people get GNU from their friends, and such 
  16296. companies don't succeed, this will show that advertising was not really 
  16297. necessary to spread GNU.  Why is it that free market advocates don't want to 
  16298. let the free market decide this? (The Free Software Foundation raises most of 
  16299. its funds from a distribution service, although it is a charity rather than a 
  16300. company.  If no one chooses to obtain copies by ordering the from the FSF, it 
  16301. will be unable to do its work.  But this does not mean that proprietary 
  16302. restrictions are justified to force every user to pay.  If a small fraction of 
  16303. all the users order copies from the FSF, that is sufficient to keep the FSF 
  16304. afloat.  So we ask users to choose to support us in this way.  Have you done 
  16305. your part?) 
  16306.  
  16307. ``My company needs a proprietary operating system to get a competitive edge.'' 
  16308.  
  16309. GNU will remove operating system software from the realm of competition. You 
  16310. will not be able to get an edge in this area, but neither will your competitors 
  16311. be able to get an edge over you.  You and they will compete in other areas, 
  16312. while benefiting mutually in this one.  If your business is selling an 
  16313. operating system, you will not like GNU, but that's tough on you.  If your 
  16314. business is something else, GNU can save you from being pushed into the 
  16315. expensive business of selling operating systems. 
  16316.  
  16317. I would like to see GNU development supported by gifts from many manufacturers 
  16318. and users, reducing the cost to each. (A group of computer companies recently 
  16319. pooled funds to support maintenance of the GNU C Compiler.) 
  16320.  
  16321. ``Don't programmers deserve a reward for their creativity?'' 
  16322.  
  16323. If anything deserves a reward, it is social contribution.  Creativity can be a 
  16324. social contribution, but only in so far as society is free to use the results. 
  16325. If programmers deserve to be rewarded for creating innovative programs, by the 
  16326. same token they deserve to be punished if they restrict the use of these 
  16327. programs. 
  16328.  
  16329. ``Shouldn't a programmer be able to ask for a reward for his creativity?'' 
  16330.  
  16331. There is nothing wrong with wanting pay for work, or seeking to maximize one's 
  16332. income, as long as one does not use means that are destructive.  But the means 
  16333. customary in the field of software today are based on destruction. 
  16334.  
  16335. Extracting money from users of a program by restricting their use of it is 
  16336. destructive because the restrictions reduce the amount and the ways that the 
  16337. program can be used.  This reduces the amount of wealth that humanity derives 
  16338. from the program.  When there is a deliberate choice to restrict, the harmful 
  16339. consequences are deliberate destruction. 
  16340.  
  16341. The reason a good citizen does not use such destructive means to become 
  16342. wealthier is that, if everyone did so, we would all become poorer from the 
  16343. mutual destructiveness.  This is Kantian ethics; or, the Golden Rule. Since I 
  16344. do not like the consequences that result if everyone hoards information, I am 
  16345. required to consider it wrong for one to do so. Specifically, the desire to be 
  16346. rewarded for one's creativity does not justify depriving the world in general 
  16347. of all or part of that creativity. 
  16348.  
  16349. ``Won't programmers starve?'' 
  16350.  
  16351. I could answer that nobody is forced to be a programmer.  Most of us cannot 
  16352. manage to get any money for standing on the street and making faces.  But we 
  16353. are not, as a result, condemned to spend our lives standing on the street 
  16354. making faces, and starving.  We do something else. 
  16355.  
  16356. But that is the wrong answer because it accepts the questioner's implicit 
  16357. assumption: that without ownership of software, programmers cannot possibly be 
  16358. paid a cent.  Supposedly it is all or nothing. 
  16359.  
  16360. The real reason programmers will not starve is that it will still be possible 
  16361. for them to get paid for programming; just not paid as much as now. 
  16362.  
  16363. Restricting copying is not the only basis for business in software.  It is the 
  16364. most common basis because it brings in the most money.  If it were prohibited, 
  16365. or rejected by the customer, software business would move to other bases of 
  16366. organization which are now used less often.  There are always numerous ways to 
  16367. organize any kind of business. 
  16368.  
  16369. Probably programming will not be as lucrative on the new basis as it is now. 
  16370. But that is not an argument against the change.  It is not considered an 
  16371. injustice that sales clerks make the salaries that they now do.  If programmers 
  16372. made the same, that would not be an injustice either.  (In practice they would 
  16373. still make considerably more than that.) 
  16374.  
  16375. ``Don't people have a right to control how their creativity is used?'' 
  16376.  
  16377. ``Control over the use of one's ideas'' really constitutes control over other 
  16378. people's lives; and it is usually used to make their lives more difficult. 
  16379.  
  16380. People who have studied the issue of intellectual property rights carefully 
  16381. (such as lawyers) say that there is no intrinsic right to intellectual 
  16382. property.  The kinds of supposed intellectual property rights that the 
  16383. government recognizes were created by specific acts of legislation for specific 
  16384. purposes. 
  16385.  
  16386. For example, the patent system was established to encourage inventors to 
  16387. disclose the details of their inventions.  Its purpose was to help society 
  16388. rather than to help inventors.  At the time, the life span of 17 years for a 
  16389. patent was short compared with the rate of advance of the state of the art. 
  16390. Since patents are an issue only among manufacturers, for whom the cost and 
  16391. effort of a license agreement are small compared with setting up production, 
  16392. the patents often do not do much harm.  They do not obstruct most individuals 
  16393. who use patented products. 
  16394.  
  16395. The idea of copyright did not exist in ancient times, when authors frequently 
  16396. copied other authors at length in works of non-fiction.  This practice was 
  16397. useful, and is the only way many authors' works have survived even in part. 
  16398. The copyright system was created expressly for the purpose of encouraging 
  16399. authorship.  In the domain for which it was invented---books, which could be 
  16400. copied economically only on a printing press---it did little harm, and did not 
  16401. obstruct most of the individuals who read the books. 
  16402.  
  16403. All intellectual property rights are just licenses granted by society because 
  16404. it was thought, rightly or wrongly, that society as a whole would benefit by 
  16405. granting them.  But in any particular situation, we have to ask: are we really 
  16406. better off granting such license?  What kind of act are we licensing a person 
  16407. to do? 
  16408.  
  16409. The case of programs today is very different from that of books a hundred years 
  16410. ago.  The fact that the easiest way to copy a program is from one neighbor to 
  16411. another, the fact that a program has both source code and object code which are 
  16412. distinct, and the fact that a program is used rather than read and enjoyed, 
  16413. combine to create a situation in which a person who enforces a copyright is 
  16414. harming society as a whole both materially and spiritually; in which a person 
  16415. should not do so regardless of whether the law enables him to. 
  16416.  
  16417. ``Competition makes things get done better.'' 
  16418.  
  16419. The paradigm of competition is a race: by rewarding the winner, we encourage 
  16420. everyone to run faster.  When capitalism really works this way, it does a good 
  16421. job; but its defenders are wrong in assuming it always works this way.  If the 
  16422. runners forget why the reward is offered and become intent on winning, no 
  16423. matter how, they may find other strategies---such as, attacking other runners. 
  16424. If the runners get into a fist fight, they will all finish late. 
  16425.  
  16426. Proprietary and secret software is the moral equivalent of runners in a fist 
  16427. fight.  Sad to say, the only referee we've got does not seem to object to 
  16428. fights; he just regulates them (``For every ten yards you run, you can fire one 
  16429. shot'').  He really ought to break them up, and penalize runners for even 
  16430. trying to fight. 
  16431.  
  16432. ``Won't everyone stop programming without a monetary incentive?'' 
  16433.  
  16434. Actually, many people will program with absolutely no monetary incentive. 
  16435. Programming has an irresistible fascination for some people, usually the people 
  16436. who are best at it.  There is no shortage of professional musicians who keep at 
  16437. it even though they have no hope of making a living that way. 
  16438.  
  16439. But really this question, though commonly asked, is not appropriate to the 
  16440. situation.  Pay for programmers will not disappear, only become less.  So the 
  16441. right question is, will anyone program with a reduced monetary incentive?  My 
  16442. experience shows that they will. 
  16443.  
  16444. For more than ten years, many of the world's best programmers worked at the 
  16445. Artificial Intelligence Lab for far less money than they could have had 
  16446. anywhere else.  They got many kinds of non-monetary rewards: fame and 
  16447. appreciation, for example.  And creativity is also fun, a reward in itself. 
  16448.  
  16449. Then most of them left when offered a chance to do the same interesting work 
  16450. for a lot of money. 
  16451.  
  16452. What the facts show is that people will program for reasons other than riches; 
  16453. but if given a chance to make a lot of money as well, they will come to expect 
  16454. and demand it.  Low-paying organizations do poorly in competition with 
  16455. high-paying ones, but they do not have to do badly if the high-paying ones are 
  16456. banned. 
  16457.  
  16458. ``We need the programmers desperately.  If they demand that we stop helping our 
  16459. neighbors, we have to obey.'' 
  16460.  
  16461. You're never so desperate that you have to obey this sort of demand. Remember: 
  16462. millions for defense, but not a cent for tribute! 
  16463.  
  16464. ``Programmers need to make a living somehow.'' 
  16465.  
  16466. In the short run, this is true.  However, there are plenty of ways that 
  16467. programmers could make a living without selling the right to use a program. 
  16468. This way is customary now because it brings programmers and businessmen the 
  16469. most money, not because it is the only way to make a living.  It is easy to 
  16470. find other ways if you want to find them.  Here are a number of examples. 
  16471.  
  16472. A manufacturer introducing a new computer will pay for the porting of operating 
  16473. systems onto the new hardware. 
  16474.  
  16475. The sale of teaching, hand-holding and maintenance services could also employ 
  16476. programmers. 
  16477.  
  16478. People with new ideas could distribute programs as freeware, asking for 
  16479. donations from satisfied users, or selling hand-holding services.  I have met 
  16480. people who are already working this way successfully. 
  16481.  
  16482. Users with related needs can form users' groups, and pay dues.  A group would 
  16483. contract with programming companies to write programs that the group's members 
  16484. would like to use. 
  16485.  
  16486. All sorts of development can be funded with a Software Tax: 
  16487.  
  16488. Suppose everyone who buys a computer has to pay x percent of the price as a 
  16489. software tax.  The government gives this to an agency like the NSF to spend on 
  16490. software development. 
  16491.  
  16492. But if the computer buyer makes a donation to software development himself, he 
  16493. can take a credit against the tax.  He can donate to the project of his own 
  16494. choosing---often, chosen because he hopes to use the results when it is done. 
  16495. He can take a credit for any amount of donation up to the total tax he had to 
  16496. pay. 
  16497.  
  16498. The total tax rate could be decided by a vote of the payers of the tax, 
  16499. weighted according to the amount they will be taxed on. 
  16500.  
  16501. The consequences: 
  16502.  
  16503. o The computer-using community supports software development. 
  16504.  
  16505. o This community decides what level of support is needed. 
  16506.  
  16507. o Users who care which projects their share is spent on can choose this for 
  16508.   themselves. 
  16509.  
  16510. In the long run, making programs free is a step toward the post-scarcity world, 
  16511. where nobody will have to work very hard just to make a living. People will be 
  16512. free to devote themselves to activities that are fun, such as programming, 
  16513. after spending the necessary ten hours a week on required tasks such as 
  16514. legislation, family counseling, robot repair and asteroid prospecting.  There 
  16515. will be no need to be able to make a living from programming. 
  16516.  
  16517. We have already greatly reduced the amount of work that the whole society must 
  16518. do for its actual productivity, but only a little of this has translated itself 
  16519. into leisure for workers because much nonproductive activity is required to 
  16520. accompany productive activity.  The main causes of this are bureaucracy and 
  16521. isometric struggles against competition.  Free software will greatly reduce 
  16522. these drains in the area of software production.  We must do this, in order for 
  16523. technical gains in productivity to translate into less work for us. 
  16524.  
  16525.  
  16526. ΓòÉΓòÉΓòÉ 37. Glossary ΓòÉΓòÉΓòÉ
  16527.  
  16528. Abbrev 
  16529.           An abbrev is a text string which expands into a different text string 
  16530.           when present in the buffer.  For example, you might define a short 
  16531.           word as an abbrev for a long phrase that you want to insert 
  16532.           frequently.  See Abbrevs. 
  16533.  
  16534. Aborting 
  16535.           Aborting means getting out of a recursive edit (q.v.).  The commands 
  16536.           C-] and M-x top-level are used for this. See Quitting. 
  16537.  
  16538. Alt 
  16539.           Alt is the name of a modifier bit which a keyboard input character 
  16540.           may have.  To make a character Alt, type it while holding down the 
  16541.           ALT key.  Such characters are given names that start with Alt- 
  16542.           (usually written A- for short). See User Input. 
  16543.  
  16544. Auto Fill Mode 
  16545.           Auto Fill mode is a minor mode in which text that you insert is 
  16546.           automatically broken into lines of fixed width.  See Filling. 
  16547.  
  16548. Auto Saving 
  16549.           Auto saving is the practice of saving the contents of an Emacs buffer 
  16550.           in a specially-named file, so that the information will not be lost 
  16551.           if the buffer is lost due to a system error or user error.  See Auto 
  16552.           Save. 
  16553.  
  16554. Backup File 
  16555.           A backup file records the contents that a file had before the current 
  16556.           editing session.  Emacs makes backup files automatically to help you 
  16557.           track down or cancel changes you later regret making.  See Backup. 
  16558.  
  16559. Balance Parentheses 
  16560.           Emacs can balance parentheses manually or automatically.  Manual 
  16561.           balancing is done by the commands to move over balanced expressions 
  16562.           (see Lists).  Automatic balancing is done by blinking the parenthesis 
  16563.           that matches one just inserted ( see Matching Parens). 
  16564.  
  16565. Bind 
  16566.           To bind a key sequence means to give it a binding (q.v.). See 
  16567.           Rebinding. 
  16568.  
  16569. Binding 
  16570.           A key sequence gets its meaning in Emacs by having a binding, which 
  16571.           is a command (q.v.), a Lisp function that is run when the user types 
  16572.           that sequence.  See Commands.  Customization often involves rebinding 
  16573.           a character to a different command function.  The bindings of all key 
  16574.           sequences are recorded in the keymaps (q.v.).  See Keymaps. 
  16575.  
  16576. Blank Lines 
  16577.           Blank lines are lines that contain only whitespace.  Emacs has 
  16578.           several commands for operating on the blank lines in the buffer. 
  16579.  
  16580. Buffer 
  16581.           The buffer is the basic editing unit; one buffer corresponds to one 
  16582.           piece of text being edited.  You can have several buffers, but at any 
  16583.           time you are editing only one, the `selected' buffer, though several 
  16584.           can be visible when you are using multiple windows.  See Buffers. 
  16585.  
  16586. Buffer Selection History 
  16587.           Emacs keeps a buffer selection history which records how recently 
  16588.           each Emacs buffer has been selected.  This is used for choosing a 
  16589.           buffer to select.  See Buffers. 
  16590.  
  16591. Button Down Event 
  16592.           A button down event is the kind of input event generated right away 
  16593.           when you press a mouse button.  See Mouse Buttons. 
  16594.  
  16595. C- 
  16596.           `C' in the name of a character is an abbreviation for Control. See 
  16597.           User Input. 
  16598.  
  16599. C-M- 
  16600.           `C-M-' in the name of a character is an abbreviation for 
  16601.           Control-Meta.  See User Input. 
  16602.  
  16603. Case Conversion 
  16604.           Case conversion means changing text from upper case to lower case or 
  16605.           vice versa.  See Case, for the commands for case conversion. 
  16606.  
  16607. Characters 
  16608.           Characters form the contents of an Emacs buffer; see Text Characters. 
  16609.           Also, key sequences (q.v.) are usually made up of characters (though 
  16610.           they may include other input events as well). See User Input. 
  16611.  
  16612. Click Event 
  16613.           A click event is the kind of input event generated when you press a 
  16614.           mouse button and let it go without moving the mouse.  See Mouse 
  16615.           Buttons. 
  16616.  
  16617. Command 
  16618.           A command is a Lisp function specially defined to be able to serve as 
  16619.           a key binding in Emacs.  When you type a key sequence (q.v.), its 
  16620.           binding (q.v.) is looked up in the relevant keymaps (q.v.) to find 
  16621.           the command to run.  See Commands. 
  16622.  
  16623. Command Name 
  16624.           A command name is the name of a Lisp symbol which is a command (see 
  16625.           Commands).  You can invoke any command by its name using M-x (see 
  16626.           M-x). 
  16627.  
  16628. Comments 
  16629.           A comment is text in a program which is intended only for humans 
  16630.           reading the program, and which is marked specially so that it will be 
  16631.           ignored when the program is loaded or compiled.  Emacs offers special 
  16632.           commands for creating, aligning and killing comments.  See Comments. 
  16633.  
  16634. Compilation 
  16635.           Compilation is the process of creating an executable program from 
  16636.           source code.  Emacs has commands for compiling files of Emacs Lisp 
  16637.           code ( see Byte Compilation) and programs in C and other languages 
  16638.           (see Compilation). 
  16639.  
  16640. Complete Key 
  16641.           A complete key is a key sequence which fully specifies one action to 
  16642.           be performed by Emacs.  For example, X and C-f and C-x m are complete 
  16643.           keys.  Complete keys derive their meanings from being bound (q.v.) to 
  16644.           commands (q.v.).  Thus, X is conventionally bound to a command to 
  16645.           insert `X' in the buffer; C-x m is conventionally bound to a command 
  16646.           to begin composing a mail message. See Keys. 
  16647.  
  16648. Completion 
  16649.           Completion is what Emacs does when it automatically fills out an 
  16650.           abbreviation for a name into the entire name.  Completion is done for 
  16651.           minibuffer (q.v.) arguments when the set of possible valid inputs is 
  16652.           known; for example, on command names, buffer names, and file names. 
  16653.           Completion occurs when TAB, SPC or RET is typed.  See Completion. 
  16654.  
  16655. Continuation Line 
  16656.           When a line of text is longer than the width of the window, it takes 
  16657.           up more than one screen line when displayed.  We say that the text 
  16658.           line is continued, and all screen lines used for it after the first 
  16659.           are called continuation lines. See Basic Editing. 
  16660.  
  16661. Control Character 
  16662.           ASCII characters with octal codes 0 through 037, and also code 0177, 
  16663.           do not have graphic images assigned to them.  These are the Control 
  16664.           characters.  To type a Control character, hold down the CTRL key and 
  16665.           type the corresponding non-Control character.  RET, TAB, ESC, LFD and 
  16666.           DEL are all control characters. See User Input. 
  16667.  
  16668.           When you are using the X Window System, every non-control character 
  16669.           has a corresponding control character variant. 
  16670.  
  16671. Copyleft 
  16672.           A copyleft is a notice giving the public legal permission to 
  16673.           redistribute a program or other work of art.  Copylefts are used by 
  16674.           left-wing programmers to give people equal rights, just as copyrights 
  16675.           are used by right-wing programmers to gain power over other people. 
  16676.  
  16677. Current Buffer 
  16678.           The current buffer in Emacs is the Emacs buffer on which most editing 
  16679.           commands operate.  You can select any Emacs buffer as the current 
  16680.           one. See Buffers. 
  16681.  
  16682. Current Line 
  16683.           The line point is on (see Point). 
  16684.  
  16685. Current Paragraph 
  16686.           The paragraph that point is in.  If point is between paragraphs, the 
  16687.           current paragraph is the one that follows point.  See Paragraphs. 
  16688.  
  16689. Current Defun 
  16690.           The defun (q.v.) that point is in.  If point is between defuns, the 
  16691.           current defun is the one that follows point.  See Defuns. 
  16692.  
  16693. Cursor 
  16694.           The cursor is the rectangle on the screen which indicates the 
  16695.           position called point (q.v.) at which insertion and deletion takes 
  16696.           place. The cursor is on or under the character that follows point. 
  16697.           Often people speak of `the cursor' when, strictly speaking, they mean 
  16698.           `point'.  See Basic Editing. 
  16699.  
  16700. Customization 
  16701.           Customization is making minor changes in the way Emacs works.  It is 
  16702.           often done by setting variables (see Variables) or by rebinding key 
  16703.           sequences (see Keymaps). 
  16704.  
  16705. Default Argument 
  16706.           The default for an argument is the value that will be assumed if you 
  16707.           do not specify one.  When the minibuffer is used to read an argument, 
  16708.           the default argument is used if you just type RET. See Minibuffer. 
  16709.  
  16710. Default Directory 
  16711.           When you specify a file name that does not start with `/' or `~', it 
  16712.           is interpreted relative to the current buffer's default directory. 
  16713.           See Minibuffer File. 
  16714.  
  16715. Defun 
  16716.           A defun is a list at the top level of parenthesis or bracket 
  16717.           structure in a program.  It is so named because most such lists in 
  16718.           Lisp programs are calls to the Lisp function defun.  See Defuns. 
  16719.  
  16720. DEL 
  16721.           DEL is a character that runs the command to delete one character of 
  16722.           text.  See Basic Editing. 
  16723.  
  16724. Deletion 
  16725.           Deletion means erasing text without copying it into the kill ring 
  16726.           (q.v.).  The alternative is killing (q.v.).  See Killing. 
  16727.  
  16728. Deletion of Files 
  16729.           Deleting a file means erasing it from the file system. See Misc File 
  16730.           Ops. 
  16731.  
  16732. Deletion of Messages 
  16733.           Deleting a message means flagging it to be eliminated from your mail 
  16734.           file.  Until you expunge (q.v.) the mail file, you can still undelete 
  16735.           the messages you have deleted.  See Rmail Deletion. 
  16736.  
  16737. Deletion of Windows 
  16738.           Deleting a window means eliminating it from the screen.  Other 
  16739.           windows expand to use up the space.  The deleted window can never 
  16740.           come back, but no actual text is thereby lost.  See Windows. 
  16741.  
  16742. Directory 
  16743.           File directories are named collections in the file system, within 
  16744.           which you can place individual files or subdirectories. See 
  16745.           Directories. 
  16746.  
  16747. Dired 
  16748.           Dired is the Emacs facility that displays the contents of a file 
  16749.           directory and allows you to ``edit the directory'', performing 
  16750.           operations on the files in the directory.  See Dired. 
  16751.  
  16752. Disabled Command 
  16753.           A disabled command is one that you may not run without special 
  16754.           confirmation.  The usual reason for disabling a command is that it is 
  16755.           confusing for beginning users.  See Disabling. 
  16756.  
  16757. Down Event 
  16758.           Short for `button down event'. 
  16759.  
  16760. Drag Event 
  16761.           A drag event is the kind of input event generated when you press a 
  16762.           mouse button, move the mouse, and then release the button. See Mouse 
  16763.           Buttons. 
  16764.  
  16765. Dribble File 
  16766.           A file into which Emacs writes all the characters that the user types 
  16767.           on the keyboard.  Dribble files are used to make a record for 
  16768.           debugging Emacs bugs.  Emacs does not make a dribble file unless you 
  16769.           tell it to.  See Bugs. 
  16770.  
  16771. Echo Area 
  16772.           The echo area is the bottom line of the screen, used for echoing the 
  16773.           arguments to commands, for asking questions, and printing brief 
  16774.           messages (including error messages).  See Echo Area. 
  16775.  
  16776. Echoing 
  16777.           Echoing is acknowledging the receipt of commands by displaying them 
  16778.           (in the echo area).  Emacs never echoes single-character key 
  16779.           sequences; longer key sequences echo only if you pause while typing 
  16780.           them. 
  16781.  
  16782. Error 
  16783.           An error occurs when an Emacs command cannot execute in the current 
  16784.           circumstances.  When an error occurs, execution of the command stops 
  16785.           (unless the command has been programmed to do otherwise) and Emacs 
  16786.           reports the error by printing an error message (q.v.).  Type-ahead is 
  16787.           discarded.  Then Emacs is ready to read another editing command. 
  16788.  
  16789. Error Messages 
  16790.           Error messages are single lines of output printed by Emacs when the 
  16791.           user asks for something impossible to do (such as, killing text 
  16792.           forward when point is at the end of the buffer).  They appear in the 
  16793.           echo area, accompanied by a beep. 
  16794.  
  16795. ESC 
  16796.           ESC is a character used as a prefix for typing Meta characters on 
  16797.           keyboards lacking a META key.  Unlike the META key (which, like the 
  16798.           SHIFT key, is held down while another character is typed), the ESC 
  16799.           key is pressed once and applies to the next character typed. 
  16800.  
  16801. Expunging 
  16802.           Expunging a mail file or Dired buffer means really discarding the 
  16803.           messages or files you have previously flagged for deletion. 
  16804.  
  16805. Fill Prefix 
  16806.           The fill prefix is a string that should be expected at the beginning 
  16807.           of each line when filling is done.  It is not regarded as part of the 
  16808.           text to be filled.  See Filling. 
  16809.  
  16810. Filling 
  16811.           Filling text means moving text from line to line so that all the 
  16812.           lines are approximately the same length.  See Filling. 
  16813.  
  16814. Frame 
  16815.           A frame is a rectangular cluster of Emacs windows.  When using X 
  16816.           Windows, you can create more than one Emacs frame, each having its 
  16817.           own X window, and then you can subdivide each frame into Emacs 
  16818.           windows as you wish. See Frames. 
  16819.  
  16820. Function Key 
  16821.           A function key is a key on the keyboard that does not correspond to 
  16822.           any character.  See Function Keys. 
  16823.  
  16824. Global 
  16825.           Global means `independent of the current environment; in effect 
  16826.           throughout Emacs'.  It is the opposite of local (q.v.).  Particular 
  16827.           examples of the use of `global' appear below. 
  16828.  
  16829. Global Abbrev 
  16830.           A global definition of an abbrev (q.v.) is effective in all major 
  16831.           modes that do not have local (q.v.) definitions for the same abbrev. 
  16832.           See Abbrevs. 
  16833.  
  16834. Global Keymap 
  16835.           The global keymap (q.v.) contains key bindings that are in effect 
  16836.           except when overridden by local key bindings in a major mode's local 
  16837.           keymap (q.v.).  See Keymaps. 
  16838.  
  16839. Global Substitution 
  16840.           Global substitution means replacing each occurrence of one string by 
  16841.           another string through a large amount of text.  See Replace. 
  16842.  
  16843. Global Variable 
  16844.           The global value of a variable (q.v.) takes effect in all buffers 
  16845.           that do not have their own local (q.v.) values for the variable. See 
  16846.           Variables. 
  16847.  
  16848. Graphic Character 
  16849.           Graphic characters are those assigned pictorial images rather than 
  16850.           just names.  All the non-Meta (q.v.) characters except for the 
  16851.           Control (q.v.) characters are graphic characters.  These include 
  16852.           letters, digits, punctuation, and spaces; they do not include RET or 
  16853.           ESC.  In Emacs, typing a graphic character inserts that character (in 
  16854.           ordinary editing modes).  See Basic Editing. 
  16855.  
  16856. Hardcopy 
  16857.           Hardcopy means printed output.  Emacs has commands for making printed 
  16858.           listings of text in Emacs buffers.  See Hardcopy. 
  16859.  
  16860. HELP 
  16861.           You can type HELP at any time to ask what options you have, or to ask 
  16862.           what any command does.  The character HELP is really C-h. See Help. 
  16863.  
  16864. Hyper 
  16865.           Hyper is the name of a modifier bit which a keyboard input character 
  16866.           may have.  To make a character Hyper, type it while holding down the 
  16867.           HYPER key.  Such characters are given names that start with Hyper- 
  16868.           (usually written H- for short). See User Input. 
  16869.  
  16870. Inbox 
  16871.           An inbox is a file in which mail is delivered by the operating 
  16872.           system. Rmail transfers mail from inboxes to mail files (q.v.) in 
  16873.           which the mail is then stored permanently or until explicitly 
  16874.           deleted. See Rmail Inbox. 
  16875.  
  16876. Indentation 
  16877.           Indentation means blank space at the beginning of a line.  Most 
  16878.           programming languages have conventions for using indentation to 
  16879.           illuminate the structure of the program, and Emacs has special 
  16880.           commands to adjust indentation. See Indentation. 
  16881.  
  16882. Insertion 
  16883.           Insertion means copying text into the buffer, either from the 
  16884.           keyboard or from some other place in Emacs. 
  16885.  
  16886. Justification 
  16887.           Justification means adding extra spaces to lines of text to make them 
  16888.           come exactly to a specified width.  See Filling. 
  16889.  
  16890. Keyboard Macros 
  16891.           Keyboard macros are a way of defining new Emacs commands from 
  16892.           sequences of existing ones, with no need to write a Lisp program. See 
  16893.           Keyboard Macros. 
  16894.  
  16895. Key Sequence 
  16896.           A key sequence (key, for short) is a sequence of characters that, 
  16897.           when input to Emacs, is meaningful as a single unit.  If the key 
  16898.           sequence is enough to specify one action, it is a complete key 
  16899.           (q.v.); if it is not enough, it is a prefix key (q.v.).  See Keys. 
  16900.  
  16901. Keymap 
  16902.           The keymap is the data structure that records the bindings (q.v.) of 
  16903.           key sequences to the commands that they run.  For example, the global 
  16904.           keymap binds the character C-n to the command function next-line. 
  16905.           See Keymaps. 
  16906.  
  16907. Keyboard Translation Table 
  16908.           The keyboard translation table is an array that translates the 
  16909.           character codes that come from the terminal into the character codes 
  16910.           that make up key sequences.  See Keyboard Translations. 
  16911.  
  16912. Kill Ring 
  16913.           The kill ring is where all text you have killed recently is saved. 
  16914.           You can reinsert any of the killed text still in the ring; this is 
  16915.           called yanking (q.v.).  See Yanking. 
  16916.  
  16917. Killing 
  16918.           Killing means erasing text and saving it on the kill ring so it can 
  16919.           be yanked (q.v.) later.  Some other systems call this ``cutting''. 
  16920.           Most Emacs commands to erase text do killing, as opposed to deletion 
  16921.           (q.v.).  See Killing. 
  16922.  
  16923. Killing Jobs 
  16924.           Killing a job (such as, an invocation of Emacs) means making it cease 
  16925.           to exist.  Any data within it, if not saved in a file, is lost. See 
  16926.           Exiting. 
  16927.  
  16928. List 
  16929.           A list is, approximately, a text string beginning with an open 
  16930.           parenthesis and ending with the matching close parenthesis.  In C 
  16931.           mode and other non-Lisp modes, groupings surrounded by other kinds of 
  16932.           matched delimiters appropriate to the language, such as braces, are 
  16933.           also considered lists.  Emacs has special commands for many 
  16934.           operations on lists.  See Lists. 
  16935.  
  16936. Local 
  16937.           Local means `in effect only in a particular context'; the relevant 
  16938.           kind of context is a particular function execution, a particular 
  16939.           buffer, or a particular major mode.  It is the opposite of `global' 
  16940.           (q.v.).  Specific uses of `local' in Emacs terminology appear below. 
  16941.  
  16942. Local Abbrev 
  16943.           A local abbrev definition is effective only if a particular major 
  16944.           mode is selected.  In that major mode, it overrides any global 
  16945.           definition for the same abbrev.  See Abbrevs. 
  16946.  
  16947. Local Keymap 
  16948.           A local keymap is used in a particular major mode; the key bindings 
  16949.           (q.v.) in the current local keymap override global bindings of the 
  16950.           same key sequences.  See Keymaps. 
  16951.  
  16952. Local Variable 
  16953.           A local value of a variable (q.v.) applies to only one buffer. See 
  16954.           Locals. 
  16955.  
  16956. M- 
  16957.           M- in the name of a character is an abbreviation for META, one of the 
  16958.           modifier keys that can accompany any character. See User Input. 
  16959.  
  16960. M-C- 
  16961.           `M-C-' in the name of a character is an abbreviation for 
  16962.           Control-Meta; it means the same thing as `C-M-'.  If your terminal 
  16963.           lacks a real META key, you type a Control-Meta character by typing 
  16964.           ESC and then typing the corresponding Control character. See User 
  16965.           Input. 
  16966.  
  16967. M-x 
  16968.           M-x is the key sequence which is used to call an Emacs command by 
  16969.           name.  This is how you run commands that are not bound to key 
  16970.           sequences. See M-x. 
  16971.  
  16972. Mail 
  16973.           Mail means messages sent from one user to another through the 
  16974.           computer system, to be read at the recipient's convenience.  Emacs 
  16975.           has commands for composing and sending mail, and for reading and 
  16976.           editing the mail you have received.  See Sending Mail.  See Rmail, 
  16977.           for how to read mail. 
  16978.  
  16979. Mail File 
  16980.           A mail file is a file which is edited using Rmail and in which Rmail 
  16981.           stores mail.  See Rmail. 
  16982.  
  16983. Major Mode 
  16984.           The Emacs major modes are a mutually exclusive set of options, each 
  16985.           of which configures Emacs for editing a certain sort of text. 
  16986.           Ideally, each programming language has its own major mode.  See Major 
  16987.           Modes. 
  16988.  
  16989. Mark 
  16990.           The mark points to a position in the text.  It specifies one end of 
  16991.           the region (q.v.), point being the other end.  Many commands operate 
  16992.           on all the text from point to the mark.  Each buffer has its own 
  16993.           mark. See Mark. 
  16994.  
  16995. Mark Ring 
  16996.           The mark ring is used to hold several recent previous locations of 
  16997.           the mark, just in case you want to move back to them.  Each buffer 
  16998.           has its own mark ring.  See Mark Ring. 
  16999.  
  17000. Message 
  17001.           See `mail'. 
  17002.  
  17003. Meta 
  17004.           Meta is the name of a modifier bit which a command character may 
  17005.           have. It is present in a character if the character is typed with the 
  17006.           META key held down.  Such characters are given names that start with 
  17007.           Meta- (usually written M- for short).  For example, M-< is typed by 
  17008.           holding down META and at the same time typing < (which itself is 
  17009.           done, on most terminals, by holding down SHIFT and typing ,).  See 
  17010.           User Input. 
  17011.  
  17012. Meta Character 
  17013.           A Meta character is one whose character code includes the Meta bit. 
  17014.  
  17015. Minibuffer 
  17016.           The minibuffer is the window that appears when necessary inside the 
  17017.           echo area (q.v.), used for reading arguments to commands. See 
  17018.           Minibuffer. 
  17019.  
  17020. Minibuffer History 
  17021.           The minibuffer history records the text you have specified in the 
  17022.           past for minibuffer arguments, so you can conveniently use the same 
  17023.           text again.  See Minibuffer History. 
  17024.  
  17025. Minor Mode 
  17026.           A minor mode is an optional feature of Emacs which can be switched on 
  17027.           or off independently of all other features.  Each minor mode has a 
  17028.           command to turn it on or off.  See Minor Modes. 
  17029.  
  17030. Minor Mode Keymap 
  17031.           A keymap that belongs to a minor mode and is active when that mode is 
  17032.           enabled.  Minor mode keymaps take precedence over the buffer's local 
  17033.           keymap, just as the local keymap takes precedence over the global 
  17034.           keymap.  See Keymaps. 
  17035.  
  17036. Mode Line 
  17037.           The mode line is the line at the bottom of each window (q.v.), giving 
  17038.           status information on the buffer displayed in that window. See Mode 
  17039.           Line. 
  17040.  
  17041. Modified Buffer 
  17042.           A buffer (q.v.) is modified if its text has been changed since the 
  17043.           last time the buffer was saved (or since when it was created, if it 
  17044.           has never been saved).  See Saving. 
  17045.  
  17046. Moving Text 
  17047.           Moving text means erasing it from one place and inserting it in 
  17048.           another.  The usual way to move text by killing (q.v.) and then 
  17049.           yanking (q.v.).  See Killing. 
  17050.  
  17051. Named Mark 
  17052.           A named mark is a register (q.v.) in its role of recording a location 
  17053.           in text so that you can move point to that location. See Registers. 
  17054.  
  17055. Narrowing 
  17056.           Narrowing means creating a restriction (q.v.) that limits editing in 
  17057.           the current buffer to only a part of the text in the buffer.  Text 
  17058.           outside that part is inaccessible to the user until the boundaries 
  17059.           are widened again, but it is still there, and saving the file saves 
  17060.           it all.  See Narrowing. 
  17061.  
  17062. Newline 
  17063.           LFD characters in the buffer terminate lines of text and are called 
  17064.           newlines.  See Text Characters. 
  17065.  
  17066. Numeric Argument 
  17067.           A numeric argument is a number, specified before a command, to change 
  17068.           the effect of the command.  Often the numeric argument serves as a 
  17069.           repeat count.  See Arguments. 
  17070.  
  17071. Option 
  17072.           An option is a variable (q.v.) that exists so that you can customize 
  17073.           Emacs by giving it a new value.  See Variables. 
  17074.  
  17075. Overwrite Mode 
  17076.           Overwrite mode is a minor mode.  When it is enabled, ordinary text 
  17077.           characters replace the existing text after point rather than pushing 
  17078.           it to the right.  See Minor Modes. 
  17079.  
  17080. Page 
  17081.           A page is a unit of text, delimited by formfeed characters (ASCII 
  17082.           control-L, code 014) coming at the beginning of a line.  Some Emacs 
  17083.           commands are provided for moving over and operating on pages. See 
  17084.           Pages. 
  17085.  
  17086. Paragraphs 
  17087.           Paragraphs are the medium-size unit of English text.  There are 
  17088.           special Emacs commands for moving over and operating on paragraphs. 
  17089.           See Paragraphs. 
  17090.  
  17091. Parsing 
  17092.           We say that certain Emacs commands parse words or expressions in the 
  17093.           text being edited.  Really, all they know how to do is find the other 
  17094.           end of a word or expression.  See Syntax. 
  17095.  
  17096. Point 
  17097.           Point is the place in the buffer at which insertion and deletion 
  17098.           occur.  Point is considered to be between two characters, not at one 
  17099.           character.  The terminal's cursor (q.v.) indicates the location of 
  17100.           point.  See Basic. 
  17101.  
  17102. Prefix Argument 
  17103.           See `numeric argument'. 
  17104.  
  17105. Prefix Key 
  17106.           A prefix key is a key sequence (q.v.) whose sole function is to 
  17107.           introduce a set of longer key sequences.  C-x is an example of prefix 
  17108.           key; any two-character sequence starting with C-x is therefore a 
  17109.           legitimate key sequence.  See Keys. 
  17110.  
  17111. Primary Mail File 
  17112.           Your primary mail file is the file named `RMAIL' in your home 
  17113.           directory, where all mail that you receive is stored by Rmail unless 
  17114.           you make arrangements to do otherwise.  See Rmail. 
  17115.  
  17116. Prompt 
  17117.           A prompt is text printed to ask the user for input.  Printing a 
  17118.           prompt is called prompting.  Emacs prompts always appear in the echo 
  17119.           area (q.v.).  One kind of prompting happens when the minibuffer is 
  17120.           used to read an argument (see Minibuffer); the echoing which happens 
  17121.           when you pause in the middle of typing a multicharacter key sequence 
  17122.           is also a kind of prompting (see Echo Area). 
  17123.  
  17124. Quitting 
  17125.           Quitting means cancelling a partially typed command or a running 
  17126.           command, using C-g.  See Quitting. 
  17127.  
  17128. Quoting 
  17129.           Quoting means depriving a character of its usual special 
  17130.           significance. In Emacs this is usually done with C-q.  What 
  17131.           constitutes special significance depends on the context and on 
  17132.           convention.  For example, an ``ordinary'' character as an Emacs 
  17133.           command inserts itself; so in this context, a special character is 
  17134.           any character that does not normally insert itself (such as DEL, for 
  17135.           example), and quoting it makes it insert itself as if it were not 
  17136.           special.  Not all contexts allow quoting.  See Basic Editing. 
  17137.  
  17138. Read-Only Buffer 
  17139.           A read-only buffer is one whose text you are not allowed to change. 
  17140.           Normally Emacs makes buffers read-only when they contain text which 
  17141.           has a special significance to Emacs; for example, Dired buffers. 
  17142.           Visiting a file that is write protected also makes a read-only 
  17143.           buffer. See Buffers. 
  17144.  
  17145. Recursive Editing Level 
  17146.           A recursive editing level is a state in which part of the execution 
  17147.           of a command involves asking the user to edit some text.  This text 
  17148.           may or may not be the same as the text to which the command was 
  17149.           applied. The mode line indicates recursive editing levels with square 
  17150.           brackets (`[' and `]').  See Recursive Edit. 
  17151.  
  17152. Redisplay 
  17153.           Redisplay is the process of correcting the image on the screen to 
  17154.           correspond to changes that have been made in the text being edited. 
  17155.           See Screen. 
  17156.  
  17157. Regexp 
  17158.           See `regular expression'. 
  17159.  
  17160. Region 
  17161.           The region is the text between point (q.v.) and the mark (q.v.). Many 
  17162.           commands operate on the text of the region.  See Mark. 
  17163.  
  17164. Registers 
  17165.           Registers are named slots in which text or buffer positions or 
  17166.           rectangles can be saved for later use.  See Registers. 
  17167.  
  17168. Regular Expression 
  17169.           A regular expression is a pattern that can match various text 
  17170.           strings; for example, `l[0-9]+' matches `l' followed by one or more 
  17171.           digits.  See Regexps. 
  17172.  
  17173. Repeat Count 
  17174.           See `numeric argument'. 
  17175.  
  17176. Replacement 
  17177.           See `global substitution'. 
  17178.  
  17179. Restriction 
  17180.           A buffer's restriction is the amount of text, at the beginning or the 
  17181.           end of the buffer, that is temporarily inaccessible.  Giving a buffer 
  17182.           a nonzero amount of restriction is called narrowing (q.v.). See 
  17183.           Narrowing. 
  17184.  
  17185. RET 
  17186.           RET is a character than in Emacs runs the command to insert a newline 
  17187.           into the text.  It is also used to terminate most arguments read in 
  17188.           the minibuffer (q.v.).  See User Input. 
  17189.  
  17190. Saving 
  17191.           Saving a buffer means copying its text into the file that was visited 
  17192.           (q.v.) in that buffer.  This is the way text in files actually gets 
  17193.           changed by your Emacs editing.  See Saving. 
  17194.  
  17195. Scrolling 
  17196.           Scrolling means shifting the text in the Emacs window so as to see a 
  17197.           different part of the buffer.  See Display. 
  17198.  
  17199. Searching 
  17200.           Searching means moving point to the next occurrence of a specified 
  17201.           string.  See Search. 
  17202.  
  17203. Selecting 
  17204.           Selecting a buffer means making it the current (q.v.) buffer. See 
  17205.           Buffers. 
  17206.  
  17207. Self-Documentation 
  17208.           Self-documentation is the feature of Emacs which can tell you what 
  17209.           any command does, or give you a list of all commands related to a 
  17210.           topic you specify.  You ask for self-documentation with the help 
  17211.           character, C-h.  See Help. 
  17212.  
  17213. Sentences 
  17214.           Emacs has commands for moving by or killing by sentences. See 
  17215.           Sentences. 
  17216.  
  17217. Sexp 
  17218.           A sexp (short for `s-expression') is the basic syntactic unit of Lisp 
  17219.           in its textual form: either a list, or Lisp atom.  Many Emacs 
  17220.           commands operate on sexps.  The term `sexp' is generalized to 
  17221.           languages other than Lisp, to mean a syntactically recognizable 
  17222.           expression. See Lists. 
  17223.  
  17224. Simultaneous Editing 
  17225.           Simultaneous editing means two users modifying the same file at once. 
  17226.           Simultaneous editing if not detected can cause one user to lose his 
  17227.           work.  Emacs detects all cases of simultaneous editing and warns the 
  17228.           user to investigate them.  See Simultaneous Editing. 
  17229.  
  17230. String 
  17231.           A string is a kind of Lisp data object which contains a sequence of 
  17232.           characters.  Many Emacs variables are intended to have strings as 
  17233.           values.  The Lisp syntax for a string consists of the characters in 
  17234.           the string with a `"' before and another `"' after.  A `"' that is 
  17235.           part of the string must be written as `\"' and a `\' that is part of 
  17236.           the string must be written as `\\'.  All other characters, including 
  17237.           newline, can be included just by writing them inside the string; 
  17238.           however, escape sequences as in C, such as `\n' for newline or `\241' 
  17239.           using an octal character code, are allowed as well. 
  17240.  
  17241. String Substitution 
  17242.           See `global substitution'. 
  17243.  
  17244. Syntax Table 
  17245.           The syntax table tells Emacs which characters are part of a word, 
  17246.           which characters balance each other like parentheses, etc. See 
  17247.           Syntax. 
  17248.  
  17249. Super 
  17250.           Super is the name of a modifier bit which a keyboard input character 
  17251.           may have.  To make a character Super, type it while holding down the 
  17252.           SUPER key.  Such characters are given names that start with Super- 
  17253.           (usually written s- for short). See User Input. 
  17254.  
  17255. Tag Table 
  17256.           A tag table is a file that serves as an index to the function 
  17257.           definitions in one or more other files.  See Tags. 
  17258.  
  17259. Termscript File 
  17260.           A termscript file contains a record of all characters sent by Emacs 
  17261.           to the terminal.  It is used for tracking down bugs in Emacs 
  17262.           redisplay. Emacs does not make a termscript file unless you tell it 
  17263.           to. See Bugs. 
  17264.  
  17265. Text 
  17266.           Two meanings (see Text): 
  17267.  
  17268.    o Data consisting of a sequence of characters, as opposed to binary numbers, 
  17269.      images, graphics commands, executable programs, and the like. The contents 
  17270.      of an Emacs buffer are always text in this sense. 
  17271.  
  17272.    o Data consisting of written human language, as opposed to programs, or 
  17273.      following the stylistic conventions of human language. 
  17274.  
  17275. Top Level 
  17276.           Top level is the normal state of Emacs, in which you are editing the 
  17277.           text of the file you have visited.  You are at top level whenever you 
  17278.           are not in a recursive editing level (q.v.) or the minibuffer (q.v.), 
  17279.           and not in the middle of a command.  You can get back to top level by 
  17280.           aborting (q.v.) and quitting (q.v.).  See Quitting. 
  17281.  
  17282. Transposition 
  17283.           Transposing two units of text means putting each one into the place 
  17284.           formerly occupied by the other.  There are Emacs commands to 
  17285.           transpose two adjacent characters, words, sexps (q.v.) or lines (see 
  17286.           Transpose). 
  17287.  
  17288. Truncation 
  17289.           Truncating text lines in the display means leaving out any text on a 
  17290.           line that does not fit within the right margin of the window 
  17291.           displaying it.  See also `continuation line'. See Basic Editing. 
  17292.  
  17293. Undoing 
  17294.           Undoing means making your previous editing go in reverse, bringing 
  17295.           back the text that existed earlier in the editing session. See Undo. 
  17296.  
  17297. Variable 
  17298.           A variable is an object in Lisp that can store an arbitrary value. 
  17299.           Emacs uses some variables for internal purposes, and has others 
  17300.           (known as `options' (q.v.)) just so that you can set their values to 
  17301.           control the behavior of Emacs.  The variables used in Emacs that you 
  17302.           are likely to be interested in are listed in the Variables Index in 
  17303.           this manual.  See Variables, for information on variables. 
  17304.  
  17305. Version Control 
  17306.           Version control systems keep track of multiple versions of a source 
  17307.           file. They provide a more powerful alternative to keeping backup 
  17308.           files (q.v.). See Version Control. 
  17309.  
  17310. Visiting 
  17311.           Visiting a file means loading its contents into a buffer (q.v.) where 
  17312.           they can be edited.  See Visiting. 
  17313.  
  17314. Whitespace 
  17315.           Whitespace is any run of consecutive formatting characters (space, 
  17316.           tab, newline, and backspace). 
  17317.  
  17318. Widening 
  17319.           Widening is removing any restriction (q.v.) on the current buffer; it 
  17320.           is the opposite of narrowing (q.v.).  See Narrowing. 
  17321.  
  17322. Window 
  17323.           Emacs divides a frame (q.v.) into one or more windows, each of which 
  17324.           can display the contents of one buffer (q.v.) at any time. See 
  17325.           Screen, for basic information on how Emacs uses the screen. See 
  17326.           Windows, for commands to control the use of windows. 
  17327.  
  17328. Word Abbrev 
  17329.           Synonymous with `abbrev'. 
  17330.  
  17331. Word Search 
  17332.           Word search is searching for a sequence of words, considering the 
  17333.           punctuation between them as insignificant.  See Word Search. 
  17334.  
  17335. Yanking 
  17336.           Yanking means reinserting text previously killed.  It can be used to 
  17337.           undo a mistaken kill, or for copying or moving text.  Some other 
  17338.           systems call this ``pasting''.  See Yanking. 
  17339.  
  17340.  
  17341. ΓòÉΓòÉΓòÉ 38. Key (Character) Index ΓòÉΓòÉΓòÉ
  17342.  
  17343. Sorry, no ky index 
  17344.  
  17345.  
  17346. ΓòÉΓòÉΓòÉ 39. Command and Function Index ΓòÉΓòÉΓòÉ
  17347.  
  17348. Sorry, no fn index 
  17349.  
  17350.  
  17351. ΓòÉΓòÉΓòÉ 40. Variable Index ΓòÉΓòÉΓòÉ
  17352.  
  17353. Sorry, no vr index 
  17354.  
  17355.  
  17356. ΓòÉΓòÉΓòÉ 41. Concept Index ΓòÉΓòÉΓòÉ
  17357.  
  17358. Sorry, no cp index