home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Source / GNU / emacs / info / emacs-1 (.txt) < prev    next >
GNU Info File  |  1992-10-30  |  49KB  |  828 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.49 from the
  2. input file emacs.texi.
  3.    This file documents the GNU Emacs editor.
  4.    Copyright (C) 1985, 1986, 1988, 1992 Richard M. Stallman.
  5.    Permission is granted to make and distribute verbatim copies of this
  6. manual provided the copyright notice and this permission notice are
  7. preserved on all copies.
  8.    Permission is granted to copy and distribute modified versions of
  9. this manual under the conditions for verbatim copying, provided also
  10. that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
  11. General Public License" are included exactly as in the original, and
  12. provided that the entire resulting derived work is distributed under the
  13. terms of a permission notice identical to this one.
  14.    Permission is granted to copy and distribute translations of this
  15. manual into another language, under the above conditions for modified
  16. versions, except that the sections entitled "The GNU Manifesto",
  17. "Distribution" and "GNU General Public License" may be included in a
  18. translation approved by the author instead of in the original English.
  19. File: emacs,  Node: Top,  Next: Distrib,  Up: (DIR)
  20. The Emacs Editor
  21. ****************
  22.    Emacs is the extensible, customizable, self-documenting real-time
  23. display editor.  This Info file describes how to edit with Emacs and
  24. some of how to customize it, but not how to extend it.
  25. * Menu:
  26. * Distrib::     How to get the latest Emacs distribution.
  27. * License::     The GNU General Public License gives you permission
  28.         to redistribute GNU Emacs on certain terms; and also
  29.         explains that there is no warranty.
  30. * Intro::       An introduction to Emacs concepts.
  31. * Glossary::    The glossary.
  32. * Version 19::  Changes coming in Emacs version 19, to be released.
  33. * Manifesto::   What's GNU?  Gnu's Not Unix!
  34. Indexes, nodes containing large menus
  35. * Key Index::      An item for each standard Emacs key sequence.
  36. * Command Index::  An item for each command name.
  37. * Variable Index:: An item for each documented variable.
  38. * Concept Index::  An item for each concept.
  39. Important General Concepts
  40. * Screen::      How to interpret what you see on the screen.
  41. * Characters::  Emacs's character sets for file contents and for keyboard.
  42. * Keys::        Key sequences: what you type to request one editing action.
  43. * Commands::    Commands: named functions run by key sequences to do editing.
  44. * Entering Emacs::    Starting Emacs from the shell.
  45. * Command Switches::  Hairy startup options.
  46. * Exiting::     Stopping or killing Emacs.
  47. * Basic::       The most basic editing commands.
  48. * Undo::        Undoing recently made changes in the text.
  49. * Minibuffer::  Entering arguments that are prompted for.
  50. * M-x::         Invoking commands by their names.
  51. * Help::        Commands for asking Emacs about its commands.
  52. Important Text-Changing Commands
  53. * Mark::        The mark: how to delimit a "region" of text.
  54. * Killing::     Killing text.
  55. * Yanking::     Recovering killed text.  Moving text.
  56. * Accumulating Text::
  57.                 Other ways of copying text.
  58. * Rectangles::  Operating on the text inside a rectangle on the screen.
  59. * Registers::   Saving a text string or a location in the buffer.
  60. * Display::     Controlling what text is displayed.
  61. * Search::      Finding or replacing occurrences of a string.
  62. * Fixit::       Commands especially useful for fixing typos.
  63. Larger Units of Text
  64. * Files::       All about handling files.
  65. * Buffers::     Multiple buffers; editing several files at once.
  66. * Windows::     Viewing two pieces of text at once.
  67. Advanced Features
  68. * Major Modes:: Text mode vs. Lisp mode vs. C mode ...
  69. * Indentation:: Editing the white space at the beginnings of lines.
  70. * Text::        Commands and modes for editing English.
  71. * Programs::    Commands and modes for editing programs.
  72. * Compiling/Testing::
  73.         Compiling, running and debugging programs.
  74. * Abbrevs::     How to define text abbreviations to reduce
  75.                  the number of characters you must type.
  76. * Picture::     Editing pictures made up of characters
  77.                  using the quarter-plane screen model.
  78. * Sending Mail::Sending mail in Emacs.
  79. * Rmail::       Reading mail in Emacs.
  80. * Recursive Edit::
  81.                 A command can allow you to do editing
  82.                  "within the command".  This is called a
  83.                  `recursive editing level'.
  84. * Narrowing::   Restricting display and editing to a portion
  85.                  of the buffer.
  86. * Sorting::    Sorting lines, paragraphs or pages within Emacs.
  87. * Shell::       Executing shell commands from Emacs.
  88. * Hardcopy::    Printing buffers or regions.
  89. * Dissociated Press::  Dissociating text for fun.
  90. * Amusements::         Various games and hacks.
  91. * Emulation::           Emulating some other editors with Emacs.
  92. * Customization::      Modifying the behavior of Emacs.
  93. Recovery from Problems.
  94. * Quitting::    Quitting and aborting.
  95. * Lossage::     What to do if Emacs is hung or malfunctioning.
  96. * Bugs::        How and when to report a bug.
  97. Here are some other nodes which are really inferiors of the ones
  98. already listed, mentioned here so you can get to them in one step:
  99. Subnodes of Screen
  100. * Point::    The place in the text where editing commands operate.
  101. * Echo Area::   Short messages appear at the bottom of the screen.
  102. * Mode Line::    Interpreting the mode line.
  103. Subnodes of Basic
  104. * Blank Lines:: Commands to make or delete blank lines.
  105. * Continuation Lines:: Lines too wide for the screen.
  106. * Position Info::      What page, line, row, or column is point on?
  107. * Arguments::          Giving numeric arguments to commands.
  108. Subnodes of Minibuffer
  109. * Minibuffer File::    Entering file names with the minibuffer.
  110. * Minibuffer Edit::    How to edit in the minibuffer.
  111. * Completion::  An abbreviation facility for minibuffer input.
  112. * Repetition::  Re-executing previous commands that used the minibuffer.
  113. Subnodes of Mark
  114. * Setting Mark::       Commands to set the mark.
  115. * Using Region::       Summary of ways to operate on contents of the region.
  116. * Marking Objects::    Commands to put region around textual units.
  117. * Mark Ring::          Previous mark positions saved so you can go back there.
  118. Subnodes of Yanking
  119. * Kill Ring::          Where killed text is stored.  Basic yanking.
  120. * Appending Kills::    Several kills in a row all yank together.
  121. * Earlier Kills::      Yanking something killed some time ago.
  122. Subnodes of Registers
  123. * RegPos::             Saving positions in registers.
  124. * RegText::            Saving text in registers.
  125. * RegRect::            Saving rectangles in registers.
  126. Subnodes of Display
  127. * Scrolling::               Moving text up and down in a window.
  128. * Horizontal Scrolling::   Moving text left and right in a window.
  129. * Selective Display::      Hiding lines with lots of indentation.
  130. * Display Vars::           Information on variables for customizing display.
  131. Subnodes of Search
  132. * Incremental Search::     Search happens as you type the string.
  133. * Nonincremental Search::  Specify entire string and then search.
  134. * Word Search::        Search for sequence of words.
  135. * Regexp Search::       Search for match for a regexp.
  136. * Regexps::            Syntax of regular expressions.
  137. * Search Case::           To ignore case while searching, or not.
  138. * Replace::            Search, and replace some or all matches.
  139. * Unconditional Replace::  Everything about replacement except for querying.
  140. * Query Replace::          How to use querying.
  141. * Other Repeating Search:: Operating on all matches for some regexp.
  142. Subnodes of Fixit
  143. * Kill Errors:: Commands to kill a batch of recently entered text.
  144. * Transpose::   Exchanging two characters, words, lines, lists...
  145. * Fixing Case:: Correcting case of last word entered.
  146. * Spelling::    Apply spelling checker to a word, or a whole file.
  147. Subnodes of Files
  148. * File Names::  How to type and edit file name arguments.
  149. * Visiting::    Visiting a file prepares Emacs to edit the file.
  150. * Saving::      Saving makes your changes permanent.
  151. * Backup::      How Emacs saves the old version of your file.
  152. * Interlocking::How Emacs protects against simultaneous editing
  153.                  of one file by two users.
  154. * Reverting::   Reverting cancels all the changes not saved.
  155. * Auto Save::   Auto Save periodically protects against loss of data.
  156. * ListDir::     Listing the contents of a file directory.
  157. * Dired::       "Editing" a directory to delete, rename, etc.
  158.                  the files in it.
  159. * Misc File Ops:: Other things you can do on files.
  160. Subnodes of Buffers
  161. * Select Buffer::   Creating a new buffer or reselecting an old one.
  162. * List Buffers::    Getting a list of buffers that exist.
  163. * Misc Buffer::     Renaming; changing read-only status.
  164. * Kill Buffer::     Killing buffers you no longer need.
  165. * Several Buffers:: How to go through the list of all buffers
  166.                      and operate variously on several of them.
  167. Subnodes of Windows
  168. * Basic Window::    Introduction to Emacs windows.
  169. * Split Window::    New windows are made by splitting existing windows.
  170. * Other Window::    Moving to another window or doing something to it.
  171. * Pop Up Window::   Finding a file or buffer in another window.
  172. * Change Window::   Deleting windows and changing their sizes.
  173. Subnodes of Indentation
  174. * Indentation Commands:: Various commands and techniques for indentation.
  175. * Tab Stops::   You can set arbitrary "tab stops" and then
  176.                  indent to the next tab stop when you want to.
  177. * Just Spaces:: You can request indentation using just spaces.
  178. Subnodes of Text
  179. * Text Mode::   The major mode for editing text files.
  180. * Nroff Mode::  The major mode for editing input to the formatter nroff.
  181. * TeX Mode::    The major mode for editing input to the formatter TeX.
  182. * Texinfo Mode::The major mode for editing input to the formatter Texinfo.
  183. * Outline Mode::The major mode for editing outlines.
  184. * Words::       Moving over and killing words.
  185. * Sentences::   Moving over and killing sentences.
  186. * Paragraphs::    Moving over paragraphs.
  187. * Pages::    Moving over pages.
  188. * Filling::     Filling or justifying text
  189. * Case::        Changing the case of text
  190. Subnodes of Programs
  191. * Program Modes::       Major modes for editing programs.
  192. * Lists::       Expressions with balanced parentheses.
  193.                  There are editing commands to operate on them.
  194. * Defuns::      Each program is made up of separate functions.
  195.                  There are editing commands to operate on them.
  196. * Grinding::    Adjusting indentation to show the nesting.
  197. * Matching::    Insertion of a close-delimiter flashes matching open.
  198. * Comments::    Inserting, killing and aligning comments.
  199. * Balanced Editing::    Inserting two matching parentheses at once, etc.
  200. * Lisp Completion::     Completion on symbol names in Lisp code.
  201. * Documentation::       Getting documentation of functions you plan to call.
  202. * Change Log::  Maintaining a change history for your program.
  203. * Tags::        Go direct to any function in your program in one
  204.                  command.  Tags remembers which file it is in.
  205. * Fortran::    Fortran mode and its special features.
  206. Subnodes of Compiling/Testing
  207. * Compilation::       Compiling programs in languages other than Lisp
  208.                        (C, Pascal, etc.)
  209. * Lisp Modes::        Various modes for editing Lisp programs, with
  210.                        different facilities for running the Lisp programs.
  211. * Lisp Libraries::    Creating Lisp programs to run in Emacs.
  212. * Lisp Interaction::  Executing Lisp in an Emacs buffer.
  213. * Lisp Eval::         Executing a single Lisp expression in Emacs.
  214. * Lisp Debug::        Debugging Lisp programs running in Emacs.
  215. * External Lisp::     Communicating through Emacs with a separate Lisp.
  216. Subnodes of Abbrevs
  217. * Defining Abbrevs::  Defining an abbrev, so it will expand when typed.
  218. * Expanding Abbrevs:: Controlling expansion: prefixes, canceling expansion.
  219. * Editing Abbrevs::   Viewing or editing the entire list of defined abbrevs.
  220. * Saving Abbrevs::    Saving the entire list of abbrevs for another session.
  221. * Dynamic Abbrevs::   Abbreviations for words already in the buffer.
  222. Subnodes of Picture
  223. * Basic Picture::     Basic concepts and simple commands of Picture mode.
  224. * Insert in Picture:: Controlling direction of cursor motion
  225.                        after "self-inserting" characters.
  226. * Tabs in Picture::   Various features for tab stops and indentation.
  227. * Rectangles in Picture:: Clearing and superimposing rectangles.
  228. Subnodes of Sending Mail
  229. * Mail Format::       Format of the mail being composed.
  230. * Mail Headers::      Details of allowed mail header fields.
  231. * Mail Mode::         Special commands for editing mail being composed.
  232. Subnodes of Rmail
  233. * Rmail Scrolling::   Scrolling through a message.
  234. * Rmail Motion::      Moving to another message.
  235. * Rmail Deletion::    Deleting and expunging messages.
  236. * Rmail Inbox::       How mail gets into the Rmail file.
  237. * Rmail Files::       Using multiple Rmail files.
  238. * Rmail Output::      Copying message out to files.
  239. * Rmail Labels::      Classifying messages by labeling them.
  240. * Rmail Summary::     Summaries show brief info on many messages.
  241. * Rmail Reply::       Sending replies to messages you are viewing.
  242. * Rmail Editing::     Editing message text and headers in Rmail.
  243. * Rmail Digest::      Extracting the messages from a digest message.
  244. Subnodes of Shell
  245. * Single Shell::      Commands to run one shell command and return.
  246. * Interactive Shell:: Permanent shell taking input via Emacs.
  247. * Shell Mode::        Special Emacs commands used with permanent shell.
  248. Subnodes of Customization
  249. * Minor Modes::       Each minor mode is one feature you can turn on
  250.                        independently of any others.
  251. * Variables::         Many Emacs commands examine Emacs variables
  252.                        to decide what to do; by setting variables,
  253.                        you can control their functioning.
  254. * Examining::         Examining or setting one variable's value.
  255. * Edit Options::      Examining or editing list of all variables' values.
  256. * Locals::            Per-buffer values of variables.
  257. * File Variables::    How files can specify variable values.
  258. * Keyboard Macros::   A keyboard macro records a sequence of keystrokes
  259.                        to be replayed with a single command.
  260. * Key Bindings::      The keymaps say what command each key runs.
  261.                        By changing them, you can "redefine keys".
  262. * Keymaps::           Definition of the keymap data structure.
  263. * Rebinding::         How to redefine one key's meaning conveniently.
  264. * Disabling::         Disabling a command means confirmation is required
  265.                        before it can be executed.  This is done to protect
  266.                        beginners from surprises.
  267. * Syntax::            The syntax table controls how words and expressions
  268.                        are parsed.
  269. * Init File::         How to write common customizations in the `.emacs' file.
  270. Subnodes of Lossage (and recovery)
  271. * Stuck Recursive::   `[...]' in mode line around the parentheses.
  272. * Screen Garbled::    Garbage on the screen.
  273. * Text Garbled::      Garbage in the text.
  274. * Unasked-for Search::Spontaneous entry to incremental search.
  275. * Emergency Escape::  Emergency escape--
  276.                        What to do if Emacs stops responding.
  277. * Total Frustration:: When you are at your wits' end.
  278. File: emacs,  Node: Distrib,  Next: License,  Prev: Top,  Up: Top
  279. Distribution
  280. ************
  281.    GNU Emacs is "free"; this means that everyone is free to use it and
  282. free to redistribute it on a free basis.  GNU Emacs is not in the public
  283. domain; it is copyrighted and there are restrictions on its
  284. distribution, but these restrictions are designed to permit everything
  285. that a good cooperating citizen would want to do.  What is not allowed
  286. is to try to prevent others from further sharing any version of GNU
  287. Emacs that they might get from you.  The precise conditions are found in
  288. the GNU General Public License that comes with Emacs and also appears
  289. following this section.
  290.    The easiest way to get a copy of GNU Emacs is from someone else who
  291. has it. You need not ask for permission to do so, or tell any one else;
  292. just copy it.
  293.    If you have access to the Internet, you can get the latest
  294. distribution version of GNU Emacs from host `prep.ai.mit.edu' using
  295. anonymous login.  See the file `/u2/emacs/GETTING.GNU.SOFTWARE' on that
  296. host to find out about your options for copying and which files to use.
  297.    You may also receive GNU Emacs when you buy a computer.  Computer
  298. manufacturers are free to distribute copies on the same terms that
  299. apply to everyone else.  These terms require them to give you the full
  300. sources, including whatever changes they may have made, and to permit
  301. you to redistribute the GNU Emacs received from them under the usual
  302. terms of the General Public License.  In other words, the program must
  303. be free for you when you get it, not just free for the manufacturer.
  304.    If you cannot get a copy in any of those ways, you can order one
  305. from the Free Software Foundation.  Though Emacs itself is free, our
  306. distribution service is not.  An order form is included at the end of
  307. manuals printed by the Foundation.  It is also included in the file
  308. `etc/DISTRIB' in the Emacs distribution.  For further information,
  309. write to
  310.      Free Software Foundation
  311.      675 Mass Ave
  312.      Cambridge, MA 02139
  313.      USA
  314.    The income from distribution fees goes to support the foundation's
  315. purpose: the development of more free software to distribute just like
  316. GNU Emacs.
  317.    If you find GNU Emacs useful, please send a donation to the Free
  318. Software Foundation.  This will help support development of the rest of
  319. the GNU system, and other useful software beyond that.  Your donation
  320. is tax deductible.
  321. File: emacs,  Node: License,  Next: Intro,  Prev: Distrib,  Up: Top
  322. GNU GENERAL PUBLIC LICENSE
  323. **************************
  324.                        Version 1, February 1989
  325.      Copyright (C) 1989 Free Software Foundation, Inc.
  326.      675 Mass Ave, Cambridge, MA 02139, USA
  327.      
  328.      Everyone is permitted to copy and distribute verbatim copies
  329.      of this license document, but changing it is not allowed.
  330. Preamble
  331. ========
  332.    The license agreements of most software companies try to keep users
  333. at the mercy of those companies.  By contrast, our General Public
  334. License is intended to guarantee your freedom to share and change free
  335. software--to make sure the software is free for all its users.  The
  336. General Public License applies to the Free Software Foundation's
  337. software and to any other program whose authors commit to using it. You
  338. can use it for your programs, too.
  339.    When we speak of free software, we are referring to freedom, not
  340. price.  Specifically, the General Public License is designed to make
  341. sure that you have the freedom to give away or sell copies of free
  342. software, that you receive source code or can get it if you want it,
  343. that you can change the software or use pieces of it in new free
  344. programs; and that you know you can do these things.
  345.    To protect your rights, we need to make restrictions that forbid
  346. anyone to deny you these rights or to ask you to surrender the rights.
  347. These restrictions translate to certain responsibilities for you if you
  348. distribute copies of the software, or if you modify it.
  349.    For example, if you distribute copies of a such a program, whether
  350. gratis or for a fee, you must give the recipients all the rights that
  351. you have.  You must make sure that they, too, receive or can get the
  352. source code.  And you must tell them their rights.
  353.    We protect your rights with two steps: (1) copyright the software,
  354. and (2) offer you this license which gives you legal permission to copy,
  355. distribute and/or modify the software.
  356.    Also, for each author's protection and ours, we want to make certain
  357. that everyone understands that there is no warranty for this free
  358. software.  If the software is modified by someone else and passed on, we
  359. want its recipients to know that what they have is not the original, so
  360. that any problems introduced by others will not reflect on the original
  361. authors' reputations.
  362.    The precise terms and conditions for copying, distribution and
  363. modification follow.
  364.                          TERMS AND CONDITIONS
  365.   1. This License Agreement applies to any program or other work which
  366.      contains a notice placed by the copyright holder saying it may be
  367.      distributed under the terms of this General Public License.  The
  368.      "Program", below, refers to any such program or work, and a "work
  369.      based on the Program" means either the Program or any work
  370.      containing the Program or a portion of it, either verbatim or with
  371.      modifications.  Each licensee is addressed as "you".
  372.   2. You may copy and distribute verbatim copies of the Program's source
  373.      code as you receive it, in any medium, provided that you
  374.      conspicuously and appropriately publish on each copy an
  375.      appropriate copyright notice and disclaimer of warranty; keep
  376.      intact all the notices that refer to this General Public License
  377.      and to the absence of any warranty; and give any other recipients
  378.      of the Program a copy of this General Public License along with
  379.      the Program.  You may charge a fee for the physical act of
  380.      transferring a copy.
  381.   3. You may modify your copy or copies of the Program or any portion of
  382.      it, and copy and distribute such modifications under the terms of
  383.      Paragraph 1 above, provided that you also do the following:
  384.         * cause the modified files to carry prominent notices stating
  385.           that you changed the files and the date of any change; and
  386.         * cause the whole of any work that you distribute or publish,
  387.           that in whole or in part contains the Program or any part
  388.           thereof, either with or without modifications, to be licensed
  389.           at no charge to all third parties under the terms of this
  390.           General Public License (except that you may choose to grant
  391.           warranty protection to some or all third parties, at your
  392.           option).
  393.         * If the modified program normally reads commands interactively
  394.           when run, you must cause it, when started running for such
  395.           interactive use in the simplest and most usual way, to print
  396.           or display an announcement including an appropriate copyright
  397.           notice and a notice that there is no warranty (or else,
  398.           saying that you provide a warranty) and that users may
  399.           redistribute the program under these conditions, and telling
  400.           the user how to view a copy of this General Public License.
  401.         * You may charge a fee for the physical act of transferring a
  402.           copy, and you may at your option offer warranty protection in
  403.           exchange for a fee.
  404.      Mere aggregation of another independent work with the Program (or
  405.      its derivative) on a volume of a storage or distribution medium
  406.      does not bring the other work under the scope of these terms.
  407.   4. You may copy and distribute the Program (or a portion or
  408.      derivative of it, under Paragraph 2) in object code or executable
  409.      form under the terms of Paragraphs 1 and 2 above provided that you
  410.      also do one of the following:
  411.         * accompany it with the complete corresponding machine-readable
  412.           source code, which must be distributed under the terms of
  413.           Paragraphs 1 and 2 above; or,
  414.         * accompany it with a written offer, valid for at least three
  415.           years, to give any third party free (except for a nominal
  416.           charge for the cost of distribution) a complete
  417.           machine-readable copy of the corresponding source code, to be
  418.           distributed under the terms of Paragraphs 1 and 2 above; or,
  419.         * accompany it with the information you received as to where the
  420.           corresponding source code may be obtained.  (This alternative
  421.           is allowed only for noncommercial distribution and only if you
  422.           received the program in object code or executable form alone.)
  423.      Source code for a work means the preferred form of the work for
  424.      making modifications to it.  For an executable file, complete
  425.      source code means all the source code for all modules it contains;
  426.      but, as a special exception, it need not include source code for
  427.      modules which are standard libraries that accompany the operating
  428.      system on which the executable file runs, or for standard header
  429.      files or definitions files that accompany that operating system.
  430.   5. You may not copy, modify, sublicense, distribute or transfer the
  431.      Program except as expressly provided under this General Public
  432.      License. Any attempt otherwise to copy, modify, sublicense,
  433.      distribute or transfer the Program is void, and will automatically
  434.      terminate your rights to use the Program under this License. 
  435.      However, parties who have received copies, or rights to use
  436.      copies, from you under this General Public License will not have
  437.      their licenses terminated so long as such parties remain in full
  438.      compliance.
  439.   6. By copying, distributing or modifying the Program (or any work
  440.      based on the Program) you indicate your acceptance of this license
  441.      to do so, and all its terms and conditions.
  442.   7. Each time you redistribute the Program (or any work based on the
  443.      Program), the recipient automatically receives a license from the
  444.      original licensor to copy, distribute or modify the Program
  445.      subject to these terms and conditions.  You may not impose any
  446.      further restrictions on the recipients' exercise of the rights
  447.      granted herein.
  448.   8. The Free Software Foundation may publish revised and/or new
  449.      versions of the General Public License from time to time.  Such
  450.      new versions will be similar in spirit to the present version, but
  451.      may differ in detail to address new problems or concerns.
  452.      Each version is given a distinguishing version number.  If the
  453.      Program specifies a version number of the license which applies to
  454.      it and "any later version", you have the option of following the
  455.      terms and conditions either of that version or of any later
  456.      version published by the Free Software Foundation.  If the Program
  457.      does not specify a version number of the license, you may choose
  458.      any version ever published by the Free Software Foundation.
  459.   9. If you wish to incorporate parts of the Program into other free
  460.      programs whose distribution conditions are different, write to the
  461.      author to ask for permission.  For software which is copyrighted
  462.      by the Free Software Foundation, write to the Free Software
  463.      Foundation; we sometimes make exceptions for this.  Our decision
  464.      will be guided by the two goals of preserving the free status of
  465.      all derivatives of our free software and of promoting the sharing
  466.      and reuse of software generally.
  467.                                 NO WARRANTY
  468.  10. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
  469.      WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
  470.      LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
  471.      HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
  472.      WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
  473.      NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  474.      FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE
  475.      QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  476.      PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
  477.      SERVICING, REPAIR OR CORRECTION.
  478.  11. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
  479.      WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
  480.      MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
  481.      LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
  482.      INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
  483.      INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
  484.      DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
  485.      OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
  486.      OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
  487.      ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  488.                       END OF TERMS AND CONDITIONS
  489. How to Apply These Terms to Your New Programs
  490. =============================================
  491.    If you develop a new program, and you want it to be of the greatest
  492. possible use to humanity, the best way to achieve this is to make it
  493. free software which everyone can redistribute and change under these
  494. terms.
  495.    To do so, attach the following notices to the program.  It is safest
  496. to attach them to the start of each source file to most effectively
  497. convey the exclusion of warranty; and each file should have at least the
  498. "copyright" line and a pointer to where the full notice is found.
  499.      ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
  500.      Copyright (C) 19YY  NAME OF AUTHOR
  501.      
  502.      This program is free software; you can redistribute it and/or modify
  503.      it under the terms of the GNU General Public License as published by
  504.      the Free Software Foundation; either version 1, or (at your option)
  505.      any later version.
  506.      
  507.      This program is distributed in the hope that it will be useful,
  508.      but WITHOUT ANY WARRANTY; without even the implied warranty of
  509.      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  510.      GNU General Public License for more details.
  511.      
  512.      You should have received a copy of the GNU General Public License
  513.      along with this program; if not, write to the Free Software
  514.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  515.    Also add information on how to contact you by electronic and paper
  516. mail.
  517.    If the program is interactive, make it output a short notice like
  518. this when it starts in an interactive mode:
  519.      Gnomovision version 69, Copyright (C) 19YY NAME OF AUTHOR
  520.      Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
  521.      type `show w'.  This is free software, and you are welcome
  522.      to redistribute it under certain conditions; type `show c'
  523.      for details.
  524.    The hypothetical commands `show w' and `show c' should show the
  525. appropriate parts of the General Public License.  Of course, the
  526. commands you use may be called something other than `show w' and `show
  527. c'; they could even be mouse-clicks or menu items--whatever suits your
  528. program.
  529.    You should also get your employer (if you work as a programmer) or
  530. your school, if any, to sign a "copyright disclaimer" for the program,
  531. if necessary.  Here is a sample; alter the names:
  532.      Yoyodyne, Inc., hereby disclaims all copyright
  533.      interest in the program `Gnomovision'
  534.      (a program to direct compilers to make passes
  535.      at assemblers) written by James Hacker.
  536.      
  537.      SIGNATURE OF TY COON, 1 April 1989
  538.      Ty Coon, President of Vice
  539.    That's all there is to it!
  540. File: emacs,  Node: Intro,  Next: Glossary,  Prev: License,  Up: Top
  541. Introduction
  542. ************
  543.    You are reading about GNU Emacs, the GNU incarnation of the advanced,
  544. self-documenting, customizable, extensible real-time display editor
  545. Emacs. (The `G' in `GNU' is not silent.)
  546.    We say that Emacs is a "display" editor because normally the text
  547. being edited is visible on the screen and is updated automatically as
  548. you type your commands.  *Note Display: Screen.
  549.    We call it a "real-time" editor because the display is updated very
  550. frequently, usually after each character or pair of characters you
  551. type.  This minimizes the amount of information you must keep in your
  552. head as you edit.  *Note Real-time: Basic.
  553.    We call Emacs advanced because it provides facilities that go beyond
  554. simple insertion and deletion: filling of text; automatic indentation of
  555. programs; viewing two or more files at once; and dealing in terms of
  556. characters, words, lines, sentences, paragraphs, and pages, as well as
  557. expressions and comments in several different programming languages. 
  558. It is much easier to type one command meaning "go to the end of the
  559. paragraph" than to find that spot with simple cursor keys.
  560.    "Self-documenting" means that at any time you can type a special
  561. character, `Control-h', to find out what your options are.  You can
  562. also use it to find out what any command does, or to find all the
  563. commands that pertain to a topic.  *Note Help::.
  564.    "Customizable" means that you can change the definitions of Emacs
  565. commands in little ways.  For example, if you use a programming
  566. language in which comments start with `<**' and end with `**>', you can
  567. tell the Emacs comment manipulation commands to use those strings
  568. (*note Comments::.).  Another sort of customization is rearrangement of
  569. the command set.  For example, if you prefer the four basic cursor
  570. motion commands (up, down, left and right) on keys in a diamond pattern
  571. on the keyboard, you can have it.  *Note Customization::.
  572.    "Extensible" means that you can go beyond simple customization and
  573. write entirely new commands, programs in the Lisp language to be run by
  574. Emacs's own Lisp interpreter.  Emacs is an "on-line extensible" system,
  575. which means that it is divided into many functions that call each other,
  576. any of which can be redefined in the middle of an editing session.  Any
  577. part of Emacs can be replaced without making a separate copy of all of
  578. Emacs.  Most of the editing commands of Emacs are written in Lisp
  579. already; the few exceptions could have been written in Lisp but are
  580. written in C for efficiency.  Although only a programmer can write an
  581. extension, anybody can use it afterward.
  582. File: emacs,  Node: Screen,  Next: Characters,  Prev: Concept Index,  Up: Top
  583. The Organization of the Screen
  584. ******************************
  585.    Emacs divides the screen into several areas, each of which contains
  586. its own sorts of information.  The biggest area, of course, is the one
  587. in which you usually see the text you are editing.
  588.    When you are using Emacs, the screen is divided into a number of
  589. "windows".  Initially there is one text window occupying all but the
  590. last line, plus the special "echo area" or "minibuffer window" in the
  591. last line.  The text window can be subdivided horizontally or
  592. vertically into multiple text windows, each of which can be used for a
  593. different file (*note Windows::.).  The window that the cursor is in is
  594. the "selected window", in which editing takes place.  The other windows
  595. are just for reference unless you select one of them.
  596.    Each text window's last line is a "mode line" which describes what is
  597. going on in that window.  It is in inverse video if the terminal
  598. supports that, and contains text that starts like `-----Emacs:
  599. SOMETHING'.  Its purpose is to indicate what buffer is being displayed
  600. above it in the window; what major and minor modes are in use; and
  601. whether the buffer's text has been changed.
  602. * Menu:
  603. * Point::    The place in the text where editing commands operate.
  604. * Echo Area::   Short messages appear at the bottom of the screen.
  605. * Mode Line::    Interpreting the mode line.
  606. File: emacs,  Node: Point,  Next: Echo Area,  Prev: Screen,  Up: Screen
  607. Point
  608. =====
  609.    When Emacs is running, the terminal's cursor shows the location at
  610. which editing commands will take effect.  This location is called
  611. "point".  Other commands move point through the text, so that you can
  612. edit at different places in it.
  613.    While the cursor appears to point AT a character, point should be
  614. thought of as BETWEEN two characters; it points BEFORE the character
  615. that the cursor appears on top of.  Sometimes people speak of "the
  616. cursor" when they mean "point", or speak of commands that move point as
  617. "cursor motion" commands.
  618.    Terminals have only one cursor, and when output is in progress it
  619. must appear where the typing is being done.  This does not mean that
  620. point is moving.  It is only that Emacs has no way to show you the
  621. location of point except when the terminal is idle.
  622.    If you are editing several files in Emacs, each file has its own
  623. point location.  A file that is not being displayed remembers where
  624. point is so that it can be seen when you look at that file again.
  625.    When there are multiple text windows, each window has its own point
  626. location.  The cursor shows the location of point in the selected
  627. window. This also is how you can tell which window is selected.  If the
  628. same buffer appears in more than one window, point can be moved in each
  629. window independently.
  630.    The term `point' comes from the character `.', which was the command
  631. in TECO (the language in which the original Emacs was written) for
  632. accessing the value now called `point'.
  633. File: emacs,  Node: Echo Area,  Next: Mode Line,  Prev: Point,  Up: Screen
  634. The Echo Area
  635. =============
  636.    The line at the bottom of the screen (below the mode line) is the
  637. "echo area".  It is used to display small amounts of text for several
  638. purposes.
  639.    "Echoing" means printing out the characters that you type.  Emacs
  640. never echoes single-character commands, and multi-character commands are
  641. echoed only if you pause while typing them.  As soon as you pause for
  642. more than a second in the middle of a command, all the characters of
  643. the command so far are echoed.  This is intended to "prompt" you for
  644. the rest of the command.  Once echoing has started, the rest of the
  645. command is echoed immediately when you type it.  This behavior is
  646. designed to give confident users fast response, while giving hesitant
  647. users maximum feedback.  You can change this behavior by setting a
  648. variable (*note Display Vars::.).
  649.    If a command cannot be executed, it may print an "error message" in
  650. the echo area.  Error messages are accompanied by a beep or by flashing
  651. the screen.  Also, any input you have typed ahead is thrown away when
  652. an error happens.
  653.    Some commands print informative messages in the echo area.  These
  654. messages look much like error messages, but they are not announced with
  655. a beep and do not throw away input.  Sometimes the message tells you
  656. what the command has done, when this is not obvious from looking at the
  657. text being edited.  Sometimes the sole purpose of a command is to print
  658. a message giving you specific information.  For example, the command
  659. `C-x =' is used to print a message describing the character position of
  660. point in the text and its current column in the window.  Commands that
  661. take a long time often display messages ending in `...' while they are
  662. working, and add `done' at the end when they are finished.
  663.    The echo area is also used to display the "minibuffer", a window that
  664. is used for reading arguments to commands, such as the name of a file
  665. to be edited.  When the minibuffer is in use, the echo area begins with
  666. a prompt string that usually ends with a colon; also, the cursor
  667. appears in that line because it is the selected window.  You can always
  668. get out of the minibuffer by typing `C-g'.  *Note Minibuffer::.
  669. File: emacs,  Node: Mode Line,  Prev: Echo Area,  Up: Screen
  670. The Mode Line
  671. =============
  672.    Each text window's last line is a "mode line" which describes what is
  673. going on in that window.  When there is only one text window, the mode
  674. line appears right above the echo area.  The mode line is in inverse
  675. video if the terminal supports that, starts and ends with dashes, and
  676. contains text like `Emacs: SOMETHING'.
  677.    If a mode line has something else in place of `Emacs: SOMETHING',
  678. then the window above it is in a special subsystem such as Dired.  The
  679. mode line then indicates the status of the subsystem.
  680.    Normally, the mode line has the following appearance:
  681.      --CH-Emacs: BUF      (MAJOR MINOR)----POS------
  682. This gives information about the buffer being displayed in the window:
  683. the buffer's name, what major and minor modes are in use, whether the
  684. buffer's text has been changed, and how far down the buffer you are
  685. currently looking.
  686.    CH contains two stars `**' if the text in the buffer has been edited
  687. (the buffer is "modified"), or `--' if the buffer has not been edited. 
  688. Exception: for a read-only buffer, it is `%%'.
  689.    BUF is the name of the window's chosen "buffer".  The chosen buffer
  690. in the selected window (the window that the cursor is in) is also
  691. Emacs's selected buffer, the one that editing takes place in.  When we
  692. speak of what some command does to "the buffer", we are talking about
  693. the currently selected buffer.  *Note Buffers::.
  694.    POS tells you whether there is additional text above the top of the
  695. screen, or below the bottom.  If your file is small and it is all on the
  696. screen, POS is `All'.  Otherwise, it is `Top' if you are looking at the
  697. beginning of the file, `Bot' if you are looking at the end of the file,
  698. or `NN%', where NN is the percentage of the file above the top of the
  699. screen.
  700.    MAJOR is the name of the "major mode" in effect in the buffer.  At
  701. any time, each buffer is in one and only one of the possible major
  702. modes. The major modes available include Fundamental mode (the least
  703. specialized), Text mode, Lisp mode, and C mode.  *Note Major Modes::,
  704. for details of how the modes differ and how to select one.
  705.    MINOR is a list of some of the "minor modes" that are turned on at
  706. the moment in the window's chosen buffer.  `Fill' means that Auto Fill
  707. mode is on.  `Abbrev' means that Word Abbrev mode is on. `Ovwrt' means
  708. that Overwrite mode is on.  *Note Minor Modes::, for more information. 
  709. `Narrow' means that the buffer being displayed has editing restricted
  710. to only a portion of its text.  This is not really a minor mode, but is
  711. like one.  *Note Narrowing::.  `Def' means that a keyboard macro is
  712. being defined.  *Note Keyboard Macros::.
  713.    Some buffers display additional information after the minor modes. 
  714. For example, Rmail buffers display the current message number and the
  715. total number of messages.  Compilation buffers and Shell mode display
  716. the status of the subprocess.
  717.    In addition, if Emacs is currently inside a recursive editing level,
  718. square brackets (`[...]') appear around the parentheses that surround
  719. the modes.  If Emacs is in one recursive editing level within another,
  720. double square brackets appear, and so on.  Since this information
  721. pertains to Emacs in general and not to any one buffer, the square
  722. brackets appear in every mode line on the screen or not in any of them.
  723. *Note Recursive Edit::.
  724.    Emacs can optionally display the time and system load in all mode
  725. lines. To enable this feature, type `M-x display-time'.  The
  726. information added to the mode line usually appears after the file name,
  727. before the mode names and their parentheses.  It looks like this:
  728.      HH:MMpm L.LL [D]
  729. (Some fields may be missing if your operating system cannot support
  730. them.) HH and MM are the hour and minute, followed always by `am' or
  731. `pm'.  L.LL is the average number of running processes in the whole
  732. system recently.  D is an approximate index of the ratio of disk
  733. activity to cpu activity for all users.
  734.    The word `Mail' appears after the load level if there is mail for
  735. you that you have not read yet.
  736.    Customization note: the user variable `mode-line-inverse-video'
  737. controls whether the mode line is displayed in inverse video (assuming
  738. the terminal supports it); `nil' means no inverse video.  The default
  739. is `t'.
  740. File: emacs,  Node: Characters,  Next: Keys,  Prev: Screen,  Up: Top
  741. The Emacs Character Set
  742. =======================
  743.    GNU Emacs uses the ASCII character set, which defines 128 different
  744. character codes.  Some of these codes are assigned graphic symbols such
  745. as `a' and `='; the rest are control characters, such as `Control-a'
  746. (also called `C-a' for short).  `C-a' gets its name from the fact that
  747. you type it by holding down the CTRL key and then pressing `a'.  There
  748. is no distinction between `C-a' and `C-A'; they are the same character.
  749.    Some control characters have special names, and special keys you can
  750. type them with: RET, TAB, LFD, DEL and ESC. The space character is
  751. usually referred to below as SPC, even though strictly speaking it is a
  752. graphic character whose graphic happens to be blank.
  753.    Emacs extends the 7-bit ASCII code to an 8-bit code by adding an
  754. extra bit to each character.  This makes 256 possible command
  755. characters.  The additional bit is called Meta.  Any ASCII character
  756. can be made Meta; examples of Meta characters include `Meta-a' (`M-a',
  757. for short), `M-A' (not the same character as `M-a', but those two
  758. characters normally have the same meaning in Emacs), `M-RET', and
  759. `M-C-a'.  For traditional reasons, `M-C-a' is usually called `C-M-a';
  760. logically speaking, the order in which the modifier keys CTRL and META
  761. are mentioned does not matter.
  762.    Some terminals have a META key, and allow you to type Meta
  763. characters by holding this key down.  Thus, `Meta-a' is typed by
  764. holding down META and pressing `a'.  The META key works much like the
  765. SHIFT key.  Such a key is not always labeled META, however, as this
  766. function is often a special option for a key with some other primary
  767. purpose.
  768.    If there is no META key, you can still type Meta characters using
  769. two-character sequences starting with ESC.  Thus, to enter `M-a', you
  770. could type `ESC a'.  To enter `C-M-a', you would type `ESC C-a'.  ESC is
  771. allowed on terminals with Meta keys, too, in case you have formed a
  772. habit of using it.
  773.    Emacs believes the terminal has a META key if the variable
  774. `meta-flag' is non-`nil'.  Normally this is set automatically according
  775. to the termcap entry for your terminal type.  However, sometimes the
  776. termcap entry is wrong, and then it is useful to set this variable
  777. yourself.  *Note Variables::, for how to do this.
  778.    Emacs buffers also use an 8-bit character set, because bytes have 8
  779. bits, but only the ASCII characters are considered meaningful. ASCII
  780. graphic characters in Emacs buffers are displayed with their graphics. 
  781. LFD is the same as a newline character; it is displayed by starting a
  782. new line.  TAB is displayed by moving to the next tab stop column
  783. (usually every 8 columns).  Other control characters are displayed as a
  784. caret (`^') followed by the non-control version of the character; thus,
  785. `C-a' is displayed as `^A'.  Non-ASCII characters 128 and up are
  786. displayed with octal escape sequences; thus, character code 243
  787. (octal), also called `M-#' when used as an input character, is
  788. displayed as `\243'.
  789. File: emacs,  Node: Keys,  Next: Commands,  Prev: Characters,  Up: Top
  790.    A "complete key"--where `key' is short for "key sequence"--is a
  791. sequence of keystrokes that are understood by Emacs as a unit, as a
  792. single command (possibly undefined).  Most single characters constitute
  793. complete keys in the standard Emacs command set; there are also some
  794. multi-character keys.  Examples of complete keys are `C-a', `X', RET,
  795. `C-x C-f' and `C-x 4 C-f'.
  796.    A "prefix key" is a sequence of keystrokes that are the beginning of
  797. a complete key, but not a whole one.  Prefix keys and complete keys are
  798. collectively called "keys".
  799.    A prefix key is the beginning of a series of longer sequences that
  800. are valid keys; adding any single character to the end of the prefix
  801. gives a valid key, which could be defined as an Emacs command, or could
  802. be a prefix itself.  For example, `C-x' is standardly defined as a
  803. prefix, so `C-x' and the next input character combine to make a
  804. two-character key. There are 256 different two-character keys starting
  805. with `C-x', one for each possible second character.  Many of these
  806. two-character keys starting with `C-x' are standardly defined as Emacs
  807. commands.  Notable examples include `C-x C-f' and `C-x s' (*note
  808. Files::.).
  809.    Adding one character to a prefix key does not have to form a complete
  810. key.  It could make another, longer prefix.  For example, `C-x 4' is
  811. itself a prefix that leads to 256 different three-character keys,
  812. including `C-x 4 f', `C-x 4 b' and so on.  It would be possible to
  813. define one of those three-character sequences as a prefix, creating a
  814. series of four-character keys, but we did not define any of them this
  815.    By contrast, the two-character sequence `C-f C-k' is not a key,
  816. because the `C-f' is a complete key in itself.  It's impossible to give
  817. `C-f C-k' an independent meaning as a command as long as `C-f' retains
  818. its meaning.  `C-f C-k' is two commands.
  819.    All told, the prefix keys in Emacs are `C-c', `C-x', `C-h', `C-x 4',
  820. and ESC.  But this is not built in; it is just a matter of Emacs's
  821. standard key bindings.  In customizing Emacs, you could make new prefix
  822. keys, or eliminate these.  *Note Key Bindings::.
  823.    Whether a sequence is a key can be changed by customization.  For
  824. example, if you redefine `C-f' as a prefix, `C-f C-k' automatically
  825. becomes a key (complete, unless you define it too as a prefix).
  826. Conversely, if you remove the prefix definition of `C-x 4', then `C-x 4
  827. f' (or `C-x 4 ANYTHING') is no longer a key.
  828.