home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 8 / CDASC08.ISO / VRAC / E17INFO.ZIP / EMACS-2 < prev    next >
Encoding:
GNU Info File  |  1993-07-18  |  46.7 KB  |  960 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.54 from the
  2. input file emacs.texi.
  3.  
  4. 
  5. File: emacs,  Node: Copying,  Next: Intro,  Prev: Distrib,  Up: Top
  6.  
  7. GNU GENERAL PUBLIC LICENSE
  8. **************************
  9.  
  10.                          Version 2, June 1991
  11.  
  12.      Copyright (C) 1989, 1991 Free Software Foundation, Inc.
  13.      675 Mass Ave, Cambridge, MA 02139, USA
  14.      
  15.      Everyone is permitted to copy and distribute verbatim copies
  16.      of this license document, but changing it is not allowed.
  17.  
  18. Preamble
  19. ========
  20.  
  21.    The licenses for most software are designed to take away your
  22. freedom to share and change it.  By contrast, the GNU General Public
  23. License is intended to guarantee your freedom to share and change free
  24. software--to make sure the software is free for all its users.  This
  25. General Public License applies to most of the Free Software
  26. Foundation's software and to any other program whose authors commit to
  27. using it.  (Some other Free Software Foundation software is covered by
  28. the GNU Library General Public License instead.)  You can apply it to
  29. your programs, too.
  30.  
  31.    When we speak of free software, we are referring to freedom, not
  32. price.  Our General Public Licenses are designed to make sure that you
  33. have the freedom to distribute copies of free software (and charge for
  34. this service if you wish), that you receive source code or can get it
  35. if you want it, that you can change the software or use pieces of it in
  36. new free programs; and that you know you can do these things.
  37.  
  38.    To protect your rights, we need to make restrictions that forbid
  39. anyone to deny you these rights or to ask you to surrender the rights.
  40. These restrictions translate to certain responsibilities for you if you
  41. distribute copies of the software, or if you modify it.
  42.  
  43.    For example, if you distribute copies of such a program, whether
  44. gratis or for a fee, you must give the recipients all the rights that
  45. you have.  You must make sure that they, too, receive or can get the
  46. source code.  And you must show them these terms so they know their
  47. rights.
  48.  
  49.    We protect your rights with two steps: (1) copyright the software,
  50. and (2) offer you this license which gives you legal permission to copy,
  51. distribute and/or modify the software.
  52.  
  53.    Also, for each author's protection and ours, we want to make certain
  54. that everyone understands that there is no warranty for this free
  55. software.  If the software is modified by someone else and passed on, we
  56. want its recipients to know that what they have is not the original, so
  57. that any problems introduced by others will not reflect on the original
  58. authors' reputations.
  59.  
  60.    Finally, any free program is threatened constantly by software
  61. patents.  We wish to avoid the danger that redistributors of a free
  62. program will individually obtain patent licenses, in effect making the
  63. program proprietary.  To prevent this, we have made it clear that any
  64. patent must be licensed for everyone's free use or not licensed at all.
  65.  
  66.    The precise terms and conditions for copying, distribution and
  67. modification follow.
  68.  
  69.     TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  70.  
  71.   0. This License applies to any program or other work which contains a
  72.      notice placed by the copyright holder saying it may be distributed
  73.      under the terms of this General Public License.  The "Program",
  74.      below, refers to any such program or work, and a "work based on
  75.      the Program" means either the Program or any derivative work under
  76.      copyright law: that is to say, a work containing the Program or a
  77.      portion of it, either verbatim or with modifications and/or
  78.      translated into another language.  (Hereinafter, translation is
  79.      included without limitation in the term "modification".)  Each
  80.      licensee is addressed as "you".
  81.  
  82.      Activities other than copying, distribution and modification are
  83.      not covered by this License; they are outside its scope.  The act
  84.      of running the Program is not restricted, and the output from the
  85.      Program is covered only if its contents constitute a work based on
  86.      the Program (independent of having been made by running the
  87.      Program).  Whether that is true depends on what the Program does.
  88.  
  89.   1. You may copy and distribute verbatim copies of the Program's
  90.      source code as you receive it, in any medium, provided that you
  91.      conspicuously and appropriately publish on each copy an appropriate
  92.      copyright notice and disclaimer of warranty; keep intact all the
  93.      notices that refer to this License and to the absence of any
  94.      warranty; and give any other recipients of the Program a copy of
  95.      this License along with the Program.
  96.  
  97.      You may charge a fee for the physical act of transferring a copy,
  98.      and you may at your option offer warranty protection in exchange
  99.      for a fee.
  100.  
  101.   2. You may modify your copy or copies of the Program or any portion
  102.      of it, thus forming a work based on the Program, and copy and
  103.      distribute such modifications or work under the terms of Section 1
  104.      above, provided that you also meet all of these conditions:
  105.  
  106.        a. You must cause the modified files to carry prominent notices
  107.           stating that you changed the files and the date of any change.
  108.  
  109.        b. You must cause any work that you distribute or publish, that
  110.           in whole or in part contains or is derived from the Program
  111.           or any part thereof, to be licensed as a whole at no charge
  112.           to all third parties under the terms of this License.
  113.  
  114.        c. If the modified program normally reads commands interactively
  115.           when run, you must cause it, when started running for such
  116.           interactive use in the most ordinary way, to print or display
  117.           an announcement including an appropriate copyright notice and
  118.           a notice that there is no warranty (or else, saying that you
  119.           provide a warranty) and that users may redistribute the
  120.           program under these conditions, and telling the user how to
  121.           view a copy of this License.  (Exception: if the Program
  122.           itself is interactive but does not normally print such an
  123.           announcement, your work based on the Program is not required
  124.           to print an announcement.)
  125.  
  126.      These requirements apply to the modified work as a whole.  If
  127.      identifiable sections of that work are not derived from the
  128.      Program, and can be reasonably considered independent and separate
  129.      works in themselves, then this License, and its terms, do not
  130.      apply to those sections when you distribute them as separate
  131.      works.  But when you distribute the same sections as part of a
  132.      whole which is a work based on the Program, the distribution of
  133.      the whole must be on the terms of this License, whose permissions
  134.      for other licensees extend to the entire whole, and thus to each
  135.      and every part regardless of who wrote it.
  136.  
  137.      Thus, it is not the intent of this section to claim rights or
  138.      contest your rights to work written entirely by you; rather, the
  139.      intent is to exercise the right to control the distribution of
  140.      derivative or collective works based on the Program.
  141.  
  142.      In addition, mere aggregation of another work not based on the
  143.      Program with the Program (or with a work based on the Program) on
  144.      a volume of a storage or distribution medium does not bring the
  145.      other work under the scope of this License.
  146.  
  147.   3. You may copy and distribute the Program (or a work based on it,
  148.      under Section 2) in object code or executable form under the terms
  149.      of Sections 1 and 2 above provided that you also do one of the
  150.      following:
  151.  
  152.        a. Accompany it with the complete corresponding machine-readable
  153.           source code, which must be distributed under the terms of
  154.           Sections 1 and 2 above on a medium customarily used for
  155.           software interchange; or,
  156.  
  157.        b. Accompany it with a written offer, valid for at least three
  158.           years, to give any third party, for a charge no more than your
  159.           cost of physically performing source distribution, a complete
  160.           machine-readable copy of the corresponding source code, to be
  161.           distributed under the terms of Sections 1 and 2 above on a
  162.           medium customarily used for software interchange; or,
  163.  
  164.        c. Accompany it with the information you received as to the offer
  165.           to distribute corresponding source code.  (This alternative is
  166.           allowed only for noncommercial distribution and only if you
  167.           received the program in object code or executable form with
  168.           such an offer, in accord with Subsection b above.)
  169.  
  170.      The source code for a work means the preferred form of the work for
  171.      making modifications to it.  For an executable work, complete
  172.      source code means all the source code for all modules it contains,
  173.      plus any associated interface definition files, plus the scripts
  174.      used to control compilation and installation of the executable.
  175.      However, as a special exception, the source code distributed need
  176.      not include anything that is normally distributed (in either
  177.      source or binary form) with the major components (compiler,
  178.      kernel, and so on) of the operating system on which the executable
  179.      runs, unless that component itself accompanies the executable.
  180.  
  181.      If distribution of executable or object code is made by offering
  182.      access to copy from a designated place, then offering equivalent
  183.      access to copy the source code from the same place counts as
  184.      distribution of the source code, even though third parties are not
  185.      compelled to copy the source along with the object code.
  186.  
  187.   4. You may not copy, modify, sublicense, or distribute the Program
  188.      except as expressly provided under this License.  Any attempt
  189.      otherwise to copy, modify, sublicense or distribute the Program is
  190.      void, and will automatically terminate your rights under this
  191.      License.  However, parties who have received copies, or rights,
  192.      from you under this License will not have their licenses
  193.      terminated so long as such parties remain in full compliance.
  194.  
  195.   5. You are not required to accept this License, since you have not
  196.      signed it.  However, nothing else grants you permission to modify
  197.      or distribute the Program or its derivative works.  These actions
  198.      are prohibited by law if you do not accept this License.
  199.      Therefore, by modifying or distributing the Program (or any work
  200.      based on the Program), you indicate your acceptance of this
  201.      License to do so, and all its terms and conditions for copying,
  202.      distributing or modifying the Program or works based on it.
  203.  
  204.   6. Each time you redistribute the Program (or any work based on the
  205.      Program), the recipient automatically receives a license from the
  206.      original licensor to copy, distribute or modify the Program
  207.      subject to these terms and conditions.  You may not impose any
  208.      further restrictions on the recipients' exercise of the rights
  209.      granted herein.  You are not responsible for enforcing compliance
  210.      by third parties to this License.
  211.  
  212.   7. If, as a consequence of a court judgment or allegation of patent
  213.      infringement or for any other reason (not limited to patent
  214.      issues), conditions are imposed on you (whether by court order,
  215.      agreement or otherwise) that contradict the conditions of this
  216.      License, they do not excuse you from the conditions of this
  217.      License.  If you cannot distribute so as to satisfy simultaneously
  218.      your obligations under this License and any other pertinent
  219.      obligations, then as a consequence you may not distribute the
  220.      Program at all.  For example, if a patent license would not permit
  221.      royalty-free redistribution of the Program by all those who
  222.      receive copies directly or indirectly through you, then the only
  223.      way you could satisfy both it and this License would be to refrain
  224.      entirely from distribution of the Program.
  225.  
  226.      If any portion of this section is held invalid or unenforceable
  227.      under any particular circumstance, the balance of the section is
  228.      intended to apply and the section as a whole is intended to apply
  229.      in other circumstances.
  230.  
  231.      It is not the purpose of this section to induce you to infringe any
  232.      patents or other property right claims or to contest validity of
  233.      any such claims; this section has the sole purpose of protecting
  234.      the integrity of the free software distribution system, which is
  235.      implemented by public license practices.  Many people have made
  236.      generous contributions to the wide range of software distributed
  237.      through that system in reliance on consistent application of that
  238.      system; it is up to the author/donor to decide if he or she is
  239.      willing to distribute software through any other system and a
  240.      licensee cannot impose that choice.
  241.  
  242.      This section is intended to make thoroughly clear what is believed
  243.      to be a consequence of the rest of this License.
  244.  
  245.   8. If the distribution and/or use of the Program is restricted in
  246.      certain countries either by patents or by copyrighted interfaces,
  247.      the original copyright holder who places the Program under this
  248.      License may add an explicit geographical distribution limitation
  249.      excluding those countries, so that distribution is permitted only
  250.      in or among countries not thus excluded.  In such case, this
  251.      License incorporates the limitation as if written in the body of
  252.      this License.
  253.  
  254.   9. The Free Software Foundation may publish revised and/or new
  255.      versions of the General Public License from time to time.  Such
  256.      new versions will be similar in spirit to the present version, but
  257.      may differ in detail to address new problems or concerns.
  258.  
  259.      Each version is given a distinguishing version number.  If the
  260.      Program specifies a version number of this License which applies
  261.      to it and "any later version", you have the option of following
  262.      the terms and conditions either of that version or of any later
  263.      version published by the Free Software Foundation.  If the Program
  264.      does not specify a version number of this License, you may choose
  265.      any version ever published by the Free Software Foundation.
  266.  
  267.  10. If you wish to incorporate parts of the Program into other free
  268.      programs whose distribution conditions are different, write to the
  269.      author to ask for permission.  For software which is copyrighted
  270.      by the Free Software Foundation, write to the Free Software
  271.      Foundation; we sometimes make exceptions for this.  Our decision
  272.      will be guided by the two goals of preserving the free status of
  273.      all derivatives of our free software and of promoting the sharing
  274.      and reuse of software generally.
  275.  
  276.                                 NO WARRANTY
  277.  
  278.  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
  279.      WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
  280.      LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
  281.      HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
  282.      WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
  283.      NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  284.      FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE
  285.      QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  286.      PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
  287.      SERVICING, REPAIR OR CORRECTION.
  288.  
  289.  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
  290.      WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
  291.      MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
  292.      LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
  293.      INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
  294.      INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
  295.      DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
  296.      OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
  297.      OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
  298.      ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  299.  
  300.                       END OF TERMS AND CONDITIONS
  301.  
  302. How to Apply These Terms to Your New Programs
  303. =============================================
  304.  
  305.    If you develop a new program, and you want it to be of the greatest
  306. possible use to the public, the best way to achieve this is to make it
  307. free software which everyone can redistribute and change under these
  308. terms.
  309.  
  310.    To do so, attach the following notices to the program.  It is safest
  311. to attach them to the start of each source file to most effectively
  312. convey the exclusion of warranty; and each file should have at least
  313. the "copyright" line and a pointer to where the full notice is found.
  314.  
  315.      ONE LINE TO GIVE THE PROGRAM'S NAME AND AN IDEA OF WHAT IT DOES.
  316.      Copyright (C) 19YY  NAME OF AUTHOR
  317.      
  318.      This program is free software; you can redistribute it and/or
  319.      modify it under the terms of the GNU General Public License
  320.      as published by the Free Software Foundation; either version 2
  321.      of the License, or (at your option) any later version.
  322.      
  323.      This program is distributed in the hope that it will be useful,
  324.      but WITHOUT ANY WARRANTY; without even the implied warranty of
  325.      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  326.      GNU General Public License for more details.
  327.      
  328.      You should have received a copy of the GNU General Public License
  329.      along with this program; if not, write to the Free Software
  330.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  331.  
  332.    Also add information on how to contact you by electronic and paper
  333. mail.
  334.  
  335.    If the program is interactive, make it output a short notice like
  336. this when it starts in an interactive mode:
  337.  
  338.      Gnomovision version 69, Copyright (C) 19YY NAME OF AUTHOR
  339.      Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
  340.      type `show w'.  This is free software, and you are welcome
  341.      to redistribute it under certain conditions; type `show c'
  342.      for details.
  343.  
  344.    The hypothetical commands `show w' and `show c' should show the
  345. appropriate parts of the General Public License.  Of course, the
  346. commands you use may be called something other than `show w' and `show
  347. c'; they could even be mouse-clicks or menu items--whatever suits your
  348. program.
  349.  
  350.    You should also get your employer (if you work as a programmer) or
  351. your school, if any, to sign a "copyright disclaimer" for the program,
  352. if necessary.  Here is a sample; alter the names:
  353.  
  354.      Yoyodyne, Inc., hereby disclaims all copyright
  355.      interest in the program `Gnomovision'
  356.      (which makes passes at compilers) written
  357.      by James Hacker.
  358.      
  359.      SIGNATURE OF TY COON, 1 April 1989
  360.      Ty Coon, President of Vice
  361.  
  362.    This General Public License does not permit incorporating your
  363. program into proprietary programs.  If your program is a subroutine
  364. library, you may consider it more useful to permit linking proprietary
  365. applications with the library.  If this is what you want to do, use the
  366. GNU Library General Public License instead of this License.
  367.  
  368. 
  369. File: emacs,  Node: Intro,  Next: Glossary,  Prev: Copying,  Up: Top
  370.  
  371. Introduction
  372. ************
  373.  
  374.    You are reading about GNU Emacs, the GNU incarnation of the advanced,
  375. self-documenting, customizable, extensible real-time display editor
  376. Emacs.  (The `G' in `GNU' is not silent.)
  377.  
  378.    We say that Emacs is a "display" editor because normally the text
  379. being edited is visible on the screen and is updated automatically as
  380. you type your commands.  *Note Display: Screen.
  381.  
  382.    We call it a "real-time" editor because the display is updated very
  383. frequently, usually after each character or pair of characters you
  384. type.  This minimizes the amount of information you must keep in your
  385. head as you edit.  *Note Real-time: Basic.
  386.  
  387.    We call Emacs advanced because it provides facilities that go beyond
  388. simple insertion and deletion: filling of text; automatic indentation of
  389. programs; viewing two or more files at once; and dealing in terms of
  390. characters, words, lines, sentences, paragraphs, and pages, as well as
  391. expressions and comments in several different programming languages.
  392.  
  393.    "Self-documenting" means that at any time you can type a special
  394. character, `Control-h', to find out what your options are.  You can
  395. also use it to find out what any command does, or to find all the
  396. commands that pertain to a topic.  *Note Help::.
  397.  
  398.    "Customizable" means that you can change the definitions of Emacs
  399. commands in little ways.  For example, if you use a programming
  400. language in which comments start with `<**' and end with `**>', you can
  401. tell the Emacs comment manipulation commands to use those strings
  402. (*note Comments::.).  Another sort of customization is rearrangement of
  403. the command set.  For example, if you prefer the four basic cursor
  404. motion commands (up, down, left and right) on keys in a diamond pattern
  405. on the keyboard, you can have it.  *Note Customization::.
  406.  
  407.    "Extensible" means that you can go beyond simple customization and
  408. write entirely new commands, programs in the Lisp language to be run by
  409. Emacs's own Lisp interpreter.  Emacs is an "on-line extensible" system,
  410. which means that it is divided into many functions that call each other,
  411. any of which can be redefined in the middle of an editing session.  Any
  412. part of Emacs can be replaced without making a separate copy of all of
  413. Emacs.  Most of the editing commands of Emacs are written in Lisp
  414. already; the few exceptions could have been written in Lisp but are
  415. written in C for efficiency.  Although only a programmer can write an
  416. extension, anybody can use it afterward.
  417.  
  418.    When run under the X Window System, Emacs provides its own menus and
  419. convenient bindings to mouse buttons.  But Emacs can provide many of the
  420. benefits of a window system on a text-only terminal.  For instance, you
  421. can look at or edit several files at once, move text between them, and
  422. edit files at the same time as you run shell commands.
  423.  
  424. 
  425. File: emacs,  Node: Screen,  Next: User Input,  Prev: Concept Index,  Up: Top
  426.  
  427. The Organization of the Screen
  428. ******************************
  429.  
  430.    On a text-only terminal, the Emacs display occupies the whole screen.
  431. On the X Window System, Emacs creates its own X windows to use.  We use
  432. the term "frame" to mean an entire text-only screen or an entire X
  433. window used by Emacs.  Emacs uses both kinds of frames in the same way
  434. to display your editing.  Emacs normally starts out with just one frame,
  435. but under X you can create additional frames if you wish.  *Note
  436. Frames::.
  437.  
  438.    When you start Emacs, the entire frame except for the last line is
  439. devoted to the text you are editing.  This area is called "window".
  440. The last line is a special "echo area" or "minibuffer window" where
  441. prompts appear and where you can enter responses.  You can subdivide
  442. the large text window horizontally or vertically into multiple text
  443. windows, each of which can be used for a different file (*note
  444. Windows::.).  In this manual, the word "window" always refers to the
  445. subdivisions of a frame within Emacs.
  446.  
  447.    The window that the cursor is in is the "selected window", in which
  448. editing takes place.  Most Emacs commands implicitly apply to the text
  449. in the selected window.  The other windows display text for reference
  450. only, unless/until you select them.
  451.  
  452.    Each window's last line is a "mode line" which describes what is
  453. going on in that window.  It is in inverse video if the terminal
  454. supports that, and contains text that starts like `-----Emacs:
  455. SOMETHING'.  Its purpose is to indicate what buffer is being displayed
  456. above it in the window; what major and minor modes are in use; and
  457. whether the buffer contains unsaved changes.
  458.  
  459. * Menu:
  460.  
  461. * Point::    The place in the text where editing commands operate.
  462. * Echo Area::   Short messages appear at the bottom of the screen.
  463. * Mode Line::    Interpreting the mode line.
  464.  
  465. 
  466. File: emacs,  Node: Point,  Next: Echo Area,  Up: Screen
  467.  
  468. Point
  469. =====
  470.  
  471.    Within Emacs, the terminal's cursor shows the location at which
  472. editing commands will take effect.  This location is called "point".
  473. Other commands move point through the text, so that you can edit at
  474. different places in it.
  475.  
  476.    While the cursor appears to point AT a character, you should think
  477. of point as BETWEEN two characters; it points BEFORE the character that
  478. appears under the cursor.  For example, if your text looks like `frob'
  479. with the cursor over the `b', then point is between the `o' and the
  480. `b'.  If you insert the character `!' at that position, the result is
  481. `fro!b', with point between the `!' and the `b'.  Thus, the cursor
  482. remains over the `b', as before.
  483.  
  484.    Sometimes people speak of "the cursor" when they mean "point", or
  485. speak of commands that move point as "cursor motion" commands.
  486.  
  487.    Terminals have only one cursor, and when output is in progress it
  488. must appear where the typing is being done.  This does not mean that
  489. point is moving.  It is only that Emacs has no way to show you the
  490. location of point except when the terminal is idle.
  491.  
  492.    If you are editing several files in Emacs, each in its own buffer,
  493. each buffer has its own point location.  A buffer that is not currently
  494. displayed remembers where point is in case you display it again later.
  495.  
  496.    When there are multiple windows, each window has its own point
  497. location.  The cursor shows the location of point in the selected
  498. window.  This also is how you can tell which window is selected.  If the
  499. same buffer appears in more than one window, each window has its own
  500. position for point in that buffer.
  501.  
  502.    The term `point' comes from the character `.', which was the command
  503. in TECO (the language in which the original Emacs was written) for
  504. accessing the value now called `point'.
  505.  
  506. 
  507. File: emacs,  Node: Echo Area,  Next: Mode Line,  Prev: Point,  Up: Screen
  508.  
  509. The Echo Area
  510. =============
  511.  
  512.    The line at the bottom of the screen (below the mode line) is the
  513. "echo area".  It is used to display small amounts of text for several
  514. purposes.
  515.  
  516.    "Echoing" means printing out the characters that you type.  Outside
  517. Emacs, the operating system normally echoes all your input.  Emacs
  518. handles echoing differently.
  519.  
  520.    Single-character commands do not echo in Emacs, and multi-character
  521. commands echo only if you pause while typing them.  As soon as you pause
  522. for more than a second in the middle of a command, Emacs echoes all the
  523. characters of the command so far.  This is to "prompt" you for the rest
  524. of the command.  Once echoing has started, the rest of the command
  525. echoes immediately as you type it.  This behavior is designed to give
  526. confident users fast response, while giving hesitant users maximum
  527. feedback.  You can change this behavior by setting a variable (*note
  528. Display Vars::.).
  529.  
  530.    If a command cannot be executed, it may print an "error message" in
  531. the echo area.  Error messages are accompanied by a beep or by flashing
  532. the screen.  Also, any input you have typed ahead is thrown away when
  533. an error happens.
  534.  
  535.    Some commands print informative messages in the echo area.  These
  536. messages look much like error messages, but they are not announced with
  537. a beep and do not throw away input.  Sometimes the message tells you
  538. what the command has done, when this is not obvious from looking at the
  539. text being edited.  Sometimes the sole purpose of a command is to print
  540. a message giving you specific information--for example, `C-x =' prints
  541. a message describing the character position of point in the text and
  542. its current column in the window.  Commands that take a long time often
  543. display messages ending in `...' while they are working, and add `done'
  544. at the end when they are finished.
  545.  
  546.    The echo area is also used to display the "minibuffer", a window that
  547. is used for reading arguments to commands, such as the name of a file
  548. to be edited.  When the minibuffer is in use, the echo area begins with
  549. a prompt string that usually ends with a colon; also, the cursor
  550. appears in that line because it is the selected window.  You can always
  551. get out of the minibuffer by typing `C-g'.  *Note Minibuffer::.
  552.  
  553. 
  554. File: emacs,  Node: Mode Line,  Prev: Echo Area,  Up: Screen
  555.  
  556. The Mode Line
  557. =============
  558.  
  559.    Each text window's last line is a "mode line" which describes what is
  560. going on in that window.  When there is only one text window, the mode
  561. line appears right above the echo area.  The mode line is in inverse
  562. video if the terminal supports that, starts and ends with dashes, and
  563. contains text like `Emacs: SOMETHING'.
  564.  
  565.    If a mode line has something else in place of `Emacs: SOMETHING',
  566. then the window above it is in a special subsystem such as Dired.  The
  567. mode line then indicates the status of the subsystem.
  568.  
  569.    Normally, the mode line looks like this:
  570.  
  571.      --CH-Emacs: BUF      (MAJOR MINOR)----POS------
  572.  
  573. This gives information about the buffer being displayed in the window:
  574. the buffer's name, what major and minor modes are in use, whether the
  575. buffer's text has been changed, and how far down the buffer you are
  576. currently looking.
  577.  
  578.    CH contains two stars `**' if the text in the buffer has been edited
  579. (the buffer is "modified"), or `--' if the buffer has not been edited.
  580. Exception: for a read-only buffer, it is `%%'.
  581.  
  582.    BUF is the name of the window's "buffer".  In most cases this is the
  583. same as the name of a file you are editing.  *Note Buffers::.
  584.  
  585.    The buffer displayed in the selected window (the window that the
  586. cursor is in) is also Emacs's selected buffer, the one that editing
  587. takes place in.  When we speak of what some command does to "the
  588. buffer", we are talking about the currently selected buffer.
  589.  
  590.    POS tells you whether there is additional text above the top of the
  591. window, or below the bottom.  If your buffer is small and it is all
  592. visible in the window, POS is `All'.  Otherwise, it is `Top' if you are
  593. looking at the beginning of the buffer, `Bot' if you are looking at the
  594. end of the buffer, or `NN%', where NN is the percentage of the buffer
  595. above the top of the window.
  596.  
  597.    MAJOR is the name of the "major mode" in effect in the buffer.  At
  598. any time, each buffer is in one and only one of the possible major
  599. modes.  The major modes available include Fundamental mode (the least
  600. specialized), Text mode, Lisp mode, and C mode.  *Note Major Modes::,
  601. for details of how the modes differ and how to select one.
  602.  
  603.    MINOR is a list of some of the "minor modes" that are turned on at
  604. the moment in the window's chosen buffer.  `Fill' means that Auto Fill
  605. mode is on.  `Abbrev' means that Word Abbrev mode is on.  `Ovwrt' means
  606. that Overwrite mode is on.  *Note Minor Modes::, for more information.
  607. `Narrow' means that the buffer being displayed has editing restricted
  608. to only a portion of its text.  This is not really a minor mode, but is
  609. like one.  *Note Narrowing::.  `Def' means that a keyboard macro is
  610. being defined.  *Note Keyboard Macros::.
  611.  
  612.    Some buffers display additional information after the minor modes.
  613. For example, Rmail buffers display the current message number and the
  614. total number of messages.  Compilation buffers and Shell mode display
  615. the status of the subprocess.
  616.  
  617.    In addition, if Emacs is currently inside a recursive editing level,
  618. square brackets (`[...]') appear around the parentheses that surround
  619. the modes.  If Emacs is in one recursive editing level within another,
  620. double square brackets appear, and so on.  Since recursive editing
  621. levels affect Emacs globally and not any one buffer, the square
  622. brackets appear in every window's mode line or not in any of them.
  623. *Note Recursive Edit::.
  624.  
  625.    *Note Optional Display::, for features that add other handy
  626. information to the mode line, such as the current line number of point,
  627. the current time, and whether mail has arrived for you.
  628.  
  629. 
  630. File: emacs,  Node: User Input,  Next: Keys,  Prev: Screen,  Up: Top
  631.  
  632. Keyboard Input
  633. ==============
  634.  
  635.    GNU Emacs uses an extension of the ASCII character set for keyboard
  636. input.  ASCII consists of 128 character codes.  Some of these codes are
  637. assigned graphic symbols such as `a' and `='; the rest are control
  638. characters, such as `Control-a' (usually written `C-a' for short).
  639. `C-a' gets its name from the fact that you type it by holding down the
  640. CTRL key and then pressing `a'.
  641.  
  642.    Some control characters have special names, and special keys you can
  643. type them with: for example, RET, TAB, LFD, DEL and ESC.  The space
  644. character is usually referred to below as SPC, even though strictly
  645. speaking it is a graphic character whose graphic happens to be blank.
  646.  
  647.    On ASCII terminals, the shift key is meaningless with control
  648. characters: `C-a' and `C-A' are the same character, and Emacs cannot
  649. distinguish them.  Under X Windows, these are distinct characters, but
  650. the standard key bindings treat them the same in all contexts.
  651.  
  652.    On ASCII terminals, there are only 32 possible control characters.
  653. These are the control variants of letters and `@[]\^_'.  Under X
  654. Windows, every non-control character has a control variant.  For
  655. example, `C-+' and `C-5' are meaningful under X.
  656.  
  657.    Emacs extends the ASCII character code by adding an extra bit to each
  658. character.  The additional bit is called Meta.  Any character can be
  659. made Meta; examples of Meta characters include `Meta-a' (normally
  660. written `M-a', for short), `M-A' (not the same character as `M-a', but
  661. those two characters normally have the same meaning in Emacs), `M-RET',
  662. and `M-C-a'.  For traditional reasons, `M-C-a' is usually called
  663. `C-M-a'; logically speaking, the order in which the modifier keys CTRL
  664. and META are mentioned does not matter.
  665.  
  666.    Some terminals have a META key, and allow you to type Meta
  667. characters by holding this key down.  Thus, `Meta-a' is typed by
  668. holding down META and pressing `a'.  The META key works much like the
  669. SHIFT key.  Such a key is not always labeled META, however, as this
  670. function is often a special option for a key with some other primary
  671. purpose.
  672.  
  673.    If there is no META key, you can still type Meta characters using
  674. two-character sequences starting with ESC.  Thus, to enter `M-a', you
  675. could type `ESC a'.  To enter `C-M-a', you would type `ESC C-a'.  ESC
  676. is allowed on terminals with Meta keys, too, in case you have formed a
  677. habit of using it.
  678.  
  679.    X Windows provides several other modifier keys that can be applied to
  680. any keyboard input character.  These are called SUPER, HYPER and ALT.
  681. With them, you can make characters that we denote with `s-', `H-' and
  682. `A-'.  Thus, `s-H-C-x' is short for `Super-Hyper-Control-x'.  Not all X
  683. terminals actually provide keys for these modifier flags, and the
  684. standard key bindings of Emacs do not include such characters.  But you
  685. can assign them meanings of your own by customizing Emacs.
  686.  
  687.    Keyboard input includes keyboard keys that are not characters at all:
  688. for example function keys and arrow keys.  Mouse buttons are also
  689. outside the gamut of characters.  These inputs do not have numeric
  690. character codes.  Instead, Emacs represents them by their names
  691. (actually, Lisp objects called "symbols").
  692.  
  693.    Input characters and non-character inputs are collectively called
  694. "input events".
  695.  
  696.    ASCII terminals cannot really send anything to the computer except
  697. ASCII characters.  These terminals use a sequence of characters to
  698. represent each function key.  But that is invisible to the Emacs user,
  699. because the keyboard input routines recognize these special sequences
  700. and converts them to names before any other part of Emacs gets to see
  701. them.
  702.  
  703. 
  704. File: emacs,  Node: Keys,  Next: Commands,  Prev: User Input,  Up: Top
  705.  
  706. Keys
  707. ====
  708.  
  709.    A "key sequence" ("key", for short) is a sequence of input events
  710. that combine as part of the invocation of a single command.  Recall
  711. that input events include both keyboard characters and non-character
  712. inputs (function keys, arrow keys, mouse buttons, and so forth).
  713.  
  714.    If the sequence is enough to invoke a command, it is a "complete
  715. key".  If it isn't long enough to be complete, we call it a "prefix
  716. key".  Examples of complete keys include `C-a', `X', RET, NEXT (a
  717. function key), DOWN (an arrow key), `C-x C-f' and `C-x 4 C-f'.
  718.  
  719.    Most single characters constitute complete keys in the standard Emacs
  720. command bindings.  A few of them are prefix keys.  A prefix key can be
  721. followed by additional input characters (or other events) to make a
  722. longer key, which may itself be complete or a prefix.
  723.  
  724.    For example, `C-x' is a prefix key, so `C-x' and the next input
  725. character combine to make a two-character key sequence.  Most of these
  726. key sequences are complete keys, including `C-x C-f' and `C-x b'.  A
  727. few, such as `C-x 4' and `C-x r', are themselves prefix keys that lead
  728. to three-character key sequences.  There's no limit to the length of a
  729. key sequence, but any key sequence longer than one character must be
  730. reached through a chain of prefix keys.
  731.  
  732.    By contrast, the two-character sequence `C-f C-k' is not a key,
  733. because the `C-f' is a complete key in itself.  It's impossible to give
  734. `C-f C-k' an independent meaning as a command.  `C-f C-k' is two key
  735. sequences, not one.
  736.  
  737.    All told, the prefix keys in Emacs are `C-c', `C-x', `C-h', `C-x
  738. C-a', `C-x n', `C-x r', `C-x v', `C-x 4', `C-x 5', and ESC.  But this
  739. is not cast in concrete; it is just a matter of Emacs's standard key
  740. bindings.  In customizing Emacs, you could make new prefix keys, or
  741. eliminate these.  *Note Key Bindings::.
  742.  
  743.    Whether a sequence is a key can be changed by customization.  For
  744. example, if you redefine `C-f' as a prefix, `C-f C-k' automatically
  745. becomes a key (complete, unless you define it too as a prefix).
  746. Conversely, if you remove the prefix definition of `C-x 4', then `C-x 4
  747. f' (or `C-x 4 ANYTHING') is no longer a key.
  748.  
  749. 
  750. File: emacs,  Node: Commands,  Next: Text Characters,  Prev: Keys,  Up: Top
  751.  
  752. Keys and Commands
  753. =================
  754.  
  755.    This manual is full of passages that tell you what particular keys
  756. do.  But Emacs does not assign meanings to keys directly.  Instead,
  757. Emacs assigns meanings to named "commands", and then gives keys their
  758. meanings by "binding" them to commands.
  759.  
  760.    Every command has a name chosen by a programmer.  The name is usually
  761. made of a few English words separated by dashes; for example,
  762. `next-line' or `forward-word'.  A command also has a "function
  763. definition" which is a Lisp program; this is what makes the command do
  764. what it does.  In Emacs Lisp, a command is actually a special kind of
  765. Lisp function; one which specifies how to read arguments for it and
  766. call it interactively.  For more information on commands and functions,
  767. see *Note What Is a Function: (elisp)What Is a Function.  (The
  768. definition we use in this manual is simplified slightly.)
  769.  
  770.    The bindings between keys and commands are recorded in various tables
  771. called "keymaps".  *Note Keymaps::.
  772.  
  773.    When we say that "`C-n' moves down vertically one line" we are
  774. glossing over a distinction that is irrelevant in ordinary use but is
  775. vital in understanding how to customize Emacs.  It is the command
  776. `next-line' that is programmed to move down vertically.  `C-n' has this
  777. effect *because* it is bound to that command.  If you rebind `C-n' to
  778. the command `forward-word' then `C-n' will move forward by words
  779. instead.  Rebinding keys is a common method of customization.
  780.  
  781.    In the rest of this manual, we usually ignore this subtlety to keep
  782. things simple.  To give the customizer the information he needs, we
  783. state the name of the command which really does the work in parentheses
  784. after mentioning the key that runs it.  For example, we will say that
  785. "The command `C-n' (`next-line') moves point vertically down," meaning
  786. that `next-line' is a command that moves vertically down and `C-n' is a
  787. key that is standardly bound to it.
  788.  
  789.    While we are on the subject of information for customization only,
  790. it's a good time to tell you about "variables".  Often the description
  791. of a command will say, "To change this, set the variable `mumble-foo'."
  792. A variable is a name used to remember a value.  Most of the variables
  793. documented in this manual exist just to facilitate customization: some
  794. command or other part of Emacs examines the variable and behaves
  795. differently accordingly.  Until you are interested in customizing, you
  796. can ignore the information about variables.  When you are ready to be
  797. interested, read the basic information on variables, and then the
  798. information on individual variables will make sense.  *Note Variables::.
  799.  
  800. 
  801. File: emacs,  Node: Text Characters,  Next: Entering Emacs,  Prev: Commands,  Up: Top
  802.  
  803. Character Set for Text
  804. ======================
  805.  
  806.    Emacs buffers use an 8-bit character set, because bytes have 8 bits.
  807. ASCII graphic characters in Emacs buffers are displayed with their
  808. graphics.  The newline character (which has the same character code as
  809. LFD) is displayed by starting a new line.  The tab character is
  810. displayed by moving to the next tab stop column (usually every 8
  811. columns).  Other control characters are displayed as a caret (`^')
  812. followed by the non-control version of the character; thus, `C-a' is
  813. displayed as `^A'.
  814.  
  815.    Non-ASCII characters 128 and up are displayed with octal escape
  816. sequences; thus, character code 243 (octal) is displayed as `\243'.
  817. You can customize the display of these character codes (or ANSI
  818. characters) by creating a "display table"; this is useful for editing
  819. files that use 8-bit European character sets.  *Note Display Tables:
  820. (elisp)Display Tables.
  821.  
  822. 
  823. File: emacs,  Node: Entering Emacs,  Next: Exiting,  Prev: Text Characters,  Up: Top
  824.  
  825. Entering and Exiting Emacs
  826. **************************
  827.  
  828.    The usual way to invoke Emacs is with the shell command `emacs'.
  829. Emacs clears the screen and then displays an initial help message and
  830. copyright notice.  On a window system, Emacs opens a window of its own.
  831. You can begin typing Emacs commands immediately afterward.
  832.  
  833.    Some operating systems insist on discarding all type-ahead when Emacs
  834. starts up; they give Emacs no way to prevent this.  Therefore, it is
  835. wise to wait until Emacs clears the screen before typing your first
  836. editing command.
  837.  
  838.    If you run Emacs from a shell window under the X Window System, run
  839. it in the background with `emacs&'.  This way, Emacs does not tie up
  840. the shell window, so you can use it to run other shell commands while
  841. Emacs operates its own X windows.
  842.  
  843.    When Emacs starts up, it makes a buffer named `*scratch*'.  That's
  844. the buffer you start out in.  The `*scratch*' uses Lisp Interaction
  845. mode; you can use it to type Lisp expressions and evaluate them, or you
  846. can ignore that capability and simply doodle.  (You can specify a
  847. different major mode for this buffer by setting the variable
  848. `initial-major-mode' in your init file.  *Note Init File::.)
  849.  
  850.    It is also possible to specify files to be visited, Lisp files to be
  851. loaded, and functions to be called, by giving Emacs arguments in the
  852. shell command line.  *Note Command Arguments::.  But we don't recommend
  853. doing this.  The feature exists mainly for compatibility with other
  854. editors.
  855.  
  856.    Many other editors are designed to be started afresh each time you
  857. want to edit.  You edit one file and then exit the editor.  The next
  858. time you want to edit either another file or the same one, you must run
  859. the editor again.  With these editors, it makes sense to use a command
  860. line argument to say which file to edit.
  861.  
  862.    But starting a new Emacs each time you want to edit a different file
  863. does not make sense.  For one thing, this would be annoyingly slow.  For
  864. another, this would fail to take advantage of Emacs's ability to visit
  865. more than one file in a single editing session.
  866.  
  867.    The recommended way to use GNU Emacs is to start it only once, just
  868. after you log in, and do all your editing in the same Emacs session.
  869. Each time you want to edit a different file, you visit it with the
  870. existing Emacs, which eventually comes to have many files in it ready
  871. for editing.  Usually you do not kill the Emacs until you are about to
  872. log out.
  873.  
  874. 
  875. File: emacs,  Node: Exiting,  Next: Basic,  Prev: Entering Emacs,  Up: Top
  876.  
  877. Exiting Emacs
  878. =============
  879.  
  880.    There are two commands for exiting Emacs because there are two kinds
  881. of exiting: "suspending" Emacs and "killing" Emacs.
  882.  
  883.    "Suspending" means stopping Emacs temporarily and returning control
  884. to its parent process (usually a shell), allowing you to resume editing
  885. later in the same Emacs job, with the same files, same kill ring, same
  886. undo history, and so on.  This is the usual way to exit.
  887.  
  888.    "Killing" Emacs means destroying the Emacs job.  You can run Emacs
  889. again later, but you will get a fresh Emacs; there is no way to resume
  890. the same editing session after it has been killed.
  891.  
  892. `C-z'
  893.      Suspend Emacs (`suspend-emacs').
  894.  
  895. `C-x C-c'
  896.      Kill Emacs (`save-buffers-kill-emacs').
  897.  
  898.    To suspend Emacs, type `C-z' (`suspend-emacs').  This takes you back
  899. to the shell from which you invoked Emacs.  You can resume Emacs with
  900. the shell command `%emacs' in most common shells.
  901.  
  902.    On systems that do not permit programs to be suspended, `C-z' runs
  903. an inferior shell that communicates directly with the terminal, and
  904. Emacs waits until you exit the subshell.  (The way to do that is
  905. probably with `C-d' or `exit', but it depends on which shell you use.)
  906. The only way on these systems to get back to the shell from which Emacs
  907. was run (to log out, for example) is to kill Emacs.
  908.  
  909.    When Emacs communicates directly with an X server and creates its own
  910. dedicated X windows, `C-z' has a different meaning.  Suspending an
  911. applications that uses its own X windows is not meaningful or useful.
  912. Instead, `C-z' runs the command `iconify-frame', which temporarily
  913. closes up the selected Emacs frame.  The way to get back to a shell
  914. window is with the window manager.
  915.  
  916.    To kill Emacs, type `C-x C-c' (`save-buffers-kill-emacs').  A
  917. two-character key is used for this to make it harder to type.  Unless a
  918. numeric argument is used, this command first offers to save any modified
  919. buffers.  If you do not save them all, it asks for reconfirmation with
  920. `yes' before killing Emacs, since any changes not saved will be lost
  921. forever.  Also, if any subprocesses are still running, `C-x C-c' asks
  922. for confirmation about them, since killing Emacs will kill the
  923. subprocesses immediately.
  924.  
  925.    The operating system usually listens for certain special characters
  926. whose meaning is to kill or suspend the program you are running.  This
  927. operating system feature is turned off while you are in Emacs.  The
  928. meanings of `C-z' and `C-x C-c' as keys in Emacs were inspired by the
  929. use of `C-z' and `C-c' on several operating systems as the characters
  930. for stopping or killing a program, but that is their only relationship
  931. with the operating system.  You can customize these keys to run any
  932. commands (*note Keymaps::.).
  933.  
  934. 
  935. File: emacs,  Node: Basic,  Next: Undo,  Prev: Exiting,  Up: Top
  936.  
  937. Basic Editing Commands
  938. **********************
  939.  
  940.    We now give the basics of how to enter text, make corrections, and
  941. save the text in a file.  If this material is new to you, you might
  942. learn it more easily by running the Emacs learn-by-doing tutorial.  To
  943. start the tutorial, type `Control-h t' (`help-with-tutorial').
  944.  
  945.    To clear the screen and redisplay, type `C-l' (`recenter').
  946.  
  947. * Menu:
  948.  
  949. * Inserting Text::     Inserting text by simply typing it.
  950. * Moving Point::       How to move the cursor to the place where you want to
  951.                  change something.
  952. * Erasing::           Deleting and killing text.
  953. * Files: Basic Files.  Visiting, creating, and saving files.
  954. * Help: Basic Help.    Asking what a character does.
  955. * Blank Lines::        Commands to make or delete blank lines.
  956. * Continuation Lines:: Lines too wide for the screen.
  957. * Position Info::      What page, line, row, or column is point on?
  958. * Arguments::           Numeric arguments for repeating a command.
  959.  
  960.