home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / os2 / e17info.zip / EMACS / 19.17 / INFO / EMACS-2 (.txt) < prev    next >
GNU Info File  |  1993-07-18  |  48KB  |  774 lines

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