home *** CD-ROM | disk | FTP | other *** search
/ Solo Programadores 21 / SOLOPROG21.iso / utillnux / info-htm / xemacs.htm (.txt) < prev   
Encoding:
Texinfo Document  |  1996-04-02  |  890.1 KB  |  16,315 lines

  1. <HTML>
  2. <HEAD>
  3. <!-- This HTML file has been created by TEXI.HTM 1.31
  4.      from /usr/src/editors/xemacs-19.11/man/xemacs/xemacs.texinfo on 9 June 1995 -->
  5. <TITLE>XEmacs Manual</TITLE>
  6. </HEAD>
  7. <BODY>
  8. <H1>XEmacs Manual</H1>
  9. \input ../texinfo  
  10. XEmacs Manual
  11. July 1994
  12. (General Public License upgraded, January 1991)
  13. Richard Stallman
  14. Lucid, Inc.
  15. Copyright (C) 1985, 1986, 1988 Richard M. Stallman.
  16. Copyright (C) 1991, 1992, 1993, 1994  Lucid, Inc.
  17. Copyright (C) 1993, 1994 Sun Microsystems, Inc.
  18. Permission is granted to make and distribute verbatim copies of
  19. this manual provided the copyright notice and this permission notice
  20. are preserved on all copies.
  21. Permission is granted to copy and distribute modified versions of this
  22. manual under the conditions for verbatim copying, provided also that the
  23. sections entitled "The GNU Manifesto", "Distribution" and "GNU
  24. General Public License" are included exactly as in the original, and
  25. provided that the entire resulting derived work is distributed under the
  26. terms of a permission notice identical to this one.
  27. Permission is granted to copy and distribute translations of this manual
  28. into another language, under the above conditions for modified versions,
  29. except that the sections entitled "The GNU Manifesto",
  30. "Distribution" and "GNU General Public License" may be included in a
  31. translation approved by the author instead of in the original English.
  32. <H1><A NAME="SEC1" HREF="xEMACS_TO.HTM#SEC1">Preface</A></H1>
  33.   This manual documents the use and simple customization of the Emacs
  34. editor.  The reader is not expected to be a programmer to use this
  35. editor, and simple customizations do not require programming skills either.
  36. Users who are not interested in customizing Emacs can ignore the scattered
  37. customization hints.
  38.   This document is primarily a reference manual, but it can also be used as a
  39. primer.  However, if you are new to Emacs, consider using the on-line,
  40. learn-by-doing tutorial, which you get by running Emacs and typing
  41. <KBD>C-h t</KBD>.  With it, you learn Emacs by using Emacs on a specially
  42. designed file which describes commands, tells you when to try them,
  43. and then explains the results you see.  Using the tutorial gives a more vivid
  44. introduction than the printed manual.
  45.   On first reading, just skim chapters one and two, which describe the
  46. notational conventions of the manual and the general appearance of the
  47. Emacs display screen.  Note which questions are answered in these chapters,
  48. so you can refer back later.  After reading chapter four you should
  49. practice the commands there.  The next few chapters describe fundamental
  50. techniques and concepts that are used constantly.  You need to understand
  51. them thoroughly, experimenting with them if necessary.
  52.   To find the documentation on a particular command, look in the index.
  53. Keys (character commands) and command names have separate indexes.  There
  54. is also a glossary, with a cross reference for each term.
  55.   This manual comes in two forms: the published form and the Info form.
  56. The Info form is for on-line perusal with the INFO program; it is
  57. distributed along with GNU Emacs.  Both forms contain substantially the
  58. same text and are generated from a common source file, which is also
  59. distributed along with GNU Emacs.
  60.   GNU Emacs is a member of the Emacs editor family.  There are many Emacs
  61. editors, all sharing common principles of organization.  For information on
  62. the underlying philosophy of Emacs and the lessons learned from its
  63. development, write for a copy of AI memo 519a, "Emacs, the Extensible,
  64. Customizable Self-Documenting Display Editor", to Publications Department,
  65. Artificial Intelligence Lab, 545 Tech Square, Cambridge, MA 02139, USA.  At
  66. last report they charge $2.25 per copy.  Another useful publication is LCS
  67. TM-165, "A Cookbook for an Emacs", by Craig Finseth, available from
  68. Publications Department, Laboratory for Computer Science, 545 Tech Square,
  69. Cambridge, MA 02139, USA.  The price today is $3.
  70. This manual is for GNU Emacs installed on UNIX systems.  GNU
  71. Emacs can also be used on VMS systems, which have different file name
  72. syntax and don't support all GNU Emacs features.  A VMS edition of this
  73. manual may appear in the future.
  74. <H1><A NAME="SEC2" HREF="xEMACS_TO.HTM#SEC2">GNU GENERAL PUBLIC LICENSE</A></H1>
  75. Version 1, February 1989
  76. <A NAME="IDX2"></A>
  77. <A NAME="IDX1"></A>
  78. <PRE>
  79. Copyright (C) 1989 Free Software Foundation, Inc.
  80. 675 Mass Ave, Cambridge, MA 02139, USA
  81. Everyone is permitted to copy and distribute verbatim copies
  82. of this license document, but changing it is not allowed.
  83. </PRE>
  84. <H2><A NAME="SEC3" HREF="xEMACS_TO.HTM#SEC3">Preamble</A></H2>
  85.   The license agreements of most software companies try to keep users
  86. at the mercy of those companies.  By contrast, our General Public
  87. License is intended to guarantee your freedom to share and change free
  88. software--to make sure the software is free for all its users.  The
  89. General Public License applies to the Free Software Foundation's
  90. software and to any other program whose authors commit to using it.
  91. You can use it for your programs, too.
  92.   When we speak of free software, we are referring to freedom, not
  93. price.  Specifically, the General Public License is designed to make
  94. sure that you have the freedom to give away or sell copies of free
  95. software, that you receive source code or can get it if you want it,
  96. that you can change the software or use pieces of it in new free
  97. programs; and that you know you can do these things.
  98.   To protect your rights, we need to make restrictions that forbid
  99. anyone to deny you these rights or to ask you to surrender the rights.
  100. These restrictions translate to certain responsibilities for you if you
  101. distribute copies of the software, or if you modify it.
  102.   For example, if you distribute copies of a such a program, whether
  103. gratis or for a fee, you must give the recipients all the rights that
  104. you have.  You must make sure that they, too, receive or can get the
  105. source code.  And you must tell them their rights.
  106.   We protect your rights with two steps: (1) copyright the software, and
  107. (2) offer you this license which gives you legal permission to copy,
  108. distribute and/or modify the software.
  109.   Also, for each author's protection and ours, we want to make certain
  110. that everyone understands that there is no warranty for this free
  111. software.  If the software is modified by someone else and passed on, we
  112. want its recipients to know that what they have is not the original, so
  113. that any problems introduced by others will not reflect on the original
  114. authors' reputations.
  115.   The precise terms and conditions for copying, distribution and
  116. modification follow.
  117. <H2><A NAME="SEC4" HREF="xEMACS_TO.HTM#SEC4">TERMS AND CONDITIONS</A></H2>
  118. This License Agreement applies to any program or other work which
  119. contains a notice placed by the copyright holder saying it may be
  120. distributed under the terms of this General Public License.  The
  121. "Program", below, refers to any such program or work, and a "work based
  122. on the Program" means either the Program or any work containing the
  123. Program or a portion of it, either verbatim or with modifications.  Each
  124. licensee is addressed as "you".
  125. <A NAME="IDX3"></A>
  126. You may copy and distribute verbatim copies of the Program's source
  127. code as you receive it, in any medium, provided that you conspicuously and
  128. appropriately publish on each copy an appropriate copyright notice and
  129. disclaimer of warranty; keep intact all the notices that refer to this
  130. General Public License and to the absence of any warranty; and give any
  131. other recipients of the Program a copy of this General Public License
  132. along with the Program.  You may charge a fee for the physical act of
  133. transferring a copy.
  134. You may modify your copy or copies of the Program or any portion of
  135. it, and copy and distribute such modifications under the terms of Paragraph
  136. 1 above, provided that you also do the following:
  137. cause the modified files to carry prominent notices stating that
  138. you changed the files and the date of any change; and
  139. cause the whole of any work that you distribute or publish, that
  140. in whole or in part contains the Program or any part thereof, either
  141. with or without modifications, to be licensed at no charge to all
  142. third parties under the terms of this General Public License (except
  143. that you may choose to grant warranty protection to some or all
  144. third parties, at your option).
  145. If the modified program normally reads commands interactively when
  146. run, you must cause it, when started running for such interactive use
  147. in the simplest and most usual way, to print or display an
  148. announcement including an appropriate copyright notice and a notice
  149. that there is no warranty (or else, saying that you provide a
  150. warranty) and that users may redistribute the program under these
  151. conditions, and telling the user how to view a copy of this General
  152. Public License.
  153. You may charge a fee for the physical act of transferring a
  154. copy, and you may at your option offer warranty protection in
  155. exchange for a fee.
  156. </UL>
  157. Mere aggregation of another independent work with the Program (or its
  158. derivative) on a volume of a storage or distribution medium does not bring
  159. the other work under the scope of these terms.
  160. You may copy and distribute the Program (or a portion or derivative of
  161. it, under Paragraph 2) in object code or executable form under the terms of
  162. Paragraphs 1 and 2 above provided that you also do one of the following:
  163. accompany it with the complete corresponding machine-readable
  164. source code, which must be distributed under the terms of
  165. Paragraphs 1 and 2 above; or,
  166. accompany it with a written offer, valid for at least three
  167. years, to give any third party free (except for a nominal charge
  168. for the cost of distribution) a complete machine-readable copy of the
  169. corresponding source code, to be distributed under the terms of
  170. Paragraphs 1 and 2 above; or,
  171. accompany it with the information you received as to where the
  172. corresponding source code may be obtained.  (This alternative is
  173. allowed only for noncommercial distribution and only if you
  174. received the program in object code or executable form alone.)
  175. </UL>
  176. Source code for a work means the preferred form of the work for making
  177. modifications to it.  For an executable file, complete source code means
  178. all the source code for all modules it contains; but, as a special
  179. exception, it need not include source code for modules which are standard
  180. libraries that accompany the operating system on which the executable
  181. file runs, or for standard header files or definitions files that
  182. accompany that operating system.
  183. You may not copy, modify, sublicense, distribute or transfer the
  184. Program except as expressly provided under this General Public License.
  185. Any attempt otherwise to copy, modify, sublicense, distribute or transfer
  186. the Program is void, and will automatically terminate your rights to use
  187. the Program under this License.  However, parties who have received
  188. copies, or rights to use copies, from you under this General Public
  189. License will not have their licenses terminated so long as such parties
  190. remain in full compliance.
  191. By copying, distributing or modifying the Program (or any work based
  192. on the Program) you indicate your acceptance of this license to do so,
  193. and all its terms and conditions.
  194. Each time you redistribute the Program (or any work based on the
  195. Program), the recipient automatically receives a license from the original
  196. licensor to copy, distribute or modify the Program subject to these
  197. terms and conditions.  You may not impose any further restrictions on the
  198. recipients' exercise of the rights granted herein.
  199. The Free Software Foundation may publish revised and/or new versions
  200. of the General Public License from time to time.  Such new versions will
  201. be similar in spirit to the present version, but may differ in detail to
  202. address new problems or concerns.
  203. Each version is given a distinguishing version number.  If the Program
  204. specifies a version number of the license which applies to it and "any
  205. later version", you have the option of following the terms and conditions
  206. either of that version or of any later version published by the Free
  207. Software Foundation.  If the Program does not specify a version number of
  208. the license, you may choose any version ever published by the Free Software
  209. Foundation.
  210. If you wish to incorporate parts of the Program into other free
  211. programs whose distribution conditions are different, write to the author
  212. to ask for permission.  For software which is copyrighted by the Free
  213. Software Foundation, write to the Free Software Foundation; we sometimes
  214. make exceptions for this.  Our decision will be guided by the two goals
  215. of preserving the free status of all derivatives of our free software and
  216. of promoting the sharing and reuse of software generally.
  217. <H2>NO WARRANTY</H2>
  218. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
  219. FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
  220. OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
  221. PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
  222. OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  223. MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
  224. TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  225. PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
  226. REPAIR OR CORRECTION.
  227. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
  228. ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
  229. REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
  230. INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
  231. ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT
  232. LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES
  233. SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE
  234. WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
  235. ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  236. </OL>
  237. <H2>END OF TERMS AND CONDITIONS</H2>
  238. <H2><A NAME="SEC5" HREF="xEMACS_TO.HTM#SEC5">Appendix: How to Apply These Terms to Your New Programs</A></H2>
  239.   If you develop a new program, and you want it to be of the greatest
  240. possible use to humanity, the best way to achieve this is to make it
  241. free software which everyone can redistribute and change under these
  242. terms.
  243.   To do so, attach the following notices to the program.  It is safest to
  244. attach them to the start of each source file to most effectively convey
  245. the exclusion of warranty; and each file should have at least the
  246. "copyright" line and a pointer to where the full notice is found.
  247. <PRE>
  248. <VAR>one line to give the program's name and a brief idea of what it does.</VAR>
  249. Copyright (C) 19<VAR>yy</VAR>  <VAR>name of author</VAR>
  250. This program is free software; you can redistribute it and/or modify
  251. it under the terms of the GNU General Public License as published by
  252. the Free Software Foundation; either version 1, or (at your option)
  253. any later version.
  254. This program is distributed in the hope that it will be useful,
  255. but WITHOUT ANY WARRANTY; without even the implied warranty of
  256. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  257. GNU General Public License for more details.
  258. You should have received a copy of the GNU General Public License
  259. along with this program; if not, write to the Free Software
  260. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  261. </PRE>
  262. Also add information on how to contact you by electronic and paper mail.
  263. If the program is interactive, make it output a short notice like this
  264. when it starts in an interactive mode:
  265. <PRE>
  266. Gnomovision version 69, Copyright (C) 19<VAR>yy</VAR> <VAR>name of author</VAR>
  267. Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  268. This is free software, and you are welcome to redistribute it
  269. under certain conditions; type `show c' for details.
  270. </PRE>
  271. The hypothetical commands `show w' and `show c' should show the
  272. appropriate parts of the General Public License.  Of course, the
  273. commands you use may be called something other than `show w' and `show
  274. c'; they could even be mouse-clicks or menu items--whatever suits your
  275. program.
  276. You should also get your employer (if you work as a programmer) or your
  277. school, if any, to sign a "copyright disclaimer" for the program, if
  278. necessary.  Here a sample; alter the names:
  279. <PRE>
  280. Yoyodyne, Inc., hereby disclaims all copyright interest in the
  281. program `Gnomovision' (a program to direct compilers to make passes
  282. at assemblers) written by James Hacker.
  283. <VAR>signature of Ty Coon</VAR>, 1 April 1989
  284. Ty Coon, President of Vice
  285. </PRE>
  286. That's all there is to it!
  287. <H1><A NAME="SEC6" HREF="xEMACS_TO.HTM#SEC6">Distribution</A></H1>
  288. XEmacs is <DFN>free</DFN>; this means that everyone is free to use it and
  289. free to redistribute it on a free basis.  XEmacs is not in the public
  290. domain; it is copyrighted and there are restrictions on its
  291. distribution, but these restrictions are designed to permit everything
  292. that a good cooperating citizen would want to do.  What is not allowed
  293. is to try to prevent others from further sharing any version of GNU
  294. Emacs that they might get from you.  The precise conditions are found in
  295. the GNU General Public License that comes with Emacs and also appears
  296. following this section.
  297. The easiest way to get a copy of GNU Emacs is from someone else who has it.
  298. You need not ask for permission to do so, or tell any one else; just copy
  299. If you have access to the Internet, you can get the latest version of 
  300. XEmacs from anonymous FTP server, <TT>`cs.uiuc.edu'</TT>.   It can
  301. also be found at numerous other archive sites around the world; check
  302. the file <TT>`etc/DISTRIB'</TT> in a XEmacs distribution for the latest
  303. known list.
  304. <H2><A NAME="SEC7" HREF="xEMACS_TO.HTM#SEC7">Getting Earlier Versions of GNU Emacs</A></H2>
  305. XEmacs, the version of Emacs described in this manual, is not
  306. distributed by the Free Software Foundation. You can, however, still get
  307. other versions of Emacs from there.
  308. If you have access to the Internet, you can get the latest distribution
  309. version of GNU Emacs from host <TT>`prep.ai.mit.edu'</TT> using anonymous
  310. login.  See the file <TT>`/pub/gnu/GNUinfo/FTP'</TT> on that host
  311. to find out about your options for copying and which files to use.
  312. You may also receive GNU Emacs when you buy a computer.  Computer
  313. manufacturers are free to distribute copies on the same terms that apply to
  314. everyone else.  These terms require them to give you the full sources,
  315. including whatever changes they may have made, and to permit you to
  316. redistribute the GNU Emacs received from them under the usual terms of the
  317. General Public License.  In other words, the program must be free for you
  318. when you get it, not just free for the manufacturer.
  319. If you cannot get a copy in any of those ways, you can order one from
  320. the Free Software Foundation.  Though Emacs itself is free, the Free
  321. Software Foundation's distribution service is not.  An order form is
  322. included in the file <TT>`etc/DISTRIB'</TT> in the Emacs distribution.
  323. For further information, write to:
  324. <PRE>
  325. Free Software Foundation
  326. 675 Mass Ave.
  327. Cambridge, MA 02139
  328. </PRE>
  329. The income from distribution fees goes to support the foundation's
  330. purpose: the development of more free software to distribute just like
  331. GNU Emacs.
  332. If you find GNU Emacs useful, please <B>send a donation</B> to the Free
  333. Software Foundation.  This will help support development of the rest of the
  334. GNU system, and other useful software beyond that.  Your donation is tax
  335. deductible.
  336. <H1><A NAME="SEC8" HREF="xEMACS_TO.HTM#SEC8">Introduction</A></H1>
  337.   You are reading about GNU Emacs, the GNU incarnation of the advanced,
  338. self-documenting, customizable, extensible real-time display editor Emacs.
  339. (The `G' in `GNU' is not silent.)
  340.   We say that Emacs is a <DFN>display</DFN> editor because normally the text
  341. being edited is visible on the screen and is updated automatically as you
  342. type.  See section <A HREF="xEMACS.HTM#SEC9">The Emacs Screen</A>.
  343.   We call Emacs a <DFN>real-time</DFN> editor because the display is updated very
  344. frequently, usually after each character or pair of characters you
  345. type.  This minimizes the amount of information you must keep in your
  346. head as you edit.  See section <A HREF="xEMACS.HTM#SEC36">Basic Editing Commands</A>.
  347.   We call Emacs advanced because it provides facilities that go beyond
  348. simple insertion and deletion: filling of text; automatic indentation of
  349. programs; viewing two or more files at once; and dealing in terms of
  350. characters, words, lines, sentences, paragraphs, and pages, as well as
  351. expressions and comments in several different programming languages.  It is
  352. much easier to type one command meaning "go to the end of the paragraph"
  353. than to find that spot with simple cursor keys.
  354.   <DFN>Self-documenting</DFN> means that at any time you can type a special
  355. character, <KBD>Control-h</KBD>, to find out what your options are.  You can
  356. also use <KBD>C-h</KBD> to find out what a command does, or to find all the
  357. commands relevant to a topic.  See section <A HREF="xEMACS.HTM#SEC55">Help</A>.
  358.   <DFN>Customizable</DFN> means you can change the definitions of Emacs
  359. commands.  For example, if you use a programming language in
  360. which comments start with <SAMP>`<**'</SAMP> and end with <SAMP>`**>'</SAMP>, you can tell
  361. the Emacs comment manipulation commands to use those strings
  362. (see section <A HREF="xEMACS.HTM#SEC194">Manipulating Comments</A>).  Another sort of customization is rearrangement of the
  363. command set.  For example, you can set up the four basic cursor motion
  364. commands (up, down, left and right) on keys in a diamond pattern on the
  365. keyboard if you prefer.  See section <A HREF="xEMACS.HTM#SEC273">Customization</A>.
  366.   <DFN>Extensible</DFN> means you can go beyond simple customization and
  367. write entirely new commands, programs in the Lisp language to be run by
  368. Emacs's own Lisp interpreter.  Emacs is an "on-line extensible"
  369. system: it is divided into many functions that call each other.  You can
  370. redefine any function in the middle of an editing session and replace
  371. any part of Emacs without making a separate copy of all of Emacs.  Most
  372. of the editing commands of Emacs are written in Lisp; the few
  373. exceptions could have been written in Lisp but are written in C for
  374. efficiency.  Only a programmer can write an extension to Emacs, but anybody
  375. can use it afterward.
  376. <A NAME="IDX4"></A>
  377. <A NAME="IDX5"></A>
  378. <A NAME="IDX6"></A>
  379. <H1><A NAME="SEC9" HREF="xEMACS_TO.HTM#SEC9">The Emacs Screen</A></H1>
  380. The terminology used here reflects the fact that Emacs was developed on 
  381. environments that had only one window, which took up the entire screen.
  382. <DL COMPACT>
  383. <DT>Screen
  384. <DD>In many environments, such as a tty terminal, an Emacs screen
  385. literally takes up the whole screen.  If you are
  386. running Emacs in a multi-window system like the X Window System, the
  387. Emacs screen takes up one X window.  See section <A HREF="xEMACS.HTM#SEC13">Using Emacs Under the X Window System</A>, for more
  388. information.
  389. <DT>Window
  390. <DD>No matter what environment you are running in, Emacs allows you to look
  391. at several buffers at the same time by having several windows be part of
  392. the screen.  Often, the whole screen is taken up by just one window, but
  393. you can split the screen into two or more subwindows.  If you are
  394. running Emacs under the X window system, that means you can have several
  395. <DFN>Emacs windows</DFN> inside the X window that contains the Emacs screen.
  396. You can even have multiple screens in different X windows, each with
  397. their own set of subwindows. 
  398. </DL>
  399. Each Emacs screen displays a variety of information: 
  400. The biggest area usually displays the text you are editing.  It may
  401. consist of one window or of two or more windows if you need to look at two
  402. buffers a the same time. 
  403. Below each text window's last line is a <DFN>mode line</DFN> (see section <A HREF="xEMACS.HTM#SEC12">The Mode Line</A>), which describes what is going on in that window.  The mode line
  404. is in inverse video if the terminal supports that.  If there are several
  405. Emacs windows in one screen, each window has its own mode line.
  406. At the bottom of each Emacs screen is the <DFN>echo area</DFN> or <DFN>minibuffer
  407. window</DFN>(see section <A HREF="xEMACS.HTM#SEC11">The Echo Area</A>).  It is used by Emacs to exchange information
  408. with the user.  There is only one echo area per Emacs screen.
  409. If you are running XEmacs under the X Window System, a
  410. menu bar at the top of the screen makes shortcuts to several of the
  411. commands available (see section <A HREF="xEMACS.HTM#SEC23">XEmacs Pull-down Menus</A>).
  412. </UL>
  413.   You can subdivide the Emacs screen into multiple text windows, and use
  414. each window for a different file (see section <A HREF="xEMACS.HTM#SEC153">Multiple Windows</A>).  Multiple Emacs
  415. windows are tiled vertically on the Emacs screen.  The upper Emacs window
  416. is separated from the lower window by its mode line.
  417.   When there are multiple, tiled Emacs windows on a single Emacs screen,
  418. the Emacs window receiving input from the keyboard has the <DFN>keyboard
  419. focus</DFN> and is called the <DFN>selected window</DFN>.  The selected window
  420. contains the cursor, which indicates the insertion point.  If you are
  421. working in an environment that permits multiple Emacs screens, and you
  422. move the focus from one Emacs screen into another, the
  423. selected window is the one that was last selected in that screen.
  424.   The same text can be displayed simultaneously in several Emacs
  425. windows, which can be in different Emacs screens.  If you alter the text
  426. in an Emacs buffer by editing it in one Emacs window, the changes are
  427. visible in all Emacs windows containing that buffer.
  428. <A NAME="IDX7"></A>
  429. <A NAME="IDX8"></A>
  430. <H2><A NAME="SEC10" HREF="xEMACS_TO.HTM#SEC10">Point</A></H2>
  431.   When Emacs is running, the cursor shows the location at which editing
  432. commands will take effect.  This location is called <DFN>point</DFN>.  You
  433. can use keystrokes or the mouse cursor to move point through the text
  434. and edit the text at different places.
  435.   While the cursor appears to point <VAR>at</VAR> a character, you should
  436. think of point as <VAR>between</VAR> two characters: it points <VAR>before</VAR>
  437. the character on which the cursor appears.  Sometimes people speak
  438. of "the cursor" when they mean "point," or speak of commands that
  439. move point as "cursor motion" commands.
  440.  Each Emacs screen has only one cursor.  When output is in progress, the cursor
  441. must appear where the typing is being done.  This does not mean that
  442. point is moving.  It is only that Emacs has no way to show you the
  443. location of point except when the terminal is idle.
  444.   If you are editing several files in Emacs, each file has its own point
  445. location.  A file that is not being displayed remembers where point is.
  446. Point becomes visible at the correct location when you look at the file again.
  447.   When there are multiple text windows, each window has its own point
  448. location.  The cursor shows the location of point in the selected
  449. window.  The visible cursor also shows you which window is selected.  If
  450. the same buffer appears in more than one window, point can be moved in
  451. each window independently.
  452.   The term `point' comes from the character <SAMP>`.'</SAMP>, which was the
  453. command in TECO (the language in which the original Emacs was written)
  454. for accessing the value now called `point'.
  455. <A NAME="IDX9"></A>
  456. <H2><A NAME="SEC11" HREF="xEMACS_TO.HTM#SEC11">The Echo Area</A></H2>
  457.   The line at the bottom of the screen (below the mode line) is the
  458. <DFN>echo area</DFN>.  Emacs uses this area to communicate with the user:
  459.   <DFN>Echoing</DFN> means printing out the characters that the user types.  Emacs
  460. never echoes single-character commands.  Multi-character commands are
  461. echoed only if you pause while typing them: As soon as you pause for more
  462. than one second in the middle of a command, all the characters of the command
  463. so far are echoed.  This is intended to <DFN>prompt</DFN> you for the rest of
  464. the command.  Once echoing has started, the rest of the command is echoed
  465. immediately as you type it.  This behavior is designed to give confident
  466. users fast response, while giving hesitant users maximum feedback.  You
  467. can change this behavior by setting a variable (see section <A HREF="xEMACS.HTM#SEC92">Variables Controlling Display</A>).
  468.   If you issue a command that cannot be executed, Emacs may print an
  469. <DFN>error message</DFN> in the echo area.  Error messages are accompanied by
  470. a beep or by flashing the screen.  Any input you have typed ahead is
  471. thrown away when an error happens.
  472.   Some commands print informative messages in the echo area.  These
  473. messages look similar to error messages, but are not announced with a
  474. beep and do not throw away input.  Sometimes a message tells you what the
  475. command has done, when this is not obvious from looking at the text being
  476. edited.  Sometimes the sole purpose of a command is to print a message
  477. giving you specific information.  For example, the command <KBD>C-x =</KBD> is
  478. used to print a message describing the character position of point in the
  479. text and its current column in the window.  Commands that take a long time
  480. often display messages ending in <SAMP>`...'</SAMP> while they are working, and
  481. add <SAMP>`done'</SAMP> at the end when they are finished.
  482.   The echo area is also used to display the <DFN>minibuffer</DFN>, a window
  483. that is used for reading arguments to commands, such as the name of a
  484. file to be edited.  When the minibuffer is in use, the echo area displays
  485. with a prompt string that usually ends with a colon.  The cursor
  486. appears after the prompt.  You can always get out of the minibuffer by
  487. typing <KBD>C-g</KBD>.  See section <A HREF="xEMACS.HTM#SEC47">The Minibuffer</A>.
  488. </UL>
  489. <A NAME="IDX10"></A>
  490. <A NAME="IDX11"></A>
  491. <H2><A NAME="SEC12" HREF="xEMACS_TO.HTM#SEC12">The Mode Line</A></H2>
  492.   Each text window's last line is a <DFN>mode line</DFN> which describes what is
  493. going on in that window.  When there is only one text window, the mode line
  494. appears right above the echo area.  The mode line is in inverse video if
  495. the terminal supports that, starts and ends with dashes, and contains text
  496. like <SAMP>`Emacs: <VAR>something</VAR>'</SAMP>.
  497.   If a mode line has something else in place of <SAMP>`Emacs:
  498. <VAR>something</VAR>'</SAMP>, the window above it is in a special subsystem
  499. such as Dired.  The mode line then indicates the status of the
  500. subsystem.
  501.   Normally, the mode line has the following appearance:
  502. <PRE>
  503. --<VAR>ch</VAR>-Emacs: <VAR>buf</VAR>      (<VAR>major</VAR> <VAR>minor</VAR>)----<VAR>pos</VAR>------
  504. </PRE>
  505. This gives information about the buffer being displayed in the window: the
  506. buffer's name, what major and minor modes are in use, whether the buffer's
  507. text has been changed, and how far down the buffer you are currently
  508. looking.
  509.   <VAR>ch</VAR> contains two stars (<SAMP>`**'</SAMP>) if the text in the buffer has been
  510. edited (the buffer is "modified"), or two dashes (<SAMP>`--'</SAMP>) if the
  511. buffer has not been edited.  Exception: for a read-only buffer, it is 
  512. <SAMP>`%%'</SAMP>.
  513.   <VAR>buf</VAR> is the name of the window's chosen <DFN>buffer</DFN>.  The chosen
  514. buffer in the selected window (the window that the cursor is in) is also
  515. Emacs's selected buffer, the buffer in which editing takes place.  When
  516. we speak of what some command does to "the buffer", we mean the
  517. currently selected buffer.  See section <A HREF="xEMACS.HTM#SEC147">Using Multiple Buffers</A>.
  518.   <VAR>pos</VAR> tells you whether there is additional text above the top of
  519. the screen or below the bottom.  If your file is small and it is
  520. completely visible on the screen, <VAR>pos</VAR> is <SAMP>`All'</SAMP>.  Otherwise, 
  521. <VAR>pos</VAR> is <SAMP>`Top'</SAMP> if you are looking at the beginning of the file,
  522. <SAMP>`Bot'</SAMP> if you are looking at the end of the file, or
  523. <SAMP>`<VAR>nn</VAR>%'</SAMP>, where <VAR>nn</VAR> is the percentage of the file above the
  524. top of the screen.<P>
  525.   <VAR>major</VAR> is the name of the <DFN>major mode</DFN> in effect in the buffer.  At
  526. any time, each buffer is in one and only one major mode.
  527. The available major modes include Fundamental mode (the least specialized),
  528. Text mode, Lisp mode, and C mode.  See section <A HREF="xEMACS.HTM#SEC159">Major Modes</A>, for details
  529. on how the modes differ and how you select one.<P>
  530.   <VAR>minor</VAR> is a list of some of the <DFN>minor modes</DFN> that are turned on
  531. in the window's chosen buffer.  For example, <SAMP>`Fill'</SAMP> means that Auto
  532. Fill mode is on.  <CODE>Abbrev</CODE> means that Word Abbrev mode is on.
  533. <CODE>Ovwrt</CODE> means that Overwrite mode is on.  See section <A HREF="xEMACS.HTM#SEC274">Minor Modes</A>, for more
  534. information.  <SAMP>`Narrow'</SAMP> means that the buffer being displayed has
  535. editing restricted to only a portion of its text.  This is not really a
  536. minor mode, but is like one.  See section <A HREF="xEMACS.HTM#SEC265">Narrowing</A>.  <CODE>Def</CODE> means that a
  537. keyboard macro is being defined.  See section <A HREF="xEMACS.HTM#SEC280">Keyboard Macros</A>.
  538.   Some buffers display additional information after the minor modes.  For
  539. example, Rmail buffers display the current message number and the total
  540. number of messages.  Compilation buffers and Shell mode display the status
  541. of the subprocess.
  542.   If Emacs is currently inside a recursive editing level, square
  543. brackets (<SAMP>`[...]'</SAMP>) appear around the parentheses that surround
  544. the modes.  If Emacs is in one recursive editing level within another,
  545. double square brackets appear, and so on.  Since information on
  546. recursive editing applies to Emacs in general and not to any one buffer,
  547. the square brackets appear in every mode line on the screen or not in
  548. any of them.  See section <A HREF="xEMACS.HTM#SEC267">Recursive Editing Levels</A>.<A NAME="IDX12"></A>
  549.   Emacs can optionally display the time and system load in all mode lines.
  550. To enable this feature, type <KBD>M-x display-time</KBD>.  The information added
  551. to the mode line usually appears after the file name, before the mode names
  552. and their parentheses.  It looks like this:
  553. <PRE>
  554. <VAR>hh</VAR>:<VAR>mm</VAR>pm <VAR>l.ll</VAR> [<VAR>d</VAR>]
  555. </PRE>
  556. (Some fields may be missing if your operating system cannot support them.)
  557. <VAR>hh</VAR> and <VAR>mm</VAR> are the hour and minute, followed always by <SAMP>`am'</SAMP>
  558. or <SAMP>`pm'</SAMP>.  <VAR>l.ll</VAR> is the average number of running processes in the
  559. whole system recently.  <VAR>d</VAR> is an approximate index of the ratio of
  560. disk activity to CPU activity for all users.
  561. The word <SAMP>`Mail'</SAMP> appears after the load level if there is mail for
  562. you that you have not read yet.
  563. <A NAME="IDX13"></A>
  564.   Customization note: the variable <CODE>mode-line-inverse-video</CODE>
  565. controls whether the mode line is displayed in inverse video (assuming
  566. the terminal supports it); <CODE>nil</CODE> means no inverse video.  The
  567. default is <CODE>t</CODE>.  For X screens, simply set the foreground and
  568. background colors appropriately.
  569. <H2><A NAME="SEC13" HREF="xEMACS_TO.HTM#SEC13">Using Emacs Under the X Window System</A></H2>
  570.  XEmacs can be used with the X Window System and a window
  571. manager like MWM or TWM.  In that case, the X window manager opens, closes,
  572. and resizes Emacs screens.  You use the window manager's mouse gestures to
  573. perform the operations.  Consult your window manager guide or reference
  574. manual for information on manipulating X windows.
  575. When you are working under X, each X window (that is, each Emacs screen)
  576. has a menu bar for mouse-controlled operations (see section <A HREF="xEMACS.HTM#SEC23">XEmacs Pull-down Menus</A>).
  577. <A NAME="IDX14"></A>
  578. <A NAME="IDX15"></A>
  579. Emacs under X is also a multi-screen Emacs.  You can use the <B>New
  580. Screen</B> menu item from the <B>File</B> menu to create a new Emacs screen in
  581. a new X window from the same process.  The different screens will share
  582. the same buffer list, but you can look at different buffers in the
  583. different screens.
  584. <A NAME="IDX16"></A>
  585. The function <CODE>find-file-other-screen</CODE> is just like <CODE>find-file</CODE>,
  586. but picks a new screen to display the buffer in first.  If there is only
  587. one screen, then a new screen is created; otherwise some other screen
  588. is used.  This is normally bound to <KBD>C-x 5 C-f</KBD>, and is what
  589. the <B>Open File, New Screen</B> menu item does.
  590. <A NAME="IDX17"></A>
  591. The function <CODE>switch-to-buffer-other-screen</CODE> is just 
  592. like <CODE>switch-to-buffer</CODE>, but picks a new screen to display the
  593. buffer in first.  If there is only one screen, then a new screen is created;
  594. otherwise some other screen is used.  This is normally bound to 
  595. <KBD>C-x 5 b</KBD>.
  596. <A NAME="IDX18"></A>
  597. You can specify a different default screen size other than the one
  598. provided. Use the variable <CODE>default-screen-alist</CODE>, which is an
  599. alist of default values for screen creation other than the first one.
  600. These may be set in your init file, like this:
  601. <PRE>
  602.   (setq default-screen-alist '((width . 80) (height . 55)))
  603. </PRE>
  604. <A NAME="IDX19"></A>
  605. For values specific to the first Emacs screen, you must use X resources.
  606. The variable <CODE>x-screen-defaults</CODE> takes an alist of default screen
  607. creation parameters for X window screens.  These override what is
  608. specified in <TT>`~/.Xdefaults'</TT> but are overridden by the arguments to
  609. the particular call to <CODE>x-create-screen</CODE>.
  610. <A NAME="IDX20"></A>
  611. When you create a new screen, the variable <CODE>create-screen-hook</CODE>
  612. is called with one argument, the screen just created.
  613. If you want to close one or more of the X windows you created using
  614. <B>New Screen</B>, use the <B>Delete Screen</B> menu item from the <B>File</B> menu.  
  615. <A NAME="IDX21"></A>
  616. <A NAME="IDX22"></A>
  617. If you are working with multiple screens, some special information
  618. applies:
  619. <LI>Two variables, <CODE>screen-title-format</CODE> and
  620. <CODE>screen-icon-title-format</CODE> determine the title of the screen and the
  621. title of the icon that results if you shrink the screen. 
  622. <A NAME="IDX24"></A>
  623. <A NAME="IDX23"></A>
  624. <LI>The variables <CODE>auto-lower-screen</CODE> and
  625. <CODE>auto-raise-screen</CODE> position a screen. If true,
  626. <CODE>auto-lower-screen</CODE> lowers a screen to the bottom when it is no longer
  627. selected. If true, <CODE>auto-raise-screen</CODE> raises a screen to
  628. the top when it is selected. Under X, most ICCCM-compliant window managers
  629. will have options to do this for you, but these variables are provided in
  630. case you are using a broken window manager.
  631. <LI>There is a new screen/modeline format directive, %S, which expands
  632. to the name of the current screen (a screen's name is distinct from its
  633. title; the name is used for resource lookup, among other things, and the
  634. title is simply what appears above the window.)
  635. </UL>
  636. <H1><A NAME="SEC14" HREF="xEMACS_TO.HTM#SEC14">Keystrokes, Key Sequences, and Key Bindings</A></H1>
  637.   This chapter discusses the character set Emacs uses for input commands
  638. and inside files.  You have already learned that the more frequently
  639. used Emacs commands are bound to keys.  For example, <KBD>Control-f</KBD> is
  640. bound to <CODE>forward-char</CODE>.  The following issues are covered:
  641. How keystrokes can be represented
  642. How you can create key sequences from keystrokes
  643. How you can add to the available modifier keys by customizing your
  644. keyboard: for example, you could have the
  645. <KBD>Capslock</KBD> key be understood as the <KBD>Super</KBD> key by Emacs. A
  646. <KBD>Super</KBD> key is used like <KBD>Control</KBD> or <KBD>Meta</KBD> in that you hold
  647. it while typing another key. 
  648. </UL>
  649.  You will also learn how to customize existing key bindings and
  650. create new ones.
  651. <A NAME="IDX25"></A>
  652. <A NAME="IDX26"></A>
  653. <A NAME="IDX27"></A>
  654. <H2><A NAME="SEC15" HREF="xEMACS_TO.HTM#SEC15">Keystrokes as Building Blocks of Key Sequences</A></H2>
  655.       Earlier versions of GNU Emacs used only the ASCII character set,
  656. which defines 128 different character codes.  Some of these codes are
  657. assigned graphic symbols like <SAMP>`a'</SAMP> and <SAMP>`='</SAMP>; the rest are
  658. control characters, such as <KBD>Control-a</KBD> (also called <KBD>C-a</KBD>).
  659. <KBD>C-a</KBD> means you hold down the <KBD>CTRL</KBD> key and then press
  660. <KBD>a</KBD>.<P>
  661.    Keybindings in XEmacs are no longer restricted to the set of
  662. keystrokes that can be represented in ASCII.  Emacs can now tell the
  663. difference between, for example, <KBD>Control-h</KBD>, <KBD>Control-Shift-h</KBD>,
  664. and <KBD>Backspace</KBD>.
  665. <A NAME="IDX29"></A>
  666. <A NAME="IDX30"></A>
  667. <A NAME="IDX31"></A>
  668. <A NAME="IDX32"></A>
  669. <A NAME="IDX33"></A>
  670. <A NAME="IDX34"></A>
  671. <A NAME="IDX35"></A>
  672. <A NAME="IDX36"></A>
  673. <A NAME="IDX37"></A>
  674. <A NAME="IDX38"></A>
  675. <A NAME="IDX39"></A>
  676. <A NAME="IDX40"></A>
  677. <A NAME="IDX28"></A>
  678.   A keystroke is like a piano chord: you get it by simultaneously
  679. striking several keys.  To be more precise, a keystroke consists
  680. of a possibly empty set of modifiers followed by a single
  681. <DFN>keysym</DFN>.  The set of modifiers is small; it consists of
  682. <KBD>Control</KBD>, <KBD>Meta</KBD>, <KBD>Super</KBD>, <KBD>Hyper</KBD>, and <KBD>Shift</KBD>.
  683.   The rest of the keys on your keyboard, along with the mouse buttons,
  684. make up the set of keysyms.  A keysym is usually what is printed on the
  685. keys on your keyboard.  Here is a table of some of the symbolic names
  686. for keysyms:
  687. <DL COMPACT>
  688. <DT><KBD>a,b,c...</KBD>
  689. <DD>alphabetic keys
  690. <DT><KBD>f1,f2...</KBD>
  691. <DD>function keys
  692. <DT><KBD>button1</KBD>
  693. <DD>left mouse button
  694. <DT><KBD>button2</KBD>
  695. <DD>middle mouse button
  696. <DT><KBD>button3</KBD>
  697. <DD>right mouse button
  698. <DT><KBD>button1up</KBD>
  699. <DD>upstroke on the left mouse button
  700. <DT><KBD>button2up</KBD>
  701. <DD>upstroke on the middle mouse button
  702. <DT><KBD>button3up</KBD>
  703. <DD>upstroke on the right mouse button
  704. <DT><KBD>return</KBD>
  705. <DD>Return key
  706. </DL>
  707. <A NAME="IDX41"></A>
  708. Use the variable <CODE>keyboard-translate-table</CODE> only if you are on a
  709. dumb tty, as it cannot handle input that cannot be represented as ASCII.
  710. The value of this variable is a string used as a translate table for
  711. keyboard input or <CODE>nil</CODE>.  Each character is looked up in this
  712. string and the contents used instead.  If the string is of length
  713. <CODE>n</CODE>, character codes <CODE>N</CODE> and up are untranslated.  If you are
  714. running Emacs under X, you should do the translations with the
  715. <CODE>xmodmap</CODE> program instead.
  716. <A NAME="IDX42"></A>
  717. <A NAME="IDX43"></A>
  718. <A NAME="IDX44"></A>
  719. <H3><A NAME="SEC16" HREF="xEMACS_TO.HTM#SEC16">Representing Keystrokes</A></H3>
  720.   XEmacs represents keystrokes as lists. Each list consists of
  721. an arbitrary combination of modifiers followed by a single keysym at the
  722. end of the list.  If the keysym corresponds to an ASCII character, you
  723. can use its character code.  (A keystroke may also be represented by an
  724. event object, as returned by the <CODE>read-key-sequence</CODE> function;
  725. non-programmers need not worry about this.)
  726. The following table gives some examples of how to list representations
  727. for keystrokes.  Each list consists of sets of modifiers followed by
  728. keysyms:
  729. <DL COMPACT>
  730. <DT><KBD>(control a)</KBD>
  731. <DD>Pressing <KBD>CTRL</KBD> and <KBD>a</KBD> simultaneously.
  732. <DT><KBD>(control ?a)</KBD>
  733. <DD>Another way of writing the keystroke <KBD>C-a</KBD>.
  734. <DT><KBD>(control 65)</KBD>
  735. <DD>Yet another way of writing the keystroke <KBD>C-a</KBD>.
  736. <DT><KBD>(break)</KBD>
  737. <DD>Pressing the <KBD>BREAK</KBD> key.
  738. <DT><KBD>(control meta button2up)</KBD>
  739. <DD>Release the middle mouse button, while pressing <KBD>CTRL</KBD> and
  740. <KBD>META</KBD>. 
  741. <A NAME="IDX45"></A>
  742. </DL>
  743.   Note: As you define keystrokes, you can use the <KBD>shift</KBD> key only
  744. as a modifier with characters that do not have a second keysym on the
  745. same key, such as <KBD>backspace</KBD> and <KBD>tab</KBD>.  It is an error to
  746. define a keystroke using the <KBD>shift</KBD> modifier with keysyms such as
  747. <KBD>a</KBD> and <KBD>=</KBD>.  The correct forms are <KBD>A</KBD> and <KBD>+</KBD>.
  748. <H3><A NAME="SEC17" HREF="xEMACS_TO.HTM#SEC17">Representing Key Sequences</A></H3>
  749.   A <DFN>complete key sequence</DFN> is a sequence of keystrokes that Emacs
  750. understands as a unit.  Key sequences are significant because you can
  751. bind them to commands.  Note that not all sequences of keystrokes are
  752. possible key sequences.  In particular, the initial keystrokes in a key
  753. sequence must make up a <DFN>prefix key sequence</DFN>.
  754.   Emacs represents a key sequence as a vector of keystrokes.  Thus, the
  755. schematic representation of a complete key sequence is as follows:
  756. <PRE>
  757.   [(modifier .. modifer keysym) ... (modifier .. modifier keysym)]
  758. </PRE>
  759.   Here are some examples of complete key sequences:
  760. <DL COMPACT>
  761. <DT><KBD>[(control c) (control a)]</KBD>
  762. <DD>Typing <KBD>C-c</KBD> followed by <KBD>C-a</KBD>
  763. <DT><KBD>[(control c) (control 65)]</KBD>
  764. <DD>Typing <KBD>C-c</KBD> followed by <KBD>C-a</KBD>. (Using the ASCII code
  765. for the character `a')<DT><KBD>[(control c) (break)]</KBD>
  766. <DD>Typing <KBD>C-c</KBD> followed by the <KBD>break</KBD> character.</DL>
  767. <A NAME="IDX46"></A>
  768. <A NAME="IDX47"></A>
  769. <A NAME="IDX48"></A>
  770. <A NAME="IDX49"></A>
  771. <A NAME="IDX50"></A>
  772.   A <DFN>prefix key sequence</DFN> is the beginning of a series of longer
  773. sequences that are valid key sequences; adding any single keystroke to
  774. the end of a prefix results in a valid key sequence.  For example,
  775. <KBD>control-x</KBD> is standardly defined as a prefix.  Thus there is a
  776. two-character key sequence starting with <KBD>C-x</KBD> for each valid
  777. keystroke, giving numerous possibilities.  Here are some samples:
  778. <KBD>[(control x) (c)]</KBD>
  779. <KBD>[(control x) (control c)]</KBD>
  780. </UL>
  781.   Adding one character to a prefix key does not have to form a complete
  782. key.  It could make another, longer prefix.  For example, <KBD>[(control
  783. x) (\4)]</KBD> is itself a prefix that leads to any number of different
  784. three-character keys, including <KBD>[(control x) (\4) (f)]</KBD>,
  785. <KBD>[(control x) (\4) (b)]</KBD> and so on.  It would be possible to define
  786. one of those three-character sequences as a prefix, creating a series of
  787. four-character keys, but we did not define any of them this way.<P>
  788.   By contrast, the two-character sequence <KBD>[(control f) (control
  789. k)]</KBD> is not a key, because the <KBD>(control f)</KBD> is a complete key
  790. sequence in itself.  You cannot give <KBD>[(control f (control k)]</KBD> an
  791. independent meaning as a command while <KBD>(control f)</KBD> is a complete
  792. sequence, because Emacs would understand <KBD>C-f C-k</KBD> as two
  793. commands.<P>
  794.  The predefined prefix key sequences in Emacs are <KBD>(control c)</KBD>,
  795. <KBD>(control x)</KBD>, <KBD>(control h)</KBD>, <KBD>[(control x) (\4)]</KBD>, and
  796. <KBD>escape</KBD>.  You can customize Emacs and could make new prefix keys or
  797. eliminate the default key sequences.  See section <A HREF="xEMACS.HTM#SEC284">Customizing Key Bindings</A>.  For example,
  798. if you redefine <KBD>(control f)</KBD> as a prefix, <KBD>[(control f)
  799. (control k)]</KBD> automatically becomes a valid key sequence (complete,
  800. unless you define it as a prefix as well).  Conversely, if you remove
  801. the prefix definition of <KBD>[(control x) (\4)]</KBD>, <KBD>[(control x)
  802. (\4) (f)]</KBD> (or <KBD>[(control x) (\4) <VAR>anything</VAR>]</KBD>) is no longer a
  803. valid key sequence.
  804. Note that the above paragraphs uses \4 instead of simply 4, because \4
  805. is the symbol whose name is "4", and plain 4 is the integer 4, which
  806. would have been interpreted as the ASCII value.  Another way of
  807. representing the symbol whose name is "4" is to write ?4, which would be
  808. interpreted as the number 52, which is the ASCII code for the character
  809. "4".  We could therefore actually have written 52 directly, but that is
  810. far less clear.
  811. <H3><A NAME="SEC18" HREF="xEMACS_TO.HTM#SEC18">String Key Sequences</A></H3>
  812. For backward compatibility, you may also represent a key sequence using
  813. strings.  For example, we have the following equivalent representations:
  814. <DL COMPACT>
  815. <DT><KBD>"\C-c\C-c"</KBD>
  816. <DD><CODE>[(control c) (control c)]</CODE>
  817. <DT><KBD>"\e\C-c"</KBD>
  818. <DD><CODE>[(meta control c)]</CODE>
  819. </DL>
  820. <A NAME="IDX51"></A>
  821. <A NAME="IDX52"></A>
  822. <H3><A NAME="SEC19" HREF="xEMACS_TO.HTM#SEC19">Assignment of the <KBD>META</KBD> Key</A></H3>
  823. <A NAME="IDX54"></A>
  824. <A NAME="IDX53"></A>
  825.   Not all terminals have the complete set of modifiers.  
  826. Terminals that have a <KBD>Meta</KBD> key allow you to type Meta characters
  827. by just holding that key down.  To type <KBD>Meta-a</KBD>, hold down
  828. <KBD>META</KBD> and press <KBD>a</KBD>.  On those terminals, the <KBD>META</KBD> key
  829. works like the <KBD>SHIFT</KBD> key.  Such a key is not always labeled
  830. <KBD>META</KBD>, however, as this function is often a special option for a
  831. key with some other primary purpose.<P>
  832.   If there is no <KBD>META</KBD> key, you can still type Meta characters
  833. using two-character sequences starting with <KBD>ESC</KBD>.  To enter
  834. <KBD>M-a</KBD>, you could type <KBD><KBD>ESC</KBD> a</KBD>.  To enter <KBD>C-M-a</KBD>, you
  835. would type <KBD>ESC C-a</KBD>.  <KBD>ESC</KBD> is allowed on terminals with
  836. Meta keys, too, in case you have formed a habit of using it.<P>
  837. If you are running under X and do not have a <KBD>META</KBD> key, it 
  838. is possible to reconfigure some other key to be a <KBD>META</KBD> 
  839. key.  See section <A HREF="xEMACS.HTM#SEC20">Assignment of the <KBD>SUPER</KBD> and <KBD>HYPER</KBD> Keys</A>. <A NAME="IDX55"></A>
  840.   Emacs believes the terminal has a <KBD>META</KBD> key if the variable
  841. <CODE>meta-flag</CODE> is non-<CODE>nil</CODE>.  Normally this is set automatically
  842. according to the termcap entry for your terminal type.  However, sometimes
  843. the termcap entry is wrong, and then it is useful to set this variable
  844. yourself.  See section <A HREF="xEMACS.HTM#SEC275">Variables</A>, for how to do this.
  845. Note: If you are running under the X window system, the setting of
  846. the <CODE>meta-flag</CODE> variable is irrelevant. 
  847. <A NAME="IDX56"></A>
  848. <A NAME="IDX57"></A>
  849. <H3><A NAME="SEC20" HREF="xEMACS_TO.HTM#SEC20">Assignment of the <KBD>SUPER</KBD> and <KBD>HYPER</KBD> Keys</A></H3>
  850.   Most keyboards do not, by default, have <KBD>SUPER</KBD> or <KBD>HYPER</KBD>
  851. modifier keys.  Under X, you can simulate the <KBD>SUPER</KBD> or
  852. <KBD>HYPER</KBD> key if you want to bind keys to sequences using <KBD>super</KBD>
  853. and <KBD>hyper</KBD>.  You can use the <CODE>xmodmap</CODE> program to do this.
  854.   For example, to turn your <KBD>CAPS-LOCK</KBD> key into a <KBD>SUPER</KBD> key,
  855. do the following:
  856.   Create a file called <CODE>~/.xmodmap</CODE>.  In this file, place the lines
  857. <PRE>
  858.     remove Lock = Caps_Lock
  859.     keysym Caps_Lock = Super_L
  860.     add Mod2 = Super_L
  861. </PRE>
  862. The first line says that the key that is currently called <CODE>Caps_Lock</CODE>
  863. should no longer behave as a "lock" key.  The second line says that
  864. this should now be called <CODE>Super_L</CODE> instead.  The third line says that 
  865. the key called <CODE>Super_L</CODE> should be a modifier key, which produces the
  866. <CODE>Mod2</CODE> modifier.
  867. To create a <KBD>META</KBD> or <KBD>HYPER</KBD> key instead of a <KBD>SUPER</KBD> key,
  868. replace the word <CODE>Super</CODE> above with <CODE>Meta</CODE> or <CODE>Hyper</CODE>.
  869. Just after you start up X, execute the command <CODE>xmodmap /.xmodmap</CODE>.
  870. You can add this command to the appropriate initialization file to have
  871. the command executed automatically.<P>
  872. If you have problems, see the documentation for the <CODE>xmodmap</CODE>
  873. program.  The X keyboard model is quite complicated, and explaining
  874. it is beyond the scope of this manual.  However, we reprint the 
  875. following description from the X Protocol document for your convenience:
  876. <A NAME="IDX58"></A>
  877. <A NAME="IDX59"></A>
  878.  A list of keysyms is associated with each keycode. If that list
  879. (ignoring trailing <CODE>NoSymbol</CODE> entries) is a single keysym <SAMP>`K'</SAMP>,
  880. then the list is treated as if it were the list 
  881. <CODE>"K NoSymbol K NoSymbol"</CODE>. If the list (ignoring trailing 
  882. <CODE>NoSymbol</CODE> entries) is a pair of keysyms <SAMP>`K1 K2'</SAMP>, then the 
  883. list is treated as if it were the list <CODE>"K1 K2 K1 K2"</CODE>. If the 
  884. list (ignoring trailing <CODE>NoSymbol</CODE> entries) is a triple of keysyms 
  885. <SAMP>`K1 K2 K3'</SAMP>, then the list is treated as if it were the list 
  886. <CODE>"K1 K2 K3 NoSymbol"</CODE>.
  887.  The first four elements of the list are split into two groups of 
  888. keysyms. Group 1 contains the first and second keysyms; Group 2 contains
  889. third and fourth keysyms. Within each group, if the second element of
  890. the group is NoSymbol, then the group should be treated as if the second
  891. element were the same as the first element, except when the first
  892. element is an alphabetic keysym <SAMP>`K'</SAMP> for which both lowercase and 
  893. uppercase forms are defined. In that case, the group should be treated 
  894. as if the first element were the lowercase form of <SAMP>`K'</SAMP> and the second 
  895. element were the uppercase form of <SAMP>`K'</SAMP>.
  896.  The standard rules for obtaining a keysym from a KeyPress event make use of 
  897. only the Group 1 and Group 2 keysyms; no interpretation of other keysyms in 
  898. the list is given here. (That is, the last four keysyms are unused.)
  899.  Which group to use is determined by modifier state. Switching between
  900. groups is controlled by the keysym named <CODE>Mode_switch</CODE>. Attach that
  901. keysym to some keycode and attach that keycode to any one of the
  902. modifiers Mod1 through Mod5. This modifier is called the <DFN>group
  903. modifier</DFN>. For any keycode, Group 1 is used when the group modifier is
  904. off, and Group 2 is used when the group modifier is on.
  905.  Within a group, which keysym to use is also determined by modifier
  906. state. The first keysym is used when the <CODE>Shift</CODE> and <CODE>Lock</CODE> 
  907. modifiers are off. The second keysym is used when the <CODE>Shift</CODE> 
  908. modifier is on, or when the <CODE>Lock</CODE> modifier is on and the second 
  909. keysym is uppercase alphabetic, or when the <CODE>Lock</CODE> modifier is on 
  910. and is interpreted as <CODE>ShiftLock</CODE>. Otherwise, when the <CODE>Lock</CODE> 
  911. modifier is on and is interpreted as <CODE>CapsLock</CODE>, the state of the 
  912. <CODE>Shift</CODE> modifier is applied first to select a keysym, 
  913. but if that keysym is lower-case alphabetic, then the corresponding 
  914. upper-case keysym is used instead.
  915.  In addition to the above information on keysyms, we also provide the 
  916. following description of modifier mapping from the InterClient 
  917. Communications Conventions Manual:
  918. <A NAME="IDX60"></A>
  919.  X11 supports 8 modifier bits, of which 3 are pre-assigned to 
  920. <CODE>Shift</CODE>, <CODE>Lock</CODE>, and <CODE>Control</CODE>. Each modifier bit is 
  921. controlled by the state of a set of keys, and these sets are specified 
  922. in a table accessed by <CODE>GetModifierMapping()</CODE> and 
  923. <CODE>SetModifierMapping()</CODE>.
  924.  A client needing to use one of the pre-assigned modifiers should assume
  925. that the modifier table has been set up correctly to control these
  926. modifiers. The <CODE>Lock</CODE> modifier should be interpreted as <CODE>Caps
  927. Lock</CODE> or <CODE>Shift Lock</CODE> according to whether the keycodes in its
  928. controlling set include <CODE>XK_Caps_Lock</CODE> or <CODE>XK_Shift_Lock</CODE>.
  929.  Clients should determine the meaning of a modifier bit from the keysyms 
  930. being used to control it.
  931. A client needing to use an extra modifier, for example <CODE>Meta</CODE>, should:
  932. Scan the existing modifier mappings.
  933. If it finds a modifier that contains a keycode whose set of keysyms 
  934. includes <CODE>XK_Meta_L</CODE> or <CODE>XK_Meta_R</CODE>, it should use that 
  935. modifier bit.
  936. If there is no existing modifier controlled by <CODE>XK_Meta_L</CODE> or 
  937. <CODE>XK_Meta_R</CODE>, it should select an unused modifier bit (one with 
  938. an empty controlling set) and:
  939. </OL>
  940. If there is a keycode with <CODE>XL_Meta_L</CODE> in its set of keysyms, 
  941. add that keycode to the set for the chosen modifier, and then:
  942. If there is a keycode with <CODE>XL_Meta_R</CODE> in its set of keysyms, 
  943. add that keycode to the set for the chosen modifier, and then:
  944. If the controlling set is still empty, interact with the user to 
  945. select one or more keys to be <CODE>Meta</CODE>.
  946. </OL>
  947. If there are no unused modifier bits, ask the user to take corrective action.
  948. </OL>
  949.  This means that the <CODE>Mod1</CODE> modifier does not necessarily mean 
  950. <CODE>Meta</CODE>, although some applications (such as twm and emacs 18) 
  951. assume that. Any of the five unassigned modifier bits could mean 
  952. <CODE>Meta</CODE>; what matters is that a modifier bit is generated by a 
  953. keycode which is bound to the keysym <CODE>Meta_L</CODE> or <CODE>Meta_R</CODE>.
  954.  Therefore, if you want to make a <KBD>META</KBD> key, the right way 
  955. is to make the keycode in question generate both a <CODE>Meta</CODE> keysym 
  956. and some previously-unassigned modifier bit.
  957. <H2><A NAME="SEC21" HREF="xEMACS_TO.HTM#SEC21">Representation of Characters</A></H2>
  958. This section briefly discusses how characters are represented in Emacs
  959. buffers.  See section <A HREF="xEMACS.HTM#SEC17">Representing Key Sequences</A> for information on representing key
  960. sequences to create key bindings. 
  961.   ASCII graphic characters in Emacs buffers are displayed with their
  962. graphics.  <KBD>LFD</KBD> is the same as a newline character; it is displayed
  963. by starting a new line.  <KBD>TAB</KBD> is displayed by moving to the next
  964. tab stop column (usually every 8 spaces).  Other control characters are
  965. displayed as a caret (<SAMP>`^'</SAMP>) followed by the non-control version of
  966. the character; thus, <KBD>C-a</KBD> is displayed as <SAMP>`^A'</SAMP>.  Non-ASCII
  967. characters 128 and up are displayed with octal escape sequences; thus,
  968. character code 243 (octal), also called <KBD>M-#</KBD> when used as an input
  969. character, is displayed as <SAMP>`\243'</SAMP>.
  970. The variable <CODE>ctl-arrow</CODE> may be used to alter this behavior.
  971. See section <A HREF="xEMACS.HTM#SEC92">Variables Controlling Display</A>.
  972. <H2><A NAME="SEC22" HREF="xEMACS_TO.HTM#SEC22">Keys and Commands</A></H2>
  973. <A NAME="IDX61"></A>
  974. <A NAME="IDX62"></A>
  975. <A NAME="IDX63"></A>
  976. <A NAME="IDX64"></A>
  977. <A NAME="IDX65"></A>
  978.   This manual is full of passages that tell you what particular keys do.
  979. But Emacs does not assign meanings to keys directly.  Instead, Emacs
  980. assigns meanings to <DFN>functions</DFN>, and then gives keys their meanings
  981. by <DFN>binding</DFN> them to functions.
  982.  A function is a Lisp object that can be executed as a program.  Usually
  983. it is a Lisp symbol that has been given a function definition; every
  984. symbol has a name, usually made of a few English words separated by
  985. dashes, such as <CODE>next-line</CODE> or <CODE>forward-word</CODE>.  It also has a
  986. <DFN>definition</DFN>, which is a Lisp program.  Only some functions can be the
  987. bindings of keys; these are functions whose definitions use
  988. <CODE>interactive</CODE> to specify how to call them interactively.  Such
  989. functions are called <DFN>commands</DFN>, and their names are <DFN>command
  990. names</DFN>.  More information on this subject will appear in the <I>GNU
  991. Emacs Lisp Manual</I>.
  992.   The bindings between keys and functions are recorded in various tables
  993. called <DFN>keymaps</DFN>.  See section <A HREF="xEMACS.HTM#SEC284">Customizing Key Bindings</A> for more information on key
  994. sequences you can bind commands to.  See section <A HREF="xEMACS.HTM#SEC285">Keymaps</A> for information on
  995. creating keymaps.
  996.   When we say  "<KBD>C-n</KBD> moves down vertically one line" we are
  997. glossing over a distinction that is irrelevant in ordinary use but is
  998. vital in understanding how to customize Emacs.  The function
  999. <CODE>next-line</CODE> is programmed to move down vertically.  <KBD>C-n</KBD>
  1000. has this effect <I>because</I> it is bound to that function.  If you rebind
  1001. <KBD>C-n</KBD> to the function <CODE>forward-word</CODE> then <KBD>C-n</KBD> will move
  1002. forward by words instead.  Rebinding keys is a common method of
  1003. customization.<P>
  1004.    The rest of this manual usually ignores this subtlety to keep
  1005. things simple.  To give the customizer the information needed, we often
  1006. state the name of the command that really does the work in parentheses
  1007. after mentioning the key that runs it.  For example, we will say that
  1008. "The command <KBD>C-n</KBD> (<CODE>next-line</CODE>) moves point vertically
  1009. down," meaning that <CODE>next-line</CODE> is a command that moves vertically
  1010. down and <KBD>C-n</KBD> is a key that is standardly bound to it.
  1011. <A NAME="IDX66"></A>
  1012.   While we are on the subject of information for customization only,
  1013. it's a good time to tell you about <DFN>variables</DFN>.  Often the
  1014. description of a command will say, "To change this, set the variable
  1015. <CODE>mumble-foo</CODE>."  A variable is a name used to remember a value.
  1016. Most of the variables documented in this manual exist just to facilitate
  1017. customization: some command or other part of Emacs uses the variable
  1018. and behaves differently depending on its setting.  Until you are interested in
  1019. customizing, you can ignore the information about variables.  When you
  1020. are ready to be interested, read the basic information on variables, and 
  1021. then the information on individual variables will make sense.
  1022. See section <A HREF="xEMACS.HTM#SEC275">Variables</A>.
  1023. <H2><A NAME="SEC23" HREF="xEMACS_TO.HTM#SEC23">XEmacs Pull-down Menus</A></H2>
  1024. If you are running XEmacs under X, a menu bar on top of the
  1025. Emacs screen provides access to pull-down menus of file, edit, and
  1026. help-related commands. The menus provide convenient shortcuts and an
  1027. easy interface for novice users.  They do not provide additions to the
  1028. functionality available via key commands; you can still invoke commands
  1029. from the keyboard as in previous versions of Emacs.
  1030.         
  1031. <DL COMPACT>
  1032. <DT><B>File</B>
  1033. <DD>Perform file and buffer-related operations, such as opening and closing
  1034. files, saving and printing buffers, as well as exiting Emacs.
  1035. <DT><B>Edit</B>
  1036. <DD>Perform standard editing operations, such as 
  1037. cutting, copying, pasting, and killing selected text.
  1038. <DT><B>Options</B>
  1039. <DD>Perform some fancy editing operations, such as Case Sensitive Search, 
  1040. Syntax Highlighting, Parenthesis Highlighting and changing Fonts, 
  1041. Size, and Weight.
  1042. <DT><B>Buffers</B>
  1043. <DD>Present a menu of buffers for selection as well as the option to display
  1044. a buffer list.
  1045. <A NAME="IDX67"></A>
  1046. <DT><B>Help</B>
  1047. <DD>Access to Emacs Info.
  1048. <A NAME="IDX68"></A>
  1049. <A NAME="IDX69"></A>
  1050. </DL>
  1051. There are two ways of selecting an item from a pull-down menu:
  1052. Select an item in the menu bar by moving the cursor over it and click the
  1053. left mouse-button.  Then move the cursor over the menu item you want to choose
  1054. and click left again.
  1055. Select an item in the menu bar by moving the cursor over it and click and
  1056. hold the left mouse-button.  With the mouse-button depressed, move the
  1057. cursor over the menu item you want, then release it to make your selection. 
  1058. </UL>
  1059. If a command in the pull-down menu is not applicable in a given
  1060. situation, the command is disabled and its name appears faded.  You
  1061. cannot invoke items that are faded.  For example, most commands on the
  1062. <B>Edit</B> menu appear faded until you select text on which they are to
  1063. operate; after you select a block of text, edit commands are enabled.
  1064. See section <A HREF="xEMACS.HTM#SEC66">Selecting Text with the Mouse</A> for information on using the mouse to select
  1065. text.  See section <A HREF="xEMACS.HTM#SEC77">Using X Selections</A> for related information.
  1066. There are also <KBD>M-x</KBD> equivalents for each menu item.  To find the
  1067. equivalent for any left-button menu item, do the following:
  1068. Type <KBD>C-h k</KBD> to get the <CODE>Describe Key</CODE> prompt. 
  1069. Select the menu item and click. 
  1070. </OL>
  1071. Emacs displays the function associated with the menu item in a separate
  1072. window, usually together with some documentation. 
  1073. <H3><A NAME="SEC24" HREF="xEMACS_TO.HTM#SEC24">The File Menu</A></H3>
  1074. <A NAME="IDX70"></A>
  1075. The <B>File</B> menu bar item contains the items <B>New Screen</B>, <B>Open
  1076. File...</B>, <B>Save Buffer</B>, <B>Save Buffer As...</B>, <B>Revert Buffer</B>,
  1077. <B>Print Buffer</B>, <B>Delete Screen</B>, <B>Kill Buffer</B> and <B>Exit Emacs</B>
  1078. on the pull-down menu.  If you select a menu item, Emacs executes the
  1079. equivalent command.
  1080. <A NAME="IDX71"></A>
  1081. <A NAME="IDX72"></A>
  1082. <A NAME="IDX73"></A>
  1083. <A NAME="IDX74"></A>
  1084. <A NAME="IDX75"></A>
  1085. <A NAME="IDX76"></A>
  1086. <A NAME="IDX77"></A>
  1087. <A NAME="IDX78"></A>
  1088. <A NAME="IDX79"></A>
  1089. <A NAME="IDX80"></A>
  1090. <A NAME="IDX81"></A>
  1091. <A NAME="IDX82"></A>
  1092. <A NAME="IDX83"></A>
  1093. <A NAME="IDX84"></A>
  1094. <DL COMPACT>
  1095. <DT><B>Open File, New Screen...</B>
  1096. <DD>Prompts you for a filename and loads that file into a new buffer in a
  1097. new Emacs screen, that is, a new X window running under the same Emacs
  1098. process.  You can remove the screen using the <B>Delete Screen</B> menu
  1099. item.  When you remove the last screen, you exit Emacs and are prompted
  1100. for confirmation. 
  1101. <DT><B>Open File...</B>
  1102. <DD>Prompts you for a filename and loads that file into a new buffer. 
  1103. <B>Open File...</B> is equivalent to the Emacs command <CODE>find-file</CODE> (<KBD>C-x
  1104. C-f</KBD>).
  1105. <DT><B>Insert File...</B>
  1106. <DD>Prompts you for a filename and inserts the contents of that file into
  1107. the current buffer.  The file associated with the current buffer is
  1108. not changed by this command.  This is equivalent to the Emacs command
  1109. <CODE>insert-file</CODE> (<KBD>C-x i</KBD>).
  1110. <DT><B>Save Buffer</B>
  1111. <DD>Writes and saves the current Emacs buffer as the latest
  1112. version of the current visited file.  <B>Save Buffer</B> is equivalent to the
  1113. Emacs command <CODE>save-buffer</CODE> (<KBD>C-x C-s</KBD>).
  1114. <DT><B>Save Buffer As...</B>
  1115. <DD>Writes and saves the current Emacs buffer to the filename you specify.
  1116. <B>Save Buffer As...</B> is equivalent to the Emacs command
  1117. <CODE>write-file</CODE> (<KBD>C-x C-w</KBD>).
  1118. <DT><B>Revert Buffer</B>
  1119. <DD>Restores the last saved version of the file to the current buffer.  When
  1120. you edit a buffer containing a text file, you must save the buffer
  1121. before your changes become effective.  Use <B>Revert Buffer</B> if you do
  1122. not want to keep the changes you have made in the buffer.  <B>Revert
  1123. Buffer</B> is equivalent to the Emacs command <CODE>revert-file</CODE> (<KBD>M-x
  1124. revert-buffer</KBD>).
  1125. <DT><B>Kill Buffer</B>
  1126. <DD>Kills the current buffer, prompting you first if there are unsaved
  1127. changes.  This is roughly equivalent to the Emacs command 
  1128. <CODE>kill-buffer</CODE> (<KBD>C-x k</KBD>), except that <CODE>kill-buffer</CODE> 
  1129. prompts for the name of a buffer to kill. 
  1130. <DT><B>Print Buffer</B>
  1131. <DD>Prints a hardcopy of the current buffer.  Equivalent
  1132. to the Emacs command <CODE>print-buffer</CODE> (<KBD>M-x print-buffer</KBD>).
  1133. <DT><B>New Screen</B>
  1134. <DD>Creates a new Emacs screen displaying the <CODE>*scratch*</CODE> buffer.  This
  1135. is like the <B>Open File, New Screen...</B> menu item, except that it does
  1136. not prompt for or load a file.
  1137. <DT><B>Delete Screen</B>
  1138. <DD>Allows you to close all but one of the screens created by <B>New Screen</B>.
  1139. If you created several Emacs screens belonging to the same Emacs
  1140. process, you can close all but one of them.  When you attempt to close the
  1141. last screen, Emacs informs you that you are attempting to delete the
  1142. last screen.  You have to choose <B>Exit Emacs</B> for that.
  1143. <DT><B>Split Screen</B>
  1144. <DD>Divides the current window on the current screen into two equal-sized
  1145. windows, both displaying the same buffer.  Equivalent to the Emacs
  1146. command <CODE>split-window-vertically</CODE> (<KBD>C-x 2</KBD>).
  1147. <DT><B>Un-split (Keep This)</B>
  1148. <DD>If the screen is divided into multiple windows, this removes all windows
  1149. other than the selected one.  Equivalent to the Emacs command
  1150. <CODE>delete-other-windows</CODE> (<KBD>C-x 1</KBD>).
  1151. <DT><B>Un-split (Keep Others)</B>
  1152. <DD>If the screen is divided into multiple windows, this removes the
  1153. selected window from the screen, giving the space back to one of the
  1154. other windows.  Equivalent to the Emacs command <CODE>delete-window</CODE>
  1155. (<KBD>C-x 0</KBD>).
  1156. <DT><B>Exit Emacs</B>
  1157. <DD>Shuts down (kills) the Emacs process.  Equivalent to the Emacs command
  1158. <CODE>save-buffers-kill-emacs</CODE> (<KBD>C-x C-c</KBD>).  Before killing the
  1159. Emacs process, the system asks which unsaved buffers to save by going through
  1160. the list of all buffers in that Emacs process.</DL>
  1161. <A NAME="IDX85"></A>
  1162. <H3><A NAME="SEC25" HREF="xEMACS_TO.HTM#SEC25">The Edit Menu</A></H3>
  1163. The <B>Edit</B> pull-down menu contains the <B>Undo</B>, <B>Cut</B>, <B>Copy</B>,
  1164. <B>Paste</B>, and <B>Clear</B> menu items.  When you select a menu item, Emacs
  1165. executes the equivalent command.  Most commands on the <B>Edit</B> menu
  1166. work on a block of text, the X selection.  They appear faded until you
  1167. select a block of text (activate a region) with the mouse.  See section <A HREF="xEMACS.HTM#SEC77">Using X Selections</A>, see section <A HREF="xEMACS.HTM#SEC69">Deletion and Killing</A>, and see section <A HREF="xEMACS.HTM#SEC73">Yanking</A> for more
  1168. information.<P>
  1169. <A NAME="IDX86"></A>
  1170. <A NAME="IDX87"></A>
  1171. <A NAME="IDX88"></A>
  1172. <A NAME="IDX89"></A>
  1173. <A NAME="IDX90"></A>
  1174. <A NAME="IDX91"></A>
  1175. <A NAME="IDX92"></A>
  1176. <A NAME="IDX93"></A>
  1177. <DL COMPACT>
  1178. <DT><B>Undo</B>
  1179. <DD>Undoes the previous command.  <B>Undo</B> is equivalent to
  1180. the Emacs command <CODE>undo</CODE> (<KBD>C-x u</KBD>).
  1181. <DT><B>Cut</B>
  1182. <DD>Removes the selected text block from the current buffer, makes it the X
  1183. clipboard selection, and places it in the kill ring.  Before executing
  1184. this command, you have to select a region using Emacs region selection
  1185. commands or with the mouse.
  1186. <DT><B>Copy</B>
  1187. <DD>Makes a selected text block the X clipboard selection, and places it in
  1188. the kill ring.  You can select text using one of the Emacs region
  1189. selection commands or by selecting a text region with the mouse.
  1190. <DT><B>Paste</B>
  1191. <DD>Inserts the current value of the X clipboard selection in the current
  1192. buffer.  Note that this is not necessarily the same as the Emacs
  1193. <CODE>yank</CODE> command, because the Emacs kill ring and the X clipboard
  1194. selection are not the same thing.  You can paste in text you
  1195. have placed in the clipboard using <B>Copy</B> or <B>Cut</B>.  You can also
  1196. use <B>Paste</B> to insert text that was pasted into the clipboard from other
  1197. applications.
  1198. <DT><B>Clear</B>
  1199. <DD>Removes the selected text block from the current buffer but does not
  1200. place it in the kill ring or the X clipboard selection. 
  1201. <DT><B>Start Macro Recording</B>
  1202. <DD>After selecting this, Emacs will remember every keystroke you type until
  1203. <B>End Macro Recording</B> is selected.  This is the same as the Emacs 
  1204. command <CODE>start-kbd-macro</CODE> (<KBD>C-x (</KBD>).
  1205. <DT><B>End Macro Recording</B>
  1206. <DD>Selecting this tells emacs to stop remembering your keystrokes.  This is
  1207. the same as the Emacs command <CODE>end-kbd-macro</CODE> (<KBD>C-x )</KBD>).
  1208. <DT><B>Execute Last Macro</B>
  1209. <DD>Selecting this item will cause emacs to re-interpret all of the
  1210. keystrokes which were saved between selections of the <B>Start Macro
  1211. Recording</B> and <B>End Macro Recording</B> menu items.  This is the same
  1212. as the Emacs command <CODE>call-last-kbd-macro</CODE> (<KBD>C-x e</KBD>).
  1213. </DL>
  1214. <A NAME="IDX94"></A>
  1215. <H3><A NAME="SEC26" HREF="xEMACS_TO.HTM#SEC26">The Options Menu</A></H3>
  1216. The <B>Options</B> pull-down menu contains the <B>Read Only</B>, <B>Case 
  1217. Sensitive Search</B>, <B>Overstrike</B>, <B>Auto Delete Selection</B>, 
  1218. <B>Teach Extended Commands</B>, <B>Syntax Highlighting</B>, <B>Paren 
  1219. Highlighting</B>, <B>Font</B>, <B>Size</B>, <B>Weight</B>, <B>Buffers Menu 
  1220. Length...</B>, <B>Buffers Sub-Menus</B> and <B>Save Options</B> menu items. 
  1221. When you select a menu item, Emacs executes the equivalent command. 
  1222. For some of the menu items, there are sub-menus which you will need 
  1223. to select.
  1224. <A NAME="IDX95"></A>
  1225. <A NAME="IDX96"></A>
  1226. <A NAME="IDX97"></A>
  1227. <A NAME="IDX98"></A>
  1228. <A NAME="IDX99"></A>
  1229. <A NAME="IDX100"></A>
  1230. <A NAME="IDX101"></A>
  1231. <A NAME="IDX102"></A>
  1232. <A NAME="IDX103"></A>
  1233. <A NAME="IDX104"></A>
  1234. <A NAME="IDX105"></A>
  1235. <A NAME="IDX106"></A>
  1236. <A NAME="IDX107"></A>
  1237. <DL COMPACT>
  1238. <DT><B>Read Only</B>
  1239. <DD>Selecting this item will cause the buffer to visit the file in a 
  1240. read-only mode. Changes to the file will not be allowed. This is 
  1241. equivalent to the Emacs command <CODE>toggle-read-only</CODE> 
  1242. (<KBD>C-x C-q</KBD>).
  1243. <DT><B>Case Sensitive Search</B>
  1244. <DD>Selecting this item will cause searches to be case-sensitive. If 
  1245. its not selected then searches will ignore case. This option is 
  1246. local to the buffer.
  1247. <DT><B>Overstrike</B>
  1248. <DD>After selecting this item, when you type letters they will replace 
  1249. existing text on a one-to-one basis, rather than pushing it to the 
  1250. right. At the end of a line, such characters extend the line. Before 
  1251. a tab, such characters insert until the tab is filled in. This is the 
  1252. same as Emacs command <CODE>quoted-insert</CODE> (<KBD>C-q</KBD>).
  1253. <DT><B>Auto Delete Selection</B>
  1254. <DD>Selecting this item will cause automatic deletion of the selected 
  1255. region. The typed text will replace the selection if the selection 
  1256. is active (i.e. if its highlighted). If the option is not selected 
  1257. then the typed text is just inserted at the point.
  1258. <DT><B>Teach Extended Commands</B>
  1259. <DD>After you  select this item, any time you execute a command with 
  1260. <KBD>M-x</KBD>which has a shorter keybinding, you will be shown the 
  1261. alternate binding before the command executes.
  1262. <DT><B>Syntax Highlighting</B>
  1263. <DD>You can customize your <CODE>.emacs</CODE> file to include the font-lock 
  1264. mode so that when you select this item, the comments will be 
  1265. displayed in one face, strings in another, reserved words in another, 
  1266. and so on. When <B>Fonts</B> is selected, different parts of the program 
  1267. will appear in different Fonts. When <B>Colors</B> is selected, then the 
  1268. program will be displayed in different colors. Selecting <B>None</B> 
  1269. causes the program to appear in just one Font and Color. Selecting 
  1270. <B>Less</B> resets the Fonts and Colors to a fast, minimal set of 
  1271. decorations. Selecting <B>More</B> resets the Fonts and Colors to a larger 
  1272. set of decorations. For example, if <B>Less</B> is selected (which is the 
  1273. default setting) then you might have all comments in green color. 
  1274. Whereas, if <B>More</B> is selected then a function name in the comments 
  1275. themselves might appear in a different Color or Font.
  1276. <DT><B>Paren Highlighting</B>
  1277. <DD>After selecting <B>Blink</B> from this item, if you place the cursor 
  1278. on a parenthesis, the matching parenthesis will blink. If you select 
  1279. <B>Highlight</B> and place the cursor on a parenthesis, the whole 
  1280. expression of the parenthesis under the cursor will be highlighted. 
  1281. Selecting <B>None</B> will turn off the options (regarding <B>Paren 
  1282. Highlighting</B>) which you had selected earlier.
  1283. <DT><B>Font</B>
  1284. <DD>You can select any Font for your program by choosing from one of the 
  1285. available Fonts.
  1286. <DT><B>Size</B>
  1287. <DD>You can select any size ranging from <B>2</B> to <B>24</B> by selecting the 
  1288. appropriate option.
  1289. <DT><B>Weight</B>
  1290. <DD>You can choose either <B>Bold</B> or <B>Medium</B> for the weight.
  1291. <DT><B>Buffers Menu Length...</B>
  1292. <DD>Prompts you for the number of buffers to display. Then it will display 
  1293. that number of most recently selected buffers.
  1294. <DT><B>Buffers Sub-Menus</B>
  1295. <DD>After selection of this item the Buffers menu will contain several 
  1296. commands, as submenus of each buffer line. If this item is unselected, 
  1297. then there are no submenus for each buffer line, the only command 
  1298. available will be selecting that buffer.
  1299. <DT><B>Save Options</B>
  1300. <DD>Selecting this item will save the current settings of your Options 
  1301. menu to your <CODE>.emacs</CODE> file.
  1302. </DL>
  1303. <A NAME="IDX108"></A>
  1304. <H3><A NAME="SEC27" HREF="xEMACS_TO.HTM#SEC27">The Buffers Menu</A></H3>
  1305. The <B>Buffers</B> menu provides a selection of up to ten buffers and the
  1306. item <B>List All Buffers</B>, which provides a Buffer List. See section <A HREF="xEMACS.HTM#SEC149">Listing Existing Buffers</A> for more information.  
  1307. <A NAME="IDX109"></A>
  1308. <H3><A NAME="SEC28" HREF="xEMACS_TO.HTM#SEC28">The Help Menu</A></H3>
  1309. The Help Menu gives you access to Emacs Info and provides a menu
  1310. equivalent for each of the choices you have when using <KBD>C-h</KBD>. 
  1311. See section <A HREF="xEMACS.HTM#SEC55">Help</A> for more information. 
  1312. The Help menu also gives access to UNIX online manual pages via the
  1313. <B>UNIX Manual Page</B> option.  
  1314. <H3><A NAME="SEC29" HREF="xEMACS_TO.HTM#SEC29">Customizing XEmacs Menus</A></H3>
  1315. You can customize any of the pull-down menus by adding or removing menu
  1316. items and disabling or enabling existing menu items.
  1317. The following functions are available: 
  1318. <DL COMPACT>
  1319. <DT><KBD>add-menu: <VAR>(menu-path menu-name menu-items &optional before)</VAR></KBD>
  1320. <DD>Add a menu to the menu bar or one of its submenus.
  1321. <DT><KBD>add-menu-item: <VAR>(menu-path item-name function enabled-p</VAR>
  1322. <DD>&optional before)</KBD>
  1323. Add a menu item to a menu, creating the menu first if necessary.
  1324. <DT><KBD>delete-menu-item: <VAR>(path)</VAR></KBD>
  1325. <DD>Remove the menu item defined by <VAR>path</VAR> from the menu hierarchy.
  1326. <DT><KBD>disable-menu-item: <VAR>(path)</VAR></KBD>
  1327. <DD>Disable the specified menu item.
  1328. <DT><KBD>enable-menu-item: <VAR>(path)</VAR></KBD>
  1329. <DD>Enable the specified previously disabled menu item.
  1330. <DT><KBD>relabel-menu-item: <VAR>(path new-name)</VAR></KBD>
  1331. <DD>Change the string of the menu item specified by <VAR>path</VAR> to
  1332. <VAR>new-name</VAR>.
  1333. </DL>
  1334. <A NAME="IDX110"></A>
  1335. <A NAME="IDX111"></A>
  1336. Use the function <CODE>add-menu</CODE> to add a new menu or submenu.
  1337. If a menu or submenu of the given name exists already, it is changed.
  1338. <VAR>menu-path</VAR> identifies the menu under which the new menu should be
  1339. inserted.  It is a list of strings; for example, <CODE>("File")</CODE> names
  1340. the top-level <B>File</B> menu.  <CODE>("File" "Foo")</CODE> names a hypothetical
  1341. submenu of <B>File</B>.  If <VAR>menu-path</VAR> is <CODE>nil</CODE>, the menu is
  1342. added to the menu bar itself.
  1343. <VAR>menu-name</VAR> is the string naming the menu to be added.  
  1344. <VAR>menu-items</VAR> is a list of menu item descriptions.  Each menu item
  1345. should be a vector of three elements:
  1346. A string, which is the name of the menu item
  1347. A symbol naming a command, or a form to evaluate
  1348. <CODE>t</CODE> or <CODE>nil</CODE> to indicate whether the item is selectable
  1349. </UL>
  1350. The optional argument <VAR>before</VAR> is the name of the menu before which
  1351. the new menu or submenu should be added.  If the menu is already
  1352. present, it is not moved.
  1353. <A NAME="IDX112"></A>
  1354. <A NAME="IDX113"></A>
  1355. The function <CODE>add-menu-item</CODE> adds a menu item to the specified
  1356. menu, creating the menu first if necessary.  If the named item already
  1357. exists, the menu remains unchanged.
  1358. <VAR>menu-path</VAR> identifies the menu into which the new menu item should
  1359. be inserted.  It is a list of strings; for example, <CODE>("File")</CODE>
  1360. names the top-level <B>File</B> menu.  <CODE>("File" "Foo")</CODE> names a
  1361. hypothetical submenu of <B>File</B>.
  1362. <VAR>item-name</VAR> is the string naming the menu item to add.
  1363. <VAR>function</VAR> is the command to invoke when this menu item is selected.
  1364. If it is a symbol, it is invoked with <CODE>call-interactively</CODE>, in the
  1365. same way that functions bound to keys are invoked.  If it is a list, the
  1366. list is simply evaluated.
  1367. <VAR>enabled-p</VAR> controls whether the item is selectable or not.
  1368. It should be <CODE>t</CODE>, <CODE>nil</CODE>, or a form to evaluate to decide.  
  1369. This form will be evaluated just before the menu is displayed, and 
  1370. the menu item will be selectable if that form returns non-<CODE>nil</CODE>.
  1371. For example, to make the <CODE>rename-file</CODE> command available from the
  1372. <B>File</B> menu, use the following code:
  1373. <PRE>
  1374. (add-menu-item '("File") "Rename File" 'rename-file t)
  1375. </PRE>
  1376. To add a submenu of file management commands using a <B>File Management</B>
  1377. item, use the following code: 
  1378. <PRE>
  1379. (add-menu-item '("File" "File Management") "Copy File" 'copy-file t)
  1380. (add-menu-item '("File" "File Management") "Delete File" 'delete-file t)
  1381. (add-menu-item '("File" "File Management") "Rename File" 'rename-file t)
  1382. </PRE>
  1383. The optional <VAR>before</VAR> argument is the name of a menu item before
  1384. which the new item should be added.  If the item is already present, it
  1385. is not moved.
  1386. <A NAME="IDX114"></A>
  1387. <A NAME="IDX115"></A>
  1388. To remove a specified menu item from the menu hierarchy, use
  1389. <CODE>delete-menu-item</CODE>.
  1390. <VAR>path</VAR> is a list of strings that identify the position of the menu
  1391. item in the menu hierarchy.  <CODE>("File" "Save")</CODE> means the menu item
  1392. called <B>Save</B> under the top level <B>File</B> menu.  <CODE>("Menu" "Foo"
  1393. "Item")</CODE> means the menu item called <B>Item</B> under the <B>Foo</B> submenu
  1394. of <B>Menu</B>.
  1395. <A NAME="IDX116"></A>
  1396. <A NAME="IDX117"></A>
  1397. <A NAME="IDX118"></A>
  1398. <A NAME="IDX119"></A>
  1399. To disable a menu item, use <CODE>disable-menu-item</CODE>.  The disabled
  1400. menu item is grayed and can no longer be selected.  To make the
  1401. item selectable again, use <CODE>enable-menu-item</CODE>.
  1402. <CODE>disable-menu-item</CODE> and <CODE>enable-menu-item</CODE> both have the
  1403. argument <VAR>path</VAR>.
  1404. <A NAME="IDX120"></A>
  1405. <A NAME="IDX121"></A>
  1406. To change the string of the specified menu item, use
  1407. <CODE>relabel-menu-item</CODE>. This function also takes the argument <VAR>path</VAR>.
  1408. <VAR>new-name</VAR> is the string to which the menu item will be changed.
  1409. <A NAME="IDX122"></A>
  1410. <A NAME="IDX123"></A>
  1411. <H1><A NAME="SEC30" HREF="xEMACS_TO.HTM#SEC30">Entering and Exiting Emacs</A></H1>
  1412.   The usual way to invoke Emacs is to type <KBD>emacs <KBD>RET</KBD></KBD> at
  1413. the shell.  To invoke XEmacs, type <KBD>xemacs <KBD>RET</KBD></KBD>.
  1414. Emacs clears the screen and then displays an initial advisory message and
  1415. copyright notice.  You can begin typing Emacs commands immediately
  1416. afterward.
  1417.   Some operating systems insist on discarding all type-ahead when Emacs
  1418. starts up; they give Emacs no way to prevent this.  Therefore, it is
  1419. wise to wait until Emacs clears the screen before typing the first
  1420. editing command.
  1421. <A NAME="IDX124"></A>
  1422.   Before Emacs reads the first command, you have not had a chance to
  1423. give a command to specify a file to edit.  Since Emacs must always have a
  1424. current buffer for editing, it presents a buffer, by default, a buffer named
  1425. <SAMP>`*scratch*'</SAMP>.  The buffer is in Lisp Interaction
  1426. mode; you can use it to type Lisp expressions and evaluate them, or you
  1427. can ignore that capability and simply doodle.  You can specify a
  1428. different major mode for this buffer by setting the variable
  1429. <CODE>initial-major-mode</CODE> in your init file.  See section <A HREF="xEMACS.HTM#SEC292">The Init File, .emacs</A>.
  1430.   It is possible to give Emacs arguments in the shell command line to
  1431. specify files to visit, Lisp files to load, and functions to call.
  1432. <A NAME="IDX125"></A>
  1433. <A NAME="IDX126"></A>
  1434. <A NAME="IDX127"></A>
  1435. <A NAME="IDX128"></A>
  1436. <H2><A NAME="SEC31" HREF="xEMACS_TO.HTM#SEC31">Exiting Emacs</A></H2>
  1437.   There are two commands for exiting Emacs because there are two kinds
  1438. of exiting: <DFN>suspending</DFN> Emacs and <DFN>killing</DFN> Emacs.
  1439. <DFN>Suspending</DFN> means stopping Emacs temporarily and returning control
  1440. to its superior (usually the shell), allowing you to resume editing
  1441. later in the same Emacs job, with the same files, same kill ring, same
  1442. undo history, and so on.  This is the usual way to exit.  <DFN>Killing</DFN>
  1443. Emacs means destroying the Emacs job.  You can run Emacs again later,
  1444. but you will get a fresh Emacs; there is no way to resume the same
  1445. editing session after it has been killed.
  1446. <DL COMPACT>
  1447. <DT><KBD>C-z</KBD>
  1448. <DD>Suspend Emacs (<CODE>suspend-emacs</CODE>).  If used under the X window system,
  1449. shrink the X window containing the Emacs screen to an icon (see below).
  1450. <DT><KBD>C-x C-c</KBD>
  1451. <DD>Kill Emacs (<CODE>save-buffers-kill-emacs</CODE>).
  1452. </DL>
  1453. If you use XEmacs under the X window system, <KBD>C-z</KBD> shrinks
  1454. the X window containing the Emacs screen to an icon.  The Emacs process
  1455. is stopped temporarily, and control is returned to the window manager.
  1456. If more than one screen is associated with the Emacs process, only the
  1457. screen from which you used <KBD>C-z</KBD> is retained.  The X windows
  1458. containing the other Emacs screens are closed. 
  1459. To activate the "suspended" Emacs, use the appropriate window manager
  1460. mouse gestures.  Usually left-clicking on the icon reactivates and
  1461. reopens the X window containing the Emacs screen, but the window manager
  1462. you use determines what exactly happens.  To actually kill the Emacs
  1463. process, use <KBD>C-x C-c</KBD> or the <B>Exit Emacs</B> item on the <B>File</B>
  1464. menu.
  1465. <A NAME="IDX129"></A>
  1466. <A NAME="IDX130"></A>
  1467.   On systems that do not permit programs to be suspended, <KBD>C-z</KBD> runs
  1468. an inferior shell that communicates directly with the terminal, and
  1469. Emacs waits until you exit the subshell.  On these systems, the only way
  1470. to return to the shell from which Emacs was started (to log out, for
  1471. example) is to kill Emacs.  <KBD>C-d</KBD> or <CODE>exit</CODE> are typical
  1472. commands to exit a subshell.
  1473. <A NAME="IDX131"></A>
  1474. <A NAME="IDX132"></A>
  1475.   To kill Emacs, type <KBD>C-x C-c</KBD> (<CODE>save-buffers-kill-emacs</CODE>).  A
  1476. two-character key is used for this to make it harder to type.  In
  1477. XEmacs, selecting the <B>Exit Emacs</B> option of the <B>File</B> menu is an
  1478. alternate way of issuing the command.
  1479. Unless a numeric argument is used, this command first offers to save any
  1480. modified buffers.  If you do not save all buffers, you are asked for
  1481. reconfirmation with <KBD>yes</KBD> before killing Emacs, since any changes
  1482. not saved will be lost.  If any subprocesses are still running, <KBD>C-x
  1483. C-c</KBD> asks you to confirm killing them, since killing Emacs kills the
  1484. subprocesses simultaneously.
  1485.   In most programs running on Unix, certain characters may instantly
  1486. suspend or kill the program.  (In Berkeley Unix these characters are
  1487. normally <KBD>C-z</KBD> and <KBD>C-c</KBD>.)  <I>This Unix feature is turned off
  1488. while you are in Emacs.</I> The meanings of <KBD>C-z</KBD> and <KBD>C-x C-c</KBD> as
  1489. keys in Emacs were inspired by the standard Berkeley Unix meanings of
  1490. <KBD>C-z</KBD> and <KBD>C-c</KBD>, but that is their only relationship with Unix.
  1491. You could customize these keys to do anything (see section <A HREF="xEMACS.HTM#SEC285">Keymaps</A>).
  1492. <A NAME="IDX133"></A>
  1493. <A NAME="IDX134"></A>
  1494. <H2><A NAME="SEC32" HREF="xEMACS_TO.HTM#SEC32">Command Line Switches and Arguments</A></H2>
  1495.   GNU Emacs supports command line arguments you can use to request
  1496. various actions when invoking Emacs.  The commands are for compatibility
  1497. with other editors and for sophisticated activities.  If you are using
  1498. XEmacs under the X window system, you can also use a number of
  1499. standard Xt command line arguments. Command line arguments are not usually
  1500. needed for editing with Emacs; new users can skip this section.
  1501. Many editors are designed to be started afresh each time you want to
  1502. edit.  You start the editor to edit one file; then exit the editor.  The
  1503. next time you want to edit either another file or the same one, you
  1504. start the editor again.  Under these circumstances, it makes sense to use a
  1505. command line argument to say which file to edit.
  1506.   The recommended way to use GNU Emacs is to start it only once, just
  1507. after you log in, and do all your editing in the same Emacs process.
  1508. Each time you want to edit a file, you visit it using the existing
  1509. Emacs.  Emacs creates a new buffer for each file, and (unless you kill
  1510. some of the buffers) Emacs eventually has many files in it ready for
  1511. editing.  Usually you do not kill the Emacs process until you are about
  1512. to log out.  Since you usually read files by typing commands to Emacs,
  1513. command line arguments for specifying a file when Emacs is started are seldom
  1514. needed.
  1515.   Emacs accepts command-line arguments that specify files to visit,
  1516. functions to call, and other activities and operating modes.  If you are
  1517. running XEmacs under the X window system, a number of standard
  1518. Xt command line arguments are available as well. 
  1519. The following subsections list:
  1520. Command line arguments that you can always use
  1521. Command line arguments that have to appear at the beginning of the
  1522. argument list
  1523. Command line arguments that are only relevant if you are running Lucid
  1524. Emacs under X
  1525. </UL>
  1526. <H3><A NAME="SEC33" HREF="xEMACS_TO.HTM#SEC33">Command Line Arguments for Any Position</A></H3>
  1527.  Command line arguments are processed in the order they appear on the
  1528. command line; however, certain arguments (the ones in the
  1529. second table) must be at the front of the list if they are used.
  1530.   Here are the arguments allowed:
  1531. <DL COMPACT>
  1532. <DT><SAMP>`<VAR>file</VAR>'</SAMP>
  1533. <DD>Visit <VAR>file</VAR> using <CODE>find-file</CODE>.  See section <A HREF="xEMACS.HTM#SEC114">Visiting Files</A>.
  1534. <DT><SAMP>`+<VAR>linenum</VAR> <VAR>file</VAR>'</SAMP>
  1535. <DD>Visit <VAR>file</VAR> using <CODE>find-file</CODE>, then go to line number
  1536. <VAR>linenum</VAR> in it.
  1537. <DT><SAMP>`-load <VAR>file</VAR>'</SAMP>
  1538. <DD><DT><SAMP>`-l <VAR>file</VAR>'</SAMP>
  1539. <DD>Load a file <VAR>file</VAR> of Lisp code with the function <CODE>load</CODE>.
  1540. See section <A HREF="xEMACS.HTM#SEC222">Libraries of Lisp Code for Emacs</A>.
  1541. <DT><SAMP>`-funcall <VAR>function</VAR>'</SAMP>
  1542. <DD><DT><SAMP>`-f <VAR>function</VAR>'</SAMP>
  1543. <DD>Call Lisp function <VAR>function</VAR> with no arguments.
  1544. <DT><SAMP>`-eval <VAR>function</VAR>'</SAMP>
  1545. <DD>Interpret the next argument as a Lisp expression, and evaluate it.
  1546. You must be very careful of the shell quoting here.
  1547. <DT><SAMP>`-insert <VAR>file</VAR>'</SAMP>
  1548. <DD><DT><SAMP>`-i <VAR>file</VAR>'</SAMP>
  1549. <DD>Insert the contents of <VAR>file</VAR> into the current buffer.  This is like
  1550. what <KBD>M-x insert-buffer</KBD> does; See section <A HREF="xEMACS.HTM#SEC146">Miscellaneous File Operations</A>.
  1551. <DT><SAMP>`-kill'</SAMP>
  1552. <DD>Exit from Emacs without asking for confirmation.
  1553. <DT><SAMP>`-version'</SAMP>
  1554. <DD>Prints version information.  This implies <SAMP>`-batch'</SAMP>.
  1555. <PRE>
  1556. % emacs -version
  1557. GNU Emacs 19.6 Lucid of Thu Apr  1 1993 on thalidomide (berkeley-unix)
  1558. </PRE>
  1559. <DT><SAMP>`-help'</SAMP>
  1560. <DD>Prints a summary of command-line options and then exits.
  1561. </DL>
  1562. <H3><A NAME="SEC34" HREF="xEMACS_TO.HTM#SEC34">Command Line Arguments (Beginning of Line Only)</A></H3>
  1563.   The following arguments are recognized only at the beginning of the
  1564. command line.  If more than one of them appears, they must appear in the
  1565. order in which they appear in this table.
  1566. <DL COMPACT>
  1567. <DT><SAMP>`-t <VAR>file</VAR>'</SAMP>
  1568. <DD>Use <VAR>file</VAR> instead of the terminal for input and output. (This
  1569. option is currently not valid in XEmacs.)
  1570. <A NAME="IDX135"></A>
  1571. <DT><SAMP>`-batch'</SAMP>
  1572. <DD>Run Emacs in <DFN>batch mode</DFN>, which means that the text being edited is
  1573. not displayed and the standard Unix interrupt characters such as
  1574. <KBD>C-z</KBD> and <KBD>C-c</KBD> continue to have their normal effect.  Emacs in
  1575. batch mode outputs to <CODE>stderr</CODE> only what would normally be printed
  1576. in the echo area under program control.
  1577. Batch mode is used for running programs written in Emacs Lisp from shell
  1578. scripts, makefiles, and so on.  Normally the <SAMP>`-l'</SAMP> switch or
  1579. <SAMP>`-f'</SAMP> switch will be used as well, to invoke a Lisp program to do
  1580. the batch processing.
  1581. <SAMP>`-batch'</SAMP> implies <SAMP>`-q'</SAMP> (do not load an init file).  It also
  1582. causes Emacs to kill itself after all command switches have been
  1583. processed.  In addition, auto-saving is not done except in buffers for
  1584. which it has been explicitly requested.
  1585. <DT><SAMP>`-no-init-file'</SAMP>
  1586. <DD><DT><SAMP>`-q'</SAMP>
  1587. <DD>Do not load your Emacs init file <TT>`~/.emacs'</TT>.
  1588. <DT><SAMP>`-no-site-file'</SAMP>
  1589. <DD>Do not load the site-specific init file <TT>`lisp/site-start.el'</TT>.
  1590. <DT><SAMP>`-user <VAR>user</VAR>'</SAMP>
  1591. <DD><DT><SAMP>`-u <VAR>user</VAR>'</SAMP>
  1592. <DD>Load <VAR>user</VAR>'s Emacs init file <TT>`~<VAR>user</VAR>/.emacs'</TT> instead of
  1593. your own.
  1594. </DL>
  1595. <A NAME="IDX136"></A>
  1596.   Note that the init file can get access to the command line argument
  1597. values as the elements of a list in the variable
  1598. <CODE>command-line-args</CODE>.  (The arguments in the second table above will
  1599. already have been processed and will not be in the list.)  The init file
  1600. can override the normal processing of the other arguments by setting
  1601. this variable.
  1602.   One way to use command switches is to visit many files automatically:
  1603. <PRE>
  1604. emacs *.c
  1605. </PRE>
  1606. passes each <CODE>.c</CODE> file as a separate argument to Emacs, so that
  1607. Emacs visits each file (see section <A HREF="xEMACS.HTM#SEC114">Visiting Files</A>).
  1608.   Here is an advanced example that assumes you have a Lisp program file
  1609. called <TT>`hack-c-program.el'</TT> which, when loaded, performs some useful
  1610. operation on the current buffer, expected to be a C program.
  1611. <PRE>
  1612. emacs -batch foo.c -l hack-c-program -f save-buffer -kill > log
  1613. </PRE>
  1614. Here Emacs is told to visit <TT>`foo.c'</TT>, load <TT>`hack-c-program.el'</TT>
  1615. (which makes changes in the visited file), save <TT>`foo.c'</TT> (note that
  1616. <CODE>save-buffer</CODE> is the function that <KBD>C-x C-s</KBD> is bound to), and
  1617. then exit to the shell from which the command was executed.  <SAMP>`-batch'</SAMP>
  1618. guarantees there will be no problem redirecting output to <TT>`log'</TT>,
  1619. because Emacs will not assume that it has a display terminal to work
  1620. with.
  1621. <A NAME="IDX137"></A>
  1622. <A NAME="IDX138"></A>
  1623. <H3><A NAME="SEC35" HREF="xEMACS_TO.HTM#SEC35">Command Line Arguments (for XEmacs Under X)</A></H3>
  1624. If you are running XEmacs under X, a number of options are
  1625. available to control color, border, and window title and icon name:
  1626. <DL COMPACT>
  1627. <DT><SAMP>`-title <VAR>title</VAR>'</SAMP>
  1628. <DD><DT><SAMP>`-wn <VAR>title</VAR>'</SAMP>
  1629. <DD><DT><SAMP>`-T <VAR>title</VAR>'</SAMP>
  1630. <DD>Use <VAR>title</VAR> as the window title. This sets the
  1631. <CODE>screen-title-format</CODE> variable, which controls the title of the X
  1632. window corresponding to the selected screen.  This is the same format as
  1633. <CODE>mode-line-format</CODE>.
  1634. <DT><SAMP>`-iconname <VAR>title</VAR>'</SAMP>
  1635. <DD><DT><SAMP>`-in <VAR>title</VAR>'</SAMP>
  1636. <DD>Use <VAR>title</VAR> as the icon name. This sets the
  1637. <CODE>screen-icon-title-format</CODE> variable, which controls the title of
  1638. the icon corresponding to the selected screen.
  1639. <DT><SAMP>`-mc <VAR>color</VAR>'</SAMP>
  1640. <DD>Use <VAR>color</VAR> as the mouse color.
  1641. <DT><SAMP>`-cr <VAR>color</VAR>'</SAMP>
  1642. <DD>Use <VAR>color</VAR> as the text-cursor foreground color.
  1643. </DL>
  1644. In addition, XEmacs allows you to use a number of standard Xt
  1645. command line arguments. 
  1646. <DL COMPACT>
  1647. <DT><SAMP>`-background <VAR>color</VAR>'</SAMP>
  1648. <DD><DT><SAMP>`-bg <VAR>color</VAR>'</SAMP>
  1649. <DD>Use <VAR>color</VAR> as the background color.
  1650. <DT><SAMP>`-bordercolor <VAR>color</VAR>'</SAMP>
  1651. <DD><DT><SAMP>`-bd <VAR>color</VAR>'</SAMP>
  1652. <DD>Use <VAR>color</VAR> as the border color.
  1653. <DT><SAMP>`-borderwidth <VAR>width</VAR>'</SAMP>
  1654. <DD><DT><SAMP>`-bw <VAR>width</VAR>'</SAMP>
  1655. <DD>Use <VAR>width</VAR> as the border width.
  1656. <DT><SAMP>`-display <VAR>display</VAR>'</SAMP>
  1657. <DD><DT><SAMP>`-d <VAR>display</VAR>'</SAMP>
  1658. <DD>When running under the X window system, create the window containing the
  1659. Emacs screen on the display named <VAR>display</VAR>.
  1660. <DT><SAMP>`-foreground <VAR>color</VAR>'</SAMP>
  1661. <DD><DT><SAMP>`-fg <VAR>color</VAR>'</SAMP>
  1662. <DD>Use <VAR>color</VAR> as the foreground color.
  1663. <DT><SAMP>`-font <VAR>name</VAR>'</SAMP>
  1664. <DD><DT><SAMP>`-fn <VAR>name</VAR>'</SAMP>
  1665. <DD>Use <VAR>name</VAR> as the default font.
  1666. <DT><SAMP>`-geometry <VAR>spec</VAR>'</SAMP>
  1667. <DD><DT><SAMP>`-geom <VAR>spec</VAR>'</SAMP>
  1668. <DD><DT><SAMP>`-g <VAR>spec</VAR>'</SAMP>
  1669. <DD>Use the geometry (window size and/or position) specified by <VAR>spec</VAR>.
  1670. <DT><SAMP>`-iconic'</SAMP>
  1671. <DD>Start up iconified.
  1672. <DT><SAMP>`-rv'</SAMP>
  1673. <DD>Bring up Emacs in reverse video.
  1674. <DT><SAMP>`-<VAR>name</VAR>'</SAMP>
  1675. <DD>Use the resource manager resources specified by <VAR>name</VAR>.
  1676. The default is to use the name of the program (<CODE>argv[0]</CODE>) as
  1677. the resource manager name.
  1678. <DT><SAMP>`-xrm'</SAMP>
  1679. <DD>Read something into the resource database for this invocation of Emacs only.
  1680. </DL>
  1681. <H1><A NAME="SEC36" HREF="xEMACS_TO.HTM#SEC36">Basic Editing Commands</A></H1>
  1682. <A NAME="IDX139"></A>
  1683. <A NAME="IDX140"></A>
  1684.   We now give the basics of how to enter text, make corrections, and
  1685. save the text in a file.  If this material is new to you, you might
  1686. learn it more easily by running the Emacs learn-by-doing tutorial.  To
  1687. do this, type <KBD>Control-h t</KBD> (<CODE>help-with-tutorial</CODE>).
  1688. <H2><A NAME="SEC37" HREF="xEMACS_TO.HTM#SEC37">Inserting Text</A></H2>
  1689. <A NAME="IDX141"></A>
  1690. <A NAME="IDX142"></A>
  1691. <A NAME="IDX143"></A>
  1692. <A NAME="IDX144"></A>
  1693.   To insert printing characters into the text you are editing, just type
  1694. them.  This inserts the characters into the buffer at the cursor (that
  1695. is, at <DFN>point</DFN>; see section <A HREF="xEMACS.HTM#SEC10">Point</A>).  The cursor moves forward.  Any
  1696. characters after the cursor move forward too.  If the text in the buffer
  1697. is <SAMP>`FOOBAR'</SAMP>, with the cursor before the <SAMP>`B'</SAMP>, and you type
  1698. <KBD>XX</KBD>, the result is <SAMP>`FOOXXBAR'</SAMP>, with the cursor still before the
  1699. <SAMP>`B'</SAMP>.
  1700. <A NAME="IDX145"></A>
  1701. <A NAME="IDX146"></A>
  1702.    To <DFN>delete</DFN> text you have just inserted, use <KBD>DEL</KBD>.
  1703. <KBD>DEL</KBD> deletes the character <VAR>before</VAR> the cursor (not the one
  1704. that the cursor is on top of or under; that is the character <VAR>after</VAR>
  1705. the cursor).  The cursor and all characters after it move backwards.
  1706. Therefore, if you type a printing character and then type <KBD>DEL</KBD>,
  1707. they cancel out.
  1708. <A NAME="IDX147"></A>
  1709. <A NAME="IDX148"></A>
  1710.    To end a line and start typing a new one, type <KBD>RET</KBD>.  This
  1711. inserts a newline character in the buffer.  If point is in the middle of
  1712. a line, <KBD>RET</KBD> splits the line.  Typing <KBD>DEL</KBD> when the cursor is
  1713. at the beginning of a line rubs out the newline before the line, thus
  1714. joining the line with the preceding line.
  1715.   Emacs automatically splits lines when they become too long, if you
  1716. turn on a special mode called <DFN>Auto Fill</DFN> mode.  See section <A HREF="xEMACS.HTM#SEC179">Filling Text</A>, for
  1717. information on using Auto Fill mode.
  1718. <A NAME="IDX149"></A>
  1719. <A NAME="IDX150"></A>
  1720. <A NAME="IDX151"></A>
  1721.   Customization information: <KBD>DEL</KBD>, in most modes, runs the command
  1722. <CODE>delete-backward-char</CODE>; <KBD>RET</KBD> runs the command <CODE>newline</CODE>,
  1723. and self-inserting printing characters run the command
  1724. <CODE>self-insert</CODE>, which inserts whatever character was typed to invoke
  1725. it.  Some major modes rebind <KBD>DEL</KBD> to other commands.
  1726. <A NAME="IDX152"></A>
  1727. <A NAME="IDX153"></A>
  1728. <A NAME="IDX154"></A>
  1729.   Direct insertion works for printing characters and <KBD>SPC</KBD>, but
  1730. other characters act as editing commands and do not insert themselves.
  1731. If you need to insert a control character or a character whose code is
  1732. above 200 octal, you must <DFN>quote</DFN> it by typing the character
  1733. <KBD>control-q</KBD> (<CODE>quoted-insert</CODE>) first.  There are two ways to use
  1734. <KBD>C-q</KBD>:<P>
  1735. <KBD>Control-q</KBD> followed by any non-graphic character (even <KBD>C-g</KBD>)
  1736. inserts that character.
  1737. <KBD>Control-q</KBD> followed by three octal digits inserts the character
  1738. with the specified character code.
  1739. </UL>
  1740. A numeric argument to <KBD>C-q</KBD> specifies how many copies of the quoted
  1741. character should be inserted (see section <A HREF="xEMACS.HTM#SEC45">Numeric Arguments</A>).
  1742.   If you prefer to have text characters replace (overwrite) existing
  1743. text instead of moving it to the right, you can enable Overwrite mode, a
  1744. minor mode.  See section <A HREF="xEMACS.HTM#SEC274">Minor Modes</A>.
  1745. <H2><A NAME="SEC38" HREF="xEMACS_TO.HTM#SEC38">Changing the Location of Point</A></H2>
  1746.   To do more than insert characters, you have to know how to move point
  1747. (see section <A HREF="xEMACS.HTM#SEC10">Point</A>).  Here are a few of the available commands.
  1748. <A NAME="IDX155"></A>
  1749. <A NAME="IDX156"></A>
  1750. <A NAME="IDX157"></A>
  1751. <A NAME="IDX158"></A>
  1752. <A NAME="IDX159"></A>
  1753. <A NAME="IDX160"></A>
  1754. <A NAME="IDX161"></A>
  1755. <A NAME="IDX162"></A>
  1756. <A NAME="IDX163"></A>
  1757. <A NAME="IDX164"></A>
  1758. <A NAME="IDX165"></A>
  1759. <A NAME="IDX166"></A>
  1760. <A NAME="IDX167"></A>
  1761. <A NAME="IDX168"></A>
  1762. <A NAME="IDX169"></A>
  1763. <A NAME="IDX170"></A>
  1764. <A NAME="IDX171"></A>
  1765. <A NAME="IDX172"></A>
  1766. <A NAME="IDX173"></A>
  1767. <A NAME="IDX174"></A>
  1768. <A NAME="IDX175"></A>
  1769. <A NAME="IDX176"></A>
  1770. <A NAME="IDX177"></A>
  1771. <A NAME="IDX178"></A>
  1772. <DL COMPACT>
  1773. <DT><KBD>C-a</KBD>
  1774. <DD>Move to the beginning of the line (<CODE>beginning-of-line</CODE>).
  1775. <DT><KBD>C-e</KBD>
  1776. <DD>Move to the end of the line (<CODE>end-of-line</CODE>).
  1777. <DT><KBD>C-f</KBD>
  1778. <DD>Move forward one character (<CODE>forward-char</CODE>).
  1779. <DT><KBD>C-b</KBD>
  1780. <DD>Move backward one character (<CODE>backward-char</CODE>).
  1781. <DT><KBD>M-f</KBD>
  1782. <DD>Move forward one word (<CODE>forward-word</CODE>).
  1783. <DT><KBD>M-b</KBD>
  1784. <DD>Move backward one word (<CODE>backward-word</CODE>).
  1785. <DT><KBD>C-n</KBD>
  1786. <DD>Move down one line, vertically (<CODE>next-line</CODE>).  This command attempts to keep the horizontal position unchanged, so if you start in the middle of one line, you end in the middle of the next.  When on the last line of text, <KBD>C-n</KBD> creates a new line and moves onto it.  @item C-p
  1787. Move up one line, vertically (<CODE>previous-line</CODE>).
  1788. <DT><KBD>C-l</KBD>
  1789. <DD>Clear the screen and reprint everything (<CODE>recenter</CODE>).  Text moves
  1790. on the screen to bring point to the center of the window.
  1791. <DT><KBD>M-r</KBD>
  1792. <DD>Move point to left margin on the line halfway down the screen or
  1793. window (<CODE>move-to-window-line</CODE>).  Text does not move on the
  1794. screen.  A numeric argument says how many screen lines down from the
  1795. top of the window (zero for the top).  A negative argument counts from
  1796. the bottom (-1 for the bottom).
  1797. <DT><KBD>C-t</KBD>
  1798. <DD>Transpose two characters, the ones before and after the cursor
  1799. <BR>(<CODE>transpose-chars</CODE>).
  1800. <DT><KBD>M-<</KBD>
  1801. <DD>Move to the top of the buffer (<CODE>beginning-of-buffer</CODE>).  With
  1802. numeric argument <VAR>n</VAR>, move to <VAR>n</VAR>/10 of the way from the top.
  1803. See section <A HREF="xEMACS.HTM#SEC45">Numeric Arguments</A>, for more information on numeric arguments.<DT><KBD>M-></KBD>
  1804. <DD>Move to the end of the buffer (<CODE>end-of-buffer</CODE>).
  1805. <DT><KBD>M-x goto-char</KBD>
  1806. <DD>Read a number <VAR>n</VAR> and move the cursor to character number <VAR>n</VAR>.
  1807. Position 1 is the beginning of the buffer.
  1808. <DT><KBD>M-x goto-line</KBD>
  1809. <DD>Read a number <VAR>n</VAR> and move cursor to line number <VAR>n</VAR>.  Line 1
  1810. is the beginning of the buffer.
  1811. <A NAME="IDX179"></A>
  1812. <DT><KBD>C-x C-n</KBD>
  1813. <DD>Use the current column of point as the <DFN>semi-permanent goal column</DFN> for
  1814. <KBD>C-n</KBD> and <KBD>C-p</KBD> (<CODE>set-goal-column</CODE>).  Henceforth, those
  1815. commands always move to this column in each line moved into, or as
  1816. close as possible given the contents of the line.  This goal column remains
  1817. in effect until canceled.
  1818. <DT><KBD>C-u C-x C-n</KBD>
  1819. <DD>Cancel the goal column.  Henceforth, <KBD>C-n</KBD> and <KBD>C-p</KBD> once
  1820. again try to avoid changing the horizontal position, as usual.
  1821. </DL>
  1822. <A NAME="IDX180"></A>
  1823.   If you set the variable <CODE>track-eol</CODE> to a non-<CODE>nil</CODE> value,
  1824. <KBD>C-n</KBD> and <KBD>C-p</KBD> move to the end of the line when at the end of
  1825. the starting line.  By default, <CODE>track-eol</CODE> is <CODE>nil</CODE>.
  1826. <H2><A NAME="SEC39" HREF="xEMACS_TO.HTM#SEC39">Erasing Text</A></H2>
  1827. <DL COMPACT>
  1828. <DT><KBD><KBD>DEL</KBD></KBD>
  1829. <DD>Delete the character before the cursor (<CODE>delete-backward-char</CODE>).
  1830. <DT><KBD>C-d</KBD>
  1831. <DD>Delete the character after the cursor (<CODE>delete-char</CODE>).
  1832. <DT><KBD>C-k</KBD>
  1833. <DD>Kill to the end of the line (<CODE>kill-line</CODE>).
  1834. <DT><KBD>M-d</KBD>
  1835. <DD>Kill forward to the end of the next word (<CODE>kill-word</CODE>).
  1836. <DT><KBD>M-<KBD>DEL</KBD></KBD>
  1837. <DD>Kill back to the beginning of the previous word
  1838. (<CODE>backward-kill-word</CODE>).
  1839. </DL>
  1840.   In contrast to the <KBD>DEL</KBD> key, which deletes the character before
  1841. the cursor, <KBD>Control-d</KBD> deletes the character after the cursor,
  1842. causing the rest of the text on the line to shift left.  If
  1843. <KBD>Control-d</KBD> is typed at the end of a line, that line and the next
  1844. line are joined.
  1845.   To erase a larger amount of text, use <KBD>Control-k</KBD>, which kills a
  1846. line at a time.  If you use <KBD>C-k</KBD> at the beginning or in the middle
  1847. of a line, it kills all the text up to the end of the line.  If you use
  1848. <KBD>C-k</KBD> at the end of a line, it joins that line and the next
  1849. line.
  1850.   See section <A HREF="xEMACS.HTM#SEC69">Deletion and Killing</A>, for more flexible ways of killing text.
  1851. <H2><A NAME="SEC40" HREF="xEMACS_TO.HTM#SEC40">Files</A></H2>
  1852. <A NAME="IDX181"></A>
  1853.   The commands above are sufficient for creating and altering text in an
  1854. Emacs buffer.  More advanced Emacs commands just make things easier.  But
  1855. to keep any text permanently you must put it in a <DFN>file</DFN>.  Files are
  1856. named units of text which are stored by the operating system and which
  1857. you can retrieve by name.  To look at or use the contents of a file in
  1858. any way, including editing the file with Emacs, you must specify the
  1859. file name.
  1860.   Consider a file named <TT>`/usr/rms/foo.c'</TT>.  To begin editing
  1861. this file from Emacs, type:
  1862. <PRE>
  1863. C-x C-f /usr/rms/foo.c <KBD>RET</KBD>
  1864. </PRE>
  1865. The file name is given as an <DFN>argument</DFN> to the command <KBD>C-x
  1866. C-f</KBD> (<CODE>find-file</CODE>).  The command uses the <DFN>minibuffer</DFN> to
  1867. read the argument.  You have to type <KBD>RET</KBD> to terminate the argument
  1868. (see section <A HREF="xEMACS.HTM#SEC47">The Minibuffer</A>).<P>
  1869.   You can also use the <B>Open...</B> menu item from the <B>File</B> menu, then
  1870. type the name of the file to the prompt.
  1871.   Emacs obeys the command by <DFN>visiting</DFN> the file: it creates a
  1872. buffer, copies the contents of the file into the buffer, and then
  1873. displays the buffer for you to edit.  You can make changes in the
  1874. buffer, and then <DFN>save</DFN> the file by typing <KBD>C-x C-s</KBD>
  1875. (<CODE>save-buffer</CODE>) or choosing <B>Save Buffer</B> from the <B>File</B> menu.  This
  1876. makes the changes permanent by copying the altered contents of the
  1877. buffer back into the file <TT>`/usr/rms/foo.c'</TT>.  Until then, the
  1878. changes are only inside your Emacs buffer, and the file <TT>`foo.c'</TT> is
  1879. not changed.<P>
  1880.   To create a file, visit the file with <KBD>C-x C-f</KBD> as if it already
  1881. existed or choose <B>Open...</B> from the <B>File</B> menu and provide the
  1882. name for the new file in the minibuffer.  Emacs will create an empty
  1883. buffer in which you can insert the text you want to put in the file.
  1884. When you save the buffer with <KBD>C-x C-s</KBD>, or by choosing <B>Save
  1885. Buffer</B> from the <B>File</B> menu, the file is created.
  1886.   To learn more about using files, see section <A HREF="xEMACS.HTM#SEC112">File Handling</A>.
  1887. <H2><A NAME="SEC41" HREF="xEMACS_TO.HTM#SEC41">Help</A></H2>
  1888.   If you forget what a key does, you can use the Help character
  1889. (<KBD>C-h</KBD>) to find out: Type <KBD>C-h k</KBD> followed by the key you want to know
  1890. about.  For example, <KBD>C-h k C-n</KBD> tells you what <KBD>C-n</KBD>
  1891. does.  <KBD>C-h</KBD> is a prefix key; <KBD>C-h k</KBD> is just one of its
  1892. subcommands (the command <CODE>describe-key</CODE>).  The other subcommands of
  1893. <KBD>C-h</KBD> provide different kinds of help.  Type <KBD>C-h</KBD> three times
  1894. to get a description of all the help facilities.  See section <A HREF="xEMACS.HTM#SEC55">Help</A>.<P>
  1895. <H2><A NAME="SEC42" HREF="xEMACS_TO.HTM#SEC42">Blank Lines</A></H2>
  1896.   Here are special commands and techniques for entering and removing
  1897. blank lines.
  1898. <DL COMPACT>
  1899. <DT><KBD>C-o</KBD>
  1900. <DD>Insert one or more blank lines after the cursor (<CODE>open-line</CODE>).
  1901. <DT><KBD>C-x C-o</KBD>
  1902. <DD>Delete all but one of many consecutive blank lines
  1903. (<CODE>delete-blank-lines</CODE>).
  1904. </DL>
  1905. <A NAME="IDX182"></A>
  1906. <A NAME="IDX183"></A>
  1907. <A NAME="IDX184"></A>
  1908. <A NAME="IDX185"></A>
  1909. <A NAME="IDX186"></A>
  1910.   When you want to insert a new line of text before an existing line,
  1911. you just type the new line of text, followed by <KBD>RET</KBD>.  If you
  1912. prefer to create a blank line first and then insert the desired text,
  1913. use the key <KBD>C-o</KBD> (<CODE>open-line</CODE>), which inserts a newline after
  1914. point but leaves point in front of the newline.  Then type
  1915. the text into the new line.  <KBD>C-o F O O</KBD> has the same effect as
  1916. <KBD>F O O <KBD>RET</KBD></KBD>, except for the final location of point.
  1917.   To create several blank lines, type <KBD>C-o</KBD> several times, or
  1918. give <KBD>C-o</KBD> an argument indicating how many blank lines to create.
  1919. See section <A HREF="xEMACS.HTM#SEC45">Numeric Arguments</A>, for more information.
  1920.   If you have many blank lines in a row and want to get rid of them, use
  1921. <KBD>C-x C-o</KBD> (<CODE>delete-blank-lines</CODE>).  If point is on a blank
  1922. line which is adjacent to at least one other blank line, <KBD>C-x C-o</KBD>
  1923. deletes all but one of the blank lines.
  1924. If point is on a blank line with no other adjacent blank line, the
  1925. sole blank line is deleted.  If point is on a non-blank
  1926. line, <KBD>C-x C-o</KBD> deletes any blank lines following that non-blank
  1927. line.
  1928. <H2><A NAME="SEC43" HREF="xEMACS_TO.HTM#SEC43">Continuation Lines</A></H2>
  1929. <A NAME="IDX187"></A>
  1930.   If you add too many characters to one line without breaking with a
  1931. <KBD>RET</KBD>, the line grows to occupy two (or more) screen lines, with a
  1932. curved arrow at the extreme right margin of all but the last line.  The
  1933. curved arrow indicates that the following screen line is not really a
  1934. distinct line in the text, but just the <DFN>continuation</DFN> of a line too
  1935. long to fit the screen.  You can use Auto Fill mode (see section <A HREF="xEMACS.HTM#SEC179">Filling Text</A>)
  1936. to have Emacs insert newlines automatically when a line gets too long.
  1937. <A NAME="IDX188"></A>
  1938. <A NAME="IDX189"></A>
  1939.   Instead of continuation, long lines can be displayed by <DFN>truncation</DFN>.
  1940. This means that all the characters that do not fit in the width of the
  1941. screen or window do not appear at all.  They remain in the buffer,
  1942. temporarily invisible.  Three diagonal dots in the last column (instead of
  1943. the curved arrow inform you that truncation is in effect.
  1944.   To turn off continuation for a particular buffer, set the
  1945. variable <CODE>truncate-lines</CODE> to non-<CODE>nil</CODE> in that buffer.
  1946. Truncation instead of continuation also happens whenever horizontal
  1947. scrolling is in use, and optionally whenever side-by-side windows are in
  1948. use (see section <A HREF="xEMACS.HTM#SEC153">Multiple Windows</A>).  Altering the value of <CODE>truncate-lines</CODE> makes
  1949. it local to the current buffer; until that time, the default value is in
  1950. effect.  The default is initially <CODE>nil</CODE>.  See section <A HREF="xEMACS.HTM#SEC278">Local Variables</A>.<P>
  1951. <H2><A NAME="SEC44" HREF="xEMACS_TO.HTM#SEC44">Cursor Position Information</A></H2>
  1952.   If you are accustomed to other display editors, you may be surprised
  1953. that Emacs does not always display the page number or line number of
  1954. point in the mode line.  In Emacs, this information is only rarely
  1955. needed, and a number of commands are available to compute and print it.
  1956. Since text is stored in a way that makes it difficult to compute the
  1957. information, it is not displayed all the time.
  1958. <DL COMPACT>
  1959. <DT><KBD>M-x what-page</KBD>
  1960. <DD>Print page number of point, and line number within page.
  1961. <DT><KBD>M-x what-line</KBD>
  1962. <DD>Print line number of point in the buffer.
  1963. <DT><KBD>M-=</KBD>
  1964. <DD>Print number of lines and characters in the current region 
  1965. (<CODE>count-lines-region</CODE>).
  1966. <DT><KBD>C-x =</KBD>
  1967. <DD>Print character code of character after point, character position of
  1968. point, and column of point (<CODE>what-cursor-position</CODE>).
  1969. </DL>
  1970. <A NAME="IDX190"></A>
  1971. <A NAME="IDX191"></A>
  1972. <A NAME="IDX192"></A>
  1973. <A NAME="IDX193"></A>
  1974. <A NAME="IDX194"></A>
  1975. <A NAME="IDX195"></A>
  1976.   There are several commands for printing line numbers:
  1977. <KBD>M-x what-line</KBD> counts lines from the beginning of the file and
  1978. prints the line number point is on.  The first line of the file is line
  1979. number 1.  You can use these numbers as arguments to <KBD>M-x
  1980. goto-line</KBD>.
  1981. <KBD>M-x what-page</KBD> counts pages from the beginning of the file, and
  1982. counts lines within the page, printing both of them.  See section <A HREF="xEMACS.HTM#SEC178">Pages</A>, for
  1983. the command <KBD>C-x l</KBD>, which counts the lines in the current page.
  1984. <KBD>M-=</KBD> (<CODE>count-lines-region</CODE>) prints the number of lines in
  1985. the region (see section <A HREF="xEMACS.HTM#SEC60">Selecting Text</A>).
  1986. </UL>
  1987. <A NAME="IDX196"></A>
  1988. <A NAME="IDX197"></A>
  1989.   The command <KBD>C-x =</KBD> (<CODE>what-cursor-position</CODE>) provides
  1990. information about point and about the column the cursor is in.
  1991. It prints a line in the echo area that looks like this:
  1992. <PRE>
  1993. Char: x (0170)  point=65986 of 563027(12%)  column 44
  1994. </PRE>
  1995. (In fact, this is the output produced when point is before <SAMP>`column 44'</SAMP>
  1996. in the example.)
  1997.   The two values after <SAMP>`Char:'</SAMP> describe the character following point,
  1998. first by showing it and second by giving its octal character code.
  1999.   <SAMP>`point='</SAMP> is followed by the position of point expressed as a character
  2000. count.  The front of the buffer counts as position 1, one character later
  2001. as 2, and so on.  The next, larger number is the total number of characters
  2002. in the buffer.  Afterward in parentheses comes the position expressed as a
  2003. percentage of the total size.
  2004.   <SAMP>`column'</SAMP> is followed by the horizontal position of point, in columns
  2005. from the left edge of the window.
  2006.   If the buffer has been narrowed, making some of the text at the
  2007. beginning and the end temporarily invisible, <KBD>C-x =</KBD> prints
  2008. additional text describing the current visible range.  For example, it
  2009. might say:
  2010. <PRE>
  2011. Char: x (0170)  point=65986 of 563025(12%) <65102 - 68533>  column 44
  2012. </PRE>
  2013. where the two extra numbers give the smallest and largest character position
  2014. that point is allowed to assume.  The characters between those two positions
  2015. are the visible ones.  See section <A HREF="xEMACS.HTM#SEC265">Narrowing</A>.
  2016.   If point is at the end of the buffer (or the end of the visible part),
  2017. <KBD>C-x =</KBD> omits any description of the character after point.
  2018. The output looks like
  2019. <PRE>
  2020. point=563026 of 563025(100%)  column 0
  2021. </PRE>
  2022. <A NAME="IDX198"></A>
  2023. <H2><A NAME="SEC45" HREF="xEMACS_TO.HTM#SEC45">Numeric Arguments</A></H2>
  2024.   Any Emacs command can be given a <DFN>numeric argument</DFN>.  Some commands
  2025. interpret the argument as a repetition count.  For example, giving an
  2026. argument of ten to the key <KBD>C-f</KBD> (the command <CODE>forward-char</CODE>, move
  2027. forward one character) moves forward ten characters.  With these commands,
  2028. no argument is equivalent to an argument of one.  Negative arguments are
  2029. allowed.  Often they tell a command to move or act backwards.
  2030. <A NAME="IDX199"></A>
  2031. <A NAME="IDX200"></A>
  2032. <A NAME="IDX201"></A>
  2033. <A NAME="IDX202"></A>
  2034.   If your keyboard has a <KBD>META</KBD> key, the easiest way to
  2035. specify a numeric argument is to type digits and/or a minus sign while
  2036. holding down the the <KBD>META</KBD> key.  For example,
  2037. <PRE>
  2038. M-5 C-n
  2039. </PRE>
  2040. moves down five lines.  The characters <KBD>Meta-1</KBD>, <KBD>Meta-2</KBD>, and
  2041. so on, as well as <KBD>Meta--</KBD>, do this because they are keys bound to
  2042. commands (<CODE>digit-argument</CODE> and <CODE>negative-argument</CODE>) that are
  2043. defined to contribute to an argument for the next command.
  2044. <A NAME="IDX203"></A>
  2045. <A NAME="IDX204"></A>
  2046.   Another way of specifying an argument is to use the <KBD>C-u</KBD>
  2047. (<CODE>universal-argument</CODE>) command followed by the digits of the argument.
  2048. With <KBD>C-u</KBD>, you can type the argument digits without holding
  2049. down shift keys.  To type a negative argument, start with a minus sign.
  2050. Just a minus sign normally means -1.  <KBD>C-u</KBD> works on all terminals.
  2051.   <KBD>C-u</KBD> followed by a character which is neither a digit nor a minus
  2052. sign has the special meaning of "multiply by four".  It multiplies the
  2053. argument for the next command by four.  <KBD>C-u</KBD> twice multiplies it by
  2054. sixteen.  Thus, <KBD>C-u C-u C-f</KBD> moves forward sixteen characters.  This
  2055. is a good way to move forward "fast", since it moves about 1/5 of a line
  2056. in the usual size screen.  Other useful combinations are <KBD>C-u C-n</KBD>,
  2057. <KBD>C-u C-u C-n</KBD> (move down a good fraction of a screen), <KBD>C-u C-u
  2058. C-o</KBD> (make "a lot" of blank lines), and <KBD>C-u C-k</KBD> (kill four
  2059. lines).<P>
  2060.   Some commands care only about whether there is an argument and not about
  2061. its value.  For example, the command <KBD>M-q</KBD> (<CODE>fill-paragraph</CODE>) with
  2062. no argument fills text; with an argument, it justifies the text as well.
  2063. (See section <A HREF="xEMACS.HTM#SEC179">Filling Text</A>, for more information on <KBD>M-q</KBD>.)  Just <KBD>C-u</KBD> is a
  2064. handy way of providing an argument for such commands.
  2065.   Some commands use the value of the argument as a repeat count, but do
  2066. something peculiar when there is no argument.  For example, the command
  2067. <KBD>C-k</KBD> (<CODE>kill-line</CODE>) with argument <VAR>n</VAR> kills <VAR>n</VAR> lines,
  2068. including their terminating newlines.  But <KBD>C-k</KBD> with no argument is
  2069. special: it kills the text up to the next newline, or, if point is right at
  2070. the end of the line, it kills the newline itself.  Thus, two <KBD>C-k</KBD>
  2071. commands with no arguments can kill a non-blank line, just like <KBD>C-k</KBD>
  2072. with an argument of one.  (See section <A HREF="xEMACS.HTM#SEC69">Deletion and Killing</A>, for more information on
  2073. <KBD>C-k</KBD>.)<P>
  2074.   A few commands treat a plain <KBD>C-u</KBD> differently from an ordinary
  2075. argument.  A few others may treat an argument of just a minus sign
  2076. differently from an argument of -1.  These unusual cases will be
  2077. described when they come up; they are always to make the individual
  2078. command more convenient to use.
  2079. <A NAME="IDX205"></A>
  2080. <A NAME="IDX206"></A>
  2081. <H1><A NAME="SEC46" HREF="xEMACS_TO.HTM#SEC46">Undoing Changes</A></H1>
  2082.   Emacs allows you to undo all changes you make to the text of a buffer,
  2083. up to a certain amount of change (8000 characters).  Each buffer records
  2084. changes individually, and the undo command always applies to the
  2085. current buffer.  Usually each editing command makes a separate entry
  2086. in the undo records, but some commands such as <CODE>query-replace</CODE>
  2087. make many entries, and very simple commands such as self-inserting
  2088. characters are often grouped to make undoing less tedious.
  2089. <DL COMPACT>
  2090. <DT><KBD>C-x u</KBD>
  2091. <DD>Undo one batch of changes (usually, one command's worth) (<CODE>undo</CODE>).
  2092. <DT><KBD>C-_</KBD>
  2093. <DD>The same.
  2094. </DL>
  2095. <A NAME="IDX207"></A>
  2096. <A NAME="IDX208"></A>
  2097. <A NAME="IDX209"></A>
  2098.   The command <KBD>C-x u</KBD> or <KBD>C-_</KBD> allows you to undo changes.  The
  2099. first time you give this command, it undoes the last change.  Point
  2100. moves to the text affected by the undo, so you can see what was undone.
  2101.   Consecutive repetitions of the <KBD>C-_</KBD> or <KBD>C-x u</KBD> commands undo
  2102. earlier and earlier changes, back to the limit of what has been
  2103. recorded.  If all recorded changes have already been undone, the undo
  2104. command prints an error message and does nothing.
  2105.   Any command other than an undo command breaks the sequence of undo
  2106. commands.  Starting at this moment, the previous undo commands are
  2107. considered ordinary changes that can themselves be undone.  Thus, you can
  2108. redo changes you have undone by typing <KBD>C-f</KBD> or any other command
  2109. that have no important effect, and then using more undo commands.
  2110.   If you notice that a buffer has been modified accidentally, the
  2111. easiest way to recover is to type <KBD>C-_</KBD> repeatedly until the stars
  2112. disappear from the front of the mode line.  When that happens, all the
  2113. modifications you made have been canceled.  If you do not remember
  2114. whether you changed the buffer deliberately, type <KBD>C-_</KBD> once. When
  2115. you see Emacs undo the last change you made, you probably remember why you
  2116. made it.  If the change was an accident, leave it undone.  If it was
  2117. deliberate, redo the change as described in the preceding paragraph.
  2118.   Whenever an undo command makes the stars disappear from the mode line,
  2119. the buffer contents is the same as it was when the file was last read in
  2120. or saved.
  2121.   Not all buffers record undo information.  Buffers whose names start with
  2122. spaces don't; these buffers are used internally by Emacs and its extensions
  2123. to hold text that users don't normally look at or edit.  Minibuffers,
  2124. help buffers, and documentation buffers also don't record undo information.
  2125.   Emacs can remember at most 8000 or so characters of deleted or
  2126. modified text in any one buffer for reinsertion by the undo command.
  2127. There is also a limit on the number of individual insert, delete, or
  2128. change actions that Emacs can remember.
  2129.   There are two keys to run the <CODE>undo</CODE> command, <KBD>C-x u</KBD> and
  2130. <KBD>C-_</KBD>, because on some keyboards, it is not obvious how to type
  2131. <KBD>C-_</KBD>. <KBD>C-x u</KBD> is an alternative you can type in the same
  2132. fashion on any terminal.
  2133. <A NAME="IDX210"></A>
  2134. <H1><A NAME="SEC47" HREF="xEMACS_TO.HTM#SEC47">The Minibuffer</A></H1>
  2135.   Emacs commands use the <DFN>minibuffer</DFN> to read arguments more
  2136. complicated than a single number.  Minibuffer arguments can be file
  2137. names, buffer names, Lisp function names, Emacs command names, Lisp
  2138. expressions, and many other things, depending on the command reading the
  2139. argument.  To edit the argument in the minibuffer, you can use Emacs
  2140. editing commands.
  2141. <A NAME="IDX211"></A>
  2142.   When the minibuffer is in use, it appears in the echo area, and the
  2143. cursor moves there.  The beginning of the minibuffer line displays a
  2144. <DFN>prompt</DFN> indicating what kind of input you should supply and how it
  2145. will be used.  The prompt is often derived from the name of the command
  2146. the argument is for.  The prompt normally ends with a colon.
  2147. <A NAME="IDX212"></A>
  2148.   Sometimes a <DFN>default argument</DFN> appears in parentheses after the
  2149. colon; it, too, is part of the prompt.  The default is used as the
  2150. argument value if you enter an empty argument (e.g., by just typing <KBD>RET</KBD>).
  2151. For example, commands that read buffer names always show a default, which
  2152. is the name of the buffer that will be used if you type just <KBD>RET</KBD>.
  2153. <A NAME="IDX213"></A>
  2154.   The simplest way to give a minibuffer argument is to type the text you
  2155. want, terminated by <KBD>RET</KBD> to exit the minibuffer.  To get out
  2156. of the minibuffer and cancel the command that it was for, type
  2157. <KBD>C-g</KBD>.
  2158.   Since the minibuffer uses the screen space of the echo area, it can
  2159. conflict with other ways Emacs customarily uses the echo area.  Here is how
  2160. Emacs handles such conflicts:
  2161. If a command gets an error while you are in the minibuffer, this does
  2162. not cancel the minibuffer.  However, the echo area is needed for the
  2163. error message and therefore the minibuffer itself is hidden for a
  2164. while.  It comes back after a few seconds, or as soon as you type
  2165. anything.
  2166. If you use a command in the minibuffer whose purpose is to print a
  2167. message in the echo area (for example <KBD>C-x =</KBD>) the message is
  2168. displayed normally, and the minibuffer is hidden for a while.  It comes back
  2169. after a few seconds, or as soon as you type anything.
  2170. Echoing of keystrokes does not take place while the minibuffer is in
  2171. </UL>
  2172. <H2><A NAME="SEC48" HREF="xEMACS_TO.HTM#SEC48">Minibuffers for File Names</A></H2>
  2173.   Sometimes the minibuffer starts out with text in it.  For example, when
  2174. you are supposed to give a file name, the minibuffer starts out containing
  2175. the <DFN>default directory</DFN>, which ends with a slash.  This informs
  2176. you in which directory the file will be looked for if you do not specify
  2177. a different one. For example, the minibuffer might start out with:
  2178. <PRE>
  2179. Find File: /u2/emacs/src/
  2180. </PRE>
  2181. where <SAMP>`Find File: '</SAMP> is the prompt.  Typing <KBD>buffer.c</KBD> specifies
  2182. the file 
  2183. <BR><TT>`/u2/emacs/src/buffer.c'</TT>.  To find files in nearby
  2184. directories, use <SAMP>`..'</SAMP>; thus, if you type <KBD>../lisp/simple.el</KBD>, the
  2185. file that you visit will be the one named 
  2186. <BR><TT>`/u2/emacs/lisp/simple.el'</TT>.
  2187. Alternatively, you can use  <KBD>M-<KBD>DEL</KBD></KBD> to kill directory names you
  2188. don't want (see section <A HREF="xEMACS.HTM#SEC175">Words</A>).<P>
  2189.   You can also type an absolute file name, one starting with a slash or a
  2190. tilde, ignoring the default directory.  For example, to find the file
  2191. <TT>`/etc/termcap'</TT>, just type the name, giving:
  2192. <PRE>
  2193. Find File: /u2/emacs/src//etc/termcap
  2194. </PRE>
  2195. Two slashes in a row are not normally meaningful in Unix file names, but
  2196. they are allowed in GNU Emacs.  They mean, "ignore everything before the
  2197. second slash in the pair."  Thus, <SAMP>`/u2/emacs/src/'</SAMP> is ignored, and
  2198. you get the file <TT>`/etc/termcap'</TT>.
  2199. <A NAME="IDX214"></A>
  2200. If you set <CODE>insert-default-directory</CODE> to <CODE>nil</CODE>, the default
  2201. directory is not inserted in the minibuffer.  This way, the minibuffer
  2202. starts out empty.  But the name you type, if relative, is still
  2203. interpreted with respect to the same default directory.
  2204. <H2><A NAME="SEC49" HREF="xEMACS_TO.HTM#SEC49">Editing in the Minibuffer</A></H2>
  2205.   The minibuffer is an Emacs buffer (albeit a peculiar one), and the usual
  2206. Emacs commands are available for editing the text of an argument you are
  2207. entering.
  2208.   Since <KBD>RET</KBD> in the minibuffer is defined to exit the minibuffer,
  2209. you must use <KBD>C-o</KBD> or <KBD>C-q <KBD>LFD</KBD></KBD> to insert a newline into
  2210. the minibuffer. (Recall that a newline is really the <KBD>LFD</KBD>
  2211. character.)
  2212.   The minibuffer has its own window, which always has space on the screen
  2213. but acts as if it were not there when the minibuffer is not in use.  The
  2214. minibuffer window is just like the others; you can switch to another 
  2215. window with <KBD>C-x o</KBD>, edit text in other windows, and perhaps even
  2216. visit more files before returning to the minibuffer to submit the
  2217. argument.  You can kill text in another window, return to the minibuffer
  2218. window, and then yank the text to use it in the argument.  See section <A HREF="xEMACS.HTM#SEC153">Multiple Windows</A>.
  2219.   There are, however, some restrictions on the use of the minibuffer window.
  2220. You cannot switch buffers in it--the minibuffer and its window are
  2221. permanently attached.  You also cannot split or kill the minibuffer
  2222. window, but you can make it taller with <KBD>C-x ^</KBD>.
  2223. <A NAME="IDX215"></A>
  2224.   If you are in the minibuffer and issue a command that displays help
  2225. text in another window, that window will be scrolled if you type
  2226. <KBD>M-C-v</KBD> while in the minibuffer until you exit the minibuffer.  This
  2227. feature is helpful if a completing minibuffer gives you a long list of
  2228. possible completions.
  2229. If the variable <CODE>minibuffer-confirm-incomplete</CODE> is <CODE>t</CODE>, you
  2230. are asked for confirmation if there is no known completion for the text
  2231. you typed. For example, if you attempted to visit a non-existent file,
  2232. the minibuffer might read:
  2233. <PRE>
  2234.         Find File:chocolate_bar.c [no completions, confirm]
  2235. </PRE>
  2236. If you press <KBD>Return</KBD> again, that confirms the filename. Otherwise,
  2237. you can continue editing it. 
  2238.  Emacs supports recursive use of the minibuffer.  However, it is
  2239. easy to do this by accident (because of autorepeating keyboards, for
  2240. example) and get confused.  Therefore, most Emacs commands that use the
  2241. minibuffer refuse to operate if the minibuffer window is selected.  If the
  2242. minibuffer is active but you have switched to a different window, recursive
  2243. use of the minibuffer is allowed--if you know enough to try to do this,
  2244. you probably will not get confused.
  2245. <A NAME="IDX216"></A>
  2246.   If you set the variable <CODE>enable-recursive-minibuffers</CODE> to be
  2247. non-<CODE>nil</CODE>, recursive use of the minibuffer is always allowed.
  2248. <A NAME="IDX217"></A>
  2249. <H2><A NAME="SEC50" HREF="xEMACS_TO.HTM#SEC50">Completion</A></H2>
  2250.   When appropriate, the minibuffer provides a <DFN>completion</DFN> facility.
  2251. You type the beginning of an argument and one of the completion keys,
  2252. and Emacs visibly fills in the rest, depending on what you have already
  2253. typed.
  2254.   When completion is available, certain keys---<KBD>TAB</KBD>, <KBD>RET</KBD>, and
  2255. <KBD>SPC</KBD>---are redefined to complete an abbreviation present in the
  2256. minibuffer into a longer string that it stands for, by matching it
  2257. against a set of <DFN>completion alternatives</DFN> provided by the command
  2258. reading the argument.  <KBD>?</KBD> is defined to display a list of possible
  2259. completions of what you have inserted.
  2260.   For example, when the minibuffer is being used by <KBD>Meta-x</KBD> to read
  2261. the name of a command, it is given a list of all available Emacs command
  2262. names to complete against.  The completion keys match the text in the
  2263. minibuffer against all the command names, find any additional characters of
  2264. the name that are implied by the ones already present in the minibuffer,
  2265. and add those characters to the ones you have given.
  2266.   Case is normally significant in completion because it is significant in
  2267. most of the names that you can complete (buffer names, file names, and
  2268. command names).  Thus, <SAMP>`fo'</SAMP> will not complete to <SAMP>`Foo'</SAMP>.  When you
  2269. are completing a name in which case does not matter, case may be ignored
  2270. for completion's sake if specified by program.
  2271. When a completion list is displayed, the completions will highlight as
  2272. you move the mouse over them.  Clicking the middle mouse button on any 
  2273. highlighted completion will "select" it just as if you had typed it in
  2274. and hit <KBD>RET</KBD>.
  2275. <H3><A NAME="SEC51" HREF="xEMACS_TO.HTM#SEC51">A Completion Example</A></H3>
  2276. <A NAME="IDX218"></A>
  2277. <A NAME="IDX219"></A>
  2278.   Consider the following example.  If you type <KBD>Meta-x au <KBD>TAB</KBD></KBD>,
  2279. <KBD>TAB</KBD> looks for alternatives (in this case, command names) that
  2280. start with <SAMP>`au'</SAMP>.  There are only two commands: <CODE>auto-fill-mode</CODE> and
  2281. <CODE>auto-save-mode</CODE>.  They are the same as far as <CODE>auto-</CODE>, so the
  2282. <SAMP>`au'</SAMP> in the minibuffer changes to <SAMP>`auto-'</SAMP>.<P>
  2283.   If you type <KBD>TAB</KBD> again immediately, there are multiple possibilities
  2284. for the very next character--it could be <SAMP>`s'</SAMP> or <SAMP>`f'</SAMP>---so no more
  2285. characters are added; but a list of all possible completions is displayed
  2286. in another window.
  2287.   If you go on to type <KBD>f <KBD>TAB</KBD></KBD>, this <KBD>TAB</KBD> sees
  2288. <SAMP>`auto-f'</SAMP>.  The only command name starting this way is
  2289. <CODE>auto-fill-mode</CODE>, so completion inserts the rest of that command.  You
  2290. now have <SAMP>`auto-fill-mode'</SAMP> in the minibuffer after typing just <KBD>au
  2291. <KBD>TAB</KBD> f <KBD>TAB</KBD></KBD>.  Note that <KBD>TAB</KBD> has this effect because in the
  2292. minibuffer it is bound to the function <CODE>minibuffer-complete</CODE> when
  2293. completion is supposed to be done.<P>
  2294. <H3><A NAME="SEC52" HREF="xEMACS_TO.HTM#SEC52">Completion Commands</A></H3>
  2295.   Here is a list of all the completion commands defined in the minibuffer
  2296. when completion is available.
  2297. <DL COMPACT>
  2298. <DT><KBD><KBD>TAB</KBD></KBD>
  2299. <DD>Complete the text in the minibuffer as much as possible <BR>
  2300. (<CODE>minibuffer-complete</CODE>).
  2301. <DT><KBD><KBD>SPC</KBD></KBD>
  2302. <DD>Complete the text in the minibuffer but don't add or fill out more
  2303. than one word (<CODE>minibuffer-complete-word</CODE>).
  2304. <DT><KBD><KBD>RET</KBD></KBD>
  2305. <DD>Submit the text in the minibuffer as the argument, possibly completing
  2306. first as described below (<CODE>minibuffer-complete-and-exit</CODE>).
  2307. <DT><KBD>?</KBD>
  2308. <DD>Print a list of all possible completions of the text in the minibuffer
  2309. (<CODE>minibuffer-list-completions</CODE>).
  2310. <DT><KBD><KBD>button2</KBD></KBD>
  2311. <DD>Select the highlighted text under the mouse as a minibuffer response.
  2312. When the minibuffer is being used to prompt the user for a completion,
  2313. any valid completions which are visible on the screen will be highlighted
  2314. when the mouse moves over them.  Clicking <KBD>button2</KBD> will select the
  2315. highlighted completion and exit the minibuffer.  
  2316. (<CODE>minibuf-select-highlighted-completion</CODE>).
  2317. </DL>
  2318. <A NAME="IDX220"></A>
  2319. <A NAME="IDX221"></A>
  2320. <KBD>SPC</KBD> completes in a way that is similar to <KBD>TAB</KBD>, but it never
  2321. goes beyond the next hyphen or space.  If you have <SAMP>`auto-f'</SAMP> in the 
  2322. minibuffer and type <KBD>SPC</KBD>, it finds that the completion is
  2323.  <SAMP>`auto-fill-mode'</SAMP>, but it stops completing after <SAMP>`fill-'</SAMP>. 
  2324. The result is <SAMP>`auto-fill-'</SAMP>. Another <KBD>SPC</KBD> at this point
  2325. completes all the way to <SAMP>`auto-fill-mode'</SAMP>.  <KBD>SPC</KBD> in the
  2326. minibuffer runs the function <CODE>minibuffer-complete-word</CODE> when 
  2327. completion is available.<P>
  2328.   There are three different ways that <KBD>RET</KBD> can work in completing
  2329. minibuffers, depending on how the argument will be used.
  2330. <DFN>Strict</DFN> completion is used when it is meaningless to give any
  2331. argument except one of the known alternatives.  For example, when
  2332. <KBD>C-x k</KBD> reads the name of a buffer to kill, it is meaningless to
  2333. give anything but the name of an existing buffer.  In strict
  2334. completion, <KBD>RET</KBD> refuses to exit if the text in the minibuffer
  2335. does not complete to an exact match.
  2336. <DFN>Cautious</DFN> completion is similar to strict completion, except that
  2337. <KBD>RET</KBD> exits only if the text was an exact match already, not
  2338. needing completion.  If the text is not an exact match, <KBD>RET</KBD> does
  2339. not exit, but it does complete the text.  If it completes to an exact
  2340. match, a second <KBD>RET</KBD> will exit.
  2341. Cautious completion is used for reading file names for files that must
  2342. already exist.
  2343. <DFN>Permissive</DFN> completion is used when any string is
  2344. meaningful, and the list of completion alternatives is just a guide.
  2345. For example, when <KBD>C-x C-f</KBD> reads the name of a file to visit, any
  2346. file name is allowed, in case you want to create a file.  In
  2347. permissive completion, <KBD>RET</KBD> takes the text in the minibuffer
  2348. exactly as given, without completing it.
  2349. </UL>
  2350.   The completion commands display a list of all possible completions in a
  2351. window whenever there is more than one possibility for the very next
  2352. character.  Typing <KBD>?</KBD> explicitly requests such a list.  The
  2353. list of completions counts as help text, so <KBD>C-M-v</KBD> typed in the
  2354. minibuffer scrolls the list.
  2355. <A NAME="IDX222"></A>
  2356.   When completion is done on file names, certain file names are usually
  2357. ignored.  The variable <CODE>completion-ignored-extensions</CODE> contains a list
  2358. of strings; a file whose name ends in any of those strings is ignored as a
  2359. possible completion.  The standard value of this variable has several
  2360. elements including <CODE>".o"</CODE>, <CODE>".elc"</CODE>, <CODE>".dvi"</CODE> and <CODE>"~"</CODE>.
  2361. The effect is that, for example, <SAMP>`foo'</SAMP> completes to <SAMP>`foo.c'</SAMP>
  2362. even though <SAMP>`foo.o'</SAMP> exists as well.  If the only possible completions
  2363. are files that end in "ignored" strings, they are not ignored.<A NAME="IDX223"></A>
  2364.   If a completion command finds the next character is undetermined, it
  2365. automatically displays a list of all possible completions.  If the variable
  2366. <CODE>completion-auto-help</CODE> is set to <CODE>nil</CODE>, this does not happen,
  2367. and you must type <KBD>?</KBD> to display the possible completions.
  2368. <A NAME="IDX224"></A>
  2369. If the variable <CODE>minibuffer-confirm-incomplete</CODE> is set to <CODE>t</CODE>,
  2370. then in contexts where <CODE>completing-read</CODE> allows answers that are
  2371. not valid completions, an extra <KBD>RET</KBD> must be typed to confirm the
  2372. response.  This is helpful for catching typos.
  2373. <A NAME="IDX225"></A>
  2374. <A NAME="IDX226"></A>
  2375. <H2><A NAME="SEC53" HREF="xEMACS_TO.HTM#SEC53">Repeating Minibuffer Commands</A></H2>
  2376.   Every command that uses the minibuffer at least once is recorded on a
  2377. special history list, together with the values of the minibuffer arguments,
  2378. so that you can repeat the command easily.  In particular, every
  2379. use of <KBD>Meta-x</KBD> is recorded, since <KBD>M-x</KBD> uses the minibuffer to
  2380. read the command name.
  2381. <A NAME="IDX227"></A>
  2382. <DL COMPACT>
  2383. <DT><KBD>C-x <KBD>ESC</KBD></KBD>
  2384. <DD>Re-execute a recent minibuffer command <BR>(<CODE>repeat-complex-command</CODE>).
  2385. <DT><KBD>M-p</KBD>
  2386. <DD>Within <KBD>C-x <KBD>ESC</KBD></KBD>, move to previous recorded command
  2387. (<CODE>previous-history-element</CODE>).
  2388. <DT><KBD>M-n</KBD>
  2389. <DD>Within <KBD>C-x <KBD>ESC</KBD></KBD>, move to the next (more recent) recorded
  2390. command (<CODE>next-history-element</CODE>).<DT><KBD>M-x list-command-history</KBD>
  2391. <DD>Display the entire command history, showing all the commands
  2392. <KBD>C-x <KBD>ESC</KBD></KBD> can repeat, most recent first.</DL>
  2393. <A NAME="IDX228"></A>
  2394. <A NAME="IDX229"></A>
  2395.   <KBD>C-x <KBD>ESC</KBD></KBD> is used to re-execute a recent command that used
  2396. the minibuffer. With no argument, it repeats the last command.  A numeric
  2397. argument specifies which command to repeat; 1 means the last one, and
  2398. larger numbers specify earlier commands.
  2399.   <KBD>C-x <KBD>ESC</KBD></KBD> works by turning the previous command into a Lisp
  2400. expression and then entering a minibuffer initialized with the text for
  2401. that expression.  If you type just <KBD>RET</KBD>, the command is repeated as
  2402. before.  You can also change the command by editing the Lisp expression.
  2403. The expression you finally submit will be executed.  The repeated
  2404. command is added to the front of the command history unless it is
  2405. identical to the most recently executed command already there.
  2406.   Even if you don't understand Lisp syntax, it will probably be obvious
  2407. which command is displayed for repetition.  If you do not change the text,
  2408. you can be sure the command will repeat exactly as before.
  2409. <A NAME="IDX230"></A>
  2410. <A NAME="IDX231"></A>
  2411. <A NAME="IDX232"></A>
  2412. <A NAME="IDX233"></A>
  2413.   If you are in the minibuffer for <KBD>C-x <KBD>ESC</KBD></KBD> and the command shown
  2414. to you is not the one you want to repeat, you can move around the list of
  2415. previous commands using <KBD>M-n</KBD> and <KBD>M-p</KBD>.  <KBD>M-p</KBD> replaces the
  2416. contents of the minibuffer with the next earlier recorded command, and
  2417. <KBD>M-n</KBD> replaces it with the next later command.  After finding the
  2418. desired previous command, you can edit its expression and then
  2419. resubmit it by typing <KBD>RET</KBD>.  Any editing you have done on the
  2420. command to be repeated is lost if you use <KBD>M-n</KBD> or <KBD>M-p</KBD>.
  2421. <KBD>M-n</KBD> and <KBD>M-p</KBD> are specially defined within <KBD>C-x <KBD>ESC</KBD></KBD>
  2422. to run the commands <CODE>previous-history-element</CODE> and
  2423. <CODE>next-history-element</CODE>.
  2424. <A NAME="IDX234"></A>
  2425.   The list of previous commands using the minibuffer is stored as a Lisp
  2426. list in the variable <CODE>command-history</CODE>.  Each element of the list
  2427. is a Lisp expression which describes one command and its arguments.
  2428. Lisp programs can reexecute a command by feeding the corresponding
  2429. <CODE>command-history</CODE> element to <CODE>eval</CODE>.
  2430. <H1><A NAME="SEC54" HREF="xEMACS_TO.HTM#SEC54">Running Commands by Name</A></H1>
  2431.   The Emacs commands that are used often or that must be quick to type are
  2432. bound to keys--short sequences of characters--for convenient use.  Other
  2433. Emacs commands that are used more rarely are not bound to keys; to run
  2434. them, you must refer to them by name.
  2435.   A command name consists, by convention, of one or more words,
  2436. separated by hyphens: for example, <CODE>auto-fill-mode</CODE> or
  2437. <CODE>manual-entry</CODE>.  The use of English words makes the command name
  2438. easier to remember than a key made up of obscure characters, even though
  2439. it results in more characters to type.  You can run any command by name,
  2440. even if it can be run by keys as well. 
  2441. <A NAME="IDX235"></A>
  2442. <A NAME="IDX236"></A>
  2443.  To run a command by name, start with <KBD>M-x</KBD>, then type the
  2444. command name, and finish with <KBD>RET</KBD>.  <KBD>M-x</KBD> uses the minibuffer
  2445. to read the command name.  <KBD>RET</KBD> exits the minibuffer and runs the
  2446. command.
  2447.   Emacs uses the minibuffer for reading input for many different purposes;
  2448. on this occasion, the string <SAMP>`M-x'</SAMP> is displayed at the beginning of
  2449. the minibuffer as a <DFN>prompt</DFN> to remind you that your input should be
  2450. the name of a command to be run.  See section <A HREF="xEMACS.HTM#SEC47">The Minibuffer</A>, for full information
  2451. on the features of the minibuffer.
  2452.   You can use completion to enter a command name.  For example, to
  2453. invoke the command <CODE>forward-char</CODE>, type:
  2454. <PRE>
  2455. M-x forward-char <KBD>RET</KBD>
  2456. </PRE>
  2457. <PRE>
  2458. M-x fo <KBD>TAB</KBD> c <KBD>RET</KBD>
  2459. </PRE>
  2460. After you type in <CODE>M-x fo TAB</CODE> emacs will give you a possible list of 
  2461. completions from which you can choose. Note that <CODE>forward-char</CODE> is the 
  2462. same command that you invoke with the key <KBD>C-f</KBD>.  You can call any 
  2463. command (interactively callable function) defined in Emacs by its name 
  2464. using <KBD>M-x</KBD> regardless of whether or not any keys are bound to it.
  2465.   If you type <KBD>C-g</KBD> while Emacs reads the command name, you cancel
  2466. the <KBD>M-x</KBD> command and get out of the minibuffer, ending up at top level.
  2467.   To pass a numeric argument to a command you are invoking with
  2468. <KBD>M-x</KBD>, specify the numeric argument before the <KBD>M-x</KBD>.  <KBD>M-x</KBD>
  2469. passes the argument along to the function that it calls.  The argument
  2470. value appears in the prompt while the command name is being read.
  2471. <A NAME="IDX237"></A>
  2472. You can use the command <CODE>M-x interactive</CODE> to specify a way of
  2473. parsing arguments for interactive use of a function.  For example, write:
  2474. <PRE>
  2475.   (defun foo (arg) "Doc string" (interactive "p") ...use arg...)
  2476. </PRE>
  2477. to make <CODE>arg</CODE> be the prefix argument when <CODE>foo</CODE> is called as a
  2478. command.  The call to <CODE>interactive</CODE> is actually a declaration
  2479. rather than a function; it tells <CODE>call-interactively</CODE> how to read
  2480. arguments to pass to the function.  When actually called, <CODE>interactive</CODE>
  2481. returns <CODE>nil</CODE>.
  2482. The argument of <VAR>interactive</VAR> is usually a string containing a code
  2483. letter followed by a prompt.  Some code letters do not use I/O to get
  2484. the argument and do not need prompts.  To prompt for multiple arguments,
  2485. you must provide a code letter, its prompt, a newline, and another code
  2486. letter, and so forth.  If the argument is not a string, it is evaluated 
  2487. to get a list of arguments to pass to the function.  If you do not provide an
  2488. argument to <CODE>interactive</CODE>, no arguments are passed when calling
  2489. interactively.
  2490. Available code letters are:
  2491. <DL COMPACT>
  2492. <DT><CODE>a</CODE>
  2493. <DD>Function name: symbol with a function definition
  2494. <DT><CODE>b</CODE>
  2495. <DD>Name of existing buffer
  2496. <DT><CODE>B</CODE>
  2497. <DD>Name of buffer, possibly nonexistent
  2498. <DT><CODE>c</CODE>
  2499. <DD>Character
  2500. <DT><CODE>C</CODE>
  2501. <DD>Command name: symbol with interactive function definition
  2502. <DT><CODE>d</CODE>
  2503. <DD>Value of point as number (does not do I/O)
  2504. <DT><CODE>D</CODE>
  2505. <DD>Directory name
  2506. <DT><CODE>e</CODE>
  2507. <DD>Last mouse event
  2508. <DT><CODE>f</CODE>
  2509. <DD>Existing file name
  2510. <DT><CODE>F</CODE>
  2511. <DD>Possibly nonexistent file name
  2512. <DT><CODE>k</CODE>
  2513. <DD>Key sequence (string)
  2514. <DT><CODE>m</CODE>
  2515. <DD>Value of mark as number (does not do I/O)
  2516. <DT><CODE>n</CODE>
  2517. <DD>Number read using minibuffer
  2518. <DT><CODE>N</CODE>
  2519. <DD>Prefix arg converted to number, or if none, do like code <CODE>n</CODE>
  2520. <DT><CODE>p</CODE>
  2521. <DD>Prefix arg converted to number (does not do I/O)
  2522. <DT><CODE>P</CODE>
  2523. <DD>Prefix arg in raw form (does not do I/O)
  2524. <DT><CODE>r</CODE>
  2525. <DD>Region: point and mark as two numeric arguments, smallest first (does
  2526. not do I/O)
  2527. <DT><CODE>s</CODE>
  2528. <DD>Any string
  2529. <DT><CODE>S</CODE>
  2530. <DD>Any symbol
  2531. <DT><CODE>v</CODE>
  2532. <DD>Variable name: symbol that is <CODE>user-variable-p</CODE>
  2533. <DT><CODE>x</CODE>
  2534. <DD>Lisp expression read but not evaluated
  2535. <DT><CODE>X</CODE>
  2536. <DD>Lisp expression read and evaluated
  2537. </DL>
  2538. In addition, if the string begins with <SAMP>`*'</SAMP>, an error is
  2539. signaled if the buffer is read-only.  This happens before reading any
  2540. arguments.  If the string begins with <SAMP>`@'</SAMP>, the window the mouse is
  2541. over is selected before anything else is done.  You may use both
  2542. <SAMP>`@'</SAMP> and <SAMP>`*'</SAMP>; they are processed in the order that they appear.
  2543. Normally, when describing a command that is run by name, we omit the
  2544. <KBD>RET</KBD> that is needed to terminate the name.  Thus we may refer to
  2545. <KBD>M-x auto-fill-mode</KBD> rather than <KBD>M-x auto-fill-mode</KBD> <KBD>RET</KBD>.
  2546. We mention the <KBD>RET</KBD> only when it it necessary to emphasize its
  2547. presence, for example, when describing a sequence of input that contains
  2548. a command name and arguments that follow it.
  2549. <A NAME="IDX238"></A>
  2550.   <KBD>M-x</KBD> is defined to run the command <CODE>execute-extended-command</CODE>,
  2551. which is responsible for reading the name of another command and invoking
  2552. <A NAME="IDX239"></A>
  2553. <A NAME="IDX240"></A>
  2554. <H1><A NAME="SEC55" HREF="xEMACS_TO.HTM#SEC55">Help</A></H1>
  2555.   Emacs provides extensive help features which revolve around a single
  2556. character, <KBD>C-h</KBD>.  <KBD>C-h</KBD> is a prefix key that is used only for
  2557. documentation-printing commands.  The characters you can type after
  2558. <KBD>C-h</KBD> are called <DFN>help options</DFN>.  One help option is <KBD>C-h</KBD>;
  2559. you use it to ask for help about using <KBD>C-h</KBD>.
  2560.   <KBD>C-h C-h</KBD> prints a list of the possible help options, and then asks
  2561. you to type the desired option.  It prompts with the string:
  2562. <PRE>
  2563. A, B, C, F, I, K, L, M, N, S, T, V, W, C-c, C-d, C-n, C-w or C-h for more help:
  2564. </PRE>
  2565. You should type one of those characters.
  2566.   Typing a third <KBD>C-h</KBD> displays a description of what the options mean;
  2567. Emacs still waits for you to type an option.  To cancel, type <KBD>C-g</KBD>.
  2568.   Here is a summary of the defined help commands.
  2569. <DL COMPACT>
  2570. <DT><KBD>C-h a <VAR>string</VAR> <KBD>RET</KBD></KBD>
  2571. <DD>Display a list of commands whose names contain <VAR>string</VAR>
  2572. (<CODE>command-<BR>apropos</CODE>).<DT><KBD>C-h b</KBD>
  2573. <DD>Display a table of all key bindings currently in effect, with local bindings of
  2574. the current major mode first, followed by all global bindings
  2575. (<CODE>describe-bindings</CODE>).
  2576. <DT><KBD>C-h c <VAR>key</VAR></KBD>
  2577. <DD>Print the name of the command that <VAR>key</VAR> runs (<CODE>describe-key-<BR>briefly</CODE>).
  2578. <KBD>c</KBD> is for `character'.  For more extensive information on <VAR>key</VAR>,
  2579. use <KBD>C-h k</KBD>.
  2580. <DT><KBD>C-h f <VAR>function</VAR> <KBD>RET</KBD></KBD>
  2581. <DD>Display documentation on the Lisp function named <VAR>function</VAR>
  2582. (<CODE>describe-function</CODE>).  Note that commands are Lisp functions, so
  2583. a command name may be used.
  2584. <DT><KBD>C-h i</KBD>
  2585. <DD>Run Info, the program for browsing documentation files (<CODE>info</CODE>).
  2586. The complete Emacs manual is available online in Info.
  2587. <DT><KBD>C-h k <VAR>key</VAR></KBD>
  2588. <DD>Display name and documentation of the command <VAR>key</VAR> runs (<CODE>describe-key</CODE>).
  2589. <DT><KBD>C-h l</KBD>
  2590. <DD>Display a description of the last 100 characters you typed
  2591. (<CODE>view-lossage</CODE>).
  2592. <DT><KBD>C-h m</KBD>
  2593. <DD>Display documentation of the current major mode (<CODE>describe-mode</CODE>).
  2594. <DT><KBD>C-h n</KBD>
  2595. <DD>Display documentation of Emacs changes, most recent first
  2596. (<CODE>view-emacs-news</CODE>).
  2597. <DT><KBD>C-h p</KBD>
  2598. <DD>Display a table of all mouse bindings currently in effect now, with
  2599. local bindings of the current major mode first, followed by all global bindings
  2600. (<CODE>describe-pointer</CODE>).
  2601. <DT><KBD>C-h s</KBD>
  2602. <DD>Display current contents of the syntax table, plus an explanation of
  2603. what they mean (<CODE>describe-syntax</CODE>).
  2604. <DT><KBD>C-h t</KBD>
  2605. <DD>Display the Emacs tutorial (<CODE>help-with-tutorial</CODE>).
  2606. <DT><KBD>C-h v <VAR>var</VAR> <KBD>RET</KBD></KBD>
  2607. <DD>Display the documentation of the Lisp variable <VAR>var</VAR>
  2608. (<CODE>describe-<BR>variable</CODE>).
  2609. <DT><KBD>C-h w <VAR>command</VAR> <KBD>RET</KBD></KBD>
  2610. <DD>Print which keys run the command named <VAR>command</VAR> (<CODE>where-is</CODE>).
  2611. <DT><KBD>M-x apropos <VAR>regexp</VAR></KBD>
  2612. <DD>Show all symbols whose names contain matches for <VAR>regexp</VAR>.
  2613. </DL>
  2614. <H2><A NAME="SEC56" HREF="xEMACS_TO.HTM#SEC56">Documentation for a Key</A></H2>
  2615. <A NAME="IDX241"></A>
  2616. <A NAME="IDX242"></A>
  2617.   The most basic <KBD>C-h</KBD> options are <KBD>C-h c</KBD>
  2618. (<CODE>describe-key-briefly</CODE>) and <KBD>C-h k</KBD><BR>(<CODE>describe-key</CODE>).
  2619. <KBD>C-h c <VAR>key</VAR></KBD> prints the name of the command that <VAR>key</VAR> is
  2620. bound to in the echo area.  For example, <KBD>C-h c C-f</KBD> prints
  2621. <SAMP>`forward-char'</SAMP>.  Since command names are chosen to describe what
  2622. the command does, using this option is a good way to get a somewhat cryptic
  2623. description of what <VAR>key</VAR> does.<A NAME="IDX243"></A>
  2624. <A NAME="IDX244"></A>
  2625.   <KBD>C-h k <VAR>key</VAR></KBD> is similar to <KBD>C-h c</KBD> but gives more
  2626. information.  It displays the documentation string of the function
  2627. <VAR>key</VAR> is bound to as well as its name.  <VAR>key</VAR> is a string or
  2628. vector of events.  When called interactively, <VAR>key</VAR> may also be a menu
  2629. selection.  This information does not usually fit into the echo area, so a
  2630. window is used for the display.
  2631. <H2><A NAME="SEC57" HREF="xEMACS_TO.HTM#SEC57">Help by Command or Variable Name</A></H2>
  2632. <A NAME="IDX245"></A>
  2633. <A NAME="IDX246"></A>
  2634. <A NAME="IDX247"></A>
  2635.   <KBD>C-h f</KBD> (<CODE>describe-function</CODE>) reads the name of a Lisp
  2636. function using the minibuffer, then displays that function's
  2637. documentation string in a window.  Since commands are Lisp functions,
  2638. you can use the argument <VAR>function</VAR> to get the documentation of a
  2639. command that you know by name.  For example,
  2640. <PRE>
  2641. C-h f auto-fill-mode <KBD>RET</KBD>
  2642. </PRE>
  2643. displays the documentation for <CODE>auto-fill-mode</CODE>. Using <KBD>C-h f</KBD>
  2644. is the only way to see the documentation of a command that is not bound
  2645. to any key, that is, a command you would normally call using <KBD>M-x</KBD>.
  2646. If the variable <CODE>describe-function-show-arglist</CODE> is <CODE>t</CODE>,
  2647. <CODE>describe-function</CODE> shows its arglist if the <VAR>function</VAR> is not
  2648. an autoload function.
  2649.   <KBD>C-h f</KBD> is also useful for Lisp functions you are planning to
  2650. use in a Lisp program.  For example, if you have just written the code
  2651. <CODE>(make-vector len)</CODE> and want to make sure you are using
  2652. <CODE>make-vector</CODE> properly, type <KBD>C-h f make-vector <KBD>RET</KBD></KBD>.  Because
  2653. <KBD>C-h f</KBD> allows all function names, not just command names, you may find
  2654. that some of your favorite abbreviations that work in <KBD>M-x</KBD> don't work
  2655. in <KBD>C-h f</KBD>.  An abbreviation may be unique among command names, yet fail
  2656. to be unique when other function names are allowed.
  2657. If you type <KBD>RET</KBD>, leaving the minibuffer empty, <KBD>C-h f</KBD> by
  2658. default describes the function called by the innermost Lisp expression
  2659. in the buffer around point, <I>provided</I> that that is a valid, defined Lisp
  2660. function name.  For example, if point is located following the text
  2661. <SAMP>`(make-vector (car x)'</SAMP>, the innermost list containing point is the
  2662. one starting with <SAMP>`(make-vector'</SAMP>, so the default is to describe
  2663. the function <CODE>make-vector</CODE>.
  2664.   <KBD>C-h f</KBD> is often useful just to verify that you have the right
  2665. spelling for the function name.  If <KBD>C-h f</KBD> mentions a default in the
  2666. prompt, you have typed the name of a defined Lisp function.  If that is
  2667. what you wanted to know, just type <KBD>C-g</KBD> to cancel the <KBD>C-h f</KBD>
  2668. command and continue editing.
  2669. <A NAME="IDX248"></A>
  2670. <A NAME="IDX249"></A>
  2671.   <KBD>C-h w <VAR>command</VAR> <KBD>RET</KBD></KBD> (<CODE>where-s</CODE>) tells you what 
  2672. keys are bound to <VAR>command</VAR>.  It prints a list of the keys in the
  2673. echo area. Alternatively, it informs you that a command is not bound to 
  2674. any keys, which implies that you must use <KBD>M-x</KBD> to call the 
  2675. command.<A NAME="IDX250"></A>
  2676. <A NAME="IDX251"></A>
  2677.   <KBD>C-h v</KBD> (<CODE>describe-variable</CODE>) is like <KBD>C-h f</KBD> but
  2678. describes Lisp variables instead of Lisp functions.  Its default is the
  2679. Lisp symbol around or before point, if that is the name of a known Lisp
  2680. variable.  See section <A HREF="xEMACS.HTM#SEC275">Variables</A>.<P>
  2681. <H2><A NAME="SEC58" HREF="xEMACS_TO.HTM#SEC58">Apropos</A></H2>
  2682. <A NAME="IDX252"></A>
  2683. <A NAME="IDX253"></A>
  2684. <A NAME="IDX254"></A>
  2685. <DL COMPACT>
  2686. <DT><KBD>C-h a</KBD>
  2687. <DD>Show only symbols that are names of commands
  2688. (<CODE>command-apropos</CODE>).
  2689. <DT><KBD>M-x apropos <VAR>regexp</VAR></KBD>
  2690. <DD>Show all symbols whose names comtain matches for <VAR>regexp</VAR>.
  2691. </DL>
  2692.   It is possible to ask a question like, "What are the commands for
  2693. working with files?"  To do this, type <KBD>C-h a file <KBD>RET</KBD></KBD>,
  2694. which displays a list of all command names that contain <SAMP>`file'</SAMP>,
  2695. such as <CODE>copy-file</CODE>, <CODE>find-file</CODE>, and so on.  With each
  2696. command name a brief description of its use and information on the keys
  2697. you can use to invoke it is displayed.  For example, you would be
  2698. informed that you can invoke <CODE>find-file</CODE> by typing <KBD>C-x C-f</KBD>.
  2699. The <KBD>a</KBD> in <KBD>C-h a</KBD> stands for `Apropos'; <KBD>C-h a</KBD> runs the
  2700. Lisp function <CODE>command-apropos</CODE>.<P>
  2701.   Because <KBD>C-h a</KBD> looks only for functions whose names contain the
  2702. string you specify, you must use ingenuity in choosing the string.  If
  2703. you are looking for commands for killing backwards and <KBD>C-h a
  2704. kill-backwards <KBD>RET</KBD></KBD> doesn't reveal any commands, don't give up.
  2705. Try just <KBD>kill</KBD>, or just <KBD>backwards</KBD>, or just <KBD>back</KBD>.  Be
  2706. persistent.  Pretend you are playing Adventure.  Also note that you can
  2707. use a regular expression as the argument (see section <A HREF="xEMACS.HTM#SEC99">Syntax of Regular Expressions</A>).
  2708.   Here is a set of arguments to give to <KBD>C-h a</KBD> that covers many
  2709. classes of Emacs commands, since there are strong conventions for naming
  2710. standard Emacs commands.  By giving you a feeling for the naming
  2711. conventions, this set of arguments can also help you develop a
  2712. technique for picking <CODE>apropos</CODE> strings.
  2713. <BLOCKQUOTE>
  2714. char, line, word, sentence, paragraph, region, page, sexp, list, defun,
  2715. buffer, screen, window, file, dir, register, mode,
  2716. beginning, end, forward, backward, next, previous, up, down, search, goto,
  2717. kill, delete, mark, insert, yank, fill, indent, case,
  2718. change, set, what, list, find, view, describe.
  2719. </BLOCKQUOTE>
  2720. <A NAME="IDX255"></A>
  2721.   To list all Lisp symbols that contain a match for a regexp, not just
  2722. the ones that are defined as commands, use the command <KBD>M-x apropos</KBD>
  2723. instead of <KBD>C-h a</KBD>.
  2724. <H2><A NAME="SEC59" HREF="xEMACS_TO.HTM#SEC59">Other Help Commands</A></H2>
  2725. <A NAME="IDX256"></A>
  2726. <A NAME="IDX257"></A>
  2727.   <KBD>C-h i</KBD> (<CODE>info</CODE>) runs the Info program, which is used for
  2728. browsing through structured documentation files.  The entire Emacs manual
  2729. is available within Info.  Eventually all the documentation of the GNU
  2730. system will be available.  Type <KBD>h</KBD> after entering Info to run
  2731. a tutorial on using Info.
  2732. <A NAME="IDX258"></A>
  2733. <A NAME="IDX259"></A>
  2734.   If something surprising happens, and you are not sure what commands you
  2735. typed, use <KBD>C-h l</KBD> (<CODE>view-lossage</CODE>).  <KBD>C-h l</KBD> prints the last
  2736. 100 command characters you typed.  If you see commands you don't
  2737. know, use <KBD>C-h c</KBD> to find out what they do.
  2738. <A NAME="IDX260"></A>
  2739. <A NAME="IDX261"></A>
  2740.   Emacs has several major modes. Each mode redefines a few keys and
  2741. makes a few other changes in how editing works.  <KBD>C-h m</KBD>
  2742. (<CODE>describe-mode</CODE>) prints documentation on the current major mode,
  2743. which normally describes all the commands that are changed in this mode.
  2744. <A NAME="IDX262"></A>
  2745. <A NAME="IDX263"></A>
  2746.   <KBD>C-h b</KBD> (<CODE>describe-bindings</CODE>) and <KBD>C-h s</KBD>
  2747. (<CODE>describe-syntax</CODE>) present information about the current Emacs
  2748. mode that is not covered by <KBD>C-h m</KBD>.  <KBD>C-h b</KBD> displays a list of
  2749. all key bindings currently in effect, with the local bindings of the current
  2750. major mode first, followed by the global bindings (see section <A HREF="xEMACS.HTM#SEC284">Customizing Key Bindings</A>).  <KBD>C-h s</KBD> displays the contents of the syntax table with
  2751. explanations of each character's syntax (see section <A HREF="xEMACS.HTM#SEC289">The Syntax Table</A>).<A NAME="IDX264"></A>
  2752. <A NAME="IDX265"></A>
  2753. <A NAME="IDX266"></A>
  2754. <A NAME="IDX267"></A>
  2755. <A NAME="IDX268"></A>
  2756. <A NAME="IDX269"></A>
  2757. <A NAME="IDX270"></A>
  2758. <A NAME="IDX271"></A>
  2759. <A NAME="IDX272"></A>
  2760. <A NAME="IDX273"></A>
  2761.   The other <KBD>C-h</KBD> options display various files of useful
  2762. information.  <KBD>C-h C-w</KBD> (<CODE>describe-no-warranty</CODE>) displays
  2763. details on the complete absence of warranty for GNU Emacs.  <KBD>C-h n</KBD> 
  2764. (<CODE>view-emacs-news</CODE>) displays the file <TT>`emacs/etc/NEWS'</TT>, which 
  2765. contains documentation on Emacs changes arranged chronologically.  
  2766. <KBD>C-h t</KBD> (<CODE>help-with-tutorial</CODE>) displays the learn-by-doing
  2767. Emacs tutorial. <KBD>C-h C-c</KBD> (<CODE>describe-copying</CODE>) displays the file
  2768. <TT>`emacs/etc/COPYING'</TT>, which tells you the conditions you must obey
  2769. in distributing copies of Emacs.  <KBD>C-h C-d</KBD>
  2770. (<CODE>describe-distribution</CODE>) displays another file named
  2771. <TT>`emacs/etc/DISTRIB'</TT>, which tells you how you can order a copy of
  2772. the latest version of Emacs.<P>
  2773. <A NAME="IDX274"></A>
  2774. <A NAME="IDX275"></A>
  2775. <H1><A NAME="SEC60" HREF="xEMACS_TO.HTM#SEC60">Selecting Text</A></H1>
  2776.   Many Emacs commands operate on an arbitrary contiguous
  2777. part of the current buffer. You can select text in two ways:
  2778. You use special keys to select text by defining a region between point
  2779. and the mark. 
  2780. If you are running XEmacs under X, you can also select text
  2781. with the mouse. 
  2782. </UL>
  2783. <H2><A NAME="SEC61" HREF="xEMACS_TO.HTM#SEC61">The Mark and the Region</A></H2>
  2784.  To specify the text for a command to operate on, set <DFN>the
  2785. mark</DFN> at one end of it, and move point to the other end.  The text
  2786. between point and the mark is called <DFN>the region</DFN>.  You can move
  2787. point or the mark to adjust the boundaries of the region.  It doesn't
  2788. matter which one is set first chronologically, or which one comes
  2789. earlier in the text.
  2790.   Once the mark has been set, it remains until it is set again at
  2791. another place.  The mark remains fixed with respect to the preceding
  2792. character if text is inserted or deleted in a buffer.  Each Emacs
  2793. buffer has its own mark; when you return to a buffer that had been
  2794. selected previously, it has the same mark it had before.
  2795.   Many commands that insert text, such as <KBD>C-y</KBD> (<CODE>yank</CODE>) and
  2796. <KBD>M-x insert-buffer</KBD>, position the mark at one end of the inserted
  2797. text--the opposite end from where point is positioned, so that the region
  2798. contains the text just inserted.
  2799.   Aside from delimiting the region, the mark is useful for marking
  2800. a spot that you may want to go back to.  To make this feature more useful,
  2801. Emacs remembers 16 previous locations of the mark in the <CODE>mark ring</CODE>.
  2802. <H3><A NAME="SEC62" HREF="xEMACS_TO.HTM#SEC62">Setting the Mark</A></H3>
  2803.   Here are some commands for setting the mark:
  2804. <DL COMPACT>
  2805. <DT><KBD>C-<KBD>SPC</KBD></KBD>
  2806. <DD>Set the mark where point is (<CODE>set-mark-command</CODE>).
  2807. <DT><KBD>C-@</KBD>
  2808. <DD>The same.
  2809. <DT><KBD>C-x C-x</KBD>
  2810. <DD>Interchange mark and point (<CODE>exchange-point-and-mark</CODE>).
  2811. <DT><KBD>C-<</KBD>
  2812. <DD>Pushes a mark at the beginning of the buffer.
  2813. <DT><KBD>C-></KBD>
  2814. <DD>Pushes a mark at the end of the buffer.
  2815. </DL>
  2816.   For example, to convert part of the buffer to all
  2817. upper-case, you can use the <KBD>C-x C-u</KBD> (<CODE>upcase-region</CODE>)
  2818. command, which operates on the text in the region.  First go to the
  2819. beginning of the text you want to capitalize and type <KBD>C-<KBD>SPC</KBD></KBD> to
  2820. put the mark there, then move to the end, and then type <KBD>C-x C-u</KBD> to
  2821. capitalize the selected region.  You can also set the mark at the end of the
  2822. text, move to the beginning, and then type <KBD>C-x C-u</KBD>.  Most commands
  2823. that operate on the text in the region have the word <CODE>region</CODE> in
  2824. their names.
  2825. <A NAME="IDX276"></A>
  2826. <A NAME="IDX277"></A>
  2827.   The most common way to set the mark is with the <KBD>C-<KBD>SPC</KBD></KBD>
  2828. command (<CODE>set-mark-command</CODE>).  This command sets the mark where
  2829. point is. You can then move point away, leaving the mark behind.  It is
  2830. actually incorrect to speak of the character <KBD>C-<KBD>SPC</KBD></KBD>; there is
  2831. no such character.  When you type <KBD>SPC</KBD> while holding down
  2832. <KBD>CTRL</KBD>, you get the character <KBD>C-@</KBD> on most terminals. This
  2833. character is actually bound to <CODE>set-mark-command</CODE>.  But unless you are
  2834. unlucky enough to have a terminal where typing <KBD>C-<KBD>SPC</KBD></KBD> does
  2835. not produce <KBD>C-@</KBD>, you should think of this character as
  2836. <KBD>C-<KBD>SPC</KBD></KBD>.
  2837. <A NAME="IDX278"></A>
  2838. <A NAME="IDX279"></A>
  2839.   Since terminals have only one cursor, Emacs cannot show you where the
  2840. mark is located. Most people use the mark soon after they set it, before
  2841. they forget where it is. But you can see where the mark is with the
  2842. command <KBD>C-x C-x</KBD> (<CODE>exchange-point-and-mark</CODE>) which puts the
  2843. mark where point was and point where the mark was.  The extent of the
  2844. region is unchanged, but the cursor and point are now at the previous
  2845. location of the mark. 
  2846. <A NAME="IDX280"></A>
  2847. <A NAME="IDX281"></A>
  2848. <A NAME="IDX282"></A>
  2849. <A NAME="IDX283"></A>
  2850.  Another way to set the mark is to push the mark to the beginning of a
  2851. buffer while leaving point at its original location. If you supply an
  2852. argument to <KBD>C-<</KBD> (<CODE>mark-beginning-of-buffer</CODE>), the mark is pushed
  2853. <VAR>n</VAR>/10 of the way from the true beginning of the buffer. You can
  2854. also set the mark at the end of a buffer with <KBD>C-></KBD>
  2855. (<CODE>mark-end-of-buffer</CODE>). It pushes the mark to the end of the buffer, 
  2856. leaving point alone. Supplying an argument to the command pushes the mark
  2857. <VAR>n</VAR>/10 of the way from the true end of the buffer.
  2858. If you are using XEmacs under the X window system, you can set
  2859. the variable <CODE>zmacs-regions</CODE> to <CODE>t</CODE>. This makes the current
  2860. region (defined by point and mark) highlight and makes it available as
  2861. the X clipboard selection, which means you can use the menu bar items on
  2862. it.  See section <A HREF="xEMACS.HTM#SEC81">Active Regions</A> for more information.
  2863.   <KBD>C-x C-x</KBD> is also useful when you are satisfied with the location of
  2864. point but want to move the mark; do <KBD>C-x C-x</KBD> to put point there and
  2865. then you can move it.  A second use of <KBD>C-x C-x</KBD>, if necessary, puts
  2866. the mark at the new location with point back at its original location.
  2867. <H3><A NAME="SEC63" HREF="xEMACS_TO.HTM#SEC63">Operating on the Region</A></H3>
  2868.   Once you have created an active region, you can do many things to
  2869. the text in it:
  2870. Kill it with <KBD>C-w</KBD> (see section <A HREF="xEMACS.HTM#SEC69">Deletion and Killing</A>).
  2871. Save it in a register with <KBD>C-x r s</KBD> (see section <A HREF="xEMACS.HTM#SEC84">Registers</A>).
  2872. Save it in a buffer or a file (see section <A HREF="xEMACS.HTM#SEC82">Accumulating Text</A>).
  2873. Convert case with <KBD>C-x C-l</KBD> or <KBD>C-x C-u</KBD> <BR>(see section <A HREF="xEMACS.HTM#SEC183">Case Conversion Commands</A>).
  2874. Evaluate it as Lisp code with <KBD>M-x eval-region</KBD> (see section <A HREF="xEMACS.HTM#SEC226">Evaluating Emacs-Lisp Expressions</A>).
  2875. Fill it as text with <KBD>M-g</KBD> (see section <A HREF="xEMACS.HTM#SEC179">Filling Text</A>).
  2876. Print hardcopy with <KBD>M-x print-region</KBD> (see section <A HREF="xEMACS.HTM#SEC266">Hardcopy Output</A>).
  2877. Indent it with <KBD>C-x <KBD>TAB</KBD></KBD> or <KBD>C-M-\</KBD> (see section <A HREF="xEMACS.HTM#SEC161">Indentation</A>).
  2878. </UL>
  2879. <H3><A NAME="SEC64" HREF="xEMACS_TO.HTM#SEC64">Commands to Mark Textual Objects</A></H3>
  2880.   There are commands for placing point and the mark around a textual
  2881. object such as a word, list, paragraph or page.
  2882. <DL COMPACT>
  2883. <DT><KBD>M-@</KBD>
  2884. <DD>Set mark after end of next word (<CODE>mark-word</CODE>).  This command and
  2885. the following one do not move point.
  2886. <DT><KBD>C-M-@</KBD>
  2887. <DD>Set mark after end of next Lisp expression (<CODE>mark-sexp</CODE>).
  2888. <DT><KBD>M-h</KBD>
  2889. <DD>Put region around current paragraph (<CODE>mark-paragraph</CODE>).
  2890. <DT><KBD>C-M-h</KBD>
  2891. <DD>Put region around current Lisp defun (<CODE>mark-defun</CODE>).
  2892. <DT><KBD>C-x h</KBD>
  2893. <DD>Put region around entire buffer (<CODE>mark-whole-buffer</CODE>).
  2894. <DT><KBD>C-x C-p</KBD>
  2895. <DD>Put region around current page (<CODE>mark-page</CODE>).
  2896. </DL>
  2897. <A NAME="IDX284"></A>
  2898. <A NAME="IDX285"></A>
  2899. <A NAME="IDX286"></A>
  2900. <A NAME="IDX287"></A>
  2901. <KBD>M-@</KBD> (<CODE>mark-word</CODE>) puts the mark at the end of the next word,
  2902. while <KBD>C-M-@</KBD> (<CODE>mark-sexp</CODE>) puts it at the end of the next Lisp
  2903. expression. These characters sometimes save you some typing.
  2904. <A NAME="IDX288"></A>
  2905. <A NAME="IDX289"></A>
  2906. <A NAME="IDX290"></A>
  2907. <A NAME="IDX291"></A>
  2908. <A NAME="IDX292"></A>
  2909. <A NAME="IDX293"></A>
  2910. <A NAME="IDX294"></A>
  2911. <A NAME="IDX295"></A>
  2912.    A number of commands are available that set both point and mark and
  2913. thus delimit an object in the buffer.  <KBD>M-h</KBD> (<CODE>mark-paragraph</CODE>)
  2914. moves point to the beginning of the paragraph that surrounds or follows
  2915. point, and puts the mark at the end of that paragraph
  2916. (see section <A HREF="xEMACS.HTM#SEC177">Paragraphs</A>).  You can then indent, case-convert, or kill the
  2917. whole paragraph.  In the same fashion, <KBD>C-M-h</KBD> (<CODE>mark-defun</CODE>)
  2918. puts point before and the mark after the current or following defun
  2919. (see section <A HREF="xEMACS.HTM#SEC187">Defuns</A>).  <KBD>C-x C-p</KBD> (<CODE>mark-page</CODE>) puts point before
  2920. the current page (or the next or previous, depending on the argument),
  2921. and mark at the end (see section <A HREF="xEMACS.HTM#SEC178">Pages</A>).  The mark goes after the
  2922. terminating page delimiter (to include it), while point goes after the
  2923. preceding page delimiter (to exclude it).  Finally, <KBD>C-x h</KBD>
  2924. (<CODE>mark-whole-buffer</CODE>) sets up the entire buffer as the region by
  2925. putting point at the beginning and the mark at the end.
  2926. <H3><A NAME="SEC65" HREF="xEMACS_TO.HTM#SEC65">The Mark Ring</A></H3>
  2927. <A NAME="IDX296"></A>
  2928. <A NAME="IDX297"></A>
  2929. <A NAME="IDX298"></A>
  2930.   Aside from delimiting the region, the mark is also useful for marking
  2931. a spot that you may want to go back to.  To make this feature more
  2932. useful, Emacs remembers 16 previous locations of the mark in the
  2933. <DFN>mark ring</DFN>.  Most commands that set the mark push the old mark onto
  2934. this ring.  To return to a marked location, use <KBD>C-u C-<KBD>SPC</KBD></KBD>
  2935. (or <KBD>C-u C-@</KBD>); this is the command <CODE>set-mark-command</CODE> given a
  2936. numeric argument.  The command moves point to where the mark was, and
  2937. restores the mark from the ring of former marks. Repeated use of this
  2938. command moves point to all the old marks on the ring, one by one.
  2939. The marks you have seen go to the end of the ring, so no marks are lost.
  2940.   Each buffer has its own mark ring.  All editing commands use the current
  2941. buffer's mark ring.  In particular, <KBD>C-u C-<KBD>SPC</KBD></KBD> always stays in
  2942. the same buffer.
  2943.   Many commands that can move long distances, such as <KBD>M-<</KBD>
  2944. (<CODE>beginning-of-buffer</CODE>), start by setting the mark and saving the
  2945. old mark on the mark ring.  This makes it easier for you to move back
  2946. later.  Searches set the mark, unless they do not actually move point.
  2947. When a command sets the mark, <SAMP>`Mark Set'</SAMP> is printed in the
  2948. echo area.
  2949. <A NAME="IDX299"></A>
  2950.   The variable <CODE>mark-ring-max</CODE> is the maximum number of entries to
  2951. keep in the mark ring.  If that many entries exist and another entry is
  2952. added, the last entry in the list is discarded.  Repeating <KBD>C-u
  2953. C-<KBD>SPC</KBD></KBD> circulates through the entries that are currently in the
  2954. ring.
  2955. <A NAME="IDX300"></A>
  2956.   The variable <CODE>mark-ring</CODE> holds the mark ring itself, as a list of
  2957. marker objects in the order most recent first.  This variable is local
  2958. in every buffer.
  2959. <A NAME="IDX301"></A>
  2960. <H2><A NAME="SEC66" HREF="xEMACS_TO.HTM#SEC66">Selecting Text with the Mouse</A></H2>
  2961. <A NAME="IDX302"></A>
  2962.   If you are using Lucid GNU Emacs under X, you can use the mouse cursor
  2963. to select text. There are two mouse cursor shapes:
  2964. When the mouse cursor is over text, it appears as an I-beam, the same
  2965. cursor that <CODE>xterm</CODE> uses. 
  2966. When the mouse cursor is not over text, it appears as a plus sign (+).
  2967. </UL>
  2968. <A NAME="IDX303"></A>
  2969. <A NAME="IDX304"></A>
  2970. <A NAME="IDX305"></A>
  2971. You can set the value of the variable <CODE>x-mode-pointer-shape</CODE> to
  2972. determine the shape of the mouse pointer when it is over the mode line.  If
  2973. the value is <CODE>nil</CODE>, either the variable
  2974. <CODE>x-nontext-pointer-shape</CODE> or <CODE>x-pointer-shape</CODE> is used.
  2975. <A NAME="IDX306"></A>
  2976. <A NAME="IDX307"></A>
  2977. If you want to get fancy, you can set the foreground and background
  2978. colors of the mouse pointer with the variables
  2979. <CODE>x-pointer-background-color</CODE> and <CODE>x-pointer-foreground-color</CODE>.
  2980. There are two ways to select a region of text with the mouse:
  2981.   To select a word in text, double-click with the left mouse button
  2982. while the mouse cursor is over the word.  The word is highlighted when
  2983. selected. On monochrome monitors, a stippled background indicates that a
  2984. region of text has been highlighted. On color monitors, a color
  2985. background indicates highlighted text. You can triple-click to select
  2986. whole lines. 
  2987. To select an arbitrary region of text:
  2988. Move the mouse cursor over the character at the beginning of the region of
  2989. text you want to select.
  2990. Press and hold the left mouse button. 
  2991. While holding the left mouse button down, drag the cursor to the
  2992. character at the end of the region of text you want to select.
  2993. Release the left mouse button.
  2994. </OL>
  2995. The selected region of text is highlighted.
  2996.   Once a region of text is selected, it becomes the primary X selection
  2997. (see section <A HREF="xEMACS.HTM#SEC77">Using X Selections</A>) as well as the Emacs selected region. You
  2998. can paste it into other X applications and use the options from the
  2999. <B>Edit</B> pull-down menu on it.  Since it is also the Emacs region, you
  3000. can use Emacs region commands on it.
  3001. <A NAME="IDX308"></A>
  3002. <H2><A NAME="SEC67" HREF="xEMACS_TO.HTM#SEC67">Additional Mouse Operations</A></H2>
  3003. Lucid GNU Emacs also provides the following mouse functions.
  3004. Most of these are not bound to mouse gestures by default, but they are
  3005. provided for your customization pleasure.  For example, if you
  3006. wanted <KBD>shift-left</KBD> (that is, holding down the <KBD>Shift</KBD> key
  3007. and clicking the left mouse button) to delete the character at which
  3008. you are pointing, then you could do this:
  3009. <PRE>
  3010. (global-set-key '(shift button1) 'mouse-del-char)
  3011. </PRE>
  3012. <A NAME="IDX309"></A>
  3013. <A NAME="IDX310"></A>
  3014. <A NAME="IDX311"></A>
  3015. <A NAME="IDX312"></A>
  3016. <A NAME="IDX313"></A>
  3017. <A NAME="IDX314"></A>
  3018. <A NAME="IDX315"></A>
  3019. <A NAME="IDX316"></A>
  3020. <A NAME="IDX317"></A>
  3021. <A NAME="IDX318"></A>
  3022. <A NAME="IDX319"></A>
  3023. <A NAME="IDX320"></A>
  3024. <A NAME="IDX321"></A>
  3025. <A NAME="IDX322"></A>
  3026. <DL COMPACT>
  3027. <DT><KBD>mouse-del-char</KBD>
  3028. <DD>Delete the character pointed to by the mouse.
  3029. <DT><KBD>mouse-delete-window</KBD>
  3030. <DD>Delete the Emacs window that the mouse is on.
  3031. <DT><KBD>mouse-keep-one-window</KBD>
  3032. <DD>Select the Emacs window that the mouse is on, then delete all other
  3033. windows on this screen.
  3034. <DT><KBD>mouse-kill-line</KBD>
  3035. <DD>Kill the line pointed to by the mouse.
  3036. <DT><KBD>mouse-line-length</KBD>
  3037. <DD>Print the length of the line indicated by the pointer.
  3038. <DT><KBD>mouse-scroll</KBD>
  3039. <DD>Scroll point to the mouse position.
  3040. <DT><KBD>mouse-select</KBD>
  3041. <DD>Select the Emacs window the mouse is on.
  3042. <DT><KBD>mouse-select-and-split</KBD>
  3043. <DD>Select the Emacs window mouse is on, then split it vertically in half.
  3044. <DT><KBD>mouse-set-mark</KBD>
  3045. <DD>Select the Emacs window the mouse is on and set the mark at the mouse 
  3046. position.  Display the cursor at that position for a second.
  3047. <DT><KBD>mouse-set-point</KBD>
  3048. <DD>Select the Emacs window that the mouse is on and move point to the
  3049. mouse position.
  3050. <DT><KBD>mouse-track</KBD>
  3051. <DD>Make a selection with the mouse.   This is the default binding of 
  3052. the left mouse button (<KBD>button1</KBD>).
  3053. <DT><KBD>mouse-track-adjust</KBD>
  3054. <DD>Extend the existing selection.  This is the default binding of
  3055. <KBD>Shift-button1</KBD>.
  3056. <DT><KBD>mouse-track-and-copy-to-cutbuffer</KBD>
  3057. <DD>Make a selection like <CODE>mouse-track</CODE>, but also copy it to the cut buffer.
  3058. <DT><KBD>mouse-track-delete-and-insert</KBD>
  3059. <DD>Make a selection with the mouse and insert it at point.  This is the
  3060. default binding of <KBD>control-shift-button1</KBD>.
  3061. <DT><KBD>mouse-track-insert</KBD>
  3062. <DD>Make a selection with the mouse and insert it at point.
  3063. This is the default binding of <KBD>control-button1</KBD>.
  3064. <DT><KBD>mouse-window-to-region</KBD>
  3065. <DD>Narrow a window to the region between the cursor and the mouse pointer.
  3066. </DL>
  3067. The <KBD>M-x mouse-track</KBD> command should be bound to a mouse button.  If
  3068. you click-and-drag, the selection is set to the region between the
  3069. point of the initial click and the point at which you release the
  3070. button.  These positions do not need to be ordered. 
  3071. If you click-and-release without moving the mouse, the point is moved,
  3072. and the selection is disowned (there will be no selection owner.)  The
  3073. mark will be set to the previous position of point.
  3074. If you double-click, the selection will extend by symbols instead of by
  3075. characters.  If you triple-click, the selection will extend by lines.
  3076. If you drag the mouse off the top or bottom of the window, you can
  3077. select pieces of text that are larger than the visible part of the
  3078. buffer; the buffer will scroll as necessary.
  3079. The selected text becomes the current X selection, and is also copied to
  3080. the top of the kill ring.  Point will be left at the position at
  3081. which you released the button and the mark will be left at the initial
  3082. click position.  Bind a mouse click to
  3083. <KBD>mouse-track-and-copy-to-cutbuffer</KBD> to copy selections to the cut buffer.
  3084. (See also the <CODE>mouse-track-adjust</CODE> command, on <KBD>Shift-button1</KBD>.)
  3085. The <KBD>M-x mouse-track-adjust</KBD> command should be bound to a mouse
  3086. button.  The selection will be enlarged or shrunk so that the point of
  3087. the mouse click is one of its endpoints.  This is only meaningful
  3088. after the <CODE>mouse-track</CODE> command (<KBD>button1</KBD>) has been executed.
  3089. The <KBD>M-x mouse-track-delete-and-insert</KBD> command is exactly the same
  3090. as the <CODE>mouse-track</CODE> command on <KBD>button1</KBD>, except that point is
  3091. not moved; the selected text is immediately inserted after being
  3092. selected; and the text of the selection is deleted.
  3093. The <KBD>M-x mouse-track-insert</KBD> command is exactly the same as the
  3094. <CODE>mouse-track</CODE> command on <KBD>button1</KBD>, except that point is not moved;
  3095. the selected text is immediately inserted after being selected; and the
  3096. selection is immediately disowned afterwards.
  3097. <H1><A NAME="SEC68" HREF="xEMACS_TO.HTM#SEC68">Killing and Moving Text</A></H1>
  3098.   <DFN>Killing</DFN> means erasing text and copying it into the <DFN>kill ring</DFN>,
  3099. from which it can be retrieved by <DFN>yanking</DFN> it.  Some other systems
  3100. that have recently become popular use the terms "cutting" and "pasting"
  3101. for these operations.
  3102.   The most common way of moving or copying text with Emacs is to kill it
  3103. and later yank it in one or more places.  This is safe because all the
  3104. text killed recently is stored in the kill ring, and it is versatile,
  3105. because you can use the same commands for killing syntactic units and
  3106. for moving those units.  There are other ways of copying text for
  3107. special purposes.
  3108.   Emacs has only one kill ring, so you can kill text in one buffer and yank
  3109. it in another buffer. If you are using Lucid GNU Emacs under X, you can
  3110. also use the X selection mechanism to copy text from one buffer to
  3111. another, or between applications. See section <A HREF="xEMACS.HTM#SEC77">Using X Selections</A>.
  3112. <A NAME="IDX323"></A>
  3113. <A NAME="IDX324"></A>
  3114. <H2><A NAME="SEC69" HREF="xEMACS_TO.HTM#SEC69">Deletion and Killing</A></H2>
  3115. <A NAME="IDX325"></A>
  3116. <A NAME="IDX326"></A>
  3117. <A NAME="IDX327"></A>
  3118. <A NAME="IDX328"></A>
  3119. <A NAME="IDX329"></A>
  3120.   Most commands that erase text from the buffer save it. You can get
  3121. the text back if you change your mind, or you can move or copy it to
  3122. other parts of the buffer.  Commands which erase text and save it in the
  3123. kill ring are known as <DFN>kill</DFN> commands.  Some other commands erase
  3124. text but do not save it; they are known as <DFN>delete</DFN> commands.  (This
  3125. distinction is made only for erasing text in the buffer.)
  3126. The commands' names and individual descriptions use the words
  3127. <SAMP>`kill'</SAMP> and <SAMP>`delete'</SAMP> to indicate what they do.  If you perform
  3128. a kill or delete command by mistake, use the <KBD>C-x u</KBD> (<CODE>undo</CODE>)
  3129. command to undo it (see section <A HREF="xEMACS.HTM#SEC46">Undoing Changes</A>). The delete commands include <KBD>C-d</KBD>
  3130. (<CODE>delete-char</CODE>) and <KBD>DEL</KBD> (<CODE>delete-backward-char</CODE>), which
  3131. delete only one character at a time, and those commands that delete only
  3132. spaces or newlines.  Commands that can destroy significant amounts of
  3133. nontrivial data usually kill.<P>
  3134. <H3><A NAME="SEC70" HREF="xEMACS_TO.HTM#SEC70">Deletion</A></H3>
  3135. <DL COMPACT>
  3136. <DT><KBD>C-d</KBD>
  3137. <DD>Delete next character (<CODE>delete-char</CODE>).
  3138. <DT><KBD><KBD>DEL</KBD></KBD>
  3139. <DD>Delete previous character (<CODE>delete-backward-char</CODE>).
  3140. <DT><KBD>M-\</KBD>
  3141. <DD>Delete spaces and tabs around point (<CODE>delete-horizontal-space</CODE>).
  3142. <DT><KBD>M-<KBD>SPC</KBD></KBD>
  3143. <DD>Delete spaces and tabs around point, leaving one space
  3144. (<CODE>just-one-space</CODE>).
  3145. <DT><KBD>C-x C-o</KBD>
  3146. <DD>Delete blank lines around the current line (<CODE>delete-blank-lines</CODE>).
  3147. <DT><KBD>M-^</KBD>
  3148. <DD>Join two lines by deleting the intervening newline, and any indentation
  3149. following it (<CODE>delete-indentation</CODE>).
  3150. </DL>
  3151.   The most basic delete commands are <KBD>C-d</KBD> (<CODE>delete-char</CODE>) and
  3152. <KBD>DEL</KBD> (<CODE>delete-backward-char</CODE>).  <KBD>C-d</KBD> deletes the
  3153. character after point, the one the cursor is "on top of".  Point
  3154. doesn't move.  <KBD>DEL</KBD> deletes the character before the cursor, and
  3155. moves point back.  You can delete newlines like any other characters in
  3156. the buffer; deleting a newline joins two lines.  Actually, <KBD>C-d</KBD> and
  3157. <KBD>DEL</KBD> aren't always delete commands; if you give them an argument,
  3158. they kill instead, since they can erase more than one character this
  3159. <A NAME="IDX330"></A>
  3160. <A NAME="IDX331"></A>
  3161. <A NAME="IDX332"></A>
  3162. <A NAME="IDX333"></A>
  3163. <A NAME="IDX334"></A>
  3164. <A NAME="IDX335"></A>
  3165. <A NAME="IDX336"></A>
  3166. <A NAME="IDX337"></A>
  3167.   The other delete commands delete only formatting characters: spaces,
  3168. tabs and newlines.  <KBD>M-\</KBD> (<CODE>delete-horizontal-space</CODE>) deletes
  3169. all spaces and tab characters before and after point.
  3170. <KBD>M-<KBD>SPC</KBD></KBD> (<CODE>just-one-space</CODE>) does the same but leaves a
  3171. single space after point, regardless of the number of spaces that
  3172. existed previously (even zero).
  3173.   <KBD>C-x C-o</KBD> (<CODE>delete-blank-lines</CODE>) deletes all blank lines after
  3174. the current line. If the current line is blank, it deletes all blank lines
  3175. preceding the current line as well as leaving one blank line, the current
  3176. line.  <KBD>M-^</KBD> (<CODE>delete-indentation</CODE>) joins the current line and
  3177. the previous line, or, if given an argument, joins the current line and 
  3178. the next line by deleting a newline and all surrounding spaces, possibly
  3179. leaving a single space.  See section <A HREF="xEMACS.HTM#SEC161">Indentation</A>.
  3180. <H3><A NAME="SEC71" HREF="xEMACS_TO.HTM#SEC71">Killing by Lines</A></H3>
  3181. <DL COMPACT>
  3182. <DT><KBD>C-k</KBD>
  3183. <DD>Kill rest of line or one or more lines (<CODE>kill-line</CODE>).
  3184. </DL>
  3185. <A NAME="IDX338"></A>
  3186. <A NAME="IDX339"></A>
  3187.   The simplest kill command is <KBD>C-k</KBD>.  If given at the beginning of
  3188. a line, it kills all the text on the line, leaving the line blank.  If
  3189. given on a blank line, the blank line disappears.  As a consequence, a
  3190. line disappears completely if you go to the front of a non-blank line
  3191. and type <KBD>C-k</KBD> twice.
  3192.   More generally, <KBD>C-k</KBD> kills from point up to the end of the line,
  3193. unless it is at the end of a line.  In that case, it kills the newline
  3194. following the line, thus merging the next line into the current one.
  3195. Emacs ignores invisible spaces and tabs at the end of the line when deciding
  3196. which case applies: if point appears to be at the end of the line, you
  3197. can be sure the newline will be killed.
  3198.   If you give <KBD>C-k</KBD> a positive argument, it kills that many lines
  3199. and the newlines that follow them (however, text on the current line
  3200. before point is not killed).  With a negative argument, <KBD>C-k</KBD> kills
  3201. back to a number of line beginnings.  An argument of -2 means
  3202. kill back to the second line beginning.  If point is at the beginning of
  3203. a line, that line beginning doesn't count, so <KBD>C-u - 2 C-k</KBD> with
  3204. point at the front of a line kills the two previous lines.
  3205.   <KBD>C-k</KBD> with an argument of zero kills all the text before point on the
  3206. current line.
  3207. <A NAME="IDX340"></A>
  3208. <A NAME="IDX341"></A>
  3209. <A NAME="IDX342"></A>
  3210. <A NAME="IDX343"></A>
  3211. <A NAME="IDX344"></A>
  3212. <A NAME="IDX345"></A>
  3213. <A NAME="IDX346"></A>
  3214. <A NAME="IDX347"></A>
  3215. <A NAME="IDX348"></A>
  3216. <A NAME="IDX349"></A>
  3217. <A NAME="IDX350"></A>
  3218. <A NAME="IDX351"></A>
  3219. <H3><A NAME="SEC72" HREF="xEMACS_TO.HTM#SEC72">Other Kill Commands</A></H3>
  3220. <DL COMPACT>
  3221. <DT><KBD>C-w</KBD>
  3222. <DD>Kill region (from point to the mark) (<CODE>kill-region</CODE>).
  3223. See section <A HREF="xEMACS.HTM#SEC175">Words</A>.
  3224. <DT><KBD>M-d</KBD>
  3225. <DD>Kill word (<CODE>kill-word</CODE>).
  3226. <DT><KBD>M-<KBD>DEL</KBD></KBD>
  3227. <DD>Kill word backwards (<CODE>backward-kill-word</CODE>).
  3228. <DT><KBD>C-x <KBD>DEL</KBD></KBD>
  3229. <DD>Kill back to beginning of sentence (<CODE>backward-kill-sentence</CODE>).
  3230. See section <A HREF="xEMACS.HTM#SEC176">Sentences</A>.
  3231. <DT><KBD>M-k</KBD>
  3232. <DD>Kill to end of sentence (<CODE>kill-sentence</CODE>).
  3233. <DT><KBD>C-M-k</KBD>
  3234. <DD>Kill sexp (<CODE>kill-sexp</CODE>).  See section <A HREF="xEMACS.HTM#SEC186">Lists and Sexps</A>.
  3235. <DT><KBD>M-z <VAR>char</VAR></KBD>
  3236. <DD>Kill up to next occurrence of <VAR>char</VAR> (<CODE>zap-to-char</CODE>).
  3237. </DL>
  3238.    <KBD>C-w</KBD> (<CODE>kill-region</CODE>) is a very general kill command; it
  3239. kills everything between point and the mark. You can use this command to
  3240. kill any contiguous sequence of characters by first setting the mark at
  3241. one end of a sequence of characters, then going to the other end and
  3242. typing <KBD>C-w</KBD>.
  3243. <A NAME="IDX352"></A>
  3244. <A NAME="IDX353"></A>
  3245.   A convenient way of killing is combined with searching: <KBD>M-z</KBD>
  3246. (<CODE>zap-to-char</CODE>) reads a character and kills from point up to (but not
  3247. including) the next occurrence of that character in the buffer.  If there
  3248. is no next occurrence, killing goes to the end of the buffer.  A numeric
  3249. argument acts as a repeat count.  A negative argument means to search
  3250. backward and kill text before point.
  3251.   Other syntactic units can be killed: words, with <KBD>M-<KBD>DEL</KBD></KBD> and
  3252. <KBD>M-d</KBD> (see section <A HREF="xEMACS.HTM#SEC175">Words</A>); sexps, with <KBD>C-M-k</KBD> (see section <A HREF="xEMACS.HTM#SEC186">Lists and Sexps</A>); and
  3253. sentences, with <KBD>C-x <KBD>DEL</KBD></KBD> and <KBD>M-k</KBD>
  3254. (see section <A HREF="xEMACS.HTM#SEC176">Sentences</A>).<P>
  3255. <A NAME="IDX354"></A>
  3256. <A NAME="IDX355"></A>
  3257. <A NAME="IDX356"></A>
  3258. <A NAME="IDX357"></A>
  3259. <A NAME="IDX358"></A>
  3260. <H2><A NAME="SEC73" HREF="xEMACS_TO.HTM#SEC73">Yanking</A></H2>
  3261.   <DFN>Yanking</DFN> means getting back text which was killed. Some systems
  3262. call this "pasting".  The usual way to move or copy text is to kill it
  3263. and then yank it one or more times.
  3264. <DL COMPACT>
  3265. <DT><KBD>C-y</KBD>
  3266. <DD>Yank last killed text (<CODE>yank</CODE>).
  3267. <DT><KBD>M-y</KBD>
  3268. <DD>Replace re-inserted killed text with the previously killed text
  3269. (<CODE>yank-pop</CODE>).
  3270. <DT><KBD>M-w</KBD>
  3271. <DD>Save region as last killed text without actually killing it
  3272. (<CODE>copy-region-as-kill</CODE>).
  3273. <DT><KBD>C-M-w</KBD>
  3274. <DD>Append next kill to last batch of killed text (<CODE>append-next-kill</CODE>).
  3275. </DL>
  3276. <H3><A NAME="SEC74" HREF="xEMACS_TO.HTM#SEC74">The Kill Ring</A></H3>
  3277. <A NAME="IDX359"></A>
  3278. <A NAME="IDX360"></A>
  3279.   All killed text is recorded in the <DFN>kill ring</DFN>, a list of blocks of
  3280. text that have been killed.  There is only one kill ring, used in all
  3281. buffers, so you can kill text in one buffer and yank it in another buffer.
  3282. This is the usual way to move text from one file to another.
  3283. (See section <A HREF="xEMACS.HTM#SEC82">Accumulating Text</A>, for some other ways.)
  3284.   If you have two separate Emacs processes, you cannot use the kill ring
  3285. to move text. If you are using Lucid GNU Emacs under X, however, you can
  3286. use the X selection mechanism to move text from one to another.
  3287. If you are using Lucid GNU Emacs under X and have one Emacs process with
  3288. multiple screens, they do share the same kill ring.  You can kill or
  3289. copy text in one Emacs screen, then yank it in the other screen
  3290. belonging to the same process.
  3291.   The command <KBD>C-y</KBD> (<CODE>yank</CODE>) reinserts the text of the most recent
  3292. kill.  It leaves the cursor at the end of the text and sets the mark at
  3293. the beginning of the text.  See section <A HREF="xEMACS.HTM#SEC60">Selecting Text</A>.
  3294.   <KBD>C-u C-y</KBD> yanks the text, leaves the cursor in front of the text,
  3295. and sets the mark after it, if the argument is with just a <KBD>C-u</KBD>.
  3296. Any other argument, including <KBD>C-u</KBD> and digits, has different
  3297. results, described below, under "Yanking Earlier Kills".
  3298. <A NAME="IDX361"></A>
  3299. <A NAME="IDX362"></A>
  3300.  To copy a block of text, you can also use <KBD>M-w</KBD>
  3301. (<CODE>copy-region-as-kill</CODE>), which copies the region into the kill ring
  3302. without removing it from the buffer. <KBD>M-w</KBD> is similar to <KBD>C-w</KBD>
  3303. followed by <KBD>C-y</KBD> but does not mark the buffer as "modified" and
  3304. does not actually cut anything.
  3305. <H3><A NAME="SEC75" HREF="xEMACS_TO.HTM#SEC75">Appending Kills</A></H3>
  3306. <A NAME="IDX363"></A>
  3307.   Normally, each kill command pushes a new block onto the kill ring.
  3308. However, two or more kill commands in a row combine their text into a
  3309. single entry, so that a single <KBD>C-y</KBD> yanks it all back. This means
  3310. you don't have to kill all the text you want to yank in one command; you
  3311. can kill line after line, or word after word, until you have killed what
  3312. you want, then get it all back at once using <KBD>C-y</KBD>. (Thus we join
  3313. television in leading people to kill thoughtlessly.)
  3314.   Commands that kill forward from point add onto the end of the previous
  3315. killed text.  Commands that kill backward from point add onto the
  3316. beginning.  This way, any sequence of mixed forward and backward kill
  3317. commands puts all the killed text into one entry without rearrangement.
  3318. Numeric arguments do not break the sequence of appending kills.  For
  3319. example, suppose the buffer contains:
  3320. <PRE>
  3321. This is the first
  3322. line of sample text
  3323. and here is the third.
  3324. </PRE>
  3325. with point at the beginning of the second line.  If you type <KBD>C-k C-u 2
  3326. M-<KBD>DEL</KBD> C-k</KBD>, the first <KBD>C-k</KBD> kills the text <SAMP>`line of sample
  3327. text'</SAMP>, <KBD>C-u 2 M-<KBD>DEL</KBD></KBD> kills <SAMP>`the first'</SAMP> with the newline that
  3328. followed it, and the second <KBD>C-k</KBD> kills the newline after the second
  3329. line.  The result is that the buffer contains <SAMP>`This is and here is the
  3330. third.'</SAMP> and a single kill entry contains <SAMP>`the first<KBD>RET</KBD>line of
  3331. sample text<KBD>RET</KBD>'</SAMP>---all the killed text, in its original order.
  3332. <A NAME="IDX364"></A>
  3333. <A NAME="IDX365"></A>
  3334.   If a kill command is separated from the last kill command by other
  3335. commands (not just numeric arguments), it starts a new entry on the kill
  3336. ring.  To force a kill command to append, first type the command <KBD>C-M-w</KBD>
  3337. (<CODE>append-next-kill</CODE>). <KBD>C-M-w</KBD> tells the following command,
  3338. if it is a kill command, to append the text it kills to the last killed
  3339. text, instead of starting a new entry.  With <KBD>C-M-w</KBD>, you can kill
  3340. several separated pieces of text and accumulate them to be yanked back
  3341. in one place.<P>
  3342. <H3><A NAME="SEC76" HREF="xEMACS_TO.HTM#SEC76">Yanking Earlier Kills</A></H3>
  3343. <A NAME="IDX366"></A>
  3344. <A NAME="IDX367"></A>
  3345.   To recover killed text that is no longer the most recent kill, you need
  3346. the <KBD>Meta-y</KBD> (<CODE>yank-pop</CODE>) command.  You can use <KBD>M-y</KBD> only
  3347. after a <KBD>C-y</KBD> or another <KBD>M-y</KBD>.  It takes the text previously
  3348. yanked and replaces it with the text from an earlier kill.  To recover
  3349. the text of the next-to-the-last kill, first use <KBD>C-y</KBD> to recover
  3350. the last kill, then <KBD>M-y</KBD> to replace it with the previous
  3351. kill.<P>
  3352.   You can think in terms of a "last yank" pointer which points at an item
  3353. in the kill ring.  Each time you kill, the "last yank" pointer moves to
  3354. the new item at the front of the ring.  <KBD>C-y</KBD> yanks the item
  3355. which the "last yank" pointer points to.  <KBD>M-y</KBD> moves the "last
  3356. yank" pointer to a different item, and the text in the buffer changes to
  3357. match.  Enough <KBD>M-y</KBD> commands can move the pointer to any item in the
  3358. ring, so you can get any item into the buffer.  Eventually the pointer
  3359. reaches the end of the ring; the next <KBD>M-y</KBD> moves it to the first item
  3360. again.
  3361.   Yanking moves the "last yank" pointer around the ring, but does not
  3362. change the order of the entries in the ring, which always runs from the
  3363. most recent kill at the front to the oldest one still remembered.
  3364.   Use <KBD>M-y</KBD> with a numeric argument to advance the "last
  3365. yank" pointer by the specified number of items.  A negative argument
  3366. moves the pointer toward the front of the ring; from the front of the
  3367. ring, it moves to the last entry and starts moving forward from there.
  3368.   Once the text you are looking for is brought into the buffer, you can
  3369. stop doing <KBD>M-y</KBD> commands and the text will stay there. Since the
  3370. text is just a copy of the kill ring item, editing it in the buffer does
  3371. not change what's in the ring.  As long you don't kill additional text,
  3372. the "last yank" pointer remains at the same place in the kill ring:
  3373. repeating <KBD>C-y</KBD> will yank another copy of the same old kill.
  3374.   If you know how many <KBD>M-y</KBD> commands it would take to find the
  3375. text you want, you can yank that text in one step using <KBD>C-y</KBD> with
  3376. a numeric argument.  <KBD>C-y</KBD> with an argument greater than one
  3377. restores the text the specified number of entries back in the kill
  3378. ring.  Thus, <KBD>C-u 2 C-y</KBD> gets the next to the last block of killed
  3379. text.  It is equivalent to <KBD>C-y M-y</KBD>.  <KBD>C-y</KBD> with a numeric
  3380. argument starts counting from the "last yank" pointer, and sets the
  3381. "last yank" pointer to the entry that it yanks.
  3382. <A NAME="IDX368"></A>
  3383.   The variable <CODE>kill-ring-max</CODE> controls the length of the kill
  3384. ring; no more than that many blocks of killed text are saved.
  3385. <H2><A NAME="SEC77" HREF="xEMACS_TO.HTM#SEC77">Using X Selections</A></H2>
  3386. In the X window system, mouse selections provide a simple mechanism for
  3387. text transfer between different applications.  In a typical X
  3388. application, you can select text by pressing the left mouse button and
  3389. dragging the cursor over the text you want to copy.  The text becomes the
  3390. primary X selection and is highlighted.  The highlighted region is also
  3391. the Emacs selected region.
  3392. Since the region is the primary X selection, you can go to a different X
  3393. application and click the middle mouse button: the text that you selected in
  3394. the previous application is pasted into the current application.
  3395. Since the region is the Emacs selected region, you can use all region
  3396. commands (<KBD>C-w, M-w</KBD> etc.) as well as the options of the <B>Edit</B>
  3397. menu to manipulate the selected text.
  3398. </UL>
  3399. <A NAME="IDX369"></A>
  3400. <H3><A NAME="SEC78" HREF="xEMACS_TO.HTM#SEC78">The Clipboard Selection</A></H3>
  3401. There are other kinds of X selections besides the <B>Primary</B> selection; one
  3402. common one is the <B>Clipboard</B> selection.  Some applications prefer to
  3403. transfer data using this selection in preference to the <B>Primary</B>.
  3404. One can transfer text from the <B>Primary</B> selection to the  <B>Clipboard</B>
  3405. selection with the <B>Copy</B> command under the <B>Edit</B> menu in the menubar.
  3406. Usually, the clipboard selection is not visible.  However, if you run the
  3407. <TT>`xclipboard'</TT> application, the text most recently copied to the clipboard
  3408. (with the <B>Copy</B> command) is displayed in a window.  Any time new text is
  3409. thus copied, the <TT>`xclipboard'</TT> application makes a copy of it and displays
  3410. it in its window.  The value of the clipboard can survive the lifetime of the
  3411. running Emacs process.  The <CODE>xclipboard</CODE> man page provides more details.
  3412. Warning: If you use the <TT>`xclipboard'</TT> application, remember that it
  3413. maintains a list of all things that have been pasted to the clipboard (that
  3414. is, copied with the <B>Copy</B> command).  If you don't manually delete elements
  3415. from this list by clicking on the <B>Delete</B> button in the <CODE>xclipboard</CODE>
  3416. window, the clipboard will eventually consume a lot of memory.
  3417. In summary, some X applications (such as <TT>`xterm'</TT>) allow one to paste
  3418. text in them from XEmacs in the following way:
  3419. Drag out a region of text in Emacs with the left mouse button,
  3420. making that text be the <B>Primary</B> selection.
  3421. Click the middle button in the other application, pasting the <B>Primary</B>
  3422. selection. 
  3423. </UL>
  3424. With some other applications (notably, the OpenWindows and Motif tools) you
  3425. must use this method instead:
  3426. Drag out a region of text in Emacs with the left mouse button,
  3427. making that text be the <B>Primary</B> selection.
  3428. Copy the selected text to the <B>Clipboard</B> selection by selecting the
  3429. <B>Copy</B> menu item from the <B>Edit</B> menu, or by hitting the <B>Copy</B>
  3430. key on your keyboard.
  3431. Paste the text in the other application by selecting <B>Paste</B> from its
  3432. menu, or by hitting the <B>Paste</B> key on your keyboard.
  3433. </UL>
  3434. <A NAME="IDX370"></A>
  3435. <A NAME="IDX371"></A>
  3436. <H3><A NAME="SEC79" HREF="xEMACS_TO.HTM#SEC79">Miscellaneous X Selection Commands</A></H3>
  3437. <A NAME="IDX372"></A>
  3438. <A NAME="IDX373"></A>
  3439. <A NAME="IDX374"></A>
  3440. <A NAME="IDX375"></A>
  3441. <A NAME="IDX376"></A>
  3442. <A NAME="IDX377"></A>
  3443. <A NAME="IDX378"></A>
  3444. <A NAME="IDX379"></A>
  3445. <DL COMPACT>
  3446. <DT><KBD>M-x x-copy-primary-selection</KBD>
  3447. <DD>Copy the primary selection to both the kill ring and the Clipboard.
  3448. <DT><KBD>M-x x-insert-selection</KBD>
  3449. <DD>Insert the current selection into the buffer at point.
  3450. <DT><KBD>M-x x-delete-primary-selection</KBD>
  3451. <DD>Deletes the text in the primary selection without copying it to the kill
  3452. ring or the Clipboard.
  3453. <DT><KBD>M-x x-kill-primary-selection</KBD>
  3454. <DD>Deletes the text in the primary selection and copies it to 
  3455. both the kill ring and the Clipboard.
  3456. <DT><KBD>M-x x-mouse-kill</KBD>
  3457. <DD>Kill the text between point and the mouse and copy it to 
  3458. the clipboard and to the cut buffer.
  3459. <DT><KBD>M-x x-own-secondary-selection</KBD>
  3460. <DD>Make a secondary X selection of the given argument. 
  3461. <DT><KBD>M-x x-own-selection</KBD>
  3462. <DD>Make a primary X selection of the given argument.  
  3463. <DT><KBD>M-x x-set-point-and-insert-selection</KBD>
  3464. <DD>Set point where clicked and insert the primary selection or the
  3465. cut buffer.
  3466. </DL>
  3467. <H3><A NAME="SEC80" HREF="xEMACS_TO.HTM#SEC80">X Cut Buffers</A></H3>
  3468. X cut buffers are a different, older way of transferring text between
  3469. applications.  XEmacs supports cut buffers for compatibility
  3470. with older programs, even though selections are now the preferred way of
  3471. transferring text.
  3472. X has a concept of applications "owning" selections.  When you select
  3473. text by clicking and dragging inside an application, the application
  3474. tells the X server that it owns the selection.  When another
  3475. application asks the X server for the value of the selection, the X
  3476. server requests the information from the owner. When you use
  3477. selections, the selection data is not actually transferred unless
  3478. someone wants it; the act of making a selection doesn't transfer data.
  3479. Cut buffers are different: when you "own" a cut buffer, the data is
  3480. actually transferred to the X server immediately, and survives the
  3481. lifetime of the application.
  3482. Any time a region of text becomes the primary selection in Emacs,
  3483. Emacs also copies that text to the cut buffer.  This makes it possible
  3484. to copy text from a Lucid GNU Emacs buffer and paste it into an older,
  3485. non-selection-based application (such as Emacs 18).
  3486. Note: Older versions of Emacs could not access the X selections, only
  3487. the X cut buffers.
  3488. <A NAME="IDX380"></A>
  3489. <H3><A NAME="SEC81" HREF="xEMACS_TO.HTM#SEC81">Active Regions</A></H3>
  3490.   By default, both the text you select in an Emacs buffer using the
  3491. click-and-drag mechanism and text you select by setting point and the
  3492. mark is highlighted. You can use Emacs region commands as well as the
  3493. <B>Cut</B> and <B>Copy</B> commands on the highlighted region you selected
  3494. with the mouse.
  3495. If you prefer, you can make a distinction between text selected with the
  3496. mouse and text selected with point and the mark by setting the variable
  3497. <CODE>zmacs-regions</CODE> to <CODE>nil</CODE>.  In that case:
  3498. The text selected with the mouse becomes both the X selection and the
  3499. Emacs selected region. You can use menu-bar commands as well as Emacs
  3500. region commands on it. 
  3501. The text selected with point and the mark is not highlighted. You can
  3502. only use Emacs region commands on it, not the menu-bar items. 
  3503. </UL>
  3504.   Active regions originally come from Zmacs, the Lisp Machine editor.
  3505. The idea behind them is that commands can only operate on a region when
  3506. the region is in an "active" state.  Put simply, you can only operate on
  3507. a region that is highlighted.
  3508. <A NAME="IDX381"></A>
  3509. The variable <CODE>zmacs-regions</CODE> checks whether LISPM-style active
  3510. regions should be used.  This means that commands that operate on the
  3511. region (the area between point and the mark) only work while
  3512. the region is in the active state, which is indicated by highlighting.
  3513. Most commands causes the region to not be in the active state;
  3514. for example, <KBD>C-w</KBD> only works immediately after activating the
  3515. region.
  3516. More specifically:
  3517. Commands that operate on the region only work if the region is active.
  3518. Only a very small set of commands causes the region to become active---
  3519. those commands whose semantics are to mark an area, such as <CODE>mark-defun</CODE>.
  3520. The region is deactivated after each command that is executed, except that
  3521. motion commands do not change whether the region is active or not.
  3522. </UL>
  3523. <CODE>set-mark-command</CODE> (<KBD>C-SPC</KBD>) pushes a mark and activates the
  3524. region.  Moving the cursor with normal motion commands (<KBD>C-n</KBD>,
  3525. <KBD>C-p</KBD>, etc.) will cause the region between point and the
  3526. recently-pushed mark to be highlighted.  It will remain highlighted
  3527. until some non-motion comand is executed.
  3528. <CODE>exchange-point-and-mark</CODE> (<KBD>C-x C-x</KBD>) activates the region.
  3529. So if you mark a region and execute a command that operates on it, you
  3530. can reactivate the same region with <KBD>C-x C-x</KBD> (or perhaps <KBD>C-x
  3531. C-x C-x C-x</KBD>) to operate on it again.
  3532. Generally, commands that push marks as a means of navigation, such as
  3533. <CODE>beginning-of-buffer</CODE> (<KBD>M-<</KBD>) and <CODE>end-of-buffer</CODE>
  3534. (<KBD>M-></KBD>), do not activate the region.  However, commands that push
  3535. marks as a means of marking an area of text, such as <CODE>mark-defun</CODE>
  3536. (<KBD>M-C-h</KBD>), <CODE>mark-word</CODE> (<KBD>M-@</KBD>), and <CODE>mark-whole-buffer</CODE>
  3537. (<KBD>C-x h</KBD>), do activate the region.
  3538. When <CODE>zmacs-regions</CODE> is <CODE>t</CODE>, there is no distinction between
  3539. the primary X selection and the active region selected by point and the
  3540. mark.  To see this, set the mark (<KBD>C-SPC</KBD>) and move the cursor
  3541. with any cursor-motion command: the region between point and mark is
  3542. highlighted, and you can watch it grow and shrink as you move the
  3543. cursor.
  3544. Any other commands besides cursor-motion commands (such as inserting or
  3545. deleting text) will cause the region to no longer be active; it will no
  3546. longer be highlighted, and will no longer be the primary selection.
  3547. Errors also remove highlighting from a region.
  3548. Commands that require a region (such as <KBD>C-w</KBD>) signal an error if
  3549. the region is not active.  Certain commands cause the region to be in
  3550. its active state.  The most common ones are <CODE>push-mark</CODE>
  3551. (<KBD>C-SPC</KBD>) and <CODE>exchange-point-and-mark</CODE> (<KBD>C-x C-x</KBD>).
  3552. <A NAME="IDX382"></A>
  3553. When <CODE>zmacs-regions</CODE> is <CODE>t</CODE>, programs can be non-intrusive
  3554. on the state of the region by setting the variable <CODE>zmacs-region-stays</CODE>
  3555. to a non-<CODE>nil</CODE> value.  If you are writing a new Emacs command that
  3556. is conceptually a "motion" command and should not interfere with the
  3557. current highlightedness of the region, then you may set this variable.
  3558. It is reset to <CODE>nil</CODE> after each user command is executed.
  3559. <A NAME="IDX383"></A>
  3560. When <CODE>zmacs-regions</CODE> is <CODE>t</CODE>, programs can make the region between
  3561. point and mark go into the active (highlighted) state by using the
  3562. function <CODE>zmacs-activate-region</CODE>. Only a small number of commands
  3563. should ever do this. 
  3564. <A NAME="IDX384"></A>
  3565. When <CODE>zmacs-regions</CODE> is <CODE>t</CODE>, programs can deactivate the region
  3566. between point and the mark by using <CODE>zmacs-deactivate-region</CODE>.
  3567. Note: you should not have to call this function; the command loop calls
  3568. it when appropriate. 
  3569. <A NAME="IDX385"></A>
  3570. <A NAME="IDX386"></A>
  3571. <A NAME="IDX387"></A>
  3572. <A NAME="IDX388"></A>
  3573. <A NAME="IDX389"></A>
  3574. <A NAME="IDX390"></A>
  3575. <H2><A NAME="SEC82" HREF="xEMACS_TO.HTM#SEC82">Accumulating Text</A></H2>
  3576.   Usually you copy or move text by killing it and yanking it, but there are
  3577. other ways that are useful for copying one block of text in many places, or
  3578. for copying many scattered blocks of text into one place.
  3579.   If you like, you can accumulate blocks of text from scattered
  3580. locations either into a buffer or into a file.  The relevant commands
  3581. are described here.  You can also use Emacs registers for storing and
  3582. accumulating text.  See section <A HREF="xEMACS.HTM#SEC84">Registers</A>.
  3583. <DL COMPACT>
  3584. <DT><KBD>M-x append-to-buffer</KBD>
  3585. <DD>Append region to contents of specified buffer (<CODE>append-to-buffer</CODE>).
  3586. <DT><KBD>M-x prepend-to-buffer</KBD>
  3587. <DD>Prepend region to contents of specified buffer.
  3588. <DT><KBD>M-x copy-to-buffer</KBD>
  3589. <DD>Copy region into specified buffer, deleting that buffer's old contents.
  3590. <DT><KBD>M-x insert-buffer</KBD>
  3591. <DD>Insert contents of specified buffer into current buffer at point.
  3592. <DT><KBD>M-x append-to-file</KBD>
  3593. <DD>Append region to the end of the contents of specified file.
  3594. </DL>
  3595.   To accumulate text into a buffer, use the command <KBD>M-x
  3596. append-to-buffer</KBD>, which inserts a copy of the region into the buffer
  3597. <VAR>buffername</VAR>, at the location of point in that buffer.  If there is
  3598. no buffer with the given name, one is created.
  3599.   If you append text to a buffer that has been used for editing, the
  3600. copied text goes to the place where point is.  Point in that buffer is
  3601. left at the end of the copied text, so successive uses of
  3602. <CODE>append-to-buffer</CODE> accumulate the text in the specified buffer in
  3603. the same order as they were copied.  Strictly speaking, this command does
  3604. not always append to the text already in the buffer; but if this command
  3605. is the only command used to alter a buffer, it does always append to the
  3606. existing text because point is always at the end.
  3607.   <KBD>M-x prepend-to-buffer</KBD> is similar to <CODE>append-to-buffer</CODE>, but
  3608. point in the other buffer is left before the copied text, so successive
  3609. prependings add text in reverse order.  <KBD>M-x copy-to-buffer</KBD> is
  3610. similar, except that any existing text in the other buffer is deleted,
  3611. so the buffer is left containing just the text newly copied into it.
  3612.   You can retrieve the accumulated text from that buffer with <KBD>M-x
  3613. insert-buffer</KBD>, which takes <VAR>buffername</VAR> as an argument.  It inserts
  3614. a copy of the text in buffer <VAR>buffername</VAR> into the selected buffer.
  3615. You could alternatively select the other buffer for editing, perhaps moving
  3616. text from it by killing or with <CODE>append-to-buffer</CODE>.  See section <A HREF="xEMACS.HTM#SEC147">Using Multiple Buffers</A>, for
  3617. background information on buffers.
  3618.   Instead of accumulating text within Emacs in a buffer, you can append
  3619. text directly into a file with <KBD>M-x append-to-file</KBD>, which takes
  3620. <VAR>file-name</VAR> as an argument.  It adds the text of the region to the
  3621. end of the specified file.  The file is changed immediately on disk.
  3622. This command is normally used with files that are <I>not</I> being visited
  3623. in Emacs.  Using it on a file that Emacs is visiting can produce
  3624. confusing results, because the file's text inside Emacs does not change
  3625. while the file itself changes.
  3626. <A NAME="IDX391"></A>
  3627. <H2><A NAME="SEC83" HREF="xEMACS_TO.HTM#SEC83">Rectangles</A></H2>
  3628.   The rectangle commands affect rectangular areas of text: all
  3629. characters between a certain pair of columns, in a certain range of lines.
  3630. Commands are provided to kill rectangles, yank killed rectangles, clear
  3631. them out, or delete them.  Rectangle commands are useful with text in
  3632. multicolumnar formats, like code with comments at the right,
  3633. or for changing text into or out of such formats.
  3634.   To specify the rectangle a command should work on, put the mark at one
  3635. corner and point at the opposite corner.  The specified rectangle is
  3636. called the <DFN>region-rectangle</DFN> because it is controlled about the
  3637. same way the region is controlled.  Remember that a given
  3638. combination of point and mark values can be interpreted either as
  3639. specifying a region or as specifying a rectangle; it is up to the
  3640. command that uses them to choose the interpretation.
  3641. <DL COMPACT>
  3642. <DT><KBD>M-x delete-rectangle</KBD>
  3643. <DD>Delete the text of the region-rectangle, moving any following text on
  3644. each line leftward to the left edge of the region-rectangle.
  3645. <DT><KBD>M-x kill-rectangle</KBD>
  3646. <DD>Similar, but also save the contents of the region-rectangle as the
  3647. "last killed rectangle".
  3648. <DT><KBD>M-x yank-rectangle</KBD>
  3649. <DD>Yank the last killed rectangle with its upper left corner at point.
  3650. <DT><KBD>M-x open-rectangle</KBD>
  3651. <DD>Insert blank space to fill the space of the region-rectangle.
  3652. The previous contents of the region-rectangle are pushed rightward.
  3653. <DT><KBD>M-x clear-rectangle</KBD>
  3654. <DD>Clear the region-rectangle by replacing its contents with spaces.
  3655. </DL>
  3656.   The rectangle operations fall into two classes: commands deleting and
  3657. moving rectangles, and commands for blank rectangles.
  3658. <A NAME="IDX392"></A>
  3659. <A NAME="IDX393"></A>
  3660.   There are two ways to get rid of the text in a rectangle: you can discard
  3661. the text (delete it) or save it as the "last killed" rectangle.  The
  3662. commands for these two ways are <KBD>M-x delete-rectangle</KBD> and <KBD>M-x
  3663. kill-rectangle</KBD>.  In either case, the portion of each line that falls inside
  3664. the rectangle's boundaries is deleted, causing following text (if any) on
  3665. the line to move left.
  3666.   Note that "killing" a rectangle is not killing in the usual sense; the
  3667. rectangle is not stored in the kill ring, but in a special place that
  3668. only records the most recently killed rectangle (that is, does not
  3669. append to a killed rectangle).  Different yank commands
  3670. have to be used and only one rectangle is stored, because yanking
  3671. a rectangle is quite different from yanking linear text and yank-popping
  3672. commands are difficult to make sense of.
  3673.   Inserting a rectangle is the opposite of deleting one.  You specify
  3674. where to put the upper left corner by putting point there.  The
  3675. rectangle's first line is inserted at point, the rectangle's second line
  3676. is inserted at a point one line vertically down, and so on.  The number
  3677. of lines affected is determined by the height of the saved rectangle.
  3678. <A NAME="IDX394"></A>
  3679.   To insert the last killed rectangle, type <KBD>M-x yank-rectangle</KBD>.
  3680. This can be used to convert single-column lists into double-column
  3681. lists; kill the second half of the list as a rectangle and then
  3682. yank it beside the first line of the list.
  3683. <A NAME="IDX395"></A>
  3684. <A NAME="IDX396"></A>
  3685.   There are two commands for working with blank rectangles: <KBD>M-x
  3686. clear-rectangle</KBD> erases existing text, and <KBD>M-x open-rectangle</KBD>
  3687. inserts a blank rectangle.  Clearing a rectangle is equivalent to
  3688. deleting it and then inserting a blank rectangle of the same size.
  3689.   Rectangles can also be copied into and out of registers.
  3690. See section <A HREF="xEMACS.HTM#SEC87">Saving Rectangles in Registers</A>.
  3691. <A NAME="IDX397"></A>
  3692. <H1><A NAME="SEC84" HREF="xEMACS_TO.HTM#SEC84">Registers</A></H1>
  3693.   Emacs <DFN>registers</DFN> are places in which you can save text or
  3694. positions for later use.  Text saved in a register can be copied into
  3695. the buffer once or many times; a position saved in a register is used by
  3696. moving point to that position.  Rectangles can also be copied into and
  3697. out of registers (see section <A HREF="xEMACS.HTM#SEC83">Rectangles</A>).
  3698.   Each register has a name, which is a single character.  A register can
  3699. store either a piece of text, a position, or a rectangle, but only one
  3700. thing at any given time.  Whatever you store in a register remains
  3701. there until you store something else in that register.
  3702. <DL COMPACT>
  3703. <DT><KBD>M-x view-register <KBD>RET</KBD> <VAR>r</VAR></KBD>
  3704. <DD>Display a description of what register <VAR>r</VAR> contains.
  3705. </DL>
  3706. <A NAME="IDX398"></A>
  3707.   <KBD>M-x view-register</KBD> reads a register name as an argument and then
  3708. displays the contents of the specified register.
  3709. <H2><A NAME="SEC85" HREF="xEMACS_TO.HTM#SEC85">Saving Positions in Registers</A></H2>
  3710.   Saving a position records a spot in a buffer so you can move
  3711. back there later.  Moving to a saved position re-selects the buffer
  3712. and moves point to the spot.
  3713. <DL COMPACT>
  3714. <DT><KBD>C-x r SPC <VAR>r</VAR></KBD>
  3715. <DD>Save the location of point in register <VAR>r</VAR> (<CODE>point-to-register</CODE>).
  3716. <DT><KBD>C-x r j <VAR>r</VAR></KBD>
  3717. <DD>Jump to the location saved in register <VAR>r</VAR> (<CODE>register-to-point</CODE>).
  3718. </DL>
  3719. <A NAME="IDX399"></A>
  3720. <A NAME="IDX400"></A>
  3721.   To save the current location of point in a register, choose a name
  3722. <VAR>r</VAR> and type <KBD>C-x r SPC <VAR>r</VAR></KBD>.  The register <VAR>r</VAR> retains
  3723. the location thus saved until you store something else in that
  3724. register.<A NAME="IDX401"></A>
  3725. <A NAME="IDX402"></A>
  3726.   The command <KBD>C-x r j <VAR>r</VAR></KBD> moves point to the location recorded
  3727. in register <VAR>r</VAR>.  The register is not affected; it continues to
  3728. record the same location.  You can jump to the same position using the
  3729. same register as often as you want.
  3730. <H2><A NAME="SEC86" HREF="xEMACS_TO.HTM#SEC86">Saving Text in Registers</A></H2>
  3731.   When you want to insert a copy of the same piece of text many times, it
  3732. can be impractical to use the kill ring, since each subsequent kill moves
  3733. the piece of text further down on the ring.  It becomes hard to keep
  3734. track of the argument needed to retrieve the same text with <KBD>C-y</KBD>.  An
  3735. alternative is to store the text in a register with <KBD>C-x r s</KBD>
  3736. (<CODE>copy-to-register</CODE>) and then retrieve it with <KBD>C-x r g</KBD>
  3737. (<CODE>insert-register</CODE>).
  3738. <DL COMPACT>
  3739. <DT><KBD>C-x r s <VAR>r</VAR></KBD>
  3740. <DD>Copy region into register <VAR>r</VAR> (<CODE>copy-to-register</CODE>).
  3741. <DT><KBD>C-x r g <VAR>r</VAR></KBD>
  3742. <DD>Insert text contents of register <VAR>r</VAR> (<CODE>insert-register</CODE>).
  3743. </DL>
  3744. <A NAME="IDX403"></A>
  3745. <A NAME="IDX404"></A>
  3746. <A NAME="IDX405"></A>
  3747. <A NAME="IDX406"></A>
  3748.   <KBD>C-x r s <VAR>r</VAR></KBD> stores a copy of the text of the region into the
  3749. register named <VAR>r</VAR>.  Given a numeric argument, <KBD>C-x r s</KBD> deletes the
  3750. text from the buffer as well.
  3751.   <KBD>C-x r g <VAR>r</VAR></KBD> inserts the text from register <VAR>r</VAR> in the buffer.
  3752. By default it leaves point before the text and places the mark after it. 
  3753. With a numeric argument, it puts point after the text and the mark
  3754. before it.
  3755. <A NAME="IDX407"></A>
  3756. <A NAME="IDX408"></A>
  3757. <H2><A NAME="SEC87" HREF="xEMACS_TO.HTM#SEC87">Saving Rectangles in Registers</A></H2>
  3758.   A register can contain a rectangle instead of lines of text.  The rectangle
  3759. is represented as a list of strings.  See section <A HREF="xEMACS.HTM#SEC83">Rectangles</A>, for basic
  3760. information on rectangles and how to specify rectangles in a buffer.
  3761. <DL COMPACT>
  3762. <DT><KBD>C-x r r <VAR>r</VAR></KBD>
  3763. <DD>Copy the region-rectangle into register <VAR>r</VAR>(<CODE>copy-rectangle-to-register</CODE>).
  3764. With a numeric argument, delete it as well.
  3765. <DT><KBD>C-x r g <VAR>r</VAR></KBD>
  3766. <DD>Insert the rectangle stored in register <VAR>r</VAR> (if it contains a
  3767. rectangle) (<CODE>insert-register</CODE>).
  3768. </DL>
  3769.   The <KBD>C-x r g</KBD> command inserts linear text if the register contains
  3770. that, or inserts a rectangle if the register contains one.
  3771. <H1><A NAME="SEC88" HREF="xEMACS_TO.HTM#SEC88">Controlling the Display</A></H1>
  3772.   Since only part of a large buffer fits in the window, Emacs tries to show
  3773. the part that is likely to be interesting.  The display control commands
  3774. allow you to specify which part of the text you want to see.
  3775. <DL COMPACT>
  3776. <DT><KBD>C-l</KBD>
  3777. <DD>Clear screen and redisplay, scrolling the selected window to center
  3778. point vertically within it (<CODE>recenter</CODE>).
  3779. <DT><KBD>C-v</KBD>
  3780. <DD>Scroll forward (a windowful or a specified number of lines) (<CODE>scroll-up</CODE>).
  3781. <DT><KBD>M-v</KBD>
  3782. <DD>Scroll backward (<CODE>scroll-down</CODE>).
  3783. <DT><KBD><VAR>arg</VAR> C-l</KBD>
  3784. <DD>Scroll so point is on line <VAR>arg</VAR> (<CODE>recenter</CODE>).
  3785. <DT><KBD>C-x <</KBD>
  3786. <DD>Scroll text in current window to the left (<CODE>scroll-left</CODE>).
  3787. <DT><KBD>C-x ></KBD>
  3788. <DD>Scroll to the right (<CODE>scroll-right</CODE>).
  3789. <DT><KBD>C-x $</KBD>
  3790. <DD>Make deeply indented lines invisible (<CODE>set-selective-display</CODE>).
  3791. </DL>
  3792. <H2><A NAME="SEC89" HREF="xEMACS_TO.HTM#SEC89">Scrolling</A></H2>
  3793.   If a buffer contains text that is too large to fit entirely within the
  3794. window that is displaying the buffer, Emacs shows a contiguous section of
  3795. the text.  The section shown always contains point.
  3796. <A NAME="IDX409"></A>
  3797.   <DFN>Scrolling</DFN> means moving text up or down in the window so that
  3798. different parts of the text are visible.  Scrolling forward means that text
  3799. moves up, and new text appears at the bottom.  Scrolling backward moves
  3800. text down and new text appears at the top.
  3801.   Scrolling happens automatically if you move point past the bottom or top
  3802. of the window.  You can also explicitly request scrolling with the commands
  3803. in this section.
  3804. <A NAME="IDX410"></A>
  3805. <A NAME="IDX411"></A>
  3806.   The most basic scrolling command is <KBD>C-l</KBD> (<CODE>recenter</CODE>) with no
  3807. argument.  It clears the entire screen and redisplays all windows.  In
  3808. addition, it scrolls the selected window so that point is halfway down
  3809. from the top of the window.
  3810. <A NAME="IDX412"></A>
  3811. <A NAME="IDX413"></A>
  3812. <A NAME="IDX414"></A>
  3813. <A NAME="IDX415"></A>
  3814.   The scrolling commands <KBD>C-v</KBD> and <KBD>M-v</KBD> let you move all the text
  3815. in the window up or down a few lines.  <KBD>C-v</KBD> (<CODE>scroll-up</CODE>) with an
  3816. argument shows you that many more lines at the bottom of the window, moving
  3817. the text and point up together as <KBD>C-l</KBD> might.  <KBD>C-v</KBD> with a
  3818. negative argument shows you more lines at the top of the window.
  3819. <KBD>Meta-v</KBD> (<CODE>scroll-down</CODE>) is like <KBD>C-v</KBD>, but moves in the
  3820. opposite direction.<A NAME="IDX416"></A>
  3821.   To read the buffer a windowful at a time, use <KBD>C-v</KBD> with no
  3822. argument.  <KBD>C-v</KBD> takes the last two lines at the bottom of the
  3823. window and puts them at the top, followed by nearly a whole windowful of
  3824. lines not previously visible.  Point moves to the new top of the window
  3825. if it was in the text scrolled off the top.  <KBD>M-v</KBD> with no argument
  3826. moves backward with similar overlap.  The number of lines of overlap
  3827. across a <KBD>C-v</KBD> or <KBD>M-v</KBD> is controlled by the variable
  3828. <CODE>next-screen-context-lines</CODE>; by default, it is two.
  3829.   Another way to scroll is using <KBD>C-l</KBD> with a numeric argument.
  3830. <KBD>C-l</KBD> does not clear the screen when given an argument; it only
  3831. scrolls the selected window.  With a positive argument <VAR>n</VAR>, <KBD>C-l</KBD>
  3832. repositions text to put point <VAR>n</VAR> lines down from the top.  An
  3833. argument of zero puts point on the very top line.  Point does not move
  3834. with respect to the text; rather, the text and point move rigidly on the
  3835. screen.  <KBD>C-l</KBD> with a negative argument puts point that many lines
  3836. from the bottom of the window.  For example, <KBD>C-u - 1 C-l</KBD> puts
  3837. point on the bottom line, and <KBD>C-u - 5 C-l</KBD> puts it five lines from
  3838. the bottom.  Just <KBD>C-u</KBD> as argument, as in <KBD>C-u C-l</KBD>, scrolls
  3839. point to the center of the screen.
  3840. <A NAME="IDX417"></A>
  3841.   Scrolling happens automatically if point has moved out of the visible
  3842. portion of the text when it is time to display.  Usually scrolling is
  3843. done  to put point vertically centered within the window.  However, if
  3844. the variable <CODE>scroll-step</CODE> has a non-zero value, an attempt is made to
  3845. scroll the buffer by that many lines; if that is enough to bring point back
  3846. into visibility, that is what happens.
  3847. <H2><A NAME="SEC90" HREF="xEMACS_TO.HTM#SEC90">Horizontal Scrolling</A></H2>
  3848. <A NAME="IDX418"></A>
  3849. <A NAME="IDX419"></A>
  3850. <A NAME="IDX420"></A>
  3851. <A NAME="IDX421"></A>
  3852. <A NAME="IDX422"></A>
  3853.   The text in a window can also be scrolled horizontally.  This means that
  3854. each line of text is shifted sideways in the window, and one or more
  3855. characters at the beginning of each line are not displayed at all.  When a
  3856. window has been scrolled horizontally in this way, text lines are truncated
  3857. rather than continued (see section <A HREF="xEMACS.HTM#SEC43">Continuation Lines</A>), with a <SAMP>`$'</SAMP> appearing
  3858. in the first column when there is text truncated to the left, and in the
  3859. last column when there is text truncated to the right.
  3860.   The command <KBD>C-x <</KBD> (<CODE>scroll-left</CODE>) scrolls the selected
  3861. window to the left by <VAR>n</VAR> columns with argument <VAR>n</VAR>.  With no
  3862. argument, it scrolls by almost the full width of the window (two columns
  3863. less, to be precise).  <KBD>C-x ></KBD> (<CODE>scroll-right</CODE>) scrolls
  3864. similarly to the right.  The window cannot be scrolled any farther to
  3865. the right once it is displaying normally (with each line starting at the
  3866. window's left margin); attempting to do so has no effect.
  3867. <A NAME="IDX423"></A>
  3868. <A NAME="IDX424"></A>
  3869. <H2><A NAME="SEC91" HREF="xEMACS_TO.HTM#SEC91">Selective Display</A></H2>
  3870.   Emacs can hide lines indented more than a certain number
  3871. of columns (you specify how many columns).  This allows you  to get an
  3872. overview of a part of a program.
  3873.   To hide lines, type <KBD>C-x $</KBD> (<CODE>set-selective-display</CODE>) with a
  3874. numeric argument <VAR>n</VAR>.  (See section <A HREF="xEMACS.HTM#SEC45">Numeric Arguments</A>, for information on giving
  3875. the argument.)  Lines with at least <VAR>n</VAR> columns of indentation
  3876. disappear from the screen.  The only indication of their presence are
  3877. three dots (<SAMP>`...'</SAMP>), which appear at the end of each visible
  3878. line that is followed by one or more invisible ones.<P>
  3879.   The invisible lines are still present in the buffer, and most editing
  3880. commands see them as usual, so it is very easy to put point in the middle
  3881. of invisible text.  When this happens, the cursor appears at the end of the
  3882. previous line, after the three dots.  If point is at the end of the visible
  3883. line, before the newline that ends it, the cursor appears before the three
  3884. dots.
  3885.   The commands <KBD>C-n</KBD> and <KBD>C-p</KBD> move across the invisible lines
  3886. as if they were not there.
  3887.   To make everything visible again, type <KBD>C-x $</KBD> with no argument.
  3888. <H2><A NAME="SEC92" HREF="xEMACS_TO.HTM#SEC92">Variables Controlling Display</A></H2>
  3889.   This section contains information for customization only.  Beginning
  3890. users should skip it.
  3891. <A NAME="IDX425"></A>
  3892.   The variable <CODE>mode-line-inverse-video</CODE> controls whether the mode
  3893. line is displayed in inverse video (assuming the terminal supports it);
  3894. <CODE>nil</CODE> means don't do so.  See section <A HREF="xEMACS.HTM#SEC12">The Mode Line</A>.
  3895. <A NAME="IDX426"></A>
  3896.   If the variable <CODE>inverse-video</CODE> is non-<CODE>nil</CODE>, Emacs attempts
  3897. to invert all the lines of the display from what they normally are.
  3898. <A NAME="IDX427"></A>
  3899.   When you reenter Emacs after suspending, Emacs normally clears the
  3900. screen and redraws the entire display.  On some terminals with more than
  3901. one page of memory, it is possible to arrange the termcap entry so that
  3902. the <SAMP>`ti'</SAMP> and <SAMP>`te'</SAMP> strings (output to the terminal when Emacs
  3903. is entered and exited, respectively) switch between pages of memory so
  3904. as to use one page for Emacs and another page for other output.  In that
  3905. case, you might want to set the variable <CODE>no-redraw-on-reenter</CODE> to
  3906. non-<CODE>nil</CODE> so that Emacs will assume, when resumed, that the screen
  3907. page it is using still contains what Emacs last wrote there.
  3908. <A NAME="IDX428"></A>
  3909.   The variable <CODE>echo-keystrokes</CODE> controls the echoing of multi-character
  3910. keys; its value is the number of seconds of pause required to cause echoing
  3911. to start, or zero, meaning don't echo at all.  See section <A HREF="xEMACS.HTM#SEC11">The Echo Area</A>.
  3912. <A NAME="IDX429"></A>
  3913.   If the variable <CODE>ctl-arrow</CODE> is <CODE>nil</CODE>, control characters in the
  3914. buffer are displayed with octal escape sequences, all except newline and
  3915. tab.  If its value is <CODE>t</CODE>, then control characters will be printed 
  3916. with an up-arrow, for example <KBD>^A</KBD>.  
  3917. If its value is not <CODE>t</CODE> and not <CODE>nil</CODE>, then characters whose
  3918. code is greater than 160 (that is, the space character (32) with its
  3919. high bit set) will be assumed to be printable, and will be displayed
  3920. without alteration.  This is the default when running under X Windows,
  3921. since XEmacs assumes an ISO/8859-1 character set (also known as
  3922. "Latin1").  The <CODE>ctl-arrow</CODE> variable may also be set to an
  3923. integer, in which case all characters whose codes are greater than or
  3924. equal to that value will be assumed to be printable.
  3925. Altering the value of <CODE>ctl-arrow</CODE> makes it local to the current
  3926. buffer; until that time, the default value is in effect.  See section <A HREF="xEMACS.HTM#SEC278">Local Variables</A>.
  3927. <A NAME="IDX430"></A>
  3928.   Normally, a tab character in the buffer is displayed as whitespace which
  3929. extends to the next display tab stop position, and display tab stops come
  3930. at intervals equal to eight spaces.  The number of spaces per tab is
  3931. controlled by the variable <CODE>tab-width</CODE>, which is made local by
  3932. changing it, just like <CODE>ctl-arrow</CODE>.  Note that how the tab character
  3933. in the buffer is displayed has nothing to do with the definition of
  3934. <KBD>TAB</KBD> as a command.
  3935. <A NAME="IDX431"></A>
  3936.   If you set the variable <CODE>selective-display-ellipses</CODE> to <CODE>nil</CODE>,
  3937. the three dots at the end of a line that precedes invisible
  3938. lines do not appear.  There is no visible indication of the invisible lines.
  3939. This variable becomes local automatically when set.
  3940. <A NAME="IDX432"></A>
  3941. <H1><A NAME="SEC93" HREF="xEMACS_TO.HTM#SEC93">Searching and Replacement</A></H1>
  3942.   Like other editors, Emacs has commands for searching for occurrences of
  3943. a string.  The principal search command is unusual in that it is
  3944. <DFN>incremental</DFN>: it begins to search before you have finished typing the
  3945. search string.  There are also non-incremental search commands more like
  3946. those of other editors.
  3947.   Besides the usual <CODE>replace-string</CODE> command that finds all
  3948. occurrences of one string and replaces them with another, Emacs has a fancy
  3949. replacement command called <CODE>query-replace</CODE> which asks interactively
  3950. which occurrences to replace.
  3951. <H2><A NAME="SEC94" HREF="xEMACS_TO.HTM#SEC94">Incremental Search</A></H2>
  3952.   An incremental search begins searching as soon as you type the first
  3953. character of the search string.  As you type in the search string, Emacs
  3954. shows you where the string (as you have typed it so far) is found.
  3955. When you have typed enough characters to identify the place you want, you
  3956. can stop.  Depending on what you do next, you may or may not need to
  3957. terminate the search explicitly with a <KBD>RET</KBD>.
  3958. <DL COMPACT>
  3959. <DT><KBD>C-s</KBD>
  3960. <DD>Incremental search forward (<CODE>isearch-forward</CODE>).
  3961. <DT><KBD>C-r</KBD>
  3962. <DD>Incremental search backward (<CODE>isearch-backward</CODE>).
  3963. </DL>
  3964. <A NAME="IDX433"></A>
  3965. <A NAME="IDX434"></A>
  3966. <A NAME="IDX435"></A>
  3967. <A NAME="IDX436"></A>
  3968.   <KBD>C-s</KBD> starts an incremental search.  <KBD>C-s</KBD> reads characters from
  3969. the keyboard and positions the cursor at the first occurrence of the
  3970. characters that you have typed.  If you type <KBD>C-s</KBD> and then <KBD>F</KBD>,
  3971. the cursor moves right after the first <SAMP>`F'</SAMP>.  Type an <KBD>O</KBD>, and see
  3972. the cursor move to after the first <SAMP>`FO'</SAMP>.  After another <KBD>O</KBD>, the
  3973. cursor is after the first <SAMP>`FOO'</SAMP> after the place where you started the
  3974. search.  Meanwhile, the search string <SAMP>`FOO'</SAMP> has been echoed in the
  3975. echo area.<P>
  3976.   The echo area display ends with three dots when actual searching is going
  3977. on.  When search is waiting for more input, the three dots are removed.
  3978. (On slow terminals, the three dots are not displayed.)
  3979.   If you make a mistake in typing the search string, you can erase
  3980. characters with <KBD>DEL</KBD>.  Each <KBD>DEL</KBD> cancels the last character of the
  3981. search string.  This does not happen until Emacs is ready to read another
  3982. input character; first it must either find, or fail to find, the character
  3983. you want to erase.  If you do not want to wait for this to happen, use
  3984. <KBD>C-g</KBD> as described below.<P>
  3985.   When you are satisfied with the place you have reached, you can type
  3986. <KBD>RET</KBD> (or <KBD>C-m</KBD>), which stops searching, leaving the cursor where 
  3987. the search brought it.  Any command not specially meaningful in searches also
  3988. stops the search and is then executed.  Thus, typing <KBD>C-a</KBD> exits the
  3989. search and then moves to the beginning of the line.  <KBD>RET</KBD> is necessary
  3990. only if the next command you want to type is a printing character,
  3991. <KBD>DEL</KBD>, <KBD>ESC</KBD>, or another control character that is special
  3992. within searches (<KBD>C-q</KBD>, <KBD>C-w</KBD>, <KBD>C-r</KBD>, <KBD>C-s</KBD>, or <KBD>C-y</KBD>).
  3993.   Sometimes you search for <SAMP>`FOO'</SAMP> and find it, but were actually
  3994. looking for a different occurance of it.  To move to the next occurrence
  3995. of the search string, type another <KBD>C-s</KBD>.  Do this as often as
  3996. necessary.  If you overshoot, you can cancel some <KBD>C-s</KBD>
  3997. characters with <KBD>DEL</KBD>.
  3998.   After you exit a search, you can search for the same string again by
  3999. typing just <KBD>C-s C-s</KBD>: the first <KBD>C-s</KBD> is the key that invokes
  4000. incremental search, and the second <KBD>C-s</KBD> means "search again".
  4001.   If the specified string is not found at all, the echo area displays
  4002. the text <SAMP>`Failing I-Search'</SAMP>.  The cursor is after the place where
  4003. Emacs found as much of your string as it could.  Thus, if you search for
  4004. <SAMP>`FOOT'</SAMP>, and there is no <SAMP>`FOOT'</SAMP>, the cursor may be after the
  4005. <SAMP>`FOO'</SAMP> in <SAMP>`FOOL'</SAMP>.  At this point there are several things you
  4006. can do.  If you mistyped the search string, correct it.  If you like the
  4007. place you have found, you can type <KBD>RET</KBD> or some other Emacs command
  4008. to "accept what the search offered".  Or you can type <KBD>C-g</KBD>, which
  4009. removes from the search string the characters that could not be found
  4010. (the <SAMP>`T'</SAMP> in <SAMP>`FOOT'</SAMP>), leaving those that were found (the
  4011. <SAMP>`FOO'</SAMP> in <SAMP>`FOOT'</SAMP>).  A second <KBD>C-g</KBD> at that point cancels
  4012. the search entirely, returning point to where it was when the search
  4013. started.
  4014.   If a search is failing and you ask to repeat it by typing another
  4015. <KBD>C-s</KBD>, it starts again from the beginning of the buffer.  Repeating
  4016. a failing backward search with <KBD>C-r</KBD> starts again from the end.  This
  4017. is called <DFN>wrapping around</DFN>.  <SAMP>`Wrapped'</SAMP> appears in the search
  4018. prompt once this has happened.
  4019. <A NAME="IDX437"></A>
  4020.   The <KBD>C-g</KBD> "quit" character does special things during searches;
  4021. just what it does depends on the status of the search.  If the search has
  4022. found what you specified and is waiting for input, <KBD>C-g</KBD> cancels the
  4023. entire search.  The cursor moves back to where you started the search.  If
  4024. <KBD>C-g</KBD> is typed when there are characters in the search string that have
  4025. not been found--because Emacs is still searching for them, or because it
  4026. has failed to find them--then the search string characters which have not
  4027. been found are discarded from the search string.  The
  4028. search is now successful and waiting for more input, so a second <KBD>C-g</KBD>
  4029. cancels the entire search.
  4030.   To search for a control character such as <KBD>C-s</KBD> or <KBD>DEL</KBD> or
  4031. <KBD>ESC</KBD>, you must quote it by typing <KBD>C-q</KBD> first.  This function
  4032. of <KBD>C-q</KBD> is analogous to its meaning as an Emacs command: it causes
  4033. the following character to be treated the way a graphic character would
  4034. normally be treated in the same context.
  4035.  To search backwards, you can use <KBD>C-r</KBD> instead of <KBD>C-s</KBD> to
  4036. start the search; <KBD>C-r</KBD> is the key that runs the command
  4037. (<CODE>isearch-backward</CODE>) to search backward.  You can also use
  4038. <KBD>C-r</KBD> to change from searching forward to searching backwards.  Do
  4039. this if a search fails because the place you started was too far down in the
  4040. file.  Repeated <KBD>C-r</KBD> keeps looking for more occurrences backwards.
  4041. <KBD>C-s</KBD> starts going forward again.  You can cancel <KBD>C-r</KBD> in a
  4042. search with <KBD>DEL</KBD>.
  4043.   The characters <KBD>C-y</KBD> and <KBD>C-w</KBD> can be used in incremental search
  4044. to grab text from the buffer into the search string.  This makes it
  4045. convenient to search for another occurrence of text at point.  <KBD>C-w</KBD>
  4046. copies the word after point as part of the search string, advancing
  4047. point over that word.  Another <KBD>C-s</KBD> to repeat the search will then
  4048. search for a string including that word.  <KBD>C-y</KBD> is similar to <KBD>C-w</KBD>
  4049. but copies the rest of the current line into the search string.
  4050.   The characters <KBD>M-p</KBD> and <KBD>M-n</KBD> can be used in an incremental
  4051. search to recall things which you have searched for in the past.  A
  4052. list of the last 16 things you have searched for is retained, and 
  4053. <KBD>M-p</KBD> and <KBD>M-n</KBD> let you cycle through that ring.
  4054. The character <KBD>M-<KBD>TAB</KBD></KBD> does completion on the elements in 
  4055. the search history ring.  For example, if you know that you have
  4056. recently searched for the string <CODE>POTATOE</CODE>, you could type
  4057. <KBD>C-s P O M-<KBD>TAB</KBD></KBD>.  If you had searched for other strings
  4058. beginning with <CODE>PO</CODE> then you would be shown a list of them, and
  4059. would need to type more to select one. 
  4060.   You can change any of the special characters in incremental search via
  4061. the normal keybinding mechanism: simply add a binding to the 
  4062. <CODE>isearch-mode-map</CODE>.  For example, to make the character
  4063. <KBD>C-b</KBD> mean "search backwards" while in isearch-mode, do this:
  4064. <PRE>
  4065. (define-key isearch-mode-map "\C-b" 'isearch-repeat-backward)
  4066. </PRE>
  4067. These are the default bindings of isearch-mode:
  4068. <A NAME="IDX438"></A>
  4069. <A NAME="IDX439"></A>
  4070. <A NAME="IDX440"></A>
  4071. <A NAME="IDX441"></A>
  4072. <A NAME="IDX442"></A>
  4073. <A NAME="IDX443"></A>
  4074. <A NAME="IDX444"></A>
  4075. <A NAME="IDX445"></A>
  4076. <A NAME="IDX446"></A>
  4077. <A NAME="IDX447"></A>
  4078. <A NAME="IDX448"></A>
  4079. <A NAME="IDX449"></A>
  4080. <A NAME="IDX450"></A>
  4081. <A NAME="IDX451"></A>
  4082. <A NAME="IDX452"></A>
  4083. <A NAME="IDX453"></A>
  4084. <A NAME="IDX454"></A>
  4085. <A NAME="IDX455"></A>
  4086. <A NAME="IDX456"></A>
  4087. <A NAME="IDX457"></A>
  4088. <A NAME="IDX458"></A>
  4089. <A NAME="IDX459"></A>
  4090. <DL COMPACT>
  4091. <DT><KBD>DEL</KBD>
  4092. <DD>Delete a character from the incremental search string (<CODE>isearch-delete-char</CODE>).
  4093. <DT><KBD>RET</KBD>
  4094. <DD>Exit incremental search (<CODE>isearch-exit</CODE>).
  4095. <DT><KBD>C-q</KBD>
  4096. <DD>Quote special characters for incremental search (<CODE>isearch-quote-char</CODE>).
  4097. <DT><KBD>C-s</KBD>
  4098. <DD>Repeat incremental search forward (<CODE>isearch-repeat-forward</CODE>).
  4099. <DT><KBD>C-r</KBD>
  4100. <DD>Repeat incremental search backward (<CODE>isearch-repeat-backward</CODE>).
  4101. <DT><KBD>C-y</KBD>
  4102. <DD>Pull rest of line from buffer into search string (<CODE>isearch-yank-line</CODE>).
  4103. <DT><KBD>C-w</KBD>
  4104. <DD>Pull next word from buffer into search string (<CODE>isearch-yank-word</CODE>).
  4105. <DT><KBD>C-g</KBD>
  4106. <DD>Cancels input back to what has been found successfully, or aborts the 
  4107. isearch (<CODE>isearch-abort</CODE>).
  4108. <DT><KBD>M-p</KBD>
  4109. <DD>Recall the previous element in the isearch history ring 
  4110. (<CODE>isearch-ring-retreat</CODE>).
  4111. <DT><KBD>M-n</KBD>
  4112. <DD>Recall the next element in the isearch history ring 
  4113. (<CODE>isearch-ring-advance</CODE>).
  4114. <DT><KBD>M-<KBD>TAB</KBD></KBD>
  4115. <DD>Do completion on the elements in the isearch history ring 
  4116. (<CODE>isearch-complete</CODE>).
  4117. </DL>
  4118. Any other character which is normally inserted into a buffer when typed
  4119. is automatically added to the search string in isearch-mode.
  4120. <H3><A NAME="SEC95" HREF="xEMACS_TO.HTM#SEC95">Slow Terminal Incremental Search</A></H3>
  4121.   Incremental search on a slow terminal uses a modified style of display
  4122. that is designed to take less time.  Instead of redisplaying the buffer at
  4123. each place the search gets to, it creates a new single-line window and uses
  4124. that to display the line the search has found.  The single-line window
  4125. appears as soon as point gets outside of the text that is already
  4126. on the screen.
  4127.   When the search is terminated, the single-line window is removed.  Only
  4128. at this time the window in which the search was done is redisplayed to show
  4129. its new value of point.
  4130.   The three dots at the end of the search string, normally used to indicate
  4131. that searching is going on, are not displayed in slow style display.
  4132. <A NAME="IDX460"></A>
  4133.   The slow terminal style of display is used when the terminal baud rate is
  4134. less than or equal to the value of the variable <CODE>search-slow-speed</CODE>,
  4135. initially 1200.
  4136. <A NAME="IDX461"></A>
  4137.   The number of lines to use in slow terminal search display is controlled
  4138. by the variable <CODE>search-slow-window-lines</CODE>.  Its normal value is 1.
  4139. <A NAME="IDX462"></A>
  4140. <H2><A NAME="SEC96" HREF="xEMACS_TO.HTM#SEC96">Non-Incremental Search</A></H2>
  4141.   Emacs also has conventional non-incremental search commands, which require
  4142. you type the entire search string before searching begins.
  4143. <DL COMPACT>
  4144. <DT><KBD>C-s <KBD>RET</KBD> <VAR>string</VAR> <KBD>RET</KBD></KBD>
  4145. <DD>Search for <VAR>string</VAR>.
  4146. <DT><KBD>C-r <KBD>RET</KBD> <VAR>string</VAR> <KBD>RET</KBD></KBD>
  4147. <DD>Search backward for <VAR>string</VAR>.
  4148. </DL>
  4149.   To do a non-incremental search, first type <KBD>C-s <KBD>RET</KBD></KBD>
  4150. (or <KBD>C-s C-m</KBD>).  This enters the minibuffer to read the search string.
  4151. Terminate the string with <KBD>RET</KBD> to start the search.  If the string
  4152. is not found, the search command gets an error.
  4153.  By default, <KBD>C-s</KBD> invokes incremental search, but if you give it an
  4154. empty argument, which would otherwise be useless, it invokes non-incremental
  4155. search.  Therefore, <KBD>C-s <KBD>RET</KBD></KBD> invokes non-incremental search. 
  4156. <KBD>C-r <KBD>RET</KBD></KBD> also works this way.
  4157. <A NAME="IDX463"></A>
  4158. <A NAME="IDX464"></A>
  4159.   Forward and backward non-incremental searches are implemented by the
  4160. commands <CODE>search-forward</CODE> and <CODE>search-backward</CODE>.  You can bind
  4161. these commands to keys.  The reason that incremental
  4162. search is programmed to invoke them as well is that <KBD>C-s <KBD>RET</KBD></KBD>
  4163. is the traditional sequence of characters used in Emacs to invoke
  4164. non-incremental search.
  4165.  Non-incremental searches performed using <KBD>C-s <KBD>RET</KBD></KBD> do
  4166. not call <CODE>search-forward</CODE> right away.  They first check
  4167. if the next character is <KBD>C-w</KBD>, which requests a word search.
  4168. <A NAME="IDX465"></A>
  4169. <H2><A NAME="SEC97" HREF="xEMACS_TO.HTM#SEC97">Word Search</A></H2>
  4170.   Word search looks for a sequence of words without regard to how the
  4171. words are separated.  More precisely, you type a string of many words,
  4172. using single spaces to separate them, and the string is found even if
  4173. there are multiple spaces, newlines or other punctuation between the words.
  4174.   Word search is useful in editing documents formatted by text formatters.
  4175. If you edit while looking at the printed, formatted version, you can't tell
  4176. where the line breaks are in the source file.  Word search, allows you
  4177. to search  without having to know the line breaks.
  4178. <DL COMPACT>
  4179. <DT><KBD>C-s <KBD>RET</KBD> C-w <VAR>words</VAR> <KBD>RET</KBD></KBD>
  4180. <DD>Search for <VAR>words</VAR>, ignoring differences in punctuation.
  4181. <DT><KBD>C-r <KBD>RET</KBD> C-w <VAR>words</VAR> <KBD>RET</KBD></KBD>
  4182. <DD>Search backward for <VAR>words</VAR>, ignoring differences in punctuation.
  4183. </DL>
  4184.   Word search is a special case of non-incremental search.  It is invoked
  4185. with <KBD>C-s <KBD>RET</KBD> C-w</KBD> followed by the search string, which
  4186. must always be terminated with another <KBD>RET</KBD>.  Being non-incremental, this
  4187. search does not start until the argument is terminated.  It works by
  4188. constructing a regular expression and searching for that.  See section <A HREF="xEMACS.HTM#SEC98">Regular Expression Search</A>.
  4189.  You can do a backward word search with <KBD>C-r <KBD>RET</KBD> C-w</KBD>.
  4190. <A NAME="IDX466"></A>
  4191. <A NAME="IDX467"></A>
  4192.   Forward and backward word searches are implemented by the commands
  4193. <CODE>word-search-forward</CODE> and <CODE>word-search-backward</CODE>.  You can
  4194. bind these commands to keys.  The reason that incremental
  4195. search is programmed to invoke them as well is that <KBD>C-s <KBD>RET</KBD> C-w</KBD>
  4196. is the traditional Emacs sequence of keys for word search.
  4197. <A NAME="IDX468"></A>
  4198. <A NAME="IDX469"></A>
  4199. <H2><A NAME="SEC98" HREF="xEMACS_TO.HTM#SEC98">Regular Expression Search</A></H2>
  4200.   A <DFN>regular expression</DFN> (<DFN>regexp</DFN>, for short) is a pattern that
  4201. denotes a set of strings, possibly an infinite set.  Searching for matches
  4202. for a regexp is a powerful operation that editors on Unix systems have
  4203. traditionally offered.  In GNU Emacs, you can search for the next match for
  4204. a regexp either incrementally or not.
  4205. <A NAME="IDX470"></A>
  4206. <A NAME="IDX471"></A>
  4207. <A NAME="IDX472"></A>
  4208.   Incremental search for a regexp is done by typing <KBD>M-C-s</KBD>
  4209. (<CODE>isearch-forward-regexp</CODE>).  This command reads a search string
  4210. incrementally just like <KBD>C-s</KBD>, but it treats the search string as a
  4211. regexp rather than looking for an exact match against the text in the
  4212. buffer.  Each time you add text to the search string, you make the regexp
  4213. longer, and the new regexp is searched for.  A reverse regexp search command
  4214. <CODE>isearch-backward-regexp</CODE> also exists, but no key runs it.
  4215.   All of the control characters that do special things within an ordinary
  4216. incremental search have the same functionality in incremental regexp search.
  4217. Typing <KBD>C-s</KBD> or <KBD>C-r</KBD> immediately after starting a search
  4218. retrieves the last incremental search regexp used:
  4219. incremental regexp and non-regexp searches have independent defaults.
  4220. <A NAME="IDX473"></A>
  4221. <A NAME="IDX474"></A>
  4222.   Non-incremental search for a regexp is done by the functions
  4223. <CODE>re-search-forward</CODE> and <CODE>re-search-backward</CODE>.  You can invoke
  4224. them with <KBD>M-x</KBD> or bind them to keys.  You can also call
  4225. <CODE>re-search-forward</CODE> by way of incremental regexp search with
  4226. <KBD>M-C-s <KBD>RET</KBD></KBD>.
  4227. <H2><A NAME="SEC99" HREF="xEMACS_TO.HTM#SEC99">Syntax of Regular Expressions</A></H2>
  4228. Regular expressions have a syntax in which a few characters are special
  4229. constructs and the rest are <DFN>ordinary</DFN>.  An ordinary character is a
  4230. simple regular expression which matches that character and nothing else.
  4231. The special characters are <SAMP>`$'</SAMP>, <SAMP>`^'</SAMP>, <SAMP>`.'</SAMP>, <SAMP>`*'</SAMP>,
  4232. <SAMP>`+'</SAMP>, <SAMP>`?'</SAMP>, <SAMP>`['</SAMP>, <SAMP>`]'</SAMP> and <SAMP>`\'</SAMP>; no new special
  4233. characters will be defined.  Any other character appearing in a regular
  4234. expression is ordinary, unless a <SAMP>`\'</SAMP> precedes it.<P>
  4235. For example, <SAMP>`f'</SAMP> is not a special character, so it is ordinary, and
  4236. therefore <SAMP>`f'</SAMP> is a regular expression that matches the string <SAMP>`f'</SAMP>
  4237. and no other string.  (It does <I>not</I> match the string <SAMP>`ff'</SAMP>.)  Likewise,
  4238. <SAMP>`o'</SAMP> is a regular expression that matches only <SAMP>`o'</SAMP>.<P>
  4239. Any two regular expressions <VAR>a</VAR> and <VAR>b</VAR> can be concatenated.  The
  4240. result is a regular expression which matches a string if <VAR>a</VAR> matches
  4241. some amount of the beginning of that string and <VAR>b</VAR> matches the rest of
  4242. the string.<P>
  4243. As a simple example, you can concatenate the regular expressions <SAMP>`f'</SAMP>
  4244. and <SAMP>`o'</SAMP> to get the regular expression <SAMP>`fo'</SAMP>, which matches only
  4245. the string <SAMP>`fo'</SAMP>.  To do something nontrivial, you
  4246. need to use one of the following special characters:
  4247. <DL COMPACT>
  4248. <DT><KBD>. (Period)</KBD>
  4249. <DD>is a special character that matches any single character except a newline.
  4250. Using concatenation, you can make regular expressions like <SAMP>`a.b'</SAMP>, which
  4251. matches any three-character string which begins with <SAMP>`a'</SAMP> and ends with
  4252. <SAMP>`b'</SAMP>.
  4253. <DT><KBD>*</KBD>
  4254. <DD>is not a construct by itself; it is a suffix, which means the
  4255. preceding regular expression is to be repeated as many times as
  4256. possible.  In <SAMP>`fo*'</SAMP>, the <SAMP>`*'</SAMP> applies to the <SAMP>`o'</SAMP>, so
  4257. <SAMP>`fo*'</SAMP> matches one <SAMP>`f'</SAMP> followed by any number of <SAMP>`o'</SAMP>s.
  4258. The case of zero <SAMP>`o'</SAMP>s is allowed: <SAMP>`fo*'</SAMP> does match
  4259. <SAMP>`f'</SAMP>.
  4260. <SAMP>`*'</SAMP> always applies to the <I>smallest</I> possible preceding
  4261. expression.  Thus, <SAMP>`fo*'</SAMP> has a repeating <SAMP>`o'</SAMP>, not a
  4262. repeating <SAMP>`fo'</SAMP>.
  4263. The matcher processes a <SAMP>`*'</SAMP> construct by immediately matching
  4264. as many repetitions as it can find.  Then it continues with the rest
  4265. of the pattern.  If that fails, backtracking occurs, discarding some
  4266. of the matches of the <SAMP>`*'</SAMP>-modified construct in case that makes
  4267. it possible to match the rest of the pattern.  For example, matching
  4268. <SAMP>`ca*ar'</SAMP> against the string <SAMP>`caaar'</SAMP>, the <SAMP>`a*'</SAMP> first
  4269. tries to match all three <SAMP>`a'</SAMP>s; but the rest of the pattern is
  4270. <SAMP>`ar'</SAMP> and there is only <SAMP>`r'</SAMP> left to match, so this try fails.
  4271. The next alternative is for <SAMP>`a*'</SAMP> to match only two <SAMP>`a'</SAMP>s.
  4272. With this choice, the rest of the regexp matches successfully.
  4273. <DT><KBD>+</KBD>
  4274. <DD>is a suffix character similar to <SAMP>`*'</SAMP> except that it requires that
  4275. the preceding expression be matched at least once.  For example,
  4276. <SAMP>`ca+r'</SAMP> will match the strings <SAMP>`car'</SAMP> and <SAMP>`caaaar'</SAMP>
  4277. but not the string <SAMP>`cr'</SAMP>, whereas <SAMP>`ca*r'</SAMP> would match all
  4278. three strings.
  4279. <DT><KBD>?</KBD>
  4280. <DD>is a suffix character similar to <SAMP>`*'</SAMP> except that it can match the
  4281. preceding expression either once or not at all.  For example,
  4282. <SAMP>`ca?r'</SAMP> will match <SAMP>`car'</SAMP> or <SAMP>`cr'</SAMP>; nothing else.
  4283. <DT><KBD>[ ... ]</KBD>
  4284. <DD><SAMP>`['</SAMP> begins a <DFN>character set</DFN>, which is terminated by a
  4285. <SAMP>`]'</SAMP>.  In the simplest case, the characters between the two form
  4286. the set.  Thus, <SAMP>`[ad]'</SAMP> matches either one <SAMP>`a'</SAMP> or one
  4287. <SAMP>`d'</SAMP>, and <SAMP>`[ad]*'</SAMP> matches any string composed of just
  4288. <SAMP>`a'</SAMP>s and <SAMP>`d'</SAMP>s (including the empty string), from which it
  4289. follows that <SAMP>`c[ad]*r'</SAMP> matches <SAMP>`cr'</SAMP>, <SAMP>`car'</SAMP>, <SAMP>`cdr'</SAMP>,
  4290. <SAMP>`caddaar'</SAMP>, etc.
  4291. You can include character ranges in a character set by writing
  4292. two characters with a <SAMP>`-'</SAMP> between them.  Thus, <SAMP>`[a-z]'</SAMP>
  4293. matches any lower-case letter.  Ranges may be intermixed freely with
  4294. individual characters, as in <SAMP>`[a-z$%.]'</SAMP>, which matches any lower-
  4295. case letter or <SAMP>`$'</SAMP>, <SAMP>`%'</SAMP>, or period.
  4296. Note that inside a character set the usual special characters are not
  4297. special any more.  A completely different set of special characters
  4298. exists inside character sets: <SAMP>`]'</SAMP>, <SAMP>`-'</SAMP>, and <SAMP>`^'</SAMP>.
  4299. To include a <SAMP>`]'</SAMP> in a character set, you must make it the first
  4300. character.  For example, <SAMP>`[]a]'</SAMP> matches <SAMP>`]'</SAMP> or <SAMP>`a'</SAMP>.  To
  4301. include a <SAMP>`-'</SAMP>, write <SAMP>`---'</SAMP>, which is a range containing only
  4302. <SAMP>`-'</SAMP>.  To include <SAMP>`^'</SAMP>, make it other than the first character
  4303. in the set.
  4304. <DT><KBD>[^ ... ]</KBD>
  4305. <DD><SAMP>`[^'</SAMP> begins a <DFN>complement character set</DFN>, which matches any
  4306. character except the ones specified.  Thus, <SAMP>`[^a-z0-9A-Z]'</SAMP>
  4307. matches all characters <I>except</I> letters and digits.
  4308. <SAMP>`^'</SAMP> is not special in a character set unless it is the first
  4309. character.  The character following the <SAMP>`^'</SAMP> is treated as if it
  4310. were first (<SAMP>`-'</SAMP> and <SAMP>`]'</SAMP> are not special there).
  4311. Note that a complement character set can match a newline, unless
  4312. newline is mentioned as one of the characters not to match.
  4313. <DT><KBD>^</KBD>
  4314. <DD>is a special character that matches the empty string, but only if at
  4315. the beginning of a line in the text being matched.  Otherwise, it fails
  4316. to match anything.  Thus, <SAMP>`^foo'</SAMP> matches a <SAMP>`foo'</SAMP> that occurs
  4317. at the beginning of a line.
  4318. <DT><KBD>$</KBD>
  4319. <DD>is similar to <SAMP>`^'</SAMP> but matches only at the end of a line.  Thus,
  4320. <SAMP>`xx*$'</SAMP> matches a string of one <SAMP>`x'</SAMP> or more at the end of a line.
  4321. <DT><KBD>\</KBD>
  4322. <DD>does two things: it quotes the special characters (including
  4323. <SAMP>`\'</SAMP>), and it introduces additional special constructs.
  4324. Because <SAMP>`\'</SAMP> quotes special characters, <SAMP>`\$'</SAMP> is a regular
  4325. expression that matches only <SAMP>`$'</SAMP>, and <SAMP>`\['</SAMP> is a regular
  4326. expression that matches only <SAMP>`['</SAMP>, and so on.</DL>
  4327. Note: for historical compatibility, special characters are treated as
  4328. ordinary ones if they are in contexts where their special meanings make no
  4329. sense.  For example, <SAMP>`*foo'</SAMP> treats <SAMP>`*'</SAMP> as ordinary since there is
  4330. no preceding expression on which the <SAMP>`*'</SAMP> can act.  It is poor practice
  4331. to depend on this behavior; better to quote the special character anyway,
  4332. regardless of where is appears.<P>
  4333. Usually, <SAMP>`\'</SAMP> followed by any character matches only
  4334. that character.  However, there are several exceptions: characters
  4335. which, when preceded by <SAMP>`\'</SAMP>, are special constructs.  Such
  4336. characters are always ordinary when encountered on their own.  Here
  4337. is a table of <SAMP>`\'</SAMP> constructs.
  4338. <DL COMPACT>
  4339. <DT><KBD>\|</KBD>
  4340. <DD>specifies an alternative.
  4341. Two regular expressions <VAR>a</VAR> and <VAR>b</VAR> with <SAMP>`\|'</SAMP> in
  4342. between form an expression that matches anything <VAR>a</VAR> or
  4343. <VAR>b</VAR> matches.
  4344. Thus, <SAMP>`foo\|bar'</SAMP> matches either <SAMP>`foo'</SAMP> or <SAMP>`bar'</SAMP>
  4345. but no other string.
  4346. <SAMP>`\|'</SAMP> applies to the largest possible surrounding expressions.  Only a
  4347. surrounding <SAMP>`\( ... \)'</SAMP> grouping can limit the grouping power of
  4348. <SAMP>`\|'</SAMP>.
  4349. Full backtracking capability exists to handle multiple uses of <SAMP>`\|'</SAMP>.
  4350. <DT><KBD>\( ... \)</KBD>
  4351. <DD>is a grouping construct that serves three purposes:
  4352. <DT><KBD></KBD>
  4353. <DD>To enclose a set of <SAMP>`\|'</SAMP> alternatives for other operations.
  4354. Thus, <SAMP>`\(foo\|bar\)x'</SAMP> matches either <SAMP>`foox'</SAMP> or <SAMP>`barx'</SAMP>.
  4355. <DT><KBD></KBD>
  4356. <DD>To enclose a complicated expression for the postfix <SAMP>`*'</SAMP> to operate on.
  4357. Thus, <SAMP>`ba\(na\)*'</SAMP> matches <SAMP>`bananana'</SAMP>, etc., with any (zero or
  4358. more) number of <SAMP>`na'</SAMP> strings.
  4359. <DT><KBD></KBD>
  4360. <DD>To mark a matched substring for future reference.
  4361. </OL>
  4362. This last application is not a consequence of the idea of a
  4363. parenthetical grouping; it is a separate feature which happens to be
  4364. assigned as a second meaning to the same <SAMP>`\( ... \)'</SAMP> construct
  4365. because in practice there is no conflict between the two meanings.
  4366. Here is an explanation:
  4367. <DT><KBD>\<VAR>digit</VAR></KBD>
  4368. <DD>after the end of a <SAMP>`\( ... \)'</SAMP> construct, the matcher remembers the
  4369. beginning and end of the text matched by that construct.  Then, later on
  4370. in the regular expression, you can use <SAMP>`\'</SAMP> followed by <VAR>digit</VAR>
  4371. to mean "match the same text matched the <VAR>digit</VAR>'th time by the
  4372. <SAMP>`\( ... \)'</SAMP> construct."
  4373. The strings matching the first nine <SAMP>`\( ... \)'</SAMP> constructs appearing
  4374. in a regular expression are assigned numbers 1 through 9 in order that the
  4375. open-parentheses appear in the regular expression.  <SAMP>`\1'</SAMP> through
  4376. <SAMP>`\9'</SAMP> may be used to refer to the text matched by the corresponding
  4377. <SAMP>`\( ... \)'</SAMP> construct.
  4378. For example, <SAMP>`\(.*\)\1'</SAMP> matches any newline-free string that is
  4379. composed of two identical halves.  The <SAMP>`\(.*\)'</SAMP> matches the first
  4380. half, which may be anything, but the <SAMP>`\1'</SAMP> that follows must match
  4381. the same exact text.
  4382. <DT><KBD>\`</KBD>
  4383. <DD>matches the empty string, provided it is at the beginning
  4384. of the buffer.
  4385. <DT><KBD>\'</KBD>
  4386. <DD>matches the empty string, provided it is at the end of
  4387. the buffer.
  4388. <DT><KBD>\b</KBD>
  4389. <DD>matches the empty string, provided it is at the beginning or
  4390. end of a word.  Thus, <SAMP>`\bfoo\b'</SAMP> matches any occurrence of
  4391. <SAMP>`foo'</SAMP> as a separate word.  <SAMP>`\bballs?\b'</SAMP> matches
  4392. <SAMP>`ball'</SAMP> or <SAMP>`balls'</SAMP> as a separate word.
  4393. <DT><KBD>\B</KBD>
  4394. <DD>matches the empty string, provided it is <I>not</I> at the beginning or
  4395. end of a word.
  4396. <DT><KBD>\<</KBD>
  4397. <DD>matches the empty string, provided it is at the beginning of a word.
  4398. <DT><KBD>\></KBD>
  4399. <DD>matches the empty string, provided it is at the end of a word.
  4400. <DT><KBD>\w</KBD>
  4401. <DD>matches any word-constituent character.  The editor syntax table
  4402. determines which characters these are.
  4403. <DT><KBD>\W</KBD>
  4404. <DD>matches any character that is not a word-constituent.
  4405. <DT><KBD>\s<VAR>code</VAR></KBD>
  4406. <DD>matches any character whose syntax is <VAR>code</VAR>.  <VAR>code</VAR> is a
  4407. character which represents a syntax code: thus, <SAMP>`w'</SAMP> for word
  4408. constituent, <SAMP>`-'</SAMP> for whitespace, <SAMP>`('</SAMP> for open-parenthesis,
  4409. etc.  See section <A HREF="xEMACS.HTM#SEC289">The Syntax Table</A>.
  4410. <DT><KBD>\S<VAR>code</VAR></KBD>
  4411. <DD>matches any character whose syntax is not <VAR>code</VAR>.
  4412. </DL>
  4413.   Here is a complicated regexp used by Emacs to recognize the end of a
  4414. sentence together with any whitespace that follows.  It is given in Lisp
  4415. syntax to enable you to distinguish the spaces from the tab characters.  In
  4416. Lisp syntax, the string constant begins and ends with a double-quote.
  4417. <SAMP>`\"'</SAMP> stands for a double-quote as part of the regexp, <SAMP>`\\'</SAMP> for a
  4418. backslash as part of the regexp, <SAMP>`\t'</SAMP> for a tab and <SAMP>`\n'</SAMP> for a
  4419. newline.
  4420. <PRE>
  4421. "[.?!][]\"')]*\\($\\|\t\\|  \\)[ \t\n]*"
  4422. </PRE>
  4423. This regexp contains four parts: a character set matching
  4424. period, <SAMP>`?'</SAMP> or <SAMP>`!'</SAMP>; a character set matching close-brackets,
  4425. quotes or parentheses, repeated any number of times; an alternative in
  4426. backslash-parentheses that matches end-of-line, a tab or two spaces; and
  4427. a character set matching whitespace characters, repeated any number of
  4428. times.
  4429. <H2><A NAME="SEC100" HREF="xEMACS_TO.HTM#SEC100">Searching and Case</A></H2>
  4430. <A NAME="IDX475"></A>
  4431.   All searches in Emacs normally ignore the case of the text they
  4432. are searching through; if you specify searching for <SAMP>`FOO'</SAMP>,
  4433. <SAMP>`Foo'</SAMP> and <SAMP>`foo'</SAMP> are also considered a match.  Regexps, and in
  4434. particular character sets, are included: <SAMP>`[aB]'</SAMP> matches <SAMP>`a'</SAMP>
  4435. or <SAMP>`A'</SAMP> or <SAMP>`b'</SAMP> or <SAMP>`B'</SAMP>.<P>
  4436.   If you want a case-sensitive search, set the variable
  4437. <CODE>case-fold-search</CODE> to <CODE>nil</CODE>.  Then all letters must match
  4438. exactly, including case. <CODE>case-fold-search</CODE> is a per-buffer
  4439. variable; altering it affects only the current buffer, but
  4440. there is a default value which you can change as well.  See section <A HREF="xEMACS.HTM#SEC278">Local Variables</A>. 
  4441. You can also use <B>Case Sensitive Search</B> from the <B>Options</B> menu 
  4442. on your screen.
  4443. <A NAME="IDX476"></A>
  4444. <A NAME="IDX477"></A>
  4445. <A NAME="IDX478"></A>
  4446. <H2><A NAME="SEC101" HREF="xEMACS_TO.HTM#SEC101">Replacement Commands</A></H2>
  4447.   Global search-and-replace operations are not needed as often in Emacs as
  4448. they are in other editors, but they are available.  In addition to the
  4449. simple <CODE>replace-string</CODE> command which is like that found in most
  4450. editors, there is a <CODE>query-replace</CODE> command which asks you, for each
  4451. occurrence of a pattern, whether to replace it.
  4452.   The replace commands all replace one string (or regexp) with one
  4453. replacement string.  It is possible to perform several replacements in
  4454. parallel using the command <CODE>expand-region-abbrevs</CODE>.  See section <A HREF="xEMACS.HTM#SEC232">Controlling Abbrev Expansion</A>.
  4455. <A NAME="IDX479"></A>
  4456. <A NAME="IDX480"></A>
  4457. <H3><A NAME="SEC102" HREF="xEMACS_TO.HTM#SEC102">Unconditional Replacement</A></H3>
  4458. <DL COMPACT>
  4459. <DT><KBD>M-x replace-string <KBD>RET</KBD> <VAR>string</VAR> <KBD>RET</KBD> <VAR>newstring</VAR> <KBD>RET</KBD></KBD>
  4460. <DD>Replace every occurrence of <VAR>string</VAR> with <VAR>newstring</VAR>.
  4461. <DT><KBD>M-x replace-regexp <KBD>RET</KBD> <VAR>regexp</VAR> <KBD>RET</KBD> <VAR>newstring</VAR> <KBD>RET</KBD></KBD>
  4462. <DD>Replace every match for <VAR>regexp</VAR> with <VAR>newstring</VAR>.
  4463. </DL>
  4464.   To replace every instance of <SAMP>`foo'</SAMP> after point with <SAMP>`bar'</SAMP>,
  4465. use the command <KBD>M-x replace-string</KBD> with the two arguments
  4466. <SAMP>`foo'</SAMP> and <SAMP>`bar'</SAMP>.  Replacement occurs only after point: if you
  4467. want to cover the whole buffer you must go to the beginning first.  By
  4468. default, all occurrences up to the end of the buffer are replaced.  To
  4469. limit replacement to part of the buffer, narrow to that part of the
  4470. buffer before doing the replacement (see section <A HREF="xEMACS.HTM#SEC265">Narrowing</A>).
  4471.   When <CODE>replace-string</CODE> exits, point is left at the last occurrence
  4472. replaced.  The value of point when the <CODE>replace-string</CODE> command was
  4473. issued is remembered on the mark ring; <KBD>C-u C-<KBD>SPC</KBD></KBD> moves back
  4474. there.
  4475.   A numeric argument restricts replacement to matches that are surrounded
  4476. by word boundaries.
  4477. <H3><A NAME="SEC103" HREF="xEMACS_TO.HTM#SEC103">Regexp Replacement</A></H3>
  4478.   <CODE>replace-string</CODE> replaces exact matches for a single string.  The
  4479. similar command <CODE>replace-regexp</CODE> replaces any match for a specified
  4480. pattern.
  4481.   In <CODE>replace-regexp</CODE>, the <VAR>newstring</VAR> need not be constant.  It
  4482. can refer to all or part of what is matched by the <VAR>regexp</VAR>.  <SAMP>`\&'</SAMP>
  4483. in <VAR>newstring</VAR> stands for the entire text being replaced.
  4484. <SAMP>`\<VAR>d</VAR>'</SAMP> in <VAR>newstring</VAR>, where <VAR>d</VAR> is a digit, stands for
  4485. whatever matched the <VAR>d</VAR>'th parenthesized grouping in <VAR>regexp</VAR>.
  4486. For example,<P>
  4487. <PRE>
  4488. M-x replace-regexp <KBD>RET</KBD> c[ad]+r <KBD>RET</KBD> \&-safe <KBD>RET</KBD>
  4489. </PRE>
  4490. would replace (for example) <SAMP>`cadr'</SAMP> with <SAMP>`cadr-safe'</SAMP> and <SAMP>`cddr'</SAMP>
  4491. with <SAMP>`cddr-safe'</SAMP>.
  4492. <PRE>
  4493. M-x replace-regexp <KBD>RET</KBD> \(c[ad]+r\)-safe <KBD>RET</KBD> \1 <KBD>RET</KBD>
  4494. </PRE>
  4495. would perform exactly the opposite replacements.  To include a <SAMP>`\'</SAMP>
  4496. in the text to replace with, you must give <SAMP>`\\'</SAMP>.
  4497. <H3><A NAME="SEC104" HREF="xEMACS_TO.HTM#SEC104">Replace Commands and Case</A></H3>
  4498. <A NAME="IDX481"></A>
  4499. <A NAME="IDX482"></A>
  4500.   If the arguments to a replace command are in lower case, the command
  4501. preserves case when it makes a replacement.  Thus, the following command:
  4502. <PRE>
  4503. M-x replace-string <KBD>RET</KBD> foo <KBD>RET</KBD> bar <KBD>RET</KBD>
  4504. </PRE>
  4505. replaces a lower-case <SAMP>`foo'</SAMP> with a lower case <SAMP>`bar'</SAMP>, <SAMP>`FOO'</SAMP>
  4506. with <SAMP>`BAR'</SAMP>, and <SAMP>`Foo'</SAMP> with <SAMP>`Bar'</SAMP>.  If upper-case letters are
  4507. used in the second argument, they remain upper-case every time that
  4508. argument is inserted.  If upper-case letters are used in the first
  4509. argument, the second argument is always substituted exactly as given, with
  4510. no case conversion.  Likewise, if the variable <CODE>case-replace</CODE> is set
  4511. to <CODE>nil</CODE>, replacement is done without case conversion.  If
  4512. <CODE>case-fold-search</CODE> is set to <CODE>nil</CODE>, case is significant in
  4513. matching occurrences of <SAMP>`foo'</SAMP> to replace; also, case conversion of the
  4514. replacement string is not done.
  4515. <A NAME="IDX483"></A>
  4516. <H3><A NAME="SEC105" HREF="xEMACS_TO.HTM#SEC105">Query Replace</A></H3>
  4517. <DL COMPACT>
  4518. <DT><KBD>M-% <VAR>string</VAR> <KBD>RET</KBD> <VAR>newstring</VAR> <KBD>RET</KBD></KBD>
  4519. <DD><DT><KBD>M-x query-replace <KBD>RET</KBD> <VAR>string</VAR> <KBD>RET</KBD> <VAR>newstring</VAR> <KBD>RET</KBD></KBD>
  4520. <DD>Replace some occurrences of <VAR>string</VAR> with <VAR>newstring</VAR>.
  4521. <DT><KBD>M-x query-replace-regexp <KBD>RET</KBD> <VAR>regexp</VAR> <KBD>RET</KBD> <VAR>newstring</VAR> <KBD>RET</KBD></KBD>
  4522. <DD>Replace some matches for <VAR>regexp</VAR> with <VAR>newstring</VAR>.
  4523. </DL>
  4524. <A NAME="IDX484"></A>
  4525. <A NAME="IDX485"></A>
  4526.   If you want to change only some of the occurrences of <SAMP>`foo'</SAMP> to
  4527. <SAMP>`bar'</SAMP>, not all of them, you can use <CODE>query-replace</CODE> instead of
  4528. <KBD>M-%</KBD>.  This command finds occurrences of <SAMP>`foo'</SAMP> one by one,
  4529. displays each occurrence, and asks you whether to replace it.  A numeric
  4530. argument to <CODE>query-replace</CODE> tells it to consider only occurrences
  4531. that are bounded by word-delimiter characters.<A NAME="IDX486"></A>
  4532.   Aside from querying, <CODE>query-replace</CODE> works just like
  4533. <CODE>replace-string</CODE>, and <CODE>query-replace-regexp</CODE> works
  4534. just like <CODE>replace-regexp</CODE>.<P>
  4535.   The things you can type when you are shown an occurrence of <VAR>string</VAR>
  4536. or a match for <VAR>regexp</VAR> are:
  4537. <A NAME="IDX487"></A>
  4538. <A NAME="IDX488"></A>
  4539. <A NAME="IDX489"></A>
  4540. <A NAME="IDX490"></A>
  4541. <A NAME="IDX491"></A>
  4542. <A NAME="IDX492"></A>
  4543. <A NAME="IDX493"></A>
  4544. <A NAME="IDX494"></A>
  4545. <A NAME="IDX495"></A>
  4546. <A NAME="IDX496"></A>
  4547. <DL COMPACT>
  4548. <DT><KBD><KBD>SPC</KBD></KBD>
  4549. <DD>to replace the occurrence with <VAR>newstring</VAR>.  This preserves case, just
  4550. like <CODE>replace-string</CODE>, provided <CODE>case-replace</CODE> is non-<CODE>nil</CODE>,
  4551. as it normally is.
  4552. <DT><KBD><KBD>DEL</KBD></KBD>
  4553. <DD>to skip to the next occurrence without replacing this one.
  4554. <DT><KBD>, (Comma)</KBD>
  4555. <DD>to replace this occurrence and display the result.  You are then
  4556. prompted for another input character.  However, since the replacement has
  4557. already been made, <KBD>DEL</KBD> and <KBD>SPC</KBD> are equivalent.  At this
  4558. point, you can type <KBD>C-r</KBD> (see below) to alter the replaced text.  To
  4559. undo the replacement, you can type <KBD>C-x u</KBD>. 
  4560. This exits the <CODE>query-replace</CODE>.  If you want to do further
  4561. replacement you must use <KBD>C-x ESC</KBD> to restart (see section <A HREF="xEMACS.HTM#SEC53">Repeating Minibuffer Commands</A>).
  4562. <DT><KBD><KBD>ESC</KBD></KBD>
  4563. <DD>to exit without doing any more replacements.
  4564. <DT><KBD>. (Period)</KBD>
  4565. <DD>to replace this occurrence and then exit.
  4566. <DT><KBD>!</KBD>
  4567. <DD>to replace all remaining occurrences without asking again.
  4568. <DT><KBD>^</KBD>
  4569. <DD>to go back to the location of the previous occurrence (or what used to
  4570. be an occurrence), in case you changed it by mistake.  This works by
  4571. popping the mark ring.  Only one <KBD>^</KBD> in a row is allowed, because
  4572. only one previous replacement location is kept during <CODE>query-replace</CODE>.
  4573. <DT><KBD>C-r</KBD>
  4574. <DD>to enter a recursive editing level, in case the occurrence needs to be
  4575. edited rather than just replaced with <VAR>newstring</VAR>.  When you are
  4576. done, exit the recursive editing level with <KBD>C-M-c</KBD> and the next
  4577. occurrence will be displayed.  See section <A HREF="xEMACS.HTM#SEC267">Recursive Editing Levels</A>.
  4578. <DT><KBD>C-w</KBD>
  4579. <DD>to delete the occurrence, and then enter a recursive editing level as
  4580. in <KBD>C-r</KBD>.  Use the recursive edit to insert text to replace the
  4581. deleted occurrence of <VAR>string</VAR>.  When done, exit the recursive
  4582. editing level with <KBD>C-M-c</KBD> and the next occurrence will be
  4583. displayed.
  4584. <DT><KBD>C-l</KBD>
  4585. <DD>to redisplay the screen and then give another answer.
  4586. <DT><KBD>C-h</KBD>
  4587. <DD>to display a message summarizing these options, then give another
  4588. answer.
  4589. </DL>
  4590.   If you type any other character, Emacs exits the <CODE>query-replace</CODE>, and
  4591. executes the character as a command.  To restart the <CODE>query-replace</CODE>,
  4592. use <KBD>C-x <KBD>ESC</KBD></KBD>, which repeats the <CODE>query-replace</CODE> because it
  4593. used the minibuffer to read its arguments.  See section <A HREF="xEMACS.HTM#SEC53">Repeating Minibuffer Commands</A>.
  4594. <H2><A NAME="SEC106" HREF="xEMACS_TO.HTM#SEC106">Other Search-and-Loop Commands</A></H2>
  4595.   Here are some other commands that find matches for a regular expression.
  4596. They all operate from point to the end of the buffer.
  4597. <A NAME="IDX497"></A>
  4598. <A NAME="IDX498"></A>
  4599. <A NAME="IDX499"></A>
  4600. <A NAME="IDX500"></A>
  4601. <A NAME="IDX501"></A>
  4602. <DL COMPACT>
  4603. <DT><KBD>M-x occur</KBD>
  4604. <DD>Print each line that follows point and contains a match for the
  4605. specified regexp.  A numeric argument specifies the number of context
  4606. lines to print before and after each matching line; the default is
  4607. none.
  4608. <A NAME="IDX502"></A>
  4609. The buffer <SAMP>`*Occur*'</SAMP> containing the output serves as a menu for
  4610. finding occurrences in their original context.  Find an occurrence
  4611. as listed in <SAMP>`*Occur*'</SAMP>, position point there, and type <KBD>C-c
  4612. C-c</KBD>; this switches to the buffer that was searched and moves point to
  4613. the original of the same occurrence.
  4614. <DT><KBD>M-x list-matching-lines</KBD>
  4615. <DD>Synonym for <KBD>M-x occur</KBD>.
  4616. <DT><KBD>M-x count-matches</KBD>
  4617. <DD>Print the number of matches following point for the specified regexp.
  4618. <DT><KBD>M-x delete-non-matching-lines</KBD>
  4619. <DD>Delete each line that follows point and does not contain a match for
  4620. the specified regexp.
  4621. <DT><KBD>M-x delete-matching-lines</KBD>
  4622. <DD>Delete each line that follows point and contains a match for the
  4623. specified regexp.
  4624. </DL>
  4625. <A NAME="IDX503"></A>
  4626. <A NAME="IDX504"></A>
  4627. <H1><A NAME="SEC107" HREF="xEMACS_TO.HTM#SEC107">Commands for Fixing Typos</A></H1>
  4628.   This chapter describes commands that are especially useful when you
  4629. catch a mistake in your text just after you have made it, or when you 
  4630. change your mind while composing text on line.
  4631. <H2><A NAME="SEC108" HREF="xEMACS_TO.HTM#SEC108">Killing Your Mistakes</A></H2>
  4632. <DL COMPACT>
  4633. <DT><KBD><KBD>DEL</KBD></KBD>
  4634. <DD>Delete last character (<CODE>delete-backward-char</CODE>).
  4635. <DT><KBD>M-<KBD>DEL</KBD></KBD>
  4636. <DD>Kill last word (<CODE>backward-kill-word</CODE>).
  4637. <DT><KBD>C-x <KBD>DEL</KBD></KBD>
  4638. <DD>Kill to beginning of sentence (<CODE>backward-kill-sentence</CODE>).
  4639. </DL>
  4640. <A NAME="IDX505"></A>
  4641. <A NAME="IDX506"></A>
  4642.   The <KBD>DEL</KBD> character (<CODE>delete-backward-char</CODE>) is the most
  4643. important correction command.  When used among graphic (self-inserting)
  4644. characters, it can be thought of as canceling the last character typed.
  4645. <A NAME="IDX507"></A>
  4646. <A NAME="IDX508"></A>
  4647. <A NAME="IDX509"></A>
  4648. <A NAME="IDX510"></A>
  4649.   When your mistake is longer than a couple of characters, it might be more
  4650. convenient to use <KBD>M-<KBD>DEL</KBD></KBD> or <KBD>C-x <KBD>DEL</KBD></KBD>.
  4651. <KBD>M-<KBD>DEL</KBD></KBD> kills back to the start of the last word, and <KBD>C-x
  4652. <KBD>DEL</KBD></KBD> kills back to the start of the last sentence.  <KBD>C-x
  4653. <KBD>DEL</KBD></KBD> is particularly useful when you are thinking of what to write as
  4654. you type it, in case you change your mind about phrasing.
  4655. <KBD>M-<KBD>DEL</KBD></KBD> and <KBD>C-x <KBD>DEL</KBD></KBD> save the killed text for
  4656. <KBD>C-y</KBD> and <KBD>M-y</KBD> to retrieve.  See section <A HREF="xEMACS.HTM#SEC73">Yanking</A>.<P>
  4657.   <KBD>M-<KBD>DEL</KBD></KBD> is often useful even when you have typed only a few
  4658. characters wrong, if you know you are confused in your typing and aren't
  4659. sure exactly what you typed.  At such a time, you cannot correct with
  4660. <KBD>DEL</KBD> except by looking at the screen to see what you did.  It requires
  4661. less thought to kill the whole word and start over.
  4662. <H2><A NAME="SEC109" HREF="xEMACS_TO.HTM#SEC109">Transposing Text</A></H2>
  4663. <DL COMPACT>
  4664. <DT><KBD>C-t</KBD>
  4665. <DD>Transpose two characters (<CODE>transpose-chars</CODE>).
  4666. <DT><KBD>M-t</KBD>
  4667. <DD>Transpose two words (<CODE>transpose-words</CODE>).
  4668. <DT><KBD>C-M-t</KBD>
  4669. <DD>Transpose two balanced expressions (<CODE>transpose-sexps</CODE>).
  4670. <DT><KBD>C-x C-t</KBD>
  4671. <DD>Transpose two lines (<CODE>transpose-lines</CODE>).
  4672. </DL>
  4673. <A NAME="IDX511"></A>
  4674. <A NAME="IDX512"></A>
  4675. <A NAME="IDX513"></A>
  4676.   The common error of transposing two adjacent characters can be fixed
  4677. with the <KBD>C-t</KBD> command (<CODE>transpose-chars</CODE>).  Normally,
  4678. <KBD>C-t</KBD> transposes the two characters on either side of point.  When
  4679. given at the end of a line, <KBD>C-t</KBD> transposes the last two characters
  4680. on the line, rather than transposing the last character of the line with
  4681. the newline, which would be useless.  If you catch a
  4682. transposition error right away, you can fix it with just <KBD>C-t</KBD>.
  4683. If you catch the error later,  move the cursor back to between
  4684. the two transposed characters.  If you transposed a space with the last
  4685. character of the word before it, the word motion commands are a good way
  4686. of getting there.  Otherwise, a reverse search (<KBD>C-r</KBD>) is often the
  4687. best way.  See section <A HREF="xEMACS.HTM#SEC93">Searching and Replacement</A>.
  4688. <A NAME="IDX514"></A>
  4689. <A NAME="IDX515"></A>
  4690. <A NAME="IDX516"></A>
  4691. <A NAME="IDX517"></A>
  4692. <A NAME="IDX518"></A>
  4693. <A NAME="IDX519"></A>
  4694.   <KBD>Meta-t</KBD> (<CODE>transpose-words</CODE>) transposes the word before point
  4695. with the word after point.  It moves point forward over a word, dragging
  4696. the word preceding or containing point forward as well.  The punctuation
  4697. characters between the words do not move.  For example, <SAMP>`FOO, BAR'</SAMP>
  4698. transposes into <SAMP>`BAR, FOO'</SAMP> rather than <SAMP>`BAR FOO,'</SAMP>.
  4699.   <KBD>C-M-t</KBD> (<CODE>transpose-sexps</CODE>) is a similar command for transposing
  4700. two expressions (see section <A HREF="xEMACS.HTM#SEC186">Lists and Sexps</A>), and <KBD>C-x C-t</KBD> (<CODE>transpose-lines</CODE>)
  4701. exchanges lines.  It works like <KBD>M-t</KBD> but in determines the
  4702. division of the text into syntactic units differently.
  4703.   A numeric argument to a transpose command serves as a repeat count: it
  4704. tells the transpose command to move the character (word, sexp, line) before
  4705. or containing point across several other characters (words, sexps, lines).
  4706. For example, <KBD>C-u 3 C-t</KBD> moves the character before point forward
  4707. across three other characters.  This is equivalent to repeating <KBD>C-t</KBD>
  4708. three times.  <KBD>C-u - 4 M-t</KBD> moves the word before point backward across
  4709. four words.  <KBD>C-u - C-M-t</KBD> would cancel the effect of plain
  4710. <KBD>C-M-t</KBD>.<P>
  4711.   A numeric argument of zero transposes the character (word, sexp, line)
  4712. ending after point with the one ending after the mark (otherwise a
  4713. command with a repeat count of zero would do nothing).
  4714. <H2><A NAME="SEC110" HREF="xEMACS_TO.HTM#SEC110">Case Conversion</A></H2>
  4715. <DL COMPACT>
  4716. <DT><KBD>M-- M-l</KBD>
  4717. <DD>Convert last word to lower case.  Note that <KBD>Meta--</KBD> is "Meta-minus."
  4718. <DT><KBD>M-- M-u</KBD>
  4719. <DD>Convert last word to all upper case.
  4720. <DT><KBD>M-- M-c</KBD>
  4721. <DD>Convert last word to lower case with capital initial.
  4722. </DL>
  4723. <A NAME="IDX520"></A>
  4724. <A NAME="IDX521"></A>
  4725. <A NAME="IDX522"></A>
  4726. <A NAME="IDX523"></A>
  4727. <A NAME="IDX524"></A>
  4728. <A NAME="IDX525"></A>
  4729. <A NAME="IDX526"></A>
  4730. <A NAME="IDX527"></A>
  4731.   A  common error is to type words in the wrong case.  Because of this,
  4732. the word case-conversion commands <KBD>M-l</KBD>, <KBD>M-u</KBD>, and <KBD>M-c</KBD> do
  4733. not move the cursor when used with a negative argument.
  4734. As soon as you see you have mistyped the last word, you can simply
  4735. case-convert it and continue typing.  See section <A HREF="xEMACS.HTM#SEC183">Case Conversion Commands</A>.<P>
  4736. <A NAME="IDX528"></A>
  4737. <H2><A NAME="SEC111" HREF="xEMACS_TO.HTM#SEC111">Checking and Correcting Spelling</A></H2>
  4738. <DL COMPACT>
  4739. <DT><KBD>M-$</KBD>
  4740. <DD>Check and correct spelling of word (<CODE>spell-word</CODE>).
  4741. <DT><KBD>M-x spell-buffer</KBD>
  4742. <DD>Check and correct spelling of each word in the buffer.
  4743. <DT><KBD>M-x spell-region</KBD>
  4744. <DD>Check and correct spelling of each word in the region.
  4745. <DT><KBD>M-x spell-string</KBD>
  4746. <DD>Check spelling of specified word.
  4747. </DL>
  4748. <A NAME="IDX529"></A>
  4749. <A NAME="IDX530"></A>
  4750.   To check the spelling of the word before point, and optionally correct
  4751. it, use the command <KBD>M-$</KBD> (<CODE>spell-word</CODE>).  This command runs an
  4752. inferior process containing the <CODE>spell</CODE> program to see whether the
  4753. word is correct English.  If it is not, it asks you to edit the word (in
  4754. the minibuffer) into a corrected spelling, and then performs a
  4755. <CODE>query-replace</CODE> to substitute the corrected spelling for the old
  4756. one throughout the buffer.
  4757.   If you exit the minibuffer without altering the original spelling, it
  4758. means you do not want to do anything to that word.  In that case, the
  4759. <CODE>query-replace</CODE> is not done.
  4760. <A NAME="IDX531"></A>
  4761.   <KBD>M-x spell-buffer</KBD> checks each word in the buffer the same way that
  4762. <CODE>spell-word</CODE> does, doing a <CODE>query-replace</CODE> for
  4763. every incorrect word if appropriate.<A NAME="IDX532"></A>
  4764.   <KBD>M-x spell-region</KBD> is similar to <CODE>spell-buffer</CODE> but operates
  4765. only on the region, not the entire buffer.
  4766. <A NAME="IDX533"></A>
  4767.   <KBD>M-x spell-string</KBD> reads a string as an argument and checks
  4768. whether that is a correctly spelled English word.  It prints a message
  4769. giving the answer in the echo area.
  4770. <A NAME="IDX534"></A>
  4771. <H1><A NAME="SEC112" HREF="xEMACS_TO.HTM#SEC112">File Handling</A></H1>
  4772.   The basic unit of stored data in Unix is the <DFN>file</DFN>.  To edit a file,
  4773. you must tell Emacs to examine the file and prepare a buffer containing a
  4774. copy of the file's text.  This is called <DFN>visiting</DFN> the file.  Editing
  4775. commands apply directly to text in the buffer; that is, to the copy inside
  4776. Emacs.  Your changes appear in the file itself only when you <DFN>save</DFN> the
  4777. buffer back into the file.
  4778.   In addition to visiting and saving files, Emacs can delete, copy, rename,
  4779. and append to files, and operate on file directories.
  4780. <A NAME="IDX535"></A>
  4781. <H2><A NAME="SEC113" HREF="xEMACS_TO.HTM#SEC113">File Names</A></H2>
  4782.   Most Emacs commands that operate on a file require you to specify the
  4783. file name.  (Saving and reverting are exceptions; the buffer knows which
  4784. file name to use for them.)  File names are specified in the minibuffer
  4785. (see section <A HREF="xEMACS.HTM#SEC47">The Minibuffer</A>).  <DFN>Completion</DFN> is available, to make it easier to
  4786. specify long file names.  See section <A HREF="xEMACS.HTM#SEC50">Completion</A>.
  4787.   There is always a <DFN>default file name</DFN> which is used if you
  4788. enter an empty argument by typing just <KBD>RET</KBD>.  Normally the default
  4789. file name is the name of the file visited in the current buffer; this
  4790. makes it easy to operate on that file with any of the Emacs file
  4791. commands.
  4792. <A NAME="IDX536"></A>
  4793.   Each buffer has a default directory, normally the same as the
  4794. directory of the file visited in that buffer.  When Emacs reads a file
  4795. name, the default directory is used if you do not specify a directory.
  4796. If you specify a directory in a relative fashion, with a name that does
  4797. not start with a slash, it is interpreted with respect to the default
  4798. directory.  The default directory of the current buffer is kept in the
  4799. variable <CODE>default-directory</CODE>, which has a separate value in every
  4800. buffer.  The value of the variable should end with a slash.
  4801.   For example, if the default file name is <TT>`/u/rms/gnu/gnu.tasks'</TT> then
  4802. the default directory is <TT>`/u/rms/gnu/'</TT>.  If you type just <SAMP>`foo'</SAMP>,
  4803. which does not specify a directory, it is short for <TT>`/u/rms/gnu/foo'</TT>.
  4804. <SAMP>`../.login'</SAMP> would stand for <TT>`/u/rms/.login'</TT>.  <SAMP>`new/foo'</SAMP>
  4805. would stand for the filename <TT>`/u/rms/gnu/new/foo'</TT>.
  4806. <A NAME="IDX537"></A>
  4807. The variable <CODE>default-directory-alist</CODE> takes an alist of major
  4808. modes and their opinions on <CODE>default-directory</CODE> as a Lisp
  4809. expression to evaluate.  A resulting value of <CODE>nil</CODE> is ignored in
  4810. favor of <CODE>default-directory</CODE>.
  4811. <A NAME="IDX538"></A>
  4812. <A NAME="IDX539"></A>
  4813. <A NAME="IDX540"></A>
  4814. <A NAME="IDX541"></A>
  4815. You can create a new directory with the function <CODE>make-directory</CODE>,
  4816. which takes as an argument a file name string. The current directory is
  4817. displayed in the minibuffer when the function is called; you can delete
  4818. the old directory name and supply a new directory name. For example, if
  4819. the current directory is <TT>`/u/rms/gnu'</TT>, you can delete <TT>`gnu'</TT>
  4820. and type <TT>`oryx'</TT> and <KBD>RET</KBD> to create <TT>`/u/rms/oryx'</TT>.
  4821. Removing a directory is similar to creating one.  To remove a directory,
  4822. use <CODE>remove-directory</CODE>; it takes one argument, a file name string.
  4823.   The command <KBD>M-x pwd</KBD> prints the current buffer's default directory,
  4824. and the command <KBD>M-x cd</KBD> sets it (to a value read using the
  4825. minibuffer).  A buffer's default directory changes only when the <CODE>cd</CODE>
  4826. command is used.  A file-visiting buffer's default directory is initialized
  4827. to the directory of the file that is visited there.  If a buffer is created
  4828. with <KBD>C-x b</KBD>, its default directory is copied from that of the
  4829. buffer that was current at the time.
  4830. <A NAME="IDX542"></A>
  4831.   The default directory name actually appears in the minibuffer when the
  4832. minibuffer becomes active to read a file name.  This serves two
  4833. purposes: it shows you what the default is, so that you can type a
  4834. relative file name and know with certainty what it will mean, and it
  4835. allows you to edit the default to specify a different directory.  To
  4836. inhibit the insertion of the default directory, set the variable
  4837. <CODE>insert-default-directory</CODE> to <CODE>nil</CODE>.
  4838.   Note that it is legitimate to type an absolute file name after you
  4839. enter the minibuffer, ignoring the presence of the default directory
  4840. name.  The final minibuffer contents may look invalid, but that is not
  4841. so.  See section <A HREF="xEMACS.HTM#SEC48">Minibuffers for File Names</A>.
  4842.   <SAMP>`$'</SAMP> in a file name is used to substitute environment variables.  For
  4843. example, if you have used the shell command <SAMP>`setenv FOO rms/hacks'</SAMP> to
  4844. set up an environment variable named <SAMP>`FOO'</SAMP>, then you can use
  4845. <TT>`/u/$FOO/test.c'</TT> or <TT>`/u/${FOO}/test.c'</TT> as an abbreviation for
  4846. <TT>`/u/rms/hacks/test.c'</TT>.  The environment variable name consists of all
  4847. the alphanumeric characters after the <SAMP>`$'</SAMP>; alternatively, it may be
  4848. enclosed in braces after the <SAMP>`$'</SAMP>.  Note that the <SAMP>`setenv'</SAMP> command
  4849. affects Emacs only if done before Emacs is started.
  4850.   To access a file with <SAMP>`$'</SAMP> in its name, type <SAMP>`$$'</SAMP>.  This pair
  4851. is converted to a single <SAMP>`$'</SAMP> at the same time variable substitution
  4852. is performed for single <SAMP>`$'</SAMP>.  The Lisp function that performs the
  4853. substitution is called <CODE>substitute-in-file-name</CODE>.  The substitution
  4854. is performed only on filenames read as such using the minibuffer.
  4855. <A NAME="IDX543"></A>
  4856. <H2><A NAME="SEC114" HREF="xEMACS_TO.HTM#SEC114">Visiting Files</A></H2>
  4857. <DL COMPACT>
  4858. <DT><KBD>C-x C-f</KBD>
  4859. <DD>Visit a file (<CODE>find-file</CODE>).
  4860. <DT><KBD>C-x C-v</KBD>
  4861. <DD>Visit a different file instead of the one visited last
  4862. (<CODE>find-alternate-file</CODE>).
  4863. <DT><KBD>C-x 4 C-f</KBD>
  4864. <DD>Visit a file, in another window (<CODE>find-file-other-window</CODE>).  Don't
  4865. change this window.
  4866. <DT><KBD>C-x 5 C-f</KBD>
  4867. <DD>Visit a file, in another screen (<CODE>find-file-other-screen</CODE>).  Don't
  4868. change this window or screen.
  4869. </DL>
  4870. <A NAME="IDX544"></A>
  4871. <A NAME="IDX545"></A>
  4872. <A NAME="IDX546"></A>
  4873.   <DFN>Visiting</DFN> a file means copying its contents into an Emacs buffer
  4874. so you can edit it.  Emacs creates a new buffer for each file you
  4875. visit.  We say that the buffer is visiting the file that it was created
  4876. to hold.  Emacs constructs the buffer name from the file name by
  4877. throwing away the directory and keeping just the file name.  For example,
  4878. a file named <TT>`/usr/rms/emacs.tex'</TT> is displayed in a buffer named
  4879. <SAMP>`emacs.tex'</SAMP>.  If a buffer with that name exists, a unique
  4880. name is constructed by appending <SAMP>`<2>'</SAMP>, <SAMP>`<3>'</SAMP>,and so on, using
  4881. the lowest number that makes a name that is not already in use.
  4882.   Each window's mode line shows the name of the buffer that is being displayed
  4883. in that window, so you can always tell what buffer you are editing.
  4884.   The changes you make with Emacs are made in the Emacs buffer.  They do
  4885. not take effect in the file that you visit, or any other permanent
  4886. place, until you <DFN>save</DFN> the buffer.  Saving the buffer means that
  4887. Emacs writes the current contents of the buffer into its visited file.
  4888. See section <A HREF="xEMACS.HTM#SEC115">Saving Files</A>.
  4889. <A NAME="IDX547"></A>
  4890.   If a buffer contains changes that have not been saved, the buffer is said
  4891. to be <DFN>modified</DFN>.  This is important because it implies that some
  4892. changes will be lost if the buffer is not saved.  The mode line displays
  4893. two stars near the left margin if the buffer is modified.
  4894. <A NAME="IDX548"></A>
  4895. <A NAME="IDX549"></A>
  4896. <A NAME="IDX550"></A>
  4897.   To visit a file, use the command <KBD>C-x C-f</KBD> (<CODE>find-file</CODE>).  Follow
  4898. the command with the name of the file you wish to visit, terminated by a
  4899. <KBD>RET</KBD>.  If you are using Lucid GNU Emacs under X, you can also use the
  4900. <B>Open...</B> command from the <B>File</B> menu bar item. 
  4901.   The file name is read using the minibuffer (see section <A HREF="xEMACS.HTM#SEC47">The Minibuffer</A>), with
  4902. defaulting and completion in the standard manner (see section <A HREF="xEMACS.HTM#SEC113">File Names</A>).
  4903. While in the minibuffer, you can abort <KBD>C-x C-f</KBD> by typing <KBD>C-g</KBD>.
  4904.   <KBD>C-x C-f</KBD> has completed successfully when text appears on the
  4905. screen and a new buffer name appears in the mode line.  If the specified
  4906. file does not exist and could not be created or cannot be read, an error
  4907. results.  The error message is printed in the echo area, and includes
  4908. the name of the file that Emacs was trying to visit.
  4909.   If you visit a file that is already in Emacs, <KBD>C-x C-f</KBD> does not make
  4910. another copy.  It selects the existing buffer containing that file.
  4911. However, before doing so, it checks that the file itself has not changed
  4912. since you visited or saved it last.  If the file has changed, Emacs
  4913. prints a warning message.  See section <A HREF="xEMACS.HTM#SEC120">Protection Against Simultaneous Editing</A>.
  4914. <A NAME="IDX551"></A>
  4915. You can switch to a specific file called out in the current buffer by
  4916. calling the function <CODE>find-this-file</CODE>. By providing a prefix
  4917. argument, this function calls <CODE>filename-at-point</CODE> and switches to a
  4918. buffer visiting the file <VAR>filename</VAR>. It creates one if none already
  4919. exists. You can use this function to edit the file mentioned in the
  4920. buffer you are working in or to test if the file exists. You can do that
  4921. by using the minibuffer completion after snatching the all or part of
  4922. the filename.
  4923. <A NAME="IDX552"></A>
  4924. <A NAME="IDX553"></A>
  4925. If the variable <CODE>find-file-use-truenames</CODE>'s value is
  4926. non-<CODE>nil</CODE>, a buffer's visited filename will always be traced back
  4927. to the real file. The filename will never be a symbolic link, and there
  4928. will never be a symbolic link anywhere in its directory path. In other
  4929. words, the <CODE>buffer-file-name</CODE> and <CODE>buffer-file-truename</CODE> will
  4930. be equal.
  4931. <A NAME="IDX554"></A>
  4932. <A NAME="IDX555"></A>
  4933. If the variable <CODE>find-file-compare-truenames</CODE> value is
  4934. non-<CODE>nil</CODE>, the <CODE>find-file</CODE> command will check the
  4935. <CODE>buffer-file-truename</CODE> of all visited files when deciding whether a
  4936. given file is already in a buffer, instead of just
  4937. <CODE>buffer-file-name</CODE>.  If you attempt to visit another file which is
  4938. a hard-link or symbolic-link to a file that is already in a buffer, the
  4939. existing buffer will be found instead of a newly created one.
  4940. <A NAME="IDX556"></A>
  4941.    If you want to create a file, just visit it.  Emacs prints
  4942. <SAMP>`(New File)'</SAMP> in the echo area, but in other respects behaves as if you
  4943. had visited an existing empty file.  If you make any changes and save them,
  4944. the file is created.
  4945. <A NAME="IDX557"></A>
  4946. <A NAME="IDX558"></A>
  4947.   If you visit a nonexistent file unintentionally (because you typed the
  4948. wrong file name), use the <KBD>C-x C-v</KBD> (<CODE>find-alternate-file</CODE>)
  4949. command to visit the file you wanted.  <KBD>C-x C-v</KBD> is similar to <KBD>C-x
  4950. C-f</KBD>, but it kills the current buffer (after first offering to save it if
  4951. it is modified).  <KBD>C-x C-v</KBD> is allowed even if the current buffer
  4952. is not visiting a file.
  4953. <A NAME="IDX559"></A>
  4954.   If the file you specify is actually a directory, Dired is called on
  4955. that directory (see section <A HREF="xEMACS.HTM#SEC141">Dired, the Directory Editor</A>).  To inhibit this, set the variable
  4956. <CODE>find-file-run-dired</CODE> to <CODE>nil</CODE>; then it is an error to try to
  4957. visit a directory.
  4958. <A NAME="IDX560"></A>
  4959. <A NAME="IDX561"></A>
  4960.   <KBD>C-x 4 f</KBD> (<CODE>find-file-other-window</CODE>) is like <KBD>C-x C-f</KBD>
  4961. except that the buffer containing the specified file is selected in another
  4962. window.  The window that was selected before <KBD>C-x 4 f</KBD> continues to
  4963. show the same buffer it was already showing.  If you use this command when
  4964. only one window is being displayed, that window is split in two, with one
  4965. window showing the same buffer as before, and the other one showing the
  4966. newly requested file.  See section <A HREF="xEMACS.HTM#SEC153">Multiple Windows</A>.
  4967. <A NAME="IDX562"></A>
  4968. <A NAME="IDX563"></A>
  4969. <KBD>C-x 5 C-f</KBD> (<CODE>find-file-other-screen</CODE>) is like <KBD>C-x C-f</KBD>
  4970. except that it creates a new screen in which the file is displayed.
  4971. <A NAME="IDX564"></A>
  4972.  Use the function <CODE>find-this-file-other-window</CODE> to edit a file
  4973. mentioned in the buffer you are editing or to test if that file exists.
  4974. To do do this, use the minibuffer completion after snatching the part or
  4975. all of the filename. By providing a prefix argument, the function calls
  4976. <CODE>filename-at-point</CODE> and switches you to a buffer visiting the file
  4977. <VAR>filename</VAR> in another window. The function creates a buffer if none
  4978. already exists. This function is similar to <CODE>find-file-other-window</CODE>.
  4979. <A NAME="IDX565"></A>
  4980. <A NAME="IDX566"></A>
  4981.   There are two hook variables that allow extensions to modify the
  4982. operation of visiting files.  Visiting a file that does not exist runs the
  4983. functions in the list <CODE>find-file-not-found-hooks</CODE>; the value of this
  4984. variable is expected to be a list of functions which are
  4985. called one by one until one of them returns non-<CODE>nil</CODE>.  Any visiting
  4986. of a file, whether extant or not, expects <CODE>find-file-hooks</CODE> to
  4987. contain list of functions and calls them all, one by one.  In both cases
  4988. the functions receive no arguments.  Visiting a nonexistent file
  4989. runs the <CODE>find-file-not-found-hooks</CODE> first.
  4990. <H2><A NAME="SEC115" HREF="xEMACS_TO.HTM#SEC115">Saving Files</A></H2>
  4991.   <DFN>Saving</DFN> a buffer in Emacs means writing its contents back into the file
  4992. that was visited in the buffer.
  4993. <DL COMPACT>
  4994. <DT><KBD>C-x C-s</KBD>
  4995. <DD>Save the current buffer in its visited file (<CODE>save-buffer</CODE>).
  4996. <DT><KBD>C-x s</KBD>
  4997. <DD>Save any or all buffers in their visited files (<CODE>save-some-buffers</CODE>).
  4998. <DT><KBD>M-~</KBD>
  4999. <DD>Forget that the current buffer has been changed (<CODE>not-modified</CODE>).
  5000. <DT><KBD>C-x C-w</KBD>
  5001. <DD>Save the current buffer in a specified file, and record that file as
  5002. the one visited in the buffer (<CODE>write-file</CODE>).
  5003. <DT><KBD>M-x set-visited-file-name</KBD>
  5004. <DD>Change file the name under which the current buffer will be saved.
  5005. </DL>
  5006. <A NAME="IDX567"></A>
  5007. <A NAME="IDX568"></A>
  5008.   To save a file and make your changes permanent, type
  5009. <KBD>C-x C-s</KBD> (<CODE>save-buffer</CODE>).  After saving is finished, <KBD>C-x C-s</KBD>
  5010. prints a message such as:
  5011. <PRE>
  5012. Wrote /u/rms/gnu/gnu.tasks
  5013. </PRE>
  5014. If the selected buffer is not modified (no changes have been made in it
  5015. since the buffer was created or last saved), Emacs does not save it
  5016. because it would have no effect.  Instead, <KBD>C-x C-s</KBD> prints a message
  5017. in the echo area saying:
  5018. <PRE>
  5019. (No changes need to be saved)
  5020. </PRE>
  5021. <A NAME="IDX569"></A>
  5022. <A NAME="IDX570"></A>
  5023.   The command <KBD>C-x s</KBD> (<CODE>save-some-buffers</CODE>) can save any or all
  5024. modified buffers.  First it asks, for each modified buffer, whether to
  5025. save it.  The questions should be answered with <KBD>y</KBD> or <KBD>n</KBD>.
  5026. <KBD>C-x C-c</KBD>, the key that kills Emacs, invokes
  5027. <CODE>save-some-buffers</CODE> and therefore asks the same questions.
  5028. <A NAME="IDX571"></A>
  5029. <A NAME="IDX572"></A>
  5030.   If you have changed a buffer and do not want the changes to be saved,
  5031. you should take some action to prevent it.  Otherwise, you are liable to
  5032. save it by mistake each time you use <CODE>save-some-buffers</CODE> or a
  5033. related command.  One thing you can do is type <KBD>M-~</KBD>
  5034. (<CODE>not-modified</CODE>), which removes the indication that the buffer
  5035. is modified.  If you do this, none of the save commands will believe
  5036. that the buffer needs to be saved.  (<SAMP>`~'</SAMP> is often used as a
  5037. mathematical symbol for `not'; thus <KBD>Meta-~</KBD> is `not', metafied.)
  5038. You could also use <CODE>set-visited-file-name</CODE> (see below) to mark the
  5039. buffer as visiting a different file name, not in use for
  5040. anything important. 
  5041. You can also undo all the changes made since the file was visited or
  5042. saved, by reading the text from the file again.  This is called
  5043. <DFN>reverting</DFN>.  See section <A HREF="xEMACS.HTM#SEC121">Reverting a Buffer</A>.  Alternatively, you can undo all the
  5044. changes by repeating the undo command <KBD>C-x u</KBD>; but this only works
  5045. if you have not made more changes than the undo mechanism can remember.
  5046. <A NAME="IDX573"></A>
  5047.   <KBD>M-x set-visited-file-name</KBD> alters the name of the file that the
  5048. current buffer is visiting.  It prompts you for the new file name in the
  5049. minibuffer.  You can also use <CODE>set-visited-file-name</CODE> on a buffer
  5050. that is not visiting a file.  The buffer's name is changed to correspond
  5051. to the file it is now visiting unless the new name is already used by a
  5052. different buffer; in that case, the buffer name is not changed.
  5053. <CODE>set-visited-file-name</CODE> does not save the buffer in the newly
  5054. visited file; it just alters the records inside Emacs so that it will
  5055. save the buffer in that file.  It also marks the buffer as "modified"
  5056. so that <KBD>C-x C-s</KBD> <I>will</I> save.
  5057. <A NAME="IDX574"></A>
  5058. <A NAME="IDX575"></A>
  5059.   If you wish to mark a buffer as visiting a different file and save it
  5060. right away, use <KBD>C-x C-w</KBD> (<CODE>write-file</CODE>).  It is precisely
  5061. equivalent to <CODE>set-visited-file-name</CODE> followed by <KBD>C-x C-s</KBD>.
  5062. <KBD>C-x C-s</KBD> used on a buffer that is not visiting  a file has the
  5063. same effect as <KBD>C-x C-w</KBD>; that is, it reads a file name, marks the
  5064. buffer as visiting that file, and saves it there.  The default file name in
  5065. a buffer that is not visiting a file is made by combining the buffer name
  5066. with the buffer's default directory.
  5067.   If Emacs is about to save a file and sees that the date of the latest
  5068. version on disk does not match what Emacs last read or wrote, Emacs
  5069. notifies you of this fact, because it probably indicates a problem caused
  5070. by simultaneous editing and requires your immediate attention.
  5071. See section <A HREF="xEMACS.HTM#SEC120">Protection Against Simultaneous Editing</A>.
  5072. <A NAME="IDX576"></A>
  5073.   If the variable <CODE>require-final-newline</CODE> is non-<CODE>nil</CODE>, Emacs
  5074. puts a newline at the end of any file that doesn't already end in one,
  5075. every time a file is saved or written.
  5076. <A NAME="IDX577"></A>
  5077. <A NAME="IDX578"></A>
  5078.   Use the hook variable <CODE>write-file-hooks</CODE> to implement other ways
  5079. to write files, and specify things to be done before files are written.  The
  5080. value of this variable should be a list of Lisp functions.  When a file
  5081. is to be written, the functions in the list are called, one by one, with
  5082. no arguments.  If one of them returns a non-<CODE>nil</CODE> value, Emacs
  5083. takes this to mean that the file has been written in some suitable
  5084. fashion; the rest of the functions are not called, and normal writing is
  5085. not done. Use the hook variable <CODE>after-save-hook</CODE> to list
  5086. all the functions to be called after writing out a buffer to a file.
  5087. <A NAME="IDX579"></A>
  5088. <A NAME="IDX580"></A>
  5089. <H3><A NAME="SEC116" HREF="xEMACS_TO.HTM#SEC116">Backup Files</A></H3>
  5090.   Because Unix does not provide version numbers in file names, rewriting a
  5091. file in Unix automatically destroys all record of what the file used to
  5092. contain.  Thus, saving a file from Emacs throws away the old contents of
  5093. the file--or it would, except that Emacs carefully copies the old contents
  5094. to another file, called the <DFN>backup</DFN> file, before actually saving.
  5095. (Make sure that the variable <CODE>make-backup-files</CODE> is non-<CODE>nil</CODE>.
  5096. Backup files are not written if this variable is <CODE>nil</CODE>).
  5097.   At your option, Emacs can keep either a single backup file or a series of
  5098. numbered backup files for each file you edit.
  5099.   Emacs makes a backup for a file only the first time a file is saved
  5100. from one buffer.  No matter how many times you save a file, its backup file
  5101. continues to contain the contents from before the file was visited.
  5102. Normally this means that the backup file contains the contents from before
  5103. the current editing session; however, if you kill the buffer and then visit
  5104. the file again, a new backup file is made by the next save.
  5105. <H4><A NAME="SEC117" HREF="xEMACS_TO.HTM#SEC117">Single or Numbered Backups</A></H4>
  5106.   If you choose to have a single backup file (the default),
  5107. the backup file's name is constructed by appending <SAMP>`~'</SAMP> to the
  5108. file name being edited; thus, the backup file for <TT>`eval.c'</TT> is
  5109. <TT>`eval.c~'</TT>.
  5110.   If you choose to have a series of numbered backup files, backup file
  5111. names are made by appending <SAMP>`.~'</SAMP>, the number, and another <SAMP>`~'</SAMP> to
  5112. the original file name.  Thus, the backup files of <TT>`eval.c'</TT> would be
  5113. called <TT>`eval.c.~1~'</TT>, <TT>`eval.c.~2~'</TT>, and so on, through names
  5114. like <TT>`eval.c.~259~'</TT> and beyond.
  5115.   If protection stops you from writing backup files under the usual names,
  5116. the backup file is written as <TT>`%backup%~'</TT> in your home directory.
  5117. Only one such file can exist, so only the most recently made backup is
  5118. available.
  5119. <A NAME="IDX581"></A>
  5120.   The choice of single backup or numbered backups is controlled by the
  5121. variable <CODE>version-control</CODE>.  Its possible values are:
  5122. <DL COMPACT>
  5123. <DT><CODE>t</CODE>
  5124. <DD>Make numbered backups.
  5125. <DT><CODE>nil</CODE>
  5126. <DD>Make numbered backups for files that have numbered backups already.
  5127. Otherwise, make single backups.
  5128. <DT><CODE>never</CODE>
  5129. <DD>Never make numbered backups; always make single backups.
  5130. </DL>
  5131. <CODE>version-control</CODE> may be set locally in an individual buffer to
  5132. control the making of backups for that buffer's file.  For example,
  5133. Rmail mode locally sets <CODE>version-control</CODE> to <CODE>never</CODE> to make sure
  5134. that there is only one backup for an Rmail file.  See section <A HREF="xEMACS.HTM#SEC278">Local Variables</A>.
  5135. <H4><A NAME="SEC118" HREF="xEMACS_TO.HTM#SEC118">Automatic Deletion of Backups</A></H4>
  5136. <A NAME="IDX582"></A>
  5137. <A NAME="IDX583"></A>
  5138.   To prevent unlimited consumption of disk space, Emacs can delete numbered
  5139. backup versions automatically.  Generally Emacs keeps the first few backups
  5140. and the latest few backups, deleting any in between.  This happens every
  5141. time a new backup is made.  The two variables that control the deletion are
  5142. <CODE>kept-old-versions</CODE> and <CODE>kept-new-versions</CODE>.  Their values are, respectively
  5143. the number of oldest (lowest-numbered) backups to keep and the number of
  5144. newest (highest-numbered) ones to keep, each time a new backup is made.
  5145. The values are used just after a new backup version is made;
  5146. that newly made backup is included in the count in <CODE>kept-new-versions</CODE>.
  5147. By default, both variables are 2.
  5148. <A NAME="IDX584"></A>
  5149.   If <CODE>trim-versions-without-asking</CODE> is non-<CODE>nil</CODE>,  excess
  5150. middle versions are deleted without notification.  If it is <CODE>nil</CODE>, the
  5151. default, you are asked whether the excess middle versions should
  5152. really be deleted.
  5153.   You can also use Dired's <KBD>.</KBD> (Period) command to delete old versions.
  5154. See section <A HREF="xEMACS.HTM#SEC141">Dired, the Directory Editor</A>.
  5155. <H4><A NAME="SEC119" HREF="xEMACS_TO.HTM#SEC119">Copying vs. Renaming</A></H4>
  5156.   You can make backup files by copying the old file or by renaming it.
  5157. This makes a difference when the old file has multiple names.  If you
  5158. rename the old file into the backup file, the alternate names
  5159. become names for the backup file.  If you copy the old file instead,
  5160. the alternate names remain names for the file that you are editing,
  5161. and the contents accessed by those names will be the new contents.
  5162.   How you make a backup file may also affect the file's owner
  5163. and group.  If you use copying, they do not change.  If renaming is used,
  5164. you become the file's owner, and the file's group becomes the default
  5165. (different operating systems have different defaults for the group).
  5166.   Having the owner change is usually a good idea, because then the owner
  5167. is always the person who last edited the file.  Occasionally there is a 
  5168. file whose owner should not change.  Since most files should change
  5169. owners, it is a good idea to use local variable lists to set 
  5170. <CODE>backup-by-copying-when-mismatch</CODE> for the special cases where the 
  5171. owner should not change (see section <A HREF="xEMACS.HTM#SEC279">Local Variables in Files</A>).
  5172. <A NAME="IDX585"></A>
  5173. <A NAME="IDX586"></A>
  5174. <A NAME="IDX587"></A>
  5175.   Three variables control the choice of renaming or copying.
  5176. Normally, renaming is done.  If the variable <CODE>backup-by-copying</CODE> is
  5177. non-<CODE>nil</CODE>, copying is used.  Otherwise, if the variable
  5178. <CODE>backup-by-copying-when-linked</CODE> is non-<CODE>nil</CODE>, copying is
  5179. done for files that have multiple names, but renaming may still be done when
  5180. the file being edited has only one name.  If the variable
  5181. <CODE>backup-by-copying-when-mismatch</CODE> is non-<CODE>nil</CODE>, copying is
  5182. done if renaming would cause the file's owner or group to change.  <P>
  5183. <H3><A NAME="SEC120" HREF="xEMACS_TO.HTM#SEC120">Protection Against Simultaneous Editing</A></H3>
  5184. <A NAME="IDX588"></A>
  5185. <A NAME="IDX589"></A>
  5186.   Simultaneous editing occurs when two users visit the same file, both
  5187. make changes, and both save their changes.  If no one was informed that
  5188. this was happening, and you saved first, you would later find that your
  5189. changes were lost.  On some systems, Emacs notices immediately when the
  5190. second user starts to change a file already being edited, and issues a
  5191. warning.  When this is not possible, or if the second user has started
  5192. to change the file despite the warning, Emacs checks when the file is
  5193. saved, and issues a second warning when a user is about to overwrite a
  5194. file containing another user's changes.  If you are the user editing the
  5195. file, you can take corrective action at this point and prevent actual
  5196. loss of work.
  5197. <A NAME="IDX590"></A>
  5198.   When you make the first modification in an Emacs buffer that is visiting
  5199. a file, Emacs records that you have locked the file.  (It does this by
  5200. writing another file in a directory reserved for this purpose.)  The lock
  5201. is removed when you save the changes.  The idea is that the file is locked
  5202. whenever the buffer is modified.  If you begin to modify the buffer while
  5203. the visited file is locked by someone else, this constitutes a collision,
  5204. and Emacs asks you what to do.  It does this by calling the Lisp function
  5205. <CODE>ask-user-about-lock</CODE>, which you can redefine to customize what it
  5206. does.  The standard definition of this function asks you a
  5207. question and accepts three possible answers:
  5208. <DL COMPACT>
  5209. <DT><KBD>s</KBD>
  5210. <DD>Steal the lock.  Whoever was already changing the file loses the lock,
  5211. and you get the lock.
  5212. <DT><KBD>p</KBD>
  5213. <DD>Proceed.  Go ahead and edit the file despite its being locked by someone else.
  5214. <DT><KBD>q</KBD>
  5215. <DD>Quit.  This causes an error (<CODE>file-locked</CODE>) and the modification you
  5216. were trying to make in the buffer does not actually take place.
  5217. </DL>
  5218.   Note that locking works on the basis of a file name; if a file has
  5219. multiple names, Emacs does not realize that the two names are the same file
  5220. and cannot prevent two users from editing it simultaneously under different
  5221. names.  However, basing locking on names means that Emacs can interlock the
  5222. editing of new files that do not really exist until they are saved.
  5223.   Some systems are not configured to allow Emacs to make locks.  On
  5224. these systems, Emacs cannot detect trouble in advance, but it can still
  5225. detect it in time to prevent you from overwriting someone else's changes.
  5226.   Every time Emacs saves a buffer, it first checks the last-modification
  5227. date of the existing file on disk to see that it has not changed since the
  5228. file was last visited or saved.  If the date does not match, it implies
  5229. that changes were made in the file in some other way, and these changes are
  5230. about to be lost if Emacs actually does save.  To prevent this, Emacs
  5231. prints a warning message and asks for confirmation before saving.
  5232. Occasionally you will know why the file was changed and know that it does
  5233. not matter; then you can answer <KBD>yes</KBD> and proceed.  Otherwise, you should
  5234. cancel the save with <KBD>C-g</KBD> and investigate the situation.
  5235.   The first thing you should do when notified that simultaneous editing
  5236. has already taken place is to list the directory with <KBD>C-u C-x C-d</KBD>
  5237. (see section <A HREF="xEMACS.HTM#SEC139">Listing a File Directory</A>).  This will show the file's current
  5238. author.  You should attempt to contact that person and ask him not to
  5239. continue editing.  Often the next step is to save the contents of your
  5240. Emacs buffer under a different name, and use <CODE>diff</CODE> to compare the
  5241. two files.<P>
  5242.   Simultaneous editing checks are also made when you visit a file that
  5243. is already visited with <KBD>C-x C-f</KBD> and when you start to modify a
  5244. file.  This is not strictly necessary, but it is useful to find out
  5245. about such a problem as early as possible, when corrective action takes
  5246. less work.
  5247. <A NAME="IDX591"></A>
  5248. <A NAME="IDX592"></A>
  5249. Another way to protect your file is to set the read, write, and
  5250. executable permissions for the file. Use the function
  5251. <CODE>set-default-file-modes</CODE> to set the UNIX <CODE>umask</CODE> value to the
  5252. <VAR>nmask</VAR> argument. The <CODE>umask</CODE> value is the default protection
  5253. mode for new files.
  5254. <A NAME="IDX593"></A>
  5255. <A NAME="IDX594"></A>
  5256. <H2><A NAME="SEC121" HREF="xEMACS_TO.HTM#SEC121">Reverting a Buffer</A></H2>
  5257.   If you have made extensive changes to a file and then change your mind
  5258. about them, you can get rid of all changes by reading in the previous
  5259. version of the file.  To do this, use <KBD>M-x revert-buffer</KBD>, which
  5260. operates on the current buffer.  Since reverting a buffer can result in
  5261. very extensive changes, you must confirm it with <KBD>yes</KBD>.
  5262.   If the current buffer has been auto-saved more recently than it has been
  5263. saved explicitly, <CODE>revert-buffer</CODE> offers to read the auto save file
  5264. instead of the visited file (see section <A HREF="xEMACS.HTM#SEC122">Auto-Saving: Protection Against Disasters</A>).  Emacs asks you about
  5265. the auto-save file before the request for confirmation of the
  5266. <KBD>revert-buffer</KBD> operation, and demands <KBD>y</KBD> or <KBD>n</KBD>
  5267. as an answer.  If you have started to type <KBD>yes</KBD> for confirmation
  5268. without realizing that the auto-save question was going to be asked, the
  5269. <KBD>y</KBD> will answer that question, but the <KBD>es</KBD> will not be valid
  5270. confirmation.  This gives you a chance to cancel the operation with
  5271. <KBD>C-g</KBD> and try again with the answers you really intend.
  5272.   <CODE>revert-buffer</CODE> keeps point at the same distance (measured in
  5273. characters) from the beginning of the file.  If the file was edited only
  5274. slightly, you will be at approximately the same piece of text after
  5275. reverting as before.  If you have made more extensive changes, the value of
  5276. point in the old file may bring you to a totally different piece of text
  5277. than your last editing point.
  5278. A buffer reverted from its visited file is marked "not modified" until
  5279. you make a change.
  5280.   Some kinds of buffers whose contents reflect data bases other than files,
  5281. such as Dired buffers, can also be reverted.  For them, reverting means
  5282. recalculating their contents from the appropriate data.  Buffers
  5283. created randomly with <KBD>C-x b</KBD> cannot be reverted; <CODE>revert-buffer</CODE>
  5284. reports an error when asked to do so.
  5285. <A NAME="IDX595"></A>
  5286. <A NAME="IDX596"></A>
  5287. <H2><A NAME="SEC122" HREF="xEMACS_TO.HTM#SEC122">Auto-Saving: Protection Against Disasters</A></H2>
  5288.   Emacs saves all the visited files from time to time (based on counting
  5289. your keystrokes) without being asked.  This is called <DFN>auto-saving</DFN>.
  5290. It prevents you from losing more than a limited amount of work if the
  5291. system crashes.
  5292.   When Emacs determines it is time for auto-saving, each buffer is
  5293. considered and is auto-saved if auto-saving is turned on for it and it has
  5294. changed since the last time it was auto-saved.  If any auto-saving is
  5295. done, the message <SAMP>`Auto-saving...'</SAMP> is displayed in the echo area until
  5296. auto-saving is finished.  Errors occurring during auto-saving are caught
  5297. so that they do not interfere with the execution of commands you have been
  5298. typing.
  5299. <H3><A NAME="SEC123" HREF="xEMACS_TO.HTM#SEC123">Auto-Save Files</A></H3>
  5300.   Auto-saving does not normally write to the files you visited, because
  5301. it can be undesirable to save a program that is in an inconsistent
  5302. state when you have made only half of a planned change.  Instead, auto-saving
  5303. is done in a different file called the <DFN>auto-save file</DFN>, and the
  5304. visited file is changed only when you save explicitly, for example, 
  5305. with <KBD>C-x C-s</KBD>.
  5306.   Normally, the name of the auto-save file is generated by appending
  5307. <SAMP>`#'</SAMP> to the front and back of the visited file name.  Thus, a buffer
  5308. visiting file <TT>`foo.c'</TT> would be auto-saved in a file <TT>`#foo.c#'</TT>.
  5309. Most buffers that are not visiting files are auto-saved only if you
  5310. request it explicitly; when they are auto-saved, the auto-save file name
  5311. is generated by appending <SAMP>`#%'</SAMP> to the front and <SAMP>`#'</SAMP> to the
  5312. back of buffer name.  For example, the <SAMP>`*mail*'</SAMP> buffer in which you
  5313. compose messages to be sent is auto-saved in a file named
  5314. <TT>`#%*mail*#'</TT>.  Names of auto-save files are generated this way
  5315. unless you customize the functions <CODE>make-auto-save-file-name</CODE> and
  5316. <CODE>auto-save-file-name-p</CODE> to do something different.  The file name
  5317. to be used for auto-saving a buffer is calculated at the time auto-saving is
  5318. turned on in that buffer.
  5319. <A NAME="IDX597"></A>
  5320.   If you want auto-saving to be done in the visited file, set the variable
  5321. <CODE>auto-save-visited-file-name</CODE> to be non-<CODE>nil</CODE>.  In this mode,
  5322. there is really no difference between auto-saving and explicit saving.
  5323. <A NAME="IDX598"></A>
  5324.   Emacs deletes a buffer's auto-save file when you explicitly save the
  5325. buffer.  To inhibit the deletion, set the variable
  5326. <CODE>delete-auto-save-files</CODE> to <CODE>nil</CODE>.  Changing the visited file
  5327. name with <KBD>C-x C-w</KBD> or <CODE>set-visited-file-name</CODE> renames any
  5328. auto-save file to correspond to the new visited name.
  5329. <H3><A NAME="SEC124" HREF="xEMACS_TO.HTM#SEC124">Controlling Auto-Saving</A></H3>
  5330. <A NAME="IDX599"></A>
  5331. <A NAME="IDX600"></A>
  5332.   Each time you visit a file, auto-saving is turned on for that file's
  5333. buffer if the variable <CODE>auto-save-default</CODE> is non-<CODE>nil</CODE> (but
  5334. not in batch mode; see section <A HREF="xEMACS.HTM#SEC30">Entering and Exiting Emacs</A>).  The default for this
  5335. variable is <CODE>t</CODE>, so Emacs auto-saves buffers that visit files by
  5336. default.  You can use the command <KBD>M-x auto-save-mode</KBD> to turn
  5337. auto-saving for a buffer on or off.  Like other minor mode commands,
  5338. <KBD>M-x auto-save-mode</KBD> turns auto-saving on with a positive argument,
  5339. off with a zero or negative argument; with no argument, it toggles.
  5340. <A NAME="IDX601"></A>
  5341. <A NAME="IDX602"></A>
  5342.   Emacs performs auto-saving periodically based on counting how many
  5343. characters you have typed since the last time auto-saving happened.  The
  5344. variable <CODE>auto-save-interval</CODE> specifies the number of characters
  5345. between auto-saves.  By default, it is 300.  Emacs also auto-saves
  5346. whenever you call the function <CODE>do-auto-save</CODE>.
  5347.   Emacs also does auto-saving whenever it gets a fatal error.  This
  5348. includes killing the Emacs job with a shell command such as <CODE>kill
  5349. -emacs</CODE>, or disconnecting a phone line or network connection.
  5350. <A NAME="IDX603"></A>
  5351. You can set the number of seconds of idle time before an auto-save is
  5352. done. Setting the value of the variable <CODE>auto-save-timeout</CODE> to zero or 
  5353. <CODE>nil</CODE> will  disable auto-saving due to idleness.
  5354. The actual amount of idle time between auto-saves is logarithmically
  5355. related to the size of the current buffer.  This variable is the number
  5356. of seconds after which an auto-save will happen when the current buffer
  5357. is 50k or less; the timeout will be 2 1/4 times this in a 200k buffer, 3
  5358. 3/4 times this in a 1000k buffer, and 4 1/2 times this in a 2000k
  5359. buffer.
  5360. For this variable to have any effect, you must do <CODE>(require 'timer)</CODE>.
  5361. <H3><A NAME="SEC125" HREF="xEMACS_TO.HTM#SEC125">Recovering Data from Auto-Saves</A></H3>
  5362. <A NAME="IDX604"></A>
  5363.   If you want to use the contents of an auto-save file to recover from a
  5364. loss of data, use the command <KBD>M-x recover-file <KBD>RET</KBD> <VAR>file</VAR>
  5365. <KBD>RET</KBD></KBD>.  Emacs visits <VAR>file</VAR> and then (after your confirmation)
  5366. restores the contents from the auto-save file <TT>`#<VAR>file</VAR>#'</TT>.  You
  5367. can then save the file with <KBD>C-x C-s</KBD> to put the recovered text into
  5368. <VAR>file</VAR> itself.  For example, to recover file <TT>`foo.c'</TT> from its
  5369. auto-save file <TT>`#foo.c#'</TT>, do:<P>
  5370. <PRE>
  5371. M-x recover-file <KBD>RET</KBD> foo.c <KBD>RET</KBD>
  5372. C-x C-s
  5373. </PRE>
  5374.   Before asking for confirmation, <KBD>M-x recover-file</KBD> displays a
  5375. directory listing describing the specified file and the auto-save file,
  5376. so you can compare their sizes and dates.  If the auto-save file
  5377. is older, <KBD>M-x recover-file</KBD> does not offer to read it.
  5378.   Auto-saving is disabled by <KBD>M-x recover-file</KBD> because using
  5379. this command implies that the auto-save file contains valuable data
  5380. from a past session.  If you save the data in the visited file and
  5381. then go on to make new changes, turn auto-saving back on
  5382. with <KBD>M-x auto-save-mode</KBD>.
  5383. <A NAME="IDX605"></A>
  5384. <H2><A NAME="SEC126" HREF="xEMACS_TO.HTM#SEC126">Version Control</A></H2>
  5385.   <DFN>Version control systems</DFN> are packages that can record multiple
  5386. versions of a source file, usually storing the unchanged parts of the
  5387. file just once.  Version control systems also record history information
  5388. such as the creation time of each version, who created it, and a 
  5389. description of what was changed in that version.
  5390.   The GNU project recommends the version control system known as RCS,
  5391. which is free software and available from the Free Software Foundation.
  5392. Emacs supports use of either RCS or SCCS (a proprietary, but widely
  5393. used, version control system that is not quite as powerful as RCS)
  5394. through a facility called VC.  The same Emacs commands work with either
  5395. RCS or SCCS, so you hardly have to know which one of them you are
  5396. using.
  5397. <H3><A NAME="SEC127" HREF="xEMACS_TO.HTM#SEC127">Concepts of Version Control</A></H3>
  5398. <A NAME="IDX606"></A>
  5399. <A NAME="IDX607"></A>
  5400. <A NAME="IDX608"></A>
  5401. <A NAME="IDX609"></A>
  5402. <A NAME="IDX610"></A>
  5403.    When a file is under version control, we also say that it is
  5404. <DFN>registered</DFN> in the version control system.  Each registered file
  5405. has a corresponding <DFN>master file</DFN> which represents the file's
  5406. present state plus its change history, so that you can reconstruct from
  5407. it either the current version or any specified earlier version.  Usually
  5408. the master file also records a <DFN>log entry</DFN> for each version describing
  5409. what was changed in that version.
  5410.   The file that is maintained under version control is sometimes called
  5411. the <DFN>work file</DFN> corresponding to its master file.
  5412. <A NAME="IDX611"></A>
  5413. <A NAME="IDX612"></A>
  5414. <A NAME="IDX613"></A>
  5415.    To examine a file, you <DFN>check it out</DFN>.  This extracts a version
  5416. of the source file (typically, the most recent) from the master file.
  5417. If you want to edit the file, you must check it out <DFN>locked</DFN>.  Only
  5418. one user can do this at a time for any given source file.  (This kind 
  5419. of locking is completely unrelated to the locking that Emacs uses to
  5420. detect simultaneous editing of a file.)
  5421.   When you are done with your editing, you must <DFN>check in</DFN> the new
  5422. version.  This records the new version in the master file, and unlocks
  5423. the source file so that other people can lock it and thus modify it.
  5424.   Checkin and checkout are the basic operations of version control.  You
  5425. can do both of them with a single Emacs command: <KBD>C-x C-q</KBD>
  5426. (<CODE>vc-toggle-read-only</CODE>).
  5427.   A <DFN>snapshot</DFN> is a coherent collection of versions of the various
  5428. files that make up a program.  See section <A HREF="xEMACS.HTM#SEC135">Snapshots</A>.
  5429. <H3><A NAME="SEC128" HREF="xEMACS_TO.HTM#SEC128">Editing with Version Control</A></H3>
  5430.   When you visit a file that is maintained using version control, the
  5431. mode line displays <SAMP>`RCS'</SAMP> or <SAMP>`SCCS'</SAMP> to inform you that version
  5432. control is in use, and also (in case you care) which low-level system
  5433. the file is actually stored in.  Normally, such a source file is
  5434. read-only, and the mode line indicates this with <SAMP>`%%'</SAMP>.  With RCS,
  5435. the mode line also indicates the number of the head version, which is
  5436. normally also the version you are looking at.
  5437.   These are the commands for editing a file maintained with
  5438. version control:
  5439. <DL COMPACT>
  5440. <DT><KBD>C-x C-q</KBD>
  5441. <DD>Check the visited file in or out.
  5442. <DT><KBD>C-x v u</KBD>
  5443. <DD>Revert the buffer and the file to the last checked in version.
  5444. <DT><KBD>C-x v c</KBD>
  5445. <DD>Remove the last-entered change from the master for the visited file.
  5446. This undoes your last check-in.
  5447. <DT><KBD>C-x v i</KBD>
  5448. <DD>Register the visited file in version control.
  5449. </DL>
  5450. (<KBD>C-x v</KBD> is the prefix key for version control commands; all of these
  5451. commands except for <KBD>C-x C-q</KBD> start with <KBD>C-x v</KBD>.)
  5452. <A NAME="IDX614"></A>
  5453.   When you want to modify a file maintained with version control, type
  5454. <KBD>C-x C-q</KBD> (<CODE>vc-toggle-read-only</CODE>).  This <DFN>checks out</DFN> the
  5455. file, and tells RCS or SCCS to lock the file.  This means making the
  5456. file writable for you (but not for anyone else).
  5457. <A NAME="IDX615"></A>
  5458.   When you are finished editing the file, type <KBD>C-x C-q</KBD> again.
  5459. When used on a file that is checked out, this command checks the file
  5460. in.  But check-in does not start immediately; first, you must enter the
  5461. <DFN>log entry</DFN>---a description of the changes in the new version.
  5462. <KBD>C-x C-q</KBD> pops up a buffer for you to enter this in.  When you are
  5463. finished typing in the log entry, type <KBD>C-c C-c</KBD> to terminate it; this is
  5464. when actual check-in takes place.
  5465.   Once you have checked in your changes, the file is unlocked, so that
  5466. other users can lock it and modify it.
  5467. <A NAME="IDX616"></A>
  5468.   Emacs does not save backup files for source files that are maintained
  5469. with version control.  If you want to make backup files despite version
  5470. control, set the variable <CODE>vc-make-backup-files</CODE> to a
  5471. non-<CODE>nil</CODE> value.
  5472. <A NAME="IDX617"></A>
  5473.   Normally the work file exists all the time, whether it is locked or
  5474. not.  If you set <CODE>vc-keep-workfiles</CODE> to <CODE>nil</CODE>, then checking
  5475. in a new version with <KBD>C-x C-q</KBD> deletes the work file; but any
  5476. attempt to visit the file with Emacs creates it again.
  5477.   It is not impossible to lock a file that someone else has locked.  If
  5478. you try to check out a file that is locked, <KBD>C-x C-q</KBD> asks you
  5479. whether you want to "steal the lock."  If you say yes, the file
  5480. becomes locked by you, but a message is sent to the person who had
  5481. formerly locked the file, to inform him of what has happened.  The mode
  5482. line indicates that a file is locked by someone else by displaying the
  5483. login name of that person, before the version number.
  5484. <A NAME="IDX618"></A>
  5485. <A NAME="IDX619"></A>
  5486.   If you want to discard your current set of changes and revert to the
  5487. last version checked in, use <KBD>C-x v u</KBD> (<CODE>vc-revert-buffer</CODE>).
  5488. This cancels your last check-out, leaving the file unlocked.  If you want
  5489. to make a different set of changes, you must first check the file out
  5490. again.  <KBD>C-x v u</KBD> requires confirmation, unless it sees that 
  5491. you haven't made any changes since the last checked-in version.
  5492.   <KBD>C-x v u</KBD> is also the command to use if you lock a file and then
  5493. don't actually change it.
  5494. <A NAME="IDX620"></A>
  5495. <A NAME="IDX621"></A>
  5496.   You can cancel a change after checking it in, with <KBD>C-x v c</KBD>
  5497. (<CODE>vc-cancel-version</CODE>).  This command discards all record of the
  5498. most recent checked in version, so be careful about using it.  It
  5499. requires confirmation with <KBD>yes</KBD>.  By default, <KBD>C-x v c</KBD> reverts
  5500. your workfile and buffer to the previous version (the one that precedes
  5501. the version that is deleted), but you can prevent the reversion by
  5502. giving the command a prefix argument.  Then the buffer does not change.
  5503.   This command with a prefix argument is useful when you have checked in
  5504. a change and then discover a trivial error in it; you can cancel the
  5505. erroneous check-in, fix the error, and repeat the check-in.
  5506.   Be careful when invoking <KBD>C-x v c</KBD>, as it is easy to throw away a
  5507. lot of work with it.  To help you be careful, this command always
  5508. requires confirmation with <SAMP>`yes'</SAMP>.
  5509. <A NAME="IDX622"></A>
  5510. <A NAME="IDX623"></A>
  5511. <A NAME="IDX624"></A>
  5512.   You can register the visited file for version control using
  5513. <KBD>C-x v i</KBD> (<CODE>vc-register</CODE>).  If the variable
  5514. <CODE>vc-default-back-end</CODE> is non-<CODE>nil</CODE>, it specifies which
  5515. version control system to use; otherwise, this uses RCS if it is
  5516. installed on your system and SCCS if not.  After <KBD>C-x v i</KBD>,
  5517. the file is unlocked and read-only.  Type <KBD>C-x C-q</KBD> if you wish to
  5518. edit it.
  5519.   By default, the initial version number is 1.1.  If you want to use a
  5520. different number, give <KBD>C-x v i</KBD> a prefix argument; then it reads
  5521. the initial version number using the minibuffer.
  5522. <A NAME="IDX625"></A>
  5523.   If <CODE>vc-initial-comment</CODE> is non-<CODE>nil</CODE>, <KBD>C-x v i</KBD> reads
  5524. an initial comment (much like a log entry) to describe the purpose of
  5525. this source file.
  5526. <A NAME="IDX626"></A>
  5527. <A NAME="IDX627"></A>
  5528.   To specify the version number for a subsequent checkin, use the
  5529. command <KBD>C-u C-x v v</KBD>.  <KBD>C-x v v</KBD> (<CODE>vc-next-action</CODE>) is the
  5530. command that <KBD>C-x C-q</KBD> uses to do the "real work" when the visited
  5531. file uses version control.  When used for checkin, and given a prefix
  5532. argument, it reads the version number with the minibuffer.
  5533. <H3><A NAME="SEC129" HREF="xEMACS_TO.HTM#SEC129">Variables Affecting Check-in and Check-out</A></H3>
  5534. <A NAME="IDX628"></A>
  5535.   If <CODE>vc-suppress-confirm</CODE> is non-<CODE>nil</CODE>, then <KBD>C-x C-q</KBD>
  5536. and <KBD>C-x v i</KBD> can save the current buffer without asking, and
  5537. <KBD>C-x v u</KBD> also operates without asking for confirmation.
  5538. (This variable does not affect <KBD>C-x v c</KBD>; that is so drastic
  5539. that it should always ask for confirmation.)
  5540. <A NAME="IDX629"></A>
  5541.   VC mode does much of its work by running the shell commands for RCS
  5542. and SCCS.  If <CODE>vc-command-messages</CODE> is non-<CODE>nil</CODE>, VC displays
  5543. messages to indicate which shell commands it runs, and additional
  5544. messages when the commands finish.
  5545.   Normally, VC assumes that it can deduce the locked/unlocked state of
  5546. files by looking at the file permissions of the work file; this is
  5547. fast.  However, if the <TT>`RCS'</TT> or <TT>`SCCS'</TT> subdirectory is
  5548. actually a symbolic link, then VC does not trust the file permissions to
  5549. reflect this status.
  5550. <A NAME="IDX630"></A>
  5551. You can specify the criterion for whether to trust the file permissions
  5552. by setting the variable <CODE>vc-mistrust-permissions</CODE>.  Its value may
  5553. be <CODE>t</CODE> (always mistrust the file permissions and check the master
  5554. file), <CODE>nil</CODE> (always trust the file permissions), or a function of
  5555. one argument which makes the decision.  The argument is the directory
  5556. name of the <TT>`RCS'</TT> or <TT>`SCCS'</TT> subdirectory.  A non-<CODE>nil</CODE>
  5557. value from the function says to mistrust the file permissions.
  5558.   If you find that the file permissions of work files are changed
  5559. erroneously, set <CODE>vc-mistrust-permissions</CODE> to <CODE>t</CODE>.  Then VC
  5560. always checks the master file to determine the file's status.
  5561. <A NAME="IDX631"></A>
  5562.   You can specify additional directories to search for version control
  5563. programs by setting the variable <CODE>vc-path</CODE>.  These directories
  5564. are searched before the usual search path.  The proper result usually
  5565. happens automatically.
  5566. <H3><A NAME="SEC130" HREF="xEMACS_TO.HTM#SEC130">Log Entries</A></H3>
  5567.   When you're editing an initial comment or log entry for inclusion in a
  5568. master file, finish your entry by typing <KBD>C-c C-c</KBD>.
  5569. <DL COMPACT>
  5570. <DT><KBD>C-c C-c</KBD>
  5571. <DD>Finish the comment edit normally (<CODE>vc-finish-logentry</CODE>).
  5572. This finishes check-in.
  5573. </DL>
  5574.   To abort check-in, just don't type <KBD>C-c C-c</KBD> in that buffer.  You
  5575. can switch buffers and do other editing.  As long as you don't try to
  5576. check in another file, the entry you were editing remains in its
  5577. buffer, and you can go back to that buffer at any time to complete the
  5578. check-in.
  5579.   If you change several source files for the same reason, it is often
  5580. convenient to specify the same log entry for many of the files.  To do
  5581. this, use the history of previous log entries.  The commands <KBD>M-n</KBD>,
  5582. <KBD>M-p</KBD>, <KBD>M-s</KBD> and <KBD>M-r</KBD> for doing this work just like the
  5583. minibuffer history commands (except that these versions are used outside
  5584. the minibuffer).
  5585. <A NAME="IDX632"></A>
  5586.   Each time you check in a file, the log entry buffer is put into VC Log
  5587. mode, which involves running two hooks: <CODE>text-mode-hook</CODE> and
  5588. <CODE>vc-log-mode-hook</CODE>.
  5589. <H3><A NAME="SEC131" HREF="xEMACS_TO.HTM#SEC131">Change Logs and VC</A></H3>
  5590.   If you use RCS for a program and also maintain a change log file for
  5591. it (see section <A HREF="xEMACS.HTM#SEC200">Change Logs</A>), you can generate change log entries
  5592. automatically from the version control log entries:
  5593. <DL COMPACT>
  5594. <A NAME="IDX633"></A>
  5595. <A NAME="IDX634"></A>
  5596. <DT><KBD>C-x v a</KBD>
  5597. <DD>Visit the current directory's change log file and create new entries for
  5598. versions checked in since the most recent entry in the change log file
  5599. (<CODE>vc-update-change-log</CODE>).
  5600. This command works with RCS only; it does not work with SCCS.
  5601. </DL>
  5602.   For example, suppose the first line of <TT>`ChangeLog'</TT> is dated 10
  5603. April 1992, and that the only check-in since then was by Nathaniel
  5604. Bowditch to <TT>`rcs2log'</TT> on 8 May 1992 with log text <SAMP>`Ignore log
  5605. messages that start with `#'.'</SAMP>.  Then <KBD>C-x v a</KBD> visits
  5606. <TT>`ChangeLog'</TT> and inserts text like this:
  5607. <PRE>
  5608. Fri May  8 21:45:00 1992  Nathaniel Bowditch  (nat@apn.org)
  5609.         * rcs2log: Ignore log messages that start with `#'.
  5610. </PRE>
  5611. You can then edit the new change log entry further as you wish.
  5612.   Normally, the log entry for file <TT>`foo'</TT> is displayed as <SAMP>`*
  5613. foo: <VAR>text of log entry</VAR>'</SAMP>.  The <SAMP>`:'</SAMP> after <TT>`foo'</TT> is omitted
  5614. if the text of the log entry starts with <SAMP>`(<VAR>functionname</VAR>):
  5615. '</SAMP>.  For example, if the log entry for <TT>`vc.el'</TT> is
  5616. <SAMP>`(vc-do-command): Check call-process status.'</SAMP>, then the text in
  5617. <TT>`ChangeLog'</TT> looks like this:
  5618. <PRE>
  5619. Wed May  6 10:53:00 1992  Nathaniel Bowditch  (nat@apn.org)
  5620.         * vc.el (vc-do-command): Check call-process status.
  5621. </PRE>
  5622.   When <KBD>C-x v a</KBD> adds several change log entries at once, it groups
  5623. related log entries together if they all are checked in by the same
  5624. author at nearly the same time.  If the log entries for several such
  5625. files all have the same text, it coalesces them into a single entry.
  5626. For example, suppose the most recent checkins have the following log
  5627. entries:
  5628. <PRE>
  5629. For <TT>`vc.texinfo'</TT>:
  5630. Fix expansion typos.
  5631. For <TT>`vc.el'</TT>:
  5632. Don't call expand-file-name.
  5633. For <TT>`vc-hooks.el'</TT>:
  5634. Don't call expand-file-name.
  5635. </PRE>
  5636.   They appear like this in <TT>`ChangeLog'</TT>:
  5637. <PRE>
  5638. Wed Apr  1 08:57:59 1992  Nathaniel Bowditch  (nat@apn.org)
  5639.         * vc.texinfo: Fix expansion typos.
  5640.         * vc.el, vc-hooks.el: Don't call expand-file-name.
  5641. </PRE>
  5642.   Normally, <KBD>C-x v a</KBD> separates log entries by a blank line, but you
  5643. can mark several related log entries to be clumped together (without an
  5644. intervening blank line) by starting the text of each related log entry
  5645. with a label of the form <SAMP>`{<VAR>clumpname</VAR>} '</SAMP>.  The label
  5646. itself is not copied to <TT>`ChangeLog'</TT>.  For example, suppose the log
  5647. entries are:
  5648. <PRE>
  5649. For <TT>`vc.texinfo'</TT>:
  5650. {expand} Fix expansion typos.
  5651. For <TT>`vc.el'</TT>:
  5652. {expand} Don't call expand-file-name.
  5653. For <TT>`vc-hooks.el'</TT>:
  5654. {expand} Don't call expand-file-name.
  5655. </PRE>
  5656. Then the text in <TT>`ChangeLog'</TT> looks like this:
  5657. <PRE>
  5658. Wed Apr  1 08:57:59 1992  Nathaniel Bowditch  (nat@apn.org)
  5659.         * vc.texinfo: Fix expansion typos.
  5660.         * vc.el, vc-hooks.el: Don't call expand-file-name.
  5661. </PRE>
  5662.   A log entry whose text begins with <SAMP>`#'</SAMP> is not copied to
  5663. <TT>`ChangeLog'</TT>.  For example, if you merely fix some misspellings in
  5664. comments, you can log the change with an entry beginning with <SAMP>`#'</SAMP>
  5665. to avoid putting such trivia into <TT>`ChangeLog'</TT>.
  5666. <H3><A NAME="SEC132" HREF="xEMACS_TO.HTM#SEC132">Examining And Comparing Old Versions</A></H3>
  5667. <DL COMPACT>
  5668. <DT><KBD>C-x v ~ <VAR>version</VAR> <KBD>RET</KBD></KBD>
  5669. <DD>Examine version <VAR>version</VAR> of the visited file, in a buffer of its
  5670. own (<CODE>vc-version-other-window</CODE>).
  5671. <DT><KBD>C-x v =</KBD>
  5672. <DD>Compare the current buffer contents with the latest checked-in version
  5673. of the file.
  5674. <DT><KBD>C-u C-x v = <VAR>file</VAR> <KBD>RET</KBD> <VAR>oldvers</VAR> <KBD>RET</KBD> <VAR>newvers</VAR> <KBD>RET</KBD></KBD>
  5675. <DD>Compare the specified two versions of <VAR>file</VAR>.
  5676. </DL>
  5677. <A NAME="IDX635"></A>
  5678. <A NAME="IDX636"></A>
  5679.   You can examine any version of a file by first visiting it, and then
  5680. using <KBD>C-x v ~ <VAR>version</VAR> <KBD>RET</KBD></KBD>
  5681. (<CODE>vc-version-other-window</CODE>).  This puts the text of version
  5682. <VAR>version</VAR> in a file named <TT>`<VAR>filename</VAR>.~<VAR>version</VAR>~'</TT>,
  5683. then visits it in a separate window.
  5684. <A NAME="IDX637"></A>
  5685. <A NAME="IDX638"></A>
  5686.   To compare two versions of a file, use the command <KBD>C-x v =</KBD>
  5687. (<CODE>vc-diff</CODE>).
  5688.   Plain <KBD>C-x v =</KBD> compares the current buffer contents (saving them
  5689. in the file if necessary) with the last checked-in version of the file.
  5690. With a prefix argument, <KBD>C-x v =</KBD> reads a file name and two version
  5691. numbers, then compares those versions of the specified file.
  5692.   If you supply a directory name instead of the name of a work file,
  5693. this command compares the two specified versions of all registered files
  5694. in that directory and its subdirectories.  You can also specify a
  5695. snapshot name (see section <A HREF="xEMACS.HTM#SEC135">Snapshots</A>) instead of one or both version
  5696. numbers.
  5697.   You can specify a checked-in version by its number; you can specify
  5698. the most recent checked-in version with an empty version number.
  5699.   This command works by running the <CODE>diff</CODE> utility, getting the
  5700. options from the variable <CODE>diff-switches</CODE>.  It displays the output
  5701. in a special buffer in another window.  Unlike the <KBD>M-x diff</KBD>
  5702. command, <KBD>C-x v =</KBD> does not try to find the changes in the old and
  5703. new versions.  This is because one or both versions normally do not
  5704. exist as files.  They exist only in the records of the master file.
  5705. See section <A HREF="xEMACS.HTM#SEC140">Comparing Files</A>, for more information about <KBD>M-x diff</KBD>.
  5706. <H3><A NAME="SEC133" HREF="xEMACS_TO.HTM#SEC133">VC Status Commands</A></H3>
  5707. <A NAME="IDX639"></A>
  5708. <A NAME="IDX640"></A>
  5709.   To view the detailed version control status and history of a file,
  5710. type <KBD>C-x v l</KBD> (<CODE>vc-print-log</CODE>).  It displays the history of
  5711. changes to the current file, including the text of the log entries.  The
  5712. output appears in a separate window.
  5713. <A NAME="IDX641"></A>
  5714. <A NAME="IDX642"></A>
  5715.   When you are working on a large program, it's often useful to find all
  5716. the files that are currently locked, or all the files maintained in
  5717. version control at all.  You can use <KBD>C-x v d</KBD> (<CODE>vc-directory</CODE>)
  5718. to show all the locked files in or beneath the current directory.  This
  5719. includes all files that are locked by any user.  <KBD>C-u C-x v d</KBD> lists
  5720. all files in or beneath the current directory that are maintained with
  5721. version control.
  5722.   The list of files is displayed as a buffer that uses an augmented
  5723. Dired mode.  The names of the users locking various files are shown (in
  5724. parentheses) in place of the owner and group.  All the normal Dired
  5725. commands work in this buffer.  Most interactive VC commands work also,
  5726. and apply to the file name on the current line.
  5727.   The <KBD>C-x v v</KBD> command (<CODE>vc-next-action</CODE>), when used in the
  5728. augmented Dired buffer, operates on all the marked files (or the file on
  5729. the current line).  If it operates on more than one file, it handles
  5730. each file according to its current state; thus, it may check out one
  5731. file and check in another (because it is already checked out).  If it
  5732. has to check in any files, it reads a single log entry, then uses that
  5733. text for all the files being checked in.  This can be convenient for
  5734. registering or checking in several files at once, as part of the same
  5735. change.
  5736. <H3><A NAME="SEC134" HREF="xEMACS_TO.HTM#SEC134">Renaming VC Work Files and Master Files</A></H3>
  5737. <A NAME="IDX643"></A>
  5738.   When you rename a registered file, you must also rename its master
  5739. file correspondingly to get proper results.  Use <CODE>vc-rename-file</CODE>
  5740. to rename the source file as you specify, and rename its master file
  5741. accordingly.  It also updates any snapshots (see section <A HREF="xEMACS.HTM#SEC135">Snapshots</A>) that
  5742. mention the file, so that they use the new name; despite this, the
  5743. snapshot thus modified may not completely work (see section <A HREF="xEMACS.HTM#SEC137">Snapshot Caveats</A>).
  5744.   You cannot use <CODE>vc-rename-file</CODE> on a file that is locked by
  5745. someone else.
  5746. <A NAME="IDX644"></A>
  5747. <H3><A NAME="SEC135" HREF="xEMACS_TO.HTM#SEC135">Snapshots</A></H3>
  5748.   A <DFN>snapshot</DFN> is a named set of file versions (one for each
  5749. registered file) that you can treat as a unit.  One important kind of
  5750. snapshot is a <DFN>release</DFN>, a (theoretically) stable version of the
  5751. system that is ready for distribution to users.
  5752. <H4><A NAME="SEC136" HREF="xEMACS_TO.HTM#SEC136">Making and Using Snapshots</A></H4>
  5753.   There are two basic commands for snapshots; one makes a
  5754. snapshot with a given name, the other retrieves a named snapshot.
  5755. <A NAME="IDX645"></A>
  5756. <A NAME="IDX646"></A>
  5757. <DL COMPACT>
  5758. <DT><CODE>C-x v s <VAR>name</VAR> <KBD>RET</KBD></CODE>
  5759. <DD>Define the last saved versions of every registered file in or under the
  5760. current directory as a snapshot named <VAR>name</VAR>
  5761. (<CODE>vc-create-snapshot</CODE>).
  5762. <A NAME="IDX648"></A>
  5763. <A NAME="IDX647"></A>
  5764. <DT><CODE>C-x v r <VAR>name</VAR> <KBD>RET</KBD></CODE>
  5765. <DD>Check out all registered files at or below the current directory level
  5766. using whatever versions correspond to the snapshot <VAR>name</VAR>
  5767. (<CODE>vc-retrieve-snapshot</CODE>).
  5768. This command reports an error if any files are locked at or below the
  5769. current directory, without changing anything; this is to avoid
  5770. overwriting work in progress.
  5771. </DL>
  5772.   A snapshot uses a very small amount of resources--just enough to record
  5773. the list of file names and which version belongs to the snapshot.  Thus,
  5774. you need not hesitate to create snapshots whenever they are useful.
  5775.   You can give a snapshot name as an argument to <KBD>C-x v =</KBD> or
  5776. <KBD>C-x v ~</KBD> (see section <A HREF="xEMACS.HTM#SEC132">Examining And Comparing Old Versions</A>).  Thus, you can use it to compare a
  5777. snapshot against the current files, or two snapshots against each other,
  5778. or a snapshot against a named version.
  5779. <H4><A NAME="SEC137" HREF="xEMACS_TO.HTM#SEC137">Snapshot Caveats</A></H4>
  5780. <A NAME="IDX649"></A>
  5781.   VC's snapshot facilities are modeled on RCS's named-configuration
  5782. support.  They use RCS's native facilities for this, so under VC
  5783. snapshots made using RCS are visible even when you bypass VC.
  5784.   For SCCS, VC implements snapshots itself.  The files it uses contain
  5785. name/file/version-number triples.  These snapshots are visible only
  5786. through VC.
  5787.   A snapshot is a set of checked-in versions.  So make sure that all the
  5788. files are checked in and not locked when you make a snapshot.
  5789.   File renaming and deletion can create some difficulties with snapshots.
  5790. This is not a VC-specific problem, but a general design issue in version
  5791. control systems that no one has solved very well yet.
  5792.   If you rename a registered file, you need to rename its master along
  5793. with it (the command <CODE>vc-rename-file</CODE> does this automatically).  If
  5794. you are using SCCS, you must also update the records of the snapshot, to
  5795. mention the file by its new name (<CODE>vc-rename-file</CODE> does this,
  5796. too).  An old snapshot that refers to a master file that no longer
  5797. exists under the recorded name is invalid; VC can no longer retrieve
  5798. it.  It would be beyond the scope of this manual to explain enough about
  5799. RCS and SCCS to explain how to update the snapshots by hand.
  5800.   Using <CODE>vc-rename-file</CODE> makes the snapshot remain valid for
  5801. retrieval, but it does not solve all problems.  For example, some of the
  5802. files in the program probably refer to others by name.  At the very
  5803. least, the makefile probably mentions the file that you renamed.  If you
  5804. retrieve an old snapshot, the renamed file is retrieved under its new
  5805. name, which is not the name that the makefile expects.  So the program
  5806. won't really work as retrieved.
  5807. <H3><A NAME="SEC138" HREF="xEMACS_TO.HTM#SEC138">Inserting Version Control Headers</A></H3>
  5808.    Sometimes it is convenient to put version identification strings
  5809. directly into working files.  Certain special strings called
  5810. <DFN>version headers</DFN> are replaced in each successive version by the
  5811. number of that version.
  5812. <A NAME="IDX650"></A>
  5813. <A NAME="IDX651"></A>
  5814.   You can use the <KBD>C-x v h</KBD> command (<CODE>vc-insert-headers</CODE>) to
  5815. insert a suitable header string.
  5816. <DL COMPACT>
  5817. <DT><KBD>C-x v h</KBD>
  5818. <DD>Insert headers in a file for use with your version-control system.
  5819. </DL>
  5820. <A NAME="IDX652"></A>
  5821.   The default header string is <SAMP>`\$Id\$'</SAMP> for RCS and <SAMP>`\%W\%'</SAMP>
  5822. for SCCS. (The actual strings inserted do not have the backslashes
  5823. in them.  They were placed in the Info source file so that the
  5824. strings don't get interpreted as version-control headers when the
  5825. Info source files are maintained under version control.) You can
  5826. specify other headers to insert by setting the variable
  5827. <CODE>vc-header-alist</CODE>.  Its value is a list of elements of the form
  5828. <CODE>(<VAR>program</VAR> . <VAR>string</VAR>)</CODE> where <VAR>program</VAR> is <CODE>RCS</CODE>
  5829. or <CODE>SCCS</CODE> and <VAR>string</VAR> is the string to use.
  5830.   Instead of a single string, you can specify a list of strings; then
  5831. each string in the list is inserted as a separate header on a line of
  5832. its own.
  5833.   It is often necessary to use "superfluous" backslashes when writing
  5834. the strings that you put in this variable.  This is to prevent the
  5835. string in the constant from being interpreted as a header itself if the
  5836. Emacs Lisp file containing it is maintained with version control.
  5837. <A NAME="IDX653"></A>
  5838.   Each header is inserted surrounded by tabs, inside comment delimiters,
  5839. on a new line at the start of the buffer.  Normally the ordinary comment
  5840. start and comment end strings of the current mode are used, but for
  5841. certain modes, there are special comment delimiters for this purpose;
  5842. the variable <CODE>vc-comment-alist</CODE> specifies them.  Each element of
  5843. this list has the form <CODE>(<VAR>mode</VAR> <VAR>starter</VAR> <VAR>ender</VAR>)</CODE>.
  5844. <A NAME="IDX654"></A>
  5845.   The variable <CODE>vc-static-header-alist</CODE> specifies further strings
  5846. to add based on the name of the buffer.  Its value should be a list of
  5847. elements of the form <CODE>(<VAR>regexp</VAR> . <VAR>format</VAR>)</CODE>.  Whenever
  5848. <VAR>regexp</VAR> matches the buffer name, <VAR>format</VAR> is inserted as part
  5849. of the header.  A header line is inserted for each element that matches
  5850. the buffer name, and for each string specified by
  5851. <CODE>vc-header-alist</CODE>.  The header line is made by processing the
  5852. string from <CODE>vc-header-alist</CODE> with the format taken from the
  5853. element.  The default value for <CODE>vc-static-header-alist</CODE> is:
  5854. <PRE>
  5855. (("\\.c$" .
  5856.   "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\
  5857. #endif /* lint */\n"))
  5858. </PRE>
  5859. which specifies insertion of a string of this form:
  5860. <PRE>
  5861. #ifndef lint
  5862. static char vcid[] = "<VAR>string</VAR>";
  5863. #endif /* lint */
  5864. </PRE>
  5865. <H2><A NAME="SEC139" HREF="xEMACS_TO.HTM#SEC139">Listing a File Directory</A></H2>
  5866. <A NAME="IDX655"></A>
  5867. <A NAME="IDX656"></A>
  5868.   Files are organized by Unix into <DFN>directories</DFN>.  A <DFN>directory
  5869. listing</DFN> is a list of all the files in a directory.  Emacs provides
  5870. directory listings in brief format (file names only) and verbose format
  5871. (sizes, dates, and authors included).
  5872. <DL COMPACT>
  5873. <DT><KBD>C-x C-d <VAR>dir-or-pattern</VAR></KBD>
  5874. <DD>Print a brief directory listing (<CODE>list-directory</CODE>).
  5875. <DT><KBD>C-u C-x C-d <VAR>dir-or-pattern</VAR></KBD>
  5876. <DD>Print a verbose directory listing.
  5877. </DL>
  5878. <A NAME="IDX657"></A>
  5879. <A NAME="IDX658"></A>
  5880.   To print a directory listing, use <KBD>C-x C-d</KBD>
  5881. (<CODE>list-directory</CODE>).  This command prompts in the minibuffer for a
  5882. file name which is either a  directory to be listed or pattern
  5883. containing wildcards for the files to be listed.  For example,
  5884. <PRE>
  5885. C-x C-d /u2/emacs/etc <KBD>RET</KBD>
  5886. </PRE>
  5887. lists all the files in directory <TT>`/u2/emacs/etc'</TT>.  An example of
  5888. specifying a file name pattern is:
  5889. <PRE>
  5890. C-x C-d /u2/emacs/src/*.c <KBD>RET</KBD>
  5891. </PRE>
  5892.   Normally, <KBD>C-x C-d</KBD> prints a brief directory listing containing just
  5893. file names.  A numeric argument (regardless of value) tells it to print a
  5894. verbose listing (like <CODE>ls -l</CODE>).
  5895. <A NAME="IDX659"></A>
  5896. <A NAME="IDX660"></A>
  5897.   Emacs obtains the text of a directory listing by running <CODE>ls</CODE> in
  5898. an inferior process.  Two Emacs variables control the switches passed to
  5899. <CODE>ls</CODE>: <CODE>list-directory-brief-switches</CODE> is a string giving the
  5900. switches to use in brief listings (<CODE>"-CF"</CODE> by default).
  5901. <CODE>list-directory-verbose-switches</CODE> is a string giving the switches
  5902. to use in a verbose listing (<CODE>"-l"</CODE> by default).
  5903. The variable <CODE>directory-abbrev-alist</CODE> is an alist of abbreviations
  5904. for file directories.  The list consists of elements of the form
  5905. <CODE>(FROM .  TO)</CODE>, each meaning to replace <CODE>FROM</CODE> with <CODE>TO</CODE>
  5906. when it appears in a directory name.  This replacement is done when
  5907. setting up the default directory of a newly visited file.  Every <CODE>FROM</CODE>
  5908. string should start with `<SAMP>`^'</SAMP>'.
  5909. Use this feature when you have directories which you normally refer to
  5910. via absolute symbolic links.  Make <CODE>TO</CODE> the name of the link, and
  5911. <CODE>FROM</CODE> the name it is linked to.
  5912. <A NAME="IDX661"></A>
  5913. <H2><A NAME="SEC140" HREF="xEMACS_TO.HTM#SEC140">Comparing Files</A></H2>
  5914. <A NAME="IDX662"></A>
  5915. <A NAME="IDX663"></A>
  5916.   The command <KBD>M-x diff</KBD> compares two files, displaying the
  5917. differences in an Emacs buffer named <SAMP>`*Diff*'</SAMP>.  It works by running
  5918. the <CODE>diff</CODE> program, using options taken from the variable
  5919. <CODE>diff-switches</CODE>, whose value should be a string.
  5920.   The buffer <SAMP>`*Diff*'</SAMP> has Compilation mode as its major mode, so
  5921. you can use <KBD>C-x `</KBD> to visit successive changed locations in the two
  5922. source files.  You can also move to a particular hunk of changes and
  5923. type <KBD>C-c C-c</KBD> to find the corresponding source location.  You can
  5924. also use the other special commands of Compilation mode: <KBD>SPC</KBD> and
  5925. <KBD>DEL</KBD> for scrolling, and <KBD>M-p</KBD> and <KBD>M-n</KBD> for cursor motion.
  5926. See section <A HREF="xEMACS.HTM#SEC220">Running `make', or Compilers Generally</A>.
  5927. <A NAME="IDX664"></A>
  5928.   The command <KBD>M-x diff-backup</KBD> compares a specified file with its most
  5929. recent backup.  If you specify the name of a backup file,
  5930. <CODE>diff-backup</CODE> compares it with the source file that it is a backup
  5931. <A NAME="IDX665"></A>
  5932. <A NAME="IDX666"></A>
  5933.   The command <KBD>M-x compare-windows</KBD> compares the text in the current
  5934. window with that in the next window.  Comparison starts at point in each
  5935. window.  Point moves forward in each window, a character at a time in each
  5936. window, until the next characters in the two windows are different.  Then
  5937. the command is finished.  For more information about windows in Emacs,
  5938. section <A HREF="xEMACS.HTM#SEC153">Multiple Windows</A>.
  5939. <A NAME="IDX667"></A>
  5940.   With a numeric argument, <CODE>compare-windows</CODE> ignores changes in
  5941. whitespace.  If the variable <CODE>compare-ignore-case</CODE> is
  5942. non-<CODE>nil</CODE>, it ignores differences in case as well.
  5943. <A NAME="IDX668"></A>
  5944. <A NAME="IDX669"></A>
  5945. <H2><A NAME="SEC141" HREF="xEMACS_TO.HTM#SEC141">Dired, the Directory Editor</A></H2>
  5946.   Dired makes it easy to delete or visit many of the files in a single
  5947. directory at once.  It creates an Emacs buffer containing a listing of the
  5948. directory.  You can use the normal Emacs commands to move around in this
  5949. buffer and special Dired commands to operate on the files.
  5950. <H3><A NAME="SEC142" HREF="xEMACS_TO.HTM#SEC142">Entering Dired</A></H3>
  5951. <A NAME="IDX670"></A>
  5952. <A NAME="IDX671"></A>
  5953. <A NAME="IDX672"></A>
  5954.   To invoke dired, type <KBD>C-x d</KBD> or <KBD>M-x dired</KBD>.  The command reads a
  5955. directory name or wildcard file name pattern as a minibuffer argument just
  5956. like the <CODE>list-directory</CODE> command, <KBD>C-x C-d</KBD>.  Where <CODE>dired</CODE>
  5957. differs from <CODE>list-directory</CODE> is in naming the buffer after the
  5958. directory name or the wildcard pattern used for the listing, and putting
  5959. the buffer into Dired mode so that the special commands of Dired are
  5960. available in it.  The variable <CODE>dired-listing-switches</CODE> is a string
  5961. used as an argument to <CODE>ls</CODE> in making the directory; this string
  5962. <I>must</I> contain <SAMP>`-l'</SAMP>.
  5963. <A NAME="IDX673"></A>
  5964. <A NAME="IDX674"></A>
  5965.   To display the Dired buffer in another window rather than in the selected
  5966. window, use <KBD>C-x 4 d</KBD> (<CODE>dired-other-window)</CODE> instead of <KBD>C-x d</KBD>.
  5967. <H3><A NAME="SEC143" HREF="xEMACS_TO.HTM#SEC143">Editing in Dired</A></H3>
  5968.   Once the Dired buffer exists, you can switch freely between it and other
  5969. Emacs buffers.  Whenever the Dired buffer is selected, certain special
  5970. commands are provided that operate on files that are listed.  The Dired
  5971. buffer is "read-only", and inserting text in it is not useful, so
  5972. ordinary printing characters such as <KBD>d</KBD> and <KBD>x</KBD> are used for Dired
  5973. commands.  Most Dired commands operate on the file described by the line
  5974. that point is on.  Some commands perform operations immediately; others
  5975. "flag" a file to be operated on later.
  5976.   Most Dired commands that operate on the current line's file also treat a
  5977. numeric argument as a repeat count, meaning to act on the files of the
  5978. next few lines.  A negative argument means to operate on the files of the
  5979. preceding lines, and leave point on the first of those lines.
  5980.   All the usual Emacs cursor motion commands are available in Dired
  5981. buffers.  Some special purpose commands are also provided.  The keys
  5982. <KBD>C-n</KBD> and <KBD>C-p</KBD> are redefined so that they try to position
  5983. the cursor at the beginning of the filename on the line, rather than
  5984. at the beginning of the line.
  5985.   For extra convenience, <KBD>SPC</KBD> and <KBD>n</KBD> in Dired are equivalent to
  5986. <KBD>C-n</KBD>.  <KBD>p</KBD> is equivalent to <KBD>C-p</KBD>.  Moving by lines is done so
  5987. often in Dired that it deserves to be easy to type.  <KBD>DEL</KBD> (move up and
  5988. unflag) is often useful simply for moving up.<P>
  5989.   The <KBD>g</KBD> command in Dired runs <CODE>revert-buffer</CODE> to reinitialize
  5990. the buffer from the actual disk directory and show any changes made in the
  5991. directory by programs other than Dired.  All deletion flags in the Dired
  5992. buffer are lost when this is done.
  5993. <H3><A NAME="SEC144" HREF="xEMACS_TO.HTM#SEC144">Deleting Files With Dired</A></H3>
  5994.   The primary use of Dired is to flag files for deletion and then delete
  5995. them.
  5996. <DL COMPACT>
  5997. <DT><KBD>d</KBD>
  5998. <DD>Flag this file for deletion.
  5999. <DT><KBD>u</KBD>
  6000. <DD>Remove deletion-flag on this line.
  6001. <DT><KBD><KBD>DEL</KBD></KBD>
  6002. <DD>Remove deletion-flag on previous line, moving point to that line.
  6003. <DT><KBD>x</KBD>
  6004. <DD>Delete the files that are flagged for deletion.
  6005. <DT><KBD>#</KBD>
  6006. <DD>Flag all auto-save files (files whose names start and end with <SAMP>`#'</SAMP>)
  6007. for deletion (see section <A HREF="xEMACS.HTM#SEC122">Auto-Saving: Protection Against Disasters</A>).
  6008. <DT><KBD>~</KBD>
  6009. <DD>Flag all backup files (files whose names end with <SAMP>`~'</SAMP>) for deletion
  6010. (see section <A HREF="xEMACS.HTM#SEC116">Backup Files</A>).
  6011. <DT><KBD>. (Period)</KBD>
  6012. <DD>Flag excess numeric backup files for deletion.  The oldest and newest
  6013. few backup files of any one file are exempt; the middle ones are flagged.
  6014. </DL>
  6015.   You can flag a file for deletion by moving to the line describing the
  6016. file and typing <KBD>d</KBD> or <KBD>C-d</KBD>.  The deletion flag is visible as a
  6017. <SAMP>`D'</SAMP> at the beginning of the line.  Point is moved to the beginning of
  6018. the next line, so that repeated <KBD>d</KBD> commands flag successive files.
  6019.   The files are flagged for deletion rather than deleted immediately to
  6020. avoid the danger of deleting a file accidentally.  Until you direct Dired
  6021. to delete the flagged files, you can remove deletion flags using the
  6022. commands <KBD>u</KBD> and <KBD>DEL</KBD>.  <KBD>u</KBD> works just like <KBD>d</KBD>, but
  6023. removes flags rather than making flags.  <KBD>DEL</KBD> moves upward, removing
  6024. flags; it is like <KBD>u</KBD> with numeric argument automatically negated.
  6025.   To delete the flagged files, type <KBD>x</KBD>.  This command first displays a
  6026. list of all the file names flagged for deletion, and requests confirmation
  6027. with <KBD>yes</KBD>.  Once you confirm, all the flagged files are deleted, and their
  6028. lines are deleted from the text of the Dired buffer.  The shortened Dired
  6029. buffer remains selected.  If you answer <KBD>no</KBD> or quit with <KBD>C-g</KBD>, you
  6030. return immediately to Dired, with the deletion flags still present and no
  6031. files actually deleted.
  6032.   The <KBD>#</KBD>, <KBD>~</KBD>, and <KBD>.</KBD> commands flag many files for
  6033. deletion, based on their names.  These commands are useful precisely
  6034. because they do not actually delete any files; you can remove the
  6035. deletion flags from any flagged files that you really wish to keep.<P>
  6036.   <KBD>#</KBD> flags for deletion all files that appear to have been made by
  6037. auto-saving (that is, files whose names begin and end with <SAMP>`#'</SAMP>).
  6038. <KBD>~</KBD> flags for deletion all files that appear to have been made as
  6039. backups for files that were edited (that is, files whose names end with
  6040. <SAMP>`~'</SAMP>).
  6041. <A NAME="IDX675"></A>
  6042.   <KBD>.</KBD> (Period) flags just some of the backup files for deletion: only
  6043. numeric backups that are not among the oldest few nor the newest few
  6044. backups of any one file.  Normally <CODE>dired-kept-versions</CODE> (not
  6045. <CODE>kept-new-versions</CODE>; that applies only when saving) specifies the
  6046. number of newest versions of each file to keep, and
  6047. <CODE>kept-old-versions</CODE> specifies the number of oldest versions to keep.
  6048. Period with a positive numeric argument, as in <KBD>C-u 3 .</KBD>, specifies the
  6049. number of newest versions to keep, overriding <CODE>dired-kept-versions</CODE>.
  6050. A negative numeric argument overrides <CODE>kept-old-versions</CODE>, using minus
  6051. the value of the argument to specify the number of oldest versions of each
  6052. file to keep.<P>
  6053. <H3><A NAME="SEC145" HREF="xEMACS_TO.HTM#SEC145">Immediate File Operations in Dired</A></H3>
  6054.   Some file operations in Dired take place immediately when they are
  6055. requested.
  6056. <DL COMPACT>
  6057. <DT><KBD>c</KBD>
  6058. <DD>Copies the file described on the current line.  You must supply a file name
  6059. to copy to, using the minibuffer.
  6060. <DT><KBD>f</KBD>
  6061. <DD>Visits the file described on the current line.  It is just like typing
  6062. <KBD>C-x C-f</KBD> and supplying that file name.  If the file on this line is a
  6063. subdirectory, <KBD>f</KBD> actually causes Dired to be invoked on that
  6064. subdirectory.  See section <A HREF="xEMACS.HTM#SEC114">Visiting Files</A>.
  6065. <DT><KBD>o</KBD>
  6066. <DD>Like <KBD>f</KBD>, but uses another window to display the file's buffer.  The
  6067. Dired buffer remains visible in the first window.  This is like using
  6068. <KBD>C-x 4 C-f</KBD> to visit the file.  See section <A HREF="xEMACS.HTM#SEC153">Multiple Windows</A>.
  6069. <DT><KBD>r</KBD>
  6070. <DD>Renames the file described on the current line.  You must supply a file
  6071. name to rename to, using the minibuffer.
  6072. <DT><KBD>v</KBD>
  6073. <DD>Views the file described on this line using <KBD>M-x view-file</KBD>.  Viewing a
  6074. file is like visiting it, but is slanted toward moving around in the file
  6075. conveniently and does not allow changing the file.  See section <A HREF="xEMACS.HTM#SEC146">Miscellaneous File Operations</A>.  Viewing a file that is a directory runs Dired on that
  6076. directory.</DL>
  6077. <H2><A NAME="SEC146" HREF="xEMACS_TO.HTM#SEC146">Miscellaneous File Operations</A></H2>
  6078.   Emacs has commands for performing many other operations on files.
  6079. All operate on one file; they do not accept wildcard file names.
  6080. <A NAME="IDX676"></A>
  6081.   You can use the command <KBD>M-x add-name-to-file</KBD> to add a name to an
  6082. existing file without removing the old name.  The new name must belong
  6083. on the file system that the file is on.
  6084. <A NAME="IDX677"></A>
  6085.   <KBD>M-x append-to-file</KBD> adds the text of the region to the end of the
  6086. specified file.
  6087. <A NAME="IDX678"></A>
  6088. <A NAME="IDX679"></A>
  6089.   <KBD>M-x copy-file</KBD> reads the file <VAR>old</VAR> and writes a new file
  6090. named <VAR>new</VAR> with the same contents.  Confirmation is required if a
  6091. file named <VAR>new</VAR> already exists, because copying overwrites the old
  6092. contents of the file <VAR>new</VAR>.
  6093. <A NAME="IDX680"></A>
  6094. <A NAME="IDX681"></A>
  6095.   <KBD>M-x delete-file</KBD> deletes a specified file, like the <CODE>rm</CODE>
  6096. command in the shell.  If you are deleting many files in one directory, it
  6097. may be more convenient to use Dired (see section <A HREF="xEMACS.HTM#SEC141">Dired, the Directory Editor</A>).
  6098. <A NAME="IDX682"></A>
  6099.   <KBD>M-x insert-file</KBD> inserts a copy of the contents of a specified
  6100. file into the current buffer at point, leaving point unchanged before the
  6101. contents and the mark after them.  See section <A HREF="xEMACS.HTM#SEC60">Selecting Text</A>.
  6102. <A NAME="IDX683"></A>
  6103.   <KBD>M-x make-symbolic-link</KBD> reads two file names <VAR>old</VAR> and
  6104. <VAR>linkname</VAR>, and then creates a symbolic link named <VAR>linkname</VAR>
  6105. and pointing at <VAR>old</VAR>.  Future attempts to open file
  6106. <VAR>linkname</VAR> will then refer to the file named <VAR>old</VAR> at the time
  6107. the opening is done, or will result in an error if the name <VAR>old</VAR> is
  6108. not in use at that time.  Confirmation is required if you create the
  6109. link while <VAR>linkname</VAR> is in use.  Note that not all systems support
  6110. symbolic links.
  6111. <A NAME="IDX684"></A>
  6112.   <KBD>M-x rename-file</KBD> reads two file names <VAR>old</VAR> and <VAR>new</VAR> using
  6113. the minibuffer, then renames file <VAR>old</VAR> as <VAR>new</VAR>.  If a file named
  6114. <VAR>new</VAR> already exists, you must confirm with <KBD>yes</KBD> or renaming is not
  6115. done; this is because renaming causes the previous meaning of the 
  6116. name <VAR>new</VAR> to be lost.  If <VAR>old</VAR> and <VAR>new</VAR> are on different 
  6117. file systems, the file <VAR>old</VAR> is copied and deleted.
  6118. <A NAME="IDX685"></A>
  6119. <A NAME="IDX686"></A>
  6120.   <KBD>M-x view-file</KBD> allows you to scan or read a file by sequential
  6121. screenfuls.  It reads a file name argument using the minibuffer.  After
  6122. reading the file into an Emacs buffer, <CODE>view-file</CODE> reads and displays
  6123. one windowful.  You can then type <KBD>SPC</KBD> to scroll forward one window,
  6124. or <KBD>DEL</KBD> to scroll backward.  Various other commands are provided for
  6125. moving around in the file, but none for changing it; type <KBD>C-h</KBD> while
  6126. viewing a file for a list of them.  Most commands are the default Emacs
  6127. cursor motion commands.  To exit from viewing, type <KBD>C-c</KBD>.
  6128. <H1><A NAME="SEC147" HREF="xEMACS_TO.HTM#SEC147">Using Multiple Buffers</A></H1>
  6129. <A NAME="IDX687"></A>
  6130.   Text you are editing in Emacs resides in an object called a
  6131. <DFN>buffer</DFN>.  Each time you visit a file, Emacs creates a buffer to
  6132. hold the file's text.  Each time you invoke Dired, Emacs creates a buffer
  6133. to hold the directory listing.  If you send a message with <KBD>C-x m</KBD>,
  6134. a buffer named <SAMP>`*mail*'</SAMP> is used to hold the text of the message.
  6135. When you ask for a command's documentation, it appears in a buffer
  6136. called <SAMP>`*Help*'</SAMP>.
  6137. <A NAME="IDX688"></A>
  6138. <A NAME="IDX689"></A>
  6139.   At any time, one and only one buffer is <DFN>selected</DFN>.  It is also
  6140. called the <DFN>current buffer</DFN>.  Saying a command operates on "the
  6141. buffer" really means that the command operates on the selected
  6142. buffer, as most commands do.
  6143.   When Emacs creates multiple windows, each window has a chosen buffer which
  6144. is displayed there, but at any time only one of the windows is selected and
  6145. its chosen buffer is the selected buffer.  Each window's mode line displays
  6146. the name of the buffer the window is displaying (see section <A HREF="xEMACS.HTM#SEC153">Multiple Windows</A>).
  6147.   Each buffer has a name which can be of any length but is
  6148. case-sensitive.  You can select a buffer using its name.  Most
  6149. buffers are created when you visit files; their names are derived from
  6150. the files' names.  You can also create an empty buffer with any name you
  6151. want.  A newly started Emacs has a buffer named <SAMP>`*scratch*'</SAMP> which
  6152. you can use for evaluating Lisp expressions in Emacs.
  6153.   Each buffer records what file it is visiting, whether it is
  6154. modified, and what major mode and minor modes are in effect in it
  6155. (see section <A HREF="xEMACS.HTM#SEC159">Major Modes</A>).  Any Emacs variable can be made <DFN>local to</DFN> a
  6156. particular buffer, meaning its value in that buffer can be different from
  6157. the value in other buffers.  See section <A HREF="xEMACS.HTM#SEC278">Local Variables</A>.
  6158. <A NAME="IDX690"></A>
  6159. <A NAME="IDX691"></A>
  6160. <H2><A NAME="SEC148" HREF="xEMACS_TO.HTM#SEC148">Creating and Selecting Buffers</A></H2>
  6161. <DL COMPACT>
  6162. <DT><KBD>C-x b <VAR>buffer</VAR> <KBD>RET</KBD></KBD>
  6163. <DD>Select or create a buffer named <VAR>buffer</VAR> (<CODE>switch-to-buffer</CODE>).
  6164. <DT><KBD>C-x 4 b <VAR>buffer</VAR> <KBD>RET</KBD></KBD>
  6165. <DD>Similar, but select a buffer named <VAR>buffer</VAR> in another window
  6166. (<CODE>switch-to-buffer-other-window</CODE>).
  6167. <DT><KBD>M-x switch-to-other-buffer <VAR>n</VAR></KBD>
  6168. <DD>Switch to the previous buffer.
  6169. </DL>
  6170. <A NAME="IDX692"></A>
  6171. <A NAME="IDX693"></A>
  6172. <A NAME="IDX694"></A>
  6173. <A NAME="IDX695"></A>
  6174. <A NAME="IDX696"></A>
  6175. <A NAME="IDX697"></A>
  6176.   To select a buffer named <VAR>bufname</VAR>, type <KBD>C-x b <VAR>bufname</VAR>
  6177. <KBD>RET</KBD></KBD>.  This is the command <CODE>switch-to-buffer</CODE> with argument
  6178. <VAR>bufname</VAR>.  You can use completion on an abbreviation for the buffer
  6179. name you want (see section <A HREF="xEMACS.HTM#SEC50">Completion</A>).  An empty argument to <KBD>C-x b</KBD>
  6180. specifies the most recently selected buffer that is not displayed in any
  6181. window.<P>
  6182.   Most buffers are created when you visit files, or use Emacs commands
  6183. that display text.  You can also create a buffer explicitly by typing
  6184. <KBD>C-x b <VAR>bufname</VAR> <KBD>RET</KBD></KBD>, which creates a new, empty buffer
  6185. that is not visiting any file, and selects it for editing.  The new
  6186. buffer's major mode is determined by the value of
  6187. <CODE>default-major-mode</CODE> (see section <A HREF="xEMACS.HTM#SEC159">Major Modes</A>).  Buffers not visiting
  6188. files are usually used for making notes to yourself.  If you try to save
  6189. one, you are asked for the file name to use.
  6190.  The function <CODE>switch-to-buffer-other-screen</CODE> is similar to
  6191. <CODE>switch-to-buffer</CODE> except that it creates a new screen in which to
  6192. display the selected buffer.
  6193. <A NAME="IDX698"></A>
  6194. Use <KBD>M-x switch-to-other-buffer</KBD> to visit the previous buffer. If
  6195. you supply a positive integer <VAR>n</VAR>, the <VAR>n</VAR>th most recent buffer
  6196. is displayed. If you supply an argument of 0, the current buffer is
  6197. moved to the bottom of the buffer stack.
  6198.   Note that you can also use <KBD>C-x C-f</KBD> and any other command for
  6199. visiting a file to switch buffers.  See section <A HREF="xEMACS.HTM#SEC114">Visiting Files</A>.
  6200. <H2><A NAME="SEC149" HREF="xEMACS_TO.HTM#SEC149">Listing Existing Buffers</A></H2>
  6201. <DL COMPACT>
  6202. <DT><KBD>C-x C-b</KBD>
  6203. <DD>List the existing buffers (<CODE>list-buffers</CODE>).
  6204. </DL>
  6205. <A NAME="IDX699"></A>
  6206. <A NAME="IDX700"></A>
  6207.   To print a list of all existing buffers, type <KBD>C-x C-b</KBD>.  Each
  6208. line in the list shows one buffer's name, major mode, and visited file.
  6209. A <SAMP>`*'</SAMP> at the beginning of a line indicates the buffer has been
  6210. "modified".  If several buffers are modified, it may be time to save
  6211. some with <KBD>C-x s</KBD> (see section <A HREF="xEMACS.HTM#SEC115">Saving Files</A>).  A <SAMP>`%'</SAMP> indicates a read-only
  6212. buffer.  A <SAMP>`.'</SAMP> marks the selected buffer.  Here is an example of a
  6213. buffer list:<P>
  6214. <PRE>
  6215.  MR Buffer         Size  Mode           File
  6216.  -- ------         ----  ----           ----
  6217. .*  emacs.tex      383402 Texinfo       /u2/emacs/man/emacs.tex
  6218.     *Help*         1287  Fundamental    
  6219.     files.el       23076 Emacs-Lisp     /u2/emacs/lisp/files.el
  6220.   % RMAIL          64042 RMAIL          /u/rms/RMAIL
  6221.  *% man            747   Dired        /u2/emacs/man/
  6222.     net.emacs      343885 Fundamental   /u/rms/net.emacs
  6223.     fileio.c       27691 C              /u2/emacs/src/fileio.c
  6224.     NEWS           67340 Text           /u2/emacs/etc/NEWS
  6225.     *scratch*       0     Lisp Interaction
  6226. </PRE>
  6227. Note that the buffer <SAMP>`*Help*'</SAMP> was made by a help request; it is not
  6228. visiting any file.  The buffer <CODE>man</CODE> was made by Dired on the
  6229. directory <TT>`/u2/emacs/man/'</TT>.
  6230. As you move the mouse over the <SAMP>`*Buffer List*'</SAMP> buffer, the lines
  6231. are highlighted.  This visual cue indicates that clicking the right
  6232. mouse button (<CODE>button3</CODE>) will pop up a menu of commands on the
  6233. buffer represented by this line.  This menu duplicates most of those
  6234. commands which are bound to keys in the <SAMP>`*Buffer List*'</SAMP> buffer.
  6235. <H2><A NAME="SEC150" HREF="xEMACS_TO.HTM#SEC150">Miscellaneous Buffer Operations</A></H2>
  6236. <DL COMPACT>
  6237. <DT><KBD>C-x C-q</KBD>
  6238. <DD>Toggle read-only status of buffer (<CODE>toggle-read-only</CODE>).
  6239. <DT><KBD>M-x rename-buffer</KBD>
  6240. <DD>Change the name of the current buffer.
  6241. <DT><KBD>M-x view-buffer</KBD>
  6242. <DD>Scroll through a buffer.
  6243. </DL>
  6244. <A NAME="IDX701"></A>
  6245. <A NAME="IDX702"></A>
  6246. <A NAME="IDX703"></A>
  6247. <A NAME="IDX704"></A>
  6248.   A buffer can be <DFN>read-only</DFN>, which means that commands to change
  6249. its text are not allowed.  Normally, read-only buffers are created by
  6250. subsystems such as Dired and Rmail that have special commands to operate
  6251. on the text.  Emacs also creates a read-only buffer if you
  6252. visit a file that is protected.  To make changes in a read-only buffer,
  6253. use the command <KBD>C-x C-q</KBD> (<CODE>toggle-read-only</CODE>).  It makes a
  6254. read-only buffer writable, and makes a writable buffer read-only.  This
  6255. works by setting the variable <CODE>buffer-read-only</CODE>, which has a local
  6256. value in each buffer and makes a buffer read-only if its value is
  6257. non-<CODE>nil</CODE>.
  6258. <A NAME="IDX705"></A>
  6259.   <KBD>M-x rename-buffer</KBD> changes the name of the current buffer,
  6260. prompting for the new name in the minibuffer.  There is no default.  If you
  6261. specify a name that is used by a different buffer, an error is signalled and
  6262. renaming is not done.
  6263. <A NAME="IDX706"></A>
  6264.   <KBD>M-x view-buffer</KBD> is similar to <KBD>M-x view-file</KBD> (see section <A HREF="xEMACS.HTM#SEC146">Miscellaneous File Operations</A>), but it examines an already existing Emacs buffer.  View mode
  6265. provides convenient commands for scrolling through the buffer but not
  6266. for changing it.  When you exit View mode, the resulting value of point
  6267. remains in effect.
  6268. To copy text from one buffer to another, use the commands <KBD>M-x
  6269. append-to-buffer</KBD> and <KBD>M-x insert-buffer</KBD>.  See section <A HREF="xEMACS.HTM#SEC82">Accumulating Text</A>.<P>
  6270. <H2><A NAME="SEC151" HREF="xEMACS_TO.HTM#SEC151">Killing Buffers</A></H2>
  6271.   After using Emacs for a while, you may accumulate a large number of
  6272. buffers and may want to eliminate the ones you no
  6273. longer need.  There are several commands for doing this.
  6274. <DL COMPACT>
  6275. <DT><KBD>C-x k</KBD>
  6276. <DD>Kill a buffer, specified by name (<CODE>kill-buffer</CODE>).
  6277. <DT><KBD>M-x kill-some-buffers</KBD>
  6278. <DD>Offer to kill each buffer, one by one.
  6279. </DL>
  6280. <A NAME="IDX707"></A>
  6281. <A NAME="IDX708"></A>
  6282. <A NAME="IDX709"></A>
  6283.   <KBD>C-x k</KBD> (<CODE>kill-buffer</CODE>) kills one buffer, whose name you
  6284. specify in the minibuffer.  If you type just <KBD>RET</KBD> in the
  6285. minibuffer, the default, killing the current buffer, is used.  If the
  6286. current buffer is killed, the buffer that has been selected recently but
  6287. does not appear in any window now is selected.  If the buffer being
  6288. killed contains unsaved changes, you are asked to confirm with <KBD>yes</KBD>
  6289. before the buffer is killed.
  6290.   The command <KBD>M-x kill-some-buffers</KBD> asks about each buffer, one by
  6291. one.  An answer of <KBD>y</KBD> means to kill the buffer.  Killing the current
  6292. buffer or a buffer containing unsaved changes selects a new buffer or asks
  6293. for confirmation just like <CODE>kill-buffer</CODE>.
  6294. <A NAME="IDX710"></A>
  6295. <H2><A NAME="SEC152" HREF="xEMACS_TO.HTM#SEC152">Operating on Several Buffers</A></H2>
  6296.   The <DFN>buffer-menu</DFN> facility is like a "Dired for buffers"; it allows
  6297. you to request operations on various Emacs buffers by editing a
  6298. buffer containing a list of them.  You can save buffers, kill them
  6299. (here called <DFN>deleting</DFN> them, for consistency with Dired), or display
  6300. them.
  6301. <DL COMPACT>
  6302. <DT><KBD>M-x buffer-menu</KBD>
  6303. <DD>Begin editing a buffer listing all Emacs buffers.
  6304. </DL>
  6305. <A NAME="IDX711"></A>
  6306.   The command <CODE>buffer-menu</CODE> writes a list of all Emacs buffers into
  6307. the buffer <SAMP>`*Buffer List*'</SAMP>, and selects that buffer in Buffer Menu
  6308. mode.  The buffer is read-only.  You can only change it using the special
  6309. commands described in this section.  Most of the commands are graphic
  6310. characters.  You can use  Emacs cursor motion commands in the
  6311. <SAMP>`*Buffer List*'</SAMP> buffer.  If the cursor is on a line describing a
  6312. buffer, the following  special commands apply to that buffer:
  6313. <DL COMPACT>
  6314. <DT><KBD>d</KBD>
  6315. <DD>Request to delete (kill) the buffer, then move down.  A <SAMP>`D'</SAMP> before
  6316. the buffer name on a line indicates a deletion request.  Requested
  6317. deletions actually take place when you use the <KBD>x</KBD> command.
  6318. <DT><KBD>k</KBD>
  6319. <DD>Synonym for <KBD>d</KBD>.
  6320. <DT><KBD>C-d</KBD>
  6321. <DD>Like <KBD>d</KBD> but move up afterwards instead of down.
  6322. <DT><KBD>s</KBD>
  6323. <DD>Request to save the buffer.  An <SAMP>`S'</SAMP> befor the buffer name on a line
  6324. indicates the request.  Requested saves actually take place when you use
  6325. the <KBD>x</KBD> command.  You can request both saving and deletion for the
  6326. same buffer.
  6327. <DT><KBD>~</KBD>
  6328. <DD>Mark buffer "unmodified".  The command <KBD>~</KBD> does this
  6329. immediately when typed.
  6330. <DT><KBD>x</KBD>
  6331. <DD>Perform previously requested deletions and saves.
  6332. <DT><KBD>u</KBD>
  6333. <DD>Remove any request made for the current line, and move down.
  6334. <DT><KBD><KBD>DEL</KBD></KBD>
  6335. <DD>Move to previous line and remove any request made for that line.
  6336. </DL>
  6337.   All commands that add or remove flags to request later operations
  6338. also move down a line.  They accept a numeric argument as a repeat count,
  6339. unless otherwise specified.
  6340.   There are also special commands to use the buffer list to select another
  6341. buffer, and to specify one or more other buffers for display in additional
  6342. windows.
  6343. <DL COMPACT>
  6344. <DT><KBD>1</KBD>
  6345. <DD>Select the buffer in a full-screen window.  This command takes effect
  6346. immediately.
  6347. <DT><KBD>2</KBD>
  6348. <DD>Immediately set up two windows, with this buffer in one and the
  6349. buffer selected before <SAMP>`*Buffer List*'</SAMP> in the other.
  6350. <DT><KBD>f</KBD>
  6351. <DD>Immediately select the buffer in place of the <SAMP>`*Buffer List*'</SAMP> buffer.
  6352. <DT><KBD>o</KBD>
  6353. <DD>Immediately select the buffer in another window as if by <KBD>C-x 4 b</KBD>,
  6354. leaving <SAMP>`*Buffer List*'</SAMP> visible.
  6355. <DT><KBD>q</KBD>
  6356. <DD>Immediately select this buffer, and display any buffers previously
  6357. flagged with the <KBD>m</KBD> command in other windows.  If there are no 
  6358. buffers flagged with <KBD>m</KBD>, this command is equivalent to <KBD>1</KBD>.
  6359. <DT><KBD>m</KBD>
  6360. <DD>Flag this buffer to be displayed in another window if the <KBD>q</KBD>
  6361. command is used.  The request shows as a <SAMP>`>'</SAMP> at the beginning of
  6362. the line.  The same buffer may not have both a delete request and a
  6363. display request.
  6364. </DL>
  6365.  Going back between a <CODE>buffer-menu</CODE> buffer and other Emacs buffers is
  6366. easy.  You can, for example, switch from the <SAMP>`*Buffer List*'</SAMP>
  6367. buffer to another Emacs buffer, and edit there.  You can then reselect the
  6368. <CODE>buffer-menu</CODE> buffer and perform operations already
  6369. requested, or you can kill that buffer or pay no further attention to it.
  6370.  All that <CODE>buffer-menu</CODE> does directly is create and select a
  6371. suitable buffer, and turn on Buffer Menu mode.  All the other
  6372. capabilities of the buffer menu are implemented by special commands
  6373. provided in Buffer Menu mode.  
  6374.   The only difference between <CODE>buffer-menu</CODE> and <CODE>list-buffers</CODE> is
  6375. that <CODE>buffer-menu</CODE> selects the <SAMP>`*Buffer List*'</SAMP> buffer and
  6376. <CODE>list-buffers</CODE> does not.  If you run <CODE>list-buffers</CODE> (that is,
  6377. type <KBD>C-x C-b</KBD>) and select the buffer list manually, you can use all
  6378. the commands described here.
  6379. <A NAME="IDX712"></A>
  6380. <H1><A NAME="SEC153" HREF="xEMACS_TO.HTM#SEC153">Multiple Windows</A></H1>
  6381.   Emacs can split the screen into two or many windows, which can display
  6382. parts of different buffers or different parts of one buffer.  If you are
  6383. running Lucid GNU Emacs under X, that means you can have the X window
  6384. that contains the Emacs screen have multiple subwindows. 
  6385. <H2><A NAME="SEC154" HREF="xEMACS_TO.HTM#SEC154">Concepts of Emacs Windows</A></H2>
  6386.   When Emacs displays multiple windows, each window has one Emacs
  6387. buffer designated for display.  The same buffer may appear in more
  6388. than one window; if it does, any changes in its text are displayed in all
  6389. the windows that display it.  Windows showing the same buffer can
  6390. show different parts of it, because each window has its own value of point.
  6391. <A NAME="IDX713"></A>
  6392.   At any time, one  window is the <DFN>selected window</DFN>; the buffer
  6393.  displayed by that window is the current buffer.  The cursor
  6394. shows the location of point in that window.  Each other window has a
  6395. location of point as well, but since the terminal has only one cursor, it
  6396. cannot show the location of point in the other windows. 
  6397.   Commands to move point affect the value of point for the selected Emacs
  6398. window only.  They do not change the value of point in any other Emacs
  6399. window, including those showing the same buffer.  The same is true for commands
  6400. such as <KBD>C-x b</KBD> to change the selected buffer in the selected window;
  6401. they do not affect other windows at all.  However, there are other commands
  6402. such as <KBD>C-x 4 b</KBD> that select a different window and switch buffers in
  6403. it.  Also, all commands that display information in a window, including
  6404. (for example) <KBD>C-h f</KBD> (<CODE>describe-function</CODE>) and <KBD>C-x C-b</KBD>
  6405. (<CODE>list-buffers</CODE>), work by switching buffers in a non-selected window
  6406. without affecting the selected window.
  6407.   Each window has its own mode line, which displays the buffer name,
  6408. modification status, and major and minor modes of the buffer that is
  6409. displayed in the window.  See section <A HREF="xEMACS.HTM#SEC12">The Mode Line</A>, for details on the mode
  6410. line.
  6411. <H2><A NAME="SEC155" HREF="xEMACS_TO.HTM#SEC155">Splitting Windows</A></H2>
  6412. <DL COMPACT>
  6413. <DT><KBD>C-x 2</KBD>
  6414. <DD>Split the selected window into two windows, one above the other
  6415. (<CODE>split-window-vertically</CODE>).
  6416. <DT><KBD>C-x 3</KBD>
  6417. <DD>Split the selected window into two windows positioned side by side
  6418. (<CODE>split-window-horizontally</CODE>).
  6419. <DT><KBD>C-x 6</KBD>
  6420. <DD>Save the current window configuration in register <VAR>reg</VAR> (a letter).
  6421. <DT><KBD>C-x 7</KBD>
  6422. <DD>Restore (make current) the window configuration in register
  6423. <VAR>reg</VAR> (a letter).  Use with a register previously set with <KBD>C-x 6</KBD>.
  6424. </DL>
  6425. <A NAME="IDX714"></A>
  6426. <A NAME="IDX715"></A>
  6427.   The command <KBD>C-x 2</KBD> (<CODE>split-window-vertically</CODE>) breaks the
  6428. selected window into two windows, one above the other.  Both windows
  6429. start out displaying the same buffer, with the same value of point.  By
  6430. default each of the two windows gets half the height of the window that
  6431. was split.  A numeric argument specifies how many lines to give to the
  6432. top window.
  6433. <A NAME="IDX716"></A>
  6434. <A NAME="IDX717"></A>
  6435.   <KBD>C-x 3</KBD> (<CODE>split-window-horizontally</CODE>) breaks the selected
  6436. window into two side-by-side windows.  A numeric argument specifies how
  6437. many columns to give the one on the left.  A line of vertical bars
  6438. separates the two windows.  Windows that are not the full width of the
  6439. screen have truncated mode lines which do not always appear in inverse
  6440. video, because Emacs display routines cannot display a region of inverse
  6441. video that is only part of a line on the screen.
  6442. <A NAME="IDX718"></A>
  6443.   When a window is less than the full width, many text lines are too
  6444. long to fit.  Continuing all those lines might be confusing.  Set the
  6445. variable <CODE>truncate-partial-width-windows</CODE> to non-<CODE>nil</CODE> to
  6446. force truncation in all windows less than the full width of the screen,
  6447. independent of the buffer and its value for <CODE>truncate-lines</CODE>.
  6448. See section <A HREF="xEMACS.HTM#SEC43">Continuation Lines</A>.<P>
  6449.   Horizontal scrolling is often used in side-by-side windows.
  6450. See section <A HREF="xEMACS.HTM#SEC88">Controlling the Display</A>.
  6451. <A NAME="IDX719"></A>
  6452. <A NAME="IDX720"></A>
  6453. You can resize a window and store that configuration in a register by
  6454. supplying a <VAR>register</VAR> argument to <CODE>window-configuration-to-register</CODE>
  6455. (<KBD>C-x 6</KBD>). To return to the window configuration established with
  6456. <CODE>window-configuration-to-register</CODE>, use <CODE>jump-to-register</CODE>
  6457. (<KBD>C-x j</KBD>).
  6458. <H2><A NAME="SEC156" HREF="xEMACS_TO.HTM#SEC156">Using Other Windows</A></H2>
  6459. <DL COMPACT>
  6460. <DT><KBD>C-x o</KBD>
  6461. <DD>Select another window (<CODE>other-window</CODE>).  That is the letter `o', not zero.
  6462. <DT><KBD>M-C-v</KBD>
  6463. <DD>Scroll the next window (<CODE>scroll-other-window</CODE>).
  6464. <DT><KBD>M-x compare-windows</KBD>
  6465. <DD>Find the next place where the text in the selected window does not match
  6466. the text in the next window.
  6467. <DT><KBD>M-x other-window-any-screen <VAR>n</VAR></KBD>
  6468. <DD>Select the <VAR>n</VAR>th different window on any screen.
  6469. </DL>
  6470. <A NAME="IDX721"></A>
  6471. <A NAME="IDX722"></A>
  6472.   To select a different window, use <KBD>C-x o</KBD> (<CODE>other-window</CODE>).
  6473. That is an `o', for `other', not a zero.  When there are more than
  6474. two windows, the command moves through all the windows in a cyclic
  6475. order, generally top to bottom and left to right.  From the rightmost
  6476. and bottommost window, it goes back to the one at the upper left corner.
  6477. A numeric argument, <VAR>n</VAR>, moves several steps in the cyclic order of
  6478. windows. A negative numeric argument moves around the cycle in the
  6479. opposite order.  If the optional second argument <VAR>all_screens</VAR> is
  6480. non-<CODE>nil</CODE>, the function cycles through all screens.  When the
  6481. minibuffer is active, the minibuffer is the last window in the cycle;
  6482. you can switch from the minibuffer window to one of the other windows,
  6483. and later switch back and finish supplying the minibuffer argument that
  6484. is requested.  See section <A HREF="xEMACS.HTM#SEC49">Editing in the Minibuffer</A>.
  6485. <A NAME="IDX723"></A>
  6486.  The command <KBD>M-x other-window-any-screen</KBD> also selects the window
  6487. <VAR>n</VAR> steps away in the cyclic order.  However, unlike <CODE>other-window</CODE>,
  6488. this command selects a window on the next or previous screen instead of
  6489. wrapping around to the top or bottom of the current screen, when there
  6490. are no more windows.
  6491. <A NAME="IDX724"></A>
  6492. <A NAME="IDX725"></A>
  6493.   The usual scrolling commands (see section <A HREF="xEMACS.HTM#SEC88">Controlling the Display</A>) apply to the selected
  6494. window only.  <KBD>M-C-v</KBD> (<CODE>scroll-other-window</CODE>) scrolls the
  6495. window that <KBD>C-x o</KBD> would select.  Like <KBD>C-v</KBD>, it takes positive
  6496. and negative arguments. 
  6497. <A NAME="IDX726"></A>
  6498.   The command <KBD>M-x compare-windows</KBD> compares the text in the current
  6499. window with the text in the next window.  Comparison starts at point in each
  6500. window.  Point moves forward in each window, a character at a time,
  6501. until the next set of characters in the two windows are different.  Then the
  6502. command is finished.
  6503. A prefix argument <VAR>ignore-whitespace</VAR> means ignore changes in
  6504. whitespace.  The variable <CODE>compare-windows-whitespace</CODE> controls how
  6505. whitespace is skipped.
  6506. If <CODE>compare-ignore-case</CODE> is non-<CODE>nil</CODE>, changes in case are
  6507. also ignored.
  6508. <H2><A NAME="SEC157" HREF="xEMACS_TO.HTM#SEC157">Displaying in Another Window</A></H2>
  6509. <A NAME="IDX727"></A>
  6510.   <KBD>C-x 4</KBD> is a prefix key for commands that select another window
  6511. (splitting the window if there is only one) and select a buffer in that
  6512. window.  Different <KBD>C-x 4</KBD> commands have different ways of finding the
  6513. buffer to select.
  6514. <A NAME="IDX728"></A>
  6515. <A NAME="IDX729"></A>
  6516. <A NAME="IDX730"></A>
  6517. <A NAME="IDX731"></A>
  6518. <A NAME="IDX732"></A>
  6519. <DL COMPACT>
  6520. <DT><KBD>C-x 4 b <VAR>bufname</VAR> <KBD>RET</KBD></KBD>
  6521. <DD>Select buffer <VAR>bufname</VAR> in another window.  This runs 
  6522. <CODE>switch-to-buffer-other-window</CODE>.
  6523. <DT><KBD>C-x 4 f <VAR>filename</VAR> <KBD>RET</KBD></KBD>
  6524. <DD>Visit file <VAR>filename</VAR> and select its buffer in another window.  This
  6525. runs <CODE>find-file-other-window</CODE>.  See section <A HREF="xEMACS.HTM#SEC114">Visiting Files</A>.
  6526. <DT><KBD>C-x 4 d <VAR>directory</VAR> <KBD>RET</KBD></KBD>
  6527. <DD>Select a Dired buffer for directory <VAR>directory</VAR> in another window.
  6528. This runs <CODE>dired-other-window</CODE>.  See section <A HREF="xEMACS.HTM#SEC141">Dired, the Directory Editor</A>.
  6529. <DT><KBD>C-x 4 m</KBD>
  6530. <DD>Start composing a mail message in another window.  This runs
  6531. <CODE>mail-other-window</CODE>, and its same-window version is <KBD>C-x m</KBD>
  6532. (see section <A HREF="xEMACS.HTM#SEC241">Sending Mail</A>).
  6533. <DT><KBD>C-x 4 .</KBD>
  6534. <DD>Find a tag in the current tag table in another window.  This runs
  6535. <CODE>find-tag-other-window</CODE>, the multiple-window variant of <KBD>M-.</KBD>
  6536. (see section <A HREF="xEMACS.HTM#SEC201">Tag Tables</A>).
  6537. </DL>
  6538. <A NAME="IDX733"></A>
  6539. If the variable <CODE>display-buffer-function</CODE> is non-<CODE>nil</CODE>, its value is
  6540. the function to call to handle <CODE>display-buffer</CODE>. It receives two
  6541. arguments, the buffer and a flag that if non-<CODE>nil</CODE> means that the
  6542. currently selected window is not acceptable. Commands such as
  6543. <CODE>switch-to-buffer-other-window</CODE> and <CODE>find-file-other-window</CODE>
  6544. work using this function.
  6545. <H2><A NAME="SEC158" HREF="xEMACS_TO.HTM#SEC158">Deleting and Rearranging Windows</A></H2>
  6546. <DL COMPACT>
  6547. <DT><KBD>C-x 0</KBD>
  6548. <DD>Get rid of the selected window (<CODE>delete-window</CODE>).  That is a zero. 
  6549. If there is more than one Emacs screen, deleting the sole remaining
  6550. window on that screen deletes the screen as well. If the current screen
  6551. is the only screen, it is not deleted. 
  6552. <DT><KBD>C-x 1</KBD>
  6553. <DD>Get rid of all windows except the selected one
  6554. (<CODE>delete-other-windows</CODE>).
  6555. <DT><KBD>C-x ^</KBD>
  6556. <DD>Make the selected window taller, at the expense of the other(s)
  6557. <BR>(<CODE>enlarge-window</CODE>).
  6558. <DT><KBD>C-x }</KBD>
  6559. <DD>Make the selected window wider (<CODE>enlarge-window-horizontally</CODE>).
  6560. </DL>
  6561. <A NAME="IDX734"></A>
  6562. <A NAME="IDX735"></A>
  6563.   To delete a window, type <KBD>C-x 0</KBD> (<CODE>delete-window</CODE>).  (That is a
  6564. zero.)  The space occupied by the deleted window is distributed among the
  6565. other active windows (but not the minibuffer window, even if that is active
  6566. at the time).  Once a window is deleted, its attributes are forgotten;
  6567. there is no automatic way to make another window of the same shape or
  6568. showing the same buffer.  The buffer continues to exist, and you can
  6569. select it in any window with <KBD>C-x b</KBD>.
  6570. <A NAME="IDX736"></A>
  6571. <A NAME="IDX737"></A>
  6572.   <KBD>C-x 1</KBD> (<CODE>delete-other-windows</CODE>) is more powerful than <KBD>C-x 0</KBD>;
  6573. it deletes all the windows except the selected one (and the minibuffer).
  6574. The selected window expands to use the whole screen except for the echo
  6575. area.
  6576. <A NAME="IDX738"></A>
  6577. <A NAME="IDX739"></A>
  6578. <A NAME="IDX740"></A>
  6579. <A NAME="IDX741"></A>
  6580. <A NAME="IDX742"></A>
  6581. <A NAME="IDX743"></A>
  6582.   To readjust the division of space among existing windows, use <KBD>C-x
  6583. ^</KBD> (<CODE>enlarge-window</CODE>).  It makes the currently selected window
  6584. longer by one line or as many lines as a numeric argument specifies.
  6585. With a negative argument, it makes the selected window smaller.
  6586. <KBD>C-x }</KBD> (<CODE>enlarge-window-horizontally</CODE>) makes the selected
  6587. window wider by the specified number of columns.  The extra screen space
  6588. given to a window comes from one of its neighbors, if that is possible;
  6589. otherwise, all the competing windows are shrunk in the same proportion.
  6590. If this makes some windows too small, those windows are deleted and their
  6591. space is divided up.   Minimum window size is specified by the variables
  6592. <CODE>window-min-height</CODE> and <CODE>window-min-width</CODE>.
  6593. You can also resize windows within a screen by clicking the left mouse
  6594. button on a modeline, and dragging.
  6595. Clicking the right button on a mode line pops up a menu of common window
  6596. manager operations.  This menu contains the following options:
  6597. <A NAME="IDX744"></A>
  6598. <A NAME="IDX745"></A>
  6599. <A NAME="IDX746"></A>
  6600. <DL COMPACT>
  6601. <DT><B>Delete Window</B>
  6602. <DD>Remove the window above this modeline from the screen.
  6603. <DT><B>Delete Other Windows</B>
  6604. <DD>Delete all windows on the screen except for the one above this modeline.
  6605. <DT><B>Split Window</B>
  6606. <DD>Split the window above the mode line in half, creating another window.
  6607. <DT><B>Split Window Horizontally</B>
  6608. <DD>Split the window above the mode line in half horizontally, so that there
  6609. will be two windows side-by-side.
  6610. <DT><B>Balance Windows</B>
  6611. <DD>Readjust the sizes of all windows on the screen until all windows have
  6612. roughly the same number of lines.
  6613. </DL>
  6614. <A NAME="IDX747"></A>
  6615. <A NAME="IDX748"></A>
  6616. <A NAME="IDX749"></A>
  6617. <A NAME="IDX750"></A>
  6618. <H1><A NAME="SEC159" HREF="xEMACS_TO.HTM#SEC159">Major Modes</A></H1>
  6619.   Emacs has many different <DFN>major modes</DFN>, each of which customizes
  6620. Emacs for editing text of a particular sort.  The major modes are mutually
  6621. exclusive;  at any time, each buffer has one major mode.  The mode line
  6622. normally contains the name of the current major mode in parentheses.
  6623. See section <A HREF="xEMACS.HTM#SEC12">The Mode Line</A>.
  6624.   The least specialized major mode is called <DFN>Fundamental mode</DFN>.  This
  6625. mode has no mode-specific redefinitions or variable settings.  Each
  6626. Emacs command behaves in its most general manner, and each option is in its
  6627. default state.  For editing any specific type of text, such as Lisp code or
  6628. English text, you should switch to the appropriate major mode, such as Lisp
  6629. mode or Text mode.
  6630.   Selecting a major mode changes the meanings of a few keys to become
  6631. more specifically adapted to the language being edited.  <KBD>TAB</KBD>,
  6632. <KBD>DEL</KBD>, and <KBD>LFD</KBD> are changed frequently.  In addition, commands
  6633. which handle comments use the mode to determine how to delimit comments.
  6634. Many major modes redefine the syntactical properties of characters
  6635. appearing in the buffer.  See section <A HREF="xEMACS.HTM#SEC289">The Syntax Table</A>.
  6636.   The major modes fall into three major groups.  Lisp mode (which has
  6637. several variants), C mode, and Muddle mode are for specific programming
  6638. languages.  Text mode, Nroff mode, TeX mode, and Outline mode are for
  6639. editing English text.  The remaining major modes are not intended for use
  6640. on users' files; they are used in buffers created by Emacs for specific
  6641. purposes and include Dired mode for buffers made by Dired (see section <A HREF="xEMACS.HTM#SEC141">Dired, the Directory Editor</A>),
  6642. Mail mode for buffers made by <KBD>C-x m</KBD> (see section <A HREF="xEMACS.HTM#SEC241">Sending Mail</A>), and Shell
  6643. mode for buffers used for communicating with an inferior shell process
  6644. (see section <A HREF="xEMACS.HTM#SEC263">Interactive Inferior Shell</A>).
  6645.   Most programming language major modes specify that only blank lines
  6646. separate paragraphs.  This is so that the paragraph commands remain useful.
  6647. See section <A HREF="xEMACS.HTM#SEC177">Paragraphs</A>.  They also cause Auto Fill mode to use the definition of
  6648. <KBD>TAB</KBD> to indent the new lines it creates.  This is because most lines
  6649. in a program are usually indented.  See section <A HREF="xEMACS.HTM#SEC161">Indentation</A>.
  6650. <H2><A NAME="SEC160" HREF="xEMACS_TO.HTM#SEC160">Choosing Major Modes</A></H2>
  6651.   You can select a major mode explicitly for the current buffer, but
  6652. most of the time Emacs determines which mode to use based on the file
  6653. name or some text in the file.
  6654.   Use a <KBD>M-x</KBD> command to explicitly select a new major mode.  Add
  6655. <CODE>-mode</CODE> to the name of a major mode to get the name of a command to
  6656. select that mode.  For example, to enter Lisp mode, execute <KBD>M-x
  6657. lisp-mode</KBD>.
  6658. <A NAME="IDX751"></A>
  6659.   When you visit a file, Emacs usually chooses the right major mode
  6660. based on the file's name.  For example, files whose names end in
  6661. <CODE>.c</CODE> are edited in C mode.  The variable <CODE>auto-mode-alist</CODE>
  6662. controls the correspondence between file names and major mode.  Its value
  6663. is a list in which each element has the form:
  6664. <PRE>
  6665. (<VAR>regexp</VAR> . <VAR>mode-function</VAR>)
  6666. </PRE>
  6667. For example, one element normally found in the list has the form
  6668. <CODE>(<TT>"\\.c$"</TT> . c-mode)</CODE>. It is responsible for selecting C mode
  6669. for files whose names end in <TT>`.c'</TT>.  (Note that <SAMP>`\\'</SAMP> is needed in
  6670. Lisp syntax to include a <SAMP>`\'</SAMP> in the string, which is needed to
  6671. suppress the special meaning of <SAMP>`.'</SAMP> in regexps.)  The only practical
  6672. way to change this variable is with Lisp code.
  6673.   You can specify which major mode should be used for editing a certain
  6674. file by a special sort of text in the first non-blank line of the file.
  6675. The mode name should appear in this line both preceded and followed by
  6676. <SAMP>`-*-'</SAMP>.  Other text may appear on the line as well.  For example,
  6677. <PRE>
  6678. ;-*-Lisp-*-
  6679. </PRE>
  6680. tells Emacs to use Lisp mode.  Note how the semicolon is used to make Lisp
  6681. treat this line as a comment.  Such an explicit specification overrides any
  6682. default mode based on the file name.
  6683.   Another format of mode specification is:
  6684. <PRE>
  6685. -*-Mode: <VAR>modename</VAR>;-*-
  6686. </PRE>
  6687. which allows other things besides the major mode name to be specified.
  6688. However, Emacs does not look for anything except the mode name.
  6689. The major mode can also be specified in a local variables list.
  6690. See section <A HREF="xEMACS.HTM#SEC279">Local Variables in Files</A>.
  6691. <A NAME="IDX752"></A>
  6692.   When you visit a file that does not specify a major mode to use, or
  6693. when you create a new buffer with <KBD>C-x b</KBD>, Emacs uses the major mode
  6694. specified by the variable <CODE>default-major-mode</CODE>.  Normally this
  6695. value is the symbol <CODE>fundamental-mode</CODE>, which specifies Fundamental
  6696. mode.  If <CODE>default-major-mode</CODE> is <CODE>nil</CODE>, the major mode is
  6697. taken from the previously selected buffer.
  6698. <A NAME="IDX753"></A>
  6699. <H1><A NAME="SEC161" HREF="xEMACS_TO.HTM#SEC161">Indentation</A></H1>
  6700. <DL COMPACT>
  6701. <DT><KBD><KBD>TAB</KBD></KBD>
  6702. <DD>Indent current line "appropriately" in a mode-dependent fashion.
  6703. <DT><KBD><KBD>LFD</KBD></KBD>
  6704. <DD>Perform <KBD>RET</KBD> followed by <KBD>TAB</KBD> (<CODE>newline-and-indent</CODE>).
  6705. <DT><KBD>M-^</KBD>
  6706. <DD>Merge two lines (<CODE>delete-indentation</CODE>).  This would cancel out
  6707. the effect of <KBD>LFD</KBD>.
  6708. <DT><KBD>C-M-o</KBD>
  6709. <DD>Split line at point; text on the line after point becomes a new line
  6710. indented to the same column that it now starts in (<CODE>split-line</CODE>).
  6711. <DT><KBD>M-m</KBD>
  6712. <DD>Move (forward or back) to the first non-blank character on the current
  6713. line (<CODE>back-to-indentation</CODE>).
  6714. <DT><KBD>C-M-\</KBD>
  6715. <DD>Indent several lines to same column (<CODE>indent-region</CODE>).
  6716. <DT><KBD>C-x <KBD>TAB</KBD></KBD>
  6717. <DD>Shift block of lines rigidly right or left (<CODE>indent-rigidly</CODE>).
  6718. <DT><KBD>M-i</KBD>
  6719. <DD>Indent from point to the next prespecified tab stop column
  6720. (<CODE>tab-to-tab-stop</CODE>).
  6721. <DT><KBD>M-x indent-relative</KBD>
  6722. <DD>Indent from point to under an indentation point in the previous line.
  6723. </DL>
  6724. <A NAME="IDX754"></A>
  6725. <A NAME="IDX755"></A>
  6726.   Most programming languages have some indentation convention.  For Lisp
  6727. code, lines are indented according to their nesting in parentheses.  The
  6728. same general idea is used for C code, though details differ.
  6729.    Use the <KBD>TAB</KBD> command to indent a line whatever the language.
  6730. Each major mode defines this command to perform indentation appropriate
  6731. for the particular language.  In Lisp mode, <KBD>TAB</KBD> aligns a line
  6732. according to its depth in parentheses.  No matter where in the line you
  6733. are when you type <KBD>TAB</KBD>, it aligns the line as a whole.  In C mode,
  6734. <KBD>TAB</KBD> implements a subtle and sophisticated indentation style that
  6735. knows about many aspects of C syntax.
  6736. <A NAME="IDX756"></A>
  6737.   In Text mode, <KBD>TAB</KBD> runs the command <CODE>tab-to-tab-stop</CODE>, which
  6738. indents to the next tab stop column.  You can set the tab stops with
  6739. <KBD>M-x edit-tab-stops</KBD>.
  6740. <H2><A NAME="SEC162" HREF="xEMACS_TO.HTM#SEC162">Indentation Commands and Techniques</A></H2>
  6741.   If you just want to insert a tab character in the buffer, you can type
  6742. <KBD>C-q <KBD>TAB</KBD></KBD>.
  6743. <A NAME="IDX757"></A>
  6744. <A NAME="IDX758"></A>
  6745.   To move over the indentation on a line, type <KBD>Meta-m</KBD>
  6746. (<CODE>back-to-indentation</CODE>).  This command, given anywhere on a line,
  6747. positions point at the first non-blank character on the line.
  6748.   To insert an indented line before the current line, type <KBD>C-a C-o
  6749. <KBD>TAB</KBD></KBD>.  To make an indented line after the current line, use
  6750. <KBD>C-e <KBD>LFD</KBD></KBD>.
  6751. <A NAME="IDX759"></A>
  6752. <A NAME="IDX760"></A>
  6753.   <KBD>C-M-o</KBD> (<CODE>split-line</CODE>) moves the text from point to the end of
  6754. the line vertically down, so that the current line becomes two lines.
  6755. <KBD>C-M-o</KBD> first moves point forward over any spaces and tabs.  Then it
  6756. inserts after point a newline and enough indentation to reach the same
  6757. column point is on.  Point remains before the inserted newline; in this
  6758. regard, <KBD>C-M-o</KBD> resembles <KBD>C-o</KBD>.
  6759. <A NAME="IDX761"></A>
  6760. <A NAME="IDX762"></A>
  6761. <A NAME="IDX763"></A>
  6762. <A NAME="IDX764"></A>
  6763.   To join two lines cleanly, use the <KBD>Meta-^</KBD>
  6764. (<CODE>delete-indentation</CODE>) command to delete the indentation at the
  6765. front of the current line, and the line boundary as well.  Empty spaces
  6766. are replaced by a single space, or by no space if at the beginning of a
  6767. line, before a close parenthesis, or after an open parenthesis.  
  6768. To delete just the indentation of a line, go to the beginning of the 
  6769. line and use <KBD>Meta-\</KBD> (<CODE>delete-horizontal-space</CODE>), which 
  6770. deletes all spaces and tabs around the cursor.
  6771. <A NAME="IDX765"></A>
  6772. <A NAME="IDX766"></A>
  6773. <A NAME="IDX767"></A>
  6774. <A NAME="IDX768"></A>
  6775.   There are also commands for changing the indentation of several lines at
  6776. once.  <KBD>Control-Meta-\</KBD> (<CODE>indent-region</CODE>) gives each line which
  6777. begins in the region the "usual" indentation by invoking <KBD>TAB</KBD> at the
  6778. beginning of the line.  A numeric argument specifies the column to indent
  6779. to.  Each line is shifted left or right so that its first non-blank
  6780. character appears in that column.  <KBD>C-x <KBD>TAB</KBD></KBD>
  6781. (<CODE>indent-rigidly</CODE>) moves all the lines in the region right by its
  6782. argument (left, for negative arguments).  The whole group of lines moves
  6783. rigidly sideways, which is how the command gets its name.<A NAME="IDX769"></A>
  6784.   <KBD>M-x indent-relative</KBD> indents at point based on the previous line
  6785. (actually, the last non-empty line.)  It inserts whitespace at point, moving
  6786. point, until it is underneath an indentation point in the previous line.
  6787. An indentation point is the end of a sequence of whitespace or the end of
  6788. the line.  If point is farther right than any indentation point in the
  6789. previous line, the whitespace before point is deleted and the first
  6790. indentation point then applicable is used.  If no indentation point is
  6791. applicable even then, <CODE>tab-to-tab-stop</CODE> is run (see next section).
  6792.   <CODE>indent-relative</CODE> is the definition of <KBD>TAB</KBD> in Indented Text
  6793. mode.  See section <A HREF="xEMACS.HTM#SEC165">Commands for Human Languages</A>.
  6794. <H2><A NAME="SEC163" HREF="xEMACS_TO.HTM#SEC163">Tab Stops</A></H2>
  6795. <A NAME="IDX770"></A>
  6796. <A NAME="IDX771"></A>
  6797.   For typing in tables, you can use Text mode's definition of <KBD>TAB</KBD>,
  6798. <CODE>tab-to-tab-stop</CODE>.  This command inserts indentation before point,
  6799. enough to reach the next tab stop column.  Even if you are not in Text mode,
  6800. this function is associated with <KBD>M-i</KBD> anyway.
  6801. <A NAME="IDX772"></A>
  6802. <A NAME="IDX773"></A>
  6803. <A NAME="IDX774"></A>
  6804. <A NAME="IDX775"></A>
  6805.   You can arbitrarily set the tab stops used by <KBD>M-i</KBD>.  They are
  6806. stored as a list of column-numbers in increasing order in the variable
  6807. <CODE>tab-stop-list</CODE>.
  6808.   The convenient way to set the tab stops is using <KBD>M-x edit-tab-stops</KBD>,
  6809. which creates and selects a buffer containing a description of the tab stop
  6810. settings.  You can edit this buffer to specify different tab stops, and
  6811. then type <KBD>C-c C-c</KBD> to make those new tab stops take effect.  In the
  6812. tab stop buffer, <KBD>C-c C-c</KBD> runs the function
  6813. <CODE>edit-tab-stops-note-changes</CODE> rather than the default
  6814. <CODE>save-buffer</CODE>.  <CODE>edit-tab-stops</CODE> records which buffer was current
  6815. when you invoked it, and stores the tab stops in that buffer.  Normally
  6816. all buffers share the same tab stops and changing them in one buffer
  6817. affects all.  If you make <CODE>tab-stop-list</CODE> local in one
  6818. buffer <CODE>edit-tab-stops</CODE> in that buffer edits only the local
  6819. settings.
  6820.   Below is the text representing ordinary tab stops every eight columns:
  6821. <PRE>
  6822.         :       :       :       :       :       :
  6823. 0         1         2         3         4
  6824. 0123456789012345678901234567890123456789012345678
  6825. To install changes, type C-c C-c
  6826. </PRE>
  6827.   The first line contains a colon at each tab stop.  The remaining lines
  6828. help you see where the colons are and tell you what to do.
  6829.   Note that the tab stops that control <CODE>tab-to-tab-stop</CODE> have nothing
  6830. to do with displaying tab characters in the buffer.  See section <A HREF="xEMACS.HTM#SEC92">Variables Controlling Display</A>,
  6831. for more information on that.
  6832. <H2><A NAME="SEC164" HREF="xEMACS_TO.HTM#SEC164">Tabs vs. Spaces</A></H2>
  6833. <A NAME="IDX776"></A>
  6834.   Emacs normally uses both tabs and spaces to indent lines.  If you prefer,
  6835. all indentation can be made from spaces only.  To request this, set
  6836. <CODE>indent-tabs-mode</CODE> to <CODE>nil</CODE>.  This is a per-buffer variable;
  6837. altering the variable affects only the current buffer, but there is a
  6838. default value which you can change as well.  See section <A HREF="xEMACS.HTM#SEC278">Local Variables</A>.
  6839. <A NAME="IDX777"></A>
  6840. <A NAME="IDX778"></A>
  6841.   There are also commands to convert tabs to spaces or vice versa, always
  6842. preserving the columns of all non-blank text.  <KBD>M-x tabify</KBD> scans the
  6843. region for sequences of spaces, and converts sequences of at least three
  6844. spaces to tabs if that is possible without changing indentation.  <KBD>M-x
  6845. untabify</KBD> changes all tabs in the region to corresponding numbers of spaces.
  6846. <A NAME="IDX779"></A>
  6847. <H1><A NAME="SEC165" HREF="xEMACS_TO.HTM#SEC165">Commands for Human Languages</A></H1>
  6848.   The term <DFN>text</DFN> has two widespread meanings in our area of the
  6849. computer field.  One is data that is a sequence of characters.  In this
  6850. sense of the word any file that you edit with Emacs is text.  The other
  6851. meaning is more restrictive: a sequence of characters in a human
  6852. language for humans to read (possibly after processing by a text
  6853. formatter), as opposed to a program or commands for a program.
  6854.   Human languages have syntactic and stylistic conventions that editor
  6855. commands should support or use to advantage: conventions involving
  6856. words, sentences, paragraphs, and capital letters.  This chapter describes
  6857. Emacs commands for all these things.  There are also commands for
  6858. <DFN>filling</DFN>, or rearranging paragraphs into lines of approximately equal
  6859. length.  The commands for moving over and killing words, sentences,
  6860. and paragraphs, while intended primarily for editing text, are also often
  6861. useful for editing programs.
  6862.   Emacs has several major modes for editing human language text.
  6863. If a file contains plain text, use Text mode, which customizes
  6864. Emacs in small ways for the syntactic conventions of text.  For text which
  6865. contains embedded commands for text formatters, Emacs has other major modes,
  6866. each for a particular text formatter.  Thus, for input to TeX, you can
  6867. use TeX mode; for input to nroff, Nroff mode.
  6868. <H2><A NAME="SEC166" HREF="xEMACS_TO.HTM#SEC166">Text Mode</A></H2>
  6869. <A NAME="IDX780"></A>
  6870. <A NAME="IDX781"></A>
  6871. <A NAME="IDX782"></A>
  6872. <A NAME="IDX783"></A>
  6873. <A NAME="IDX784"></A>
  6874.   You should use Text mode--rather than Fundamental or Lisp mode--to
  6875. edit files of text in a human language.  Invoke <KBD>M-x text-mode</KBD> to
  6876. enter Text mode.  In Text mode, <KBD>TAB</KBD> runs the function
  6877. <CODE>tab-to-tab-stop</CODE>, which allows you to use arbitrary tab stops set
  6878. with <KBD>M-x edit-tab-stops</KBD> (see section <A HREF="xEMACS.HTM#SEC163">Tab Stops</A>).  Features concerned
  6879. with comments in programs are turned off unless they are explicitly invoked.
  6880. The syntax table is changed so that periods are not considered part of a
  6881. word, while apostrophes, backspaces and underlines are.
  6882. <A NAME="IDX785"></A>
  6883.   A similar variant mode is Indented Text mode, intended for editing
  6884. text in which most lines are indented.  This mode defines <KBD>TAB</KBD> to
  6885. run <CODE>indent-relative</CODE> (see section <A HREF="xEMACS.HTM#SEC161">Indentation</A>), and makes Auto Fill
  6886. indent the lines it creates.  As a result, a line made by Auto Filling,
  6887. or by <KBD>LFD</KBD>, is normally indented just like the previous line.  Use
  6888. <KBD>M-x indented-text-mode</KBD> to select this mode.
  6889. <A NAME="IDX786"></A>
  6890.   Entering Text mode or Indented Text mode calls the value of the
  6891. variable <CODE>text-mode-hook</CODE> with no arguments, if that value exists
  6892. and is not <CODE>nil</CODE>.  This value is also called when modes related to
  6893. Text mode are entered; this includes Nroff mode, TeX mode, Outline
  6894. mode, and Mail mode.  Your hook can look at the value of
  6895. <CODE>major-mode</CODE> to see which of these modes is actually being entered.
  6896.   Two modes similar to Text mode are of use for editing text that is to
  6897. be passed through a text formatter before achieving its final readable form.
  6898. <H3><A NAME="SEC167" HREF="xEMACS_TO.HTM#SEC167">Nroff Mode</A></H3>
  6899. <A NAME="IDX787"></A>
  6900. <A NAME="IDX788"></A>
  6901.   Nroff mode is a mode like Text mode but modified to handle nroff
  6902. commands present in the text.  Invoke <KBD>M-x nroff-mode</KBD> to enter this
  6903. mode.  Nroff mode differs from Text mode in only a few ways.  All nroff
  6904. command lines are considered paragraph separators, so that filling never
  6905. garbles the nroff commands.  Pages are separated by <SAMP>`.bp'</SAMP> commands.
  6906. Comments start with backslash-doublequote.  There are also three special
  6907. commands that are not available in Text mode:
  6908. <A NAME="IDX789"></A>
  6909. <A NAME="IDX790"></A>
  6910. <A NAME="IDX791"></A>
  6911. <A NAME="IDX792"></A>
  6912. <A NAME="IDX793"></A>
  6913. <A NAME="IDX794"></A>
  6914. <DL COMPACT>
  6915. <DT><KBD>M-n</KBD>
  6916. <DD>Move to the beginning of the next line that isn't an nroff command
  6917. (<CODE>forward-text-line</CODE>).  An argument is a repeat count.
  6918. <DT><KBD>M-p</KBD>
  6919. <DD>Like <KBD>M-n</KBD> but move up (<CODE>backward-text-line</CODE>).
  6920. <DT><KBD>M-?</KBD>
  6921. <DD>Prints in the echo area the number of text lines (lines that are not
  6922. nroff commands) in the region (<CODE>count-text-lines</CODE>).
  6923. </DL>
  6924. <A NAME="IDX795"></A>
  6925.   The other feature of Nroff mode is Electric Nroff newline mode.  
  6926. This is a minor mode that you can turn on or off with
  6927. <KBD>M-x electric-nroff-mode</KBD> (see section <A HREF="xEMACS.HTM#SEC274">Minor Modes</A>).  When the mode is
  6928. on and you use <KBD>RET</KBD> to end a line containing an nroff command
  6929. that opens a kind of grouping, Emacs automatically inserts the matching
  6930. nroff command to close that grouping on the following line.  For
  6931. example, if you are at the beginning of a line and type <KBD>.(b
  6932. <KBD>RET</KBD></KBD>, the matching command <SAMP>`.)b'</SAMP> will be inserted on a new
  6933. line following point.
  6934. <A NAME="IDX796"></A>
  6935.   Entering Nroff mode calls the value of the variable
  6936. <CODE>text-mode-hook</CODE> with no arguments, if that value exists and is not
  6937. <CODE>nil</CODE>; then it does the same with the variable
  6938. <CODE>nroff-mode-hook</CODE>.
  6939. <A NAME="IDX797"></A>
  6940. <A NAME="IDX798"></A>
  6941. <A NAME="IDX799"></A>
  6942. <A NAME="IDX800"></A>
  6943. <A NAME="IDX801"></A>
  6944. <A NAME="IDX802"></A>
  6945. <A NAME="IDX803"></A>
  6946. <A NAME="IDX804"></A>
  6947. <H3><A NAME="SEC168" HREF="xEMACS_TO.HTM#SEC168">TeX Mode</A></H3>
  6948.   TeX is a powerful text formatter written by Donald Knuth; like GNU
  6949. Emacs, it is free.  LaTeX is a simplified input format for TeX,
  6950. implemented by TeX macros.  It is part of TeX.<P>
  6951.   Emacs has a special TeX mode for editing TeX input files.
  6952. It provides facilities for checking the balance of delimiters and for
  6953. invoking TeX on all or part of the file.
  6954.   TeX mode has two variants, Plain TeX mode and LaTeX mode,
  6955. which are two distinct major modes that differ only slightly.  These
  6956. modes are designed for editing the two different input formats.  The
  6957. command <KBD>M-x tex-mode</KBD> looks at the contents of a buffer to
  6958. determine whether it appears to be LaTeX input or not; it then
  6959. selects the appropriate mode.  If it can't tell which is right (e.g.,
  6960. the buffer is empty), the variable <CODE>tex-default-mode</CODE> controls
  6961. which mode is used.
  6962.   The commands <KBD>M-x plain-tex-mode</KBD> and <KBD>M-x latex-mode</KBD>
  6963. explicitly select one of the variants of TeX mode.  Use these
  6964. commands when <KBD>M-x tex-mode</KBD> does not guess right.<P>
  6965.   TeX for Unix systems can be obtained from the University of Washington
  6966. for a distribution fee.
  6967.   To order a full distribution, send $140.00 for a 1/2 inch
  6968. 9-track tape, $165.00 for two 4-track 1/4 inch cartridge tapes
  6969. (foreign sites $150.00, for 1/2 inch, $175.00 for 1/4 inch, to cover
  6970. the extra postage) payable to the University of Washington to:
  6971. <PRE>
  6972. The Director
  6973. Northwest Computer Support Group,  DW-10
  6974. University of Washington
  6975. Seattle, Washington 98195
  6976. </PRE>
  6977. Purchase orders are acceptable, but there is an extra charge of
  6978. $10.00 to pay for processing charges. (The total cost comes to $150 
  6979. for domestic sites, $175 for foreign sites).
  6980.   The normal distribution is a tar tape, blocked 20, 1600 bpi, on an
  6981. industry standard 2400 foot half-inch reel.  The physical format for
  6982. the 1/4 inch streamer cartridges uses QIC-11, 8000 bpi, 4-track
  6983. serpentine recording for the SUN.  Also, SystemV tapes can be written
  6984. in cpio format, blocked 5120 bytes, ASCII headers.
  6985. <H4><A NAME="SEC169" HREF="xEMACS_TO.HTM#SEC169">TeX Editing Commands</A></H4>
  6986.   Here are the special commands provided in TeX mode for editing the
  6987. text of the file.
  6988. <DL COMPACT>
  6989. <DT><KBD>"</KBD>
  6990. <DD>Insert, according to context, either <SAMP>`"'</SAMP> or <SAMP>`"'</SAMP> or
  6991. <SAMP>`"'</SAMP> (<CODE>TeX-insert-quote</CODE>).
  6992. <DT><KBD><KBD>LFD</KBD></KBD>
  6993. <DD>Insert a paragraph break (two newlines) and check the previous
  6994. paragraph for unbalanced braces or dollar signs
  6995. (<CODE>tex-terminate-<BR>paragraph</CODE>).
  6996. <DT><KBD>M-x validate-tex-buffer</KBD>
  6997. <DD>Check each paragraph in the buffer for unbalanced braces or dollar signs.
  6998. <DT><KBD>C-c {</KBD>
  6999. <DD>Insert <SAMP>`{}'</SAMP> and position point between them (<CODE>tex-insert-braces</CODE>).
  7000. <DT><KBD>C-c }</KBD>
  7001. <DD>Move forward past the next unmatched close brace (<CODE>up-list</CODE>).
  7002. <DT><KBD>C-c C-e</KBD>
  7003. <DD>Close a block for LaTeX (<CODE>tex-close-latex-block</CODE>).
  7004. </DL>
  7005. <A NAME="IDX805"></A>
  7006. <A NAME="IDX806"></A>
  7007.   In TeX, the character <SAMP>`"'</SAMP> is not normally used; you use <SAMP>`"'</SAMP>
  7008. to start a quotation and <SAMP>`"'</SAMP> to end one.  TeX mode defines the key
  7009. <KBD>"</KBD> to insert <SAMP>`"'</SAMP> after whitespace or an open brace, <SAMP>`"'</SAMP>
  7010. after a backslash, or <SAMP>`"'</SAMP> otherwise.  This is done by the command
  7011. <CODE>tex-insert-quote</CODE>.  If you need the character <SAMP>`"'</SAMP> itself in
  7012. unusual contexts, use <KBD>C-q</KBD> to insert it.  Also, <KBD>"</KBD> with a
  7013. numeric argument always inserts that number of <SAMP>`"'</SAMP> characters.
  7014.   In TeX mode, <SAMP>`$'</SAMP> has a special syntax code which attempts to
  7015. understand the way TeX math mode delimiters match.  When you insert a
  7016. <SAMP>`$'</SAMP> that is meant to exit math mode, the position of the matching
  7017. <SAMP>`$'</SAMP> that entered math mode is displayed for a second.  This is the
  7018. same feature that displays the open brace that matches a close brace that
  7019. is inserted.  However, there is no way to tell whether a <SAMP>`$'</SAMP> enters
  7020. math mode or leaves it; so when you insert a <SAMP>`$'</SAMP> that enters math
  7021. mode, the previous <SAMP>`$'</SAMP> position is shown as if it were a match, even
  7022. though they are actually unrelated.
  7023. <A NAME="IDX807"></A>
  7024. <A NAME="IDX808"></A>
  7025. <A NAME="IDX809"></A>
  7026. <A NAME="IDX810"></A>
  7027.   If you prefer to keep braces balanced at all times, you can use <KBD>C-c {</KBD>
  7028. (<CODE>tex-insert-braces</CODE>) to insert a pair of braces.  It leaves point
  7029. between the two braces so you can insert the text that belongs inside.
  7030. Afterward, use the command <KBD>C-c }</KBD> (<CODE>up-list</CODE>) to move forward
  7031. past the close brace.
  7032. <A NAME="IDX811"></A>
  7033. <A NAME="IDX812"></A>
  7034. <A NAME="IDX813"></A>
  7035.   There are two commands for checking the matching of braces.  <KBD>LFD</KBD>
  7036. (<CODE>tex-terminate-paragraph</CODE>) checks the paragraph before point, and
  7037. inserts two newlines to start a new paragraph.  It prints a message in the
  7038. echo area if any mismatch is found.  <KBD>M-x validate-tex-buffer</KBD> checks
  7039. the entire buffer, paragraph by paragraph.  When it finds a paragraph that
  7040. contains a mismatch, it displays point at the beginning of the paragraph
  7041. for a few seconds and pushes a mark at that spot.  Scanning continues
  7042. until the whole buffer has been checked or until you type another key.
  7043. The positions of the last several paragraphs with mismatches can be
  7044. found in the mark ring (see section <A HREF="xEMACS.HTM#SEC65">The Mark Ring</A>).
  7045.   Note that square brackets and parentheses, not just braces, are
  7046. matched in TeX mode.  This is wrong if you want to  check TeX syntax.
  7047. However, parentheses and square brackets are likely to be used in text as
  7048. matching delimiters and it is useful for the various motion commands and
  7049. automatic match display to work with them.
  7050. <A NAME="IDX814"></A>
  7051. <A NAME="IDX815"></A>
  7052.   In LaTeX input, <SAMP>`\begin'</SAMP> and <SAMP>`\end'</SAMP> commands must balance.
  7053. After you insert a <SAMP>`\begin'</SAMP>, use <KBD>C-c C-f</KBD>
  7054. (<CODE>tex-close-latex-block</CODE>) to insert automatically a matching
  7055. <SAMP>`\end'</SAMP> (on a new line following the <SAMP>`\begin'</SAMP>).  A blank line is
  7056. inserted between the two, and point is left there.<P>
  7057. <H4><A NAME="SEC170" HREF="xEMACS_TO.HTM#SEC170">TeX Printing Commands</A></H4>
  7058.   You can invoke TeX as an inferior of Emacs on either the entire
  7059. contents of the buffer or just a region at a time.  Running TeX in
  7060. this way on just one chapter is a good way to see what your changes
  7061. look like without taking the time to format the entire file.
  7062. <DL COMPACT>
  7063. <DT><KBD>C-c C-r</KBD>
  7064. <DD>Invoke TeX on the current region, plus the buffer's header
  7065. (<CODE>tex-region</CODE>).
  7066. <DT><KBD>C-c C-b</KBD>
  7067. <DD>Invoke TeX on the entire current buffer (<CODE>tex-buffer</CODE>).
  7068. <DT><KBD>C-c C-l</KBD>
  7069. <DD>Recenter the window showing output from the inferior TeX so that
  7070. the last line can be seen (<CODE>tex-recenter-output-buffer</CODE>).
  7071. <DT><KBD>C-c C-k</KBD>
  7072. <DD>Kill the inferior TeX (<CODE>tex-kill-job</CODE>).
  7073. <DT><KBD>C-c C-p</KBD>
  7074. <DD>Print the output from the last <KBD>C-c C-r</KBD> or <KBD>C-c C-b</KBD> command
  7075. (<CODE>tex-print</CODE>).
  7076. <DT><KBD>C-c C-q</KBD>
  7077. <DD>Show the printer queue (<CODE>tex-show-print-queue</CODE>).
  7078. </DL>
  7079. <A NAME="IDX816"></A>
  7080. <A NAME="IDX817"></A>
  7081. <A NAME="IDX818"></A>
  7082. <A NAME="IDX819"></A>
  7083. <A NAME="IDX820"></A>
  7084. <A NAME="IDX821"></A>
  7085.   You can pass the current buffer through an inferior TeX using
  7086. <KBD>C-c C-b</KBD> (<CODE>tex-buffer</CODE>).  The formatted output appears in a file
  7087. in <TT>`/tmp'</TT>; to print it, type <KBD>C-c C-p</KBD> (<CODE>tex-print</CODE>).
  7088. Afterward use <KBD>C-c C-q</KBD> (<CODE>tex-show-print-queue</CODE>) to view the
  7089. progress of your output towards being printed.
  7090. <A NAME="IDX822"></A>
  7091. <A NAME="IDX823"></A>
  7092. <A NAME="IDX824"></A>
  7093. <A NAME="IDX825"></A>
  7094.   The console output from TeX, including any error messages, appears in a
  7095. buffer called <SAMP>`*TeX-shell*'</SAMP>.  If TeX gets an error, you can switch
  7096. to this buffer and feed it input (this works as in Shell mode;
  7097. see section <A HREF="xEMACS.HTM#SEC263">Interactive Inferior Shell</A>).  Without switching to this buffer, you can scroll
  7098. it so that its last line is visible by typing <KBD>C-c C-l</KBD>.
  7099.   Type <KBD>C-c C-k</KBD> (<CODE>tex-kill-job</CODE>) to kill the TeX process if
  7100. you see that its output is no longer useful.  Using <KBD>C-c C-b</KBD> or
  7101. <KBD>C-c C-r</KBD> also kills any TeX process still running.<A NAME="IDX826"></A>
  7102. <A NAME="IDX827"></A>
  7103.   You can pass an arbitrary region through an inferior TeX by typing
  7104. <KBD>C-c C-r</KBD> (<CODE>tex-region</CODE>).  This is tricky, however, because
  7105. most files of TeX input contain commands at the beginning to set
  7106. parameters and define macros.  Without them, no later part of the file
  7107. will format correctly.  To solve this problem, <KBD>C-c C-r</KBD> allows you
  7108. to designate a part of the file as containing essential commands; it is
  7109. included before the specified region as part of the input to TeX.
  7110. The designated part of the file is called the <DFN>header</DFN>.
  7111. <A NAME="IDX828"></A>
  7112.   To indicate the bounds of the header in Plain TeX mode, insert two
  7113. special strings in the file: <SAMP>`%**start of header'</SAMP> before the
  7114. header, and <SAMP>`%**end of header'</SAMP> after it.  Each string must appear
  7115. entirely on one line, but there may be other text on the line before or
  7116. after.  The lines containing the two strings are included in the header.
  7117. If <SAMP>`%**start of header'</SAMP> does not appear within the first 100 lines of
  7118. the buffer, <KBD>C-c C-r</KBD> assumes there is no header.
  7119.   In LaTeX mode, the header begins with <SAMP>`\documentstyle'</SAMP> and ends
  7120. with <BR><SAMP>`\begin{document}'</SAMP>.  These are commands that LaTeX requires
  7121. you to use, so you don't need to do anything special to identify the
  7122. header.
  7123. <A NAME="IDX829"></A>
  7124. <A NAME="IDX830"></A>
  7125. <A NAME="IDX831"></A>
  7126.   When you enter either kind of TeX mode, Emacs calls with no
  7127. arguments the value of the variable <CODE>text-mode-hook</CODE>, if that value
  7128. exists and is not <CODE>nil</CODE>.  Emacs then calls the variable
  7129. <CODE>TeX-mode-hook</CODE> and either <CODE>plain-TeX-mode-hook</CODE> or
  7130. <CODE>LaTeX-mode-hook</CODE> under the same conditions.
  7131. <A NAME="IDX832"></A>
  7132. <A NAME="IDX833"></A>
  7133. <A NAME="IDX834"></A>
  7134. <H3><A NAME="SEC171" HREF="xEMACS_TO.HTM#SEC171">Outline Mode</A></H3>
  7135.   Outline mode is a major mode similar to Text mode but intended for editing
  7136. outlines.  It allows you to make parts of the text temporarily invisible
  7137. so that you can see just the overall structure of the outline.  Type
  7138. <KBD>M-x outline-mode</KBD> to turn on Outline mode in the current buffer.
  7139. <A NAME="IDX835"></A>
  7140.   When you enter Outline mode, Emacs calls with no arguments the value
  7141. of the variable <CODE>text-mode-hook</CODE>, if that value exists and is not
  7142. <CODE>nil</CODE>; then it does the same with the variable
  7143. <CODE>outline-mode-hook</CODE>.
  7144.   When a line is invisible in outline mode, it does not appear on the
  7145. screen.  The screen appears exactly as if the invisible line
  7146. were deleted, except that an ellipsis (three periods in a row) appears
  7147. at the end of the previous visible line (only one ellipsis no matter
  7148. how many invisible lines follow).
  7149.   All editing commands treat the text of the invisible line as part of the
  7150. previous visible line.  For example, <KBD>C-n</KBD> moves onto the next visible
  7151. line.  Killing an entire visible line, including its terminating newline,
  7152. really kills all the following invisible lines as well; yanking
  7153. everything back yanks the invisible lines and they remain invisible.
  7154. <H4><A NAME="SEC172" HREF="xEMACS_TO.HTM#SEC172">Format of Outlines</A></H4>
  7155. <A NAME="IDX836"></A>
  7156. <A NAME="IDX837"></A>
  7157.   Outline mode assumes that the lines in the buffer are of two types:
  7158. <DFN>heading lines</DFN> and <DFN>body lines</DFN>.  A heading line represents a
  7159. topic in the outline.  Heading lines start with one or more stars; the
  7160. number of stars determines the depth of the heading in the outline
  7161. structure.  Thus, a heading line with one star is a major topic; all the
  7162. heading lines with two stars between it and the next one-star heading
  7163. are its subtopics; and so on.  Any line that is not a heading line is a
  7164. body line.  Body lines belong to the preceding heading line.  Here is an
  7165. example:
  7166. <PRE>
  7167. * Food
  7168. This is the body,
  7169. which says something about the topic of food.
  7170. ** Delicious Food
  7171. This is the body of the second-level header.
  7172. ** Distasteful Food
  7173. This could have
  7174. a body too, with
  7175. several lines.
  7176. *** Dormitory Food
  7177. * Shelter
  7178. A second first-level topic with its header line.
  7179. </PRE>
  7180.   A heading line together with all following body lines is called
  7181. collectively an <DFN>entry</DFN>.  A heading line together with all following
  7182. deeper heading lines and their body lines is called a <DFN>subtree</DFN>.
  7183. <A NAME="IDX838"></A>
  7184.  You can customize the criterion for distinguishing heading lines by
  7185. setting the variable <CODE>outline-regexp</CODE>.  Any line whose beginning
  7186. has a match for this regexp is considered a heading line.  Matches that
  7187. start within a line (not at the beginning) do not count.  The length of
  7188. the matching text determines the level of the heading; longer matches
  7189. make a more deeply nested level.  Thus, for example, if a text formatter
  7190. has commands <SAMP>`@chapter'</SAMP>, <SAMP>`@section'</SAMP> and <SAMP>`@subsection'</SAMP>
  7191. to divide the document into chapters and sections, you can make those
  7192. lines count as heading lines by setting <CODE>outline-regexp</CODE> to
  7193. <SAMP>`"@chap\\|@\\(sub\\)*section"'</SAMP>.  Note the trick: the two words
  7194. <SAMP>`chapter'</SAMP> and <SAMP>`section'</SAMP> are the same length, but by defining
  7195. the regexp to match only <SAMP>`chap'</SAMP> we ensure that the length of the
  7196. text matched on a chapter heading is shorter, so that Outline mode will
  7197. know that sections are contained in chapters.  This works as long as no
  7198. other command starts with <SAMP>`@chap'</SAMP>.
  7199.   Outline mode makes a line invisible by changing the newline before it
  7200. into an ASCII Control-M (code 015).  Most editing commands that work on
  7201. lines treat an invisible line as part of the previous line because,
  7202. strictly speaking, it <I>is</I> part of that line, since there is no longer a
  7203. newline in between.  When you save the file in Outline mode, Control-M
  7204. characters are saved as newlines, so the invisible lines become ordinary
  7205. lines in the file.  Saving does not change the visibility status of a
  7206. line inside Emacs.
  7207. <H4><A NAME="SEC173" HREF="xEMACS_TO.HTM#SEC173">Outline Motion Commands</A></H4>
  7208.    Some special commands in Outline mode move backward and forward to
  7209. heading lines.
  7210. <DL COMPACT>
  7211. <DT><KBD>C-c C-n</KBD>
  7212. <DD>Move point to the next visible heading line
  7213. (<CODE>outline-next-visible-heading</CODE>).
  7214. <DT><KBD>C-c C-p</KBD>
  7215. <DD>Move point to the previous visible heading line <BR>
  7216. (<CODE>outline-previous-visible-heading</CODE>).
  7217. <DT><KBD>C-c C-f</KBD>
  7218. <DD>Move point to the next visible heading line at the same level
  7219. as the one point is on (<CODE>outline-forward-same-level</CODE>).
  7220. <DT><KBD>C-c C-b</KBD>
  7221. <DD>Move point to the previous visible heading line at the same level
  7222. (<CODE>outline-backward-same-level</CODE>).
  7223. <DT><KBD>C-c C-u</KBD>
  7224. <DD>Move point up to a lower-level (more inclusive) visible heading line
  7225. (<CODE>outline-up-heading</CODE>).
  7226. </DL>
  7227. <A NAME="IDX839"></A>
  7228. <A NAME="IDX840"></A>
  7229. <A NAME="IDX841"></A>
  7230. <A NAME="IDX842"></A>
  7231.   <KBD>C-c C-n</KBD> (<CODE>next-visible-heading</CODE>) moves down to the next
  7232. heading line.  <KBD>C-c C-p</KBD> (<CODE>previous-visible-heading</CODE>) moves
  7233. similarly backward.  Both accept numeric arguments as repeat counts.  The
  7234. names emphasize that invisible headings are skipped, but this is not really
  7235. a special feature.  All editing commands that look for lines ignore the
  7236. invisible lines automatically.<A NAME="IDX843"></A>
  7237. <A NAME="IDX844"></A>
  7238. <A NAME="IDX845"></A>
  7239. <A NAME="IDX846"></A>
  7240. <A NAME="IDX847"></A>
  7241. <A NAME="IDX848"></A>
  7242.   More advanced motion commands understand the levels of headings.
  7243. The commands <KBD>C-c C-f</KBD> (<CODE>outline-forward-same-level</CODE>) and
  7244. <KBD>C-c C-b</KBD> (<CODE>outline-backward-same-level</CODE>) move from one
  7245. heading line to another visible heading at the same depth in
  7246. the outline.  <KBD>C-c C-u</KBD> (<CODE>outline-up-heading</CODE>) moves
  7247. backward to another heading that is less deeply nested.
  7248. <H4><A NAME="SEC174" HREF="xEMACS_TO.HTM#SEC174">Outline Visibility Commands</A></H4>
  7249.   The other special commands of outline mode are used to make lines visible
  7250. or invisible.  Their names all start with <CODE>hide</CODE> or <CODE>show</CODE>.
  7251. Most of them exist as pairs of opposites.  They are not undoable; instead,
  7252. you can undo right past them.  Making lines visible or invisible is simply
  7253. not recorded by the undo mechanism.
  7254. <DL COMPACT>
  7255. <DT><KBD>M-x hide-body</KBD>
  7256. <DD>Make all body lines in the buffer invisible.
  7257. <DT><KBD>M-x show-all</KBD>
  7258. <DD>Make all lines in the buffer visible.
  7259. <DT><KBD>C-c C-d</KBD>
  7260. <DD>Make everything under this heading invisible, not including this
  7261. heading itself (<CODE>hide-subtree</CODE>).
  7262. <DT><KBD>C-c C-s</KBD>
  7263. <DD>Make everything under this heading visible, including body,
  7264. subheadings, and their bodies (<CODE>show-subtree</CODE>).
  7265. <DT><KBD>M-x hide-leaves</KBD>
  7266. <DD>Make the body of this heading line, and of all its subheadings,
  7267. invisible.
  7268. <DT><KBD>M-x show-branches</KBD>
  7269. <DD>Make all subheadings of this heading line, at all levels, visible.
  7270. <DT><KBD>C-c C-i</KBD>
  7271. <DD>Make immediate subheadings (one level down) of this heading line
  7272. visible (<CODE>show-children</CODE>).
  7273. <DT><KBD>M-x hide-entry</KBD>
  7274. <DD>Make this heading line's body invisible.
  7275. <DT><KBD>M-x show-entry</KBD>
  7276. <DD>Make this heading line's body visible.
  7277. </DL>
  7278. <A NAME="IDX849"></A>
  7279. <A NAME="IDX850"></A>
  7280.   Two commands that are exact opposites are <KBD>M-x hide-entry</KBD> and
  7281. <KBD>M-x show-entry</KBD>.  They are used with point on a heading line, and
  7282. apply only to the body lines of that heading.  The subtopics and their
  7283. bodies are not affected.
  7284. <A NAME="IDX851"></A>
  7285. <A NAME="IDX852"></A>
  7286. <A NAME="IDX853"></A>
  7287. <A NAME="IDX854"></A>
  7288. <A NAME="IDX855"></A>
  7289.   Two more powerful opposites are <KBD>C-c C-h</KBD> (<CODE>hide-subtree</CODE>) and
  7290. <KBD>C-c C-s</KBD> (<CODE>show-subtree</CODE>).  Both should be used when point is
  7291. on a heading line, and both apply to all the lines of that heading's
  7292. <DFN>subtree</DFN>: its body, all its subheadings, both direct and indirect, and
  7293. all of their bodies.  In other words, the subtree contains everything
  7294. following this heading line, up to and not including the next heading of
  7295. the same or higher rank.<A NAME="IDX856"></A>
  7296. <A NAME="IDX857"></A>
  7297.   Intermediate between a visible subtree and an invisible one is having
  7298. all the subheadings visible but none of the body.  There are two commands
  7299. for doing this, one that hides the bodies and one that
  7300. makes the subheadings visible.  They are <KBD>M-x hide-leaves</KBD> and
  7301. <KBD>M-x show-branches</KBD>.
  7302. <A NAME="IDX858"></A>
  7303. <A NAME="IDX859"></A>
  7304.   A little weaker than <CODE>show-branches</CODE> is <KBD>C-c C-i</KBD>
  7305. (<CODE>show-children</CODE>).  It makes just the direct subheadings
  7306. visible--those one level down.  Deeper subheadings remain
  7307. invisible.<A NAME="IDX860"></A>
  7308. <A NAME="IDX861"></A>
  7309.   Two commands have a blanket effect on the whole file.  <KBD>M-x
  7310. hide-body</KBD> makes all body lines invisible, so that you see just the
  7311. outline structure.  <KBD>M-x show-all</KBD> makes all lines visible.  You can
  7312. think of these commands as a pair of opposites even though <KBD>M-x
  7313. show-all</KBD> applies to more than just body lines.
  7314. <A NAME="IDX862"></A>
  7315. You can turn off the use of ellipses at the ends of visible lines by
  7316. setting <CODE>selective-display-ellipses</CODE> to <CODE>nil</CODE>.  The result is
  7317. no visible indication of the presence of invisible lines.
  7318. <A NAME="IDX863"></A>
  7319. <A NAME="IDX864"></A>
  7320. <H2><A NAME="SEC175" HREF="xEMACS_TO.HTM#SEC175">Words</A></H2>
  7321.   Emacs has commands for moving over or operating on words.  By convention,
  7322. the keys for them are all <KBD>Meta-</KBD> characters.
  7323. <DL COMPACT>
  7324. <DT><KBD>M-f</KBD>
  7325. <DD>Move forward over a word (<CODE>forward-word</CODE>).
  7326. <DT><KBD>M-b</KBD>
  7327. <DD>Move backward over a word (<CODE>backward-word</CODE>).
  7328. <DT><KBD>M-d</KBD>
  7329. <DD>Kill up to the end of a word (<CODE>kill-word</CODE>).
  7330. <DT><KBD>M-<KBD>DEL</KBD></KBD>
  7331. <DD>Kill back to the beginning of a word (<CODE>backward-kill-word</CODE>).
  7332. <DT><KBD>M-@</KBD>
  7333. <DD>Mark the end of the next word (<CODE>mark-word</CODE>).
  7334. <DT><KBD>M-t</KBD>
  7335. <DD>Transpose two words;  drag a word forward
  7336. or backward across other words (<CODE>transpose-words</CODE>).
  7337. </DL>
  7338.   Notice how these keys form a series that parallels the
  7339. character-based <KBD>C-f</KBD>, <KBD>C-b</KBD>, <KBD>C-d</KBD>, <KBD>C-t</KBD> and
  7340. <KBD>DEL</KBD>.  <KBD>M-@</KBD> is related to <KBD>C-@</KBD>, which is an alias for
  7341. <KBD>C-<KBD>SPC</KBD></KBD>.<A NAME="IDX865"></A>
  7342. <A NAME="IDX866"></A>
  7343. <A NAME="IDX867"></A>
  7344. <A NAME="IDX868"></A>
  7345.   The commands <KBD>Meta-f</KBD> (<CODE>forward-word</CODE>) and <KBD>Meta-b</KBD>
  7346. (<CODE>backward-word</CODE>) move forward and backward over words.  They are
  7347. analogous to <KBD>Control-f</KBD> and <KBD>Control-b</KBD>, which move over single
  7348. characters.  Like their <KBD>Control-</KBD> analogues, <KBD>Meta-f</KBD> and
  7349. <KBD>Meta-b</KBD> move several words if given an argument.  <KBD>Meta-f</KBD> with a
  7350. negative argument moves backward, and <KBD>Meta-b</KBD> with a negative argument
  7351. moves forward.  Forward motion stops after the last letter of the
  7352. word, while backward motion stops before the first letter.<A NAME="IDX869"></A>
  7353. <A NAME="IDX870"></A>
  7354.   <KBD>Meta-d</KBD> (<CODE>kill-word</CODE>) kills the word after point.  To be
  7355. precise, it kills everything from point to the place <KBD>Meta-f</KBD> would
  7356. move to.  Thus, if point is in the middle of a word, <KBD>Meta-d</KBD> kills
  7357. just the part after point.  If some punctuation comes between point and the
  7358. next word, it is killed along with the word.  (To kill only the
  7359. next word but not the punctuation before it, simply type <KBD>Meta-f</KBD> to get
  7360. to the end and kill the word backwards with <KBD>Meta-<KBD>DEL</KBD></KBD>.)
  7361. <KBD>Meta-d</KBD> takes arguments just like <KBD>Meta-f</KBD>.
  7362. <A NAME="IDX871"></A>
  7363. <A NAME="IDX872"></A>
  7364.   <KBD>Meta-<KBD>DEL</KBD></KBD> (<CODE>backward-kill-word</CODE>) kills the word before
  7365. point.  It kills everything from point back to where <KBD>Meta-b</KBD> would
  7366. move to.  If point is after the space in <SAMP>`FOO, BAR'</SAMP>, then
  7367. <SAMP>`FOO, '</SAMP> is killed.   To kill just <SAMP>`FOO'</SAMP>, type
  7368. <KBD>Meta-b Meta-d</KBD> instead of <KBD>Meta-<KBD>DEL</KBD></KBD>.
  7369. <A NAME="IDX873"></A>
  7370. <A NAME="IDX874"></A>
  7371. <A NAME="IDX875"></A>
  7372.   <KBD>Meta-t</KBD> (<CODE>transpose-words</CODE>) exchanges the word before or
  7373. containing point with the following word.  The delimiter characters
  7374. between the words do not move.  For example, transposing <SAMP>`FOO,
  7375. BAR'</SAMP> results in <SAMP>`BAR, FOO'</SAMP> rather than <SAMP>`BAR FOO,'</SAMP>.
  7376. See section <A HREF="xEMACS.HTM#SEC109">Transposing Text</A>, for more on transposition and on arguments to
  7377. transposition commands.
  7378. <A NAME="IDX876"></A>
  7379. <A NAME="IDX877"></A>
  7380.   To operate on the next <VAR>n</VAR> words with an operation which applies
  7381. between point and mark, you can either set the mark at point and then move
  7382. over the words, or you can use the command <KBD>Meta-@</KBD> (<CODE>mark-word</CODE>)
  7383. which does not move point but sets the mark where <KBD>Meta-f</KBD> would move
  7384. to.  It can be given arguments just like <KBD>Meta-f</KBD>.
  7385. <A NAME="IDX878"></A>
  7386.   The word commands' understanding of syntax is completely controlled by
  7387. the syntax table.  For example, any character can be declared to be a word
  7388. delimiter.  See section <A HREF="xEMACS.HTM#SEC289">The Syntax Table</A>.
  7389. <A NAME="IDX879"></A>
  7390. <H2><A NAME="SEC176" HREF="xEMACS_TO.HTM#SEC176">Sentences</A></H2>
  7391.   The Emacs commands for manipulating sentences and paragraphs are mostly
  7392. on <KBD>Meta-</KBD> keys, and therefore are like the word-handling commands.
  7393. <DL COMPACT>
  7394. <DT><KBD>M-a</KBD>
  7395. <DD>Move back to the beginning of the sentence (<CODE>backward-sentence</CODE>).
  7396. <DT><KBD>M-e</KBD>
  7397. <DD>Move forward to the end of the sentence (<CODE>forward-sentence</CODE>).
  7398. <DT><KBD>M-k</KBD>
  7399. <DD>Kill forward to the end of the sentence (<CODE>kill-sentence</CODE>).
  7400. <DT><KBD>C-x <KBD>DEL</KBD></KBD>
  7401. <DD>Kill back to the beginning of the sentence <BR>(<CODE>backward-kill-sentence</CODE>).
  7402. </DL>
  7403. <A NAME="IDX880"></A>
  7404. <A NAME="IDX881"></A>
  7405. <A NAME="IDX882"></A>
  7406. <A NAME="IDX883"></A>
  7407.   The commands <KBD>Meta-a</KBD> and <KBD>Meta-e</KBD> (<CODE>backward-sentence</CODE>
  7408. and <CODE>forward-sentence</CODE>) move to the beginning and end of the
  7409. current sentence, respectively.  They resemble <KBD>Control-a</KBD> and
  7410. <KBD>Control-e</KBD>, which move to the beginning and end of a line.  Unlike
  7411. their counterparts, <KBD>Meta-a</KBD> and <KBD>Meta-e</KBD> move over successive
  7412. sentences if repeated or given numeric arguments.  Emacs assumes
  7413. the typist's convention is followed, and thus considers a sentence to
  7414. end wherever there is a <SAMP>`.'</SAMP>, <SAMP>`?'</SAMP>, or <SAMP>`!'</SAMP> followed by the
  7415. end of a line or two spaces, with any number of <SAMP>`)'</SAMP>, <SAMP>`]'</SAMP>,
  7416. <SAMP>`''</SAMP>, or <SAMP>`"'</SAMP> characters allowed in between.  A sentence also
  7417. begins or ends wherever a paragraph begins or ends.<P>
  7418.   Neither <KBD>M-a</KBD> nor <KBD>M-e</KBD> moves past the newline or spaces beyond
  7419. the sentence edge at which it is stopping.
  7420. <A NAME="IDX884"></A>
  7421. <A NAME="IDX885"></A>
  7422. <A NAME="IDX886"></A>
  7423. <A NAME="IDX887"></A>
  7424.  <KBD>M-a</KBD> and <KBD>M-e</KBD> have a corresponding kill command, just like
  7425. <KBD>C-a</KBD> and <KBD>C-e</KBD> have <KBD>C-k</KBD>.  The command is  <KBD>M-k</KBD>
  7426. (<CODE>kill-sentence</CODE>) which kills from point to the end of the
  7427. sentence.  With minus one as an argument it kills back to the beginning
  7428. of the sentence.  Larger arguments serve as repeat counts.<P>
  7429.   There is a special command, <KBD>C-x <KBD>DEL</KBD></KBD>
  7430. (<CODE>backward-kill-sentence</CODE>), for killing back to the beginning of a
  7431. sentence, which is useful when you change your mind in the middle of
  7432. composing text.<A NAME="IDX888"></A>
  7433.   The variable <CODE>sentence-end</CODE> controls recognition of the end of a
  7434. sentence.  It is a regexp that matches the last few characters of a
  7435. sentence, together with the whitespace following the sentence.  Its
  7436. normal value is:
  7437. <PRE>
  7438. "[.?!][]\"')]*\\($\\|\t\\|  \\)[ \t\n]*"
  7439. </PRE>
  7440. This example is explained in the section on regexps.  See section <A HREF="xEMACS.HTM#SEC99">Syntax of Regular Expressions</A>.
  7441. <A NAME="IDX889"></A>
  7442. <A NAME="IDX890"></A>
  7443. <A NAME="IDX891"></A>
  7444. <A NAME="IDX892"></A>
  7445. <A NAME="IDX893"></A>
  7446. <H2><A NAME="SEC177" HREF="xEMACS_TO.HTM#SEC177">Paragraphs</A></H2>
  7447.   The Emacs commands for manipulating paragraphs are also <KBD>Meta-</KBD>
  7448. keys.
  7449. <DL COMPACT>
  7450. <DT><KBD>M-[</KBD>
  7451. <DD>Move back to previous paragraph beginning <BR>(<CODE>backward-paragraph</CODE>).
  7452. <DT><KBD>M-]</KBD>
  7453. <DD>Move forward to next paragraph end (<CODE>forward-paragraph</CODE>).
  7454. <DT><KBD>M-h</KBD>
  7455. <DD>Put point and mark around this or next paragraph (<CODE>mark-paragraph</CODE>).
  7456. </DL>
  7457.   <KBD>Meta-[</KBD> moves to the beginning of the current or previous paragraph,
  7458. while <KBD>Meta-]</KBD> moves to the end of the current or next paragraph.
  7459. Blank lines and text formatter command lines separate paragraphs and are
  7460. not part of any paragraph.  An indented line starts a new paragraph.
  7461.   In major modes for programs (as opposed to Text mode), paragraphs begin
  7462. and end only at blank lines.  As a result, the paragraph commands continue to
  7463. be useful even though there are no paragraphs per se.
  7464.   When there is a fill prefix, paragraphs are delimited by all lines
  7465. which don't start with the fill prefix.  See section <A HREF="xEMACS.HTM#SEC179">Filling Text</A>.
  7466. <A NAME="IDX894"></A>
  7467. <A NAME="IDX895"></A>
  7468.    To operate on a paragraph, you can use the command
  7469. <KBD>Meta-h</KBD> (<CODE>mark-paragraph</CODE>) to set the region around it.  This
  7470. command puts point at the beginning and mark at the end of the paragraph
  7471. point was in.  If point is between paragraphs (in a run of blank lines or
  7472. at a boundary), the paragraph following point is surrounded by point and
  7473. mark.  If there are blank lines preceding the first line of the paragraph,
  7474. one of the blank lines is included in the region.  Thus, for example,
  7475. <KBD>M-h C-w</KBD> kills the paragraph around or after point.
  7476. <A NAME="IDX896"></A>
  7477. <A NAME="IDX897"></A>
  7478.   The precise definition of a paragraph boundary is controlled by the
  7479. variables <CODE>paragraph-separate</CODE> and <CODE>paragraph-start</CODE>.  The value
  7480. of <CODE>paragraph-start</CODE> is a regexp that matches any line that
  7481. either starts or separates paragraphs.  The value of
  7482. <CODE>paragraph-separate</CODE> is another regexp that  matches only lines
  7483. that separate paragraphs without being part of any paragraph.  Lines that
  7484. start a new paragraph and are contained in it must match both regexps.  For
  7485. example, normally <CODE>paragraph-start</CODE> is <CODE>"^[ <TT>\</TT>t<TT>\</TT>n<TT>\</TT>f]"</CODE>
  7486. and <CODE>paragraph-separate</CODE> is <CODE>"^[ <TT>\</TT>t<TT>\</TT>f]*$"</CODE>.<P>
  7487.   Normally it is desirable for page boundaries to separate paragraphs.
  7488. The default values of these variables recognize the usual separator for
  7489. pages.
  7490. <H2><A NAME="SEC178" HREF="xEMACS_TO.HTM#SEC178">Pages</A></H2>
  7491. <A NAME="IDX898"></A>
  7492. <A NAME="IDX899"></A>
  7493.   Files are often thought of as divided into <DFN>pages</DFN> by the
  7494. <DFN>formfeed</DFN> character (ASCII Control-L, octal code 014).  For
  7495. example, if a file is printed on a line printer, each "page" of the
  7496. file starts on a new page of paper.  Emacs treats a page-separator
  7497. character just like any other character.  It can be inserted with
  7498. <KBD>C-q C-l</KBD> or deleted with <KBD>DEL</KBD>.  You are free to
  7499. paginate your file or not.  However, since pages are often meaningful
  7500. divisions of the file, commands are provided to move over them and
  7501. operate on them.
  7502. <DL COMPACT>
  7503. <DT><KBD>C-x [</KBD>
  7504. <DD>Move point to previous page boundary (<CODE>backward-page</CODE>).
  7505. <DT><KBD>C-x ]</KBD>
  7506. <DD>Move point to next page boundary (<CODE>forward-page</CODE>).
  7507. <DT><KBD>C-x C-p</KBD>
  7508. <DD>Put point and mark around this page (or another page) (<CODE>mark-page</CODE>).
  7509. <DT><KBD>C-x l</KBD>
  7510. <DD>Count the lines in this page (<CODE>count-lines-page</CODE>).
  7511. </DL>
  7512. <A NAME="IDX900"></A>
  7513. <A NAME="IDX901"></A>
  7514. <A NAME="IDX902"></A>
  7515. <A NAME="IDX903"></A>
  7516.   The <KBD>C-x [</KBD> (<CODE>backward-page</CODE>) command moves point to
  7517. immediately after the previous page delimiter.  If point is already
  7518. right after a page delimiter, the command skips that one and stops at
  7519. the previous one.  A numeric argument serves as a repeat count.  The
  7520. <KBD>C-x ]</KBD> (<CODE>forward-page</CODE>) command moves forward past the next
  7521. page delimiter.
  7522. <A NAME="IDX904"></A>
  7523. <A NAME="IDX905"></A>
  7524.   The <KBD>C-x C-p</KBD> command (<CODE>mark-page</CODE>) puts point at the beginning
  7525. of the current page and the mark at the end.  The page delimiter at the end
  7526. is included (the mark follows it).  The page delimiter at the front is
  7527. excluded (point follows it).  You can follow this command  by <KBD>C-w</KBD> to
  7528. kill a page you want to move elsewhere.  If you insert the page after a page
  7529. delimiter, at a place where <KBD>C-x ]</KBD> or <KBD>C-x [</KBD> would take you,
  7530. the page will be properly delimited before and after once again.
  7531.   A numeric argument to <KBD>C-x C-p</KBD> is used to specify which page to go
  7532. to, relative to the current one.  Zero means the current page.  One means
  7533. the next page, and -1 means the previous one.
  7534. <A NAME="IDX906"></A>
  7535. <A NAME="IDX907"></A>
  7536.   The <KBD>C-x l</KBD> command (<CODE>count-lines-page</CODE>) can help you decide
  7537. where to break a page in two.  It prints the total number of lines in
  7538. the current page in the echo area, then divides the lines into those
  7539. preceding the current line and those following it, for example
  7540. <PRE>
  7541. Page has 96 (72+25) lines
  7542. </PRE>
  7543.   Notice that the sum is off by one; this is correct if point is not at the
  7544. beginning of a line.
  7545. <A NAME="IDX908"></A>
  7546.   The variable <CODE>page-delimiter</CODE> should have as its value a regexp that
  7547. matches the beginning of a line that separates pages.  This defines
  7548. where pages begin.  The normal value of this variable is <CODE>"^<TT>\</TT>f"</CODE>,
  7549. which matches a formfeed character at the beginning of a line.
  7550. <A NAME="IDX909"></A>
  7551. <H2><A NAME="SEC179" HREF="xEMACS_TO.HTM#SEC179">Filling Text</A></H2>
  7552.   If you use Auto Fill mode, Emacs <DFN>fills</DFN> text (breaks it up into
  7553. lines that fit in a specified width) as you insert it.  When you alter
  7554. existing text it is often no longer be properly filled afterwards and
  7555. you can use explicit commands for filling.
  7556. <H3><A NAME="SEC180" HREF="xEMACS_TO.HTM#SEC180">Auto Fill Mode</A></H3>
  7557. <A NAME="IDX910"></A>
  7558.   <DFN>Auto Fill</DFN> mode is a minor mode in which lines are broken
  7559. automatically when they become too wide.  Breaking happens only when
  7560. you type a <KBD>SPC</KBD> or <KBD>RET</KBD>.
  7561. <DL COMPACT>
  7562. <DT><KBD>M-x auto-fill-mode</KBD>
  7563. <DD>Enable or disable Auto Fill mode.
  7564. <DT><KBD><KBD>SPC</KBD></KBD>
  7565. <DD><DT><KBD><KBD>RET</KBD></KBD>
  7566. <DD>In Auto Fill mode, break lines when appropriate.
  7567. </DL>
  7568. <A NAME="IDX911"></A>
  7569.   <KBD>M-x auto-fill-mode</KBD> turns Auto Fill mode on if it was off, or off
  7570. if it was on.  With a positive numeric argument the command always turns
  7571. Auto Fill mode on, and with a negative argument it always turns it off.
  7572. The presence of the word <SAMP>`Fill'</SAMP> in the mode line, inside the
  7573. parentheses, indicates that Auto Fill mode is in effect.  Auto Fill mode
  7574. is a minor mode; you can turn it on or off for each buffer individually.
  7575. See section <A HREF="xEMACS.HTM#SEC274">Minor Modes</A>.
  7576.   In Auto Fill mode, lines are broken automatically at spaces when they get
  7577. longer than desired.  Line breaking and rearrangement takes place
  7578. only when you type <KBD>SPC</KBD> or <KBD>RET</KBD>.  To insert a space
  7579. or newline without permitting line-breaking, type <KBD>C-q <KBD>SPC</KBD></KBD> or
  7580. <KBD>C-q <KBD>LFD</KBD></KBD> (recall that a newline is really a linefeed).
  7581. <KBD>C-o</KBD> inserts a newline without line breaking.
  7582.   Auto Fill mode works well with Lisp mode: when it makes a new line in
  7583. Lisp mode, it indents that line with <KBD>TAB</KBD>.  If a line ending in a
  7584. Lisp comment gets too long, the text of the comment is split into two
  7585. comment lines.  Optionally, new comment delimiters are inserted at the
  7586. end of the first line and the beginning of the second, so that each line
  7587. is a separate comment.  The variable <CODE>comment-multi-line</CODE> controls
  7588. the choice (see section <A HREF="xEMACS.HTM#SEC194">Manipulating Comments</A>).
  7589.   Auto Fill mode does not refill entire paragraphs.  It can break lines but
  7590. cannot merge lines.  Editing in the middle of a paragraph can result in
  7591. a paragraph that is not correctly filled.  The easiest way to make the
  7592. paragraph properly filled again is using an explicit fill commands.
  7593.   Many users like Auto Fill mode and want to use it in all text files.
  7594. The section on init files explains how you can arrange this
  7595. permanently for yourself.  See section <A HREF="xEMACS.HTM#SEC292">The Init File, .emacs</A>.
  7596. <H3><A NAME="SEC181" HREF="xEMACS_TO.HTM#SEC181">Explicit Fill Commands</A></H3>
  7597. <DL COMPACT>
  7598. <DT><KBD>M-q</KBD>
  7599. <DD>Fill current paragraph (<CODE>fill-paragraph</CODE>).
  7600. <DT><KBD>M-g</KBD>
  7601. <DD>Fill each paragraph in the region (<CODE>fill-region</CODE>).
  7602. <DT><KBD>C-x f</KBD>
  7603. <DD>Set the fill column (<CODE>set-fill-column</CODE>).
  7604. <DT><KBD>M-x fill-region-as-paragraph</KBD>
  7605. <DD>Fill the region, considering it as one paragraph.
  7606. <DT><KBD>M-s</KBD>
  7607. <DD>Center a line.
  7608. </DL>
  7609. <A NAME="IDX912"></A>
  7610. <A NAME="IDX913"></A>
  7611.   To refill a paragraph, use the command <KBD>Meta-q</KBD>
  7612. (<CODE>fill-paragraph</CODE>).  It causes the paragraph containing point, or
  7613. the one after point if point is between paragraphs, to be refilled.  All
  7614. line breaks are removed, and new ones are inserted where necessary.
  7615. <KBD>M-q</KBD> can be undone with <KBD>C-_</KBD>.  See section <A HREF="xEMACS.HTM#SEC46">Undoing Changes</A>.<A NAME="IDX914"></A>
  7616. <A NAME="IDX915"></A>
  7617.   To refill many paragraphs, use <KBD>M-g</KBD> (<CODE>fill-region</CODE>), which
  7618. divides the region into paragraphs and fills each of them.
  7619. <A NAME="IDX916"></A>
  7620.   <KBD>Meta-q</KBD> and <KBD>Meta-g</KBD> use the same criteria as <KBD>Meta-h</KBD> for
  7621. finding paragraph boundaries (see section <A HREF="xEMACS.HTM#SEC177">Paragraphs</A>).  For more control, you
  7622. can use <KBD>M-x fill-region-as-paragraph</KBD>, which refills everything
  7623. between point and mark.  This command recognizes only blank lines as
  7624. paragraph separators.<A NAME="IDX917"></A>
  7625.   A numeric argument to <KBD>M-g</KBD> or <KBD>M-q</KBD> causes it to
  7626. <DFN>justify</DFN> the text as well as filling it.  Extra spaces are inserted
  7627. to make the right margin line up exactly at the fill column.  To remove
  7628. the extra spaces, use <KBD>M-q</KBD> or <KBD>M-g</KBD> with no argument.<A NAME="IDX918"></A>
  7629. The variable <CODE>auto-fill-inhibit-regexp</CODE> takes as a value a regexp to
  7630. match lines that should not be auto-filled.
  7631. <A NAME="IDX919"></A>
  7632. <A NAME="IDX920"></A>
  7633. <A NAME="IDX921"></A>
  7634.   The command <KBD>Meta-s</KBD> (<CODE>center-line</CODE>) centers the current line
  7635. within the current fill column.  With an argument, it centers several lines
  7636. individually and moves past them.
  7637. <A NAME="IDX922"></A>
  7638.   The maximum line width for filling is in the variable
  7639. <CODE>fill-column</CODE>.  Altering the value of <CODE>fill-column</CODE> makes it
  7640. local to the current buffer; until then, the default value--initially
  7641. 70--is in effect. See section <A HREF="xEMACS.HTM#SEC278">Local Variables</A>.
  7642. <A NAME="IDX923"></A>
  7643. <A NAME="IDX924"></A>
  7644.   The easiest way to set <CODE>fill-column</CODE> is to use the command <KBD>C-x
  7645. f</KBD> (<CODE>set-fill-column</CODE>).  With no argument, it sets <CODE>fill-column</CODE>
  7646. to the current horizontal position of point.  With a numeric argument, it
  7647. uses that number as the new fill column.
  7648. <H3><A NAME="SEC182" HREF="xEMACS_TO.HTM#SEC182">The Fill Prefix</A></H3>
  7649. <A NAME="IDX925"></A>
  7650.   To fill a paragraph in which each line starts with a special marker
  7651. (which might be a few spaces, giving an indented paragraph), use the
  7652. <DFN>fill prefix</DFN> feature.  The fill prefix is a string which is not
  7653. included in filling.  Emacs expects every line to start with a fill
  7654. prefix.
  7655. <DL COMPACT>
  7656. <DT><KBD>C-x .</KBD>
  7657. <DD>Set the fill prefix (<CODE>set-fill-prefix</CODE>).
  7658. <DT><KBD>M-q</KBD>
  7659. <DD>Fill a paragraph using current fill prefix (<CODE>fill-paragraph</CODE>).
  7660. <DT><KBD>M-x fill-individual-paragraphs</KBD>
  7661. <DD>Fill the region, considering each change of indentation as starting a
  7662. new paragraph.
  7663. </DL>
  7664. <A NAME="IDX926"></A>
  7665. <A NAME="IDX927"></A>
  7666.   To specify a fill prefix, move to a line that starts with the desired
  7667. prefix, put point at the end of the prefix, and give the command
  7668. <KBD>C-x .</KBD> (<CODE>set-fill-prefix</CODE>).  That's a period after the
  7669. <KBD>C-x</KBD>.  To turn off the fill prefix, specify an empty prefix: type
  7670. <KBD>C-x .</KBD> with point at the beginning of a line.<P>
  7671.   When a fill prefix is in effect, the fill commands remove the fill
  7672. prefix from each line before filling and insert it on each line after
  7673. filling.  Auto Fill mode also inserts the fill prefix inserted on new
  7674. lines it creates.  Lines that do not start with the fill prefix are
  7675. considered to start paragraphs, both in <KBD>M-q</KBD> and the paragraph
  7676. commands; this is just right if you are using paragraphs with hanging
  7677. indentation (every line indented except the first one).  Lines which are
  7678. blank or indented once the prefix is removed also separate or start
  7679. paragraphs; this is what you want if you are writing multi-paragraph
  7680. comments with a comment delimiter on each line.
  7681. <A NAME="IDX928"></A>
  7682.   The fill prefix is stored in the variable <CODE>fill-prefix</CODE>.  Its value
  7683. is a string, or <CODE>nil</CODE> when there is no fill prefix.  This is a
  7684. per-buffer variable; altering the variable affects only the current buffer,
  7685. but there is a default value which you can change as well.  See section <A HREF="xEMACS.HTM#SEC278">Local Variables</A>.
  7686. <A NAME="IDX929"></A>
  7687.   Another way to use fill prefixes is through <KBD>M-x
  7688. fill-individual-paragraphs</KBD>.  This function divides the region into groups
  7689. of consecutive lines with the same amount and kind of indentation and fills
  7690. each group as a paragraph, using its indentation as a fill prefix.
  7691. <A NAME="IDX930"></A>
  7692. <H2><A NAME="SEC183" HREF="xEMACS_TO.HTM#SEC183">Case Conversion Commands</A></H2>
  7693.   Emacs has commands for converting either a single word or any arbitrary
  7694. range of text to upper case or to lower case.
  7695. <DL COMPACT>
  7696. <DT><KBD>M-l</KBD>
  7697. <DD>Convert following word to lower case (<CODE>downcase-word</CODE>).
  7698. <DT><KBD>M-u</KBD>
  7699. <DD>Convert following word to upper case (<CODE>upcase-word</CODE>).
  7700. <DT><KBD>M-c</KBD>
  7701. <DD>Capitalize the following word (<CODE>capitalize-word</CODE>).
  7702. <DT><KBD>C-x C-l</KBD>
  7703. <DD>Convert region to lower case (<CODE>downcase-region</CODE>).
  7704. <DT><KBD>C-x C-u</KBD>
  7705. <DD>Convert region to upper case (<CODE>upcase-region</CODE>).
  7706. </DL>
  7707. <A NAME="IDX931"></A>
  7708. <A NAME="IDX932"></A>
  7709. <A NAME="IDX933"></A>
  7710. <A NAME="IDX934"></A>
  7711. <A NAME="IDX935"></A>
  7712. <A NAME="IDX936"></A>
  7713. <A NAME="IDX937"></A>
  7714.   The word conversion commands are used most frequently.  <KBD>Meta-l</KBD>
  7715. (<CODE>downcase-word</CODE>) converts the word after point to lower case,
  7716. moving past it.  Thus, repeating <KBD>Meta-l</KBD> converts successive words.
  7717. <KBD>Meta-u</KBD> (<CODE>upcase-word</CODE>) converts to all capitals instead,
  7718. while <KBD>Meta-c</KBD> (<CODE>capitalize-word</CODE>) puts the first letter of the
  7719. word into upper case and the rest into lower case.  The word conversion
  7720. commands convert several words at once if given an argument.  They are
  7721. especially convenient for converting a large amount of text from all
  7722. upper case to mixed case: you can move through the text using
  7723. <KBD>M-l</KBD>, <KBD>M-u</KBD>, or <KBD>M-c</KBD> on each word as appropriate,
  7724. occasionally using <KBD>M-f</KBD> instead to skip a word.
  7725.   When given a negative argument, the word case conversion commands apply
  7726. to the appropriate number of words before point, but do not move point.
  7727. This is convenient when you have just typed a word in the wrong case: you
  7728. can give the case conversion command and continue typing.
  7729.   If a word case conversion command is given in the middle of a word, it
  7730. applies only to the part of the word which follows point.  This is just
  7731. like what <KBD>Meta-d</KBD> (<CODE>kill-word</CODE>) does.  With a negative argument,
  7732. case conversion applies only to the part of the word before point.
  7733. <A NAME="IDX938"></A>
  7734. <A NAME="IDX939"></A>
  7735. <A NAME="IDX940"></A>
  7736. <A NAME="IDX941"></A>
  7737. <A NAME="IDX942"></A>
  7738.   The other case conversion commands are <KBD>C-x C-u</KBD>
  7739. (<CODE>upcase-region</CODE>) and <KBD>C-x C-l</KBD> (<CODE>downcase-region</CODE>), which
  7740. convert everything between point and mark to the specified case.  Point and
  7741. mark do not move.<P>
  7742. <A NAME="IDX943"></A>
  7743. <A NAME="IDX944"></A>
  7744. <H1><A NAME="SEC184" HREF="xEMACS_TO.HTM#SEC184">Editing Programs</A></H1>
  7745.   Emacs has many commands designed to understand the syntax of programming
  7746. languages such as Lisp and C.  These commands can:
  7747. Move over or kill balanced expressions or <DFN>sexps</DFN> (see section <A HREF="xEMACS.HTM#SEC186">Lists and Sexps</A>).
  7748. Move over or mark top-level balanced expressions (<DFN>defuns</DFN>, in Lisp;
  7749. functions, in C).
  7750. Show how parentheses balance (see section <A HREF="xEMACS.HTM#SEC193">Automatic Display of Matching Parentheses</A>).
  7751. Insert, kill, or align comments (see section <A HREF="xEMACS.HTM#SEC194">Manipulating Comments</A>).
  7752. Follow the usual indentation conventions of the language
  7753. (see section <A HREF="xEMACS.HTM#SEC188">Indentation for Programs</A>).
  7754. </UL>
  7755.   The commands available for words, sentences, and paragraphs are useful in
  7756. editing code even though their canonical application is for editing human
  7757. language text.  Most symbols contain words (see section <A HREF="xEMACS.HTM#SEC175">Words</A>); sentences can
  7758. be found in strings and comments (see section <A HREF="xEMACS.HTM#SEC176">Sentences</A>).  Paragraphs per se
  7759. are not present in code, but the paragraph commands are useful anyway,
  7760. because Lisp mode and C mode define paragraphs to begin and end at blank
  7761. lines (see section <A HREF="xEMACS.HTM#SEC177">Paragraphs</A>).  Judicious use of blank lines to make the
  7762. program clearer also provides interesting chunks of text for the
  7763. paragraph commands to work on.
  7764.   The selective display feature is useful for looking at the overall
  7765. structure of a function (see section <A HREF="xEMACS.HTM#SEC91">Selective Display</A>).  This feature causes
  7766. only the lines that are indented less than a specified amount to appear
  7767. on the screen.
  7768. <H2><A NAME="SEC185" HREF="xEMACS_TO.HTM#SEC185">Major Modes for Programming Languages</A></H2>
  7769. <A NAME="IDX945"></A>
  7770. <A NAME="IDX946"></A>
  7771. <A NAME="IDX947"></A>
  7772.   Emacs has several major modes for the programming languages Lisp, Scheme (a
  7773. variant of Lisp), C, Fortran, and Muddle.  Ideally, a major mode should be
  7774. implemented for each programming language you might want to edit with
  7775. Emacs; but often the mode for one language can serve for other
  7776. syntactically similar languages.  The language modes that exist are those
  7777. that someone decided to take the trouble to write.
  7778.   There are several variants of Lisp mode, which differ in the way they
  7779. interface to Lisp execution.  See section <A HREF="xEMACS.HTM#SEC221">Major Modes for Lisp</A>.
  7780.   Each of the programming language modes defines the <KBD>TAB</KBD> key to run
  7781. an indentation function that knows the indentation conventions of that
  7782. language and updates the current line's indentation accordingly.  For
  7783. example, in C mode <KBD>TAB</KBD> is bound to <CODE>c-indent-line</CODE>.  <KBD>LFD</KBD>
  7784. is normally defined to do <KBD>RET</KBD> followed by <KBD>TAB</KBD>; thus it, too,
  7785. indents in a mode-specific fashion.
  7786. <A NAME="IDX948"></A>
  7787. <A NAME="IDX949"></A>
  7788.   In most programming languages, indentation is likely to vary from line to
  7789. line.  So the major modes for those languages rebind <KBD>DEL</KBD> to treat a
  7790. tab as if it were the equivalent number of spaces (using the command
  7791. <CODE>backward-delete-char-untabify</CODE>).  This makes it possible to rub out
  7792. indentation one column at a time without worrying whether it is made up of
  7793. spaces or tabs.  In these modes, use <KBD>C-b C-d</KBD> to delete a tab
  7794. character before point. 
  7795.   Programming language modes define paragraphs to be separated only by
  7796. blank lines, so that the paragraph commands remain useful.  Auto Fill mode,
  7797. if enabled in a programming language major mode, indents the new lines
  7798. which it creates.
  7799. <A NAME="IDX950"></A>
  7800. <A NAME="IDX951"></A>
  7801. <A NAME="IDX952"></A>
  7802. <A NAME="IDX953"></A>
  7803. <A NAME="IDX954"></A>
  7804. <A NAME="IDX955"></A>
  7805. <A NAME="IDX956"></A>
  7806.   Turning on a major mode calls a user-supplied function called the
  7807. <DFN>mode hook</DFN>, which is the value of a Lisp variable.  For example,
  7808. turning on C mode calls the value of the variable <CODE>c-mode-hook</CODE> if
  7809. that value exists and is non-<CODE>nil</CODE>.  Mode hook variables for other
  7810. programming language modes include <CODE>lisp-mode-hook</CODE>,
  7811. <CODE>emacs-lisp-mode-hook</CODE>, <CODE>lisp-interaction-mode-hook</CODE>,
  7812. <CODE>scheme-mode-hook</CODE>, and <CODE>muddle-mode-hook</CODE>.  The mode hook
  7813. function receives no arguments.<P>
  7814. <H2><A NAME="SEC186" HREF="xEMACS_TO.HTM#SEC186">Lists and Sexps</A></H2>
  7815. <A NAME="IDX957"></A>
  7816.   By convention, Emacs keys for dealing with balanced expressions are
  7817. usually <KBD>Control-Meta-</KBD> characters.  They tend to be analogous in
  7818. function to their <KBD>Control-</KBD> and <KBD>Meta-</KBD> equivalents.  These commands
  7819. are usually thought of as pertaining to expressions in programming
  7820. languages, but can be useful with any language in which some sort of
  7821. parentheses exist (including English).
  7822. <A NAME="IDX958"></A>
  7823. <A NAME="IDX959"></A>
  7824. <A NAME="IDX960"></A>
  7825.   The commands fall into two classes.  Some commands deal only with
  7826. <DFN>lists</DFN> (parenthetical groupings).  They see nothing except
  7827. parentheses, brackets, braces (depending on what must balance in the
  7828. language you are working with), and escape characters that might be used
  7829. to quote those.
  7830.   The other commands deal with expressions or <DFN>sexps</DFN>.  The word `sexp'
  7831. is derived from <DFN>s-expression</DFN>, the term for a symbolic expression in
  7832. Lisp.  In Emacs, the notion of `sexp' is not limited to Lisp.  It
  7833. refers to an expression in the language  your program is written in.
  7834. Each programming language has its own major mode, which customizes the
  7835. syntax tables so that expressions in that language count as sexps.
  7836.   Sexps typically include symbols, numbers, and string constants, as well
  7837. as anything contained in parentheses, brackets, or braces.
  7838.   In languages that use prefix and infix operators, such as C, it is not
  7839. possible for all expressions to be sexps.  For example, C mode does not
  7840. recognize <SAMP>`foo + bar'</SAMP> as an sexp, even though it <I>is</I> a C expression;
  7841. it recognizes <SAMP>`foo'</SAMP> as one sexp and <SAMP>`bar'</SAMP> as another, with the
  7842. <SAMP>`+'</SAMP> as punctuation between them.  This is a fundamental ambiguity:
  7843. both <SAMP>`foo + bar'</SAMP> and <SAMP>`foo'</SAMP> are legitimate choices for the sexp to
  7844. move over if point is at the <SAMP>`f'</SAMP>.  Note that <SAMP>`(foo + bar)'</SAMP> is a
  7845. sexp in C mode.
  7846.   Some languages have obscure forms of syntax for expressions that nobody
  7847. has bothered to make Emacs understand properly.
  7848. <DL COMPACT>
  7849. <DT><KBD>C-M-f</KBD>
  7850. <DD>Move forward over an sexp (<CODE>forward-sexp</CODE>).
  7851. <DT><KBD>C-M-b</KBD>
  7852. <DD>Move backward over an sexp (<CODE>backward-sexp</CODE>).
  7853. <DT><KBD>C-M-k</KBD>
  7854. <DD>Kill sexp forward (<CODE>kill-sexp</CODE>).
  7855. <DT><KBD>C-M-u</KBD>
  7856. <DD>Move up and backward in list structure (<CODE>backward-up-list</CODE>).
  7857. <DT><KBD>C-M-d</KBD>
  7858. <DD>Move down and forward in list structure (<CODE>down-list</CODE>).
  7859. <DT><KBD>C-M-n</KBD>
  7860. <DD>Move forward over a list (<CODE>forward-list</CODE>).
  7861. <DT><KBD>C-M-p</KBD>
  7862. <DD>Move backward over a list (<CODE>backward-list</CODE>).
  7863. <DT><KBD>C-M-t</KBD>
  7864. <DD>Transpose expressions (<CODE>transpose-sexps</CODE>).
  7865. <DT><KBD>C-M-@</KBD>
  7866. <DD>Put mark after following expression (<CODE>mark-sexp</CODE>).
  7867. </DL>
  7868. <A NAME="IDX961"></A>
  7869. <A NAME="IDX962"></A>
  7870. <A NAME="IDX963"></A>
  7871. <A NAME="IDX964"></A>
  7872.   To move forward over an sexp, use <KBD>C-M-f</KBD> (<CODE>forward-sexp</CODE>).  If
  7873. the first significant character after point is an opening delimiter
  7874. (<SAMP>`('</SAMP> in Lisp; <SAMP>`('</SAMP>, <SAMP>`['</SAMP>, or <SAMP>`{'</SAMP> in C), <KBD>C-M-f</KBD>
  7875. moves past the matching closing delimiter.  If the character begins a
  7876. symbol, string, or number, <KBD>C-M-f</KBD> moves over that.  If the character
  7877. after point is a closing delimiter, <KBD>C-M-f</KBD> just moves past it.  (This
  7878. last is not really moving across an sexp; it is an exception which is
  7879. included in the definition of <KBD>C-M-f</KBD> because it is as useful a
  7880. behavior as anyone can think of for that situation.)<P>
  7881.   The command <KBD>C-M-b</KBD> (<CODE>backward-sexp</CODE>) moves backward over a
  7882. sexp.  The detailed rules are like those above for <KBD>C-M-f</KBD>, but with
  7883. directions reversed.  If there are any prefix characters (single quote,
  7884. back quote, and comma, in Lisp) preceding the sexp, <KBD>C-M-b</KBD> moves back
  7885. over them as well.
  7886.   <KBD>C-M-f</KBD> or <KBD>C-M-b</KBD> with an argument repeats that operation the
  7887. specified number of times; with a negative argument, it moves in the
  7888. opposite direction.
  7889. In languages such as C where the comment-terminator can be recognized,
  7890. the sexp commands move across comments as if they were whitespace.  In
  7891. Lisp and other languages where comments run until the end of a line, it
  7892. is very difficult to ignore comments when parsing backwards; therefore,
  7893. in such languages the sexp commands treat the text of comments as if it
  7894. were code.
  7895. <A NAME="IDX965"></A>
  7896. <A NAME="IDX966"></A>
  7897.   Killing an sexp at a time can be done with <KBD>C-M-k</KBD> (<CODE>kill-sexp</CODE>).
  7898. <KBD>C-M-k</KBD> kills the characters that <KBD>C-M-f</KBD> would move over.
  7899. <A NAME="IDX967"></A>
  7900. <A NAME="IDX968"></A>
  7901. <A NAME="IDX969"></A>
  7902. <A NAME="IDX970"></A>
  7903.   The <DFN>list commands</DFN>, <KBD>C-M-n</KBD> (<CODE>forward-list</CODE>) and
  7904. <KBD>C-M-p</KBD> (<CODE>backward-list</CODE>), move over lists like the sexp
  7905. commands but skip over any number of other kinds of sexps (symbols,
  7906. strings, etc).  In some situations, these commands are useful because
  7907. they usually ignore comments, since the comments usually do not contain
  7908. any lists.<A NAME="IDX971"></A>
  7909. <A NAME="IDX972"></A>
  7910. <A NAME="IDX973"></A>
  7911. <A NAME="IDX974"></A>
  7912.   <KBD>C-M-n</KBD> and <KBD>C-M-p</KBD> stay at the same level in parentheses, when
  7913. that is possible.  To move <I>up</I> one (or <VAR>n</VAR>) levels, use <KBD>C-M-u</KBD>
  7914. (<CODE>backward-up-list</CODE>).
  7915. <KBD>C-M-u</KBD> moves backward up past one unmatched opening delimiter.  A
  7916. positive argument serves as a repeat count; a negative argument reverses
  7917. direction of motion and also requests repetition, so it moves forward and
  7918. up one or more levels.<P>
  7919.   To move <I>down</I> in list structure, use <KBD>C-M-d</KBD>
  7920. (<CODE>down-list</CODE>).  In Lisp mode, where <SAMP>`('</SAMP> is the only opening
  7921. delimiter, this is nearly the same as searching for a <SAMP>`('</SAMP>.  An
  7922. argument specifies the number of levels of parentheses to go down.
  7923. <A NAME="IDX975"></A>
  7924. <A NAME="IDX976"></A>
  7925. <A NAME="IDX977"></A>
  7926. <KBD>C-M-t</KBD> (<CODE>transpose-sexps</CODE>) drags the previous sexp across
  7927. the next one.  An argument serves as a repeat count, and a negative
  7928. argument drags backwards (thus canceling out the effect of <KBD>C-M-t</KBD> with
  7929. a positive argument).  An argument of zero, rather than doing nothing,
  7930. transposes the sexps ending after point and the mark.
  7931. <A NAME="IDX978"></A>
  7932. <A NAME="IDX979"></A>
  7933.   To make the region be the next sexp in the buffer, use <KBD>C-M-@</KBD>
  7934. (<CODE>mark-sexp</CODE>) which sets the mark at the same place that
  7935. <KBD>C-M-f</KBD> would move to.  <KBD>C-M-@</KBD> takes arguments like
  7936. <KBD>C-M-f</KBD>.  In particular, a negative argument is useful for putting
  7937. the mark at the beginning of the previous sexp.
  7938.   The list and sexp commands' understanding of syntax is completely
  7939. controlled by the syntax table.  Any character can, for example, be
  7940. declared to be an opening delimiter and act like an open parenthesis.
  7941. See section <A HREF="xEMACS.HTM#SEC289">The Syntax Table</A>.
  7942. <A NAME="IDX980"></A>
  7943. <H2><A NAME="SEC187" HREF="xEMACS_TO.HTM#SEC187">Defuns</A></H2>
  7944.   In Emacs, a parenthetical grouping at the top level in the buffer is
  7945. called a <DFN>defun</DFN>.  The name derives from the fact that most
  7946. top-level lists in Lisp are instances of the special form
  7947. <CODE>defun</CODE>, but Emacs calls any top-level parenthetical
  7948. grouping counts a defun regardless of its contents or
  7949. the programming language.  For example, in C, the body of a
  7950. function definition is a defun.
  7951. <DL COMPACT>
  7952. <DT><KBD>C-M-a</KBD>
  7953. <DD>Move to beginning of current or preceding defun
  7954. (<CODE>beginning-of-defun</CODE>).
  7955. <DT><KBD>C-M-e</KBD>
  7956. <DD>Move to end of current or following defun (<CODE>end-of-defun</CODE>).
  7957. <DT><KBD>C-M-h</KBD>
  7958. <DD>Put region around whole current or following defun (<CODE>mark-defun</CODE>).
  7959. </DL>
  7960. <A NAME="IDX981"></A>
  7961. <A NAME="IDX982"></A>
  7962. <A NAME="IDX983"></A>
  7963. <A NAME="IDX984"></A>
  7964. <A NAME="IDX985"></A>
  7965. <A NAME="IDX986"></A>
  7966.   The commands to move to the beginning and end of the current defun are
  7967. <KBD>C-M-a</KBD> (<CODE>beginning-of-defun</CODE>) and <KBD>C-M-e</KBD> (<CODE>end-of-defun</CODE>).
  7968.    To operate on the current defun, use <KBD>C-M-h</KBD> (<CODE>mark-defun</CODE>)
  7969. which puts point at the beginning and the mark at the end of the current
  7970. or next defun.  This is the easiest way to prepare for moving the defun
  7971. to a different place.  In C mode, <KBD>C-M-h</KBD> runs the function
  7972. <CODE>mark-c-function</CODE>, which is almost the same as <CODE>mark-defun</CODE>,
  7973. but which backs up over the argument declarations, function name, and
  7974. returned data type so that the entire C function is inside the region.
  7975. <A NAME="IDX987"></A>
  7976. To compile and evaluate the current defun, use <KBD>M-x compile-defun</KBD>. 
  7977. This function prints the results in the minibuffer. If you include an 
  7978. argument, it inserts the value in the current buffer after the defun.
  7979.   Emacs assumes that any open-parenthesis found in the leftmost column is
  7980. the start of a defun.  Therefore, <I>never put an open-parenthesis at the
  7981. left margin in a Lisp file unless it is the start of a top level list.
  7982. Never put an open-brace or other opening delimiter at the beginning of a
  7983. line of C code unless it starts the body of a function.</I>  The most likely
  7984. problem case is when you want an opening delimiter at the start of a line
  7985. inside a string.  To avoid trouble, put an escape character (<SAMP>`\'</SAMP> in C
  7986. and Emacs Lisp, <SAMP>`/'</SAMP> in some other Lisp dialects) before the opening
  7987. delimiter.  It will not affect the contents of the string.
  7988.   The original Emacs found defuns by moving upward a
  7989. level of parentheses until there were no more levels to go up.  This
  7990. required scanning back to the beginning of the buffer for every
  7991. function.  To speed this up, Emacs was changed to assume
  7992. that any <SAMP>`('</SAMP> (or other character assigned the syntactic class of
  7993. opening-delimiter) at the left margin is the start of a defun.  This
  7994. heuristic is nearly always right; however, it mandates the convention 
  7995. described above.
  7996. <A NAME="IDX988"></A>
  7997. <A NAME="IDX989"></A>
  7998. <H2><A NAME="SEC188" HREF="xEMACS_TO.HTM#SEC188">Indentation for Programs</A></H2>
  7999.   The best way to keep a program properly indented ("ground") is to
  8000. use Emacs to re-indent it as you change the program.  Emacs has commands
  8001. to indent properly either a single line, a specified number of lines, or
  8002. all of the lines inside a single parenthetical grouping.
  8003. <H3><A NAME="SEC189" HREF="xEMACS_TO.HTM#SEC189">Basic Program Indentation Commands</A></H3>
  8004. <DL COMPACT>
  8005. <DT><KBD><KBD>TAB</KBD></KBD>
  8006. <DD>Adjust indentation of current line.
  8007. <DT><KBD><KBD>LFD</KBD></KBD>
  8008. <DD>Equivalent to <KBD>RET</KBD> followed by <KBD>TAB</KBD> (<CODE>newline-and-indent</CODE>).
  8009. </DL>
  8010. <A NAME="IDX990"></A>
  8011. <A NAME="IDX991"></A>
  8012. <A NAME="IDX992"></A>
  8013.   The basic indentation command is <KBD>TAB</KBD>, which gives the current
  8014. line the correct indentation as determined from the previous lines.  The
  8015. function that <KBD>TAB</KBD> runs depends on the major mode; it is
  8016. <CODE>lisp-indent-line</CODE> in Lisp mode, <CODE>c-indent-line</CODE> in C mode,
  8017. etc.  These functions understand different syntaxes for different
  8018. languages, but they all do about the same thing.  <KBD>TAB</KBD> in any
  8019. programming language major mode inserts or deletes whitespace at the
  8020. beginning of the current line, independent of where point is in the
  8021. line.  If point is inside the whitespace at the beginning of the line,
  8022. <KBD>TAB</KBD> leaves it at the end of that whitespace; otherwise, <KBD>TAB</KBD>
  8023. leaves point fixed with respect to the characters around it.
  8024.   Use <KBD>C-q <KBD>TAB</KBD></KBD> to insert a tab at point.
  8025. <A NAME="IDX993"></A>
  8026. <A NAME="IDX994"></A>
  8027.   When entering a large amount of new code, use <KBD>LFD</KBD>
  8028. (<CODE>newline-and-indent</CODE>), which is equivalent to a <KBD>RET</KBD> followed
  8029. by a <KBD>TAB</KBD>.  <KBD>LFD</KBD> creates a blank line, then gives it the
  8030. appropriate indentation.
  8031.   <KBD>TAB</KBD> indents the second and following lines of the body of a
  8032. parenthetical grouping each under the preceding one; therefore, if you
  8033. alter one line's indentation to be nonstandard, the lines below tend
  8034. to follow it.  This is the right behavior in cases where the standard
  8035. result of <KBD>TAB</KBD> does not look good.
  8036.   Remember that Emacs assumes that an open-parenthesis, open-brace, or
  8037. other opening delimiter at the left margin (including the indentation
  8038. routines) is the start of a function.  You should therefore never have
  8039. an opening delimiter in column zero that is not the beginning of a
  8040. function, not even inside a string.  This restriction is vital for
  8041. making the indentation commands fast. See section <A HREF="xEMACS.HTM#SEC187">Defuns</A>, for more
  8042. information on this behavior.
  8043. <H3><A NAME="SEC190" HREF="xEMACS_TO.HTM#SEC190">Indenting Several Lines</A></H3>
  8044.   Several commands are available to re-indent several lines of code
  8045. which have been altered or moved to a different level in a list
  8046. structure.
  8047. <DL COMPACT>
  8048. <DT><KBD>C-M-q</KBD>
  8049. <DD>Re-indent all the lines within one list (<CODE>indent-sexp</CODE>).
  8050. <DT><KBD>C-u <KBD>TAB</KBD></KBD>
  8051. <DD>Shift an entire list rigidly sideways so that its first line
  8052. is properly indented.
  8053. <DT><KBD>C-M-\</KBD>
  8054. <DD>Re-indent all lines in the region (<CODE>indent-region</CODE>).
  8055. </DL>
  8056. <A NAME="IDX995"></A>
  8057. <A NAME="IDX996"></A>
  8058. <A NAME="IDX997"></A>
  8059.  To re-indent the contents of a single list, position point before the
  8060. beginning of it and type <KBD>C-M-q</KBD>. This key is bound to
  8061. <CODE>indent-sexp</CODE> in Lisp mode, <CODE>indent-c-exp</CODE> in C mode, and
  8062. bound to other suitable functions in other modes.  The indentation of
  8063. the line the sexp starts on is not changed; therefore, only the relative
  8064. indentation within the list, and not its position, is changed.  To
  8065. correct the position as well, type a <KBD>TAB</KBD> before <KBD>C-M-q</KBD>.
  8066. <A NAME="IDX998"></A>
  8067.   If the relative indentation within a list is correct but the
  8068. indentation of its beginning is not, go to the line on which the list
  8069. begins and type <KBD>C-u <KBD>TAB</KBD></KBD>.  When you give <KBD>TAB</KBD> a numeric
  8070. argument, it moves all the lines in the group, starting on the current
  8071. line, sideways the same amount that the current line moves.  The command
  8072. does not move lines that start inside strings, or C
  8073. preprocessor lines when in C mode.
  8074. <A NAME="IDX999"></A>
  8075. <A NAME="IDX1000"></A>
  8076.   Another way to specify a range to be re-indented is with point and
  8077. mark.  The command <KBD>C-M-\</KBD> (<CODE>indent-region</CODE>) applies <KBD>TAB</KBD>
  8078. to every line whose first character is between point and mark.
  8079. <A NAME="IDX1001"></A>
  8080. <H3><A NAME="SEC191" HREF="xEMACS_TO.HTM#SEC191">Customizing Lisp Indentation</A></H3>
  8081.   The indentation pattern for a Lisp expression can depend on the function
  8082. called by the expression.  For each Lisp function, you can choose among
  8083. several predefined patterns of indentation, or define an arbitrary one with
  8084. a Lisp program.
  8085.   The standard pattern of indentation is as follows: the second line of the
  8086. expression is indented under the first argument, if that is on the same
  8087. line as the beginning of the expression; otherwise, the second line is
  8088. indented underneath the function name.  Each following line is indented
  8089. under the previous line whose nesting depth is the same.
  8090. <A NAME="IDX1002"></A>
  8091.   If the variable <CODE>lisp-indent-offset</CODE> is non-<CODE>nil</CODE>, it overrides
  8092. the usual indentation pattern for the second line of an expression, so that
  8093. such lines are always indented <CODE>lisp-indent-offset</CODE> more columns than
  8094. the containing list.
  8095. <A NAME="IDX1003"></A>
  8096.   Certain functions override the standard pattern.  Functions
  8097. whose names start with <CODE>def</CODE> always indent the second line by
  8098. <CODE>lisp-body-indention</CODE> extra columns beyond the open-parenthesis
  8099. starting the expression.
  8100.   Individual functions can override the standard pattern in various
  8101. ways, according to the <CODE>lisp-indent-function</CODE> property of the
  8102. function name.  (Note: <CODE>lisp-indent-function</CODE> was formerly called
  8103. <CODE>lisp-indent-hook</CODE>).  There are four possibilities for this
  8104. property:
  8105. <DL COMPACT>
  8106. <DT><CODE>nil</CODE>
  8107. <DD>This is the same as no property; the standard indentation pattern is used.
  8108. <DT><CODE>defun</CODE>
  8109. <DD>The pattern used for function names that start with <CODE>def</CODE> is used for
  8110. this function also.
  8111. <DT>a number, <VAR>number</VAR>
  8112. <DD>The first <VAR>number</VAR> arguments of the function are
  8113. <DFN>distinguished</DFN> arguments; the rest are considered the <DFN>body</DFN>
  8114. of the expression.  A line in the expression is indented according to
  8115. whether the first argument on it is distinguished or not.  If the
  8116. argument is part of the body, the line is indented <CODE>lisp-body-indent</CODE>
  8117. more columns than the open-parenthesis starting the containing
  8118. expression.  If the argument is distinguished and is either the first
  8119. or second argument, it is indented <I>twice</I> that many extra columns.
  8120. If the argument is distinguished and not the first or second argument,
  8121. the standard pattern is followed for that line.
  8122. <DT>a symbol, <VAR>symbol</VAR>
  8123. <DD><VAR>symbol</VAR> should be a function name; that function is called to
  8124. calculate the indentation of a line within this expression.  The
  8125. function receives two arguments:
  8126. <DL COMPACT>
  8127. <DT><VAR>state</VAR>
  8128. <DD>The value returned by <CODE>parse-partial-sexp</CODE> (a Lisp primitive for
  8129. indentation and nesting computation) when it parses up to the
  8130. beginning of this line.
  8131. <DT><VAR>pos</VAR>
  8132. <DD>The position at which the line being indented begins.
  8133. </DL>
  8134. It should return either a number, which is the number of columns of
  8135. indentation for that line, or a list whose first element is such a
  8136. number.  The difference between returning a number and returning a list
  8137. is that a number says that all following lines at the same nesting level
  8138. should be indented just like this one; a list says that following lines
  8139. might call for different indentations.  This makes a difference when the
  8140. indentation is computed by <KBD>C-M-q</KBD>; if the value is a number,
  8141. <KBD>C-M-q</KBD> need not recalculate indentation for the following lines
  8142. until the end of the list.
  8143. </DL>
  8144. <H3><A NAME="SEC192" HREF="xEMACS_TO.HTM#SEC192">Customizing C Indentation</A></H3>
  8145.   Two variables control which commands perform C indentation and when.
  8146. <A NAME="IDX1004"></A>
  8147.   If <CODE>c-auto-newline</CODE> is non-<CODE>nil</CODE>, newlines are inserted both
  8148. before and after braces that you insert and after colons and semicolons.
  8149. Correct C indentation is done on all the lines that are made this way.
  8150. <A NAME="IDX1005"></A>
  8151.   If <CODE>c-tab-always-indent</CODE> is non-<CODE>nil</CODE>, the <KBD>TAB</KBD> command
  8152. in C mode does indentation only if point is at the left margin or within
  8153. the line's indentation.  If there is non-whitespace to the left of point,
  8154. <KBD>TAB</KBD> just inserts a tab character in the buffer.  Normally,
  8155. this variable is <CODE>nil</CODE>, and <KBD>TAB</KBD> always reindents the current line.
  8156.   C does not have anything analogous to particular function names for which
  8157. special forms of indentation are desirable.  However, it has a different
  8158. need for customization facilities: many different styles of C indentation
  8159. are in common use.
  8160.   There are six variables you can set to control the style that Emacs C
  8161. mode will use.
  8162. <DL COMPACT>
  8163. <DT><CODE>c-indent-level</CODE>
  8164. <DD>Indentation of C statements within surrounding block.  The surrounding
  8165. block's indentation is the indentation of the line on which the
  8166. open-brace appears.
  8167. <DT><CODE>c-continued-statement-offset</CODE>
  8168. <DD>Extra indentation given to a substatement, such as the then-clause of
  8169. an <CODE>if</CODE> or body of a <CODE>while</CODE>.
  8170. <DT><CODE>c-brace-offset</CODE>
  8171. <DD>Extra indentation for lines that start with an open brace.
  8172. <DT><CODE>c-brace-imaginary-offset</CODE>
  8173. <DD>An open brace following other text is treated as if it were this far
  8174. to the right of the start of its line.
  8175. <DT><CODE>c-argdecl-indent</CODE>
  8176. <DD>Indentation level of declarations of C function arguments.
  8177. <DT><CODE>c-label-offset</CODE>
  8178. <DD>Extra indentation for a line that is a label, case, or default.
  8179. </DL>
  8180. <A NAME="IDX1006"></A>
  8181.   The variable <CODE>c-indent-level</CODE> controls the indentation for C
  8182. statements with respect to the surrounding block.  In the example:
  8183. <PRE>
  8184.     {
  8185.       foo ();
  8186. </PRE>
  8187. the difference in indentation between the lines is <CODE>c-indent-level</CODE>.
  8188. Its standard value is 2.
  8189. If the open-brace beginning the compound statement is not at the beginning
  8190. of its line, the <CODE>c-indent-level</CODE> is added to the indentation of the
  8191. line, not the column of the open-brace.  For example,
  8192. <PRE>
  8193. if (losing) {
  8194.   do_this ();
  8195. </PRE>
  8196. One popular indentation style is that which results from setting
  8197. <CODE>c-indent-level</CODE> to 8 and putting open-braces at the end of a line
  8198. in this way.  Another popular style prefers to put the open-brace on a
  8199. separate line.
  8200. <A NAME="IDX1007"></A>
  8201.   In fact, the value of the variable <CODE>c-brace-imaginary-offset</CODE> is
  8202. also added to the indentation of such a statement.  Normally this variable
  8203. is zero.  Think of this variable as the imaginary position of the open
  8204. brace, relative to the first non-blank character on the line.  By setting
  8205. the variable to 4 and <CODE>c-indent-level</CODE> to 0, you can get this style:
  8206. <PRE>
  8207. if (x == y) {
  8208.     do_it ();
  8209.     }
  8210. </PRE>
  8211.   When <CODE>c-indent-level</CODE> is zero, the statements inside most braces
  8212. line up exactly under the open brace.  An exception are braces in column
  8213. zero, like those surrounding a function's body.  The statements inside
  8214. those braces are not placed at column zero.  Instead,
  8215. <CODE>c-brace-offset</CODE> and <CODE>c-continued-statement-offset</CODE> (see
  8216. below) are added to produce a typical offset between brace levels, and
  8217. the statements are indented that far.
  8218. <A NAME="IDX1008"></A>
  8219.   <CODE>c-continued-statement-offset</CODE> controls the extra indentation for
  8220. a line that starts within a statement (but not within parentheses or
  8221. brackets).  These lines are usually statements inside other statements,
  8222. like the then-clauses of <CODE>if</CODE> statements and the bodies of
  8223. <CODE>while</CODE> statements.  The <CODE>c-continued-statement-offset</CODE>
  8224. parameter determines the difference in indentation between the two lines in:
  8225. <PRE>
  8226. if (x == y)
  8227.   do_it ();
  8228. </PRE>
  8229. The default value for <CODE>c-continued-statement-offset</CODE> is 2.  Some
  8230. popular indentation styles correspond to a value of zero for
  8231. <CODE>c-continued-statement-offset</CODE>.
  8232. <A NAME="IDX1009"></A>
  8233.   <CODE>c-brace-offset</CODE> is the extra indentation given to a line that
  8234. starts with an open-brace.  Its standard value is zero;
  8235. compare:
  8236. <PRE>
  8237. if (x == y)
  8238. </PRE>
  8239. with:
  8240. <PRE>
  8241. if (x == y)
  8242.   do_it ();
  8243. </PRE>
  8244. If you set <CODE>c-brace-offset</CODE> to 4, the first example becomes:
  8245. <PRE>
  8246. if (x == y)
  8247.       {
  8248. </PRE>
  8249. <A NAME="IDX1010"></A>
  8250.   <CODE>c-argdecl-indent</CODE> controls the indentation of declarations of the
  8251. arguments of a C function.  It is absolute: argument declarations receive
  8252. exactly <CODE>c-argdecl-indent</CODE> spaces.  The standard value is 5 and
  8253. results in code like this:
  8254. <PRE>
  8255. char *
  8256. index (string, char)
  8257.      char *string;
  8258.      int char;
  8259. </PRE>
  8260. <A NAME="IDX1011"></A>
  8261.   <CODE>c-label-offset</CODE> is the extra indentation given to a line that
  8262. contains a label, a case statement, or a <CODE>default:</CODE> statement.  Its
  8263. standard value is -2 and results in code like this:
  8264. <PRE>
  8265. switch (c)
  8266.   case 'x':
  8267. </PRE>
  8268. If <CODE>c-label-offset</CODE> were zero, the same code would be indented as:
  8269. <PRE>
  8270. switch (c)
  8271.     case 'x':
  8272. </PRE>
  8273. This example assumes that the other variables above also have their
  8274. default values. 
  8275. Using the indentation style produced by the default settings of the
  8276. variables just discussed and putting open braces on separate lines
  8277. produces clear and readable files.  For an example, look at any of the C
  8278. source files of GNU Emacs.
  8279. <A NAME="IDX1012"></A>
  8280. <A NAME="IDX1013"></A>
  8281. <H2><A NAME="SEC193" HREF="xEMACS_TO.HTM#SEC193">Automatic Display of Matching Parentheses</A></H2>
  8282.   The Emacs parenthesis-matching feature shows you automatically how
  8283. parentheses match in the text.  Whenever a self-inserting character that
  8284. is a closing delimiter is typed, the cursor moves momentarily to the
  8285. location of the matching opening delimiter, provided that is visible on
  8286. the screen.  If it is not on the screen, some text starting with that
  8287. opening delimiter is displayed in the echo area.  Either way, you see
  8288. the grouping you are closing off. 
  8289.   In Lisp, automatic matching applies only to parentheses.  In C, it
  8290. also applies to braces and brackets.  Emacs knows which characters to regard
  8291. as matching delimiters based on the syntax table set by the major
  8292. mode.  See section <A HREF="xEMACS.HTM#SEC289">The Syntax Table</A>.
  8293.   If the opening delimiter and closing delimiter are mismatched--as
  8294. in <SAMP>`[x)'</SAMP>---the echo area displays a warning message.  The
  8295. correct matches are specified in the syntax table.
  8296. <A NAME="IDX1014"></A>
  8297. <A NAME="IDX1015"></A>
  8298.   Two variables control parenthesis matching displays.
  8299. <CODE>blink-matching-paren</CODE> turns the feature on or off. The default is 
  8300. <CODE>t</CODE> (match display is on); <CODE>nil</CODE> turns it off.
  8301. <CODE>blink-matching-paren-distance</CODE> specifies how many characters back
  8302. Emacs searches to find a matching opening delimiter.  If the match is
  8303. not found in the specified region, scanning stops, and nothing is
  8304. displayed.  This prevents wasting lots of time scanning when there is no
  8305. match.  The default is 4000.
  8306. <A NAME="IDX1016"></A>
  8307. <A NAME="IDX1017"></A>
  8308. <A NAME="IDX1018"></A>
  8309. <A NAME="IDX1019"></A>
  8310. <H2><A NAME="SEC194" HREF="xEMACS_TO.HTM#SEC194">Manipulating Comments</A></H2>
  8311.   The comment commands insert, kill and align comments.
  8312. <DL COMPACT>
  8313. <DT><KBD>M-;</KBD>
  8314. <DD>Insert or align comment (<CODE>indent-for-comment</CODE>).
  8315. <DT><KBD>C-x ;</KBD>
  8316. <DD>Set comment column (<CODE>set-comment-column</CODE>).
  8317. <DT><KBD>C-u - C-x ;</KBD>
  8318. <DD>Kill comment on current line (<CODE>kill-comment</CODE>).
  8319. <DT><KBD>M-<KBD>LFD</KBD></KBD>
  8320. <DD>Like <KBD>RET</KBD> followed by inserting and aligning a comment
  8321. (<CODE>indent-new-comment-line</CODE>).
  8322. </DL>
  8323.   The command that creates a comment is <KBD>Meta-;</KBD>
  8324. (<CODE>indent-for-comment</CODE>).  If there is no comment already on the
  8325. line, a new comment is created and aligned at a specific column called
  8326. the <DFN>comment column</DFN>.  Emacs creates the comment by inserting the
  8327. string at the value of <CODE>comment-start</CODE>; see below.  Point is left
  8328. after that string.  If the text of the line extends past the comment
  8329. column, indentation is done to a suitable boundary (usually, at least
  8330. one space is inserted).  If the major mode has specified a string to
  8331. terminate comments, that string is inserted after point, to keep the
  8332. syntax valid.
  8333.   You can also use <KBD>Meta-;</KBD> to align an existing comment.  If a line
  8334. already contains the string that starts comments, <KBD>M-;</KBD> just moves
  8335. point after it and re-indents it to the conventional place.  Exception:
  8336. comments starting in column 0 are not moved.
  8337.   Some major modes have special rules for indenting certain kinds of
  8338. comments in certain contexts.  For example, in Lisp code, comments which
  8339. start with two semicolons are indented as if they were lines of code,
  8340. instead of at the comment column.  Comments which start with three
  8341. semicolons are supposed to start at the left margin.  Emacs understands
  8342. these conventions by indenting a double-semicolon comment using <KBD>TAB</KBD>
  8343. and by not changing the indentation of a triple-semicolon comment at all.
  8344. <PRE>
  8345. ;; This function is just an example.
  8346. ;;; Here either two or three semicolons are appropriate.
  8347. (defun foo (x)
  8348. ;;; And now, the first part of the function:
  8349.   ;; The following line adds one.
  8350.   (1+ x))           ; This line adds one.
  8351. </PRE>
  8352.   In C code, a comment preceded on its line by nothing but whitespace
  8353. is indented like a line of code.
  8354.   Even when an existing comment is properly aligned, <KBD>M-;</KBD> is still
  8355. useful for moving directly to the start of the comment.
  8356. <A NAME="IDX1020"></A>
  8357. <A NAME="IDX1021"></A>
  8358.   <KBD>C-u - C-x ;</KBD> (<CODE>kill-comment</CODE>) kills the comment on the
  8359. current line, if there is one.  The indentation before the start of the
  8360. comment is killed as well.  If there does not appear to be a comment in
  8361. the line, nothing happens.  To reinsert the comment on another line,
  8362. move to the end of that line, type first <KBD>C-y</KBD>, and then <KBD>M-;</KBD>
  8363. to realign the comment.  Note that <KBD>C-u - C-x ;</KBD> is not a distinct
  8364. key; it is <KBD>C-x ;</KBD> (<CODE>set-comment-column</CODE>) with a negative
  8365. argument.  That command is programmed to call <CODE>kill-comment</CODE> when
  8366. called with a negative argument.  However, <CODE>kill-comment</CODE> is a
  8367. valid command which you could bind directly to a key if you wanted to.
  8368. <H3><A NAME="SEC195" HREF="xEMACS_TO.HTM#SEC195">Multiple Lines of Comments</A></H3>
  8369. <A NAME="IDX1022"></A>
  8370. <A NAME="IDX1023"></A>
  8371. <A NAME="IDX1024"></A>
  8372. <A NAME="IDX1025"></A>
  8373.   If you are typing a comment and want to continue it on another line,
  8374. use the command <KBD>Meta-<KBD>LFD</KBD></KBD> (<CODE>indent-new-comment-line</CODE>),
  8375. which terminates the comment you are typing, creates a new blank line
  8376. afterward, and begins a new comment indented under the old one.  If
  8377. Auto Fill mode is on and you go past the fill column while typing, the 
  8378. comment is continued in just this fashion.  If point is
  8379. not at the end of the line when you type <KBD>M-<KBD>LFD</KBD></KBD>, the text on
  8380. the rest of the line becomes part of the new comment line.
  8381. <H3><A NAME="SEC196" HREF="xEMACS_TO.HTM#SEC196">Options Controlling Comments</A></H3>
  8382. <A NAME="IDX1026"></A>
  8383. <A NAME="IDX1027"></A>
  8384. <A NAME="IDX1028"></A>
  8385.   The comment column is stored in the variable <CODE>comment-column</CODE>.  You
  8386. can explicitly set it to a number.  Alternatively, the command <KBD>C-x ;</KBD>
  8387. (<CODE>set-comment-column</CODE>) sets the comment column to the column point is
  8388. at.  <KBD>C-u C-x ;</KBD> sets the comment column to match the last comment
  8389. before point in the buffer, and then calls <KBD>Meta-;</KBD> to align the
  8390. current line's comment under the previous one.  Note that <KBD>C-u - C-x ;</KBD>
  8391. runs the function <CODE>kill-comment</CODE> as described above.
  8392.   <CODE>comment-column</CODE> is a per-buffer variable; altering the variable
  8393. affects only the current buffer.  You can also change the default value.
  8394. See section <A HREF="xEMACS.HTM#SEC278">Local Variables</A>.  Many major modes initialize this variable
  8395. for the current buffer.
  8396. <A NAME="IDX1029"></A>
  8397.   The comment commands recognize comments based on the regular expression
  8398. that is the value of the variable <CODE>comment-start-skip</CODE>.  This regexp
  8399. should not match the null string.  It may match more than the comment
  8400. starting delimiter in the strictest sense of the word; for example, in C
  8401. mode the value of the variable is <CODE><TT>"/\\*+ *"</TT></CODE>, which matches extra
  8402. stars and spaces after the <SAMP>`/*'</SAMP> itself.  (Note that <SAMP>`\\'</SAMP> is
  8403. needed in Lisp syntax to include a <SAMP>`\'</SAMP> in the string, which is needed
  8404. to deny the first star its special meaning in regexp syntax.  See section <A HREF="xEMACS.HTM#SEC99">Syntax of Regular Expressions</A>.)
  8405. <A NAME="IDX1030"></A>
  8406. <A NAME="IDX1031"></A>
  8407.   When a comment command makes a new comment, it inserts the value of
  8408. <CODE>comment-start</CODE> to begin it.  The value of <CODE>comment-end</CODE> is
  8409. inserted after point and will follow the text you will insert
  8410. into the comment.  In C mode, <CODE>comment-start</CODE> has the value
  8411. <CODE>"/* "</CODE> and <CODE>comment-end</CODE> has the value <CODE>" */"</CODE>.
  8412. <A NAME="IDX1032"></A>
  8413.   <CODE>comment-multi-line</CODE> controls how <KBD>M-<KBD>LFD</KBD></KBD>
  8414. (<CODE>indent-new-comment-line</CODE>) behaves when used inside a comment.  If
  8415. <CODE>comment-multi-line</CODE> is <CODE>nil</CODE>, as it normally is, then
  8416. <KBD>M-<KBD>LFD</KBD></KBD> terminates the comment on the starting line and starts
  8417. a new comment on the new following line.  If <CODE>comment-multi-line</CODE>
  8418. is not <CODE>nil</CODE>, then <KBD>M-<KBD>LFD</KBD></KBD> sets up the new following line
  8419. as part of the same comment that was found on the starting line.  This
  8420. is done by not inserting a terminator on the old line and not inserting
  8421. a starter on the new line.  In languages where multi-line comments are legal,
  8422. the value you choose for this variable is a matter of taste.
  8423. <A NAME="IDX1033"></A>
  8424.   The variable <CODE>comment-indent-hook</CODE> should contain a function that
  8425. is called to compute the indentation for a newly inserted comment or for
  8426. aligning an existing comment.  Major modes set this variable differently.
  8427. The function is called with no arguments, but with point at the
  8428. beginning of the comment, or at the end of a line if a new comment is to
  8429. be inserted.  The function should return the column in which the comment
  8430. ought to start.  For example, in Lisp mode, the indent hook function
  8431. bases its decision on the number of semicolons that begin an existing
  8432. comment and on the code in the preceding lines.
  8433. <H2><A NAME="SEC197" HREF="xEMACS_TO.HTM#SEC197">Editing Without Unbalanced Parentheses</A></H2>
  8434. <DL COMPACT>
  8435. <DT><KBD>M-(</KBD>
  8436. <DD>Put parentheses around next sexp(s) (<CODE>insert-parentheses</CODE>).
  8437. <DT><KBD>M-)</KBD>
  8438. <DD>Move past next close parenthesis and re-indent
  8439. (<CODE>move-over-close-and-reindent</CODE>).
  8440. </DL>
  8441. <A NAME="IDX1034"></A>
  8442. <A NAME="IDX1035"></A>
  8443. <A NAME="IDX1036"></A>
  8444. <A NAME="IDX1037"></A>
  8445.   The commands <KBD>M-(</KBD> (<CODE>insert-parentheses</CODE>) and <KBD>M-)</KBD>
  8446. (<CODE>move-over-close-<BR>and-reindent</CODE>) are designed to facilitate a style of
  8447. editing which keeps parentheses balanced at all times.  <KBD>M-(</KBD> inserts a
  8448. pair of parentheses, either together as in <SAMP>`()'</SAMP>, or, if given an
  8449. argument, around the next several sexps, and leaves point after the open
  8450. parenthesis.  Instead of typing <KBD>( F O O )</KBD>, you can type <KBD>M-( F O
  8451. O</KBD>, which has the same effect except for leaving the cursor before the
  8452. close parenthesis.  You can then type <KBD>M-)</KBD>, which moves past the
  8453. close parenthesis, deletes any indentation preceding it (in this example
  8454. there is none), and indents with <KBD>LFD</KBD> after it.
  8455. <A NAME="IDX1038"></A>
  8456. <H2><A NAME="SEC198" HREF="xEMACS_TO.HTM#SEC198">Completion for Lisp Symbols</A></H2>
  8457.    Completion usually happens in the minibuffer.  An exception is
  8458. completion for Lisp symbol names, which is available in all buffers.
  8459. <A NAME="IDX1039"></A>
  8460. <A NAME="IDX1040"></A>
  8461.   The command <KBD>M-<KBD>TAB</KBD></KBD> (<CODE>lisp-complete-symbol</CODE>) takes the
  8462. partial Lisp symbol before point to be an abbreviation, and compares it
  8463. against all non-trivial Lisp symbols currently known to Emacs.  Any
  8464. additional characters that they all have in common are inserted at point.
  8465. Non-trivial symbols are those that have function definitions, values, or
  8466. properties.
  8467.   If there is an open-parenthesis immediately before the beginning of
  8468. the partial symbol, only symbols with function definitions are considered
  8469. as completions.
  8470.   If the partial name in the buffer has more than one possible completion
  8471. and they have no additional characters in common, a list of all possible
  8472. completions is displayed in another window.
  8473. <H2><A NAME="SEC199" HREF="xEMACS_TO.HTM#SEC199">Documentation Commands</A></H2>
  8474. <A NAME="IDX1041"></A>
  8475. <A NAME="IDX1042"></A>
  8476. <A NAME="IDX1043"></A>
  8477. <A NAME="IDX1044"></A>
  8478.   As you edit Lisp code to be run in Emacs, you can use the commands
  8479. <KBD>C-h f</KBD> (<CODE>describe-function</CODE>) and <KBD>C-h v</KBD>
  8480. (<CODE>describe-variable</CODE>) to print documentation of functions and
  8481. variables you want to call.  These commands use the minibuffer to
  8482. read the name of a function or variable to document, and display the
  8483. documentation in a window.
  8484.   For extra convenience, these commands provide default arguments based on
  8485. the code in the neighborhood of point.  <KBD>C-h f</KBD> sets the default to the
  8486. function called in the innermost list containing point.  <KBD>C-h v</KBD> uses
  8487. the symbol name around or adjacent to point as its default.
  8488. <A NAME="IDX1045"></A>
  8489.   The <KBD>M-x manual-entry</KBD> command gives you access to documentation
  8490. on Unix commands, system calls, and libraries.  The command reads a
  8491. topic as an argument, and displays the Unix manual page for that topic. 
  8492. <CODE>manual-entry</CODE> always searches all 8 sections of the
  8493. manual and concatenates all the entries it finds.  For example,
  8494. the topic <SAMP>`termcap'</SAMP> finds the description of the termcap library
  8495. from section 3, followed by the description of the termcap data base
  8496. from section 5.
  8497. <H2><A NAME="SEC200" HREF="xEMACS_TO.HTM#SEC200">Change Logs</A></H2>
  8498. <A NAME="IDX1046"></A>
  8499. <A NAME="IDX1047"></A>
  8500.   The Emacs command <KBD>M-x add-change-log-entry</KBD> helps you keep a record
  8501. of when and why you have changed a program.  It assumes that you have a
  8502. file in which you write a chronological sequence of entries describing
  8503. individual changes.  The default is to store the change entries in a file
  8504. called <TT>`ChangeLog'</TT> in the same directory as the file you are editing.
  8505. The same <TT>`ChangeLog'</TT> file therefore records changes for all the files
  8506. in a directory.
  8507.   A change log entry starts with a header line that contains your name
  8508. and the current date.  Except for these header lines, every line in the
  8509. change log starts with a tab.  One entry can describe several changes;
  8510. each change starts with a line starting with a tab and a star.  <KBD>M-x
  8511. add-change-log-entry</KBD> visits the change log file and creates a new entry
  8512. unless the most recent entry is for today's date and your name.  In
  8513. either case, it adds a new line to start the description of another
  8514. change just after the header line of the entry.  When <KBD>M-x
  8515. add-change-log-entry</KBD> is finished, all is prepared for you to edit in
  8516. the description of what you changed and how.  You must then save the
  8517. change log file yourself.
  8518.   The change log file is always visited in Indented Text mode, which means
  8519. that <KBD>LFD</KBD> and auto-filling indent each new line like the previous
  8520. line.  This is convenient for entering the contents of an entry, which must
  8521. be indented.  See section <A HREF="xEMACS.HTM#SEC166">Text Mode</A>.
  8522.   Here is an example of the formatting conventions used in the change log
  8523. for Emacs:
  8524. <PRE>
  8525. Wed Jun 26 19:29:32 1985  Richard M. Stallman  (rms at mit-prep)
  8526.         * xdisp.c (try_window_id):
  8527.         If C-k is done at end of next-to-last line,
  8528.         this fn updates window_end_vpos and cannot leave
  8529.         window_end_pos nonnegative (it is zero, in fact).
  8530.         If display is preempted before lines are output,
  8531.         this is inconsistent.  Fix by setting
  8532.         blank_end_of_window to nonzero.
  8533. Tue Jun 25 05:25:33 1985  Richard M. Stallman  (rms at mit-prep)
  8534.         * cmds.c (Fnewline):
  8535.         Call the auto fill hook if appropriate.
  8536.         * xdisp.c (try_window_id):
  8537.         If point is found by compute_motion after xp, record that
  8538.         permanently.  If display_text_line sets point position wrong
  8539.         (case where line is killed, point is at eob and that line is
  8540.         not displayed), set it again in final compute_motion.
  8541. </PRE>
  8542. <A NAME="IDX1048"></A>
  8543. <H2><A NAME="SEC201" HREF="xEMACS_TO.HTM#SEC201">Tag Tables</A></H2>
  8544.   A <DFN>tag table</DFN> is a description of how a multi-file program is
  8545. broken up into files.  It lists the names of the component files and the
  8546. names and positions of the functions in each file.  Grouping the related
  8547. files makes it possible to search or replace through all the files with
  8548. one command.  Recording the function names and positions makes it
  8549. possible to use the <KBD>Meta-.</KBD> command, which finds the definition of a
  8550. function without asking for information on the file it is in.
  8551.   Tag tables are stored in files called <DFN>tag table files</DFN>.  The
  8552. conventional name for a tag table file is <TT>`TAGS'</TT>.
  8553.   Each entry in the tag table records the name of one tag, the name of the
  8554. file that the tag is defined in (implicitly), and the position in that file
  8555. of the tag's definition.
  8556.    The programming language of a file determines what names are recorded
  8557. in the tag table depends on.  Normally, Emacs includes all functions and
  8558. subroutines, and may also include global variables, data types, and
  8559. anything else convenient.  Each recorded name is called a <DFN>tag</DFN>.
  8560. <H3><A NAME="SEC202" HREF="xEMACS_TO.HTM#SEC202">Source File Tag Syntax</A></H3>
  8561.   In Lisp code, any function defined with <CODE>defun</CODE>, any variable
  8562. defined with <CODE>defvar</CODE> or <CODE>defconst</CODE>, and the first argument of
  8563. any expression that starts with <SAMP>`(def'</SAMP> in column zero, is a tag.
  8564.   In C code, any C function is a tag, and so is any typedef if <CODE>-t</CODE> is
  8565. specified when the tag table is constructed.
  8566.   In Fortran code, functions and subroutines are tags.
  8567.   In LaTeX text, the argument of any of the commands <CODE>\chapter</CODE>,
  8568. <CODE>\section</CODE>, <CODE>\subsection</CODE>, <CODE>\subsubsection</CODE>, <CODE>\eqno</CODE>,
  8569. <CODE>\label</CODE>, <CODE>\ref</CODE>, <CODE>\cite</CODE>, <CODE>\bibitem</CODE>, and
  8570. <BR><CODE>\typeout</CODE> is a tag.<P>
  8571. <A NAME="IDX1049"></A>
  8572. <H3><A NAME="SEC203" HREF="xEMACS_TO.HTM#SEC203">Creating Tag Tables</A></H3>
  8573.   The <CODE>etags</CODE> program is used to create a tag table file.  It knows
  8574. the syntax of C, Fortran, LaTeX, Scheme, and Emacs Lisp/Common Lisp.  To
  8575. use <CODE>etags</CODE>, use it as a shell command:
  8576. <PRE>
  8577. etags <VAR>inputfiles</VAR>...
  8578. </PRE>
  8579. The program reads the specified files and writes a tag table
  8580. named <TT>`TAGS'</TT> in the current working directory.  <CODE>etags</CODE>
  8581. recognizes the language used in an input file based on the name and
  8582. contents of the file; there are no switches for specifying the language.
  8583. The <CODE>-t</CODE> switch tells <CODE>etags</CODE> to record typedefs in C code as
  8584. tags.
  8585.   If the tag table data become outdated due to changes in the files
  8586. described in the table, you can update the tag table by running the
  8587. program from the shell again.  It is not necessary to do this often.
  8588.   If the tag table fails to record a tag, or records it for the wrong file,
  8589. Emacs cannot find its definition.  However, if the position
  8590. recorded in the tag table becomes a little bit wrong (due to some editing
  8591. in the file that the tag definition is in), the only consequence is to slow
  8592. down finding the tag slightly.  Even if the stored position is very wrong,
  8593. Emacs will still find the tag, but it must search the entire file for it.
  8594.    You should update a tag table when you define new tags you want
  8595. to have listed, when you move tag definitions from one file to another,
  8596. or when changes become substantial.  You don't have to update
  8597. the tag table after each edit, or even every day.
  8598. <H3><A NAME="SEC204" HREF="xEMACS_TO.HTM#SEC204">Selecting a Tag Table</A></H3>
  8599. <A NAME="IDX1050"></A>
  8600.    At any time Emacs has one <DFN>selected</DFN> tag table, and all the commands
  8601. for working with tag tables use the selected one.  To select a tag table,
  8602. use the variable <CODE>tag-table-alist</CODE>.
  8603. The value of <CODE>tag-table-alist</CODE> is a list that determines which
  8604. <CODE>TAGS</CODE> files should be active for a given buffer.  This is not
  8605. really an association list, in that all elements are checked.  The car
  8606. of each element of this list is a pattern against which the buffers file
  8607. name is compared; if it matches, then the cdr of the list should be the
  8608. name of the tags table to use.  If more than one element of this list
  8609. matches the buffers file name, all of the associated tags tables are
  8610. used.  Earlier ones are searched first.
  8611. If the car of elements of this list are strings, they are treated
  8612. as regular-expressions against which the file is compared (like the
  8613. <CODE>auto-mode-alist</CODE>).  If they are not strings, they are evaluated.
  8614. If they evaluate to non-<CODE>nil</CODE>, the current buffer is considered to
  8615. match.
  8616. If the cdr of the elements of this list are strings, they are
  8617. assumed to name a tags file.  If they name a directory, the string
  8618. <TT>`tags'</TT> is appended to them to get the file name.  If they are not 
  8619. strings, they are evaluated and must return an appropriate string.
  8620. For example:
  8621. <PRE>
  8622.   (setq tag-table-alist
  8623.     '(("/usr/src/public/perl/" . "/usr/src/public/perl/perl-3.0/")
  8624.       ("\\.el$" . "/usr/local/emacs/src/")
  8625.       ("/jbw/gnu/" . "/usr15/degree/stud/jbw/gnu/")
  8626.       ("" . "/usr/local/emacs/src/")
  8627.       ))
  8628. </PRE>
  8629. The example defines the tag table alist in the following way:
  8630. Anything in the directory <TT>`/usr/src/public/perl/'</TT> 
  8631. should use the <TT>`TAGS'</TT> file <TT>`/usr/src/public/perl/perl-3.0/TAGS'</TT>. 
  8632. Files ending in <TT>`.el'</TT> should use the <TT>`TAGS'</TT> file
  8633. <TT>`/usr/local/emacs/src/TAGS'</TT>. 
  8634. Anything in or below the directory <TT>`/jbw/gnu/'</TT> should use the 
  8635. <TT>`TAGS'</TT> file <TT>`/usr15/degree/stud/jbw/gnu/TAGS'</TT>.  
  8636. </UL>
  8637. If you had a file called <TT>`/usr/jbw/foo.el'</TT>, it would use both
  8638. <TT>`TAGS'</TT> files, <BR> <TT>`/usr/local/emacs/src/TAGS'</TT> and
  8639. <TT>`/usr15/degree/stud/jbw/gnu/TAGS'</TT> (in that order), because it
  8640. matches both patterns.
  8641. If the buffer-local variable <CODE>buffer-tag-table</CODE> is set, it names a
  8642. tags table that is searched before all others when <CODE>find-tag</CODE> is
  8643. executed from this buffer.
  8644. If there is a file called <TT>`TAGS'</TT> in the same directory as the file
  8645. in question, then that tags file will always be used as well (after the
  8646. <CODE>buffer-tag-table</CODE> but before the tables specified by this list).
  8647. If the variable <CODE>tags-file-name</CODE> is set, the <TT>`TAGS'</TT> file it names
  8648. will apply to all buffers (for backwards compatibility.)  It is searched
  8649. first.
  8650. <A NAME="IDX1051"></A>
  8651. If the value of the variable <CODE>tags-always-build-completion-table</CODE>
  8652. is <CODE>t</CODE>, the tags file will always be added to the completion table
  8653. without asking first, regardless of the size of the tags file.
  8654. <A NAME="IDX1052"></A>
  8655. <A NAME="IDX1053"></A>
  8656. The function <KBD>M-x visit-tags-table</KBD>, is largely made obsolete by
  8657. the variable <CODE>tag-table-alist</CODE>, tells tags commands to use the tags
  8658. table file <VAR>file</VAR> first.  The <VAR>file</VAR> should be the name of a
  8659. file created with the <CODE>etags</CODE> program.  A directory name is also
  8660. acceptable; it means the file <TT>`TAGS'</TT> in that directory.  The
  8661. function only stores the file name you provide in the variable
  8662. <CODE>tags-file-name</CODE>.  Emacs does not actually read in the tag table
  8663. contents until you try to use them.  You can set the variable explicitly
  8664. instead of using <CODE>visit-tags-table</CODE>.  The value of the variable
  8665. <CODE>tags-file-name</CODE> is the name of the tags table used by all buffers.
  8666. This is for backward compatibility, and is largely supplanted by the
  8667. variable <CODE>tag-table-alist</CODE>.
  8668. <H3><A NAME="SEC205" HREF="xEMACS_TO.HTM#SEC205">Finding a Tag</A></H3>
  8669.   The most important thing that a tag table enables you to do is to find
  8670. the definition of a specific tag.
  8671. <DL COMPACT>
  8672. <DT><KBD>M-. <VAR>tag &optional other-window</VAR></KBD>
  8673. <DD>Find first definition of <VAR>tag</VAR> (<CODE>find-tag</CODE>).
  8674. <DT><KBD>C-u M-.</KBD>
  8675. <DD>Find next alternate definition of last tag specified.
  8676. <DT><KBD>C-x 4 . <VAR>tag</VAR></KBD>
  8677. <DD>Find first definition of <VAR>tag</VAR>, but display it in another window
  8678. (<CODE>find-tag-other-window</CODE>).
  8679. </DL>
  8680. <A NAME="IDX1054"></A>
  8681. <A NAME="IDX1055"></A>
  8682.   <KBD>M-.</KBD> (<CODE>find-tag</CODE>) is the command to find the definition of
  8683. a specified tag.  It searches through the tag table for that tag, as a
  8684. string, then uses the tag table information to determine the file in
  8685. which the definition is used and the approximate character position of
  8686. the definition in the file.  Then <CODE>find-tag</CODE> visits the file,
  8687. moves point to the approximate character position, and starts searching
  8688. ever-increasing distances away for the text that should appear at
  8689. the beginning of the definition.
  8690.   If an empty argument is given (by typing <KBD>RET</KBD>), the sexp in the
  8691. buffer before or around point is used as the name of the tag to find.
  8692. See section <A HREF="xEMACS.HTM#SEC186">Lists and Sexps</A>, for information on sexps.
  8693.   The argument to <CODE>find-tag</CODE> need not be the whole tag name; it can
  8694. be a substring of a tag name.  However, there can be many tag names
  8695. containing the substring you specify.  Since <CODE>find-tag</CODE> works by
  8696. searching the text of the tag table, it finds the first tag in the table
  8697. that the specified substring appears in.  To find other tags that match
  8698. the substring, give <CODE>find-tag</CODE> a numeric argument, as in <KBD>C-u
  8699. M-.</KBD>.  This does not read a tag name, but continues searching the tag
  8700. table's text for another tag containing the same substring last used.
  8701. If your keyboard has a real <KBD>META</KBD> key, <KBD>M-0 M-.</KBD> is an easier
  8702. alternative to <KBD>C-u M-.</KBD>.
  8703. If the optional second argument <VAR>other-window</VAR> is non-<CODE>nil</CODE>, it uses
  8704. another window to display the tag.
  8705. Multiple active tags tables and completion are supported.
  8706. Variables of note include the following:
  8707. <A NAME="IDX1056"></A>
  8708. <A NAME="IDX1057"></A>
  8709. <A NAME="IDX1058"></A>
  8710. <A NAME="IDX1059"></A>
  8711. <A NAME="IDX1060"></A>
  8712. <A NAME="IDX1061"></A>
  8713. <DL COMPACT>
  8714. <DT><KBD>tag-table-alist</KBD>
  8715. <DD>Controls which tables apply to which buffers.
  8716. <DT><KBD>tags-file-name</KBD>
  8717. <DD>Stores a default tags table.
  8718. <DT><KBD>tags-build-completion-table</KBD>
  8719. <DD>Controls completion behavior.
  8720. <DT><KBD>buffer-tag-table</KBD>
  8721. <DD>Specifies a buffer-local table.
  8722. <DT><KBD>make-tags-files-invisible</KBD>
  8723. <DD>Sets whether tags tables should be very hidden.
  8724. <DT><KBD>tag-mark-stack-max</KBD>
  8725. <DD>Specifies how many tags-based hops to remember.
  8726. </DL>
  8727. <A NAME="IDX1062"></A>
  8728. <A NAME="IDX1063"></A>
  8729.   Like most commands that can switch buffers, <CODE>find-tag</CODE> has another
  8730. similar command that displays the new buffer in another window.  <KBD>C-x 4
  8731. .</KBD> invokes the function <CODE>find-tag-other-window</CODE>.  (This key sequence
  8732. ends with a period.)
  8733.   Emacs comes with a tag table file <TT>`TAGS'</TT> (in the directory
  8734. containing Lisp libraries) that includes all the Lisp libraries and all
  8735. the C sources of Emacs.  By specifying this file with <CODE>visit-tags-table</CODE>
  8736. and then using <KBD>M-.</KBD> you can quickly look at the source of any Emacs
  8737. function.
  8738. <H3><A NAME="SEC206" HREF="xEMACS_TO.HTM#SEC206">Searching and Replacing with Tag Tables</A></H3>
  8739.   The commands in this section visit and search all the files listed in the
  8740. selected tag table, one by one.  For these commands, the tag table serves
  8741. only to specify a sequence of files to search.  A related command is
  8742. <KBD>M-x grep</KBD> (see section <A HREF="xEMACS.HTM#SEC220">Running `make', or Compilers Generally</A>).
  8743. <DL COMPACT>
  8744. <DT><KBD>M-x tags-search</KBD>
  8745. <DD>Search for the specified regexp through the files in the selected tag
  8746. table.
  8747. <DT><KBD>M-x tags-query-replace</KBD>
  8748. <DD>Perform a <CODE>query-replace</CODE> on each file in the selected tag table.
  8749. <DT><KBD>M-,</KBD>
  8750. <DD>Restart one of the commands above, from the current location of point
  8751. (<CODE>tags-loop-continue</CODE>).
  8752. </DL>
  8753. <A NAME="IDX1064"></A>
  8754.   <KBD>M-x tags-search</KBD> reads a regexp using the minibuffer, then visits
  8755. the files of the selected tag table one by one, and searches through each
  8756. file for that regexp.  It displays the name of the file being searched so
  8757. you can follow its progress.  As soon as an occurrence is found,
  8758. <CODE>tags-search</CODE> returns.
  8759. <A NAME="IDX1065"></A>
  8760. <A NAME="IDX1066"></A>
  8761.  After you have found one match, you probably want to find all the rest.
  8762. To find one more match, type <KBD>M-,</KBD> (<CODE>tags-loop-continue</CODE>) to
  8763. resume the <CODE>tags-search</CODE>.  This searches the rest of the current
  8764. buffer, followed by the remaining files of the tag table.
  8765. <A NAME="IDX1067"></A>
  8766.   <KBD>M-x tags-query-replace</KBD> performs a single <CODE>query-replace</CODE>
  8767. through all the files in the tag table.  It reads a string to search for
  8768. and a string to replace with, just like ordinary <KBD>M-x query-replace</KBD>.
  8769. It searches much like <KBD>M-x tags-search</KBD> but repeatedly, processing
  8770. matches according to your input.  See section <A HREF="xEMACS.HTM#SEC101">Replacement Commands</A>, for more information on
  8771. <CODE>query-replace</CODE>.<P>
  8772.   It is possible to get through all the files in the tag table with a
  8773. single invocation of <KBD>M-x tags-query-replace</KBD>.  But since any
  8774. unrecognized character causes the command to exit, you may need to continue
  8775. from where you left off.  You can use <KBD>M-,</KBD> to do this.  It resumes
  8776. the last tags search or replace command that you did.
  8777.   It may have struck you that <CODE>tags-search</CODE> is a lot like <CODE>grep</CODE>.
  8778. You can also run <CODE>grep</CODE> itself as an inferior of Emacs and have Emacs
  8779. show you the matching lines one by one.  This works mostly the same as
  8780. running a compilation and having Emacs show you where the errors were.
  8781. See section <A HREF="xEMACS.HTM#SEC220">Running `make', or Compilers Generally</A>.
  8782. <A NAME="IDX1068"></A>
  8783. <H3><A NAME="SEC207" HREF="xEMACS_TO.HTM#SEC207">Stepping Through a Tag Table</A></H3>
  8784.   If you wish to process all the files in a selected tag table, but
  8785. <KBD>M-x tags-search</KBD> and <KBD>M-x tags-query-replace</KBD> are not giving
  8786. you the desired result, you can use <KBD>M-x next-file</KBD>.
  8787. <DL COMPACT>
  8788. <DT><KBD>C-u M-x next-file</KBD>
  8789. <DD>With a numeric argument, regardless of its value, visit the first
  8790. file in the tag table and prepare to advance sequentially by files.
  8791. <DT><KBD>M-x next-file</KBD>
  8792. <DD>Visit the next file in the selected tag table.
  8793. </DL>
  8794. <H3><A NAME="SEC208" HREF="xEMACS_TO.HTM#SEC208">Tag Table Inquiries</A></H3>
  8795. <DL COMPACT>
  8796. <DT><KBD>M-x list-tags</KBD>
  8797. <DD>Display a list of the tags defined in a specific program file.
  8798. <DT><KBD>M-x tags-apropos</KBD>
  8799. <DD>Display a list of all tags matching a specified regexp.
  8800. </DL>
  8801. <A NAME="IDX1069"></A>
  8802.   <KBD>M-x list-tags</KBD> reads the name of one of the files described by the
  8803. selected tag table, and displays a list of all the tags defined in that
  8804. file.  The "file name" argument is really just a string to compare
  8805. against the names recorded in the tag table; it is read as a string rather
  8806. than a file name.  Therefore, completion and defaulting are not
  8807. available, and you must enter the string the same way it appears in the tag
  8808. table.  Do not include a directory as part of the file name unless the file
  8809. name recorded in the tag table contains that directory.
  8810. <A NAME="IDX1070"></A>
  8811.   <KBD>M-x tags-apropos</KBD> is like <CODE>apropos</CODE> for tags.  It reads a regexp,
  8812. then finds all the tags in the selected tag table whose entries match that
  8813. regexp, and displays the tag names found.
  8814. <A NAME="IDX1071"></A>
  8815. <H2><A NAME="SEC209" HREF="xEMACS_TO.HTM#SEC209">Fortran Mode</A></H2>
  8816.   Fortran mode provides special motion commands for Fortran statements and
  8817. subprograms, and indentation commands that understand Fortran conventions
  8818. of nesting, line numbers, and continuation statements.
  8819.   Special commands for comments are provided because Fortran comments are
  8820. unlike those of other languages.
  8821.   Built-in abbrevs optionally save typing when you insert Fortran keywords.
  8822. <A NAME="IDX1072"></A>
  8823.   Use <KBD>M-x fortran-mode</KBD> to switch to this major mode.  Doing so calls
  8824. the value of <CODE>fortran-mode-hook</CODE> as a function of no arguments if
  8825. that variable has a non-<CODE>nil</CODE> value.
  8826.   Fortran mode was contributed by Michael Prange.
  8827. <H3><A NAME="SEC210" HREF="xEMACS_TO.HTM#SEC210">Motion Commands</A></H3>
  8828.   Fortran mode provides special commands to move by subprograms (functions
  8829. and subroutines) and by statements.  There is also a command to put the
  8830. region around one subprogram, which is convenient for killing it or moving it.
  8831. <A NAME="IDX1073"></A>
  8832. <A NAME="IDX1074"></A>
  8833. <A NAME="IDX1075"></A>
  8834. <A NAME="IDX1076"></A>
  8835. <A NAME="IDX1077"></A>
  8836. <A NAME="IDX1078"></A>
  8837. <A NAME="IDX1079"></A>
  8838. <A NAME="IDX1080"></A>
  8839. <A NAME="IDX1081"></A>
  8840. <A NAME="IDX1082"></A>
  8841. <DL COMPACT>
  8842. <DT><KBD>C-M-a</KBD>
  8843. <DD>Move to beginning of subprogram<BR>
  8844. (<CODE>beginning-of-fortran-subprogram</CODE>).
  8845. <DT><KBD>C-M-e</KBD>
  8846. <DD>Move to end of subprogram (<CODE>end-of-fortran-subprogram</CODE>).
  8847. <DT><KBD>C-M-h</KBD>
  8848. <DD>Put point at beginning of subprogram and mark at end
  8849. (<CODE>mark-fortran-subprogram</CODE>).
  8850. <DT><KBD>C-c C-n</KBD>
  8851. <DD>Move to beginning of current or next statement
  8852. (<CODE>fortran-next-<BR>statement</CODE>).
  8853. <DT><KBD>C-c C-p</KBD>
  8854. <DD>Move to beginning of current or previous statement
  8855. (<CODE>fortran-<BR>previous-statement</CODE>).
  8856. </DL>
  8857. <H3><A NAME="SEC211" HREF="xEMACS_TO.HTM#SEC211">Fortran Indentation</A></H3>
  8858.   Special commands and features are available for indenting Fortran
  8859. code.  They make sure various syntactic entities (line numbers, comment line
  8860. indicators, and continuation line flags) appear in the columns that are
  8861. required for standard Fortran.
  8862. <H4><A NAME="SEC212" HREF="xEMACS_TO.HTM#SEC212">Fortran Indentation Commands</A></H4>
  8863. <DL COMPACT>
  8864. <DT><KBD><KBD>TAB</KBD></KBD>
  8865. <DD>Indent the current line (<CODE>fortran-indent-line</CODE>).
  8866. <DT><KBD>M-<KBD>LFD</KBD></KBD>
  8867. <DD>Break the current line and set up a continuation line.
  8868. <DT><KBD>C-M-q</KBD>
  8869. <DD>Indent all the lines of the subprogram point is in
  8870. (<CODE>fortran-indent-subprogram</CODE>).
  8871. </DL>
  8872. <A NAME="IDX1083"></A>
  8873.   <KBD>TAB</KBD> is redefined by Fortran mode to reindent the current line for
  8874. Fortran (<CODE>fortran-indent-line</CODE>).  Line numbers and continuation
  8875. markers are indented to their required columns, and the body of the
  8876. statement is independently indented, based on its nesting in the program.
  8877. <A NAME="IDX1084"></A>
  8878. <A NAME="IDX1085"></A>
  8879.   The key <KBD>C-M-q</KBD> is redefined as <CODE>fortran-indent-subprogram</CODE>, a
  8880. command that reindents all the lines of the Fortran subprogram (function or
  8881. subroutine) containing point.
  8882. <A NAME="IDX1086"></A>
  8883. <A NAME="IDX1087"></A>
  8884.   The key <KBD>M-<KBD>LFD</KBD></KBD> is redefined as <CODE>fortran-split-line</CODE>, a
  8885. command to split a line in the appropriate fashion for Fortran.  In a
  8886. non-comment line, the second half becomes a continuation line and is
  8887. indented accordingly.  In a comment line, both halves become separate
  8888. comment lines.
  8889. <H4><A NAME="SEC213" HREF="xEMACS_TO.HTM#SEC213">Line Numbers and Continuation</A></H4>
  8890.   If a number is the first non-whitespace in the line, it is assumed to be
  8891. a line number and is moved to columns 0 through 4.  (Columns are always
  8892. counted from 0 in GNU Emacs.)  If the text on the line starts with the
  8893. conventional Fortran continuation marker <SAMP>`$'</SAMP>, it is moved to column 5.
  8894. If the text begins with any non whitespace character in column 5, it is
  8895. assumed to be an unconventional continuation marker and remains in column
  8896. <A NAME="IDX1088"></A>
  8897.   Line numbers of four digits or less are normally indented one space.
  8898. This amount is controlled by the variable <CODE>fortran-line-number-indent</CODE>,
  8899. which is the maximum indentation a line number can have.  Line numbers
  8900. are indented to right-justify them to end in column 4 unless that would
  8901. require more than the maximum indentation.  The default value of the
  8902. variable is 1.
  8903. <A NAME="IDX1089"></A>
  8904.   Simply inserting a line number is enough to indent it according to these
  8905. rules.  As each digit is inserted, the indentation is recomputed.  To turn
  8906. off this feature, set the variable <CODE>fortran-electric-line-number</CODE> to
  8907. <CODE>nil</CODE>.  Then inserting line numbers is like inserting anything else.
  8908. <H4><A NAME="SEC214" HREF="xEMACS_TO.HTM#SEC214">Syntactic Conventions</A></H4>
  8909.   Fortran mode assumes that you follow certain conventions that simplify
  8910. the task of understanding a Fortran program well enough to indent it
  8911. properly:
  8912. <A NAME="IDX1090"></A>
  8913. Two nested <SAMP>`do'</SAMP> loops never share a <SAMP>`continue'</SAMP> statement.
  8914. The same character appears in column 5 of all continuation lines.  It
  8915. is the value of the variable <CODE>fortran-continuation-char</CODE>.
  8916. By default, this character is <SAMP>`$'</SAMP>.
  8917. </UL>
  8918. If you fail to follow these conventions, the indentation commands may
  8919. indent some lines unaesthetically.  However, a correct Fortran program will
  8920. retain its meaning when reindented even if the conventions are not
  8921. followed.
  8922. <H4><A NAME="SEC215" HREF="xEMACS_TO.HTM#SEC215">Variables for Fortran Indentation</A></H4>
  8923. <A NAME="IDX1091"></A>
  8924. <A NAME="IDX1092"></A>
  8925. <A NAME="IDX1093"></A>
  8926. <A NAME="IDX1094"></A>
  8927. <A NAME="IDX1095"></A>
  8928.   Several additional variables control how Fortran indentation works.
  8929. <DL COMPACT>
  8930. <DT><CODE>fortran-do-indent</CODE>
  8931. <DD>Extra indentation within each level of <SAMP>`do'</SAMP> statement (the default is 3).
  8932. <DT><CODE>fortran-if-indent</CODE>
  8933. <DD>Extra indentation within each level of <SAMP>`if'</SAMP> statement (the default is 3).
  8934. <DT><CODE>fortran-continuation-indent</CODE>
  8935. <DD>Extra indentation for bodies of continuation lines (the default is 5).
  8936. <DT><CODE>fortran-check-all-num-for-matching-do</CODE>
  8937. <DD>If this is <CODE>nil</CODE>, indentation assumes that each <SAMP>`do'</SAMP>
  8938. statement ends on a <SAMP>`continue'</SAMP> statement.  Therefore, when
  8939. computing indentation for a statement other than <SAMP>`continue'</SAMP>, it
  8940. can save time by not checking for a <SAMP>`do'</SAMP> statement ending there.
  8941. If this is non-<CODE>nil</CODE>, indenting any numbered statement must check
  8942. for a <SAMP>`do'</SAMP> that ends there.  The default is <CODE>nil</CODE>.
  8943. <DT><CODE>fortran-minimum-statement-indent</CODE>
  8944. <DD>Minimum indentation for Fortran statements.  For standard Fortran,
  8945. this is 6.  Statement bodies are always indented at least this much.
  8946. </DL>
  8947. <H3><A NAME="SEC216" HREF="xEMACS_TO.HTM#SEC216">Comments</A></H3>
  8948.   The usual Emacs comment commands assume that a comment can follow a line
  8949. of code.  In Fortran, the standard comment syntax requires an entire line
  8950. to be just a comment.  Therefore, Fortran mode replaces the standard Emacs
  8951. comment commands and defines some new variables.
  8952.   Fortran mode can also handle a non-standard comment syntax where comments
  8953. start with <SAMP>`!'</SAMP> and can follow other text.  Because only some Fortran
  8954. compilers accept this syntax, Fortran mode will not insert such comments
  8955. unless you have specified to do so in advance by setting the variable
  8956. <CODE>comment-start</CODE> to <SAMP>`"!"'</SAMP> (see section <A HREF="xEMACS.HTM#SEC275">Variables</A>).
  8957. <DL COMPACT>
  8958. <DT><KBD>M-;</KBD>
  8959. <DD>Align comment or insert new comment (<CODE>fortran-comment-indent</CODE>).
  8960. <DT><KBD>C-x ;</KBD>
  8961. <DD>Applies to nonstandard <SAMP>`!'</SAMP> comments only.
  8962. <DT><KBD>C-c ;</KBD>
  8963. <DD>Turn all lines of the region into comments, or (with arg)
  8964. turn them back into real code (<CODE>fortran-comment-region</CODE>).
  8965. </DL>
  8966.   <KBD>M-;</KBD> in Fortran mode is redefined as the command
  8967. <CODE>fortran-comment-indent</CODE>.  Like the usual <KBD>M-;</KBD> command,
  8968. it recognizes an existing comment and aligns its text appropriately.
  8969. If there is no existing comment, a comment is inserted and aligned.
  8970. Inserting and aligning comments is not the same in Fortran mode as in
  8971. other modes.  When a new comment must be inserted, a full-line comment is
  8972. inserted if the current line is blank.  On a non-blank line, a
  8973. non-standard <SAMP>`!'</SAMP> comment is inserted if you previously specified
  8974. you wanted to use them.  Otherwise a full-line comment is inserted on a
  8975. new line before the current line.
  8976.   Non-standard <SAMP>`!'</SAMP> comments are aligned like comments in other
  8977. languages, but full-line comments are aligned differently.  In a
  8978. standard full-line comment, the comment delimiter itself must always
  8979. appear in column zero.  What can be aligned is the text within the
  8980. comment.  You can choose from three styles of alignment by setting the
  8981. variable <CODE>fortran-comment-indent-style</CODE> to one of these values:
  8982. <A NAME="IDX1096"></A>
  8983. <A NAME="IDX1097"></A>
  8984. <DL COMPACT>
  8985. <DT><CODE>fixed</CODE>
  8986. <DD>The text is aligned at a fixed column, which is the value of
  8987. <CODE>fortran-comment-line-column</CODE>.  This is the default.
  8988. <DT><CODE>relative</CODE>
  8989. <DD>The text is aligned as if it were a line of code, but with an
  8990. additional <CODE>fortran-comment-line-column</CODE> columns of indentation.
  8991. <DT><CODE>nil</CODE>
  8992. <DD>Text in full-line columns is not moved automatically.
  8993. </DL>
  8994. <A NAME="IDX1098"></A>
  8995.   You can also specify the character to be used to indent within
  8996. full-line comments by setting the variable <CODE>fortran-comment-indent-char</CODE>
  8997. to the character you want to use.
  8998. <A NAME="IDX1099"></A>
  8999. <A NAME="IDX1100"></A>
  9000.   Fortran mode introduces two variables <CODE>comment-line-start</CODE> and
  9001. <CODE>comment-line-start-skip</CODE>, which do for full-line comments what
  9002. <CODE>comment-start</CODE> and <CODE>comment-start-skip</CODE> do for
  9003. ordinary text-following comments.  Normally these are set properly by
  9004. Fortran mode, so you do not need to change them.
  9005.   The normal Emacs comment command <KBD>C-x ;</KBD> has not been redefined.
  9006. It can therefore be used if you use <SAMP>`!'</SAMP> comments, but is useless in
  9007. Fortran mode otherwise. 
  9008. <A NAME="IDX1101"></A>
  9009. <A NAME="IDX1102"></A>
  9010. <A NAME="IDX1103"></A>
  9011.   The command <KBD>C-c ;</KBD> (<CODE>fortran-comment-region</CODE>) turns all the
  9012. lines of the region into comments by inserting the string <SAMP>`C$$$'</SAMP> at
  9013. the front of each one.  With a numeric arg, the region is turned back into
  9014. live code by deleting <SAMP>`C$$$'</SAMP> from the front of each line.  You can
  9015. control the string used for the comments by setting the variable
  9016. <CODE>fortran-comment-region</CODE>.  Note that here we have an example of a
  9017. command and a variable with the same name; the two uses of the name never
  9018. conflict because in Lisp and in Emacs it is always clear from the context
  9019. which one is referred to.
  9020. <H3><A NAME="SEC217" HREF="xEMACS_TO.HTM#SEC217">Columns</A></H3>
  9021. <DL COMPACT>
  9022. <DT><KBD>C-c C-r</KBD>
  9023. <DD>Displays a "column ruler" momentarily above the current line
  9024. (<CODE>fortran-column-ruler</CODE>).
  9025. <DT><KBD>C-c C-w</KBD>
  9026. <DD>Splits the current window horizontally so that it is 72 columns wide.
  9027. This may help you avoid going over that limit (<CODE>fortran-window-create</CODE>).
  9028. </DL>
  9029. <A NAME="IDX1104"></A>
  9030. <A NAME="IDX1105"></A>
  9031.   The command <KBD>C-c C-r</KBD> (<CODE>fortran-column-ruler</CODE>) shows a column
  9032. ruler above the current line.  The comment ruler consists of two lines
  9033. of text that show you the locations of columns with special significance
  9034. in Fortran programs.  Square brackets show the limits of the columns for
  9035. line numbers, and curly brackets show the limits of the columns for the
  9036. statement body.  Column numbers appear above them.
  9037.   Note that the column numbers count from zero, as always in GNU Emacs.  As
  9038. a result, the numbers may not be those you are familiar with; but the
  9039. actual positions in the line are standard Fortran.
  9040.   The text used to display the column ruler is the value of the variable
  9041. <CODE>fortran-comment-ruler</CODE>.  By changing this variable, you can change
  9042. the display.
  9043. <A NAME="IDX1106"></A>
  9044. <A NAME="IDX1107"></A>
  9045.   For even more help, use <KBD>C-c C-w</KBD> (<CODE>fortran-window-create</CODE>), a
  9046. command which splits the current window horizontally, resulting in a window 72
  9047. columns wide.  When you edit in this window, you can immediately see
  9048. when a line gets too wide to be correct Fortran.
  9049. <H3><A NAME="SEC218" HREF="xEMACS_TO.HTM#SEC218">Fortran Keyword Abbrevs</A></H3>
  9050.   Fortran mode provides many built-in abbrevs for common keywords and
  9051. declarations.  These are the same sort of abbrevs that you can define
  9052. yourself.  To use them, you must turn on Abbrev mode.  see section <A HREF="xEMACS.HTM#SEC230">Abbrevs</A>.
  9053.   The built-in abbrevs are unusual in one way: they all start with a
  9054. semicolon.  You cannot normally use semicolon in an abbrev, but Fortran
  9055. mode makes this possible by changing the syntax of semicolon to "word
  9056. constituent".
  9057.   For example, one built-in Fortran abbrev is <SAMP>`;c'</SAMP> for
  9058. <SAMP>`continue'</SAMP>.  If you insert <SAMP>`;c'</SAMP> and then insert a punctuation
  9059. character such as a space or a newline, the <SAMP>`;c'</SAMP> changes
  9060. automatically to <SAMP>`continue'</SAMP>, provided Abbrev mode is enabled.<P>
  9061.   Type <SAMP>`;?'</SAMP> or <SAMP>`;C-h'</SAMP> to display a list of all built-in
  9062. Fortran abbrevs and what they stand for.
  9063. <H1><A NAME="SEC219" HREF="xEMACS_TO.HTM#SEC219">Compiling and Testing Programs</A></H1>
  9064.   The previous chapter discusses the Emacs commands that are useful for
  9065. making changes in programs.  This chapter deals with commands that assist
  9066. in the larger process of developing and maintaining programs.
  9067. <A NAME="IDX1108"></A>
  9068. <A NAME="IDX1109"></A>
  9069. <A NAME="IDX1110"></A>
  9070. <A NAME="IDX1111"></A>
  9071. <H2><A NAME="SEC220" HREF="xEMACS_TO.HTM#SEC220">Running `make', or Compilers Generally</A></H2>
  9072.   Emacs can run compilers for non-interactive languages like C and
  9073. Fortran as inferior processes, feeding the error log into an Emacs buffer.
  9074. It can also parse the error messages and visit the files in which errors
  9075. are found, moving point to the line where the error occurred.
  9076. <DL COMPACT>
  9077. <DT><KBD>M-x compile</KBD>
  9078. <DD>Run a compiler asynchronously under Emacs, with error messages to
  9079. <SAMP>`*compilation*'</SAMP> buffer.
  9080. <DT><KBD>M-x grep</KBD>
  9081. <DD>Run <CODE>grep</CODE> asynchronously under Emacs, with matching lines
  9082. listed in the buffer named <SAMP>`*compilation*'</SAMP>.
  9083. <DT><KBD>M-x kill-compilation</KBD>
  9084. <DD>Kill the process made by the <CODE>M-x compile</CODE> command.
  9085. <DT><KBD>M-x kill-grep</KBD>
  9086. <DD>Kill the running compilation or <CODE>grep</CODE> subprocess.
  9087. <DT><KBD>C-x `</KBD>
  9088. <DD>Visit the next compiler error message or <CODE>grep</CODE> match.
  9089. </DL>
  9090. <A NAME="IDX1112"></A>
  9091.   To run <CODE>make</CODE> or another compiler, type <KBD>M-x compile</KBD>.  This
  9092. command reads a shell command line using the minibuffer, then executes
  9093. the specified command line in an inferior shell with output going to the
  9094. buffer named <SAMP>`*compilation*'</SAMP>.  By default, the current buffer's
  9095. default directory is used as the working directory for the execution of
  9096. the command; therefore, the makefile comes from this directory.
  9097. <A NAME="IDX1113"></A>
  9098.   When the shell command line is read, the minibuffer appears containing a
  9099. default command line (the command you used the last time you typed
  9100. <KBD>M-x compile</KBD>).  If you type just <KBD>RET</KBD>, the same command line is used
  9101. again.  The first <KBD>M-x compile</KBD> provides <CODE>make -k</CODE> as the default.
  9102. The default is taken from the variable <CODE>compile-command</CODE>; if the
  9103. appropriate compilation command for a file is something other than
  9104. <CODE>make -k</CODE>, it can be useful to have the file specify a local value for
  9105. <CODE>compile-command</CODE> (see section <A HREF="xEMACS.HTM#SEC279">Local Variables in Files</A>).
  9106. <A NAME="IDX1114"></A>
  9107.   When you start a compilation, the buffer <SAMP>`*compilation*'</SAMP> is
  9108. displayed in another window but not selected.  Its mode line displays
  9109. the word <SAMP>`run'</SAMP> or <SAMP>`exit'</SAMP> in the parentheses to tell you whether
  9110. compilation is finished.  You do not have to keep this buffer visible;
  9111. compilation continues in any case.
  9112. <A NAME="IDX1115"></A>
  9113.   To kill the compilation process, type <KBD>M-x-kill-compilation</KBD>.  The mode
  9114. line of the <SAMP>`*compilation*'</SAMP> buffer changes to say <SAMP>`signal'</SAMP>
  9115. instead of <SAMP>`run'</SAMP>.  Starting a new compilation also kills any
  9116. running compilation, as only one can occur at any time.  Starting a new
  9117. compilation prompts for confirmation before actually killing a
  9118. compilation that is running.<A NAME="IDX1116"></A>
  9119. <A NAME="IDX1117"></A>
  9120.   To parse the compiler error messages, type <KBD>C-x `</KBD>
  9121. (<CODE>next-error</CODE>).  The character following <KBD>C-x</KBD> is the grave
  9122. accent, not the single quote.  The command displays the buffer
  9123. <SAMP>`*compilation*'</SAMP> in one window and the buffer in which the next
  9124. error occurred in another window.  Point in that buffer is moved to the
  9125. line where the error was found.  The corresponding error message is
  9126. scrolled to the top of the window in which <SAMP>`*compilation*'</SAMP> is
  9127. displayed.
  9128.   The first time you use <KBD>C-x `</KBD> after the start of a compilation, it
  9129. parses all the error messages, visits all the files that have error
  9130. messages, and creates markers pointing at the lines the error messages
  9131. refer to.  It then moves to the first error message location.  Subsequent
  9132. uses of <KBD>C-x `</KBD> advance down the data set up by the first use.  When
  9133. the preparsed error messages are exhausted, the next <KBD>C-x `</KBD> checks for
  9134. any more error messages that have come in; this is useful if you start
  9135. editing compiler errors while compilation is still going on.  If no
  9136. additional error messages have come in, <KBD>C-x `</KBD> reports an error.
  9137.   <KBD>C-u C-x `</KBD> discards the preparsed error message data and parses the
  9138. <SAMP>`*compilation*'</SAMP> buffer again, then displays the first error.
  9139. This way, you can process the same set of errors again.
  9140.   Instead of running a compiler, you can run <CODE>grep</CODE> and see the
  9141. lines on which matches were found.  To do this, type <KBD>M-x grep</KBD> with
  9142. an argument line that contains the same arguments you would give to
  9143. <CODE>grep</CODE>: a <CODE>grep</CODE>-style regexp (usually in single quotes to
  9144. quote the shell's special characters) followed by filenames, which may
  9145. use wildcard characters.  The output from <CODE>grep</CODE> goes in the
  9146. <SAMP>`*compilation*'</SAMP> buffer.  You can use <KBD>C-x `</KBD> to find the lines that
  9147. match as if they were compilation errors.
  9148.   Note: a shell is used to run the compile command, but the shell is not
  9149. run in interactive mode.  In particular, this means that the shell starts
  9150. up with no prompt.  If you find your usual shell prompt making an
  9151. unsightly appearance in the <SAMP>`*compilation*'</SAMP> buffer, it means you
  9152. have made a mistake in your shell's initialization file (<TT>`.cshrc'</TT>
  9153. or <TT>`.shrc'</TT> or ...) by setting the prompt unconditionally.  The
  9154. shell initialization file should set the prompt only if there already is
  9155. a prompt.  Here's how to do it in <CODE>csh</CODE>:
  9156. <PRE>
  9157. if ($?prompt) set prompt = ...
  9158. </PRE>
  9159. <H2><A NAME="SEC221" HREF="xEMACS_TO.HTM#SEC221">Major Modes for Lisp</A></H2>
  9160.   Emacs has four different major modes for Lisp.  They are the same in
  9161. terms of editing commands, but differ in the commands for executing Lisp
  9162. expressions.
  9163. <DL COMPACT>
  9164. <DT>Emacs-Lisp mode
  9165. <DD>The mode for editing source files of programs to run in Emacs Lisp.
  9166. This mode defines <KBD>C-M-x</KBD> to evaluate the current defun.
  9167. See section <A HREF="xEMACS.HTM#SEC222">Libraries of Lisp Code for Emacs</A>.
  9168. <DT>Lisp Interaction mode
  9169. <DD>The mode for an interactive session with Emacs Lisp.  It defines
  9170. <KBD>LFD</KBD> to evaluate the sexp before point and insert its value in the
  9171. buffer.  See section <A HREF="xEMACS.HTM#SEC228">Lisp Interaction Buffers</A>.
  9172. <DT>Lisp mode
  9173. <DD>The mode for editing source files of programs that run in other dialects
  9174. of Lisp than Emacs Lisp.  This mode defines <KBD>C-M-x</KBD> to send the
  9175. current defun to an inferior Lisp process.  See section <A HREF="xEMACS.HTM#SEC229">Running an External Lisp</A>.
  9176. <DT>Inferior Lisp mode
  9177. <DD>The mode for an interactive session with an inferior Lisp process.
  9178. This mode combines the special features of Lisp mode and Shell mode
  9179. (see section <A HREF="xEMACS.HTM#SEC264">Shell Mode</A>).
  9180. <DT>Scheme mode
  9181. <DD>Like Lisp mode but for Scheme programs.
  9182. <DT>Inferior Scheme mode
  9183. <DD>The mode for an interactive session with an inferior Scheme process.
  9184. </DL>
  9185. <A NAME="IDX1118"></A>
  9186. <A NAME="IDX1119"></A>
  9187. <H2><A NAME="SEC222" HREF="xEMACS_TO.HTM#SEC222">Libraries of Lisp Code for Emacs</A></H2>
  9188.   Lisp code for Emacs editing commands is stored in files whose names
  9189. conventionally end in <TT>`.el'</TT>.  This ending tells Emacs to edit them in
  9190. Emacs-Lisp mode (see section <A HREF="xEMACS.HTM#SEC221">Major Modes for Lisp</A>).
  9191. <H3><A NAME="SEC223" HREF="xEMACS_TO.HTM#SEC223">Loading Libraries</A></H3>
  9192. <DL COMPACT>
  9193. <DT><KBD>M-x load-file <VAR>file</VAR></KBD>
  9194. <DD>Load the file <VAR>file</VAR> of Lisp code.
  9195. <DT><KBD>M-x load-library <VAR>library</VAR></KBD>
  9196. <DD>Load the library named <VAR>library</VAR>.
  9197. <DT><KBD>M-x locate-library <VAR>library</VAR> &optional <VAR>nosuffix</VAR></KBD>
  9198. <DD>Show the full path name of Emacs library <VAR>library</VAR>.
  9199. </DL>
  9200. <A NAME="IDX1120"></A>
  9201.   To execute a file of Emacs Lisp, use <KBD>M-x load-file</KBD>.  This
  9202. command reads the file name you provide in the minibuffer, then executes
  9203. the contents of that file as Lisp code.  It is not necessary to visit
  9204. the file first; in fact, this command reads the file as found on
  9205. disk, not the text in an Emacs buffer.
  9206. <A NAME="IDX1121"></A>
  9207. <A NAME="IDX1122"></A>
  9208.   Once a file of Lisp code is installed in the Emacs Lisp library
  9209. directories, users can load it using <KBD>M-x load-library</KBD>.  Programs can
  9210. load it by calling <CODE>load-library</CODE>, or with <CODE>load</CODE>, a more primitive
  9211. function that is similar but accepts some additional arguments.
  9212.   <KBD>M-x load-library</KBD> differs from <KBD>M-x load-file</KBD> in that it
  9213. searches a sequence of directories and tries three file names in each
  9214. directory.  The three names are: first, the specified name with <TT>`.elc'</TT>
  9215. appended; second, the name with <TT>`.el'</TT> appended; third, the specified
  9216. name alone.  A <TT>`.elc'</TT> file would be the result of compiling the Lisp
  9217. file into byte code;  if possible, it is loaded in preference to the Lisp
  9218. file itself because the compiled file loads and runs faster.
  9219. <A NAME="IDX1123"></A>
  9220.   Because the argument to <CODE>load-library</CODE> is usually not in itself
  9221. a valid file name, file name completion is not available.  In fact, when
  9222. using this command, you usually do not know exactly what file name
  9223. will be used.
  9224. <A NAME="IDX1124"></A>
  9225.   The sequence of directories searched by <KBD>M-x load-library</KBD> is
  9226. specified by the variable <CODE>load-path</CODE>, a list of strings that are
  9227. directory names.  The elements of this list may not begin with "<SAMP>`~'</SAMP>",
  9228. so you must call <CODE>expand-file-name</CODE> on them before adding them to
  9229. the list.  The default value of the list contains the directory where
  9230. the Lisp code for Emacs itself is stored.  If you have libraries of your
  9231. own, put them in a single directory and add that directory to
  9232. <CODE>load-path</CODE>.  <CODE>nil</CODE> in this list stands for the current
  9233. default directory, but it is probably not a good idea to put <CODE>nil</CODE>
  9234. in the list.  If you start wishing that <CODE>nil</CODE> were in the list, you
  9235. should probably use <KBD>M-x load-file</KBD> for this case.
  9236. The variable is initialized by the <B>EMACSLOADPATH</B> environment
  9237. variable. If no value is specified, the variable takes the default value
  9238. specified in the file <TT>`paths.h'</TT> when Emacs was built. If a path
  9239. isn't specified in <TT>`paths.h'</TT>, a default value is obtained from the
  9240. file system, near the directory in which the Emacs executable resides.
  9241. <A NAME="IDX1125"></A>
  9242.  Like <KBD>M-x load-library</KBD>, <KBD>M-x locate-library</KBD> searches the 
  9243. directories in <CODE>load-path</CODE> to find the file that <KBD>M-x load-library</KBD>
  9244. would load.  If the optional second argument <VAR>nosuffix</VAR> is
  9245. non-<CODE>nil</CODE>, the suffixes <TT>`.elc'</TT> or <TT>`.el'</TT> are not added to
  9246. the specified name <VAR>library</VAR> (like calling <CODE>load</CODE> instead of
  9247. <CODE>load-library</CODE>).
  9248. <A NAME="IDX1126"></A>
  9249.    You often do not have to give any command to load a library, because the
  9250. commands defined in the library are set up to <DFN>autoload</DFN> that library.
  9251. Running any of those commands causes <CODE>load</CODE> to be called to load the
  9252. library; this replaces the autoload definitions with the real ones from the
  9253. library.
  9254.   If autoloading a file does not finish, either because of an error or
  9255. because of a <KBD>C-g</KBD> quit, all function definitions made by the file
  9256. are undone automatically.  So are any calls to <CODE>provide</CODE>.  As a
  9257. consequence, the entire file is loaded a second time if you use one of
  9258. the autoloadable commands again.  This prevents problems when the
  9259. command is no longer autoloading but is working incorrectly because the file
  9260. was only partially loaded.  Function definitions are undone only for
  9261. autoloading; explicit calls to <CODE>load</CODE> do not undo anything if
  9262. loading is not completed.
  9263. <A NAME="IDX1127"></A>
  9264. The variable <CODE>after-load-alist</CODE> takes an alist of expressions to be
  9265. evaluated when particular files are loaded.  Each element has the form
  9266. <CODE>(<VAR>filename</VAR> forms...)</CODE>.  When <CODE>load</CODE> is run and the filename
  9267. argument is <VAR>filename</VAR>, the forms in the corresponding element are
  9268. executed at the end of loading.
  9269. <VAR>filename</VAR> must match exactly.  Normally <VAR>filename</VAR> is the
  9270. name of a library, with no directory specified, since that is how load
  9271. is normally called.  An error in <CODE>forms</CODE> does not undo the load, but
  9272. it does prevent execution of the rest of the <CODE>forms</CODE>.
  9273. <H3><A NAME="SEC224" HREF="xEMACS_TO.HTM#SEC224">Compiling Libraries</A></H3>
  9274. <A NAME="IDX1128"></A>
  9275.   Emacs Lisp code can be compiled into byte-code which loads faster,
  9276. takes up less space when loaded, and executes faster.
  9277. <DL COMPACT>
  9278. <DT><KBD>M-x batch-byte-compile</KBD>
  9279. <DD>Run byte-compile-file on the files remaining on the command line.
  9280. <DT><KBD>M-x byte-compile-buffer &optional <VAR>buffer</VAR></KBD>
  9281. <DD>Byte-compile and evaluate contents of <VAR>buffer</VAR> (default is current 
  9282. buffer).
  9283. <DT><KBD>M-x byte-compile-file</KBD>
  9284. <DD>Compile a file of Lisp code named <VAR>filename</VAR> into a file of byte code.
  9285. <DT><KBD>M-x byte-compile-and-load-file <VAR>filename</VAR></KBD>
  9286. <DD>Compile a file of Lisp code named <VAR>filename</VAR> into a file of byte
  9287. code and load it.
  9288. <DT><KBD>M-x byte-recompile-directory <VAR>directory</VAR></KBD>
  9289. <DD>Recompile every <TT>`.el'</TT> file in <VAR>directory</VAR> that needs recompilation.
  9290. <DT><KBD>M-x disassemble</KBD>
  9291. <DD>Print disassembled code for <VAR>object</VAR> on (optional) <VAR>stream</VAR>.
  9292. <A NAME="IDX1129"></A>
  9293. <DT><KBD>M-x make-obsolete <VAR>function new</VAR></KBD>
  9294. <DD>Make the byte-compiler warn that <VAR>function</VAR> is obsolete and <VAR>new</VAR> 
  9295. should be used instead.
  9296. </DL>
  9297. <A NAME="IDX1130"></A>
  9298. <A NAME="IDX1131"></A>
  9299. <A NAME="IDX1132"></A>
  9300.  <KBD>byte-compile-file</KBD> creates a byte-code compiled file from an
  9301. Emacs-Lisp source file.  The default argument for this function is the
  9302. file visited in the current buffer.  The function reads the specified
  9303. file, compiles it into byte code, and writes an output file whose name
  9304. is made by appending <TT>`c'</TT> to the input file name.  Thus, the file
  9305. <TT>`rmail.el'</TT> would be compiled into <TT>`rmail.elc'</TT>. To compile a
  9306. file of Lisp code named <VAR>filename</VAR> into a file of byte code and
  9307. then load it, use <CODE>byte-compile-and-load-file</CODE>. To compile and
  9308. evaluate Lisp code in a given buffer, use <CODE>byte-compile-buffer</CODE>.
  9309. <A NAME="IDX1133"></A>
  9310.   To recompile all changed Lisp files in a directory, use <KBD>M-x
  9311. byte-recompile-directory</KBD>.  Specify just the directory name as an argument.
  9312. Each <TT>`.el'</TT> file that has been byte-compiled before is byte-compiled
  9313. again if it has changed since the previous compilation.  A numeric argument
  9314. to this command tells it to offer to compile each <TT>`.el'</TT> file that has
  9315. not been compiled yet.  You must answer <KBD>y</KBD> or <KBD>n</KBD> to each
  9316. offer.
  9317. <A NAME="IDX1134"></A>
  9318.   You can use the function <CODE>batch-byte-compile</CODE> to invoke Emacs
  9319. non-interactively from the shell to do byte compilation.  When you use
  9320. this function, the files to be compiled are specified with command-line
  9321. arguments.  Use a shell command of the form:
  9322. <PRE>
  9323. emacs -batch -f batch-byte-compile <VAR>files</VAR>...
  9324. </PRE>
  9325.   Directory names may also be given as arguments; in that case,
  9326. <CODE>byte-recompile-directory</CODE> is invoked on each such directory.
  9327. <CODE>batch-byte-compile</CODE> uses all remaining command-line arguments as
  9328. file or directory names, then kills the Emacs process.
  9329. <A NAME="IDX1135"></A>
  9330.   <KBD>M-x disassemble</KBD> explains the result of byte compilation.  Its
  9331. argument is a function name.  It displays the byte-compiled code in a help
  9332. window in symbolic form, one instruction per line.  If the instruction
  9333. refers to a variable or constant, that is shown, too.
  9334. <H3><A NAME="SEC225" HREF="xEMACS_TO.HTM#SEC225">Converting Mocklisp to Lisp</A></H3>
  9335. <A NAME="IDX1136"></A>
  9336. <A NAME="IDX1137"></A>
  9337.   GNU Emacs can run Mocklisp files by converting them to Emacs Lisp first.
  9338. To convert a Mocklisp file, visit it and then type <KBD>M-x
  9339. convert-mocklisp-buffer</KBD>.  Then save the resulting buffer of Lisp file in a
  9340. file whose name ends in <TT>`.el'</TT> and use the new file as a Lisp library.
  9341.   You cannot currently byte-compile converted Mocklisp code.
  9342. The reason is that converted Mocklisp code uses some special Lisp features
  9343. to deal with Mocklisp's incompatible ideas of how arguments are evaluated
  9344. and which values signify "true" or "false".
  9345. <A NAME="IDX1138"></A>
  9346. <H2><A NAME="SEC226" HREF="xEMACS_TO.HTM#SEC226">Evaluating Emacs-Lisp Expressions</A></H2>
  9347. <A NAME="IDX1139"></A>
  9348.   Lisp programs intended to be run in Emacs should be edited in
  9349. Emacs-Lisp mode; this will happen automatically for file names ending in
  9350. <TT>`.el'</TT>.  By contrast, Lisp mode itself should be used for editing
  9351. Lisp programs intended for other Lisp systems.  Emacs-Lisp mode can be
  9352. selected with the command <KBD>M-x emacs-lisp-mode</KBD>.
  9353.   For testing of Lisp programs to run in Emacs, it is useful to be able
  9354. to evaluate part of the program as it is found in the Emacs buffer.  For
  9355. example, if you change the text of a Lisp function definition and then
  9356. evaluate the definition, Emacs installs the change for future calls to the
  9357. function.  Evaluation of Lisp expressions is also useful in any kind of
  9358. editing task for invoking non-interactive functions (functions that are
  9359. not commands).
  9360. <DL COMPACT>
  9361. <DT><KBD>M-<KBD>ESC</KBD></KBD>
  9362. <DD>Read a Lisp expression in the minibuffer, evaluate it, and print the
  9363. value in the minibuffer (<CODE>eval-expression</CODE>).
  9364. <DT><KBD>C-x C-e</KBD>
  9365. <DD>Evaluate the Lisp expression before point, and print the value in the
  9366. minibuffer (<CODE>eval-last-sexp</CODE>).
  9367. <DT><KBD>C-M-x</KBD>
  9368. <DD>Evaluate the defun containing point or after point, and print the value in
  9369. the minibuffer (<CODE>eval-defun</CODE>).
  9370. <DT><KBD>M-x eval-region</KBD>
  9371. <DD>Evaluate all the Lisp expressions in the region.
  9372. <DT><KBD>M-x eval-current-buffer</KBD>
  9373. <DD>Evaluate all the Lisp expressions in the buffer.
  9374. </DL>
  9375. <A NAME="IDX1140"></A>
  9376. <A NAME="IDX1141"></A>
  9377.   <KBD>M-<KBD>ESC</KBD></KBD> (<CODE>eval-expression</CODE>) is the most basic command
  9378. for evaluating a Lisp expression interactively.  It reads the expression
  9379. using the minibuffer, so you can execute any expression on a buffer
  9380. regardless of what the buffer contains.  When evaluation is complete,
  9381. the current buffer is once again the buffer that was current when
  9382. <KBD>M-<KBD>ESC</KBD></KBD> was typed.
  9383.   <KBD>M-<KBD>ESC</KBD></KBD> can easily confuse users, especially on keyboards
  9384. with autorepeat, where it can result from holding down the <KBD>ESC</KBD> key
  9385. for too long.  Therefore, <CODE>eval-expression</CODE> is normally a disabled
  9386. command.  Attempting to use this command asks for confirmation and gives
  9387. you the option of enabling it; once you enable the command, you are no
  9388. longer required to confirm.  See section <A HREF="xEMACS.HTM#SEC288">Disabling Commands</A>.<A NAME="IDX1142"></A>
  9389. <A NAME="IDX1143"></A>
  9390.   In Emacs-Lisp mode, the key <KBD>C-M-x</KBD> is bound to the function
  9391. <CODE>eval-defun</CODE>, which parses the defun containing point or following point
  9392. as a Lisp expression and evaluates it.  The value is printed in the echo
  9393. area.  This command is convenient for installing in the Lisp environment
  9394. changes that you have just made in the text of a function definition.
  9395. <A NAME="IDX1144"></A>
  9396. <A NAME="IDX1145"></A>
  9397.   The command <KBD>C-x C-e</KBD> (<CODE>eval-last-sexp</CODE>) performs a similar job
  9398. but is available in all major modes, not just Emacs-Lisp mode.  It finds
  9399. the sexp before point, reads it as a Lisp expression, evaluates it, and
  9400. prints the value in the echo area.  It is sometimes useful to type in an
  9401. expression and then, with point still after it, type <KBD>C-x C-e</KBD>.
  9402.   If <KBD>C-M-x</KBD> or <KBD>C-x C-e</KBD> are given a numeric argument, they
  9403. print the value by inserting it into the current buffer at point, rather
  9404. than in the echo area.  The argument value does not matter.
  9405. <A NAME="IDX1146"></A>
  9406. <A NAME="IDX1147"></A>
  9407.   The most general command for evaluating Lisp expressions from a buffer
  9408. is <CODE>eval-region</CODE>.  <KBD>M-x eval-region</KBD> parses the text of the
  9409. region as one or more Lisp expressions, evaluating them one by one.
  9410. <KBD>M-x eval-current-buffer</KBD> is similar, but it evaluates the entire
  9411. buffer.  This is a reasonable way to install the contents of a file of
  9412. Lisp code that you are just ready to test.  After finding and fixing a
  9413. bug, use <KBD>C-M-x</KBD> on each function that you change, to keep the Lisp
  9414. world in step with the source file.
  9415. <A NAME="IDX1148"></A>
  9416. <H2><A NAME="SEC227" HREF="xEMACS_TO.HTM#SEC227">The Emacs-Lisp Debugger</A></H2>
  9417. <A NAME="IDX1149"></A>
  9418. <A NAME="IDX1150"></A>
  9419.   GNU Emacs contains a debugger for Lisp programs executing inside it.
  9420. This debugger is normally not used; many commands frequently get Lisp
  9421. errors when invoked in inappropriate contexts (such as <KBD>C-f</KBD> at the
  9422. end of the buffer) and it would be unpleasant to enter a special
  9423. debugging mode in this case.  When you want to make Lisp errors invoke
  9424. the debugger, you must set the variable <CODE>debug-on-error</CODE> to
  9425. non-<CODE>nil</CODE>.  Quitting with <KBD>C-g</KBD> is not considered an error, and
  9426. <CODE>debug-on-error</CODE> has no effect on the handling of <KBD>C-g</KBD>.
  9427. However, if you set <CODE>debug-on-quit</CODE> to be non-<CODE>nil</CODE>, <KBD>C-g</KBD> will
  9428. invoke the debugger.  This can be useful for debugging an infinite loop;
  9429. type <KBD>C-g</KBD> once the loop has had time to reach its steady state.
  9430. <CODE>debug-on-quit</CODE> has no effect on errors.<A NAME="IDX1151"></A>
  9431. <A NAME="IDX1152"></A>
  9432. <A NAME="IDX1153"></A>
  9433.   You can make Emacs enter the debugger when a specified function
  9434. is called or at a particular place in Lisp code.  Use <KBD>M-x
  9435. debug-on-entry</KBD> with argument <VAR>fun-name</VAR> to have Emacs enter the
  9436. debugger as soon as <VAR>fun-name</VAR> is called. Use
  9437. <KBD>M-x cancel-debug-on-entry</KBD> to make the function stop entering the
  9438. debugger when called.  (Redefining the function also does this.)  To enter
  9439. the debugger from some other place in Lisp code, you must insert the
  9440. expression <CODE>(debug)</CODE> there and install the changed code with
  9441. <KBD>C-M-x</KBD>.  See section <A HREF="xEMACS.HTM#SEC226">Evaluating Emacs-Lisp Expressions</A>.<P>
  9442.   When the debugger is entered, it displays the previously selected buffer
  9443. in one window and a buffer named <SAMP>`*Backtrace*'</SAMP> in another window.  The
  9444. backtrace buffer contains one line for each level of Lisp function
  9445. execution currently going on.  At the beginning of the buffer is a message
  9446. describing the reason that the debugger was invoked, for example, an
  9447. error message if it was invoked due to an error.
  9448.   The backtrace buffer is read-only and is in Backtrace mode, a special
  9449. major mode in which letters are defined as debugger commands.  The
  9450. usual Emacs editing commands are available; you can switch windows to
  9451. examine the buffer that was being edited at the time of the error, and
  9452. you can switch buffers, visit files, and perform any other editing
  9453. operations.  However, the debugger is a recursive editing level
  9454. (see section <A HREF="xEMACS.HTM#SEC267">Recursive Editing Levels</A>); it is a good idea to return to the backtrace
  9455. buffer and explictly exit the debugger when you don't want to use it any
  9456. more.  Exiting the debugger kills the backtrace buffer.
  9457. <A NAME="IDX1154"></A>
  9458.   The contents of the backtrace buffer show you the functions that are
  9459. executing and the arguments that were given to them.  It also allows you
  9460. to specify a stack frame by moving point to the line describing that
  9461. frame.  The frame whose line point is on is considered the <DFN>current
  9462. frame</DFN>.  Some of the debugger commands operate on the current frame.
  9463. Debugger commands are mainly used for stepping through code one
  9464. expression at a time.  Here is a list of them:
  9465. <DL COMPACT>
  9466. <DT><KBD>c</KBD>
  9467. <DD>Exit the debugger and continue execution.  In most cases, execution of
  9468. the program continues as if the debugger had never been entered (aside
  9469. from the effect of any variables or data structures you may have changed
  9470. while inside the debugger).  This includes entry to the debugger due to
  9471. function entry or exit, explicit invocation, and quitting or certain
  9472. errors.  Most errors cannot be continued; trying to continue an error usually
  9473. causes the same error to occur again.
  9474. <DT><KBD>d</KBD>
  9475. <DD>Continue execution, but enter the debugger the next time a Lisp
  9476. function is called.  This allows you to step through the
  9477. subexpressions of an expression, and see what the subexpressions do and
  9478. what values they compute.
  9479. When you enter the debugger this way, Emacs flags the stack frame for the
  9480. function call from which you entered.  The same function is then called
  9481. when you exit the frame.  To cancel this flag, use <KBD>u</KBD>.
  9482. <DT><KBD>b</KBD>
  9483. <DD>Set up to enter the debugger when the current frame is exited.  Frames
  9484. that invoke the debugger on exit are flagged with stars.
  9485. <DT><KBD>u</KBD>
  9486. <DD>Don't enter the debugger when the current frame is exited.  This
  9487. cancels a <KBD>b</KBD> command on a frame.
  9488. <DT><KBD>e</KBD>
  9489. <DD>Read a Lisp expression in the minibuffer, evaluate it, and print the
  9490. value in the echo area.  This is equivalent to the command <KBD>M-<KBD>ESC</KBD></KBD>,
  9491. except that <KBD>e</KBD> is not normally disabled like <KBD>M-<KBD>ESC</KBD></KBD>.
  9492. <DT><KBD>q</KBD>
  9493. <DD>Terminate the program being debugged; return to top-level Emacs
  9494. command execution.
  9495. If the debugger was entered due to a <KBD>C-g</KBD> but you really want
  9496. to quit, not to debug, use the <KBD>q</KBD> command.
  9497. <DT><KBD>r</KBD>
  9498. <DD>Return a value from the debugger.  The value is computed by reading an
  9499. expression with the minibuffer and evaluating it.
  9500. The value returned by the debugger makes a difference when the debugger
  9501. was invoked due to exit from a Lisp call frame (as requested with <KBD>b</KBD>);
  9502. then the value specified in the <KBD>r</KBD> command is used as the value of
  9503. that frame.
  9504. The debugger's return value also matters with many errors.  For example,
  9505. <CODE>wrong-type-argument</CODE> errors will use the debugger's return value
  9506. instead of the invalid argument; <CODE>no-catch</CODE> errors will use the
  9507. debugger value as a throw tag instead of the tag that was not found.
  9508. If an error was signaled by calling the Lisp function <CODE>signal</CODE>,
  9509. the debugger's return value is returned as the value of <CODE>signal</CODE>.
  9510. </DL>
  9511. <H2><A NAME="SEC228" HREF="xEMACS_TO.HTM#SEC228">Lisp Interaction Buffers</A></H2>
  9512.   The buffer <SAMP>`*scratch*'</SAMP>, which is selected when Emacs starts up, is
  9513. provided for evaluating Lisp expressions interactively inside Emacs.  Both
  9514. the expressions you evaluate and their output goes in the buffer.
  9515.   The <SAMP>`*scratch*'</SAMP> buffer's major mode is Lisp Interaction mode, which
  9516. is the same as Emacs-Lisp mode except for one command, <KBD>LFD</KBD>.  In
  9517. Emacs-Lisp mode, <KBD>LFD</KBD> is an indentation command.  In Lisp
  9518. Interaction mode, <KBD>LFD</KBD> is bound to <CODE>eval-print-last-sexp</CODE>.  This
  9519. function reads the Lisp expression before point, evaluates it, and inserts
  9520. the value in printed representation before point.
  9521.  The way to use the <SAMP>`*scratch*'</SAMP> buffer is to insert Lisp
  9522. expressions at the end, ending each one with <KBD>LFD</KBD> so that it will
  9523. be evaluated.  The result is a complete typescript of the expressions
  9524. you have evaluated and their values.
  9525. <A NAME="IDX1155"></A>
  9526.   The rationale for this feature is that Emacs must have a buffer when it
  9527. starts up, but that buffer is not useful for editing files since a new
  9528. buffer is made for every file that you visit.  The Lisp interpreter
  9529. typescript is the most useful thing I can think of for the initial buffer
  9530. to do.  <KBD>M-x lisp-interaction-mode</KBD> will put any buffer in Lisp
  9531. Interaction mode.
  9532. <H2><A NAME="SEC229" HREF="xEMACS_TO.HTM#SEC229">Running an External Lisp</A></H2>
  9533.   Emacs has facilities for running programs in other Lisp systems.  You can
  9534. run a Lisp process as an inferior of Emacs, and pass expressions to it to
  9535. be evaluated.  You can also pass changed function definitions directly from
  9536. the Emacs buffers in which you edit the Lisp programs to the inferior Lisp
  9537. process.
  9538. <A NAME="IDX1156"></A>
  9539.   To run an inferior Lisp process, type <KBD>M-x run-lisp</KBD>.  This runs the
  9540. program named <CODE>lisp</CODE>, the same program you would run by typing
  9541. <CODE>lisp</CODE> as a shell command, with both input and output going through an
  9542. Emacs buffer named <SAMP>`*lisp*'</SAMP>.  In other words, any "terminal output"
  9543. from Lisp will go into the buffer, advancing point, and any "terminal
  9544. input" for Lisp comes from text in the buffer.  To give input to Lisp, go
  9545. to the end of the buffer and type the input, terminated by <KBD>RET</KBD>.  The
  9546. <SAMP>`*lisp*'</SAMP> buffer is in Inferior Lisp mode, which has all the
  9547. special characteristics of Lisp mode and Shell mode (see section <A HREF="xEMACS.HTM#SEC264">Shell Mode</A>).
  9548. <A NAME="IDX1157"></A>
  9549.   Use Lisp mode to run the source files of programs in external Lisps.
  9550. You can select this mode with <KBD>M-x lisp-mode</KBD>.  It is used automatically
  9551. for files whose names end in <TT>`.l'</TT> or <TT>`.lisp'</TT>, as most Lisp
  9552. systems usually expect.
  9553. <A NAME="IDX1158"></A>
  9554. <A NAME="IDX1159"></A>
  9555.   When you edit a function in a Lisp program you are running, the easiest
  9556. way to send the changed definition to the inferior Lisp process is the key
  9557. <KBD>C-M-x</KBD>.  In Lisp mode, this key runs the function <CODE>lisp-send-defun</CODE>,
  9558. which finds the defun around or following point and sends it as input to
  9559. the Lisp process.  (Emacs can send input to any inferior process regardless
  9560. of what buffer is current.)
  9561.   Contrast the meanings of <KBD>C-M-x</KBD> in Lisp mode (for editing programs
  9562. to be run in another Lisp system) and Emacs-Lisp mode (for editing Lisp
  9563. programs to be run in Emacs): in both modes it has the effect of installing
  9564. the function definition that point is in, but the way of doing so is
  9565. different according to where the relevant Lisp environment is found.
  9566. See section <A HREF="xEMACS.HTM#SEC221">Major Modes for Lisp</A>.
  9567. <A NAME="IDX1160"></A>
  9568. <A NAME="IDX1161"></A>
  9569. <H1><A NAME="SEC230" HREF="xEMACS_TO.HTM#SEC230">Abbrevs</A></H1>
  9570.   An <DFN>abbrev</DFN> is a word which <DFN>expands</DFN> into some
  9571. different text.  Abbrevs are defined by the user to expand in specific
  9572. ways.  For example, you might define <SAMP>`foo'</SAMP> as an abbrev expanding to
  9573. <SAMP>`find outer otter'</SAMP>.  With this abbrev defined, you would be able to
  9574. get <SAMP>`find outer otter '</SAMP> into the buffer by typing <KBD>f o o <KBD>SPC</KBD></KBD>.
  9575. <A NAME="IDX1162"></A>
  9576. <A NAME="IDX1163"></A>
  9577.   Abbrevs expand only when Abbrev mode (a minor mode) is enabled.
  9578. Disabling Abbrev mode does not cause abbrev definitions to be discarded,
  9579. but they do not expand until Abbrev mode is enabled again.  The command
  9580. <KBD>M-x abbrev-mode</KBD> toggles Abbrev mode; with a numeric argument, it
  9581. turns Abbrev mode on if the argument is positive, off otherwise.
  9582. See section <A HREF="xEMACS.HTM#SEC274">Minor Modes</A>.  <CODE>abbrev-mode</CODE> is also a variable; Abbrev mode is
  9583. on when the variable is non-<CODE>nil</CODE>.  The variable <CODE>abbrev-mode</CODE>
  9584. automatically becomes local to the current buffer when it is set.
  9585.   Abbrev definitions can be <DFN>mode-specific</DFN>---active only in one major
  9586. mode.  Abbrevs can also have <DFN>global</DFN> definitions that are active in
  9587. all major modes.  The same abbrev can have a global definition and various
  9588. mode-specific definitions for different major modes.  A mode-specific
  9589. definition for the current major mode overrides a global definition.
  9590.  You can define Abbrevs interactively during an editing session.  You
  9591. can also save lists of abbrev definitions in files and reload them in later
  9592. sessions.  Some users keep extensive lists of abbrevs that they load in
  9593. every session.
  9594.   A second kind of abbreviation facility is called the <DFN>dynamic
  9595. expansion</DFN>.  Dynamic abbrev expansion happens only when you give an
  9596. explicit command and the result of the expansion depends only on the
  9597. current contents of the buffer.  See section <A HREF="xEMACS.HTM#SEC235">Dynamic Abbrev Expansion</A>.
  9598. <H2><A NAME="SEC231" HREF="xEMACS_TO.HTM#SEC231">Defining Abbrevs</A></H2>
  9599. <DL COMPACT>
  9600. <DT><KBD>C-x a g</KBD>
  9601. <DD>Define an abbrev to expand into some text before point
  9602. (<CODE>add-global-abbrev</CODE>).
  9603. <DT><KBD>C-x a l</KBD>
  9604. <DD>Similar, but define an abbrev available only in the current major mode
  9605. (<CODE>add-mode-abbrev</CODE>).
  9606. <DT><KBD>C-x a i g</KBD>
  9607. <DD>Define a word in the buffer as an abbrev (<CODE>inverse-add-global-abbrev</CODE>).
  9608. <DT><KBD>C-x a i l</KBD>
  9609. <DD>Define a word in the buffer as a mode-specific abbrev
  9610. (<CODE>inverse-add-mode-abbrev</CODE>).
  9611. <DT><KBD>M-x kill-all-abbrevs</KBD>
  9612. <DD>After this command, no abbrev definitions remain in effect.
  9613. </DL>
  9614. <A NAME="IDX1164"></A>
  9615. <A NAME="IDX1165"></A>
  9616.   The usual way to define an abbrev is to enter the text you want the
  9617. abbrev to expand to, position point after it, and type <KBD>C-x a g</KBD>
  9618. (<CODE>add-global-abbrev</CODE>).  This reads the abbrev itself using the
  9619. minibuffer, and then defines it as an abbrev for one or more words
  9620. before point.  Use a numeric argument to say how many words before point
  9621. should be taken as the expansion.  For example, to define the abbrev
  9622. <SAMP>`foo'</SAMP> as in the example above, insert the text <SAMP>`find outer
  9623. otter'</SAMP>, then type <BR><KBD>C-u 3 C-x a g f o o <KBD>RET</KBD></KBD>.
  9624.   An argument of zero to <KBD>C-x a g</KBD> means to use the contents of the
  9625. region as the expansion of the abbrev being defined.
  9626. <A NAME="IDX1166"></A>
  9627. <A NAME="IDX1167"></A>
  9628.   The command <KBD>C-x a l</KBD> (<CODE>add-mode-abbrev</CODE>) is similar, but
  9629. defines a mode-specific abbrev.  Mode-specific abbrevs are active only in a
  9630. particular major mode.  <KBD>C-x a l</KBD> defines an abbrev for the major mode
  9631. in effect at the time <KBD>C-x a l</KBD> is typed.  The arguments work the
  9632. same way they do for <KBD>C-x a g</KBD>.
  9633. <A NAME="IDX1168"></A>
  9634. <A NAME="IDX1169"></A>
  9635. <A NAME="IDX1170"></A>
  9636. <A NAME="IDX1171"></A>
  9637.   If the text of an abbrev you want is already in the buffer instead of
  9638. the expansion, use command <KBD>C-x a i g</KBD> (<CODE>inverse-add-global-abbrev</CODE>)
  9639. instead of <KBD>C-x a g</KBD>, or use <KBD>C-x a i l</KBD>
  9640. (<CODE>inverse-add-mode-abbrev</CODE>) instead of <KBD>C-x a l</KBD>.  These commands
  9641. are called "inverse" because they invert the meaning of the argument
  9642. found in the buffer and the argument read using the minibuffer.<P>
  9643.   To change the definition of an abbrev, just add the new definition.  You
  9644. will be asked to confirm if the abbrev has a prior definition.  To remove
  9645. an abbrev definition, give a negative argument to <KBD>C-x a g</KBD> or <KBD>C-x
  9646. a l</KBD>.  You must choose the command to specify whether to kill a global
  9647. definition or a mode-specific definition for the current mode, since those
  9648. two definitions are independent for one abbrev.
  9649. <A NAME="IDX1172"></A>
  9650.   <KBD>M-x kill-all-abbrevs</KBD> removes all existing abbrev definitions.
  9651. <H2><A NAME="SEC232" HREF="xEMACS_TO.HTM#SEC232">Controlling Abbrev Expansion</A></H2>
  9652.   An abbrev expands whenever it is in a buffer just before point and you
  9653. type a self-inserting punctuation character (<KBD>SPC</KBD>, comma,
  9654. etc.).  Most often an abbrev is used by inserting the abbrev followed
  9655. by punctuation.
  9656. <A NAME="IDX1173"></A>
  9657.   Abbrev expansion preserves case; thus, <SAMP>`foo'</SAMP> expands into <SAMP>`find
  9658. outer otter'</SAMP>, <SAMP>`Foo'</SAMP> into <SAMP>`Find outer otter'</SAMP>, and <SAMP>`FOO'</SAMP> into
  9659. <SAMP>`FIND OUTER OTTER'</SAMP> or <SAMP>`Find Outer Otter'</SAMP> according to the
  9660. variable <CODE>abbrev-all-caps</CODE> (a non-<CODE>nil</CODE> value chooses the first
  9661. of the two expansions).<P>
  9662.    Two commands are available to control abbrev expansion:
  9663. <DL COMPACT>
  9664. <DT><KBD>M-'</KBD>
  9665. <DD>Separate a prefix from a following abbrev to be expanded
  9666. (<CODE>abbrev-prefix-mark</CODE>).
  9667. <A NAME="IDX1174"></A>
  9668. <DT><KBD>C-x a e</KBD>
  9669. <DD>Expand the abbrev before point (<CODE>expand-abbrev</CODE>).
  9670. This is effective even when Abbrev mode is not enabled.
  9671. <DT><KBD>M-x unexpand-abbrev</KBD>
  9672. <DD>Undo last abbrev expansion.
  9673. <DT><KBD>M-x expand-region-abbrevs</KBD>
  9674. <DD>Expand some or all abbrevs found in the region.
  9675. </DL>
  9676. <A NAME="IDX1175"></A>
  9677. <A NAME="IDX1176"></A>
  9678.   You may wish to expand an abbrev with a prefix attached.  For example,
  9679. if <SAMP>`cnst'</SAMP> expands into <SAMP>`construction'</SAMP>, you may want to use it
  9680. to enter <SAMP>`reconstruction'</SAMP>.  It does not work to type <KBD>recnst</KBD>,
  9681. because that is not necessarily a defined abbrev.  Instead, you can use
  9682. the command <KBD>M-'</KBD> (<CODE>abbrev-prefix-mark</CODE>) between the prefix
  9683. <SAMP>`re'</SAMP> and the abbrev <SAMP>`cnst'</SAMP>.  First, insert <SAMP>`re'</SAMP>.  Then
  9684. type <KBD>M-'</KBD>; this inserts a minus sign in the buffer to indicate that
  9685. it has done its work.  Then insert the abbrev <SAMP>`cnst'</SAMP>.  The buffer
  9686. now contains <SAMP>`re-cnst'</SAMP>.  Now insert a punctuation character to
  9687. expand the abbrev <SAMP>`cnst'</SAMP> into <SAMP>`construction'</SAMP>.  The minus sign
  9688. is deleted at this point by <KBD>M-'</KBD>.  The resulting text is the
  9689. desired <SAMP>`reconstruction'</SAMP>.<P>
  9690.   If you actually want the text of the abbrev in the buffer, rather than
  9691. its expansion, insert the following punctuation with <KBD>C-q</KBD>.  Thus,
  9692. <KBD>foo C-q -</KBD> leaves <SAMP>`foo-'</SAMP> in the buffer.
  9693. <A NAME="IDX1177"></A>
  9694.   If you expand an abbrev by mistake, you can undo the expansion (replace
  9695. the expansion by the original abbrev text) with <KBD>M-x unexpand-abbrev</KBD>.
  9696. You can also use <KBD>C-_</KBD> (<CODE>undo</CODE>) to undo the expansion; but that
  9697. will first undo the insertion of the punctuation character.
  9698. <A NAME="IDX1178"></A>
  9699.   <KBD>M-x expand-region-abbrevs</KBD> searches through the region for defined
  9700. abbrevs, and  offers to replace each one it finds with its expansion.
  9701. This command is useful if you have typed text using abbrevs but forgot
  9702. to turn on Abbrev mode first.  It may also be useful together with a
  9703. special set of abbrev definitions for making several global replacements at
  9704. once.  The command is effective even if Abbrev mode is not enabled.
  9705. <H2><A NAME="SEC233" HREF="xEMACS_TO.HTM#SEC233">Examining and Editing Abbrevs</A></H2>
  9706. <DL COMPACT>
  9707. <DT><KBD>M-x list-abbrevs</KBD>
  9708. <DD>Print a list of all abbrev definitions.
  9709. <DT><KBD>M-x edit-abbrevs</KBD>
  9710. <DD>Edit a list of abbrevs; you can add, alter, or remove definitions.
  9711. </DL>
  9712. <A NAME="IDX1179"></A>
  9713.   The output from <KBD>M-x list-abbrevs</KBD> looks like this:
  9714. <PRE>
  9715. (lisp-mode-abbrev-table)
  9716. "dk"           0    "define-key"
  9717. (global-abbrev-table)
  9718. "dfn"           0    "definition"
  9719. </PRE>
  9720. (Some blank lines of no semantic significance, and some other abbrev
  9721. tables, have been omitted.)
  9722.   A line containing a name in parentheses is the header for abbrevs in a
  9723. particular abbrev table; <CODE>global-abbrev-table</CODE> contains all the global
  9724. abbrevs, and the other abbrev tables that are named after major modes
  9725. contain the mode-specific abbrevs.
  9726.   Within each abbrev table, each non-blank line defines one abbrev.  The
  9727. word at the beginning is the abbrev.  The number that appears is the number
  9728. of times the abbrev has been expanded.  Emacs keeps track of this to help
  9729. you see which abbrevs you actually use, in case you want to eliminate
  9730. those that you don't use often.  The string at the end of the line is the
  9731. expansion.
  9732. <A NAME="IDX1180"></A>
  9733. <A NAME="IDX1181"></A>
  9734. <A NAME="IDX1182"></A>
  9735.   <KBD>M-x edit-abbrevs</KBD> allows you to add, change or kill abbrev
  9736. definitions by editing a list of them in an Emacs buffer.  The list has
  9737. the format described above.  The buffer of abbrevs is called
  9738. <SAMP>`*Abbrevs*'</SAMP>, and is in Edit-Abbrevs mode.  This mode redefines the
  9739. key <KBD>C-c C-c</KBD> to install the abbrev definitions as specified in the
  9740. buffer.  The  <CODE>edit-abbrevs-redefine</CODE> command does this.
  9741. Any abbrevs not described in the buffer are eliminated when this is
  9742. done.
  9743.   <CODE>edit-abbrevs</CODE> is actually the same as <CODE>list-abbrevs</CODE>, except
  9744. that it selects the buffer <SAMP>`*Abbrevs*'</SAMP> whereas <CODE>list-abbrevs</CODE>
  9745. merely displays it in another window.
  9746. <H2><A NAME="SEC234" HREF="xEMACS_TO.HTM#SEC234">Saving Abbrevs</A></H2>
  9747.   These commands allow you to keep abbrev definitions between editing
  9748. sessions.
  9749. <DL COMPACT>
  9750. <DT><KBD>M-x write-abbrev-file</KBD>
  9751. <DD>Write a file describing all defined abbrevs.
  9752. <DT><KBD>M-x read-abbrev-file</KBD>
  9753. <DD>Read such an abbrev file and define abbrevs as specified there.
  9754. <DT><KBD>M-x quietly-read-abbrev-file</KBD>
  9755. <DD>Similar, but do not display a message about what is going on.
  9756. <DT><KBD>M-x define-abbrevs</KBD>
  9757. <DD>Define abbrevs from buffer.
  9758. <DT><KBD>M-x insert-abbrevs</KBD>
  9759. <DD>Insert all abbrevs and their expansions into the buffer.
  9760. </DL>
  9761. <A NAME="IDX1183"></A>
  9762.   Use <KBD>M-x write-abbrev-file</KBD> to save abbrev definitions for use in
  9763. a later session.  The command reads a file name using the minibuffer and
  9764. writes a description of all current abbrev definitions into the
  9765. specified file.  The text stored in the file looks like the output of
  9766. <KBD>M-x list-abbrevs</KBD>.
  9767. <A NAME="IDX1184"></A>
  9768. <A NAME="IDX1185"></A>
  9769. <A NAME="IDX1186"></A>
  9770.   <KBD>M-x read-abbrev-file</KBD> prompts for a file name using the
  9771. minibuffer and reads the specified file, defining abbrevs according to
  9772. its contents.  <KBD>M-x quietly-read-abbrev-file</KBD> is the same but does
  9773. not display a message in the echo area; it is actually useful primarily
  9774. in the <TT>`.emacs'</TT> file.  If you give an empty argument to either of
  9775. these functions, the file name Emacs uses is the value of the variable
  9776. <CODE>abbrev-file-name</CODE>, which is by default <CODE>"~/.abbrev_defs"</CODE>.
  9777. <A NAME="IDX1187"></A>
  9778.   Emacs offers to save abbrevs automatically if you have changed any of
  9779. them, whenever it offers to save all files (for <KBD>C-x s</KBD> or <KBD>C-x
  9780. C-c</KBD>).  Set the variable <CODE>save-abbrevs</CODE> to <CODE>nil</CODE> to inhibit
  9781. this feature.
  9782. <A NAME="IDX1188"></A>
  9783. <A NAME="IDX1189"></A>
  9784.   The commands <KBD>M-x insert-abbrevs</KBD> and <KBD>M-x define-abbrevs</KBD> are
  9785. similar to the previous commands but work on text in an Emacs buffer.
  9786. <KBD>M-x insert-abbrevs</KBD> inserts text into the current buffer before point,
  9787. describing all current abbrev definitions; <KBD>M-x define-abbrevs</KBD> parses
  9788. the entire current buffer and defines abbrevs accordingly.<P>
  9789. <H2><A NAME="SEC235" HREF="xEMACS_TO.HTM#SEC235">Dynamic Abbrev Expansion</A></H2>
  9790.   The abbrev facility described above operates automatically as you insert
  9791. text, but all abbrevs must be defined explicitly.  By contrast,
  9792. <DFN>dynamic abbrevs</DFN> allow the meanings of abbrevs to be determined
  9793. automatically from the contents of the buffer, but dynamic abbrev expansion
  9794. happens only when you request it explicitly.
  9795. <A NAME="IDX1190"></A>
  9796. <A NAME="IDX1191"></A>
  9797. <DL COMPACT>
  9798. <DT><KBD>M-/</KBD>
  9799. <DD>Expand the word in the buffer before point as a <DFN>dynamic abbrev</DFN>,
  9800. by searching in the buffer for words starting with that abbreviation
  9801. (<CODE>dabbrev-expand</CODE>).
  9802. </DL>
  9803.   For example, if the buffer contains <SAMP>`does this follow '</SAMP> and you type
  9804. <KBD>f o M-/</KBD>, the effect is to insert <SAMP>`follow'</SAMP> because that is the
  9805. last word in the buffer that starts with <SAMP>`fo'</SAMP>.  A numeric argument to
  9806. <KBD>M-/</KBD> says to take the second, third, etc. distinct expansion found
  9807. looking backward from point.  Repeating <KBD>M-/</KBD> searches for an
  9808. alternative expansion by looking farther back.  After the entire buffer
  9809. before point has been considered, the buffer after point is searched.
  9810.   Dynamic abbrev expansion is completely independent of Abbrev mode; the
  9811. expansion of a word with <KBD>M-/</KBD> is completely independent of whether it
  9812. has a definition as an ordinary abbrev.
  9813. <A NAME="IDX1192"></A>
  9814. <A NAME="IDX1193"></A>
  9815. <H1><A NAME="SEC236" HREF="xEMACS_TO.HTM#SEC236">Editing Pictures</A></H1>
  9816.   If you want to create a picture made out of text characters (for example,
  9817. a picture of the division of a register into fields, as a comment in a
  9818. program), use the command <CODE>edit-picture</CODE> to enter Picture mode.
  9819.   In Picture mode, editing is based on the <DFN>quarter-plane</DFN> model of
  9820. text.  In this model, the text characters lie studded on an area that
  9821. stretches infinitely far to the right and downward.  The concept of the end
  9822. of a line does not exist in this model; the most you can say is where the
  9823. last non-blank character on the line is found.
  9824.   Of course, Emacs really always considers text as a sequence of
  9825. characters, and lines really do have ends.  But in Picture mode most
  9826. frequently-used keys are rebound to commands that simulate the
  9827. quarter-plane model of text.  They do this by inserting spaces or by
  9828. converting tabs to spaces.
  9829.   Most of the basic editing commands of Emacs are redefined by Picture mode
  9830. to do essentially the same thing but in a quarter-plane way.  In addition,
  9831. Picture mode defines various keys starting with the <KBD>C-c</KBD> prefix to
  9832. run special picture editing commands.
  9833.   One of these keys, <KBD>C-c C-c</KBD>, is pretty important.  Often a picture
  9834. is part of a larger file that is usually edited in some other major mode.
  9835. <KBD>M-x edit-picture</KBD> records the name of the previous major mode. 
  9836. You can then use the <KBD>C-c C-c</KBD> command (<CODE>picture-mode-exit</CODE>) to
  9837. restore that mode.  <KBD>C-c C-c</KBD> also deletes spaces from the ends of
  9838. lines, unless you give it a numeric argument.
  9839.   The commands used in Picture mode all work in other modes (provided the
  9840. <TT>`picture'</TT> library is loaded), but are only  bound to keys in
  9841. Picture mode.  Note that the descriptions below talk of moving "one
  9842. column" and so on, but all the picture mode commands handle numeric
  9843. arguments as their normal equivalents do.
  9844. <A NAME="IDX1194"></A>
  9845.   Turning on Picture mode calls the value of the variable
  9846. <CODE>picture-mode-hook</CODE> as a function, with no arguments, if that value
  9847. exists and is non-<CODE>nil</CODE>.
  9848. <H2><A NAME="SEC237" HREF="xEMACS_TO.HTM#SEC237">Basic Editing in Picture Mode</A></H2>
  9849. <A NAME="IDX1195"></A>
  9850. <A NAME="IDX1196"></A>
  9851. <A NAME="IDX1197"></A>
  9852. <A NAME="IDX1198"></A>
  9853.   Most keys do the same thing in Picture mode that they usually do, but do
  9854. it in a quarter-plane style.  For example, <KBD>C-f</KBD> is rebound to run
  9855. <CODE>picture-forward-column</CODE>, which moves point one column to
  9856. the right, by inserting a space if necessary, so that the actual end of the
  9857. line makes no difference.  <KBD>C-b</KBD> is rebound to run
  9858. <CODE>picture-backward-column</CODE>, which always moves point left one column,
  9859. converting a tab to multiple spaces if necessary.  <KBD>C-n</KBD> and <KBD>C-p</KBD>
  9860. are rebound to run <CODE>picture-move-down</CODE> and <CODE>picture-move-up</CODE>,
  9861. which can either insert spaces or convert tabs as necessary to make sure
  9862. that point stays in exactly the same column.  <KBD>C-e</KBD> runs
  9863. <CODE>picture-end-of-line</CODE>, which moves to after the last non-blank
  9864. character on the line.  There was no need to change <KBD>C-a</KBD>, as the choice
  9865. of screen model does not affect beginnings of lines.<A NAME="IDX1199"></A>
  9866.   Insertion of text is adapted to the quarter-plane screen model through
  9867. the use of Overwrite mode (see section <A HREF="xEMACS.HTM#SEC274">Minor Modes</A>).  Self-inserting characters
  9868. replace existing text, column by column, rather than pushing existing text
  9869. to the right.  <KBD>RET</KBD> runs <CODE>picture-newline</CODE>, which just moves to
  9870. the beginning of the following line so that new text will replace that
  9871. line.
  9872. <A NAME="IDX1200"></A>
  9873. <A NAME="IDX1201"></A>
  9874. <A NAME="IDX1202"></A>
  9875.   Text is erased instead of deleted and killed.  <KBD>DEL</KBD>
  9876. (<CODE>picture-backward-clear-column</CODE>) replaces the preceding character
  9877. with a space rather than removing it.  <KBD>C-d</KBD>
  9878. (<CODE>picture-clear-column</CODE>) does the same in a forward direction.
  9879. <KBD>C-k</KBD> (<CODE>picture-clear-line</CODE>) really kills the contents of lines,
  9880. but never removes the newlines from a buffer.<A NAME="IDX1203"></A>
  9881.   To do actual insertion, you must use special commands.  <KBD>C-o</KBD>
  9882. (<CODE>picture-open-line</CODE>) creates a blank line, but does so after
  9883. the current line; it never splits a line.  <KBD>C-M-o</KBD>, <CODE>split-line</CODE>,
  9884. makes sense in Picture mode, so it remains unchanged.  <KBD>LFD</KBD>
  9885. (<CODE>picture-duplicate-line</CODE>) inserts another line
  9886. with the same contents below the current line.<A NAME="IDX1204"></A>
  9887. <A NAME="IDX1205"></A>
  9888.   To actually delete parts of the picture, use <KBD>C-w</KBD>, or with
  9889. <KBD>C-c C-d</KBD> (which is defined as <CODE>delete-char</CODE>, as <KBD>C-d</KBD> is
  9890. in other modes), or with one of the picture rectangle commands
  9891. (see section <A HREF="xEMACS.HTM#SEC240">Picture Mode Rectangle Commands</A>).
  9892. <H2><A NAME="SEC238" HREF="xEMACS_TO.HTM#SEC238">Controlling Motion After Insert</A></H2>
  9893. <A NAME="IDX1206"></A>
  9894. <A NAME="IDX1207"></A>
  9895. <A NAME="IDX1208"></A>
  9896. <A NAME="IDX1209"></A>
  9897. <A NAME="IDX1210"></A>
  9898. <A NAME="IDX1211"></A>
  9899. <A NAME="IDX1212"></A>
  9900. <A NAME="IDX1213"></A>
  9901. <A NAME="IDX1214"></A>
  9902. <A NAME="IDX1215"></A>
  9903. <A NAME="IDX1216"></A>
  9904. <A NAME="IDX1217"></A>
  9905. <A NAME="IDX1218"></A>
  9906. <A NAME="IDX1219"></A>
  9907. <A NAME="IDX1220"></A>
  9908. <A NAME="IDX1221"></A>
  9909.   Since "self-inserting" characters just overwrite and move point in
  9910. Picture mode, there is no essential restriction on how point should be
  9911. moved.  Normally point moves right, but you can specify any of the eight
  9912. orthogonal or diagonal directions for motion after a "self-inserting"
  9913. character.  This is useful for drawing lines in the buffer.
  9914. <DL COMPACT>
  9915. <DT><KBD>C-c <</KBD>
  9916. <DD>Move left after insertion (<CODE>picture-movement-left</CODE>).
  9917. <DT><KBD>C-c ></KBD>
  9918. <DD>Move right after insertion (<CODE>picture-movement-right</CODE>).
  9919. <DT><KBD>C-c ^</KBD>
  9920. <DD>Move up after insertion (<CODE>picture-movement-up</CODE>).
  9921. <DT><KBD>C-c .</KBD>
  9922. <DD>Move down after insertion (<CODE>picture-movement-down</CODE>).
  9923. <DT><KBD>C-c `</KBD>
  9924. <DD>Move up and left ("northwest") after insertion <BR>(<CODE>picture-movement-nw</CODE>).
  9925. <DT><KBD>C-c '</KBD>
  9926. <DD>Move up and right ("northeast") after insertion <BR>
  9927. (<CODE>picture-movement-ne</CODE>).
  9928. <DT><KBD>C-c /</KBD>
  9929. <DD>Move down and left ("southwest") after insertion
  9930. <BR>(<CODE>picture-movement-sw</CODE>).
  9931. <DT><KBD>C-c \</KBD>
  9932. <DD>Move down and right ("southeast") after insertion
  9933. <BR>(<CODE>picture-movement-se</CODE>).
  9934. </DL>
  9935. <A NAME="IDX1222"></A>
  9936. <A NAME="IDX1223"></A>
  9937. <A NAME="IDX1224"></A>
  9938. <A NAME="IDX1225"></A>
  9939.   Two motion commands move based on the current Picture insertion
  9940. direction.  The command <KBD>C-c C-f</KBD> (<CODE>picture-motion</CODE>) moves in the
  9941. same direction as motion after "insertion" currently does, while <KBD>C-c
  9942. C-b</KBD> (<CODE>picture-motion-reverse</CODE>) moves in the opposite direction.
  9943. <H2><A NAME="SEC239" HREF="xEMACS_TO.HTM#SEC239">Picture Mode Tabs</A></H2>
  9944. <A NAME="IDX1227"></A>
  9945. <A NAME="IDX1228"></A>
  9946. <A NAME="IDX1226"></A>
  9947.   Two kinds of tab-like action are provided in Picture mode.
  9948. Context-based tabbing is done with <KBD>M-<KBD>TAB</KBD></KBD>
  9949. (<CODE>picture-tab-search</CODE>).  With no argument, it moves to a point
  9950. underneath the next "interesting" character that follows whitespace in
  9951. the previous non-blank line.  "Next" here means "appearing at a
  9952. horizontal position greater than the one point starts out at".  With an
  9953. argument, as in <KBD>C-u M-<KBD>TAB</KBD></KBD>, the command moves to the next such
  9954. interesting character in the current line.  <KBD>M-<KBD>TAB</KBD></KBD> does not
  9955. change the text; it only moves point.  "Interesting" characters are
  9956. defined by the variable <CODE>picture-tab-chars</CODE>, which contains a string
  9957. of characters considered interesting.  Its default value is
  9958. <CODE>"!-~"</CODE>.<A NAME="IDX1229"></A>
  9959.   <KBD>TAB</KBD> itself runs <CODE>picture-tab</CODE>, which operates based on the
  9960. current tab stop settings; it is the Picture mode equivalent of
  9961. <CODE>tab-to-tab-stop</CODE>.  Without arguments it just moves point, but with
  9962. a numeric argument it clears the text that it moves over.
  9963. <A NAME="IDX1230"></A>
  9964. <A NAME="IDX1231"></A>
  9965.   The context-based and tab-stop-based forms of tabbing are brought
  9966. together by the command <KBD>C-c <KBD>TAB</KBD></KBD> (<CODE>picture-set-tab-stops</CODE>.)
  9967. This command sets the tab stops to the positions which <KBD>M-<KBD>TAB</KBD></KBD>
  9968. would consider significant in the current line.  If you use this command
  9969. with <KBD>TAB</KBD>, you can get the effect of context-based tabbing.  But
  9970. <KBD>M-<KBD>TAB</KBD></KBD> is more convenient in the cases where it is sufficient.
  9971. <A NAME="IDX1232"></A>
  9972. <H2><A NAME="SEC240" HREF="xEMACS_TO.HTM#SEC240">Picture Mode Rectangle Commands</A></H2>
  9973.   Picture mode defines commands for working on rectangular pieces of the
  9974. text in ways that fit with the quarter-plane model.  The standard rectangle
  9975. commands may also be useful (see section <A HREF="xEMACS.HTM#SEC83">Rectangles</A>).
  9976. <DL COMPACT>
  9977. <DT><KBD>C-c C-k</KBD>
  9978. <DD>Clear out the region-rectangle (<CODE>picture-clear-rectangle</CODE>).  With
  9979. argument, kill it.
  9980. <DT><KBD>C-c C-w <VAR>r</VAR></KBD>
  9981. <DD>Similar but save rectangle contents in register <VAR>r</VAR> first
  9982. (<CODE>picture-clear-rectangle-to-register</CODE>).
  9983. <DT><KBD>C-c C-y</KBD>
  9984. <DD>Copy last killed rectangle into the buffer by overwriting, with upper
  9985. left corner at point (<CODE>picture-yank-rectangle</CODE>).  With argument,
  9986. insert instead.
  9987. <DT><KBD>C-c C-x <VAR>r</VAR></KBD>
  9988. <DD>Similar, but use the rectangle in register <VAR>r</VAR><BR>
  9989. (<CODE>picture-yank-rectangle-from-register</CODE>).
  9990. </DL>
  9991. <A NAME="IDX1233"></A>
  9992. <A NAME="IDX1234"></A>
  9993. <A NAME="IDX1235"></A>
  9994. <A NAME="IDX1236"></A>
  9995.   The picture rectangle commands <KBD>C-c C-k</KBD>
  9996. (<CODE>picture-clear-rectangle</CODE>) and <KBD>C-c C-w</KBD>
  9997. (<CODE>picture-clear-rectangle-to-register</CODE>) differ from the standard
  9998. rectangle commands in that they normally clear the rectangle instead of
  9999. deleting it; this is analogous with the way <KBD>C-d</KBD> is changed in Picture
  10000. mode.<P>
  10001.   However, deletion of rectangles can be useful in Picture mode, so these
  10002. commands delete the rectangle if given a numeric argument.
  10003. <A NAME="IDX1237"></A>
  10004. <A NAME="IDX1238"></A>
  10005. <A NAME="IDX1239"></A>
  10006. <A NAME="IDX1240"></A>
  10007.   The Picture mode commands for yanking rectangles differ from the standard
  10008. ones in overwriting instead of inserting.  This is the same way that
  10009. Picture mode insertion of other text is different from other modes.
  10010. <KBD>C-c C-y</KBD> (<CODE>picture-yank-rectangle</CODE>) inserts (by overwriting) the
  10011. rectangle that was most recently killed, while <KBD>C-c C-x</KBD>
  10012. (<CODE>picture-yank-rectangle-from-register</CODE>) does for the
  10013. rectangle found in a specified register.
  10014. Since most region commands in Picture mode operate on rectangles, when you
  10015. select a region of text with the mouse in Picture mode, it is highlighted
  10016. as a rectangle.
  10017. <A NAME="IDX1241"></A>
  10018. <A NAME="IDX1242"></A>
  10019. <H1><A NAME="SEC241" HREF="xEMACS_TO.HTM#SEC241">Sending Mail</A></H1>
  10020.   To send a message in Emacs, start by typing the command (<KBD>C-x m</KBD>)
  10021. to select and initialize the <SAMP>`*mail*'</SAMP> buffer.  You can then edit the text
  10022. and headers of the message in the mail buffer, and type the command
  10023. (<KBD>C-c C-c</KBD>) to send the message.
  10024. <DL COMPACT>
  10025. <DT><KBD>C-x m</KBD>
  10026. <DD>Begin composing a message to send (<CODE>mail</CODE>).
  10027. <DT><KBD>C-x 4 m</KBD>
  10028. <DD>Likewise, but display the message in another window
  10029. (<CODE>mail-other-window</CODE>).
  10030. <DT><KBD>C-c C-c</KBD>
  10031. <DD>In Mail mode, send the message and switch to another buffer
  10032. (<CODE>mail-send-and-exit</CODE>).
  10033. </DL>
  10034. <A NAME="IDX1243"></A>
  10035. <A NAME="IDX1244"></A>
  10036. <A NAME="IDX1245"></A>
  10037. <A NAME="IDX1246"></A>
  10038.   The command <KBD>C-x m</KBD> (<CODE>mail</CODE>) selects a buffer named
  10039. <SAMP>`*mail*'</SAMP> and initializes it with the skeleton of an outgoing message.
  10040. <KBD>C-x 4 m</KBD> (<CODE>mail-other-window</CODE>) selects the <SAMP>`*mail*'</SAMP> buffer
  10041. in a different window, leaving the previous current buffer visible.<P>
  10042.   Because the buffer for mail composition is an ordinary Emacs buffer, you can
  10043. switch to other buffers while in the middle of composing mail, and switch
  10044. back later (or never).  If you use the <KBD>C-x m</KBD> command again when you
  10045. have been composing another message but have not sent it, a new mail
  10046. buffer will be created; in this way, you can compose multiple messages
  10047. at once.  You can switch back to and complete an unsent message by using
  10048. the normal buffer selection mechanisms.  
  10049. <KBD>C-u C-x m</KBD> is another way to switch back to a message in progress:
  10050. it will search for an existing, unsent mail message buffer and select it.
  10051. <H2><A NAME="SEC242" HREF="xEMACS_TO.HTM#SEC242">The Format of the Mail Buffer</A></H2>
  10052.   In addition to the <DFN>text</DFN> or contents, a message has <DFN>header
  10053. fields</DFN>, which say who sent it, when, to whom, why, and so on.  Some header
  10054. fields, such as the date and sender, are created automatically after the
  10055. message is sent.  Others, such as the recipient names, must be specified by
  10056. you in order to send the message properly.
  10057.   Mail mode provides a few commands to help you edit some header fields,
  10058. and some are preinitialized in the buffer automatically at times.  You can
  10059. insert or edit any header fields using ordinary editing commands.
  10060.   The line in the buffer that says:
  10061. <PRE>
  10062. --text follows this line--
  10063. </PRE>
  10064. <A NAME="IDX1247"></A>
  10065. is a special delimiter that separates the headers you have specified from
  10066. the text.  Whatever follows this line is the text of the message; the
  10067. headers precede it.  The delimiter line itself does not appear in the
  10068. message actually sent.  The text used for the delimiter line is controlled
  10069. by the variable <CODE>mail-header-separator</CODE>.
  10070. Here is an example of what the headers and text in the <SAMP>`*mail*'</SAMP> buffer
  10071. might look like.
  10072. <PRE>
  10073. To: rms@mc
  10074. CC: mly@mc, rg@oz
  10075. Subject: The Emacs Manual
  10076. --Text follows this line--
  10077. Please ignore this message.
  10078. </PRE>
  10079. <A NAME="IDX1248"></A>
  10080. <H2><A NAME="SEC243" HREF="xEMACS_TO.HTM#SEC243">Mail Header Fields</A></H2>
  10081.   There are several header fields you can use in the <SAMP>`*mail*'</SAMP> buffer.
  10082. Each header field starts with a field name at the beginning of a line,
  10083. terminated by a colon.  It does not matter whether you use upper or lower
  10084. case in the field name.  After the colon and optional whitespace comes the
  10085. contents of the field.
  10086. <DL COMPACT>
  10087. <DT><SAMP>`To'</SAMP>
  10088. <DD>This field contains the mailing addresses of the message.
  10089. <DT><SAMP>`Subject'</SAMP>
  10090. <DD>The contents of the <SAMP>`Subject'</SAMP> field should be a piece of text that
  10091. says what the message is about.  Subject fields are useful because most
  10092. mail-reading programs can provide a summary of messages, listing the
  10093. subject of each message but not its text.
  10094. <DT><SAMP>`CC'</SAMP>
  10095. <DD>This field contains additional mailing addresses to send the message
  10096. to, but whose readers should not regard the message as addressed to
  10097. them.
  10098. <DT><SAMP>`BCC'</SAMP>
  10099. <DD>This field contains additional mailing addresses to send the message
  10100. to, but which should not appear in the header of the message actually
  10101. sent.
  10102. <DT><SAMP>`FCC'</SAMP>
  10103. <DD>This field contains the name of one file (in Unix mail file format) to
  10104. which a copy of the message should be appended when the message is
  10105. sent.
  10106. <DT><SAMP>`From'</SAMP>
  10107. <DD>Use the <SAMP>`From'</SAMP> field to say who you are, when the account you are
  10108. using to send the mail is not your own.  The contents of the
  10109. <SAMP>`From'</SAMP> field should be a valid mailing address, since replies
  10110. will normally go there.
  10111. <DT><SAMP>`Reply-To'</SAMP>
  10112. <DD>Use the <SAMP>`Reply-To'</SAMP> field to direct replies to a different
  10113. address, not your own. <SAMP>`From'</SAMP> and
  10114. <SAMP>`Reply-To'</SAMP> have the same effect on where replies go, but they convey a
  10115. different meaning to the person who reads the message.
  10116. <DT><SAMP>`In-Reply-To'</SAMP>
  10117. <DD>This field contains a piece of text describing a message you are
  10118. replying to.  Some mail systems can use the information to correlate
  10119. related pieces of mail.  Normally this field is filled in by Rmail
  10120. when you are replying to a message in Rmail, and you never need to
  10121. think about it (see section <A HREF="xEMACS.HTM#SEC245">Reading Mail With Rmail</A>).
  10122. </DL>
  10123. The <SAMP>`To'</SAMP>, <SAMP>`CC'</SAMP>, <SAMP>`BCC'</SAMP> and <SAMP>`FCC'</SAMP> fields can appear
  10124. any number of times, to specify many places to send the message.
  10125. The <SAMP>`To'</SAMP>, <SAMP>`CC'</SAMP>, and <SAMP>`BCC'</SAMP>, fields can have continuation
  10126. lines.  All the lines starting with whitespace, following the line on
  10127. which the field starts, are considered part of the field.  For
  10128. example,<P>
  10129. <PRE>
  10130. To: foo@here, this@there,
  10131.   me@gnu.cambridge.mass.usa.earth.spiral3281
  10132. </PRE>
  10133. <A NAME="IDX1249"></A>
  10134. If you have a <TT>`~/.mailrc'</TT> file, Emacs scans it for mail aliases the
  10135. first time you try to send mail in an Emacs session.  Emacs expands
  10136. aliases found in the <SAMP>`To'</SAMP>, <SAMP>`CC'</SAMP>, and <SAMP>`BCC'</SAMP> fields where
  10137. appropriate. You can set the variable <CODE>mail-abbrev-mailrc-file</CODE> to
  10138. the name of the file with mail aliases.  If <CODE>nil</CODE>, <TT>`~/.mailrc'</TT>
  10139. is used.
  10140. <A NAME="IDX1250"></A>
  10141. Your <TT>`.mailrc'</TT> file ensures that word-abbrevs are defined for each
  10142. of your mail aliases when point is in a <SAMP>`To'</SAMP>, <SAMP>`CC'</SAMP>,
  10143. <SAMP>`BCC'</SAMP>, or <SAMP>`From'</SAMP> field.  The aliases are defined in your
  10144. <TT>`.mailrc'</TT> file or in a file specified by the <B>MAILRC</B>
  10145. environment variable if it exists.  Your mail aliases expand any time
  10146. you type a word-delimiter at the end of an abbreviation.
  10147. In this version of Emacs, what you see is what you get: in contrast to
  10148. some other versions, no abbreviations are expanded after you have sent the
  10149. mail.  This means you don't suffer the annoyance of having the system do
  10150. things behind your back -- if the system rewrites an address you typed,
  10151. you know it immediately, instead of after the mail has been sent and
  10152. it's too late to do anything about it.  For example, you will never
  10153. again be in trouble because you forgot to delete an old alias from your
  10154. <TT>`.mailrc'</TT> and a new local user is given a userid which conflicts
  10155. with one of your aliases.
  10156. <A NAME="IDX1251"></A>
  10157. Your mail alias abbrevs are in effect only when point is in an
  10158. appropriate header field. The mail aliases will not expand in the body
  10159. of the message, or in other header fields.  The default mode-specific
  10160. abbrev table <CODE>mail-mode-abbrev-table</CODE> is used instead if defined.
  10161. That means if you have been using mail-mode specific abbrevs, this code
  10162. will not adversely affect you.  You can control which header fields the
  10163. abbrevs are used in by changing the variable <CODE>mail-abbrev-mode-regexp</CODE>.
  10164. If auto-fill mode is on, abbrevs wrap at commas instead of at word
  10165. boundaries, and header continuation lines will be properly indented.
  10166. <A NAME="IDX1252"></A>
  10167. You can also insert a mail alias with <CODE>mail-interactive-insert-alias</CODE>.
  10168. This function, which is bound to <KBD>C-c C-a</KBD>, prompts you for an alias
  10169. (with completion) and inserts its expansion at point.
  10170. In this version of Emacs, it is possible to have lines like the
  10171. following in your <TT>`.mailrc'</TT> file:
  10172. <PRE>
  10173.      alias someone "John Doe <doe@quux.com>"
  10174. </PRE>
  10175. That is, if you want an address to have embedded spaces, simply surround
  10176. it with double-quotes.  The quotes are necessary because the format of
  10177. the <TT>`.mailrc'</TT> file uses spaces as address delimiters.  
  10178. Aliases in the <TT>`.mailrc'</TT> file may be nested. For example, assume
  10179. you define aliases like:
  10180. <PRE>
  10181.      alias group1 fred ethel
  10182.      alias group2 larry curly moe
  10183.      alias everybody group1 group2
  10184. </PRE>
  10185. When you now type <SAMP>`everybody'</SAMP> on the <SAMP>`To'</SAMP> line, it will expand to:
  10186. <PRE>
  10187.      fred, ethyl, larry, curly, moe
  10188. </PRE>
  10189. Aliases may contain forward references; the alias of <SAMP>`everybody'</SAMP> in the
  10190. example above can preceed the aliases of <SAMP>`group1'</SAMP> and <SAMP>`group2'</SAMP>.
  10191. In this version of Emacs, you can use the <CODE>source</CODE> <TT>`.mailrc'</TT> command
  10192. for reading aliases from some other file as well.
  10193. Aliases may contain hyphens, as in <CODE>"alias foo-bar foo@bar"</CODE>, even
  10194. though word-abbrevs normally cannot contain hyphens.
  10195. To read in the contents of another <TT>`.mailrc'</TT>-type file from Emacs, use the
  10196. command <CODE>M-x merge-mail-aliases</CODE>.  The <CODE>rebuild-mail-aliases</CODE>
  10197. command is similar, but deletes existing aliases first.
  10198. <A NAME="IDX1253"></A>
  10199. If you want multiple addresses separated by a string other than <SAMP>`,'</SAMP>
  10200. (a comma), then set the variable <CODE>mail-alias-seperator-string</CODE> to
  10201. it.  This has to be a comma bracketed by whitespace if you want any kind
  10202.  of reasonable behavior.
  10203. <A NAME="IDX1254"></A>
  10204.   If the variable <CODE>mail-archive-file-name</CODE> is non-<CODE>nil</CODE>, it
  10205. should be a string naming a file.  Each time you start to edit a message
  10206. to send, an <SAMP>`FCC'</SAMP> field is entered for that file.  Unless you
  10207. remove the <SAMP>`FCC'</SAMP> field, every message is written into that
  10208. file when it is sent.
  10209. <H2><A NAME="SEC244" HREF="xEMACS_TO.HTM#SEC244">Mail Mode</A></H2>
  10210.   The major mode used in the <SAMP>`*mail*'</SAMP> buffer is Mail mode.  Mail
  10211. mode is similar to Text mode, but several commands are provided on
  10212. the <KBD>C-c</KBD> prefix.  These commands all deal specifically with
  10213. editing or sending the message.
  10214. <DL COMPACT>
  10215. <DT><KBD>C-c C-s</KBD>
  10216. <DD>Send the message, and leave the <SAMP>`*mail*'</SAMP> buffer selected
  10217. (<CODE>mail-send</CODE>).
  10218. <DT><KBD>C-c C-c</KBD>
  10219. <DD>Send the message, and select some other buffer (<CODE>mail-send-and-exit</CODE>).
  10220. <DT><KBD>C-c C-f C-t</KBD>
  10221. <DD>Move to the <SAMP>`To'</SAMP> header field, creating one if there is none
  10222. (<CODE>mail-to</CODE>).
  10223. <DT><KBD>C-c C-f C-s</KBD>
  10224. <DD>Move to the <SAMP>`Subject'</SAMP> header field, creating one if there is
  10225. none (<CODE>mail-subject</CODE>).
  10226. <DT><KBD>C-c C-f C-c</KBD>
  10227. <DD>Move to the <SAMP>`CC'</SAMP> header field, creating one if there is none
  10228. (<CODE>mail-cc</CODE>).
  10229. <DT><KBD>C-c C-w</KBD>
  10230. <DD>Insert the file <TT>`~/.signature'</TT> at the end of the message text
  10231. (<CODE>mail-signature</CODE>).
  10232. <DT><KBD>C-c C-y</KBD>
  10233. <DD>Yank the selected message from Rmail (<CODE>mail-yank-original</CODE>).
  10234. This command does nothing unless your command to start sending a
  10235. message was issued with Rmail.
  10236. <DT><KBD>C-c C-q</KBD>
  10237. <DD>Fill all paragraphs of yanked old messages, each individually
  10238. (<CODE>mail-fill-yanked-message</CODE>).
  10239. <DT><KBD><KBD>button3</KBD></KBD>
  10240. <DD>Pops up a menu of useful mail-mode commands.
  10241. </DL>
  10242. <A NAME="IDX1255"></A>
  10243. <A NAME="IDX1256"></A>
  10244. <A NAME="IDX1257"></A>
  10245. <A NAME="IDX1258"></A>
  10246.   There are two ways to send a message.  <KBD>C-c C-c</KBD>
  10247. (<CODE>mail-send-and-exit</CODE>) is the usual way to send the message.  It
  10248. sends the message and then deletes the window (if there is another
  10249. window) or switches to another buffer.  It puts the <SAMP>`*mail*'</SAMP> buffer
  10250. at the lowest priority for automatic reselection, since you are finished
  10251. with using it.  <KBD>C-c C-s</KBD> (<CODE>mail-send</CODE>) sends the
  10252. message and marks the <SAMP>`*mail*'</SAMP> buffer unmodified, but leaves that
  10253. buffer selected so that you can modify the message (perhaps with new
  10254. recipients) and send it again.
  10255. <A NAME="IDX1259"></A>
  10256. <A NAME="IDX1260"></A>
  10257. <A NAME="IDX1261"></A>
  10258. <A NAME="IDX1262"></A>
  10259. <A NAME="IDX1263"></A>
  10260. <A NAME="IDX1264"></A>
  10261.   Mail mode provides some other special commands that are useful for
  10262. editing the headers and text of the message before you send it.  There are
  10263. three commands defined to move point to particular header fields, all based
  10264. on the prefix <KBD>C-c C-f</KBD> (<SAMP>`C-f'</SAMP> is for "field").  They are
  10265. <KBD>C-c C-f C-t</KBD> (<CODE>mail-to</CODE>) to move to the <SAMP>`To'</SAMP> field, <KBD>C-c
  10266. C-f C-s</KBD> (<CODE>mail-subject</CODE>) for the <SAMP>`Subject'</SAMP> field, and <KBD>C-c
  10267. C-f C-c</KBD> (<CODE>mail-cc</CODE>) for the <SAMP>`CC'</SAMP> field.  These fields have
  10268. special motion commands because they are edited most frequently. 
  10269. <A NAME="IDX1265"></A>
  10270. <A NAME="IDX1266"></A>
  10271.   <KBD>C-c C-w</KBD> (<CODE>mail-signature</CODE>) adds a standard piece of text at
  10272. the end of the message to say more about who you are.  The text comes
  10273. from the file <TT>`.signature'</TT> in your home directory.
  10274. <A NAME="IDX1267"></A>
  10275. <A NAME="IDX1268"></A>
  10276.   When you use an Rmail command to send mail from the Rmail mail reader,
  10277. you can use <KBD>C-c C-y</KBD> <CODE>mail-yank-original</CODE> inside the
  10278. <SAMP>`*mail*'</SAMP> buffer to insert the
  10279. text of the message you are replying to.  Normally Rmail indents each line
  10280. of that message four spaces and eliminates most header fields.  A
  10281. numeric argument specifies the number of spaces to indent.  An argument
  10282. of just <KBD>C-u</KBD> says not to indent at all and not to eliminate
  10283. anything.  <KBD>C-c C-y</KBD> always uses the current message from the
  10284. <SAMP>`RMAIL'</SAMP> buffer, so you can insert several old messages by selecting
  10285. one in <SAMP>`RMAIL'</SAMP>, switching to <SAMP>`*mail*'</SAMP> and yanking it, then
  10286. switching back to <SAMP>`RMAIL'</SAMP> to select another.<A NAME="IDX1269"></A>
  10287. <A NAME="IDX1270"></A>
  10288.   After using <KBD>C-c C-y</KBD>, you can use the command <KBD>C-c C-q</KBD>
  10289. (<CODE>mail-fill-yanked-message</CODE>) to fill the paragraphs of the yanked
  10290. old message or messages.  One use of <KBD>C-c C-q</KBD> fills all such
  10291. paragraphs, each one separately.
  10292.   Clicking the right mouse button in a mail buffer pops up a menu of
  10293. the above commands, for easy access.
  10294. <A NAME="IDX1271"></A>
  10295.   Turning on Mail mode (which <KBD>C-x m</KBD> does automatically) calls the
  10296. value of <CODE>text-mode-hook</CODE>, if it is not void or <CODE>nil</CODE>, and
  10297. then calls the value of <CODE>mail-mode-hook</CODE> if that is not void or
  10298. <CODE>nil</CODE>.
  10299. <A NAME="IDX1272"></A>
  10300. <A NAME="IDX1273"></A>
  10301. <A NAME="IDX1274"></A>
  10302. <H1><A NAME="SEC245" HREF="xEMACS_TO.HTM#SEC245">Reading Mail With Rmail</A></H1>
  10303.   Rmail is an Emacs subsystem for reading and disposing of mail that you
  10304. receive.  Rmail stores mail messages in files called Rmail files.  You read
  10305. the messages in an Rmail file in a special major mode, Rmail mode,
  10306. which redefines most letters to run commands for managing mail.  To enter
  10307. Rmail, type <KBD>M-x rmail</KBD>.  This reads your primary mail file, merges
  10308. new mail in from your inboxes, displays the first new message, and lets
  10309. you begin reading.
  10310. <A NAME="IDX1275"></A>
  10311.   Using Rmail in the simplest fashion, you have one Rmail file,
  10312. <TT>`~/RMAIL'</TT>, in which all of your mail is saved.  It is called your
  10313. <DFN>primary mail file</DFN>.  You can also copy messages into other Rmail
  10314. files and then edit those files with Rmail.
  10315.   Rmail displays only one message at a time.  It is called the
  10316. <DFN>current message</DFN>.  Rmail mode's special commands can move to
  10317. another message, delete the message, copy the message into another file,
  10318. or send a reply.
  10319. <A NAME="IDX1276"></A>
  10320.   Within the Rmail file, messages are arranged sequentially in order
  10321. of receipt.  They are also assigned consecutive integers as their
  10322. <DFN>message numbers</DFN>.  The number of the current message is displayed
  10323. in Rmail's mode line, followed by the total number of messages in the
  10324. file.  You can move to a message by specifying its message number
  10325. using the <KBD>j</KBD> key (see section <A HREF="xEMACS.HTM#SEC247">Moving Among Messages</A>).
  10326. <A NAME="IDX1277"></A>
  10327. <A NAME="IDX1278"></A>
  10328.   Following the usual conventions of Emacs, changes in an Rmail file become
  10329. permanent only when the file is saved.  You can do this with <KBD>s</KBD>
  10330. (<CODE>rmail-save</CODE>), which also expunges deleted messages from the file
  10331. first (see section <A HREF="xEMACS.HTM#SEC248">Deleting Messages</A>).  To save the file without expunging, use
  10332. <KBD>C-x C-s</KBD>.  Rmail saves the Rmail file automatically when moving new
  10333. mail from an inbox file (see section <A HREF="xEMACS.HTM#SEC249">Rmail Files and Inboxes</A>).
  10334. <A NAME="IDX1279"></A>
  10335. <A NAME="IDX1280"></A>
  10336.   You can exit Rmail with <KBD>q</KBD> (<CODE>rmail-quit</CODE>); this expunges and
  10337. saves the Rmail file and then switches to another buffer.  However, there is
  10338. no need to `exit' formally.  If you switch from Rmail to editing in
  10339. other buffers, and never happen to switch back, you have exited.  Just
  10340. make sure to save the Rmail file eventually (like any other file you
  10341. have changed).  <KBD>C-x s</KBD> is a good enough way to do this
  10342. (see section <A HREF="xEMACS.HTM#SEC115">Saving Files</A>).
  10343. <H2><A NAME="SEC246" HREF="xEMACS_TO.HTM#SEC246">Scrolling Within a Message</A></H2>
  10344.   When Rmail displays a message that does not fit on the screen, you
  10345. have to scroll through it.  You could use <KBD>C-v</KBD>, <KBD>M-v</KBD>,
  10346. and <KBD>M-<</KBD>, but scrolling is so frequent in Rmail that it deserves to be
  10347. easier to type.
  10348. <DL COMPACT>
  10349. <DT><KBD><KBD>SPC</KBD></KBD>
  10350. <DD>Scroll forward (<CODE>scroll-up</CODE>).
  10351. <DT><KBD><KBD>DEL</KBD></KBD>
  10352. <DD>Scroll backward (<CODE>scroll-down</CODE>).
  10353. <DT><KBD>.</KBD>
  10354. <DD>Scroll to start of message (<CODE>rmail-beginning-of-message</CODE>).
  10355. </DL>
  10356. <A NAME="IDX1281"></A>
  10357. <A NAME="IDX1282"></A>
  10358.   Since the most common thing to do while reading a message is to scroll
  10359. through it by screenfuls, Rmail makes <KBD>SPC</KBD> and <KBD>DEL</KBD> synonyms of
  10360. <KBD>C-v</KBD> (<CODE>scroll-up</CODE>) and <KBD>M-v</KBD> (<CODE>scroll-down</CODE>)
  10361. <A NAME="IDX1283"></A>
  10362. <A NAME="IDX1284"></A>
  10363.   The command <KBD>.</KBD> (<CODE>rmail-beginning-of-message</CODE>) scrolls back to the
  10364. beginning of a selected message.  This is not quite the same as <KBD>M-<</KBD>:
  10365. first, it does not set the mark; secondly, it resets the buffer
  10366. boundaries to the current message if you have changed them.
  10367. <H2><A NAME="SEC247" HREF="xEMACS_TO.HTM#SEC247">Moving Among Messages</A></H2>
  10368.   The most basic thing to do with a message is to read it.  The way to
  10369. do this in Rmail is to make the message current.  You can make any
  10370. message current, given its message number, by using the <KBD>j</KBD> command, but
  10371. people most often move sequentially through the file, since this is the
  10372. order of receipt of messages.  When you enter Rmail, you are positioned
  10373. at the first new message (new messages are those received after you last
  10374. used Rmail), or at the last message if there are no new messages this
  10375. time.  Move forward to see other new messages if there are any; move
  10376. backward to re-examine old messages.
  10377. <DL COMPACT>
  10378. <DT><KBD>n</KBD>
  10379. <DD>Move to the next non-deleted message, skipping any intervening deleted <BR>
  10380. messages (<CODE>rmail-next-undeleted-message</CODE>).
  10381. <DT><KBD>p</KBD>
  10382. <DD>Move to the previous non-deleted message <BR>
  10383. (<CODE>rmail-previous-undeleted-message</CODE>).
  10384. <DT><KBD>M-n</KBD>
  10385. <DD>Move to the next message, including deleted messages
  10386. (<CODE>rmail-next-message</CODE>).
  10387. <DT><KBD>M-p</KBD>
  10388. <DD>Move to the previous message, including deleted messages
  10389. (<CODE>rmail-previous-message</CODE>).
  10390. <DT><KBD>j</KBD>
  10391. <DD>Move to the first message.  With argument <VAR>n</VAR>, move to
  10392. message number <VAR>n</VAR> (<CODE>rmail-show-message</CODE>).
  10393. <DT><KBD>></KBD>
  10394. <DD>Move to the last message (<CODE>rmail-last-message</CODE>).
  10395. <DT><KBD>M-s <VAR>regexp</VAR> <KBD>RET</KBD></KBD>
  10396. <DD>Move to the next message containing a match for <VAR>regexp</VAR>
  10397. (<CODE>rmail-search</CODE>).  If <VAR>regexp</VAR> is empty, the last regexp used is
  10398. used again.
  10399. <DT><KBD>- M-s <VAR>regexp</VAR> <KBD>RET</KBD></KBD>
  10400. <DD>Move to the previous message containing a match for <VAR>regexp</VAR>.
  10401. If <VAR>regexp</VAR> is empty, the last regexp used is used again.
  10402. </DL>
  10403. <A NAME="IDX1285"></A>
  10404. <A NAME="IDX1286"></A>
  10405. <A NAME="IDX1287"></A>
  10406. <A NAME="IDX1288"></A>
  10407. <A NAME="IDX1289"></A>
  10408. <A NAME="IDX1290"></A>
  10409. <A NAME="IDX1291"></A>
  10410. <A NAME="IDX1292"></A>
  10411.   To move among messages in Rmail, you can use <KBD>n</KBD> and <KBD>p</KBD>.
  10412. These keys move through the messages sequentially but skip over deleted
  10413. messages, which is usually what you want to do.  Their command
  10414. definitions are named <CODE>rmail-next-undeleted-message</CODE> and
  10415. <CODE>rmail-previous-undeleted-message</CODE>.  If you do not want to skip
  10416. deleted messages--for example, if you want to move to a message to
  10417. undelete it--use the variants <KBD>M-n</KBD> (<CODE>rmail-next-message</CODE>) and
  10418. <KBD>M-p</KBD> (<CODE>rmail-previous-message</CODE>).  A numeric argument to any of
  10419. these commands serves as a repeat count.<P>
  10420.   In Rmail, you can specify a numeric argument by just typing the digits.
  10421. It is not necessary to type <KBD>C-u</KBD> first.
  10422. <A NAME="IDX1293"></A>
  10423. <A NAME="IDX1294"></A>
  10424.   The <KBD>M-s</KBD> (<CODE>rmail-search</CODE>) command is Rmail's version of
  10425. search.  The usual incremental search command <KBD>C-s</KBD> works in Rmail,
  10426. but searches only within the current message.  The purpose of <KBD>M-s</KBD>
  10427. is to search for another message.  It reads a regular expression
  10428. (see section <A HREF="xEMACS.HTM#SEC99">Syntax of Regular Expressions</A>) non-incrementally, then starts searching at the
  10429. beginning of the following message for a match.  The message containing
  10430. the match is selected.
  10431.   To search backward in the file for another message, give <KBD>M-s</KBD> a
  10432. negative argument.  In Rmail you can do this with <KBD>- M-s</KBD>.
  10433.   It is also possible to search for a message based on labels.
  10434. See section <A HREF="xEMACS.HTM#SEC252">Labels</A>.
  10435. <A NAME="IDX1295"></A>
  10436. <A NAME="IDX1296"></A>
  10437. <A NAME="IDX1297"></A>
  10438. <A NAME="IDX1298"></A>
  10439.   To move to a message specified by absolute message number, use <KBD>j</KBD>
  10440. (<CODE>rmail-show-message</CODE>) with the message number as argument.  With
  10441. no argument, <KBD>j</KBD> selects the first message.  <KBD>></KBD>
  10442. (<CODE>rmail-last-message</CODE>) selects the last message.
  10443. <H2><A NAME="SEC248" HREF="xEMACS_TO.HTM#SEC248">Deleting Messages</A></H2>
  10444. <A NAME="IDX1299"></A>
  10445.   When you no longer need to keep a message, you can <DFN>delete</DFN> it.  This
  10446. flags it as ignorable, and some Rmail commands will pretend it is no longer
  10447. present, but it still has its place in the Rmail file and still has its
  10448. message number.
  10449. <A NAME="IDX1300"></A>
  10450.   <DFN>Expunging</DFN> the Rmail file actually removes the deleted messages.
  10451. The remaining messages are renumbered consecutively.  Expunging is the only
  10452. action that changes the message number of any message, except for
  10453. undigestifying (see section <A HREF="xEMACS.HTM#SEC258">Digest Messages</A>).
  10454. <DL COMPACT>
  10455. <DT><KBD>d</KBD>
  10456. <DD>Delete the current message and move to the next non-deleted message
  10457. (<CODE>rmail-delete-forward</CODE>).
  10458. <DT><KBD>C-d</KBD>
  10459. <DD>Delete the current message and move to the previous non-deleted
  10460. message (<CODE>rmail-delete-backward</CODE>).
  10461. <DT><KBD>u</KBD>
  10462. <DD>Undelete the current message, or move back to a deleted message and
  10463. undelete it (<CODE>rmail-undelete-previous-message</CODE>).
  10464. <DT><KBD>e</KBD>
  10465. <DD><DT><KBD>x</KBD>
  10466. <DD>Expunge the Rmail file (<CODE>rmail-expunge</CODE>).  These two
  10467. commands are synonyms.
  10468. </DL>
  10469. <A NAME="IDX1301"></A>
  10470. <A NAME="IDX1302"></A>
  10471. <A NAME="IDX1303"></A>
  10472. <A NAME="IDX1304"></A>
  10473.   There are two Rmail commands for deleting messages.  Both delete the
  10474. current message and select another message.  <KBD>d</KBD>
  10475. (<CODE>rmail-delete-forward</CODE>) moves to the following message, skipping
  10476. messages already deleted, while <KBD>C-d</KBD> (<CODE>rmail-delete-backward</CODE>)
  10477. moves to the previous non-deleted message.  If there is no non-deleted
  10478. message to move to in the specified direction, the message that was just
  10479. deleted remains current.
  10480. <A NAME="IDX1305"></A>
  10481. <A NAME="IDX1306"></A>
  10482. <A NAME="IDX1307"></A>
  10483.   To make all deleted messages disappear from the Rmail file, type
  10484. <KBD>e</KBD> (<CODE>rmail-expunge</CODE>).  Until you do this, you can still
  10485. <DFN>undelete</DFN> the deleted messages.
  10486. <A NAME="IDX1308"></A>
  10487. <A NAME="IDX1309"></A>
  10488.   To undelete, type
  10489. <KBD>u</KBD> (<CODE>rmail-undelete-previous-message</CODE>), which cancels the
  10490. effect of a <KBD>d</KBD> command (usually).  It undeletes the current message
  10491. if the current message is deleted.  Otherwise it moves backward to previous
  10492. messages until a deleted message is found, and undeletes that message.
  10493.   You can usually undo a <KBD>d</KBD> with a <KBD>u</KBD> because the <KBD>u</KBD>
  10494. moves back to and undeletes the message that the <KBD>d</KBD> deleted.  This
  10495. does not work when the <KBD>d</KBD> skips a few already-deleted messages that
  10496. follow the message being deleted; in that case the <KBD>u</KBD> command
  10497. undeletes the last of the messages that were skipped.  There is no clean
  10498. way to avoid this problem.  However, by repeating the <KBD>u</KBD> command,
  10499. you can eventually get back to the message you intended to
  10500. undelete.  You can also reach that message with <KBD>M-p</KBD> commands and
  10501. then type <KBD>u</KBD>.<P>
  10502.   A deleted message has the <SAMP>`deleted'</SAMP> attribute, and as a result
  10503. <SAMP>`deleted'</SAMP> appears in the mode line when the current message is
  10504. deleted.  In fact, deleting or undeleting a message is nothing more than
  10505. adding or removing this attribute.  See section <A HREF="xEMACS.HTM#SEC252">Labels</A>.
  10506. <A NAME="IDX1310"></A>
  10507. <H2><A NAME="SEC249" HREF="xEMACS_TO.HTM#SEC249">Rmail Files and Inboxes</A></H2>
  10508.   Unix places your incoming mail in a file called your <DFN>inbox</DFN>.
  10509. When you start up Rmail, it copies the new messages from your inbox into
  10510. your primary mail file, an Rmail file which also contains other messages
  10511. saved from previous Rmail sessions.  In this file, you actually
  10512. read the mail with Rmail.  The operation is called <DFN>getting new mail</DFN>.
  10513. You can repeat it at any time using the <KBD>g</KBD> key in Rmail.  The inbox
  10514. file name is <TT>`/usr/spool/mail/<VAR>username</VAR>'</TT> in Berkeley Unix,
  10515. <TT>`/usr/mail/<VAR>username</VAR>'</TT> in system V.
  10516.   There are two reason for having separate Rmail files and inboxes.
  10517. The format in which Unix delivers the mail in the inbox is not
  10518. adequate for Rmail mail storage.  It has no way to record attributes
  10519. (such as <SAMP>`deleted'</SAMP>) or user-specified labels; it has no way to record
  10520. old headers and reformatted headers; it has no way to record cached
  10521. summary line information.
  10522. It is very cumbersome to access an inbox file without danger of losing
  10523. mail, because it is necessary to interlock with mail delivery.
  10524. Moreover, different Unix systems use different interlocking
  10525. techniques.  The strategy of moving mail out of the inbox once and for
  10526. all into a separate Rmail file avoids the need for interlocking in all
  10527. the rest of Rmail, since only Rmail operates on the Rmail file.
  10528. </OL>
  10529.   When getting new mail, Rmail first copies the new mail from the inbox
  10530. file to the Rmail file and saves the Rmail file.  It then deletes the
  10531. inbox file.  This way a system crash may cause duplication of mail between
  10532. the inbox and the Rmail file, but it cannot lose mail.
  10533.   Copying mail from an inbox in the system's mailer directory actually puts
  10534. it in an intermediate file, <TT>`~/.newmail'</TT>.  This is because the
  10535. interlocking is done by a C program that copies to another file.
  10536. <TT>`~/.newmail'</TT> is deleted after mail merging is successful.  If there is
  10537. a crash at the wrong time, this file will continue to exist and will be
  10538. used as an inbox the next time you get new mail.
  10539. <H2><A NAME="SEC250" HREF="xEMACS_TO.HTM#SEC250">Multiple Mail Files</A></H2>
  10540.   Rmail operates by default on your <DFN>primary mail file</DFN>, which is
  10541. named <TT>`~/RMAIL'</TT> and which receives your incoming mail from your
  10542. system inbox file. You can also have other mail files and edit them with
  10543. Rmail.  These files can receive mail through their own inboxes, or you
  10544. can move messages into them by explicit command in Rmail (see section <A HREF="xEMACS.HTM#SEC251">Copying Messages Out to Files</A>).
  10545. <DL COMPACT>
  10546. <DT><KBD>i <VAR>file</VAR> <KBD>RET</KBD></KBD>
  10547. <DD>Read <VAR>file</VAR> into Emacs and run Rmail on it (<CODE>rmail-input</CODE>).
  10548. <DT><KBD>M-x set-rmail-inbox-list <KBD>RET</KBD> <VAR>files</VAR> <KBD>RET</KBD></KBD>
  10549. <DD>Specify inbox file names for current Rmail file to get mail from.
  10550. <DT><KBD>g</KBD>
  10551. <DD>Merge new mail from current Rmail file's inboxes
  10552. (<CODE>rmail-get-new-mail</CODE>).
  10553. <DT><KBD>C-u g <VAR>file</VAR></KBD>
  10554. <DD>Merge new mail from inbox file <VAR>file</VAR>.
  10555. </DL>
  10556. <A NAME="IDX1311"></A>
  10557. <A NAME="IDX1312"></A>
  10558.   To run Rmail on a file other than your primary mail file, you may use
  10559. the <KBD>i</KBD> (<CODE>rmail-input</CODE>) command in Rmail.  This visits the
  10560. file, puts it in Rmail mode, and then gets new mail from the file's
  10561. inboxes if any.  You can also use <KBD>M-x rmail-input</KBD> even when not in
  10562. Rmail.
  10563.   The file you read with <KBD>i</KBD> does not have to be in Rmail file format.
  10564. It could also be Unix mail format, mmdf format, or it could be a mixture
  10565. of all three, as long as each message has one of the three formats.
  10566. Rmail recognizes all three and converts all the messages to proper Rmail
  10567. format before showing you the file.
  10568. <A NAME="IDX1313"></A>
  10569.   Each Rmail file can contain a list of inbox file names; you can specify
  10570. this list with <KBD>M-x set-rmail-inbox-list <KBD>RET</KBD> <VAR>files</VAR>
  10571. <KBD>RET</KBD></KBD>.  The argument can contain any number of file names, separated
  10572. by commas.  It can also be empty, which specifies that this file should
  10573. have no inboxes.  Once a list of inboxes is specified, the Rmail file
  10574. remembers it permanently until it is explicitly changed.<A NAME="IDX1314"></A>
  10575. <A NAME="IDX1315"></A>
  10576.   If an Rmail file has inboxes, new mail is merged in from the inboxes
  10577. when you bring the Rmail file into Rmail, and when you use the <KBD>g</KBD>
  10578. (<CODE>rmail-get-new-mail</CODE>) command.  If the Rmail file
  10579. specifies no inboxes, then no new mail is merged in at these times.  A
  10580. special exception is made for your primary mail file: Rmail uses the
  10581. standard system inbox for it if it does not specify an inbox.
  10582.   To merge mail from a file that is not the usual inbox, give the
  10583. <KBD>g</KBD> key a numeric argument, as in <KBD>C-u g</KBD>.  Rmail prompts you
  10584. for a file name and merges mail from that file.  The inbox file is not
  10585. deleted or changed at all when you use <KBD>g</KBD> with an argument, so this
  10586. is a general way of merging one file of messages into another.
  10587. <H2><A NAME="SEC251" HREF="xEMACS_TO.HTM#SEC251">Copying Messages Out to Files</A></H2>
  10588. <DL COMPACT>
  10589. <DT><KBD>o <VAR>file</VAR> <KBD>RET</KBD></KBD>
  10590. <DD>Append a copy of the current message to the file <VAR>file</VAR>,
  10591. writing it in Rmail file format (<CODE>rmail-output-to-rmail-file</CODE>).
  10592. <DT><KBD>C-o <VAR>file</VAR> <KBD>RET</KBD></KBD>
  10593. <DD>Append a copy of the current message to the file <VAR>file</VAR>,
  10594. writing it in Unix mail file format (<CODE>rmail-output</CODE>).
  10595. </DL>
  10596. <A NAME="IDX1316"></A>
  10597. <A NAME="IDX1317"></A>
  10598. <A NAME="IDX1318"></A>
  10599. <A NAME="IDX1319"></A>
  10600.   If an Rmail file has no inboxes, use explicit <KBD>o</KBD> commands to
  10601. write Rmail files.
  10602.   <KBD>o</KBD> (<CODE>rmail-output-to-rmail-file</CODE>) appends the current
  10603. message in Rmail format to the end of a specified file.  This is the
  10604. best command to use to move messages between Rmail files.  If you are
  10605. currently visiting the other Rmail file, copying is done into the other
  10606. file's Emacs buffer instead.  You should eventually save the buffer on
  10607. disk.
  10608.   The <KBD>C-o</KBD> (<CODE>rmail-output</CODE>) command in Rmail appends a copy of
  10609. the current message to a specified file, in Unix mail file format.  This
  10610. is useful for moving messages into files to be read by other mail
  10611. processors that do not understand Rmail format.
  10612.   Copying a message with <KBD>o</KBD> or <KBD>C-o</KBD> gives the original copy of the
  10613. message the <SAMP>`filed'</SAMP> attribute. <SAMP>`filed'</SAMP> appears in the mode
  10614. line when such a message is current.
  10615.   Normally you should use only <KBD>o</KBD> to output messages to other Rmail
  10616. files, never <KBD>C-o</KBD>.  But it is also safe if you always use
  10617. <KBD>C-o</KBD>, never <KBD>o</KBD>.  When a file is visited in Rmail, the last
  10618. message is checked, and if it is in Unix format, the entire file is
  10619. scanned and all Unix-format messages are converted to Rmail format.
  10620. (The reason for checking the last message is that scanning the file is
  10621. slow and most Rmail files have only Rmail format messages.)  If you use
  10622. <KBD>C-o</KBD> consistently, the last message is guaranteed to be in Unix
  10623. format, so Rmail will convert all messages properly.
  10624. When you and other users want to append mail to the same file, you
  10625. probably always want to use <KBD>C-o</KBD> instead of <KBD>o</KBD>.  Other mail
  10626. processors may not know Rmail format but will know Unix format.
  10627.   In any case, always use <KBD>o</KBD> to add to an Rmail file that is being
  10628. visited in Rmail.  Adding messages with <KBD>C-o</KBD> to the actual disk file
  10629. will trigger a "simultaneous editing" warning when you ask to save the
  10630. Emacs buffer, and the messages will be lost if you do save.
  10631. <A NAME="IDX1320"></A>
  10632. <A NAME="IDX1321"></A>
  10633. <H2><A NAME="SEC252" HREF="xEMACS_TO.HTM#SEC252">Labels</A></H2>
  10634.   Each message can have various <DFN>labels</DFN> assigned to it as a means of
  10635. classification.  A label has a name; different names mean different labels.
  10636. Any given label is either present or absent on a particular message.  A few
  10637. label names have standard meanings and are given to messages automatically
  10638. by Rmail when appropriate; these special labels are called <DFN>attributes</DFN>.
  10639. All other labels are assigned by the user.
  10640. <DL COMPACT>
  10641. <DT><KBD>a <VAR>label</VAR> <KBD>RET</KBD></KBD>
  10642. <DD>Assign the label <VAR>label</VAR> to the current message (<CODE>rmail-add-label</CODE>).
  10643. <DT><KBD>k <VAR>label</VAR> <KBD>RET</KBD></KBD>
  10644. <DD>Remove the label <VAR>label</VAR> from the current message (<CODE>rmail-kill-label</CODE>).
  10645. <DT><KBD>C-M-n <VAR>labels</VAR> <KBD>RET</KBD></KBD>
  10646. <DD>Move to the next message that has one of the labels <VAR>labels</VAR>
  10647. (<CODE>rmail-next-labeled-message</CODE>).
  10648. <DT><KBD>C-M-p <VAR>labels</VAR> <KBD>RET</KBD></KBD>
  10649. <DD>Move to the previous message that has one of the labels <VAR>labels</VAR>
  10650. (<CODE>rmail-previous-labeled-message</CODE>).
  10651. <DT><KBD>C-M-l <VAR>labels</VAR> <KBD>RET</KBD></KBD>
  10652. <DD>Make a summary of all messages containing any of the labels <VAR>labels</VAR>
  10653. (<CODE>rmail-summary-by-labels</CODE>).
  10654. </DL>
  10655. Specifying an empty string for one these commands means to use the last
  10656. label specified for any of these commands.
  10657. <A NAME="IDX1322"></A>
  10658. <A NAME="IDX1323"></A>
  10659. <A NAME="IDX1324"></A>
  10660. <A NAME="IDX1325"></A>
  10661.   The <KBD>a</KBD> (<CODE>rmail-add-label</CODE>) and <KBD>k</KBD>
  10662. (<CODE>rmail-kill-label</CODE>) commands allow you to assign or remove any
  10663. label on the current message.  If the <VAR>label</VAR> argument is empty, it
  10664. means to assign or remove the label most recently assigned or
  10665. removed.
  10666.   Once you have given messages labels to classify them as you wish, there
  10667. are two ways to use the labels: in moving and in summaries.
  10668. <A NAME="IDX1326"></A>
  10669. <A NAME="IDX1327"></A>
  10670. <A NAME="IDX1328"></A>
  10671. <A NAME="IDX1329"></A>
  10672.   The command <KBD>C-M-n <VAR>labels</VAR> <KBD>RET</KBD></KBD>
  10673. (<CODE>rmail-next-labeled-message</CODE>) moves to the next message that has one
  10674. of the labels <VAR>labels</VAR>.  <VAR>labels</VAR> is one or more label names,
  10675. separated by commas.  <KBD>C-M-p</KBD> (<CODE>rmail-previous-labeled-message</CODE>)
  10676. is similar, but moves backwards to previous messages.  A preceding numeric
  10677. argument to either one serves as a repeat count.<A NAME="IDX1330"></A>
  10678. <A NAME="IDX1331"></A>
  10679.   The command <KBD>C-M-l <VAR>labels</VAR> <KBD>RET</KBD></KBD>
  10680. (<CODE>rmail-summary-by-labels</CODE>) displays a summary containing only the
  10681. messages that have at least one of a specified set of messages.  The
  10682. argument <VAR>labels</VAR> is one or more label names, separated by commas.
  10683. See section <A HREF="xEMACS.HTM#SEC253">Summaries</A>, for information on summaries.<P>
  10684.   If the <VAR>labels</VAR> argument to <KBD>C-M-n</KBD>, <KBD>C-M-p</KBD> or
  10685. <KBD>C-M-l</KBD> is empty, it means to use the last set of labels specified
  10686. for any of these commands.
  10687.   Some labels such as <SAMP>`deleted'</SAMP> and <SAMP>`filed'</SAMP> have built-in
  10688. meanings and are assigned to or removed from messages automatically at
  10689. appropriate times; these labels are called <DFN>attributes</DFN>.  Here is a
  10690. list of Rmail attributes:
  10691. <DL COMPACT>
  10692. <DT><SAMP>`unseen'</SAMP>
  10693. <DD>Means the message has never been current.  Assigned to messages when
  10694. they come from an inbox file, and removed when a message is made
  10695. current.
  10696. <DT><SAMP>`deleted'</SAMP>
  10697. <DD>Means the message is deleted.  Assigned by deletion commands and
  10698. removed by undeletion commands (see section <A HREF="xEMACS.HTM#SEC248">Deleting Messages</A>).
  10699. <DT><SAMP>`filed'</SAMP>
  10700. <DD>Means the message has been copied to some other file.  Assigned by the
  10701. file output commands (see section <A HREF="xEMACS.HTM#SEC250">Multiple Mail Files</A>).
  10702. <DT><SAMP>`answered'</SAMP>
  10703. <DD>Means you have mailed an answer to the message.  Assigned by the <KBD>r</KBD>
  10704. command (<CODE>rmail-reply</CODE>).  See section <A HREF="xEMACS.HTM#SEC256">Sending Replies</A>.
  10705. <DT><SAMP>`forwarded'</SAMP>
  10706. <DD>Means you have forwarded the message to other users.  Assigned by the
  10707. <KBD>f</KBD> command (<CODE>rmail-forward</CODE>).  See section <A HREF="xEMACS.HTM#SEC256">Sending Replies</A>.
  10708. <DT><SAMP>`edited'</SAMP>
  10709. <DD>Means you have edited the text of the message within Rmail.
  10710. See section <A HREF="xEMACS.HTM#SEC257">Editing Within a Message</A>.
  10711. </DL>
  10712.   All other labels are assigned or removed only by the user, and it is up
  10713. to the user to decide what they mean.
  10714. <A NAME="IDX1332"></A>
  10715. <H2><A NAME="SEC253" HREF="xEMACS_TO.HTM#SEC253">Summaries</A></H2>
  10716.   A <DFN>summary</DFN> is a buffer Rmail creates and displays to give you an
  10717. overview of the mail in an Rmail file.  It contains one line per message;
  10718. each line shows the message number, the sender, the labels, and the
  10719. subject.  When you select the summary buffer, you can use a number of
  10720. commands to select messages by moving in the summary buffer, or to
  10721. delete or undelete messages.
  10722.   A summary buffer applies to a single Rmail file only; if you are
  10723. editing multiple Rmail files, they have separate summary buffers.  The
  10724. summary buffer name is generated by appending <SAMP>`-summary'</SAMP> to the
  10725. Rmail buffer's name.  Only one summary buffer is displayed at a
  10726. time unless you make several windows and select the summary buffers by
  10727. hand.
  10728. <H3><A NAME="SEC254" HREF="xEMACS_TO.HTM#SEC254">Making Summaries</A></H3>
  10729.   Here are the commands to create a summary for the current Rmail file.
  10730. Summaries do not update automatically; to make an updated summary, you
  10731. must use one of the commands again.
  10732. <DL COMPACT>
  10733. <DT><KBD>h</KBD>
  10734. <DD><DT><KBD>C-M-h</KBD>
  10735. <DD>Summarize all messages (<CODE>rmail-summary</CODE>).
  10736. <DT><KBD>l <VAR>labels</VAR> <KBD>RET</KBD></KBD>
  10737. <DD><DT><KBD>C-M-l <VAR>labels</VAR> <KBD>RET</KBD></KBD>
  10738. <DD>Summarize message that have one or more of the specified labels
  10739. (<CODE>rmail-summary-by-labels</CODE>).
  10740. <DT><KBD>C-M-r <VAR>rcpts</VAR> <KBD>RET</KBD></KBD>
  10741. <DD>Summarize messages that have one or more of the specified recipients
  10742. (<CODE>rmail-summary-by-recipients</CODE>).
  10743. </DL>
  10744. <A NAME="IDX1333"></A>
  10745. <A NAME="IDX1334"></A>
  10746.   The <KBD>h</KBD> or <KBD>C-M-h</KBD> (<CODE>rmail-summary</CODE>) command fills the
  10747. summary buffer for the current Rmail file with a summary of all the
  10748. messages in the file.  It then displays and selects the summary buffer
  10749. in another window.
  10750. <A NAME="IDX1335"></A>
  10751. <A NAME="IDX1336"></A>
  10752. <A NAME="IDX1337"></A>
  10753.   The <KBD>l</KBD> or <KBD>C-M-l <VAR>labels</VAR> <KBD>RET</KBD></KBD> 
  10754. (<CODE>rmail-summary-by-labels</CODE>) makes
  10755. a partial summary mentioning only the messages that have one or more of the
  10756. labels <VAR>labels</VAR>.  <VAR>labels</VAR> should contain label names separated by
  10757. commas.<A NAME="IDX1338"></A>
  10758. <A NAME="IDX1339"></A>
  10759.   <KBD>C-M-r <VAR>rcpts</VAR> <KBD>RET</KBD></KBD> (<CODE>rmail-summary-by-recipients</CODE>)
  10760. makes a partial summary mentioning only the messages that have one or more
  10761. of the recipients <VAR>rcpts</VAR>.  <VAR>rcpts</VAR> should contain mailing
  10762. addresses separated by commas.<P>
  10763.   Note that there is only one summary buffer for any Rmail file; making one
  10764. kind of summary discards any previously made summary.
  10765. <H3><A NAME="SEC255" HREF="xEMACS_TO.HTM#SEC255">Editing in Summaries</A></H3>
  10766.   Summary buffers are given the major mode Rmail Summary mode, which
  10767. provides the following special commands:
  10768. <DL COMPACT>
  10769. <DT><KBD>j</KBD>
  10770. <DD>Select the message described by the line that point is on
  10771. (<CODE>rmail-summary-goto-msg</CODE>).
  10772. <DT><KBD>C-n</KBD>
  10773. <DD>Move to next line and select its message in Rmail
  10774. (<CODE>rmail-summary-next-all</CODE>).
  10775. <DT><KBD>C-p</KBD>
  10776. <DD>Move to previous line and select its message
  10777. (<CODE>rmail-summary-<BR>previous-all</CODE>).
  10778. <DT><KBD>n</KBD>
  10779. <DD>Move to next line, skipping lines saying `deleted', and select its
  10780. message (<CODE>rmail-summary-next-msg</CODE>).
  10781. <DT><KBD>p</KBD>
  10782. <DD>Move to previous line, skipping lines saying `deleted', and select
  10783. its message (<CODE>rmail-summary-previous-msg</CODE>).
  10784. <DT><KBD>d</KBD>
  10785. <DD>Delete the current line's message, then do like <KBD>n</KBD>
  10786. (<CODE>rmail-summary-delete-forward</CODE>).
  10787. <DT><KBD>u</KBD>
  10788. <DD>Undelete and select this message or the previous deleted message in
  10789. the summary (<CODE>rmail-summary-undelete</CODE>).
  10790. <DT><KBD><KBD>SPC</KBD></KBD>
  10791. <DD>Scroll the other window (presumably Rmail) forward
  10792. (<CODE>rmail-summary-scroll-msg-up</CODE>).
  10793. <DT><KBD><KBD>DEL</KBD></KBD>
  10794. <DD>Scroll the other window backward (<CODE>rmail-summary-scroll-msg-down</CODE>).
  10795. <DT><KBD>x</KBD>
  10796. <DD>Kill the summary window (<CODE>rmail-summary-exit</CODE>).
  10797. <DT><KBD>q</KBD>
  10798. <DD>Exit Rmail (<CODE>rmail-summary-quit</CODE>).
  10799. </DL>
  10800. <A NAME="IDX1340"></A>
  10801. <A NAME="IDX1341"></A>
  10802. <A NAME="IDX1342"></A>
  10803. <A NAME="IDX1343"></A>
  10804.   The keys <KBD>C-n</KBD>(<CODE>rmail-summary-next-all</CODE>) and <KBD>C-p</KBD>
  10805. (<CODE>rmail-summary-previous-all</CODE>) are modified in Rmail Summary mode.
  10806. In addition to moving point in the summary buffer, they also cause the
  10807. line's message to become current in the associated Rmail buffer.  That
  10808. buffer is also made visible in another window if it is not currently
  10809. visible.
  10810. <A NAME="IDX1344"></A>
  10811. <A NAME="IDX1345"></A>
  10812. <A NAME="IDX1346"></A>
  10813. <A NAME="IDX1347"></A>
  10814.   <KBD>n</KBD> and <KBD>p</KBD> are similar to <KBD>C-n</KBD> and <KBD>C-p</KBD>, but skip
  10815. lines that say `message deleted'.  They are like the <KBD>n</KBD> and <KBD>p</KBD>
  10816. keys of Rmail itself.  Note, however, that in a partial summary these
  10817. commands move only among the message listed in the summary.<A NAME="IDX1348"></A>
  10818. <A NAME="IDX1349"></A>
  10819.   The other Emacs cursor motion commands are not changed in Rmail
  10820. Summary mode, so it is easy to get the point on a line whose message is
  10821. not selected in Rmail.  This can also happen if you switch to the Rmail
  10822. window and switch messages there.  To get the Rmail buffer back in sync
  10823. with the summary, use the <KBD>j</KBD> (<CODE>rmail-summary-goto-msg</CODE>)
  10824. command, which selects the message of the current summary line in Rmail.
  10825. <A NAME="IDX1350"></A>
  10826. <A NAME="IDX1351"></A>
  10827. <A NAME="IDX1352"></A>
  10828. <A NAME="IDX1353"></A>
  10829.   Deletion and undeletion can also be done from the summary buffer.
  10830. They always work based on where point is located in the summary buffer,
  10831. ignoring which message is selected in Rmail.  <KBD>d</KBD>
  10832. (<CODE>rmail-summary-delete-forward</CODE>) deletes the current line's
  10833. message, then moves to the next line whose message is not deleted and
  10834. selects that message.  The inverse is <KBD>u</KBD>
  10835. (<CODE>rmail-summary-undelete</CODE>), which moves back (if necessary) to a
  10836. line whose message is deleted, undeletes that message, and selects it in
  10837. Rmail.
  10838. <A NAME="IDX1354"></A>
  10839. <A NAME="IDX1355"></A>
  10840. <A NAME="IDX1356"></A>
  10841. <A NAME="IDX1357"></A>
  10842.   When moving through messages with the summary buffer, it is convenient
  10843. to be able to scroll the message while remaining in the summary window.
  10844. The commands <KBD>SPC</KBD> (<CODE>rmail-summary-scroll-msg-up</CODE>) and
  10845. <KBD>DEL</KBD> (<CODE>rmail-summary-scroll-msg-down</CODE>) do this.  They scroll
  10846. the message just as they do when the Rmail buffer is selected.<A NAME="IDX1358"></A>
  10847. <A NAME="IDX1359"></A>
  10848.   When you are finished using the summary, type <KBD>x</KBD>
  10849. (<CODE>rmail-summary-exit</CODE>) to kill the summary buffer's window.
  10850. <A NAME="IDX1360"></A>
  10851. <A NAME="IDX1361"></A>
  10852.   You can also exit Rmail while in the summary.  <KBD>q</KBD>
  10853. (<CODE>rmail-summary-quit</CODE>) kills the summary window, then saves the
  10854. Rmail file and switches to another buffer.
  10855. <H2><A NAME="SEC256" HREF="xEMACS_TO.HTM#SEC256">Sending Replies</A></H2>
  10856.   Rmail has several commands that use Mail mode to send mail.
  10857. See section <A HREF="xEMACS.HTM#SEC241">Sending Mail</A>, for information on using Mail mode.  Only the
  10858. special commands of Rmail for entering Mail mode are documented here.
  10859. Note that the usual keys for sending mail, <KBD>C-x m</KBD> and <KBD>C-x 4
  10860. m</KBD>, are available in Rmail mode and work just as they usually do.<P>
  10861. <DL COMPACT>
  10862. <DT><KBD>m</KBD>
  10863. <DD>Send a message (<CODE>rmail-mail</CODE>).
  10864. <DT><KBD>c</KBD>
  10865. <DD>Continue editing already started outgoing message (<CODE>rmail-continue</CODE>).
  10866. <DT><KBD>r</KBD>
  10867. <DD>Send a reply to the current Rmail message (<CODE>rmail-reply</CODE>).
  10868. <DT><KBD>f</KBD>
  10869. <DD>Forward current message to other users (<CODE>rmail-forward</CODE>).
  10870. </DL>
  10871. <A NAME="IDX1362"></A>
  10872. <A NAME="IDX1363"></A>
  10873. <A NAME="IDX1364"></A>
  10874. <A NAME="IDX1365"></A>
  10875.  To reply to a the message you are reading in Rmail, type <KBD>r</KBD>
  10876. (<CODE>rmail-reply</CODE>).  This displays the <SAMP>`*mail*'</SAMP> buffer in another
  10877. window, much like <KBD>C-x 4 m</KBD>, but pre-initializes the <SAMP>`Subject'</SAMP>,
  10878. <SAMP>`To'</SAMP>, <SAMP>`CC'</SAMP>, and <SAMP>`In-reply-to'</SAMP> header fields based on the
  10879. message you reply to.  The <SAMP>`To'</SAMP> field is given the sender of
  10880. that message, and the <SAMP>`CC'</SAMP> gets all the recipients of that message.
  10881. Recipients that match elements of the list
  10882. <CODE>rmail-dont-reply-to</CODE> are omitted; by default, this list contains
  10883. your own mailing address.<P>
  10884.   Once you have initialized the <SAMP>`*mail*'</SAMP> buffer this way, sending the
  10885. mail goes as usual (see section <A HREF="xEMACS.HTM#SEC241">Sending Mail</A>).  You can edit the presupplied
  10886. header fields if they are not what you want.
  10887. <A NAME="IDX1366"></A>
  10888. <A NAME="IDX1367"></A>
  10889.   One additional Mail mode command is available when you invoke mail
  10890. from Rmail: <KBD>C-c C-y</KBD> (<CODE>mail-yank-original</CODE>) inserts into the
  10891. outgoing message a copy of the current Rmail message.  Normally this is
  10892. the message you are replying to, but you can also switch to the Rmail
  10893. buffer, select a different message, switch back, and yank the new current
  10894. message.  Normally the yanked message is indented four spaces and has
  10895. most header fields deleted from it; an argument to <KBD>C-c C-y</KBD>
  10896. specifies the amount to indent.  <KBD>C-u C-c C-y</KBD> neither indents
  10897. the message nor deletes any header fields.<A NAME="IDX1368"></A>
  10898. <A NAME="IDX1369"></A>
  10899. <A NAME="IDX1370"></A>
  10900.   Another frequent reason to send mail in Rmail is to forward the current
  10901. message to other users.  <KBD>f</KBD> (<CODE>rmail-forward</CODE>) makes this easy by
  10902. preinitializing the <SAMP>`*mail*'</SAMP> buffer with the current message as the
  10903. text and a subject designating a forwarded message.  All you have to do is
  10904. fill in the recipients and send.<A NAME="IDX1371"></A>
  10905. <A NAME="IDX1372"></A>
  10906.   You can use the <KBD>m</KBD> (<CODE>rmail-mail</CODE>) command to start editing an
  10907. outgoing message that is not a reply.  It leaves the header fields empty.
  10908. Its only difference from <KBD>C-x 4 m</KBD> is that it makes the Rmail buffer
  10909. accessible for <KBD>C-c y</KBD>, just as <KBD>r</KBD> does.  Thus <KBD>m</KBD> can be
  10910. used to reply to or forward a message; it can do anything <KBD>r</KBD> or <KBD>f</KBD>
  10911. can do.<A NAME="IDX1373"></A>
  10912. <A NAME="IDX1374"></A>
  10913.   The <KBD>c</KBD> (<CODE>rmail-continue</CODE>) command resumes editing the
  10914. <SAMP>`*mail*'</SAMP> buffer, to finish editing an outgoing message you were
  10915. already composing, or to alter a message you have sent.<P>
  10916. <H2><A NAME="SEC257" HREF="xEMACS_TO.HTM#SEC257">Editing Within a Message</A></H2>
  10917.   Rmail mode provides a few special commands for moving within and
  10918. editing the current message.  In addition, the usual Emacs commands are
  10919. available (except for a few, such as <KBD>C-M-n</KBD> and <KBD>C-M-h</KBD>, that
  10920. are redefined by Rmail for other purposes).  However, the Rmail buffer
  10921. is normally read-only, and to alter it you must use the Rmail command
  10922. <KBD>w</KBD> described below.
  10923. <DL COMPACT>
  10924. <DT><KBD>t</KBD>
  10925. <DD>Toggle display of original headers (<CODE>rmail-toggle-headers</CODE>).
  10926. <DT><KBD>w</KBD>
  10927. <DD>Edit current message (<CODE>rmail-edit-current-message</CODE>).
  10928. </DL>
  10929. <A NAME="IDX1375"></A>
  10930. <A NAME="IDX1376"></A>
  10931. <A NAME="IDX1377"></A>
  10932.   Rmail reformats the header of each message before displaying it.
  10933. Normally this involves deleting most header fields, on the grounds that
  10934. they are not interesting.  The variable <CODE>rmail-ignored-headers</CODE>
  10935. should contain a regexp that matches the header fields to discard in
  10936. this way.  The original headers are saved permanently; to see what they
  10937. look like, use the <KBD>t</KBD> (<CODE>rmail-toggle-headers</CODE>) command.  This
  10938. discards the reformatted headers of the current message and displays it
  10939. with the original headers.  Repeating <KBD>t</KBD> reformats the message
  10940. again.  Selecting the message again also reformats.
  10941. <A NAME="IDX1378"></A>
  10942. <A NAME="IDX1379"></A>
  10943.   The Rmail buffer is normally read-only, and most of the characters you
  10944. would type to modify it (including most letters) are redefined as Rmail
  10945. commands.  This is usually not a problem since people rarely want to
  10946. change the text of a message.  When you do want to do this, type <KBD>w</KBD>
  10947. (<CODE>rmail-edit-current-message</CODE>), which changes from Rmail mode to
  10948. Rmail Edit mode, another major mode which is nearly the same as Text
  10949. mode.  The mode line indicates this change.
  10950.   In Rmail Edit mode, letters insert themselves as usual and the Rmail
  10951. commands are not available.  When you are finished editing the message
  10952. and are ready to go back to Rmail, type <KBD>C-c C-c</KBD>, which switches
  10953. back to Rmail mode.  To return to Rmail mode but cancel all the editing
  10954. you have done, type <KBD>C-c C-]</KBD>.
  10955. <A NAME="IDX1380"></A>
  10956.   Entering Rmail Edit mode calls the value of the variable
  10957. <CODE>text-mode-hook</CODE> with no arguments, if that value exists and is not
  10958. <CODE>nil</CODE>.  It then does the same with the variable
  10959. <CODE>rmail-edit-mode-hook</CODE> and finally adds the attribute <SAMP>`edited'</SAMP>
  10960. to the message.
  10961. <A NAME="IDX1381"></A>
  10962. <A NAME="IDX1382"></A>
  10963. <H2><A NAME="SEC258" HREF="xEMACS_TO.HTM#SEC258">Digest Messages</A></H2>
  10964.   A <DFN>digest message</DFN> is a message which exists to contain and carry
  10965. several other messages.  Digests are used on moderated mailing lists.  All
  10966. messages that arrive for the list during a period of time, such as one
  10967. day, are put inside a single digest which is then sent to the subscribers.
  10968. Transmitting the single digest uses much less computer time than
  10969. transmitting the individual messages even though the total size is the
  10970. same, because the per-message overhead in network mail transmission is
  10971. considerable.
  10972. <A NAME="IDX1383"></A>
  10973.   When you receive a digest message, the most convenient way to read it is
  10974. to <DFN>undigestify</DFN> it: to turn it back into many individual messages.
  10975. You can then read and delete the individual messages as it suits you.
  10976.   To undigestify a message, select it and then type <KBD>M-x
  10977. undigestify-rmail-message</KBD>.  This copies each submessage as a separate
  10978. Rmail message and inserts them all following the digest.  The digest
  10979. message itself is flagged as deleted.
  10980. <H1><A NAME="SEC259" HREF="xEMACS_TO.HTM#SEC259">Miscellaneous Commands</A></H1>
  10981.   This chapter contains several brief topics that do not fit anywhere else.
  10982. <A NAME="IDX1384"></A>
  10983. <H2><A NAME="SEC260" HREF="xEMACS_TO.HTM#SEC260">Sorting Text</A></H2>
  10984.   Emacs provides several commands for sorting text in a buffer.  All
  10985. operate on the contents of the region (the text between point and the
  10986. mark).  They divide the text of the region into many <DFN>sort records</DFN>,
  10987. identify a <DFN>sort key</DFN> for each record, and then reorder the records
  10988. using the order determined by the sort keys.  The records are ordered so
  10989. that their keys are in alphabetical order, or, for numerical sorting, in
  10990. numerical order.  In alphabetical sorting, all upper-case letters `A'
  10991. through `Z' come before lower-case `a', in accordance with the ASCII
  10992. character sequence.
  10993.   The sort commands differ in how they divide the text into sort
  10994. records and in which part of each record they use as the sort key.  Most of
  10995. the commands make each line a separate sort record, but some commands use
  10996. paragraphs or pages as sort records.  Most of the sort commands use each
  10997. entire sort record as its own sort key, but some use only a portion of the
  10998. record as the sort key.
  10999. <A NAME="IDX1385"></A>
  11000. <A NAME="IDX1386"></A>
  11001. <A NAME="IDX1387"></A>
  11002. <A NAME="IDX1388"></A>
  11003. <A NAME="IDX1389"></A>
  11004. <DL COMPACT>
  11005. <DT><KBD>M-x sort-lines</KBD>
  11006. <DD>Divide the region into lines and sort by comparing the entire
  11007. text of a line.  A prefix argument means sort in descending order.
  11008. <DT><KBD>M-x sort-paragraphs</KBD>
  11009. <DD>Divide the region into paragraphs and sort by comparing the entire
  11010. text of a paragraph (except for leading blank lines).  A prefix
  11011. argument means sort in descending order.
  11012. <DT><KBD>M-x sort-pages</KBD>
  11013. <DD>Divide the region into pages and sort by comparing the entire
  11014. text of a page (except for leading blank lines).  A prefix
  11015. argument means sort in descending order.
  11016. <DT><KBD>M-x sort-fields</KBD>
  11017. <DD>Divide the region into lines and sort by comparing the contents of
  11018. one field in each line.  Fields are defined as separated by
  11019. whitespace, so the first run of consecutive non-whitespace characters
  11020. in a line constitutes field 1, the second such run constitutes field
  11021. 2, etc.
  11022. You specify which field to sort by with a numeric argument: 1 to sort
  11023. by field 1, etc.  A negative argument means sort in descending
  11024. order.  Thus, minus 2 means sort by field 2 in reverse-alphabetical
  11025. order.
  11026. <DT><KBD>M-x sort-numeric-fields</KBD>
  11027. <DD>Like <KBD>M-x sort-fields</KBD>, except the specified field is converted
  11028. to a number for each line and the numbers are compared.  <SAMP>`10'</SAMP>
  11029. comes before <SAMP>`2'</SAMP> when considered as text, but after it when
  11030. considered as a number.
  11031. <DT><KBD>M-x sort-columns</KBD>
  11032. <DD>Like <KBD>M-x sort-fields</KBD>, except that the text within each line
  11033. used for comparison comes from a fixed range of columns.  An explanation
  11034. is given below.
  11035. </DL>
  11036. For example, if the buffer contains:
  11037. <PRE>
  11038. On systems where clash detection (locking of files being edited) is
  11039. implemented, Emacs also checks the first time you modify a buffer
  11040. whether the file has changed on disk since it was last visited or
  11041. saved.  If it has, you are asked to confirm that you want to change
  11042. the buffer.
  11043. </PRE>
  11044. then if you apply <KBD>M-x sort-lines</KBD> to the entire buffer you get:
  11045. <PRE>
  11046. On systems where clash detection (locking of files being edited) is
  11047. implemented, Emacs also checks the first time you modify a buffer
  11048. saved.  If it has, you are asked to confirm that you want to change
  11049. the buffer.
  11050. whether the file has changed on disk since it was last visited or
  11051. </PRE>
  11052. where the upper case `O' comes before all lower case letters.  If you apply
  11053. instead <KBD>C-u 2 M-x sort-fields</KBD> you get:
  11054. <PRE>
  11055. implemented, Emacs also checks the first time you modify a buffer
  11056. saved.  If it has, you are asked to confirm that you want to change
  11057. the buffer.
  11058. On systems where clash detection (locking of files being edited) is
  11059. whether the file has changed on disk since it was last visited or
  11060. </PRE>
  11061. where the sort keys were <SAMP>`Emacs'</SAMP>, <SAMP>`If'</SAMP>, <SAMP>`buffer'</SAMP>,
  11062. <SAMP>`systems'</SAMP>, and <SAMP>`the'</SAMP>.<A NAME="IDX1390"></A>
  11063.   <KBD>M-x sort-columns</KBD> requires more explanation.  You specify the
  11064. columns by putting point at one of the columns and the mark at the other
  11065. column.  Because this means you cannot put point or the mark at the
  11066. beginning of the first line to sort, this command uses an unusual
  11067. definition of `region': all of the line point is in is considered part of
  11068. the region, and so is all of the line the mark is in.
  11069.   For example, to sort a table by information found in columns 10 to 15,
  11070. you could put the mark on column 10 in the first line of the table, and
  11071. point on column 15 in the last line of the table, and then use this command.
  11072. Or you could put the mark on column 15 in the first line and point on
  11073. column 10 in the last line.
  11074.   This can be thought of as sorting the rectangle specified by point and
  11075. the mark, except that the text on each line to the left or right of the
  11076. rectangle moves along with the text inside the rectangle.
  11077. See section <A HREF="xEMACS.HTM#SEC83">Rectangles</A>.
  11078. <A NAME="IDX1391"></A>
  11079. <A NAME="IDX1392"></A>
  11080. <H2><A NAME="SEC261" HREF="xEMACS_TO.HTM#SEC261">Running Shell Commands from Emacs</A></H2>
  11081.   Emacs has commands for passing single command lines to inferior shell
  11082. processes; it can also run a shell interactively with input and output to
  11083. an Emacs buffer <SAMP>`*shell*'</SAMP>.
  11084. <DL COMPACT>
  11085. <DT><KBD>M-!</KBD>
  11086. <DD>Run a specified shell command line and display the output
  11087. (<CODE>shell-command</CODE>).
  11088. <DT><KBD>M-|</KBD>
  11089. <DD>Run a specified shell command line with region contents as input;
  11090. optionally replace the region with the output
  11091. (<CODE>shell-command-on-region</CODE>).
  11092. <DT><KBD>M-x shell</KBD>
  11093. <DD>Run a subshell with input and output through an Emacs buffer.
  11094. You can then give commands interactively.
  11095. </DL>
  11096. <H3><A NAME="SEC262" HREF="xEMACS_TO.HTM#SEC262">Single Shell Commands</A></H3>
  11097. <A NAME="IDX1393"></A>
  11098. <A NAME="IDX1394"></A>
  11099.   <KBD>M-!</KBD> (<CODE>shell-command</CODE>) reads a line of text using the
  11100. minibuffer and creates an inferior shell to execute the line as a command.
  11101. Standard input from the command comes from the null device.  If the shell
  11102. command produces any output, the output goes to an Emacs buffer named
  11103. <SAMP>`*Shell Command Output*'</SAMP>, which is displayed in another window but not
  11104. selected.  A numeric argument, as in <KBD>M-1 M-!</KBD>, directs this command to
  11105. insert any output into the current buffer.  In that case, point is left
  11106. before the output and the mark is set after the output.
  11107. <A NAME="IDX1395"></A>
  11108. <A NAME="IDX1396"></A>
  11109.   <KBD>M-|</KBD> (<CODE>shell-command-on-region</CODE>) is like <KBD>M-!</KBD> but passes
  11110. the contents of the region as input to the shell command, instead of no
  11111. input.  If a numeric argument is used to direct  output to the current
  11112. buffer, then the old region is deleted first and the output replaces it as
  11113. the contents of the region.<A NAME="IDX1397"></A>
  11114. <A NAME="IDX1398"></A>
  11115.   Both <KBD>M-!</KBD> and <KBD>M-|</KBD> use <CODE>shell-file-name</CODE> to specify the
  11116. shell to use.  This variable is initialized based on your <CODE>SHELL</CODE>
  11117. environment variable when you start Emacs.  If the file name does not
  11118. specify a directory, the directories in the list <CODE>exec-path</CODE> are
  11119. searched; this list is initialized based on the <CODE>PATH</CODE> environment
  11120. variable when you start Emacs.  You can override either or both of these
  11121. default initializations in your <TT>`.emacs'</TT> file.<P>
  11122.   When you use <KBD>M-!</KBD> and <KBD>M-|</KBD>, Emacs has to wait until the
  11123. shell command completes.  You can quit with <KBD>C-g</KBD>; that terminates
  11124. the shell command.
  11125. <H3><A NAME="SEC263" HREF="xEMACS_TO.HTM#SEC263">Interactive Inferior Shell</A></H3>
  11126. <A NAME="IDX1399"></A>
  11127.   To run a subshell interactively with its typescript in an Emacs
  11128. buffer, use <KBD>M-x shell</KBD>.  This creates (or reuses) a buffer named
  11129. <SAMP>`*shell*'</SAMP> and runs a subshell with input coming from and output going
  11130. to that buffer.  That is to say, any "terminal output" from the subshell
  11131. will go into the buffer, advancing point, and any "terminal input" for
  11132. the subshell comes from text in the buffer.  To give input to the subshell,
  11133. go to the end of the buffer and type the input, terminated by <KBD>RET</KBD>.
  11134.   Emacs does not wait for the subshell to do anything.  You can switch
  11135. windows or buffers and edit them while the shell is waiting, or while it is
  11136. running a command.  Output from the subshell waits until Emacs has time to
  11137. process it; this happens whenever Emacs is waiting for keyboard input or
  11138. for time to elapse.
  11139.  To get multiple subshells, change the name of buffer
  11140. <SAMP>`*shell*'</SAMP> to something different by using <KBD>M-x rename-buffer</KBD>.  The
  11141. next use of <KBD>M-x shell</KBD> creates a new buffer <SAMP>`*shell*'</SAMP> with
  11142. its own subshell.  By renaming this buffer as well you can create a third
  11143. one, and so on.  All the subshells run independently and in parallel.
  11144. <A NAME="IDX1400"></A>
  11145.   The file name used to load the subshell is the value of the variable
  11146. <CODE>explicit-shell-file-name</CODE>, if that is non-<CODE>nil</CODE>.  Otherwise, the
  11147. environment variable <CODE>ESHELL</CODE> is used, or the environment variable
  11148. <CODE>SHELL</CODE> if there is no <CODE>ESHELL</CODE>.  If the file name specified
  11149. is relative, the directories in the list <CODE>exec-path</CODE> are searched
  11150. (see section <A HREF="xEMACS.HTM#SEC262">Single Shell Commands</A>).<P>
  11151.   As soon as the subshell is started, it is sent as input the contents of
  11152. the file <TT>`~/.emacs_<VAR>shellname</VAR>'</TT>, if that file exists, where
  11153. <VAR>shellname</VAR> is the name of the file that the shell was loaded from.
  11154. For example, if you use <CODE>csh</CODE>, the file sent to it is
  11155. <TT>`~/.emacs_csh'</TT>.<A NAME="IDX1401"></A>
  11156. <A NAME="IDX1402"></A>
  11157. <A NAME="IDX1403"></A>
  11158.   <CODE>cd</CODE>, <CODE>pushd</CODE>, and <CODE>popd</CODE> commands given to the inferior
  11159. shell are watched by Emacs so it can keep the <SAMP>`*shell*'</SAMP> buffer's
  11160. default directory the same as the shell's working directory.  These
  11161. commands are recognized syntactically by examining lines of input that are
  11162. sent.  If you use aliases for these commands, you can tell Emacs to
  11163. recognize them also.  For example, if the value of the variable
  11164. <CODE>shell-pushd-regexp</CODE> matches the beginning of a shell command line,
  11165. that line is regarded as a <CODE>pushd</CODE> command.  Change this variable when
  11166. you add aliases for <SAMP>`pushd'</SAMP>.  Likewise, <CODE>shell-popd-regexp</CODE> and
  11167. <CODE>shell-cd-regexp</CODE> are used to recognize commands with the meaning of
  11168. <SAMP>`popd'</SAMP> and <SAMP>`cd'</SAMP>.<P>
  11169. <KBD>M-x shell-resync-dirs</KBD> queries the shell and resynchronizes Emacs'
  11170. idea of what the current directory stack is.  <KBD>M-x
  11171. shell-dirtrack-toggle</KBD> turns directory tracking on and off.
  11172. <A NAME="IDX1404"></A>
  11173. Emacs keeps a history of the most recent commands you have typed in the
  11174. <SAMP>`*shell*'</SAMP> buffer.  If you are at the beginning of a shell command
  11175. line and type <KBD>M-p</KBD>, the previous shell input is inserted into the
  11176. buffer before point.  Immediately typing <KBD>M-p</KBD> again deletes that
  11177. input and inserts the one before it.  By repeating <KBD>M-p</KBD> you can
  11178. move backward through your commands until you find one you want to
  11179. repeat.  You may then edit the command before typing <KBD>RET</KBD> if you
  11180. wish. <KBD>M-n</KBD> moves forward through the command history, in case you
  11181. moved backward past the one you wanted while using <KBD>M-p</KBD>.  If you
  11182. type the first few characters of a previous command and then type
  11183. <KBD>M-p</KBD>, the most recent shell input starting with those characters is
  11184. inserted.  This can be very convenient when you are repeating a sequence
  11185. of shell commands.  The variable <CODE>input-ring-size</CODE> controls how
  11186. many commands are saved in your input history.  The default is 30.
  11187. <H3><A NAME="SEC264" HREF="xEMACS_TO.HTM#SEC264">Shell Mode</A></H3>
  11188. <A NAME="IDX1405"></A>
  11189.   The shell buffer uses Shell mode, which defines several special keys
  11190. attached to the <KBD>C-c</KBD> prefix.  They are chosen to resemble the usual
  11191. editing and job control characters present in shells that are not under
  11192. Emacs, except that you must type <KBD>C-c</KBD> first.  Here is a list
  11193. of the special key bindings of Shell mode:
  11194. <A NAME="IDX1406"></A>
  11195. <A NAME="IDX1407"></A>
  11196. <A NAME="IDX1408"></A>
  11197. <A NAME="IDX1409"></A>
  11198. <A NAME="IDX1410"></A>
  11199. <A NAME="IDX1411"></A>
  11200. <A NAME="IDX1412"></A>
  11201. <A NAME="IDX1413"></A>
  11202. <A NAME="IDX1414"></A>
  11203. <A NAME="IDX1415"></A>
  11204. <A NAME="IDX1416"></A>
  11205. <A NAME="IDX1417"></A>
  11206. <A NAME="IDX1418"></A>
  11207. <A NAME="IDX1419"></A>
  11208. <A NAME="IDX1420"></A>
  11209. <A NAME="IDX1421"></A>
  11210. <A NAME="IDX1422"></A>
  11211. <A NAME="IDX1423"></A>
  11212. <A NAME="IDX1424"></A>
  11213. <A NAME="IDX1425"></A>
  11214. <A NAME="IDX1426"></A>
  11215. <A NAME="IDX1427"></A>
  11216. <A NAME="IDX1428"></A>
  11217. <A NAME="IDX1429"></A>
  11218. <A NAME="IDX1430"></A>
  11219. <A NAME="IDX1431"></A>
  11220. <A NAME="IDX1432"></A>
  11221. <DL COMPACT>
  11222. <DT><KBD><KBD>RET</KBD></KBD>
  11223. <DD>At end of buffer send line as input; otherwise, copy current line to end of
  11224. buffer and send it (<CODE>send-shell-input</CODE>).  When a line is copied, any
  11225. text at the beginning of the line that matches the variable
  11226. <CODE>shell-prompt-pattern</CODE> is left out; this variable's value should be a
  11227. regexp string that matches the prompts that you use in your subshell.
  11228. <DT><KBD>C-c C-d</KBD>
  11229. <DD>Send end-of-file as input, probably causing the shell or its current
  11230. subjob to finish (<CODE>shell-send-eof</CODE>).
  11231. <DT><KBD>C-d</KBD>
  11232. <DD>If point is not at the end of the buffer, delete the next character just
  11233. like most other modes.  If point is at the end of the buffer, send
  11234. end-of-file as input, instead of generating an error as in other modes
  11235. (<CODE>comint-delchar-or-maybe-eof</CODE>).
  11236. <DT><KBD>C-c C-u</KBD>
  11237. <DD>Kill all text that has yet to be sent as input (<CODE>kill-shell-input</CODE>).
  11238. <DT><KBD>C-c C-w</KBD>
  11239. <DD>Kill a word before point (<CODE>backward-kill-word</CODE>).
  11240. <DT><KBD>C-c C-c</KBD>
  11241. <DD>Interrupt the shell or its current subjob if any
  11242. (<CODE>interrupt-shell-subjob</CODE>).
  11243. <DT><KBD>C-c C-z</KBD>
  11244. <DD>Stop the shell or its current subjob if any (<CODE>stop-shell-subjob</CODE>).
  11245. <DT><KBD>C-c C-\</KBD>
  11246. <DD>Send quit signal to the shell or its current subjob if any
  11247. (<CODE>quit-shell-subjob</CODE>).
  11248. <DT><KBD>C-c C-o</KBD>
  11249. <DD>Delete last batch of output from shell (<CODE>kill-output-from-shell</CODE>).
  11250. <DT><KBD>C-c C-r</KBD>
  11251. <DD>Scroll top of last batch of output to top of window
  11252. (<CODE>show-output-from-shell</CODE>).
  11253. <DT><KBD>C-c C-y</KBD>
  11254. <DD>Copy the previous bunch of shell input and insert it into the
  11255. buffer before point (<CODE>copy-last-shell-input</CODE>).  No final newline
  11256. is inserted, and the input copied is not resubmitted until you type
  11257. <KBD>RET</KBD>.
  11258. <DT><KBD>M-p</KBD>
  11259. <DD>Move backward through the input history.  Search for a matching command
  11260. if you have typed the beginning of a command (<CODE>comint-previous-input</CODE>).
  11261. <DT><KBD>M-n</KBD>
  11262. <DD>Move forward through the input history.  Useful when you are
  11263. using <KBD>M-p</KBD> quickly and go past the desired command 
  11264. (<CODE>comint-next-input</CODE>).
  11265. <DT><KBD><KBD>TAB</KBD></KBD>
  11266. <DD>Complete the file name preceding point (<CODE>comint-dynamic-complete</CODE>).
  11267. </DL>
  11268. <A NAME="IDX1433"></A>
  11269. <A NAME="IDX1434"></A>
  11270. <A NAME="IDX1435"></A>
  11271. <H2><A NAME="SEC265" HREF="xEMACS_TO.HTM#SEC265">Narrowing</A></H2>
  11272.   <DFN>Narrowing</DFN> means focusing in on some portion of the buffer, making
  11273. the rest temporarily invisible and inaccessible.  Cancelling the narrowing
  11274. and making the entire buffer once again visible is called <DFN>widening</DFN>.
  11275. The amount of narrowing in effect in a buffer at any time is called the
  11276. buffer's <DFN>restriction</DFN>.
  11277. <DL COMPACT>
  11278. <DT><KBD>C-x n n</KBD>
  11279. <DD>Narrow down to between point and mark (<CODE>narrow-to-region</CODE>).
  11280. <DT><KBD>C-x n w</KBD>
  11281. <DD>Widen to make the entire buffer visible again (<CODE>widen</CODE>).
  11282. </DL>
  11283.   Narrowing sometimes makes it easier to concentrate on a single
  11284. subroutine or paragraph by eliminating clutter.  It can also be used to
  11285. restrict the range of operation of a replace command or repeating
  11286. keyboard macro.  The word <SAMP>`Narrow'</SAMP> appears in the mode line
  11287. whenever narrowing is in effect.  When you have narrowed to a part of the
  11288. buffer, that part appears to be all there is.  You can't see the rest,
  11289. can't move into it (motion commands won't go outside the visible part),
  11290. and can't change it in any way.  However, the invisible text is not
  11291. gone; if you save the file, it will be saved.
  11292. <A NAME="IDX1436"></A>
  11293. <A NAME="IDX1437"></A>
  11294.   The primary narrowing command is <KBD>C-x n n</KBD> (<CODE>narrow-to-region</CODE>).
  11295. It sets the current buffer's restrictions so that the text in the current
  11296. region remains visible but all text before the region or after the region
  11297. is invisible.  Point and mark do not change.
  11298.   Because narrowing can easily confuse users who do not understand it,
  11299. <CODE>narrow-to-region</CODE> is normally a disabled command.  Attempting to use
  11300. this command asks for confirmation and gives you the option of enabling it;
  11301. once you enable the command, confirmation will no longer be required.  See section <A HREF="xEMACS.HTM#SEC288">Disabling Commands</A>.
  11302. <A NAME="IDX1438"></A>
  11303. <A NAME="IDX1439"></A>
  11304.    To undo narrowing, use <KBD>C-x n w</KBD> (<CODE>widen</CODE>).  This makes all
  11305. text in the buffer accessible again.
  11306.    Use the <KBD>C-x =</KBD> command to get information on what part of the
  11307. buffer you narrowed down.  See section <A HREF="xEMACS.HTM#SEC44">Cursor Position Information</A>.
  11308. <A NAME="IDX1440"></A>
  11309. <H2><A NAME="SEC266" HREF="xEMACS_TO.HTM#SEC266">Hardcopy Output</A></H2>
  11310.   The Emacs commands for making hardcopy derive their names from the
  11311. Unix commands <SAMP>`print'</SAMP> and <SAMP>`lpr'</SAMP>.
  11312. <DL COMPACT>
  11313. <DT><KBD>M-x print-buffer</KBD>
  11314. <DD>Print hardcopy of current buffer using Unix command <SAMP>`print'</SAMP>
  11315. <BR>(<SAMP>`lpr -p'</SAMP>).  This command adds page headings containing the file name
  11316. and page number.
  11317. <DT><KBD>M-x lpr-buffer</KBD>
  11318. <DD>Print hardcopy of current buffer using Unix command <SAMP>`lpr'</SAMP>.
  11319. This command does not add page headings.
  11320. <DT><KBD>M-x print-region</KBD>
  11321. <DD>Like <CODE>print-buffer</CODE>, but prints only the current region.
  11322. <DT><KBD>M-x lpr-region</KBD>
  11323. <DD>Like <CODE>lpr-buffer</CODE>, but prints only the current region.
  11324. </DL>
  11325. <A NAME="IDX1441"></A>
  11326. <A NAME="IDX1442"></A>
  11327. <A NAME="IDX1443"></A>
  11328. <A NAME="IDX1444"></A>
  11329. <A NAME="IDX1445"></A>
  11330.   All the hardcopy commands pass extra switches to the <CODE>lpr</CODE> program
  11331. based on the value of the variable <CODE>lpr-switches</CODE>.  Its value should
  11332. be a list of strings, each string a switch starting with <SAMP>`-'</SAMP>.  For
  11333. example, the value could be <CODE>("-Pfoo")</CODE> to print on printer
  11334. <SAMP>`foo'</SAMP>.
  11335. <A NAME="IDX1446"></A>
  11336. <A NAME="IDX1447"></A>
  11337. <H2><A NAME="SEC267" HREF="xEMACS_TO.HTM#SEC267">Recursive Editing Levels</A></H2>
  11338.   A <DFN>recursive edit</DFN> is a situation in which you are using Emacs
  11339. commands to perform arbitrary editing while in the middle of another
  11340. Emacs command.  For example, when you type <KBD>C-r</KBD> inside a
  11341. <CODE>query-replace</CODE>, you enter a recursive edit in which you can change
  11342. the current buffer.  When you exit from the recursive edit, you go back to
  11343. the <CODE>query-replace</CODE>.
  11344. <A NAME="IDX1448"></A>
  11345. <A NAME="IDX1449"></A>
  11346. <A NAME="IDX1450"></A>
  11347.   <DFN>Exiting</DFN> a recursive edit means returning to the unfinished
  11348. command, which continues execution.  For example, exiting the recursive
  11349. edit requested by <KBD>C-r</KBD> in <CODE>query-replace</CODE> causes query replacing
  11350. to resume.  Exiting is done with <KBD>C-M-c</KBD> (<CODE>exit-recursive-edit</CODE>).
  11351. <A NAME="IDX1451"></A>
  11352. <A NAME="IDX1452"></A>
  11353.   You can also <DFN>abort</DFN> a recursive edit.  This is like exiting, but
  11354. also quits the unfinished command immediately.  Use the command <KBD>C-]</KBD>
  11355. (<CODE>abort-recursive-edit</CODE>) for this.  See section <A HREF="xEMACS.HTM#SEC301">Quitting and Aborting</A>.
  11356.   The mode line shows you when you are in a recursive edit by displaying
  11357. square brackets around the parentheses that always surround the major
  11358. and minor mode names.  Every window's mode line shows the square
  11359. brackets, since Emacs as a whole, rather than any particular buffer, is
  11360. in a recursive edit.
  11361. <A NAME="IDX1453"></A>
  11362.   It is possible to be in recursive edits within recursive edits.  For
  11363. example, after typing <KBD>C-r</KBD> in a <CODE>query-replace</CODE>, you might
  11364. type a command that entered the debugger.  In such a case, two or
  11365. more sets of square brackets appear in the mode line(s).  Exiting the
  11366. inner recursive edit (here with the debugger <KBD>c</KBD> command)
  11367. resumes the query-replace command where it called the debugger.  After
  11368. the end of the query-replace command, you would be able to exit the
  11369. first recursive edit.  Aborting exits only one level of recursive edit;
  11370. it returns to the command level of the previous recursive edit.  You can
  11371. then abort that one as well.
  11372.   The command <KBD>M-x top-level</KBD> aborts all levels of
  11373. recursive edits, returning immediately to the top level command reader.
  11374.   The text you edit inside the recursive edit need not be the same text
  11375. that you were editing at top level.  If the command that invokes the
  11376. recursive edit selects a different buffer first, that is the buffer you
  11377. will edit recursively.  You can switch buffers within the recursive edit
  11378. in the normal manner (as long as the buffer-switching keys have not been
  11379. rebound).  While you could theoretically do the rest of your editing
  11380. inside the recursive edit, including visiting files, this could have
  11381. surprising effects (such as stack overflow) from time to time.  It is
  11382. best if you always exit or abort a recursive edit when you no longer
  11383. need it.
  11384.   In general, GNU Emacs tries to avoid using recursive edits.  It is
  11385. usually preferable to allow users to switch among the possible editing
  11386. modes in any order they like.  With recursive edits, the only way to get
  11387. to another state is to go "back" to the state that the recursive edit
  11388. was invoked from.
  11389. <H2><A NAME="SEC268" HREF="xEMACS_TO.HTM#SEC268">Dissociated Press</A></H2>
  11390. <A NAME="IDX1454"></A>
  11391.   <KBD>M-x dissociated-press</KBD> is a command for scrambling a file of text
  11392. either word by word or character by character.  Starting from a buffer of
  11393. straight English, it produces extremely amusing output.  The input comes
  11394. from the current Emacs buffer.  Dissociated Press writes its output in a
  11395. buffer named <SAMP>`*Dissociation*'</SAMP>, and redisplays that buffer after every
  11396. couple of lines (approximately) to facilitate reading it.
  11397.   <CODE>dissociated-press</CODE> asks every so often whether to continue
  11398. operating.  Answer <KBD>n</KBD> to stop it.  You can also stop at any time by
  11399. typing <KBD>C-g</KBD>.  The dissociation output remains in the <SAMP>`*Dissociation*'</SAMP>
  11400. buffer for you to copy elsewhere if you wish.
  11401. <A NAME="IDX1455"></A>
  11402.   Dissociated Press operates by jumping at random from one point in the
  11403. buffer to another.  In order to produce plausible output rather than
  11404. gibberish, it insists on a certain amount of overlap between the end of one
  11405. run of consecutive words or characters and the start of the next.  That is,
  11406. if it has just printed out `president' and then decides to jump to a
  11407. different point in the file, it might spot the `ent' in `pentagon' and
  11408. continue from there, producing `presidentagon'.  Long sample texts produce
  11409. the best results.
  11410. <A NAME="IDX1456"></A>
  11411.   A positive argument to <KBD>M-x dissociated-press</KBD> tells it to operate
  11412. character by character, and specifies the number of overlap characters.  A
  11413. negative argument tells it to operate word by word and specifies the number
  11414. of overlap words.  In this mode, whole words are treated as the elements to
  11415. be permuted, rather than characters.  No argument is equivalent to an
  11416. argument of two.  For your againformation, the output goes only into the
  11417. buffer <SAMP>`*Dissociation*'</SAMP>.  The buffer you start with is not changed.
  11418. <A NAME="IDX1457"></A>
  11419. <A NAME="IDX1458"></A>
  11420. <A NAME="IDX1459"></A>
  11421.   Dissociated Press produces nearly the same results as a Markov chain
  11422. based on a frequency table constructed from the sample text.  It is,
  11423. however, an independent, ignoriginal invention.  Dissociated Press
  11424. techniquitously copies several consecutive characters from the sample
  11425. between random choices, whereas a Markov chain would choose randomly for
  11426. each word or character.  This makes for more plausible sounding results
  11427. and runs faster.
  11428. <A NAME="IDX1460"></A>
  11429. <A NAME="IDX1461"></A>
  11430. <A NAME="IDX1462"></A>
  11431.   It is a mustatement that too much use of Dissociated Press can be a
  11432. developediment to your real work.  Sometimes to the point of outragedy.
  11433. And keep dissociwords out of your documentation, if you want it to be well
  11434. userenced and properbose.  Have fun.  Your buggestions are welcome.
  11435. <A NAME="IDX1463"></A>
  11436. <H2><A NAME="SEC269" HREF="xEMACS_TO.HTM#SEC269">CONX</A></H2>
  11437. Besides producing a file of scrambled text with Dissociated Press, you 
  11438. can generate random sentences by using CONX.
  11439. <DL COMPACT>
  11440. <DT><KBD>M-x conx</KBD>
  11441. <DD>Generate random sentences in the <CODE>*conx*</CODE> buffer.
  11442. <DT><KBD>M-x conx-buffer</KBD>
  11443. <DD>Absorb the text in the current buffer into the <CODE>conx</CODE> database.
  11444. <DT><KBD>M-x conx-init</KBD>
  11445. <DD>Forget the current word-frequency tree.
  11446. <DT><KBD>M-x conx-load</KBD>
  11447. <DD>Load a <CODE>conx</CODE> database that has been previously saved with 
  11448. <CODE>M-x conx-save</CODE>.
  11449. <DT><KBD>M-x conx-region</KBD>
  11450. <DD>Absorb the text in the current buffer into the <CODE>conx</CODE> database.
  11451. <DT><KBD>M-x conx-save</KBD>
  11452. <DD>Save the current <CODE>conx</CODE> database to a file for future retrieval.
  11453. </DL>
  11454. <A NAME="IDX1464"></A>
  11455. <A NAME="IDX1465"></A>
  11456. <A NAME="IDX1466"></A>
  11457. <A NAME="IDX1467"></A>
  11458. <A NAME="IDX1468"></A>
  11459. <A NAME="IDX1469"></A>
  11460. Copy text from a buffer using <KBD>M-x conx-buffer</KBD> or <KBD>M-x conx-region</KBD>
  11461. and then type <KBD>M-x conx</KBD>.  Output is continuously generated until you
  11462. type <KBD>^G</KBD>. You can save the <CODE>conx</CODE> database to a file with
  11463. <KBD>M-x conx-save</KBD>, which you can retrieve with <CODE>M-x conx-load</CODE>. 
  11464. To clear the database, use <CODE>M-x conx-init</CODE>.
  11465. <A NAME="IDX1470"></A>
  11466. <A NAME="IDX1471"></A>
  11467. <A NAME="IDX1472"></A>
  11468. <H2><A NAME="SEC270" HREF="xEMACS_TO.HTM#SEC270">Other Amusements</A></H2>
  11469.   If you are a little bit bored, you can try <KBD>M-x hanoi</KBD>.  If you are
  11470. considerably bored, give it a numeric argument.  If you are very, very
  11471. bored, try an argument of 9.  Sit back and watch.
  11472.   When you are frustrated, try the famous Eliza program.  Just do
  11473. <KBD>M-x doctor</KBD>.  End each input by typing <KBD>RET</KBD> twice.
  11474.   When you are feeling strange, type <KBD>M-x yow</KBD>.
  11475. <A NAME="IDX1473"></A>
  11476. <A NAME="IDX1474"></A>
  11477. <A NAME="IDX1475"></A>
  11478. <H2><A NAME="SEC271" HREF="xEMACS_TO.HTM#SEC271">Emulation</A></H2>
  11479.   GNU Emacs can be programmed to emulate (more or less) most other
  11480. editors.  Standard facilities can emulate these:
  11481. <DL COMPACT>
  11482. <A NAME="IDX1476"></A>
  11483. <A NAME="IDX1477"></A>
  11484. <DT>EDT (DEC VMS editor)
  11485. <DD>Turn on EDT emulation with <KBD>M-x edt-emulation-on</KBD>.  <KBD>M-x
  11486. <BR>edt-emulation-off</KBD> restores normal Emacs command bindings.
  11487. Most of the EDT emulation commands are keypad keys, and most standard
  11488. Emacs key bindings are still available.  The EDT emulation rebindings
  11489. are done in the global keymap, so there is no problem switching
  11490. buffers or major modes while in EDT emulation.
  11491. <A NAME="IDX1478"></A>
  11492. <A NAME="IDX1479"></A>
  11493. <DT>Gosling Emacs
  11494. <DD>Turn on emulation of Gosling Emacs (aka Unipress Emacs) with <KBD>M-x
  11495. set-gosmacs-bindings</KBD>.  This redefines many keys, mostly on the
  11496. <KBD>C-x</KBD> and <KBD>ESC</KBD> prefixes, to work as they do in Gosmacs.
  11497. <KBD>M-x set-gnu-bindings</KBD> returns to normal GNU Emacs by rebinding
  11498. the same keys to the definitions they had at the time <KBD>M-x
  11499. set-gosmacs-bindings</KBD> was done.
  11500. It is also possible to run Mocklisp code written for Gosling Emacs.
  11501. See section <A HREF="xEMACS.HTM#SEC225">Converting Mocklisp to Lisp</A>.
  11502. <A NAME="IDX1480"></A>
  11503. <DT>evi (vi emulation in XEmacs)
  11504. <DD>In XEmacs, evi is the preferred emulation of vi within Emacs.  
  11505. By default, evi-mode is as close as possible to regular vi.
  11506. To start evi mode from Emacs, type <CODE>M-x evi</CODE>.
  11507. If you want be in evi mode whenever you bring up Emacs, include this
  11508. line in your <TT>`.emacs'</TT> file:
  11509. <PRE>
  11510. (setq term-setup-hook 'evi)
  11511. </PRE>
  11512. See section <A HREF="xEMACS.HTM#SEC272">Using evi Mode</A> for more information on evi Mode. 
  11513. <A NAME="IDX1481"></A>
  11514. <DT>vi (Berkeley Unix editor)
  11515. <DD>Turn on vi emulation with <KBD>M-x vi-mode</KBD>.  This is a major mode
  11516. that replaces the previously established major mode.  All of the
  11517. vi commands that in real vi enter "input" mode are programmed
  11518. in the Emacs emulator to return to the previous major mode.  Thus,
  11519. ordinary Emacs serves as vi's "input" mode.
  11520. Because vi emulation works through major modes, it does not work
  11521. to switch buffers during emulation.  Return to normal Emacs first.
  11522. If you plan to use vi emulation much, you probably want to bind a key
  11523. to the <CODE>vi-mode</CODE> command.
  11524. <A NAME="IDX1482"></A>
  11525. <DT>vi (alternate emulator)
  11526. <DD>Another vi emulator said to resemble real vi more thoroughly is
  11527. invoked by <KBD>M-x vip-mode</KBD>.  "Input" mode in this emulator is
  11528. changed from ordinary Emacs so you can use <KBD>ESC</KBD> to go back to
  11529. emulated vi command mode.  To get from emulated vi command mode back
  11530. to ordinary Emacs, type <KBD>C-z</KBD>.
  11531. This emulation does not work through major modes, and it is possible
  11532. to switch buffers in various ways within the emulator.  It is not
  11533. so necessary to assign a key to the command <CODE>vip-mode</CODE> as
  11534. it is with <CODE>vi-mode</CODE> because terminating insert mode does
  11535. not use it.
  11536. For full information, see the long comment at the beginning of the
  11537. source file, which is <TT>`lisp/vip.el'</TT> in the Emacs distribution.
  11538. </DL>
  11539. Warning: loading more than one vi emulator at once may cause name
  11540. conflicts; no one has checked.
  11541. <A NAME="IDX1483"></A>
  11542. <H3><A NAME="SEC272" HREF="xEMACS_TO.HTM#SEC272">Using evi Mode</A></H3>
  11543. In XEmacs, evi provides vi emulation within Emacs.  
  11544. By default, evi-mode is as close as possible to regular vi.
  11545. To start evi mode from Emacs, type <CODE>M-x evi</CODE>.
  11546. If you want be in evi mode whenever you bring up Emacs, include this
  11547. line in your <TT>`.emacs'</TT> file:
  11548. <PRE>
  11549. (setq term-setup-hook 'evi)
  11550. </PRE>
  11551. You can find a customization file for evi-mode in <TT>`~/.evirc'</TT>.
  11552. This file has to contain Lisp code, just like the <TT>`.emacs'</TT> file,
  11553. and is loaded whenever you invoke evi mode.  The file allows you to
  11554. rebind keys in evi mode, just as you can in other Emacs modes. 
  11555. Note that evi also loads a file of vi commands from <TT>`.exrc'</TT>, just
  11556. like vi. 
  11557. By default, all Emacs commands are disabled in evi mode.  This leaves you
  11558. with only vi commands.  You may customize evi mode to make certain
  11559. keybindings accessible.  For example, to enable all Emacs command
  11560. sequences that begin with <KBD>Control-x</KBD> or with <KBD>Meta</KBD>, include
  11561. the following lines in your <TT>`.evirc'</TT> file:
  11562. <PRE>
  11563. (evi-define-key evi-all-keymaps "\C-x" ctl-x-map)
  11564. (setq evi-meta-prefix-char ?\C-a)
  11565. (evi-define-key evi-all-keymaps "\C-a" esc-map)
  11566. </PRE>
  11567. When you are in evi mode, typing <KBD>Control-z</KBD> stops vi emulation,
  11568. leaving you in Emacs.  To get back into evi mode, use <CODE>Meta-x evi</CODE>
  11569. again.  To exit Emacs, use <KBD>Control-x Control-c</KBD>. 
  11570. The file management commands used by vi have been adapted to Emacs.
  11571. They have slightly different meanings than the vi commands themselves: 
  11572. <DL COMPACT>
  11573. <DT><CODE>:e</CODE>
  11574. <DD>Edit a file in the current window.  With no argument, brings in a new
  11575. copy of the file, if it has been subsequently modified on disk.
  11576. <CODE>:e</CODE> overrides any complaints about the current buffer being modified
  11577. and discards all modifications.  With a filename argument, it edits that
  11578. file in the current window, using the copy already in the editor if it
  11579. was previously read in.  There is no difference between <CODE>:e!
  11580. filename</CODE> and <CODE>:e filename</CODE>.  As a shorthand for editing the most
  11581. recently accessed buffer not in the window, use <CODE>:e#</CODE>. <DT><CODE>:E</CODE>
  11582. <DD>Same as <CODE>:e</CODE>, but edits the file in another window, creating that
  11583. window if necessary.  If used with no filename, this command splits the
  11584. current buffer into two windows. <DT><CODE>:n</CODE>
  11585. <DD>Switch to the next file in the buffer list that is not currently
  11586. displayed.  Rotates the current file to the end of the buffer list, so
  11587. the command effectively cycles through all buffers. <DT><CODE>:N</CODE>
  11588. <DD>Same as <CODE>:n</CODE>, but switches to another window or creates another window
  11589. and puts the next file into it. </DL>
  11590. All <CODE>ex</CODE> commands that accept filenames as arguments perform file
  11591. completion using <KBD>SPC</KBD> or <KBD>TAB</KBD>.  Completion begins after the
  11592. space that separates the command from the filename. 
  11593. Many of the <CODE>ex</CODE> commands are not implemented.  The following
  11594. commands are implemented: 
  11595. <PRE>
  11596. cd, chdir, copy, delete, edit, file, global, map, move, next print,
  11597. put, quit, read, set, source, substitute, tag, write, wq, yank, !, <, >
  11598. </PRE>
  11599. The following <CODE>ex</CODE> options are implemented:
  11600. <PRE>
  11601. autoindent, ignorecase, magic, notimeout, shiftwidth, showmatch,
  11602. tabstop, wrapscan
  11603. </PRE>
  11604. <A NAME="IDX1484"></A>
  11605. <H1><A NAME="SEC273" HREF="xEMACS_TO.HTM#SEC273">Customization</A></H1>
  11606.   This chapter talks about various topics relevant to adapting the
  11607. behavior of Emacs in minor ways.
  11608.   All kinds of customization affect only the particular Emacs job that you
  11609. do them in.  They are completely lost when you kill the Emacs job, and have
  11610. no effect on other Emacs jobs you may run at the same time or later.  The
  11611. only way an Emacs job can affect anything outside of it is by writing a
  11612. file; in particular, the only way to make a customization `permanent' is to
  11613. put something in your <TT>`.emacs'</TT> file or other appropriate file to do the
  11614. customization in each session.  See section <A HREF="xEMACS.HTM#SEC292">The Init File, .emacs</A>.
  11615. <A NAME="IDX1485"></A>
  11616. <H2><A NAME="SEC274" HREF="xEMACS_TO.HTM#SEC274">Minor Modes</A></H2>
  11617. <A NAME="IDX1486"></A>
  11618.   Minor modes are options which you can use or not.  For example, Auto
  11619. Fill mode is a minor mode in which <KBD>SPC</KBD> breaks lines between words
  11620. as you type.  All the minor modes are independent of each other and of
  11621. the selected major mode.  Most minor modes inform you in the mode line
  11622. when they are on; for example, <SAMP>`Fill'</SAMP> in the mode line means that
  11623. Auto Fill mode is on.
  11624.   Append <CODE>-mode</CODE> to the name of a minor mode to get the name of a
  11625. command function that turns the mode on or off.  Thus, the command to
  11626. enable or disable Auto Fill mode is called <KBD>M-x auto-fill-mode</KBD>.  These
  11627. commands are usually invoked with <KBD>M-x</KBD>, but you can bind keys to them
  11628. if you wish.  With no argument, the function turns the mode on if it was
  11629. off and off if it was on.  This is known as <DFN>toggling</DFN>.  A positive
  11630. argument always turns the mode on, and an explicit zero argument or a
  11631. negative argument always turns it off.
  11632. <A NAME="IDX1487"></A>
  11633. <A NAME="IDX1488"></A>
  11634.   Auto Fill mode allows you to enter filled text without breaking lines
  11635. explicitly.  Emacs inserts newlines as necessary to prevent lines from
  11636. becoming too long.  See section <A HREF="xEMACS.HTM#SEC179">Filling Text</A>.
  11637. <A NAME="IDX1489"></A>
  11638. <A NAME="IDX1490"></A>
  11639.   Overwrite mode causes ordinary printing characters to replace existing
  11640. text instead of moving it to the right.  For example, if point is in
  11641. front of the <SAMP>`B'</SAMP> in <SAMP>`FOOBAR'</SAMP>, and you type a <KBD>G</KBD> in Overwrite
  11642. mode, it changes to <SAMP>`FOOGAR'</SAMP>, instead of <SAMP>`FOOGBAR'</SAMP>.<A NAME="IDX1491"></A>
  11643. <A NAME="IDX1492"></A>
  11644.   Abbrev mode allows you to define abbreviations that automatically expand
  11645. as you type them.  For example, <SAMP>`amd'</SAMP> might expand to <SAMP>`abbrev
  11646. mode'</SAMP>.  See section <A HREF="xEMACS.HTM#SEC230">Abbrevs</A>, for full information.
  11647. <A NAME="IDX1493"></A>
  11648. <A NAME="IDX1494"></A>
  11649. <H2><A NAME="SEC275" HREF="xEMACS_TO.HTM#SEC275">Variables</A></H2>
  11650.   A <DFN>variable</DFN> is a Lisp symbol which has a value.  Variable names
  11651. can contain any characters, but by convention they are words separated
  11652. by hyphens.  A variable can also have a documentation string, which
  11653. describes what kind of value it should have and how the value will be
  11654. used.
  11655.   Lisp allows any variable to have any kind of value, but most variables
  11656. that Emacs uses require a value of a certain type.  Often the value has
  11657. to be a string or a number.  Sometimes we say that a certain feature is
  11658. turned on if a variable is "non-<CODE>nil</CODE>," meaning that if the
  11659. variable's value is <CODE>nil</CODE>, the feature is off, but the feature is
  11660. on for <I>any</I> other value.  The conventional value to turn on the
  11661. feature--since you have to pick one particular value when you set the
  11662. variable--is <CODE>t</CODE>.
  11663.   Emacs uses many Lisp variables for internal recordkeeping, as any Lisp
  11664. program must, but the most interesting variables for you are the ones that
  11665. exist for the sake of customization.  Emacs does not (usually) change the
  11666. values of these variables; instead, you set the values, and thereby alter
  11667. and control the behavior of certain Emacs commands.  These variables are
  11668. called <DFN>options</DFN>.  Most options are documented in this manual and
  11669. appear in the Variable Index (see section <A HREF="xEMACS.HTM#SEC328">Variable Index</A>).
  11670.   One example of a variable which is an option is <CODE>fill-column</CODE>, which
  11671. specifies the position of the right margin (as a number of characters from
  11672. the left margin) to be used by the fill commands (see section <A HREF="xEMACS.HTM#SEC179">Filling Text</A>).
  11673. <A NAME="IDX1495"></A>
  11674. <H3><A NAME="SEC276" HREF="xEMACS_TO.HTM#SEC276">Examining and Setting Variables</A></H3>
  11675. <DL COMPACT>
  11676. <DT><KBD>C-h v</KBD>
  11677. <DD><DT><KBD>M-x describe-variable</KBD>
  11678. <DD>Print the value and documentation of a variable.
  11679. <A NAME="IDX1496"></A>
  11680. <DT><KBD>M-x set-variable</KBD>
  11681. <DD>Change the value of a variable.
  11682. </DL>
  11683. <A NAME="IDX1497"></A>
  11684. <A NAME="IDX1498"></A>
  11685.   To examine the value of a single variable, use <KBD>C-h v</KBD>
  11686. (<CODE>describe-variable</CODE>), which reads a variable name using the
  11687. minibuffer, with completion.  It prints both the value and the
  11688. documentation of the variable.
  11689. <PRE>
  11690. C-h v fill-column <KBD>RET</KBD>
  11691. </PRE>
  11692. prints something like:
  11693. <PRE>
  11694. fill-column's value is 75
  11695. Documentation:
  11696. *Column beyond which automatic line-wrapping should happen.
  11697. Automatically becomes local when set in any fashion.
  11698. </PRE>
  11699. <A NAME="IDX1499"></A>
  11700. The star at the beginning of the documentation indicates that this variable
  11701. is an option.  <KBD>C-h v</KBD> is not restricted to options; it allows any
  11702. variable name.
  11703. <A NAME="IDX1500"></A>
  11704.   If you know which option you want to set, you can use <KBD>M-x
  11705. set-variable</KBD> to set it.  This prompts for the variable name in the
  11706. minibuffer (with completion), and then prompts for a Lisp expression for the
  11707. new value using the minibuffer a second time.  For example,
  11708. <PRE>
  11709. M-x set-variable <KBD>RET</KBD> fill-column <KBD>RET</KBD> 75 <KBD>RET</KBD>
  11710. </PRE>
  11711. sets <CODE>fill-column</CODE> to 75, as if you had executed the Lisp expression
  11712. <CODE>(setq fill-column 75)</CODE>.
  11713.   Setting variables in this way, like all means of customizing Emacs
  11714. except where explicitly stated, affects only the current Emacs session.
  11715. <H3><A NAME="SEC277" HREF="xEMACS_TO.HTM#SEC277">Editing Variable Values</A></H3>
  11716. <DL COMPACT>
  11717. <DT><KBD>M-x list-options</KBD>
  11718. <DD>Display a buffer listing names, values, and documentation of all options.
  11719. <DT><KBD>M-x edit-options</KBD>
  11720. <DD>Change option values by editing a list of options.
  11721. </DL>
  11722. <A NAME="IDX1501"></A>
  11723.   <KBD>M-x list-options</KBD> displays a list of all Emacs option variables in
  11724. an Emacs buffer named <SAMP>`*List Options*'</SAMP>.  Each option is shown with its
  11725. documentation and its current value.  Here is what a portion of it might
  11726. look like:
  11727. <PRE>
  11728. ;; exec-path:
  11729. ("." "/usr/local/bin" "/usr/ucb" "/bin" "/usr/bin" "/u2/emacs/etc")
  11730. *List of directories to search programs to run in subprocesses.
  11731. Each element is a string (directory name)
  11732. or nil (try the default directory).
  11733. ;; fill-column:
  11734. *Column beyond which automatic line-wrapping should happen.
  11735. Automatically becomes local when set in any fashion.
  11736. </PRE>
  11737. <A NAME="IDX1502"></A>
  11738.   <KBD>M-x edit-options</KBD> goes one step further and immediately selects the
  11739. <SAMP>`*List Options*'</SAMP> buffer; this buffer uses the major mode Options mode,
  11740. which provides commands that allow you to point at an option and change its
  11741. value:
  11742. <DL COMPACT>
  11743. <DT><KBD>s</KBD>
  11744. <DD>Set the variable point is in or near to a new value read using the
  11745. minibuffer.
  11746. <DT><KBD>x</KBD>
  11747. <DD>Toggle the variable point is in or near: if the value was <CODE>nil</CODE>,
  11748. it becomes <CODE>t</CODE>; otherwise it becomes <CODE>nil</CODE>.
  11749. <DT><KBD>1</KBD>
  11750. <DD>Set the variable point is in or near to <CODE>t</CODE>.
  11751. <DT><KBD>0</KBD>
  11752. <DD>Set the variable point is in or near to <CODE>nil</CODE>.
  11753. <DT><KBD>n</KBD>
  11754. <DD><DT><KBD>p</KBD>
  11755. <DD>Move to the next or previous variable.
  11756. </DL>
  11757. <H3><A NAME="SEC278" HREF="xEMACS_TO.HTM#SEC278">Local Variables</A></H3>
  11758. <DL COMPACT>
  11759. <DT><KBD>M-x make-local-variable</KBD>
  11760. <DD>Make a variable have a local value in the current buffer.
  11761. <DT><KBD>M-x kill-local-variable</KBD>
  11762. <DD>Make a variable use its global value in the current buffer.
  11763. <DT><KBD>M-x make-variable-buffer-local</KBD>
  11764. <DD>Mark a variable so that setting it will make it local to the
  11765. buffer that is current at that time.
  11766. </DL>
  11767. <A NAME="IDX1503"></A>
  11768.    You can make any variable <DFN>local</DFN> to a specific Emacs buffer.
  11769. This means that the variable's value in that buffer is independent of
  11770. its value in other buffers.  A few variables are always local in every
  11771. buffer.  All other Emacs variables have a <DFN>global</DFN> value which is in
  11772. effect in all buffers that have not made the variable local.
  11773.   Major modes always make the variables they set local to the buffer.
  11774. This is why changing major modes in one buffer has no effect on other
  11775. buffers.
  11776. <A NAME="IDX1504"></A>
  11777.   <KBD>M-x make-local-variable</KBD> reads the name of a variable and makes it
  11778. local to the current buffer.  Further changes in this buffer will not
  11779. affect others, and changes in the global value will not affect this
  11780. buffer.
  11781. <A NAME="IDX1505"></A>
  11782. <A NAME="IDX1506"></A>
  11783.   <KBD>M-x make-variable-buffer-local</KBD> reads the name of a variable and
  11784. changes the future behavior of the variable so that it automatically
  11785. becomes local when it is set.  More precisely, once you have marked a
  11786. variable in this way, the usual ways of setting the
  11787. variable will automatically invoke <CODE>make-local-variable</CODE> first.  We
  11788. call such variables <DFN>per-buffer</DFN> variables.
  11789.   Some important variables have been marked per-buffer already.  They
  11790. include <CODE>abbrev-mode</CODE>, <CODE>auto-fill-function</CODE>,
  11791. <CODE>case-fold-search</CODE>, <CODE>comment-column</CODE>, <CODE>ctl-arrow</CODE>,
  11792. <CODE>fill-column</CODE>, <CODE>fill-prefix</CODE>, <CODE>indent-tabs-mode</CODE>,
  11793. <CODE>left-margin</CODE>, <BR><CODE>mode-line-format</CODE>, <CODE>overwrite-mode</CODE>,
  11794. <CODE>selective-display-ellipses</CODE>, <BR><CODE>selective-display</CODE>,
  11795. <CODE>tab-width</CODE>, and <CODE>truncate-lines</CODE>.  Some other variables are
  11796. always local in every buffer, but they are used for internal
  11797. purposes.<P>
  11798. Note: the variable <CODE>auto-fill-function</CODE> was formerly named
  11799. <CODE>auto-fill-hook</CODE>.
  11800. <A NAME="IDX1507"></A>
  11801.   If you want a variable to cease to be local to the current buffer,
  11802. call <KBD>M-x kill-local-variable</KBD> and provide the name of a variable to
  11803. the prompt.  The global value of the variable
  11804. is again in effect in this buffer.  Setting the major mode kills all
  11805. the local variables of the buffer.
  11806. <A NAME="IDX1508"></A>
  11807.   To set the global value of a variable, regardless of whether the
  11808. variable has a local value in the current buffer, you can use the
  11809. Lisp function <CODE>setq-default</CODE>.  It works like <CODE>setq</CODE>.
  11810. If there is a local value in the current buffer, the local value is
  11811. not affected by <CODE>setq-default</CODE>; thus, the new global value may
  11812. not be visible until you switch to another buffer, as in the case of:
  11813. <PRE>
  11814. (setq-default fill-column 75)
  11815. </PRE>
  11816. <CODE>setq-default</CODE> is the only way to set the global value of a variable
  11817. that has been marked with <CODE>make-variable-buffer-local</CODE>.
  11818. <A NAME="IDX1509"></A>
  11819.   Programs can look at a variable's default value with <CODE>default-value</CODE>.
  11820. This function takes a symbol as an argument and returns its default value.
  11821. The argument is evaluated; usually you must quote it explicitly, as in
  11822. the case of:
  11823. <PRE>
  11824. (default-value 'fill-column)
  11825. </PRE>
  11826. <A NAME="IDX1510"></A>
  11827. <H3><A NAME="SEC279" HREF="xEMACS_TO.HTM#SEC279">Local Variables in Files</A></H3>
  11828.   A file can contain a <DFN>local variables list</DFN>, which specifies the
  11829. values to use for certain Emacs variables when that file is edited.
  11830. Visiting the file checks for a local variables list and makes each variable
  11831. in the list local to the buffer in which the file is visited, with the
  11832. value specified in the file.
  11833.   A local variables list goes near the end of the file, in the last page.
  11834. (It is often best to put it on a page by itself.)  The local variables list
  11835. starts with a line containing the string <SAMP>`Local Variables:'</SAMP>, and ends
  11836. with a line containing the string <SAMP>`End:'</SAMP>.  In between come the
  11837. variable names and values, one set per line, as <SAMP>`<VAR>variable</VAR>:
  11838. <VAR>value</VAR>'</SAMP>.  The <VAR>value</VAR>s are not evaluated; they are used literally.
  11839.   The line which starts the local variables list does not have to say
  11840. just <SAMP>`Local Variables:'</SAMP>.  If there is other text before <SAMP>`Local
  11841. Variables:'</SAMP>, that text is called the <DFN>prefix</DFN>, and if there is other
  11842. text after, that is called the <DFN>suffix</DFN>.  If a prefix or suffix are
  11843. present, each entry in the local variables list should have the prefix
  11844. before it and the suffix after it.  This includes the <SAMP>`End:'</SAMP> line.
  11845. The prefix and suffix are included to disguise the local variables list
  11846. as a comment so the compiler or text formatter  will ignore it.
  11847. If you do not need to disguise the local variables list as a comment in
  11848. this way, there is no need to include a prefix or a suffix.<P>
  11849.   Two "variable" names are special in a local variables list: a value
  11850. for the variable <CODE>mode</CODE> sets the major mode, and a value for the
  11851. variable <CODE>eval</CODE> is simply evaluated as an expression and the value
  11852. is ignored.  These are not real variables; setting them in any other
  11853. context does not have the same effect.  If <CODE>mode</CODE> is used in a
  11854. local variables list, it should be the first entry in the list.
  11855. Here is an example of a local variables list:
  11856. <PRE>
  11857. ;;; Local Variables: ***
  11858. ;;; mode:lisp ***
  11859. ;;; comment-column:0 ***
  11860. ;;; comment-start: ";;; "  ***
  11861. ;;; comment-end:"***" ***
  11862. ;;; End: ***
  11863. </PRE>
  11864.   Note that the prefix is <SAMP>`;;; '</SAMP> and the suffix is <SAMP>` ***'</SAMP>.
  11865. Note also that comments in the file begin with and end with the same
  11866. strings.  Presumably the file contains code in a language which is
  11867. enough like Lisp for Lisp mode to be useful but in which comments
  11868. start and end differently.  The prefix and suffix are used in the local
  11869. variables list to make the list look like several lines of comments when
  11870. the compiler or interpreter for that language reads the file. 
  11871.   The start of the local variables list must be no more than 3000
  11872. characters from the end of the file, and must be in the last page if the
  11873. file is divided into pages.  Otherwise, Emacs will not notice it is
  11874. there.  The purpose is twofold: a stray <SAMP>`Local Variables:'</SAMP> not in
  11875. the last page does not confuse Emacs, and Emacs never needs to search a
  11876. long file that contains no page markers and has no local variables list.
  11877.   You may be tempted to turn on Auto Fill mode with a local variable
  11878. list.  That is inappropriate.  Whether you use Auto Fill mode or not is
  11879. a matter of personal taste, not a matter of the contents of particular
  11880. files.  If you want to use Auto Fill, set up major mode hooks with your
  11881. <TT>`.emacs'</TT> file to turn it on (when appropriate) for you alone
  11882. (see section <A HREF="xEMACS.HTM#SEC292">The Init File, .emacs</A>).  Don't try to use a local variable list that would
  11883. impose your taste on everyone working with the file.
  11884. XEmacs allows you to specify local variables in the first line
  11885. of a file, in addition to specifying them in the <CODE>Local Variables</CODE>
  11886. section at the end of a file.
  11887. If the first line of a file contains two occurences of <CODE>`-*-'</CODE>, Emacs
  11888. uses the information between them to determine what the major mode and
  11889. variable settings should be.  For example, these are all legal:
  11890. <PRE>
  11891.     ;;; -*- mode: emacs-lisp -*-
  11892.     ;;; -*- mode: postscript; version-control: never -*-
  11893.     ;;; -*- tags-file-name: "/foo/bar/TAGS" -*-
  11894. </PRE>
  11895. For historical reasons, the syntax <CODE>`-*- modename -*-'</CODE> is allowed
  11896. as well; for example, you can use:
  11897. <PRE>
  11898.     ;;; -*- emacs-lisp -*-
  11899. </PRE>
  11900. <A NAME="IDX1511"></A>
  11901. The variable <CODE>enable-local-variables</CODE> controls the use of local
  11902. variables lists in files you visit.  The value can be <CODE>t</CODE>,
  11903. <CODE>nil</CODE>, or something else.  A value of <CODE>t</CODE> means local variables
  11904. lists are obeyed; <CODE>nil</CODE> means they are ignored; anything else means
  11905. query.
  11906. The command <CODE>M-x normal-mode</CODE> always obeys local variables lists
  11907. and ignores this variable.
  11908. <H2><A NAME="SEC280" HREF="xEMACS_TO.HTM#SEC280">Keyboard Macros</A></H2>
  11909. <A NAME="IDX1512"></A>
  11910.   A <DFN>keyboard macro</DFN> is a command defined by the user to abbreviate a
  11911. sequence of keys.  For example, if you discover that you are about to type
  11912. <KBD>C-n C-d</KBD> forty times, you can speed your work by defining a keyboard
  11913. macro to invoke <KBD>C-n C-d</KBD> and calling it with a repeat count of forty.
  11914. <DL COMPACT>
  11915. <DT><KBD>C-x (</KBD>
  11916. <DD>Start defining a keyboard macro (<CODE>start-kbd-macro</CODE>).
  11917. <DT><KBD>C-x )</KBD>
  11918. <DD>End the definition of a keyboard macro (<CODE>end-kbd-macro</CODE>).
  11919. <DT><KBD>C-x e</KBD>
  11920. <DD>Execute the most recent keyboard macro (<CODE>call-last-kbd-macro</CODE>).
  11921. <DT><KBD>C-u C-x (</KBD>
  11922. <DD>Re-execute last keyboard macro, then add more keys to its definition.
  11923. <DT><KBD>C-x q</KBD>
  11924. <DD>When this point is reached during macro execution, ask for confirmation
  11925. (<CODE>kbd-macro-query</CODE>).
  11926. <DT><KBD>M-x name-last-kbd-macro</KBD>
  11927. <DD>Give a command name (for the duration of the session) to the most
  11928. recently defined keyboard macro.
  11929. <DT><KBD>M-x insert-kbd-macro</KBD>
  11930. <DD>Insert in the buffer a keyboard macro's definition, as Lisp code.
  11931. </DL>
  11932.   Keyboard macros differ from other Emacs commands in that they are
  11933. written in the Emacs command language rather than in Lisp.  This makes it
  11934. easier for the novice to write them and makes them more convenient as
  11935. temporary hacks.  However, the Emacs command language is not powerful
  11936. enough as a programming language to be useful for writing anything
  11937. general or complex.  For such things, Lisp must be used.
  11938.   You define a keyboard macro by executing the commands which are its
  11939. definition.  Put differently, as you are defining a keyboard macro, the
  11940. definition is being executed for the first time.  This way, you see
  11941. what the effects of your commands are, and don't have to figure
  11942. them out in your head.  When you are finished, the keyboard macro is
  11943. defined and also has been executed once.  You can then execute the same
  11944. set of commands again by invoking the macro.
  11945. <H3><A NAME="SEC281" HREF="xEMACS_TO.HTM#SEC281">Basic Use</A></H3>
  11946. <A NAME="IDX1513"></A>
  11947. <A NAME="IDX1514"></A>
  11948. <A NAME="IDX1515"></A>
  11949. <A NAME="IDX1516"></A>
  11950. <A NAME="IDX1517"></A>
  11951. <A NAME="IDX1518"></A>
  11952.   To start defining a keyboard macro, type <KBD>C-x (</KBD>
  11953. (<CODE>start-kbd-macro</CODE>).  From then on, anything you type continues to be
  11954. executed, but also becomes part of the definition of the macro.  <SAMP>`Def'</SAMP>
  11955. appears in the mode line to remind you of what is going on.  When you are
  11956. finished, the <KBD>C-x )</KBD> command (<CODE>end-kbd-macro</CODE>) terminates the
  11957. definition, without becoming part of it. 
  11958.   For example,
  11959. <PRE>
  11960. C-x ( M-f foo C-x )
  11961. </PRE>
  11962. defines a macro to move forward a word and then insert <SAMP>`foo'</SAMP>.
  11963. You can give <KBD>C-x )</KBD> a repeat count as an argument, in which case it
  11964. repeats the macro that many times right after defining it, but defining
  11965. the macro counts as the first repetition (since it is executed as you
  11966. define it).  If you give <KBD>C-x )</KBD> an argument of 4, it executes the
  11967. macro immediately 3 additional times.  An argument of zero to <KBD>C-x
  11968. e</KBD> or <KBD>C-x )</KBD> means repeat the macro indefinitely (until it gets an
  11969. error or you type <KBD>C-g</KBD>).
  11970.   Once you have defined a macro, you can invoke it again with the
  11971. <KBD>C-x e</KBD> command (<CODE>call-last-kbd-macro</CODE>).  You can give the
  11972. command a repeat count numeric argument to execute the macro many times.
  11973.   To repeat an operation at regularly spaced places in the
  11974. text, define a macro and include as part of the macro the commands to move
  11975. to the next place you want to use it.  For example, if you want to change
  11976. each line, you should position point at the start of a line, and define a
  11977. macro to change that line and leave point at the start of the next line.
  11978. Repeating the macro will then operate on successive lines.
  11979.   After you have terminated the definition of a keyboard macro, you can add
  11980. to the end of its definition by typing <KBD>C-u C-x (</KBD>.  This is equivalent
  11981. to plain <KBD>C-x (</KBD> followed by retyping the whole definition so far.  As
  11982. a consequence it re-executes the macro as previously defined.
  11983. <H3><A NAME="SEC282" HREF="xEMACS_TO.HTM#SEC282">Naming and Saving Keyboard Macros</A></H3>
  11984. <A NAME="IDX1519"></A>
  11985.   To save a keyboard macro for longer than until you define the
  11986. next one, you must give it a name using <KBD>M-x name-last-kbd-macro</KBD>.
  11987. This reads a name as an argument using the minibuffer and defines that name
  11988. to execute the macro.  The macro name is a Lisp symbol, and defining it in
  11989. this way makes it a valid command name for calling with <KBD>M-x</KBD> or for
  11990. binding a key to with <CODE>global-set-key</CODE> (see section <A HREF="xEMACS.HTM#SEC285">Keymaps</A>).  If you
  11991. specify a name that has a prior definition other than another keyboard
  11992. macro, Emacs prints an error message and nothing is changed.
  11993. <A NAME="IDX1520"></A>
  11994.   Once a macro has a command name, you can save its definition in a file.
  11995. You can then use it in another editing session.  First visit the file
  11996. you want to save the definition in.  Then use the command:
  11997. <PRE>
  11998. M-x insert-kbd-macro <KBD>RET</KBD> <VAR>macroname</VAR> <KBD>RET</KBD>
  11999. </PRE>
  12000. This inserts some Lisp code that, when executed later, will define the same
  12001. macro with the same definition it has now.  You need not understand Lisp
  12002. code to do this, because <CODE>insert-kbd-macro</CODE> writes the Lisp code for you.
  12003. Then save the file.  You can load the file with <CODE>load-file</CODE>
  12004. (see section <A HREF="xEMACS.HTM#SEC222">Libraries of Lisp Code for Emacs</A>).  If the file you save in is your initialization file
  12005. <TT>`~/.emacs'</TT> (see section <A HREF="xEMACS.HTM#SEC292">The Init File, .emacs</A>), then the macro will be defined each
  12006. time you run Emacs.
  12007.   If you give <CODE>insert-kbd-macro</CODE> a prefix argument, it creates
  12008. additional Lisp code to record the keys (if any) that you have bound to the
  12009. keyboard macro, so that the macro is reassigned the same keys when you
  12010. load the file.
  12011. <H3><A NAME="SEC283" HREF="xEMACS_TO.HTM#SEC283">Executing Macros With Variations</A></H3>
  12012. <A NAME="IDX1521"></A>
  12013. <A NAME="IDX1522"></A>
  12014.   You can use <KBD>C-x q</KBD> (<CODE>kbd-macro-query</CODE>), to get an effect similar
  12015. to that of <CODE>query-replace</CODE>.  The macro asks you  each time
  12016. whether to make a change.  When you are defining the macro, type <KBD>C-x
  12017. q</KBD> at the point where you want the query to occur.  During macro
  12018. definition, the <KBD>C-x q</KBD> does nothing, but when you invoke the macro,
  12019. <KBD>C-x q</KBD> reads a character from the terminal to decide whether to
  12020. continue.
  12021.   The special answers to a <KBD>C-x q</KBD> query are <KBD>SPC</KBD>, <KBD>DEL</KBD>,
  12022. <KBD>C-d</KBD>, <KBD>C-l</KBD>, and <KBD>C-r</KBD>.  Any other character terminates
  12023. execution of the keyboard macro and is then read as a command.
  12024. <KBD>SPC</KBD> means to continue.  <KBD>DEL</KBD> means to skip the remainder of
  12025. this repetition of the macro, starting again from the beginning in the
  12026. next repetition.  <KBD>C-d</KBD> means to skip the remainder of this
  12027. repetition and cancel further repetition.  <KBD>C-l</KBD> redraws the screen
  12028. and asks you again for a character to specify what to do.  <KBD>C-r</KBD> enters
  12029. a recursive editing level, in which you can perform editing that is not
  12030. part of the macro.  When you exit the recursive edit using <KBD>C-M-c</KBD>,
  12031. you are asked again how to continue with the keyboard macro.  If you
  12032. type a <KBD>SPC</KBD> at this time, the rest of the macro definition is
  12033. executed.  It is up to you to leave point and the text in a state such
  12034. that the rest of the macro will do what you want.<P>
  12035.   <KBD>C-u C-x q</KBD>, which is <KBD>C-x q</KBD> with a numeric argument, performs a
  12036. different function.  It enters a recursive edit reading input from the
  12037. keyboard, both when you type it during the definition of the macro and
  12038. when it is executed from the macro.  During definition, the editing you do
  12039. inside the recursive edit does not become part of the macro.  During macro
  12040. execution, the recursive edit gives you a chance to do some particularized
  12041. editing.  See section <A HREF="xEMACS.HTM#SEC267">Recursive Editing Levels</A>.
  12042. <H2><A NAME="SEC284" HREF="xEMACS_TO.HTM#SEC284">Customizing Key Bindings</A></H2>
  12043.   This section deals with the <DFN>keymaps</DFN> that define the bindings
  12044. between keys and functions, and shows how you can customize these bindings.
  12045. <A NAME="IDX1524"></A>
  12046. <A NAME="IDX1525"></A>
  12047. <A NAME="IDX1523"></A>
  12048.   A command is a Lisp function whose definition provides for interactive
  12049. use.  Like every Lisp function, a command has a function name, which is
  12050. a Lisp symbol whose name usually consists of lower case letters and
  12051. hyphens.
  12052. <A NAME="IDX1526"></A>
  12053. <H3><A NAME="SEC285" HREF="xEMACS_TO.HTM#SEC285">Keymaps</A></H3>
  12054. <A NAME="IDX1527"></A>
  12055. <A NAME="IDX1528"></A>
  12056.   The bindings between characters and command functions are recorded in
  12057. data structures called <DFN>keymaps</DFN>.  Emacs has many of these.  One, the
  12058. <DFN>global</DFN> keymap, defines the meanings of the single-character keys that
  12059. are defined regardless of major mode.  It is the value of the variable
  12060. <CODE>global-map</CODE>.
  12061. <A NAME="IDX1529"></A>
  12062. <A NAME="IDX1530"></A>
  12063. <A NAME="IDX1531"></A>
  12064.   Each major mode has another keymap, its <DFN>local keymap</DFN>, which
  12065. contains overriding definitions for the single-character keys that are
  12066. redefined in that mode.  Each buffer records which local keymap is
  12067. installed for it at any time, and the current buffer's local keymap is
  12068. the only one that directly affects command execution.  The local keymaps
  12069. for Lisp mode, C mode, and many other major modes always exist even when
  12070. not in use.  They are the values of the variables <CODE>lisp-mode-map</CODE>,
  12071. <CODE>c-mode-map</CODE>, and so on.  For less frequently used major modes, the
  12072. local keymap is sometimes constructed only when the mode is used for the
  12073. first time in a session, to save space.
  12074. <A NAME="IDX1532"></A>
  12075. <A NAME="IDX1533"></A>
  12076. <A NAME="IDX1534"></A>
  12077. <A NAME="IDX1535"></A>
  12078. <A NAME="IDX1536"></A>
  12079. <A NAME="IDX1537"></A>
  12080. <A NAME="IDX1538"></A>
  12081.   There are local keymaps for the minibuffer, too; they contain various
  12082. completion and exit commands.
  12083. <CODE>minibuffer-local-map</CODE> is used for ordinary input (no completion).
  12084. <CODE>minibuffer-local-ns-map</CODE> is similar, except that <KBD>SPC</KBD> exits
  12085. just like <KBD>RET</KBD>.  This is used mainly for Mocklisp compatibility.
  12086. <CODE>minibuffer-local-completion-map</CODE> is for permissive completion.
  12087. <CODE>minibuffer-local-must-match-map</CODE> is for strict completion and
  12088. for cautious completion.
  12089. <CODE>repeat-complex-command-map</CODE> is for use in <KBD>C-x <KBD>ESC</KBD></KBD>.
  12090. <CODE>isearch-mode-map</CODE> contains the bindings of the special keys which
  12091. are bound in the pseudo-mode entered with <KBD>C-s</KBD> and <KBD>C-r</KBD>.
  12092. </UL>
  12093. <A NAME="IDX1539"></A>
  12094. <A NAME="IDX1540"></A>
  12095. <A NAME="IDX1541"></A>
  12096.   Finally, each prefix key has a keymap which defines the key sequences
  12097. that start with it.  For example, <CODE>ctl-x-map</CODE> is the keymap used for
  12098. characters following a <KBD>C-x</KBD>.
  12099. <CODE>ctl-x-map</CODE> is the variable name for the map used for characters that
  12100. follow <KBD>C-x</KBD>.
  12101. <CODE>help-map</CODE> is used for characters that follow <KBD>C-h</KBD>.
  12102. <CODE>esc-map</CODE> is for characters that follow <KBD>ESC</KBD>. All Meta
  12103. characters are actually defined by this map.
  12104. <CODE>ctl-x-4-map</CODE> is for characters that follow <KBD>C-x 4</KBD>.
  12105. <CODE>mode-specific-map</CODE> is for characters that follow <KBD>C-c</KBD>.
  12106. </UL>
  12107.   The definition of a prefix key is the keymap to use for looking up
  12108. the following character.  Sometimes the definition is actually a Lisp
  12109. symbol whose function definition is the following character keymap.  The
  12110. effect is the same, but it provides a command name for the prefix key that
  12111. you can use as a description of what the prefix key is for.  Thus the
  12112. binding of <KBD>C-x</KBD> is the symbol <CODE>Ctl-X-Prefix</CODE>, whose function
  12113. definition is the keymap for <KBD>C-x</KBD> commands, the value of
  12114. <CODE>ctl-x-map</CODE>.<P>
  12115.   Prefix key definitions can appear in either the global
  12116. map or a local map.  The definitions of <KBD>C-c</KBD>, <KBD>C-x</KBD>, <KBD>C-h</KBD>,
  12117. and <KBD>ESC</KBD> as prefix keys appear in the global map, so these prefix
  12118. keys are always available.  Major modes can locally redefine a key as a
  12119. prefix by putting a prefix key definition for it in the local
  12120. map.<P>
  12121.   A mode can also put a prefix definition of a global prefix character such
  12122. as <KBD>C-x</KBD> into its local map.  This is how major modes override the
  12123. definitions of certain keys that start with <KBD>C-x</KBD>.  This case is
  12124. special, because the local definition does not entirely replace the global
  12125. one.  When both the global and local definitions of a key are other
  12126. keymaps, the next character is looked up in both keymaps, with the local
  12127. definition overriding the global one.  The character after the
  12128. <KBD>C-x</KBD> is looked up in both the major mode's own keymap for redefined
  12129. <KBD>C-x</KBD> commands and in <CODE>ctl-x-map</CODE>.  If the major mode's own keymap
  12130. for <KBD>C-x</KBD> commands contains <CODE>nil</CODE>, the definition from the global
  12131. keymap for <KBD>C-x</KBD> commands is used.<P>
  12132. <A NAME="IDX1542"></A>
  12133. <A NAME="IDX1543"></A>
  12134. <H3><A NAME="SEC286" HREF="xEMACS_TO.HTM#SEC286">Changing Key Bindings Interactively</A></H3>
  12135.   You can redefine an Emacs key by changing its entry in a keymap.
  12136. You can change the global keymap, in which case the change is effective in
  12137. all major modes except those that have their own overriding local
  12138. definitions for the same key.  Or you can change the current buffer's
  12139. local map, which affects all buffers using the same major mode.
  12140. <A NAME="IDX1545"></A>
  12141. <A NAME="IDX1546"></A>
  12142. <A NAME="IDX1544"></A>
  12143. <DL COMPACT>
  12144. <DT><KBD>M-x global-set-key <KBD>RET</KBD> <VAR>key</VAR> <VAR>cmd</VAR> <KBD>RET</KBD></KBD>
  12145. <DD>Defines <VAR>key</VAR> globally to run <VAR>cmd</VAR>.
  12146. <DT><KBD>M-x local-set-key <KBD>RET</KBD> <VAR>keys</VAR> <VAR>cmd</VAR> <KBD>RET</KBD></KBD>
  12147. <DD>Defines <VAR>key</VAR> locally (in the major mode now in effect) to run
  12148. <VAR>cmd</VAR>.
  12149. <DT><KBD>M-x local-unset-key <KBD>RET</KBD> <VAR>keys</VAR> <KBD>RET</KBD></KBD>
  12150. <DD>Removes the local binding of <VAR>key</VAR>.
  12151. </DL>
  12152. <VAR>cmd</VAR> is a symbol naming an interactively-callable function.
  12153. When called interactively, <VAR>key</VAR> is the next complete key sequence
  12154. that you type.  When called as a function, <VAR>key</VAR> is a string, a
  12155. vector of events, or a vector of key-description lists as described in
  12156. the <CODE>define-key</CODE> function description.  The binding goes in
  12157. the current buffer's local map, which is shared with other buffers in
  12158. the same major mode.
  12159. The following example:
  12160. <PRE>
  12161. M-x global-set-key <KBD>RET</KBD> C-f next-line <KBD>RET</KBD>
  12162. </PRE>
  12163. redefines <KBD>C-f</KBD> to move down a line.  The fact that <VAR>cmd</VAR> is
  12164. read second makes it serve as a kind of confirmation for <VAR>key</VAR>.
  12165.   These functions offer no way to specify a particular prefix keymap as
  12166. the one to redefine in, but that is not necessary, as you can include
  12167. prefixes in <VAR>key</VAR>.  <VAR>key</VAR> is read by reading characters one by
  12168. one until they amount to a complete key (that is, not a prefix key).
  12169. Thus, if you type <KBD>C-f</KBD> for <VAR>key</VAR>, Emacs enters
  12170. the minibuffer immediately to read <VAR>cmd</VAR>.  But if you type
  12171. <KBD>C-x</KBD>, another character is read; if that character is <KBD>4</KBD>,
  12172. another character is read, and so on.  For example,<P>
  12173. <PRE>
  12174. M-x global-set-key <KBD>RET</KBD> C-x 4 $ spell-other-window <KBD>RET</KBD>
  12175. </PRE>
  12176. redefines <KBD>C-x 4 $</KBD> to run the (fictitious) command
  12177. <CODE>spell-other-window</CODE>.
  12178. <A NAME="IDX1547"></A>
  12179. <A NAME="IDX1548"></A>
  12180.   The most general way to modify a keymap is the function
  12181. <CODE>define-key</CODE>, used in Lisp code (such as your <TT>`.emacs'</TT> file).
  12182. <CODE>define-key</CODE> takes three arguments: the keymap, the key to modify
  12183. in it, and the new definition.  See section <A HREF="xEMACS.HTM#SEC292">The Init File, .emacs</A>, for an example.
  12184. <CODE>substitute-key-definition</CODE> is used similarly; it takes three
  12185. arguments, an old definition, a new definition, and a keymap, and
  12186. redefines in that keymap all keys that were previously defined with the
  12187. old definition to have the new definition instead.
  12188. <H3><A NAME="SEC287" HREF="xEMACS_TO.HTM#SEC287">Changing Key Bindings Programmatically</A></H3>
  12189.   You can use the functions <CODE>global-set-key</CODE> and <CODE>define-key</CODE>
  12190. to rebind keys under program control.
  12191. <A NAME="IDX1549"></A>
  12192. <A NAME="IDX1550"></A>
  12193. <DL COMPACT>
  12194. <DT><KBD><CODE>(global-set-key <VAR>keys</VAR> <VAR>cmd</VAR>)</CODE></KBD>
  12195. <DD>Defines <VAR>keys</VAR> globally to run <VAR>cmd</VAR>.
  12196. <DT><KBD><CODE>(define-key <VAR>keymap</VAR> <VAR>keys</VAR> <VAR>def</VAR>)</CODE></KBD>
  12197. <DD>Defines <VAR>keys</VAR> to run <VAR>def</VAR> in the keymap <VAR>keymap</VAR>.
  12198. </DL>
  12199. <VAR>keymap</VAR> is a keymap object.
  12200. <VAR>keys</VAR> is the sequence of keystrokes to bind.
  12201. <VAR>def</VAR> is anything that can be a key's definition:
  12202. <CODE>nil</CODE>, meaning key is undefined in this keymap
  12203. A command, that is, a Lisp function suitable for interactive calling
  12204. A string or key sequence vector, which is treated as a keyboard macro
  12205. A keymap to define a prefix key
  12206. A symbol so that when the key is looked up, the symbol stands for its
  12207. function definition, which should at that time be one of the above,
  12208. or another symbol whose function definition is used, and so on
  12209. A cons, <CODE>(string . defn)</CODE>, meaning that <VAR>defn</VAR> is the definition
  12210. (<VAR>defn</VAR> should be a valid definition in its own right)
  12211. A cons, <CODE>(keymap . char)</CODE>, meaning use the definition of
  12212. <VAR>char</VAR> in map <VAR>keymap</VAR>
  12213. </UL>
  12214. For backward compatibility, XEmacs allows you to specify key
  12215. sequences as strings.  However, the preferred method is to use the
  12216. representations of key sequences as vectors of keystrokes.
  12217. See section <A HREF="xEMACS.HTM#SEC14">Keystrokes, Key Sequences, and Key Bindings</A>, for more information about the rules for constructing
  12218. key sequences.
  12219. Emacs allows you to abbreviate representations for key sequences in 
  12220. most places where there is no ambiguity.
  12221. Here are some rules for abbreviation:
  12222. The keysym by itself is equivalent to a list of just that keysym, i.e.,
  12223. <CODE>f1</CODE> is equivalent to <CODE>(f1)</CODE>.
  12224. A keystroke by itself is equivalent to a vector containing just that
  12225. keystroke, i.e.,  <CODE>(control a)</CODE> is equivalent to <CODE>[(control a)]</CODE>.
  12226. You can use ASCII codes for keysyms that have them. i.e.,
  12227. <CODE>65</CODE> is equivalent to <CODE>A</CODE>. (This is not so much an
  12228. abbreviation as an alternate representation.)
  12229. </UL>
  12230. Here are some examples of programmatically binding keys:
  12231. <PRE>
  12232. ;;;  Bind <CODE>my-command</CODE> to <KBD>f1</KBD>
  12233. (global-set-key 'f1 'my-command)        
  12234. ;;;  Bind <CODE>my-command</CODE> to <KBD>Shift-f1</KBD>
  12235. (global-set-key '(shift f1) 'my-command)
  12236. ;;; Bind <CODE>my-command</CODE> to <KBD>C-c Shift-f1</KBD>
  12237. (global-set-key '[(control c) (shift f1)] 'my-command)    
  12238. ;;; Bind <CODE>my-command</CODE> to the middle mouse button.
  12239. (global-set-key 'button2 'my-command)
  12240. ;;; Bind <CODE>my-command</CODE> to <KBD><KBD>META</KBD> <KBD>CTL</KBD> <KBD>Right Mouse Button</KBD></KBD>
  12241. ;;; in the keymap that is in force when you are running <CODE>dired</CODE>.
  12242. (define-key dired-mode-map '(meta control button3) 'my-command)
  12243. </PRE>
  12244.   For backward compatibility, you can still use strings to represent
  12245. key sequences.  Thus you can use comands like the following:
  12246. <PRE>
  12247. ;;; Bind <CODE>end-of-line</CODE> to <KBD>C-f</KBD>
  12248. (global-set-key "\C-f" 'end-of-line)
  12249. </PRE>
  12250. Note, however, that in some cases you may be binding more than one
  12251. key sequence by using a single command.  This situation can 
  12252. arise because in ASCII, <KBD>C-i</KBD> and <KBD>TAB</KBD> have
  12253. the same representation.  Therefore, when Emacs sees:
  12254. <PRE>
  12255. (global-set-key "\C-i" 'end-of-line)
  12256. </PRE>
  12257. it is unclear whether the user intended to bind <KBD>C-i</KBD> or <KBD>TAB</KBD>.
  12258. The solution XEmacs adopts is to bind both of these key
  12259. sequences.
  12260. <A NAME="IDX1551"></A>
  12261. After binding a command to two key sequences with a form like:
  12262. <PRE>
  12263.     (define-key global-map "\^X\^I" 'command-1)
  12264. </PRE>
  12265. it is possible to redefine only one of those sequences like so:
  12266. <PRE>
  12267.     (define-key global-map [(control x) (control i)] 'command-2)
  12268.     (define-key global-map [(control x) tab] 'command-3)
  12269. </PRE>
  12270. This applies only when running under a window system.  If you are
  12271. talking to Emacs through an ASCII-only channel, you do not get any of
  12272. these features.
  12273. Here is a table of pairs of key sequences that behave in a
  12274. similar fashion:
  12275. <PRE>
  12276.         control h      backspace           
  12277.         control l      clear
  12278.         control i      tab 
  12279.         control m      return              
  12280.         control j      linefeed 
  12281.         control [      escape
  12282.         control @      control space
  12283. </PRE>
  12284. <A NAME="IDX1552"></A>
  12285. <H3><A NAME="SEC288" HREF="xEMACS_TO.HTM#SEC288">Disabling Commands</A></H3>
  12286.   Disabling a command marks it as requiring confirmation before it
  12287. can be executed.  The purpose of disabling a command is to prevent
  12288. beginning users from executing it by accident and being confused.
  12289.   The direct mechanism for disabling a command is to have a non-<CODE>nil</CODE>
  12290. <CODE>disabled</CODE> property on the Lisp symbol for the command.  These
  12291. properties are normally set by the user's <TT>`.emacs'</TT> file with
  12292. Lisp expressions such as:
  12293. <PRE>
  12294. (put 'delete-region 'disabled t)
  12295. </PRE>
  12296.   If the value of the <CODE>disabled</CODE> property is a string, that string
  12297. is included in the message printed when the command is used:
  12298. <PRE>
  12299. (put 'delete-region 'disabled
  12300.      "Text deleted this way cannot be yanked back!\n")
  12301. </PRE>
  12302. <A NAME="IDX1553"></A>
  12303. <A NAME="IDX1554"></A>
  12304.   You can disable a command either by editing the <TT>`.emacs'</TT> file
  12305. directly or with the command <KBD>M-x disable-command</KBD>, which edits the
  12306. <TT>`.emacs'</TT> file for you.  See section <A HREF="xEMACS.HTM#SEC292">The Init File, .emacs</A>.
  12307.   When you attempt to invoke a disabled command interactively in Emacs,
  12308. a window is displayed containing the command's name, its
  12309. documentation, and some instructions on what to do next; then
  12310. Emacs asks for input saying whether to execute the command as requested,
  12311. enable it and execute, or cancel it.  If you decide to enable the
  12312. command, you are asked whether to do this permanently or just for the
  12313. current session.  Enabling permanently works by automatically editing
  12314. your <TT>`.emacs'</TT> file.  You can use <KBD>M-x enable-command</KBD> at any
  12315. time to enable any command permanently.
  12316.   Whether a command is disabled is independent of what key is used to
  12317. invoke it; it also applies if the command is invoked using <KBD>M-x</KBD>.
  12318. Disabling a command has no effect on calling it as a function from Lisp
  12319. programs.
  12320. <A NAME="IDX1555"></A>
  12321. <H2><A NAME="SEC289" HREF="xEMACS_TO.HTM#SEC289">The Syntax Table</A></H2>
  12322.   All the Emacs commands which parse words or balance parentheses are
  12323. controlled by the <DFN>syntax table</DFN>.  The syntax table specifies which
  12324. characters are opening delimiters, which are parts of words, which are
  12325. string quotes, and so on.  Actually, each major mode has its own syntax
  12326. table (though sometimes related major modes use the same one) which it
  12327. installs in each buffer that uses that major mode.  The syntax table
  12328. installed in the current buffer is the one that all commands use, so we
  12329. call it "the" syntax table.  A syntax table is a Lisp object, a vector of
  12330. length 256 whose elements are numbers.
  12331. <H3><A NAME="SEC290" HREF="xEMACS_TO.HTM#SEC290">Information About Each Character</A></H3>
  12332.   The syntax table entry for a character is a number that encodes six
  12333. pieces of information:
  12334. The syntactic class of the character, represented as a small integer
  12335. The matching delimiter, for delimiter characters only
  12336. (the matching delimiter of <SAMP>`('</SAMP> is <SAMP>`)'</SAMP>, and vice versa)
  12337. A flag saying whether the character is the first character of a
  12338. two-character comment starting sequence
  12339. A flag saying whether the character is the second character of a
  12340. two-character comment starting sequence
  12341. A flag saying whether the character is the first character of a
  12342. two-character comment ending sequence
  12343. A flag saying whether the character is the second character of a
  12344. two-character comment ending sequence
  12345. </UL>
  12346.   The syntactic classes are stored internally as small integers, but are
  12347. usually described to or by the user with characters.  For example, <SAMP>`('</SAMP>
  12348. is used to specify the syntactic class of opening delimiters.  Here is a
  12349. table of syntactic classes, with the characters that specify them.
  12350. <DL COMPACT>
  12351. <DT><SAMP>` '</SAMP>
  12352. <DD>The class of whitespace characters.
  12353. <DT><SAMP>`w'</SAMP>
  12354. <DD>The class of word-constituent characters.
  12355. <DT><SAMP>`_'</SAMP>
  12356. <DD>The class of characters that are part of symbol names but not words.
  12357. This class is represented by <SAMP>`_'</SAMP> because the character <SAMP>`_'</SAMP>
  12358. has this class in both C and Lisp.
  12359. <DT><SAMP>`.'</SAMP>
  12360. <DD>The class of punctuation characters that do not fit into any other
  12361. special class.
  12362. <DT><SAMP>`('</SAMP>
  12363. <DD>The class of opening delimiters.
  12364. <DT><SAMP>`)'</SAMP>
  12365. <DD>The class of closing delimiters.
  12366. <DT><SAMP>`''</SAMP>
  12367. <DD>The class of expression-adhering characters.  These characters are
  12368. part of a symbol if found within or adjacent to one, and are part
  12369. of a following expression if immediately preceding one, but are like
  12370. whitespace if surrounded by whitespace.
  12371. <DT><SAMP>`"'</SAMP>
  12372. <DD>The class of string-quote characters.  They match each other in pairs,
  12373. and the characters within the pair all lose their syntactic
  12374. significance except for the <SAMP>`\'</SAMP> and <SAMP>`/'</SAMP> classes of escape
  12375. characters, which can be used to include a string-quote inside the
  12376. string.
  12377. <DT><SAMP>`$'</SAMP>
  12378. <DD>The class of self-matching delimiters.  This is intended for TeX's
  12379. <SAMP>`$'</SAMP>, which is used both to enter and leave math mode.  Thus,
  12380. a pair of matching <SAMP>`$'</SAMP> characters surround each piece of math mode
  12381. TeX input.  A pair of adjacent <SAMP>`$'</SAMP> characters act like a single
  12382. one for purposes of matching.
  12383. <DT><SAMP>`/'</SAMP>
  12384. <DD>The class of escape characters that always just deny the following
  12385. character its special syntactic significance.  The character after one
  12386. of these escapes is always treated as alphabetic.
  12387. <DT><SAMP>`\'</SAMP>
  12388. <DD>The class of C-style escape characters.  In practice, these are
  12389. treated just like <SAMP>`/'</SAMP>-class characters, because the extra
  12390. possibilities for C escapes (such as being followed by digits) have no
  12391. effect on where the containing expression ends.
  12392. <DT><SAMP>`<'</SAMP>
  12393. <DD>The class of comment-starting characters.  Only single-character
  12394. comment starters (such as <SAMP>`;'</SAMP> in Lisp mode) are represented this
  12395. <DT><SAMP>`>'</SAMP>
  12396. <DD>The class of comment-ending characters.  Newline has this syntax in
  12397. Lisp mode.
  12398. </DL>
  12399. <A NAME="IDX1556"></A>
  12400.   The characters flagged as part of two-character comment delimiters can
  12401. have other syntactic functions most of the time.  For example, <SAMP>`/'</SAMP> and
  12402. <SAMP>`*'</SAMP> in C code, when found separately, have nothing to do with
  12403. comments.  The comment-delimiter significance overrides when the pair of
  12404. characters occur together in the proper order.  Only the list and sexp
  12405. commands use the syntax table to find comments; the commands specifically
  12406. for comments have other variables that tell them where to find comments.
  12407. Moreover, the list and sexp commands notice comments only if
  12408. <CODE>parse-sexp-ignore-comments</CODE> is non-<CODE>nil</CODE>.  This variable is set
  12409. to <CODE>nil</CODE> in modes where comment-terminator sequences are liable to
  12410. appear where there is no comment, for example, in Lisp mode where the
  12411. comment terminator is a newline but not every newline ends a comment.
  12412. <H3><A NAME="SEC291" HREF="xEMACS_TO.HTM#SEC291">Altering Syntax Information</A></H3>
  12413.   It is possible to alter a character's syntax table entry by storing a new
  12414. number in the appropriate element of the syntax table, but it would be hard
  12415. to determine what number to use.  Emacs therefore provides a command that
  12416. allows you to specify the syntactic properties of a character in a
  12417. convenient way.
  12418. <A NAME="IDX1557"></A>
  12419.   <KBD>M-x modify-syntax-entry</KBD> is the command to change a character's
  12420. syntax.  It can be used interactively and is also used by major
  12421. modes to initialize their own syntax tables.  Its first argument is the
  12422. character to change.  The second argument is a string that specifies the
  12423. new syntax.  When called from Lisp code, there is a third, optional
  12424. argument, which specifies the syntax table in which to make the change.  If
  12425. not supplied, or if this command is called interactively, the third
  12426. argument defaults to the current buffer's syntax table.
  12427. The first character in the string specifies the syntactic class.  It
  12428. is one of the characters in the previous table (see section <A HREF="xEMACS.HTM#SEC290">Information About Each Character</A>).
  12429. The second character is the matching delimiter.  For a character that
  12430. is not an opening or closing delimiter, this should be a space, and may
  12431. be omitted if no following characters are needed.
  12432. The remaining characters are flags.  The flag characters allowed are:
  12433. <DL COMPACT>
  12434. <DT><SAMP>`1'</SAMP>
  12435. <DD>Flag this character as the first of a two-character comment starting sequence.
  12436. <DT><SAMP>`2'</SAMP>
  12437. <DD>Flag this character as the second of a two-character comment starting sequence.
  12438. <DT><SAMP>`3'</SAMP>
  12439. <DD>Flag this character as the first of a two-character comment ending sequence.
  12440. <DT><SAMP>`4'</SAMP>
  12441. <DD>Flag this character as the second of a two-character comment ending sequence.
  12442. </DL>
  12443. </OL>
  12444. <A NAME="IDX1558"></A>
  12445. <A NAME="IDX1559"></A>
  12446.   Use <KBD>C-h s</KBD> (<CODE>describe-syntax</CODE>) to display a description of
  12447. the contents of the current syntax table.  The description of each
  12448. character includes both the string you have to pass to
  12449. <CODE>modify-syntax-entry</CODE> to set up that character's current syntax,
  12450. and some English to explain that string if necessary.
  12451. <A NAME="IDX1560"></A>
  12452. <A NAME="IDX1561"></A>
  12453. <A NAME="IDX1562"></A>
  12454. <A NAME="IDX1563"></A>
  12455. <H2><A NAME="SEC292" HREF="xEMACS_TO.HTM#SEC292">The Init File, .emacs</A></H2>
  12456.   When you start Emacs, it normally loads the file <TT>`.emacs'</TT> in your
  12457. home directory.  This file, if it exists, should contain Lisp code.  It
  12458. is called your initialization file or <DFN>init file</DFN>.  Use the command
  12459. line switches <SAMP>`-q'</SAMP> and <SAMP>`-u'</SAMP> to tell Emacs whether to load an
  12460. init file (see section <A HREF="xEMACS.HTM#SEC30">Entering and Exiting Emacs</A>).
  12461. <A NAME="IDX1564"></A>
  12462. When the <TT>`.emacs'</TT> file is read, the variable <CODE>init-file-user</CODE>
  12463. says which user's init file it is.  The value may be the null string or a
  12464. string containing a user's name.  If the value is a null string, it means
  12465. that the init file was taken from the user that originally logged in.
  12466. In all cases, <CODE>(concat "~" init-file-user "/")</CODE> evaluates to the
  12467. directory name of the directory where the <TT>`.emacs'</TT> file was looked
  12468.   At some sites there is a <DFN>default init file</DFN>, which is the
  12469. library named <TT>`default.el'</TT>, found via the standard search path for
  12470. libraries.  The Emacs distribution contains no such library; your site
  12471. may create one for local customizations.  If this library exists, it is
  12472. loaded whenever you start Emacs.  But your init file, if any, is loaded
  12473. first; if it sets <CODE>inhibit-default-init</CODE> non-<CODE>nil</CODE>, then
  12474. <TT>`default'</TT> is not loaded.
  12475.   If you have a large amount of code in your <TT>`.emacs'</TT> file, you
  12476. should move it into another file named <TT>`<VAR>something</VAR>.el'</TT>,
  12477. byte-compile it (see section <A HREF="xEMACS.HTM#SEC222">Libraries of Lisp Code for Emacs</A>), and load that file from your
  12478. <TT>`.emacs'</TT> file using <CODE>load</CODE>.
  12479. <H3><A NAME="SEC293" HREF="xEMACS_TO.HTM#SEC293">Init File Syntax</A></H3>
  12480.   The <TT>`.emacs'</TT> file contains one or more Lisp function call
  12481. expressions.  Each consists of a function name followed by
  12482. arguments, all surrounded by parentheses.  For example, <CODE>(setq
  12483. fill-column 60)</CODE> represents a call to the function <CODE>setq</CODE> which is
  12484. used to set the variable <CODE>fill-column</CODE> (see section <A HREF="xEMACS.HTM#SEC179">Filling Text</A>) to 60.
  12485.   The second argument to <CODE>setq</CODE> is an expression for the new value
  12486. of the variable.  This can be a constant, a variable, or a function call
  12487. expression.  In <TT>`.emacs'</TT>, constants are used most of the time.
  12488. They can be:
  12489. <DL COMPACT>
  12490. <DT>Numbers
  12491. <DD>Integers are written in decimal, with an optional initial minus sign.
  12492. If a sequence of digits is followed by a period and another sequence
  12493. of digits, it is interpreted as a floating point number.
  12494. <DT>Strings
  12495. <DD>Lisp string syntax is the same as C string syntax with a few extra
  12496. features.  Use a double-quote character to begin and end a string constant.
  12497. Newlines and special characters may be present literally in strings.  They
  12498. can also be represented as backslash sequences: <SAMP>`\n'</SAMP> for newline,
  12499. <SAMP>`\b'</SAMP> for backspace, <SAMP>`\r'</SAMP> for return, <SAMP>`\t'</SAMP> for tab,
  12500. <SAMP>`\f'</SAMP> for formfeed (control-l), <SAMP>`\e'</SAMP> for escape, <SAMP>`\\'</SAMP> for a
  12501. backslash, <SAMP>`\"'</SAMP> for a double-quote, or <SAMP>`\<VAR>ooo</VAR>'</SAMP> for the
  12502. character whose octal code is <VAR>ooo</VAR>.  Backslash and double-quote are
  12503. the only characters for which backslash sequences are mandatory.
  12504. You can use <SAMP>`\C-'</SAMP> as a prefix for a control character, as in
  12505. <SAMP>`\C-s'</SAMP> for ASCII Control-S, and <SAMP>`\M-'</SAMP> as a prefix for
  12506. a Meta character, as in <SAMP>`\M-a'</SAMP> for Meta-A or <SAMP>`\M-\C-a'</SAMP> for
  12507. Control-Meta-A.
  12508. <DT>Characters
  12509. <DD>Lisp character constant syntax consists of a <SAMP>`?'</SAMP> followed by
  12510. either a character or an escape sequence starting with <SAMP>`\'</SAMP>.
  12511. Examples: <CODE>?x</CODE>, <CODE>?\n</CODE>, <CODE>?\"</CODE>, <CODE>?\)</CODE>.  Note that
  12512. strings and characters are not interchangeable in Lisp; some contexts
  12513. require one and some contexts require the other.
  12514. <DT>True
  12515. <DD><CODE>t</CODE> stands for `true'.
  12516. <DT>False
  12517. <DD><CODE>nil</CODE> stands for `false'.
  12518. <DT>Other Lisp objects
  12519. <DD>Write a single-quote (') followed by the Lisp object you want.
  12520. </DL>
  12521. <H3><A NAME="SEC294" HREF="xEMACS_TO.HTM#SEC294">Init File Examples</A></H3>
  12522.   Here are some examples of doing certain commonly desired things with
  12523. Lisp expressions:
  12524. Make <KBD>TAB</KBD> in C mode just insert a tab if point is in the middle of a
  12525. line.
  12526. <PRE>
  12527. (setq c-tab-always-indent nil)
  12528. </PRE>
  12529. Here we have a variable whose value is normally <CODE>t</CODE> for `true'
  12530. and the alternative is <CODE>nil</CODE> for `false'.
  12531. Make searches case sensitive by default (in all buffers that do not
  12532. override this).
  12533. <PRE>
  12534. (setq-default case-fold-search nil)
  12535. </PRE>
  12536. This sets the default value, which is effective in all buffers that do
  12537. not have local values for the variable.  Setting <CODE>case-fold-search</CODE>
  12538. with <CODE>setq</CODE> affects only the current buffer's local value, which
  12539. is probably not what you want to do in an init file.
  12540. Make Text mode the default mode for new buffers.
  12541. <PRE>
  12542. (setq default-major-mode 'text-mode)
  12543. </PRE>
  12544. Note that <CODE>text-mode</CODE> is used because it is the command for entering
  12545. the mode we want.  A single-quote is written before it to make a symbol
  12546. constant; otherwise, <CODE>text-mode</CODE> would be treated as a variable name.
  12547. Turn on Auto Fill mode automatically in Text mode and related modes.
  12548. <PRE>
  12549. (setq text-mode-hook
  12550.   '(lambda () (auto-fill-mode 1)))
  12551. </PRE>
  12552. Here we have a variable whose value should be a Lisp function.  The
  12553. function we supply is a list starting with <CODE>lambda</CODE>, and a single
  12554. quote is written in front of it to make it (for the purpose of this
  12555. <CODE>setq</CODE>) a list constant rather than an expression.  Lisp functions
  12556. are not explained here; for mode hooks it is enough to know that
  12557. <CODE>(auto-fill-mode 1)</CODE> is an expression that will be executed when
  12558. Text mode is entered.  You could replace it with any other expression
  12559. that you like, or with several expressions in a row.
  12560. <PRE>
  12561. (setq text-mode-hook 'turn-on-auto-fill)
  12562. </PRE>
  12563. This is another way to accomplish the same result.
  12564. <CODE>turn-on-auto-fill</CODE> is a symbol whose function definition is
  12565. <CODE>(lambda () (auto-fill-mode 1))</CODE>.
  12566. Load the installed Lisp library named <TT>`foo'</TT> (actually a file
  12567. <TT>`foo.elc'</TT> or <TT>`foo.el'</TT> in a standard Emacs directory).
  12568. <PRE>
  12569. (load "foo")
  12570. </PRE>
  12571. When the argument to <CODE>load</CODE> is a relative pathname, not starting
  12572. with <SAMP>`/'</SAMP> or <SAMP>`~'</SAMP>, <CODE>load</CODE> searches the directories in
  12573. <CODE>load-path</CODE> (see section <A HREF="xEMACS.HTM#SEC223">Loading Libraries</A>).
  12574. Load the compiled Lisp file <TT>`foo.elc'</TT> from your home directory.
  12575. <PRE>
  12576. (load "~/foo.elc")
  12577. </PRE>
  12578. Here an absolute file name is used, so no searching is done.
  12579. Rebind the key <KBD>C-x l</KBD> to run the function <CODE>make-symbolic-link</CODE>.
  12580. <PRE>
  12581. (global-set-key "\C-xl" 'make-symbolic-link)
  12582. </PRE>
  12583. <PRE>
  12584. (define-key global-map "\C-xl" 'make-symbolic-link)
  12585. </PRE>
  12586. Note once again the single-quote used to refer to the symbol
  12587. <CODE>make-symbolic-link</CODE> instead of its value as a variable.
  12588. Do the same thing for C mode only.
  12589. <PRE>
  12590. (define-key c-mode-map "\C-xl" 'make-symbolic-link)
  12591. </PRE>
  12592. Bind the function key <KBD>F1</KBD> to a command in C mode.
  12593. Note that the names of function keys must be lower case.
  12594. <PRE>
  12595. (define-key c-mode-map 'f1 'make-symbolic-link)
  12596. </PRE>
  12597. Bind the shifted version of <KBD>F1</KBD> to a command.
  12598. <PRE>
  12599. (define-key c-mode-map '(shift f1) 'make-symbolic-link)
  12600. </PRE>
  12601. Redefine all keys which now run <CODE>next-line</CODE> in Fundamental mode
  12602. to run <CODE>forward-line</CODE> instead.
  12603. <PRE>
  12604. (substitute-key-definition 'next-line 'forward-line
  12605.                            global-map)
  12606. </PRE>
  12607. Make <KBD>C-x C-v</KBD> undefined.
  12608. <PRE>
  12609. (global-unset-key "\C-x\C-v")
  12610. </PRE>
  12611. One reason to undefine a key is so that you can make it a prefix.
  12612. Simply defining <KBD>C-x C-v <VAR>anything</VAR></KBD> would make <KBD>C-x C-v</KBD>
  12613. a prefix, but <KBD>C-x C-v</KBD> must be freed of any non-prefix definition
  12614. first.
  12615. Make <SAMP>`$'</SAMP> have the syntax of punctuation in Text mode.
  12616. Note the use of a character constant for <SAMP>`$'</SAMP>.
  12617. <PRE>
  12618. (modify-syntax-entry ?\$ "." text-mode-syntax-table)
  12619. </PRE>
  12620. Enable the use of the command <CODE>eval-expression</CODE> without confirmation.
  12621. <PRE>
  12622. (put 'eval-expression 'disabled nil)
  12623. </PRE>
  12624. </UL>
  12625. <H3><A NAME="SEC295" HREF="xEMACS_TO.HTM#SEC295">Terminal-Specific Initialization</A></H3>
  12626.   Each terminal type can have a Lisp library to be loaded into Emacs when
  12627. it is run on that type of terminal.  For a terminal type named
  12628. <VAR>termtype</VAR>, the library is called <TT>`term/<VAR>termtype</VAR>'</TT> and it is
  12629. found by searching the directories <CODE>load-path</CODE> as usual and trying the
  12630. suffixes <SAMP>`.elc'</SAMP> and <SAMP>`.el'</SAMP>.  Normally it appears in the
  12631. subdirectory <TT>`term'</TT> of the directory where most Emacs libraries are
  12632. kept.<P>
  12633.   The usual purpose of the terminal-specific library is to define the
  12634. escape sequences used by the terminal's function keys using the library
  12635. <TT>`keypad.el'</TT>.  See the file
  12636. <TT>`term/vt100.el'</TT> for an example of how this is done.<P>
  12637.   When the terminal type contains a hyphen, only the part of the name
  12638. before the first hyphen is significant in choosing the library name.
  12639. Thus, terminal types <SAMP>`aaa-48'</SAMP> and <SAMP>`aaa-30-rv'</SAMP> both use
  12640. the library <TT>`term/aaa'</TT>.  The code in the library can use
  12641. <CODE>(getenv "TERM")</CODE> to find the full terminal type name.<A NAME="IDX1565"></A>
  12642.   The library's name is constructed by concatenating the value of the
  12643. variable <CODE>term-file-prefix</CODE> and the terminal type.  Your <TT>`.emacs'</TT>
  12644. file can prevent the loading of the terminal-specific library by setting
  12645. <CODE>term-file-prefix</CODE> to <CODE>nil</CODE>.
  12646. <A NAME="IDX1566"></A>
  12647.   The value of the variable <CODE>term-setup-hook</CODE>, if not <CODE>nil</CODE>, is
  12648. called as a function of no arguments at the end of Emacs initialization,
  12649. after both your <TT>`.emacs'</TT> file and any terminal-specific library have
  12650. been read.  You can set the value in the <TT>`.emacs'</TT> file to override
  12651. part of any of the terminal-specific libraries and to define
  12652. initializations for terminals that do not have a library.<P>
  12653. <A NAME="IDX1567"></A>
  12654. <A NAME="IDX1568"></A>
  12655. <A NAME="IDX1569"></A>
  12656. <A NAME="IDX1570"></A>
  12657. <A NAME="IDX1571"></A>
  12658. <H2><A NAME="SEC296" HREF="xEMACS_TO.HTM#SEC296">Changing the Bell Sound</A></H2>
  12659. You can now change how the audible bell sounds using the variable
  12660. <CODE>sound-alist</CODE>.
  12661. <CODE>sound-alist</CODE>'s value is an list associating symbols with, among
  12662. other things, strings of audio-data.  When <CODE>ding</CODE> is called with
  12663. one of the symbols, the associated sound data is played instead of the
  12664. standard beep.  This only works if you are logged in on the console of a
  12665. machine with audio hardware. To listen to a sound of the provided type,
  12666. call the function <CODE>play-sound</CODE> with the argument <VAR>sound</VAR>. You
  12667. can also set the volume of the sound with the optional argument 
  12668. <VAR>volume</VAR>.<A NAME="IDX1572"></A>
  12669. Each element of <CODE>sound-alist</CODE> is a list describing a sound.
  12670. The first element of the list is the name of the sound being defined.
  12671. Subsequent elements of the list are alternating keyword/value pairs:
  12672. <DL COMPACT>
  12673. <DT><CODE>sound</CODE>
  12674. <DD>A string of raw sound data, or the name of another sound to play.   
  12675. The symbol <CODE>t</CODE> here means use the default X beep.
  12676. <DT><CODE>volume</CODE>
  12677. <DD>An integer from 0-100, defaulting to <CODE>bell-volume</CODE>.
  12678. <DT><CODE>pitch</CODE>
  12679. <DD>If using the default X beep, the pitch (Hz) to generate.
  12680. <DT><CODE>duration</CODE>
  12681. <DD>If using the default X beep, the duration (milliseconds).
  12682. </DL>
  12683. For compatibility, elements of `sound-alist' may also be of the form:
  12684. <PRE>
  12685. ( <VAR>sound-name</VAR> . <VAR><sound></VAR> )
  12686. ( <VAR>sound-name</VAR> <VAR><volume></VAR> <VAR><sound></VAR> )
  12687. </PRE>
  12688. You should probably add things to this list by calling the function
  12689. <CODE>load-sound-file</CODE>.
  12690. Note that you can only play audio data if running on the console screen
  12691. of a machine with audio hardware which emacs understands, which at this
  12692. time means a Sun SparcStation, SGI, or HP9000s700.
  12693. Also note that the pitch, duration, and volume options are available
  12694. everywhere, but most X servers ignore the `pitch' option.
  12695. <A NAME="IDX1573"></A>
  12696. The variable <CODE>bell-volume</CODE> should be an integer from 0 to 100,
  12697. with 100 being loudest, which controls how loud the sounds emacs makes
  12698. should be.  Elements of the <CODE>sound-alist</CODE> may override this value.
  12699. This variable applies to the standard X bell sound as well as sound files.
  12700. If the symbol <CODE>t</CODE> is in place of a sound-string, Emacs uses the
  12701. default X beep.  This allows you to define beep-types of 
  12702. different volumes even when not running on the console.
  12703. <A NAME="IDX1574"></A>
  12704. You can add things to this list by calling the function
  12705. <CODE>load-sound-file</CODE>, which reads in an audio-file and adds its data to
  12706. the sound-alist. You can specify the sound with the <VAR>sound-name</VAR>
  12707. argument and the file into which the sounds are loaded with the
  12708. <VAR>filename</VAR> argument. The optional <VAR>volume</VAR> argument sets the
  12709. volume.
  12710. <CODE>load-sound-file (<VAR>filename sound-name</VAR> &optional <VAR>volume</VAR>)</CODE>
  12711. To load and install some sound files as beep-types, use the function
  12712. <CODE>load-default-sounds</CODE> (note that this only works if you are on
  12713. display 0 of a machine with audio hardware).
  12714. The following beep-types are used by Emacs itself. Other Lisp
  12715. packages may use other beep types, but these are the ones that the C
  12716. kernel of Emacs uses.
  12717. <DL COMPACT>
  12718. <DT><CODE>auto-save-error</CODE>
  12719. <DD>An auto-save does not succeed
  12720. <DT><CODE>command-error</CODE>
  12721. <DD>The Emacs command loop catches an error
  12722. <DT><CODE>undefined-key</CODE>
  12723. <DD>You type a key that is undefined
  12724. <DT><CODE>undefined-click</CODE>
  12725. <DD>You use an undefined mouse-click combination
  12726. <DT><CODE>no-completion</CODE>
  12727. <DD>Completion was not possible
  12728. <DT><CODE>y-or-n-p</CODE>
  12729. <DD>You type something other than the required <CODE>y</CODE> or <CODE>n</CODE>
  12730. <DT><CODE>yes-or-no-p</CODE>
  12731. <DD>You type something other than <CODE>yes</CODE> or <CODE>no</CODE>
  12732. </DL>
  12733. <H2><A NAME="SEC297" HREF="xEMACS_TO.HTM#SEC297">Faces</A></H2>
  12734. XEmacs has objects called extents and faces.  An <DFN>extent</DFN>
  12735. is a region of text and a <DFN>face</DFN> is a collection of textual
  12736. attributes, such as fonts and colors.  Every extent is displayed in some
  12737. face; therefore, changing the properties of a face immediately updates the
  12738. display of all associated extents.  Faces can be screen-local: you can
  12739. have a region of text that displays with completely different
  12740. attributes when its buffer is viewed from a different X window.
  12741. The display attributes of faces may be specified either in Lisp or through
  12742. the X resource manager.
  12743. <H3><A NAME="SEC298" HREF="xEMACS_TO.HTM#SEC298">Customizing Faces</A></H3>
  12744. You can change the face of an extent with the functions in
  12745. this section.  All the functions prompt for a <VAR>face</VAR> as an
  12746. argument; use completion for a list of possible values.
  12747. <DL COMPACT>
  12748. <DT><KBD>M-x invert-face</KBD>
  12749. <DD>Swap the foreground and background colors of the given <VAR>face</VAR>.
  12750. <DT><KBD>M-x make-face-bold</KBD>
  12751. <DD>Make the font of the given <VAR>face</VAR> bold.  When called from a
  12752. program, returns <CODE>nil</CODE> if this is not possible.
  12753. <DT><KBD>M-x make-face-bold-italic</KBD>
  12754. <DD>Make the font of the given <VAR>face</VAR> bold italic.  
  12755. When called from a program, returns <CODE>nil</CODE> if not possible.
  12756. <DT><KBD>M-x make-face-italic</KBD>
  12757. <DD>Make the font of the given <VAR>face</VAR> italic.  
  12758. When called from a program, returns <CODE>nil</CODE> if not possible.
  12759. <DT><KBD>M-x make-face-unbold</KBD>
  12760. <DD>Make the font of the given <VAR>face</VAR> non-bold.  
  12761. When called from a program, returns <CODE>nil</CODE> if not possible.
  12762. <DT><KBD>M-x make-face-unitalic</KBD>
  12763. <DD>Make the font of the given <VAR>face</VAR> non-italic.
  12764. When called from a program, returns <CODE>nil</CODE> if not possible.
  12765. <DT><KBD>M-x make-face-larger</KBD>
  12766. <DD>Make the font of the given <VAR>face</VAR> a little larger.
  12767. When called from a program, returns <CODE>nil</CODE> if not possible.
  12768. <DT><KBD>M-x make-face-smaller</KBD>
  12769. <DD>Make the font of the given <VAR>face</VAR> a little smaller.
  12770. When called from a program, returns <CODE>nil</CODE> if not possible.
  12771. <DT><KBD>M-x set-face-background</KBD>
  12772. <DD>Change the background color of the given <VAR>face</VAR>.
  12773. <DT><KBD>M-x set-face-background-pixmap</KBD>
  12774. <DD>Change the background pixmap of the given <VAR>face</VAR>.
  12775. <DT><KBD>M-x set-face-font</KBD>
  12776. <DD>Change the font of the given <VAR>face</VAR>.
  12777. <DT><KBD>M-x set-face-foreground</KBD>
  12778. <DD>Change the foreground color of the given <VAR>face</VAR>.
  12779. <DT><KBD>M-x set-face-underline-p</KBD>
  12780. <DD>Change whether the given <VAR>face</VAR> is underlined.
  12781. </DL>
  12782. <A NAME="IDX1575"></A>
  12783. <A NAME="IDX1576"></A>
  12784. <A NAME="IDX1577"></A>
  12785. <A NAME="IDX1578"></A>
  12786. <A NAME="IDX1579"></A>
  12787. <A NAME="IDX1580"></A>
  12788. <A NAME="IDX1581"></A>
  12789. <A NAME="IDX1582"></A>
  12790. You can exchange the foreground and background color of the selected
  12791. <VAR>face</VAR> with the function <CODE>invert-face</CODE>. If the face does not
  12792. specify both foreground and background, then its foreground and
  12793. background are set to the background and foreground of the default face.
  12794. When calling this from a program, you can supply the optional argument 
  12795. <VAR>screen</VAR> to specify which screen is affected; otherwise, all screens
  12796. are affected.
  12797. <A NAME="IDX1583"></A>
  12798. You can set the background color of the specified <VAR>face</VAR> with the
  12799. function <CODE>set-face-background</CODE>.  The argument <CODE>color</CODE> should
  12800. be a string, the name of a color.  When called from a program, if the
  12801. optional <VAR>screen</VAR> argument is provided, the face is changed only 
  12802. in that screen; otherwise, it is changed in all screens.
  12803. <A NAME="IDX1584"></A>
  12804. You can set the background pixmap of the specified <VAR>face</VAR> with the
  12805. function <CODE>set-face-background-pixmap</CODE>.  The pixmap argument
  12806. <VAR>name</VAR> should be a string, the name of a file of pixmap data.  The
  12807. directories listed in the <CODE>x-bitmap-file-path</CODE> variable are
  12808. searched.  The bitmap may also be a list of the form <CODE>(<VAR>width
  12809. height data</CODE>)</VAR>, where <VAR>width</VAR> and <VAR>height</VAR> are the size in
  12810. pixels, and <VAR>data</VAR> is a string containing the raw bits of the
  12811. bitmap.  If the optional <VAR>screen</VAR> argument is provided, the face is
  12812. changed only in that screen; otherwise, it is changed in all screens.
  12813. The variable <CODE>x-bitmap-file-path</CODE> takes as a value a list of the
  12814. directories in which X bitmap files may be found.  If the value is
  12815. <CODE>nil</CODE>, the list is initialized from the <CODE>*bitmapFilePath</CODE>
  12816. resource.
  12817. If the environment variable <B>XBMLANGPATH</B> is set, then it is consulted
  12818. before the <CODE>x-bitmap-file-path</CODE> variable.
  12819. <A NAME="IDX1585"></A>
  12820. You can set the font of the specified <VAR>face</VAR> with the function
  12821. <CODE>set-face-font</CODE>.  The <VAR>font</VAR> argument should be a string, the
  12822. name of a font.  When called from a program, if the
  12823. optional <VAR>screen</VAR> argument is provided, the face is changed only 
  12824. in that screen; otherwise, it is changed in all screens.
  12825. <A NAME="IDX1586"></A>
  12826. You can set the foreground color of the specified <VAR>face</VAR> with the
  12827. function <CODE>set-face-foreground</CODE>.  The argument <VAR>color</VAR> should be
  12828. a string, the name of a color.  If the optional <VAR>screen</VAR> argument is
  12829. provided, the face is changed only in that screen; otherwise, it is
  12830. changed in all screens.
  12831. <A NAME="IDX1587"></A>
  12832. You can set underline the specified <VAR>face</VAR> with the function
  12833. <CODE>set-face-underline-p</CODE>. The argument <VAR>underline-p</VAR> can be used
  12834. to make underlining an attribute of the face or not. If the optional
  12835. <VAR>screen</VAR> argument is provided, the face is changed only in that
  12836. screen; otherwise, it is changed in all screens.
  12837. <A NAME="IDX1588"></A>
  12838. <A NAME="IDX1589"></A>
  12839. <H2><A NAME="SEC299" HREF="xEMACS_TO.HTM#SEC299">X Resources</A></H2>
  12840. The Emacs resources are generally set per-screen. Each Emacs screen can have 
  12841. its own name or the same name as another, depending on the name passed to the 
  12842. <CODE>x-create-screen</CODE> function.
  12843. You can specify resources for all screens with the syntax:
  12844. <PRE>
  12845. Emacs*parameter: value
  12846. </PRE>
  12847. <PRE>
  12848. Emacs*EmacsScreen*parameter:value
  12849. </PRE>
  12850. You can specify resources for a particular screen with the syntax:
  12851. <PRE>
  12852. Emacs*SCREEN-NAME*parameter: value
  12853. </PRE>
  12854. To make the default size of all Emacs screens 80 columns by 55 lines, set the 
  12855. resource this way:
  12856. <PRE>
  12857. Emacs*EmacsScreen*geometry: 80x55
  12858. </PRE>
  12859. As a special case, this geometry specification also works:
  12860. <PRE>
  12861. Emacs.geometry: 80x55
  12862. </PRE>
  12863. since that is the syntax used with most other applications (since most
  12864. other applications have only one top-level window, unlike Emacs). In
  12865. general, however, the top-level shell does not have any interesting
  12866. resources on it, and you should set the resources on the screens
  12867. instead.  To set the geometry of a particular screen named <CODE>fred</CODE>, do
  12868. this: <CODE>Emacs*fred.geometry: 80x55</CODE>.
  12869. Important! Do not use the following syntax:
  12870. <PRE>
  12871. Emacs*geometry: 80x55
  12872. </PRE>
  12873. You should never use <CODE>*geometry</CODE> with any X application. It does
  12874. not set the Emacs screen to be 80 columns by 55 lines. It actually sets
  12875. all Emacs screens and windows to be 80 by 35 in whatever units they care
  12876. to measure in. In particular, it tells the Emacs text pane to be 80 by
  12877. 55 in characters and tells the menu bar pane to be 80 x 55 pixels, which
  12878. is probably not what you want.
  12879. The <CODE>-geometry</CODE> command-line argument sets only the geometry of the
  12880. initial screen created by Emacs.
  12881. Emacs screens accept the following resources:
  12882. <DL COMPACT>
  12883. <DT><CODE>iconic</CODE> (class <CODE>Iconic</CODE>): boolean
  12884. <DD>Whether the initial window should appear in the iconified state.
  12885. <DT><CODE>internalBorderWidth</CODE> (class <CODE>InternalBorderWidth</CODE>): int
  12886. <DD>How many blank pixels to leave between the text and the edge of the 
  12887. window.
  12888. <DT><CODE>interline</CODE> (class <CODE>Interline</CODE>): int
  12889. <DD>How many pixels to leave between each line.
  12890. <DT><CODE>cursorColor</CODE> (class <CODE>CursorColor</CODE>): color-name
  12891. <DD>The color of the text cursor.
  12892. <DT><CODE>textPointer</CODE> (class <CODE>Cursor</CODE>): cursor-name
  12893. <DD>The cursor to use when the mouse is over text.  This resource is used to
  12894. initialize the variable <CODE>x-pointer-shape</CODE>.
  12895. <DT><CODE>selectionPointer</CODE> (class <CODE>Cursor</CODE>): cursor-name
  12896. <DD>The cursor to use when the mouse is over a selectable text region (an
  12897. extent with the <SAMP>`highlight'</SAMP> property; for example, an Info
  12898. cross-reference).  This resource is used to initialize the variable
  12899. <CODE>x-selection-pointer-shape</CODE>.
  12900. <DT><CODE>spacePointer</CODE> (class <CODE>Cursor</CODE>): cursor-name
  12901. <DD>The cursor to use when the mouse is over a blank space in a buffer (that
  12902. is, after the end of a line or after the end-of-file).  This resource is
  12903. used to initialize the variable <CODE>x-nontext-pointer-shape</CODE>.
  12904. <DT><CODE>modeLinePointer</CODE> (class <CODE>Cursor</CODE>): cursor-name
  12905. <DD>The cursor to use when the mouse is over a mode line.  This resource is
  12906. used to initialize the variable <CODE>x-mode-pointer-shape</CODE>.
  12907. <DT><CODE>gcPointer</CODE> (class <CODE>Cursor</CODE>): cursor-name
  12908. <DD>The cursor to display when a garbage-collection is in progress.  This
  12909. resource is used to initialize the variable <CODE>x-gc-pointer-shape</CODE>.
  12910. <DT><CODE>scrollbarPointer</CODE> (class <CODE>Cursor</CODE>): cursor-name
  12911. <DD>The cursor to use when the mouse is over the scrollbar.  This resource
  12912. is used to initialize the variable <CODE>x-scrollbar-pointer-shape</CODE>.
  12913. <DT><CODE>pointerColor</CODE> (class <CODE>Foreground</CODE>): color-name
  12914. <DD><DT><CODE>pointerBackground</CODE>(class <CODE>Background</CODE>): color-name
  12915. <DD>The foreground and background colors of the mouse cursor.  These
  12916. resources are used to initialize the variables
  12917. <CODE>x-pointer-foreground-color</CODE> and <CODE>x-pointer-background-color</CODE>.
  12918. </DL>
  12919. The attributes of faces are also per-screen. They can be specified as:
  12920. <PRE>
  12921. Emacs*FACE_NAME.parameter: value
  12922. </PRE>
  12923. <PRE>
  12924. Emacs*SCREEN_NAME*FACE_NAME.parameter: value
  12925. </PRE>
  12926. Faces accept the following resources:
  12927. <DL COMPACT>
  12928. <DT><CODE>attributeFont</CODE> (class <CODE>AttributeFont</CODE>): font-name
  12929. <DD>The font of this face.
  12930. <DT><CODE>attributeForeground</CODE> (class <CODE>AttributeForeground</CODE>): color-name
  12931. <DD><DT><CODE>attributeBackground</CODE> (class <CODE>AttributeBackground</CODE>): color-name
  12932. <DD>The foreground and background colors of this face.
  12933. <DT><CODE>attributeBackgroundPixmap</CODE> (class <CODE>AttributeBackgroundPixmap</CODE>): file-name
  12934. <DD>The name of an XBM file, to use as a background stipple.
  12935. <DT><CODE>attributeUnderline</CODE> (class <CODE>AttributeUnderline</CODE>): boolean
  12936. <DD>Whether text in this face should be underlined.
  12937. </DL>
  12938. All text is displayed in some face, defaulting to the face named
  12939. <CODE>default</CODE>.  To set the font of normal text, use
  12940. <CODE>Emacs*default.attributeFont</CODE>. To set it in the screen named
  12941. <CODE>fred</CODE>, use <CODE>Emacs*fred*default.attributeFont</CODE>.
  12942. These are the names of the predefined faces:
  12943. <DL COMPACT>
  12944. <DT><CODE>default</CODE>
  12945. <DD>Everything inherits from this.
  12946. <DT><CODE>bold</CODE>
  12947. <DD>If this is not specified in the resource database, Emacs tries to find a
  12948. bold version of the font of the default face.
  12949. <DT><CODE>italic</CODE>
  12950. <DD>If this is not specified in the resource database, Emacs tries to find
  12951. an italic version of the font of the default face.
  12952. <DT><CODE>bold-italic</CODE>
  12953. <DD>If this is not specified in the resource database, Emacs tries to find a
  12954. bold-italic version of the font of the default face.
  12955. <DT><CODE>modeline</CODE>
  12956. <DD>This is the face that the modeline is displayed in.  If not specified in
  12957. the resource database, it is determined from the default face by
  12958. reversing the foreground and background colors.
  12959. <DT><CODE>highlight</CODE>
  12960. <DD>This is the face that highlighted extents (for example, Info
  12961. cross-references and possible completions, when the mouse passes over
  12962. them) are displayed in.
  12963. <DT><CODE>left-margin</CODE>
  12964. <DD><DT><CODE>right-margin</CODE>
  12965. <DD>These are the faces that the left and right annotation margins are
  12966. displayed in.
  12967. <DT><CODE>primary-selection</CODE>
  12968. <DD>This is the face that mouse selections are displayed in.
  12969. <DT><CODE>isearch</CODE>
  12970. <DD>This is the face that the matched text being searched for is displayed
  12971. <DT><CODE>info-node</CODE>
  12972. <DD>This is the face of info menu items.  If unspecified, it is copied from
  12973. <CODE>bold-italic</CODE>.
  12974. <DT><CODE>info-xref</CODE>
  12975. <DD>This is the face of info cross-references.  If unspecified, it is copied
  12976. from <CODE>bold</CODE>. (Note that, when the mouse passes over a
  12977. cross-reference, the cross-reference's face is determined from a
  12978. combination of the <CODE>info-xref</CODE> and <CODE>highlight</CODE> faces.)
  12979. </DL>
  12980. Other packages might define their own faces; to see a list of all faces,
  12981. use any of the interactive face-manipulation commands such as
  12982. <CODE>set-face-font</CODE> and type <SAMP>`?'</SAMP> when you are prompted for the
  12983. name of a face.
  12984. <H1><A NAME="SEC300" HREF="xEMACS_TO.HTM#SEC300">Correcting Mistakes (Yours or Emacs's)</A></H1>
  12985.   If you type an Emacs command you did not intend, the results are often
  12986. mysterious.  This chapter discusses how you can undo your mistake or
  12987. recover from a mysterious situation.  Emacs bugs and system crashes are
  12988. also considered.
  12989. <A NAME="IDX1590"></A>
  12990. <H2><A NAME="SEC301" HREF="xEMACS_TO.HTM#SEC301">Quitting and Aborting</A></H2>
  12991. <DL COMPACT>
  12992. <DT><KBD>C-g</KBD>
  12993. <DD>Quit.  Cancel running or partially typed command.
  12994. <DT><KBD>C-]</KBD>
  12995. <DD>Abort innermost recursive editing level and cancel the command which
  12996. invoked it (<CODE>abort-recursive-edit</CODE>).
  12997. <DT><KBD>M-x top-level</KBD>
  12998. <DD>Abort all recursive editing levels that are currently executing.
  12999. <DT><KBD>C-x u</KBD>
  13000. <DD>Cancel an already-executed command, usually (<CODE>undo</CODE>).
  13001. </DL>
  13002.   There are two ways of cancelling commands which are not finished
  13003. executing: <DFN>quitting</DFN> with <KBD>C-g</KBD>, and <DFN>aborting</DFN> with <KBD>C-]</KBD>
  13004. or <KBD>M-x top-level</KBD>.  Quitting is cancelling a partially typed command
  13005. or one which is already running.  Aborting is getting out of a recursive
  13006. editing level and cancelling the command that invoked the recursive edit.
  13007. <A NAME="IDX1591"></A>
  13008. <A NAME="IDX1592"></A>
  13009.   Quitting with <KBD>C-g</KBD> is used for getting rid of a partially typed
  13010. command or a numeric argument that you don't want.  It also stops a
  13011. running command in the middle in a relatively safe way, so you can use
  13012. it if you accidentally start executing a command that takes a long
  13013. time.  In particular, it is safe to quit out of killing; either your
  13014. text will <VAR>all</VAR> still be there, or it will <VAR>all</VAR> be in the kill
  13015. ring (or maybe both).  Quitting an incremental search does special
  13016. things documented under searching; in general, it may take two
  13017. successive <KBD>C-g</KBD> characters to get out of a search.  <KBD>C-g</KBD> works
  13018. by setting the variable <CODE>quit-flag</CODE> to <CODE>t</CODE> the instant
  13019. <KBD>C-g</KBD> is typed; Emacs Lisp checks this variable frequently and quits
  13020. if it is non-<CODE>nil</CODE>.  <KBD>C-g</KBD> is only actually executed as a
  13021. command if it is typed while Emacs is waiting for input.
  13022. If you quit twice in a row before the first <KBD>C-g</KBD> is recognized, you
  13023. activate the "emergency escape" feature and return to the shell.
  13024. See section <A HREF="xEMACS.HTM#SEC307">Emergency Escape</A>.
  13025. <A NAME="IDX1593"></A>
  13026. <A NAME="IDX1594"></A>
  13027. <A NAME="IDX1595"></A>
  13028. <A NAME="IDX1596"></A>
  13029. <A NAME="IDX1597"></A>
  13030.   You can use <KBD>C-]</KBD> (<CODE>abort-recursive-edit</CODE>) to get out
  13031. of a recursive editing level and cancel the command which invoked it.
  13032. Quitting with <KBD>C-g</KBD> does not do this, and could not do this because it
  13033. is used to cancel a partially typed command <I>within</I> the recursive
  13034. editing level.  Both operations are useful.  For example, if you are in the
  13035. Emacs debugger (see section <A HREF="xEMACS.HTM#SEC227">The Emacs-Lisp Debugger</A>) and have typed <KBD>C-u 8</KBD> to enter a
  13036. numeric argument, you can cancel that argument with <KBD>C-g</KBD> and remain in
  13037. the debugger.
  13038. <A NAME="IDX1598"></A>
  13039.   The command <KBD>M-x top-level</KBD> is equivalent to "enough" <KBD>C-]</KBD>
  13040. commands to get you out of all the levels of recursive edits that you are
  13041. in.  <KBD>C-]</KBD> only gets you out one level at a time, but <KBD>M-x top-level</KBD>
  13042. goes out all levels at once.  Both <KBD>C-]</KBD> and <KBD>M-x top-level</KBD> are
  13043. like all other commands and unlike <KBD>C-g</KBD> in that they are effective
  13044. only when Emacs is ready for a command.  <KBD>C-]</KBD> is an ordinary key and
  13045. has its meaning only because of its binding in the keymap.
  13046. See section <A HREF="xEMACS.HTM#SEC267">Recursive Editing Levels</A>.
  13047.   <KBD>C-x u</KBD> (<CODE>undo</CODE>) is not strictly speaking a way of cancelling a
  13048. command, but you can think of it as cancelling a command already finished
  13049. executing.  See section <A HREF="xEMACS.HTM#SEC46">Undoing Changes</A>.
  13050. <H2><A NAME="SEC302" HREF="xEMACS_TO.HTM#SEC302">Dealing With Emacs Trouble</A></H2>
  13051.   This section describes various conditions in which Emacs fails to work,
  13052. and how to recognize them and correct them.
  13053. <H3><A NAME="SEC303" HREF="xEMACS_TO.HTM#SEC303">Recursive Editing Levels</A></H3>
  13054.   Recursive editing levels are important and useful features of Emacs, but
  13055. they can seem like malfunctions to the user who does not understand them.
  13056.   If the mode line has square brackets <SAMP>`[...]'</SAMP> around the parentheses
  13057. that contain the names of the major and minor modes, you have entered a
  13058. recursive editing level.  If you did not do this on purpose, or if you
  13059. don't understand what that means, you should just get out of the recursive
  13060. editing level.  To do so, type <KBD>M-x top-level</KBD>.  This is called getting
  13061. back to top level.  See section <A HREF="xEMACS.HTM#SEC267">Recursive Editing Levels</A>.
  13062. <H3><A NAME="SEC304" HREF="xEMACS_TO.HTM#SEC304">Garbage on the Screen</A></H3>
  13063.   If the data on the screen looks wrong, the first thing to do is see
  13064. whether the text is actually wrong.  Type <KBD>C-l</KBD>, to redisplay the
  13065. entire screen.  If the text appears correct after this, the problem was
  13066. entirely in the previous screen update.
  13067.   Display updating problems often result from an incorrect termcap entry
  13068. for the terminal you are using.  The file <TT>`etc/TERMS'</TT> in the Emacs
  13069. distribution gives the fixes for known problems of this sort.
  13070. <TT>`INSTALL'</TT> contains general advice for these problems in one of its
  13071. sections.  Very likely there is simply insufficient padding for certain
  13072. display operations.  To investigate the possibility that you have this
  13073. sort of problem, try Emacs on another terminal made by a different
  13074. manufacturer.  If problems happen frequently on one kind of terminal but
  13075. not another kind, the real problem is likely to be a bad termcap entry,
  13076. though it could also be due to a bug in Emacs that appears for terminals
  13077. that have or lack specific features.
  13078. <H3><A NAME="SEC305" HREF="xEMACS_TO.HTM#SEC305">Garbage in the Text</A></H3>
  13079.   If <KBD>C-l</KBD> shows that the text is wrong, try undoing the changes to it
  13080. using <KBD>C-x u</KBD> until it gets back to a state you consider correct.  Also
  13081. try <KBD>C-h l</KBD> to find out what command you typed to produce the observed
  13082. results.
  13083.   If a large portion of text appears to be missing at the beginning or
  13084. end of the buffer, check for the word <SAMP>`Narrow'</SAMP> in the mode line.
  13085. If it appears, the text is still present, but marked off-limits.
  13086. To make it visible again, type <KBD>C-x n w</KBD>.  See section <A HREF="xEMACS.HTM#SEC265">Narrowing</A>.
  13087. <H3><A NAME="SEC306" HREF="xEMACS_TO.HTM#SEC306">Spontaneous Entry to Incremental Search</A></H3>
  13088.   If Emacs spontaneously displays <SAMP>`I-search:'</SAMP> at the bottom of the
  13089. screen, it means that the terminal is sending <KBD>C-s</KBD> and <KBD>C-q</KBD>
  13090. according to the poorly designed xon/xoff "flow control" protocol.  You
  13091. should try to prevent this by putting the terminal in a mode where it will
  13092. not use flow control, or by giving it enough padding that it will never send a
  13093. <KBD>C-s</KBD>.  If that cannot be done, you must tell Emacs to expect flow
  13094. control to be used, until you can get a properly designed terminal.
  13095.   Information on how to do these things can be found in the file
  13096. <TT>`INSTALL'</TT> in the Emacs distribution.
  13097. <H3><A NAME="SEC307" HREF="xEMACS_TO.HTM#SEC307">Emergency Escape</A></H3>
  13098.   Because at times there have been bugs causing Emacs to loop without
  13099. checking <CODE>quit-flag</CODE>, a special feature causes Emacs to be suspended
  13100. immediately if you type a second <KBD>C-g</KBD> while the flag is already set,
  13101. so you can always get out of GNU Emacs.  Normally Emacs recognizes and
  13102. clears <CODE>quit-flag</CODE> (and quits!) quickly enough to prevent this from
  13103. happening.
  13104.   When you resume Emacs after a suspension caused by multiple <KBD>C-g</KBD>, it
  13105. asks two questions before going back to what it had been doing:
  13106. <PRE>
  13107. Auto-save? (y or n)
  13108. Abort (and dump core)? (y or n)
  13109. </PRE>
  13110. Answer each one with <KBD>y</KBD> or <KBD>n</KBD> followed by <KBD>RET</KBD>.
  13111.   Saying <KBD>y</KBD> to <SAMP>`Auto-save?'</SAMP> causes immediate auto-saving of all
  13112. modified buffers in which auto-saving is enabled.
  13113.   Saying <KBD>y</KBD> to <SAMP>`Abort (and dump core)?'</SAMP> causes an illegal
  13114. instruction to be executed, dumping core.  This is to enable a wizard to
  13115. figure out why Emacs was failing to quit in the first place.  Execution
  13116. does not continue after a core dump.  If you answer <KBD>n</KBD>, execution
  13117. does continue.  With luck, Emacs will ultimately check
  13118. <CODE>quit-flag</CODE> and quit normally.  If not, and you type another
  13119. <KBD>C-g</KBD>, it is suspended again.
  13120.   If Emacs is not really hung, but is just being slow, you may invoke
  13121. the double <KBD>C-g</KBD> feature without really meaning to.  In that case,
  13122. simply resume and answer <KBD>n</KBD> to both questions, and you will arrive
  13123. at your former state.  Presumably the quit you requested will happen
  13124. soon.
  13125.   The double-<KBD>C-g</KBD> feature may be turned off when Emacs is running under
  13126. a window system, since the window system always enables you to kill Emacs
  13127. or to create another window and run another program.
  13128. <A NAME="IDX1599"></A>
  13129. <A NAME="IDX1600"></A>
  13130. <H3><A NAME="SEC308" HREF="xEMACS_TO.HTM#SEC308">Help for Total Frustration</A></H3>
  13131.   If using Emacs (or something else) becomes terribly frustrating and none
  13132. of the techniques described above solve the problem, Emacs can still help
  13133.   First, if the Emacs you are using is not responding to commands, type
  13134. <KBD>C-g C-g</KBD> to get out of it and then start a new one.
  13135. <A NAME="IDX1601"></A>
  13136.   Second, type <KBD>M-x doctor <KBD>RET</KBD></KBD>.
  13137.   The doctor will make you feel better.  Each time you say something to
  13138. the doctor, you must end it by typing <KBD>RET</KBD> <KBD>RET</KBD>.  This lets the
  13139. doctor know you are finished.
  13140. <H2><A NAME="SEC309" HREF="xEMACS_TO.HTM#SEC309">Reporting Bugs</A></H2>
  13141. <A NAME="IDX1602"></A>
  13142.   Sometimes you will encounter a bug in Emacs.  Although we cannot promise
  13143. we can or will fix the bug, and we might not even agree that it is a bug,
  13144. we want to hear about bugs you encounter in case we do want to fix them.
  13145.   To make it possible for us to fix a bug, you must report it.  In order
  13146. to do so effectively, you must know when and how to do it.
  13147. <H3><A NAME="SEC310" HREF="xEMACS_TO.HTM#SEC310">When Is There a Bug</A></H3>
  13148.   If Emacs executes an illegal instruction, or dies with an operating
  13149. system error message that indicates a problem in the program (as opposed to
  13150. something like "disk full"), then it is certainly a bug.
  13151.   If Emacs updates the display in a way that does not correspond to what is
  13152. in the buffer, then it is certainly a bug.  If a command seems to do the
  13153. wrong thing but the problem corrects itself if you type <KBD>C-l</KBD>, it is a
  13154. case of incorrect display updating.
  13155.   Taking forever to complete a command can be a bug, but you must make
  13156. certain that it was really Emacs's fault.  Some commands simply take a long
  13157. time.  Type <KBD>C-g</KBD> and then <KBD>C-h l</KBD> to see whether the input Emacs
  13158. received was what you intended to type; if the input was such that you
  13159. <VAR>know</VAR> it should have been processed quickly, report a bug.  If you
  13160. don't know whether the command should take a long time, find out by looking
  13161. in the manual or by asking for assistance.
  13162.   If a command you are familiar with causes an Emacs error message in a
  13163. case where its usual definition ought to be reasonable, it is probably a
  13164.   If a command does the wrong thing, that is a bug.  But be sure you know
  13165. for certain what it ought to have done.  If you aren't familiar with the
  13166. command, or don't know for certain how the command is supposed to work,
  13167. then it might actually be working right.  Rather than jumping to
  13168. conclusions, show the problem to someone who knows for certain.
  13169.   Finally, a command's intended definition may not be best for editing
  13170. with.  This is a very important sort of problem, but it is also a matter of
  13171. judgment.  Also, it is easy to come to such a conclusion out of ignorance
  13172. of some of the existing features.  It is probably best not to complain
  13173. about such a problem until you have checked the documentation in the usual
  13174. ways, feel confident that you understand it, and know for certain that what
  13175. you want is not available.  If you are not sure what the command is
  13176. supposed to do after a careful reading of the manual, check the index and
  13177. glossary for any terms that may be unclear.  If you still do not
  13178. understand, this indicates a bug in the manual.  The manual's job is to
  13179. make everything clear.  It is just as important to report documentation
  13180. bugs as program bugs.
  13181.   If the online documentation string of a function or variable disagrees
  13182. with the manual, one of them must be wrong, so report the bug.
  13183. <H3><A NAME="SEC311" HREF="xEMACS_TO.HTM#SEC311">How to Report a Bug</A></H3>
  13184. <A NAME="IDX1603"></A>
  13185.   When you decide that there is a bug, it is important to report it and to
  13186. report it in a way which is useful.  What is most useful is an exact
  13187. description of what commands you type, starting with the shell command to
  13188. run Emacs, until the problem happens.  Always include the version number
  13189. of Emacs that you are using; type <KBD>M-x emacs-version</KBD> to print this.
  13190.   The most important principle in reporting a bug is to report <VAR>facts</VAR>,
  13191. not hypotheses or categorizations.  It is always easier to report the facts,
  13192. but people seem to prefer to strain to posit explanations and report
  13193. them instead.  If the explanations are based on guesses about how Emacs is
  13194. implemented, they will be useless; we will have to try to figure out what
  13195. the facts must have been to lead to such speculations.  Sometimes this is
  13196. impossible.  But in any case, it is unnecessary work for us.
  13197.   For example, suppose that you type <KBD>C-x C-f /glorp/baz.ugh
  13198. <KBD>RET</KBD></KBD>, visiting a file which (you know) happens to be rather large,
  13199. and Emacs prints out <SAMP>`I feel pretty today'</SAMP>.  The best way to report
  13200. the bug is with a sentence like the preceding one, because it gives all the
  13201. facts and nothing but the facts.
  13202.   Do not assume that the problem is due to the size of the file and say,
  13203. "When I visit a large file, Emacs prints out <SAMP>`I feel pretty today'</SAMP>."
  13204. This is what we mean by "guessing explanations".  The problem is just as
  13205. likely to be due to the fact that there is a <SAMP>`z'</SAMP> in the file name.  If
  13206. this is so, then when we got your report, we would try out the problem with
  13207. some "large file", probably with no <SAMP>`z'</SAMP> in its name, and not find
  13208. anything wrong.  There is no way in the world that we could guess that we
  13209. should try visiting a file with a <SAMP>`z'</SAMP> in its name.
  13210.   Alternatively, the problem might be due to the fact that the file starts
  13211. with exactly 25 spaces.  For this reason, you should make sure that you
  13212. inform us of the exact contents of any file that is needed to reproduce the
  13213. bug.  What if the problem only occurs when you have typed the <KBD>C-x a l</KBD>
  13214. command previously?  This is why we ask you to give the exact sequence of
  13215. characters you typed since starting to use Emacs.
  13216.   You should not even say "visit a file" instead of <KBD>C-x C-f</KBD> unless
  13217. you <I>know</I> that it makes no difference which visiting command is used.
  13218. Similarly, rather than saying "if I have three characters on the line,"
  13219. say "after I type <KBD><KBD>RET</KBD> A B C <KBD>RET</KBD> C-p</KBD>," if that is
  13220. the way you entered the text.<P>
  13221.   If you are not in Fundamental mode when the problem occurs, you should
  13222. say what mode you are in.
  13223.   If the manifestation of the bug is an Emacs error message, it is
  13224. important to report not just the text of the error message but a backtrace
  13225. showing how the Lisp program in Emacs arrived at the error.  To make the
  13226. backtrace, you must execute the Lisp expression 
  13227. <CODE>(setq debug-on-error t)</CODE> before the error happens (that is to
  13228. say, you must execute that expression and then make the bug happen).  This
  13229. causes the Lisp debugger to run (see section <A HREF="xEMACS.HTM#SEC227">The Emacs-Lisp Debugger</A>).  The debugger's
  13230. backtrace can be copied as text into the bug report.  This use of the
  13231. debugger is possible only if you know how to make the bug happen again.  Do
  13232. note the error message the first time the bug happens, so if you can't make
  13233. it happen again, you can report at least that.
  13234.   Check whether any programs you have loaded into the Lisp world, including
  13235. your <TT>`.emacs'</TT> file, set any variables that may affect the functioning
  13236. of Emacs.  Also, see whether the problem happens in a freshly started Emacs
  13237. without loading your <TT>`.emacs'</TT> file (start Emacs with the <CODE>-q</CODE> switch
  13238. to prevent loading the init file).  If the problem does <VAR>not</VAR> occur
  13239. then, it is essential that we know the contents of any programs that you
  13240. must load into the Lisp world in order to cause the problem to occur.
  13241.   If the problem does depend on an init file or other Lisp programs that
  13242. are not part of the standard Emacs system, then you should make sure it is
  13243. not a bug in those programs by complaining to their maintainers first.
  13244. After they verify that they are using Emacs in a way that is supposed to
  13245. work, they should report the bug.
  13246.   If you can tell us a way to cause the problem without visiting any files,
  13247. please do so.  This makes it much easier to debug.  If you do need files,
  13248. make sure you arrange for us to see their exact contents.  For example, it
  13249. can often matter whether there are spaces at the ends of lines, or a
  13250. newline after the last line in the buffer (nothing ought to care whether
  13251. the last line is terminated, but tell that to the bugs).
  13252. <A NAME="IDX1604"></A>
  13253. <A NAME="IDX1605"></A>
  13254.   The easy way to record the input to Emacs precisely is to to write a
  13255. dribble file; execute the Lisp expression:
  13256. <PRE>
  13257. (open-dribble-file "~/dribble")
  13258. </PRE>
  13259. using <KBD>Meta-<KBD>ESC</KBD></KBD> or from the <SAMP>`*scratch*'</SAMP> buffer just after starting
  13260. Emacs.  From then on, all Emacs input will be written in the specified
  13261. dribble file until the Emacs process is killed.
  13262. <A NAME="IDX1606"></A>
  13263. <A NAME="IDX1607"></A>
  13264.   For possible display bugs, it is important to report the terminal type
  13265. (the value of environment variable <CODE>TERM</CODE>), the complete termcap entry
  13266. for the terminal from <TT>`/etc/termcap'</TT> (since that file is not identical
  13267. on all machines), and the output that Emacs actually sent to the terminal.
  13268. The way to collect this output is to execute the Lisp expression:
  13269. <PRE>
  13270. (open-termscript "~/termscript")
  13271. </PRE>
  13272. using <KBD>Meta-<KBD>ESC</KBD></KBD> or from the <SAMP>`*scratch*'</SAMP> buffer just
  13273. after starting Emacs.  From then on, all output from Emacs to the terminal
  13274. will be written in the specified termscript file as well, until the Emacs
  13275. process is killed.  If the problem happens when Emacs starts up, put this
  13276. expression into your <TT>`.emacs'</TT> file so that the termscript file will
  13277. be open when Emacs displays the screen for the first time.  Be warned:
  13278. it is often difficult, and sometimes impossible, to fix a terminal-dependent
  13279. bug without access to a terminal of the type that stimulates the bug.<P>
  13280. The newsgroup <SAMP>`alt.lucid-emacs.bug'</SAMP> may be used for bug reports,
  13281. and the newsgroup <SAMP>`alt.lucid-emacs.help'</SAMP> may be used for other
  13282. discussions and requests for assistance.  
  13283. If you don't have access to these newgroups, you can subscribe to the
  13284. mailing list versions: the newsgroups are bidirectionally gatewayed into
  13285. the mailing lists <SAMP>`bug-lucid-emacs@cs.uiuc.edu'</SAMP> and
  13286. <SAMP>`help-lucid-emacs@cs.uiuc.edu'</SAMP> respectively.
  13287. To be added or removed from these mailing lists, send mail to
  13288. <SAMP>`bug-lucid-emacs-request@cs.uiuc.edu'</SAMP> or
  13289. <SAMP>`help-lucid-emacs-request@cs.uiuc.edu'</SAMP>.  Do not send requests for
  13290. addition to the mailing lists themselves.
  13291. The mailing lists and newsgroups are archived on our anonymous FTP server,
  13292. <SAMP>`cs.uiuc.edu'</SAMP>, and at various other archive sites around the net. You 
  13293. should also check the <SAMP>`FAQ'</SAMP> in <SAMP>`/pub/lemacs'</SAMP> on our anonymous 
  13294. FTP server. It provides some introductory information and help for initial 
  13295. configuration problems.
  13296. <H1><A NAME="SEC312" HREF="xEMACS_TO.HTM#SEC312">XEmacs Features</A></H1>
  13297. This section describes the difference between Emacs Version 18 and 
  13298. XEmacs.
  13299. <H2><A NAME="SEC313" HREF="xEMACS_TO.HTM#SEC313">General Changes</A></H2>
  13300. XEmacs has a new vi emulation mode called evi mode.  To
  13301. start evi mode in Emacs, type the command <KBD>M-x evi</KBD>.  If you want
  13302. Emacs to automatically put you in evi-mode all the time, include this
  13303. line in your <TT>`.emacs'</TT> file:
  13304. <PRE>
  13305. (setq term-setup-hook 'evi)
  13306. </PRE>
  13307. See section <A HREF="xEMACS.HTM#SEC272">Using evi Mode</A> for a brief discussion.
  13308. Earlier versions of Emacs only allowed keybindings to ASCII character
  13309. sequences.  XEmacs has greatly expanded this by allowing you to
  13310. use a vector of key sequences which are in turn composed of a modifier
  13311. and a keysym. See section <A HREF="xEMACS.HTM#SEC14">Keystrokes, Key Sequences, and Key Bindings</A> for more information.
  13312. The keymap data structure has been reimplemented to allow the use of a
  13313. character set larger than ASCII. Keymaps are no longer alists and/or
  13314. vectors; they are a new primary data type.  Consequently, code which
  13315. manipulated keymaps with list or array manipulation functions will no
  13316. longer work.  It must use the functions <CODE>define-key</CODE> or
  13317. <CODE>map-keymap</CODE> and <CODE>set-keymap-parent</CODE> (the new keymap
  13318. functions).  See section <A HREF="xEMACS.HTM#SEC284">Customizing Key Bindings</A> for more information.
  13319. Input and display of all ISO-8859-1 characters is supported.
  13320. Multiple fonts, including variable-width fonts, and fonts of differing
  13321. heights, are supported.
  13322. There is a new <TT>`tags'</TT> package and a new UNIX manual browsing
  13323. package. They are similar to earlier versions; for more information look
  13324. at the source code. 
  13325. There is a new implementation of Dired, with many new features. The
  13326. online info for Dired, <I>not</I> the Dired node of Emacs info, provides
  13327. more detail. 
  13328. GNUS (a network news reader), VM (an alternative mail reader), ILISP (a
  13329. package for interacting with inferior Lisp processes), ANGE-FTP (a package
  13330. for making FTP-accessible files appear just like files on the local disk,
  13331. even to Dired), Calendar (an Emacs-based calendar and appointment-
  13332. management tool), and W3 (an interface to the World Wide Web) are a part
  13333. of the XEmacs Lisp library.  See the related documentation in the
  13334. online info browser.
  13335. Emacs now supports floating-point numbers.
  13336. When you send mail, mail aliases are now expanded in the buffer. In
  13337. earlier versions, they were expanded after the mail-sending command was
  13338. executed.
  13339. The initial value of <CODE>load-path</CODE> is computed when Emacs starts up,
  13340. instead of being hardcoded in when Emacs is compiled. As a result, you
  13341. can now move the Emacs executable and Lisp library to a
  13342. different location in the file system without having to recompile.
  13343. Any existing subdirectories of the Emacs Lisp directory are now added to the
  13344. <CODE>load-path</CODE> by default.
  13345. On some machines, you can change the audible bell using the
  13346. <CODE>sound-alist</CODE> variable. See section <A HREF="xEMACS.HTM#SEC296">Changing the Bell Sound</A> for more information. 
  13347. You can use multiple X windows to display multiple Emacs screens. 
  13348. You can use the X selection mechanism to copy material from other
  13349. applications and into other applications.  You can also use all Emacs
  13350. region commands on a region selected with the mouse. See section <A HREF="xEMACS.HTM#SEC66">Selecting Text with the Mouse</A> for more information.
  13351. By default, the variable <CODE>zmacs-regions</CODE> is set to highlight the region
  13352. between point and the mark.  This unifies X selection and Emacs selection
  13353. behavior.  
  13354. XEmacs has a menu bar for mouse-controlled operations in addition to
  13355. keystrokes.  See section <A HREF="xEMACS.HTM#SEC23">XEmacs Pull-down Menus</A>.
  13356. You can look in the file <TT>`/usr/local/lib/xemacs-19.11/etc/Emacs.ad'</TT> for 
  13357. a list of Emacs X resources.  You can set these resources in your X 
  13358. environment to set your preferences for color, fonts, location, and the size 
  13359. of XEmacs screens.  Refer to your X documentation for more information 
  13360. about resources.
  13361. <H2><A NAME="SEC314" HREF="xEMACS_TO.HTM#SEC314">New Commands and Variables</A></H2>
  13362. There are many new functions in XEmacs, and many existing functions
  13363. whose semantics have been expanded.  Most of these are only of interest
  13364. to the Emacs-Lisp programmer; see the NEWS file <KBD>C-h n</KBD> for a complete
  13365. list.  What follows is a partial list of the new interactive commands:
  13366. <A NAME="IDX1609"></A>
  13367. <A NAME="IDX1608"></A>
  13368. <CODE>byte-compile-and-load-file</CODE> and <CODE>byte-compile-buffer</CODE>
  13369. byte-compile the contents of a file or buffer.
  13370. <A NAME="IDX1610"></A>
  13371. The new <CODE>conx</CODE> function lets you generate random sentences for your
  13372. amusement.
  13373. <A NAME="IDX1611"></A>
  13374. <CODE>compile-defun</CODE> compiles and evaluates the current top-level
  13375. form.
  13376. <A NAME="IDX1613"></A>
  13377. <A NAME="IDX1612"></A>
  13378. <CODE>find-this-file</CODE> and <CODE>find-this-file-other-window</CODE> can be used
  13379. interactively with a prefix argument to switch to the filename at point
  13380. in the buffer.  <CODE>find-this-file-other-window</CODE> displays the file in
  13381. another window.
  13382. <A NAME="IDX1615"></A>
  13383. <A NAME="IDX1616"></A>
  13384. <A NAME="IDX1617"></A>
  13385. <A NAME="IDX1618"></A>
  13386. <A NAME="IDX1619"></A>
  13387. <A NAME="IDX1620"></A>
  13388. <A NAME="IDX1621"></A>
  13389. <A NAME="IDX1622"></A>
  13390. <A NAME="IDX1623"></A>
  13391. <A NAME="IDX1624"></A>
  13392. <A NAME="IDX1614"></A>
  13393. Several new functions have been added that allow you to customize the
  13394. color and font attributes of a region of text: <CODE>invert-face</CODE>,
  13395. <CODE>make-face-bold</CODE>, <CODE>make-face-bold-italic</CODE>,
  13396. <CODE>make-face-italic</CODE>, <CODE>make-face-unbold</CODE>,
  13397. <CODE>make-face-unitalic</CODE>, <CODE>set-face-background</CODE>,
  13398. <CODE>set-face-background-pixmap</CODE>, <CODE>set-face-font</CODE>,
  13399. <CODE>set-face-foreground</CODE>, and <CODE>set-face-underline-p</CODE>.
  13400. <A NAME="IDX1626"></A>
  13401. <A NAME="IDX1627"></A>
  13402. <A NAME="IDX1625"></A>
  13403. <CODE>load-default-sounds</CODE> and <CODE>load-sound-file</CODE> allow you to
  13404. customize the audible bell sound.  <CODE>load-default-sounds</CODE> loads and
  13405. installs sound files.  <CODE>load-sound-file</CODE> reads in audio files and
  13406. adds them to the sound alist. <CODE>play-sound</CODE> plays the specified
  13407. sound type.
  13408. <A NAME="IDX1628"></A>
  13409. <CODE>locate-library</CODE> finds the file that the function
  13410. <CODE>load-library</CODE> loads, and it displays the file's full pathname.
  13411. <A NAME="IDX1630"></A>
  13412. <A NAME="IDX1629"></A>
  13413. <CODE>make-directory</CODE> creates a directory, while <CODE>remove-directory</CODE>
  13414. removes a directory.
  13415. <A NAME="IDX1632"></A>
  13416. <A NAME="IDX1631"></A>
  13417. <CODE>mark-beginning-of-buffer</CODE> and <CODE>mark-end-of-buffer</CODE> push the
  13418. mark to the beginning or end of a buffer, respectively.
  13419. <A NAME="IDX1634"></A>
  13420. <A NAME="IDX1635"></A>
  13421. <A NAME="IDX1636"></A>
  13422. <A NAME="IDX1637"></A>
  13423. <A NAME="IDX1638"></A>
  13424. <A NAME="IDX1639"></A>
  13425. <A NAME="IDX1640"></A>
  13426. <A NAME="IDX1641"></A>
  13427. <A NAME="IDX1642"></A>
  13428. <A NAME="IDX1643"></A>
  13429. <A NAME="IDX1644"></A>
  13430. <A NAME="IDX1645"></A>
  13431. <A NAME="IDX1646"></A>
  13432. <A NAME="IDX1647"></A>
  13433. <A NAME="IDX1648"></A>
  13434. <A NAME="IDX1633"></A>
  13435. Several functions have been added that allow you to perform various
  13436. editing, region, and window operations using the mouse:
  13437. <CODE>mouse-del-char</CODE>, <CODE>mouse-delete-window</CODE>,
  13438. <CODE>mouse-keep-one-window</CODE>, <CODE>mouse-kill-line</CODE>,
  13439. <CODE>mouse-line-length</CODE>, <CODE>mouse-scroll</CODE>, <CODE>mouse-select</CODE>,
  13440. <CODE>mouse-select-and-split</CODE>, <CODE>mouse-set-mark</CODE>,
  13441. <CODE>mouse-set-point</CODE>, <CODE>mouse-track</CODE>, <CODE>mouse-track-adjust</CODE>,
  13442. <CODE>mouse-track-and-copy-to-cutbuffer</CODE>,
  13443. <CODE>mouse-track-delete-and-insert</CODE>, <CODE>mouse-track-insert</CODE>, and
  13444. <CODE>mouse-window-to-region</CODE>.
  13445. <A NAME="IDX1649"></A>
  13446. <CODE>compare-windows</CODE> takes an argument <VAR>ignore-whitespace</VAR>.
  13447. The argument means ignore changes in whitespace.
  13448. </UL>
  13449. You can conditionalize your <TT>`.emacs'</TT> file as follows so that XEmacs 
  13450. commands are invoked only when you are in XEmacs:
  13451. <A NAME="IDX1650"></A>
  13452. <PRE>
  13453. (cond ((string-match "Lucid" emacs-version)
  13454.        ;;
  13455.        ;; Code for any version of XEmacs goes here
  13456.        ;;
  13457.        ))
  13458. (cond ((and (string-match "Lucid" emacs-version)
  13459.         (>= emacs-major-version 19)
  13460.         (>= emacs-minor-version 6))
  13461.        ;;
  13462.        ;; Code which requires XEmacs version 19.6 or newer goes here
  13463.        ;;
  13464.        ))
  13465. (cond ((>= emacs-major-version 19)
  13466.        ;;
  13467.        ;; Code for any vintage-19 emacs goes here
  13468.        ;;
  13469.        ))
  13470. (cond ((and (not (string-match "Lucid" emacs-version))
  13471.         (= emacs-major-version 19))
  13472.        ;;
  13473.        ;; Code specific to FSF Emacs 19 (not XEmacs) goes here
  13474.        ;;
  13475.        ))
  13476. (cond ((< emacs-major-version 19)
  13477.        ;;
  13478.        ;; Code specific to emacs 18 goes here
  13479.        ;;
  13480.        ))
  13481. </PRE>
  13482. Of particular interest for use in <TT>`.emacs'</TT> files are:
  13483. <A NAME="IDX1651"></A>
  13484. <A NAME="IDX1652"></A>
  13485. <A NAME="IDX1653"></A>
  13486. <A NAME="IDX1654"></A>
  13487. <A NAME="IDX1655"></A>
  13488. <A NAME="IDX1656"></A>
  13489. <CODE>add-menu</CODE> lets you add a new menu to the menubar or a submenu to a
  13490. pull-down menu.  <CODE>add-menu-item</CODE>, <CODE>disable-menu-item</CODE>,
  13491. <CODE>delete-menu-item</CODE>, <CODE>enable-menu-item</CODE>, and
  13492. <CODE>relabel-menu-item</CODE> allow you to customize the XEmacs
  13493. pull-down menus.
  13494. <A NAME="IDX1657"></A>
  13495. <CODE>make-screen</CODE> creates a new Emacs screen (X window).
  13496. </UL>
  13497. These new variables are only present in XEmacs:
  13498. <A NAME="IDX1658"></A>
  13499. <CODE>minibuffer-confirm-incomplete</CODE> prompts for confirmation in 
  13500. contexts where <CODE>completing-read</CODE> allows answers that are not valid
  13501. completions.
  13502. <A NAME="IDX1660"></A>
  13503. <A NAME="IDX1661"></A>
  13504. <A NAME="IDX1662"></A>
  13505. <A NAME="IDX1663"></A>
  13506. <A NAME="IDX1659"></A>
  13507. Several variables have been added that allow you to customize the color
  13508. and shape of the mouse pointer: <CODE>x-pointer-background-color</CODE>,
  13509. <CODE>x-pointer-foreground-color</CODE>, <CODE>x-mode-pointer-shape</CODE>,
  13510. <CODE>x-pointer-shape</CODE>, and <BR> <CODE>x-nontext-pointer-shape</CODE>.
  13511. <A NAME="IDX1664"></A>
  13512. <CODE>zmacs-regions</CODE> determines whether LISPM-style active regions
  13513. should be used.
  13514. </UL>
  13515. <H2><A NAME="SEC315" HREF="xEMACS_TO.HTM#SEC315">Changes in Key Bindings</A></H2>
  13516. XEmacs has the following new default function keybindings:
  13517. <DL COMPACT>
  13518. <DT><KBD><KBD>HELP</KBD></KBD>
  13519. <DD>Same as <KBD>C-h</KBD>.
  13520. <DT><KBD><KBD>UNDO</KBD></KBD>
  13521. <DD>Same as <KBD>M-x undo</KBD>.
  13522. <DT><KBD><KBD>CUT</KBD></KBD>
  13523. <DD>Same as the Cut menu item; that is, it copies the selected text to
  13524. the X Clipboard selection.
  13525. <DT><KBD><KBD>COPY</KBD></KBD>
  13526. <DD>Same as the Copy menu item.
  13527. <DT><KBD><KBD>PASTE</KBD></KBD>
  13528. <DD>Same as the Paste menu item.
  13529. <DT><KBD><KBD>PGUP</KBD></KBD>
  13530. <DD>Same as <KBD>M-v</KBD>.
  13531. <DT><KBD><KBD>PGDN</KBD></KBD>
  13532. <DD>Same as <KBD>C-v</KBD>.
  13533. <DT><KBD><KBD>HOME</KBD></KBD>
  13534. <DD>Same as <KBD>M-<</KBD>.
  13535. <DT><KBD><KBD>END</KBD></KBD>
  13536. <DD>Same as <KBD>M-></KBD>.
  13537. <DT><KBD><KBD>LEFT-ARROW</KBD></KBD>
  13538. <DD>Same as the function <CODE>backward-char</CODE>.
  13539. <DT><KBD><KBD>RIGHT-ARROW</KBD></KBD>
  13540. <DD>Same as the function <CODE>forward-char</CODE>.
  13541. <DT><KBD><KBD>UP-ARROW</KBD></KBD>
  13542. <DD>Same as the function <CODE>previous-line</CODE>.
  13543. <DT><KBD><KBD>DOWN-ARROW</KBD></KBD>
  13544. <DD>Same as the function <CODE>next-line</CODE>.
  13545. </DL>
  13546. <H1><A NAME="SEC316" HREF="xEMACS_TO.HTM#SEC316">Glossary</A></H1>
  13547. <DL COMPACT>
  13548. <DT>Abbrev
  13549. <DD>An abbrev is a text string which expands into a different text string
  13550. when present in the buffer.  For example, you might define a short
  13551. word as an abbrev for a long phrase that you want to insert
  13552. frequently.  See section <A HREF="xEMACS.HTM#SEC230">Abbrevs</A>.
  13553. <DT>Aborting
  13554. <DD>Aborting means getting out of a recursive edit (q.v.).  You can use
  13555. the commands <KBD>C-]</KBD> and <KBD>M-x top-level</KBD> for this.
  13556. See section <A HREF="xEMACS.HTM#SEC301">Quitting and Aborting</A>.
  13557. <DT>Auto Fill mode
  13558. <DD>Auto Fill mode is a minor mode in which text you insert is
  13559. automatically broken into lines of fixed width.  See section <A HREF="xEMACS.HTM#SEC179">Filling Text</A>.
  13560. <DT>Auto Saving
  13561. <DD>Auto saving means that Emacs automatically stores the contents of an
  13562. Emacs buffer in a specially-named file so the information will not be
  13563. lost if the buffer is lost due to a system error or user error.
  13564. See section <A HREF="xEMACS.HTM#SEC122">Auto-Saving: Protection Against Disasters</A>.
  13565. <DT>Backup File
  13566. <DD>A backup file records the contents that a file had before the current
  13567. editing session.  Emacs creates backup files automatically to help you
  13568. track down or cancel changes you later regret.  See section <A HREF="xEMACS.HTM#SEC116">Backup Files</A>.
  13569. <DT>Balance Parentheses
  13570. <DD>Emacs can balance parentheses manually or automatically.  Manual
  13571. balancing is done by the commands to move over balanced expressions
  13572. (see section <A HREF="xEMACS.HTM#SEC186">Lists and Sexps</A>).  Automatic balancing is done by blinking the
  13573. parenthesis that matches one just inserted (see section <A HREF="xEMACS.HTM#SEC193">Automatic Display of Matching Parentheses</A>).
  13574. <DT>Bind
  13575. <DD>To bind a key is to change its binding (q.v.).  See section <A HREF="xEMACS.HTM#SEC286">Changing Key Bindings Interactively</A>.
  13576. <DT>Binding
  13577. <DD>A key gets its meaning in Emacs by having a binding which is a
  13578. command (q.v.), a Lisp function that is run when the key is typed.
  13579. See section <A HREF="xEMACS.HTM#SEC22">Keys and Commands</A>.  Customization often involves rebinding a
  13580. character to a different command function.  The bindings of all keys
  13581. are recorded in the keymaps (q.v.).  See section <A HREF="xEMACS.HTM#SEC285">Keymaps</A>.
  13582. <DT>Blank Lines
  13583. <DD>Blank lines are lines that contain only whitespace.  Emacs has several
  13584. commands for operating on the blank lines in a buffer.
  13585. <DT>Buffer
  13586. <DD>The buffer is the basic editing unit; one buffer corresponds to one
  13587. piece of text being edited.  You can have several buffers, but at any
  13588. time you are editing only one, the `selected' buffer, though several
  13589. buffers can be visible when you are using multiple windows.  See section <A HREF="xEMACS.HTM#SEC147">Using Multiple Buffers</A>.
  13590. <DT>Buffer Selection History
  13591. <DD>Emacs keeps a buffer selection history which records how recently each
  13592. Emacs buffer was selected.  Emacs uses this list when choosing a buffer to
  13593. select.  See section <A HREF="xEMACS.HTM#SEC147">Using Multiple Buffers</A>.
  13594. <DT>C-
  13595. <DD><SAMP>`C'</SAMP> in the name of a character is an abbreviation for Control.
  13596. See section <A HREF="xEMACS.HTM#SEC14">Keystrokes, Key Sequences, and Key Bindings</A>.
  13597. <DT>C-M-
  13598. <DD><SAMP>`C-M-'</SAMP> in the name of a character is an abbreviation for
  13599. Control-Meta.  See section <A HREF="xEMACS.HTM#SEC14">Keystrokes, Key Sequences, and Key Bindings</A>.
  13600. <DT>Case Conversion
  13601. <DD>Case conversion means changing text from upper case to lower case or
  13602. vice versa.  See section <A HREF="xEMACS.HTM#SEC183">Case Conversion Commands</A>, for the commands for case conversion.
  13603. <DT>Characters
  13604. <DD>Characters form the contents of an Emacs buffer; also, Emacs commands
  13605. are invoked by keys (q.v.), which are sequences of one or more
  13606. characters.  See section <A HREF="xEMACS.HTM#SEC14">Keystrokes, Key Sequences, and Key Bindings</A>.
  13607. <DT>Command
  13608. <DD>A command is a Lisp function specially defined to be able to serve as a
  13609. key binding in Emacs.  When you type a key (q.v.), Emacs looks up its
  13610. binding (q.v.) in the relevant keymaps (q.v.) to find the command to
  13611. run.  See section <A HREF="xEMACS.HTM#SEC22">Keys and Commands</A>.
  13612. <DT>Command Name
  13613. <DD>A command name is the name of a Lisp symbol which is a command
  13614. (see section <A HREF="xEMACS.HTM#SEC22">Keys and Commands</A>).  You can invoke any command by its name using
  13615. <KBD>M-x</KBD> (see section <A HREF="xEMACS.HTM#SEC54">Running Commands by Name</A>).
  13616. <DT>Comments
  13617. <DD>A comment is text in a program which is intended only for the people
  13618. reading the program, and is marked specially so that it will be
  13619. ignored when the program is loaded or compiled.  Emacs offers special
  13620. commands for creating, aligning, and killing comments.
  13621. See section <A HREF="xEMACS.HTM#SEC194">Manipulating Comments</A>.
  13622. <DT>Compilation
  13623. <DD>Compilation is the process of creating an executable program from
  13624. source code.  Emacs has commands for compiling files of Emacs Lisp
  13625. code (see section <A HREF="xEMACS.HTM#SEC222">Libraries of Lisp Code for Emacs</A>) and programs in C and other languages
  13626. (see section <A HREF="xEMACS.HTM#SEC220">Running `make', or Compilers Generally</A>).
  13627. <DT>Complete Key
  13628. <DD>A complete key is a character or sequence of characters which, when typed
  13629. by the user, fully specifies one action to be performed by Emacs.  For
  13630. example, <KBD>X</KBD> and <KBD>Control-f</KBD> and <KBD>Control-x m</KBD> are keys.  Keys
  13631. derive their meanings from being bound (q.v.) to commands (q.v.).
  13632. Thus, <KBD>X</KBD> is conventionally bound to a command to insert <SAMP>`X'</SAMP> in
  13633. the buffer; <KBD>C-x m</KBD> is conventionally bound to a command to begin
  13634. composing a mail message. See section <A HREF="xEMACS.HTM#SEC14">Keystrokes, Key Sequences, and Key Bindings</A>.
  13635. <DT>Completion
  13636. <DD>When Emacs automatically fills an abbreviation for a name into the
  13637. entire name, that process is called completion.  Completion is done for
  13638. minibuffer (q.v.) arguments when the set of possible valid inputs is
  13639. known; for example, on command names, buffer names, and file names.
  13640. Completion occurs when you type <KBD>TAB</KBD>, <KBD>SPC</KBD>, or <KBD>RET</KBD>.
  13641. See section <A HREF="xEMACS.HTM#SEC50">Completion</A>.
  13642. <DT>Continuation Line
  13643. <DD>When a line of text is longer than the width of the screen, it
  13644. takes up more than one screen line when displayed.  We say that the
  13645. text line is continued, and all screen lines used for it after the
  13646. first are called continuation lines.  See section <A HREF="xEMACS.HTM#SEC36">Basic Editing Commands</A>.
  13647. <DT>Control-Character
  13648. <DD>ASCII characters with octal codes 0 through 037, and also code 0177,
  13649. do not have graphic images assigned to them.  These are the control
  13650. characters.  Any control character can be typed by holding down the
  13651. <KBD>CTRL</KBD> key and typing some other character; some have special keys
  13652. on the keyboard.  <KBD>RET</KBD>, <KBD>TAB</KBD>, <KBD>ESC</KBD>, <KBD>LFD</KBD>, and
  13653. <KBD>DEL</KBD> are all control characters.  See section <A HREF="xEMACS.HTM#SEC14">Keystrokes, Key Sequences, and Key Bindings</A>.
  13654. <DT>Copyleft
  13655. <DD>A copyleft is a notice giving the public legal permission to redistribute
  13656. a program or other work of art.  Copylefts are used by leftists to enrich
  13657. the public just as copyrights are used by rightists to gain power over
  13658. the public.
  13659. <DT>Current Buffer
  13660. <DD>The current buffer in Emacs is the Emacs buffer on which most editing
  13661. commands operate.  You can select any Emacs buffer as the current one.
  13662. See section <A HREF="xEMACS.HTM#SEC147">Using Multiple Buffers</A>.
  13663. <DT>Current Line
  13664. <DD>The line point is on (see section <A HREF="xEMACS.HTM#SEC10">Point</A>).
  13665. <DT>Current Paragraph
  13666. <DD>The paragraph that point is in.  If point is between paragraphs, the
  13667. current paragraph is the one that follows point.  See section <A HREF="xEMACS.HTM#SEC177">Paragraphs</A>.
  13668. <DT>Current Defun
  13669. <DD>The defun (q.v.) that point is in.  If point is between defuns, the
  13670. current defun is the one that follows point.  See section <A HREF="xEMACS.HTM#SEC187">Defuns</A>.
  13671. <DT>Cursor
  13672. <DD>The cursor is the rectangle on the screen which indicates the position
  13673. called point (q.v.) at which insertion and deletion takes place.
  13674. The cursor is on or under the character that follows point.  Often
  13675. people speak of `the cursor' when, strictly speaking, they mean
  13676. `point'.  See section <A HREF="xEMACS.HTM#SEC36">Basic Editing Commands</A>.
  13677. <DT>Customization
  13678. <DD>Customization is making minor changes in the way Emacs works.  It is
  13679. often done by setting variables (see section <A HREF="xEMACS.HTM#SEC275">Variables</A>) or by rebinding
  13680. keys (see section <A HREF="xEMACS.HTM#SEC285">Keymaps</A>).
  13681. <DT>Default Argument
  13682. <DD>The default for an argument is the value that is used if you do not
  13683. specify one.  When Emacs prompts you in the minibuffer for an argument,
  13684. the default argument is used if you just type <KBD>RET</KBD>.
  13685. See section <A HREF="xEMACS.HTM#SEC47">The Minibuffer</A>.
  13686. <DT>Default Directory
  13687. <DD>When you specify a file name that does not start with <SAMP>`/'</SAMP> or <SAMP>`~'</SAMP>,
  13688. it is interpreted relative to the current buffer's default directory.
  13689. See section <A HREF="xEMACS.HTM#SEC48">Minibuffers for File Names</A>.
  13690. <DT>Defun
  13691. <DD>A defun is a list at the top level of parenthesis or bracket structure
  13692. in a program.  It is so named because most such lists in Lisp programs
  13693. are calls to the Lisp function <CODE>defun</CODE>.  See section <A HREF="xEMACS.HTM#SEC187">Defuns</A>.
  13694. <DT><KBD>DEL</KBD>
  13695. <DD>The <KBD>DEL</KBD> character runs the command that deletes one character of
  13696. text.  See section <A HREF="xEMACS.HTM#SEC36">Basic Editing Commands</A>.
  13697. <DT>Deletion
  13698. <DD>Deleting text means erasing it without saving it.  Emacs deletes text
  13699. only when it is expected not to be worth saving (all whitespace, or
  13700. only one character).  The alternative is killing (q.v.).
  13701. See section <A HREF="xEMACS.HTM#SEC69">Deletion and Killing</A>.
  13702. <DT>Deletion of Files
  13703. <DD>Deleting a file means removing it from the file system.
  13704. See section <A HREF="xEMACS.HTM#SEC146">Miscellaneous File Operations</A>.
  13705. <DT>Deletion of Messages
  13706. <DD>Deleting a message means flagging it to be eliminated from your mail
  13707. file.  Until the mail file is expunged, you can undo this by undeleting
  13708. the message.  See section <A HREF="xEMACS.HTM#SEC248">Deleting Messages</A>.
  13709. <DT>Deletion of Screens
  13710. <DD>When working under the multi-screen X-based version of XEmacs,
  13711. you can delete individual screens using the <B>Close</B> menu item from the
  13712. <B>File</B> menu.
  13713. <DT>Deletion of Windows
  13714. <DD>When you delete a subwindow of an Emacs screen, you eliminate it from
  13715. the screen.  Other windows expand to use up the space.  The deleted
  13716. window can never come back, but no actual text is lost.  See section <A HREF="xEMACS.HTM#SEC153">Multiple Windows</A>.
  13717. <DT>Directory
  13718. <DD>Files in the Unix file system are grouped into file directories.
  13719. See section <A HREF="xEMACS.HTM#SEC139">Listing a File Directory</A>.
  13720. <DT>Dired
  13721. <DD>Dired is the Emacs facility that displays the contents of a file
  13722. directory and allows you to "edit the directory", performing
  13723. operations on the files in the directory.  See section <A HREF="xEMACS.HTM#SEC141">Dired, the Directory Editor</A>.
  13724. <DT>Disabled Command
  13725. <DD>A disabled command is one that you may not run without special
  13726. confirmation.  Commands are usually disabled because they are
  13727. confusing for beginning users.  See section <A HREF="xEMACS.HTM#SEC288">Disabling Commands</A>.
  13728. <DT>Dribble File
  13729. <DD>A file into which Emacs writes all the characters that the user types
  13730. on the keyboard.  Dribble files are used to make a record for
  13731. debugging Emacs bugs.  Emacs does not make a dribble file unless you
  13732. tell it to.  See section <A HREF="xEMACS.HTM#SEC309">Reporting Bugs</A>.
  13733. <DT>Echo Area
  13734. <DD>The area at the bottom of the Emacs screen which is used for echoing the
  13735. arguments to commands, for asking questions, and for printing brief
  13736. messages (including error messages).  See section <A HREF="xEMACS.HTM#SEC11">The Echo Area</A>.
  13737. <DT>Echoing
  13738. <DD>Echoing refers to acknowledging the receipt of commands by displaying them
  13739. (in the echo area).  Emacs never echoes single-character keys; longer
  13740. keys echo only if you pause while typing them.
  13741. <DT>Error
  13742. <DD>An error occurs when an Emacs command cannot execute in the current
  13743. circumstances.  When an error occurs, execution of the command stops
  13744. (unless the command has been programmed to do otherwise) and Emacs
  13745. reports the error by printing an error message (q.v.).  Type-ahead
  13746. is discarded.  Then Emacs is ready to read another editing command.
  13747. <DT>Error Messages
  13748. <DD>Error messages are single lines of output printed by Emacs when the
  13749. user asks for something impossible to do (such as killing text
  13750. forward when point is at the end of the buffer).  They appear in the
  13751. echo area, accompanied by a beep.
  13752. <DT><KBD>ESC</KBD>
  13753. <DD><KBD>ESC</KBD> is a character used as a prefix for typing Meta characters on
  13754. keyboards lacking a <KBD>META</KBD> key.  Unlike the <KBD>META</KBD> key (which,
  13755. like the <KBD>SHIFT</KBD> key, is held down while another character is
  13756. typed), the <KBD>ESC</KBD> key is pressed and released, and applies to the
  13757. next character typed. 
  13758. <DT>Fill Prefix
  13759. <DD>The fill prefix is a string that Emacs enters at the beginning
  13760. of each line when it performs filling.  It is not regarded as part of the
  13761. text to be filled.  See section <A HREF="xEMACS.HTM#SEC179">Filling Text</A>.
  13762. <DT>Filling
  13763. <DD>Filling text means moving text from line to line so that all the lines
  13764. are approximately the same length.  See section <A HREF="xEMACS.HTM#SEC179">Filling Text</A>.
  13765. <DT>Global
  13766. <DD>Global means `independent of the current environment; in effect
  13767. <BR>throughout Emacs'.  It is the opposite of local (q.v.).
  13768. Examples of the use of `global' appear below.
  13769. <DT>Global Abbrev
  13770. <DD>A global definition of an abbrev (q.v.) is effective in all major
  13771. modes that do not have local (q.v.) definitions for the same abbrev.
  13772. See section <A HREF="xEMACS.HTM#SEC230">Abbrevs</A>.
  13773. <DT>Global Keymap
  13774. <DD>The global keymap (q.v.) contains key bindings that are in effect
  13775. unless local key bindings in a major mode's local
  13776. keymap (q.v.) override them.See section <A HREF="xEMACS.HTM#SEC285">Keymaps</A>.
  13777. <DT>Global Substitution
  13778. <DD>Global substitution means replacing each occurrence of one string by
  13779. another string through a large amount of text.  See section <A HREF="xEMACS.HTM#SEC101">Replacement Commands</A>.
  13780. <DT>Global Variable
  13781. <DD>The global value of a variable (q.v.) takes effect in all buffers
  13782. that do not have their own local (q.v.) values for the variable.
  13783. See section <A HREF="xEMACS.HTM#SEC275">Variables</A>.
  13784. <DT>Graphic Character
  13785. <DD>Graphic characters are those assigned pictorial images rather than
  13786. just names.  All the non-Meta (q.v.) characters except for the
  13787. Control (q.v.) character are graphic characters.  These include
  13788. letters, digits, punctuation, and spaces; they do not include
  13789. <KBD>RET</KBD> or <KBD>ESC</KBD>.  In Emacs, typing a graphic character inserts
  13790. that character (in ordinary editing modes).  See section <A HREF="xEMACS.HTM#SEC36">Basic Editing Commands</A>.
  13791. <DT>Grinding
  13792. <DD>Grinding means adjusting the indentation in a program to fit the
  13793. nesting structure.  See section <A HREF="xEMACS.HTM#SEC161">Indentation</A>.
  13794. <DT>Hardcopy
  13795. <DD>Hardcopy means printed output.  Emacs has commands for making printed
  13796. listings of text in Emacs buffers.  See section <A HREF="xEMACS.HTM#SEC266">Hardcopy Output</A>.
  13797. <DT><KBD>HELP</KBD>
  13798. <DD>You can type <KBD>HELP</KBD> at any time to ask what options you have, or
  13799. to ask what any command does.  <KBD>HELP</KBD> is really <KBD>Control-h</KBD>.
  13800. See section <A HREF="xEMACS.HTM#SEC55">Help</A>.
  13801. <DT>Inbox
  13802. <DD>An inbox is a file in which mail is delivered by the operating system.
  13803. Rmail transfers mail from inboxes to mail files (q.v.) in which the
  13804. mail is then stored permanently or until explicitly deleted.
  13805. See section <A HREF="xEMACS.HTM#SEC249">Rmail Files and Inboxes</A>.
  13806. <DT>Indentation
  13807. <DD>Indentation means blank space at the beginning of a line.  Most
  13808. programming languages have conventions for using indentation to
  13809. illuminate the structure of the program, and Emacs has special
  13810. features to help you set up the correct indentation.
  13811. See section <A HREF="xEMACS.HTM#SEC161">Indentation</A>.
  13812. <DT>Insertion
  13813. <DD>Insertion means copying text into the buffer, either from the keyboard
  13814. or from some other place in Emacs.
  13815. <DT>Justification
  13816. <DD>Justification means adding extra spaces to lines of text to make them
  13817. come exactly to a specified width.  See section <A HREF="xEMACS.HTM#SEC179">Filling Text</A>.
  13818. <DT>Keyboard Macros
  13819. <DD>Keyboard macros are a way of defining new Emacs commands from
  13820. sequences of existing ones, with no need to write a Lisp program.
  13821. See section <A HREF="xEMACS.HTM#SEC280">Keyboard Macros</A>.
  13822. <DT>Key
  13823. <DD>A key is a sequence of characters that, when input to Emacs, specify
  13824. or begin to specify a single action for Emacs to perform.  That is,
  13825. the sequence is considered a single unit.  If the key is enough to
  13826. specify one action, it is a complete key (q.v.); if it is less than
  13827. enough, it is a prefix key (q.v.).  See section <A HREF="xEMACS.HTM#SEC14">Keystrokes, Key Sequences, and Key Bindings</A>.
  13828. <DT>Keymap
  13829. <DD>The keymap is the data structure that records the bindings (q.v.) of
  13830. keys to the commands that they run.  For example, the keymap binds the
  13831. character <KBD>C-n</KBD> to the command function <CODE>next-line</CODE>.
  13832. See section <A HREF="xEMACS.HTM#SEC285">Keymaps</A>.
  13833. <DT>Kill Ring
  13834. <DD>The kill ring is the place where all text you have killed recently is saved.
  13835. You can re-insert any of the killed text still in the ring; this is
  13836. called yanking (q.v.).  See section <A HREF="xEMACS.HTM#SEC73">Yanking</A>.
  13837. <DT>Killing
  13838. <DD>Killing means erasing text and saving it on the kill ring so it can be
  13839. yanked (q.v.) later.  Some other systems call this "cutting."
  13840. Most Emacs commands to erase text do killing, as opposed to deletion
  13841. (q.v.).  See section <A HREF="xEMACS.HTM#SEC69">Deletion and Killing</A>.
  13842. <DT>Killing Jobs
  13843. <DD>Killing a job (such as, an invocation of Emacs) means making it cease
  13844. to exist.  Any data within it, if not saved in a file, is lost.
  13845. See section <A HREF="xEMACS.HTM#SEC31">Exiting Emacs</A>.
  13846. <DT>List
  13847. <DD>A list is, approximately, a text string beginning with an open
  13848. parenthesis and ending with the matching close parenthesis.  In C mode
  13849. and other non-Lisp modes, groupings surrounded by other kinds of matched
  13850. delimiters appropriate to the language, such as braces, are also
  13851. considered lists.  Emacs has special commands for many operations on
  13852. lists.  See section <A HREF="xEMACS.HTM#SEC186">Lists and Sexps</A>.
  13853. <DT>Local
  13854. <DD>Local means `in effect only in a particular context'; the relevant
  13855. kind of context is a particular function execution, a particular
  13856. buffer, or a particular major mode.  Local is the opposite of `global'
  13857. (q.v.).  Specific uses of `local' in Emacs terminology appear below.
  13858. <DT>Local Abbrev
  13859. <DD>A local abbrev definition is effective only if a particular major mode
  13860. is selected.  In that major mode, it overrides any global definition
  13861. for the same abbrev.  See section <A HREF="xEMACS.HTM#SEC230">Abbrevs</A>.
  13862. <DT>Local Keymap
  13863. <DD>A local keymap is used in a particular major mode; the key bindings
  13864. (q.v.) in the current local keymap override global bindings of the
  13865. same keys.  See section <A HREF="xEMACS.HTM#SEC285">Keymaps</A>.
  13866. <DT>Local Variable
  13867. <DD>A local value of a variable (q.v.) applies to only one buffer.
  13868. See section <A HREF="xEMACS.HTM#SEC278">Local Variables</A>.
  13869. <DT>M-
  13870. <DD><KBD>M-</KBD> in the name of a character is an abbreviation for <KBD>META</KBD>,
  13871. one of the modifier keys that can accompany any character.
  13872. See section <A HREF="xEMACS.HTM#SEC14">Keystrokes, Key Sequences, and Key Bindings</A>.
  13873. <DT>M-C-
  13874. <DD><SAMP>`M-C-'</SAMP> in the name of a character is an abbreviation for
  13875. Control-Meta; it means the same thing as <SAMP>`C-M-'</SAMP>.  If your
  13876. terminal lacks a real <KBD>META</KBD> key, you type a Control-Meta character by
  13877. typing <KBD>ESC</KBD> and then typing the corresponding Control character.
  13878. See section <A HREF="xEMACS.HTM#SEC14">Keystrokes, Key Sequences, and Key Bindings</A>.
  13879. <DT>M-x
  13880. <DD><KBD>M-x</KBD> is the key which is used to call an Emacs command by name.
  13881. You use it to call commands that are not bound to keys.
  13882. See section <A HREF="xEMACS.HTM#SEC54">Running Commands by Name</A>.
  13883. <DT>Mail
  13884. <DD>Mail means messages sent from one user to another through the computer
  13885. system, to be read at the recipient's convenience.  Emacs has commands for
  13886. composing and sending mail, and for reading and editing the mail you have
  13887. received.  See section <A HREF="xEMACS.HTM#SEC241">Sending Mail</A>.  See section <A HREF="xEMACS.HTM#SEC245">Reading Mail With Rmail</A>, for how to read mail.
  13888. <DT>Mail File
  13889. <DD>A mail file is a file which is edited using Rmail and in which Rmail
  13890. stores mail.  See section <A HREF="xEMACS.HTM#SEC245">Reading Mail With Rmail</A>.
  13891. <DT>Major Mode
  13892. <DD>The major modes are a mutually exclusive set of options each of which
  13893. configures Emacs for editing a certain sort of text.  Ideally, each
  13894. programming language has its own major mode.  See section <A HREF="xEMACS.HTM#SEC159">Major Modes</A>.
  13895. <DT>Mark
  13896. <DD>The mark points to a position in the text.  It specifies one end of the
  13897. region (q.v.), point being the other end.  Many commands operate on
  13898. the whole region, that is, all the text from point to the mark.
  13899. See section <A HREF="xEMACS.HTM#SEC60">Selecting Text</A>.
  13900. <DT>Mark Ring
  13901. <DD>The mark ring is used to hold several recent previous locations of the
  13902. mark, just in case you want to move back to them.  See section <A HREF="xEMACS.HTM#SEC65">The Mark Ring</A>.
  13903. <DT>Message
  13904. <DD>See `mail'.
  13905. <DT>Meta
  13906. <DD>Meta is the name of a modifier bit which a command character may have.
  13907. It is present in a character if the character is typed with the
  13908. <KBD>META</KBD> key held down.  Such characters are given names that start
  13909. with <KBD>Meta-</KBD>.  For example, <KBD>Meta-<</KBD> is typed by holding down
  13910. <KBD>META</KBD> and at the same time typing <KBD><</KBD> (which itself is done,
  13911. on most terminals, by holding down <KBD>SHIFT</KBD> and typing <KBD>,</KBD>).
  13912. See section <A HREF="xEMACS.HTM#SEC14">Keystrokes, Key Sequences, and Key Bindings</A>.
  13913. <DT>Meta Character
  13914. <DD>A Meta character is one whose character code includes the Meta bit.
  13915. <DT>Minibuffer
  13916. <DD>The minibuffer is the window that Emacs displays inside the
  13917. echo area (q.v.) when it prompts you for arguments to commands.
  13918. See section <A HREF="xEMACS.HTM#SEC47">The Minibuffer</A>.
  13919. <DT>Minor Mode
  13920. <DD>A minor mode is an optional feature of Emacs which can be switched on
  13921. or off independent of the major mode.  Each minor mode has a
  13922. command to turn it on or off.  See section <A HREF="xEMACS.HTM#SEC274">Minor Modes</A>.
  13923. <DT>Mode Line
  13924. <DD>The mode line is the line at the bottom of each text window (q.v.),
  13925. which gives status information on the buffer displayed in that window.
  13926. See section <A HREF="xEMACS.HTM#SEC12">The Mode Line</A>.
  13927. <DT>Modified Buffer
  13928. <DD>A buffer (q.v.) is modified if its text has been changed since the
  13929. last time the buffer was saved (or since it was created, if it
  13930. has never been saved).  See section <A HREF="xEMACS.HTM#SEC115">Saving Files</A>.
  13931. <DT>Moving Text
  13932. <DD>Moving text means erasing it from one place and inserting it in
  13933. another.  This is done by killing (q.v.) and then yanking (q.v.).
  13934. See section <A HREF="xEMACS.HTM#SEC69">Deletion and Killing</A>.
  13935. <DT>Named Mark
  13936. <DD>A named mark is a register (q.v.) in its role of recording a
  13937. location in text so that you can move point to that location.
  13938. See section <A HREF="xEMACS.HTM#SEC84">Registers</A>.
  13939. <DT>Narrowing
  13940. <DD>Narrowing means creating a restriction (q.v.) that limits editing in
  13941. the current buffer to only a part of the text in the buffer.  Text
  13942. outside that part is inaccessible to the user until the boundaries are
  13943. widened again, but it is still there, and saving the file saves the
  13944. invisible text.  See section <A HREF="xEMACS.HTM#SEC265">Narrowing</A>.
  13945. <DT>Newline
  13946. <DD><KBD>LFD</KBD> characters in the buffer terminate lines of text and are
  13947. called newlines.  See section <A HREF="xEMACS.HTM#SEC14">Keystrokes, Key Sequences, and Key Bindings</A>.
  13948. <DT>Numeric Argument
  13949. <DD>A numeric argument is a number, specified before a command, to change
  13950. the effect of the command.  Often the numeric argument serves as a
  13951. repeat count.  See section <A HREF="xEMACS.HTM#SEC45">Numeric Arguments</A>.
  13952. <DT>Option
  13953. <DD>An option is a variable (q.v.) that allows you to customize
  13954. Emacs by giving it a new value.  See section <A HREF="xEMACS.HTM#SEC275">Variables</A>.
  13955. <DT>Overwrite Mode
  13956. <DD>Overwrite mode is a minor mode.  When it is enabled, ordinary text
  13957. characters replace the existing text after point rather than pushing
  13958. it to the right.  See section <A HREF="xEMACS.HTM#SEC274">Minor Modes</A>.
  13959. <DT>Page
  13960. <DD>A page is a unit of text, delimited by formfeed characters (ASCII
  13961. Control-L, code 014) coming at the beginning of a line.  Some Emacs
  13962. commands are provided for moving over and operating on pages.
  13963. See section <A HREF="xEMACS.HTM#SEC178">Pages</A>.
  13964. <DT>Paragraphs
  13965. <DD>Paragraphs are the medium-size unit of English text.  There are
  13966. special Emacs commands for moving over and operating on paragraphs.
  13967. See section <A HREF="xEMACS.HTM#SEC177">Paragraphs</A>.
  13968. <DT>Parsing
  13969. <DD>We say that Emacs parses words or expressions in the text being
  13970. edited.  Really, all it knows how to do is find the other end of a
  13971. word or expression.  See section <A HREF="xEMACS.HTM#SEC289">The Syntax Table</A>.
  13972. <DT>Point
  13973. <DD>Point is the place in the buffer at which insertion and deletion
  13974. occur.  Point is considered to be between two characters, not at one
  13975. character.  The terminal's cursor (q.v.) indicates the location of
  13976. point.  See section <A HREF="xEMACS.HTM#SEC36">Basic Editing Commands</A>.
  13977. <DT>Prefix Key
  13978. <DD>A prefix key is a key (q.v.) whose sole function is to introduce a
  13979. set of multi-character keys.  <KBD>Control-x</KBD> is an example of a prefix
  13980. key; any two-character sequence starting with <KBD>C-x</KBD> is also
  13981. a legitimate key.  See section <A HREF="xEMACS.HTM#SEC14">Keystrokes, Key Sequences, and Key Bindings</A>.
  13982. <DT>Primary Mail File
  13983. <DD>Your primary mail file is the file named <SAMP>`RMAIL'</SAMP> in your home
  13984. directory, where Rmail stores all mail you receive unless you
  13985. make arrangements to do otherwise.  See section <A HREF="xEMACS.HTM#SEC245">Reading Mail With Rmail</A>.
  13986. <DT>Prompt
  13987. <DD>A prompt is text printed to ask the user for input.  Printing a prompt
  13988. is called prompting.  Emacs prompts always appear in the echo area
  13989. (q.v.).  One kind of prompting happens when the minibuffer is used
  13990. to read an argument (see section <A HREF="xEMACS.HTM#SEC47">The Minibuffer</A>); the echoing which happens
  13991. when you pause in the middle of typing a multi-character key is also a
  13992. kind of prompting (see section <A HREF="xEMACS.HTM#SEC11">The Echo Area</A>).
  13993. <DT>Quitting
  13994. <DD>Quitting means cancelling a partially typed command or a running
  13995. command, using <KBD>C-g</KBD>.  See section <A HREF="xEMACS.HTM#SEC301">Quitting and Aborting</A>.
  13996. <DT>Quoting
  13997. <DD>Quoting means depriving a character of its usual special significance.
  13998. In Emacs this is usually done with <KBD>Control-q</KBD>.  What constitutes special
  13999. significance depends on the context and on convention.  For example,
  14000. an "ordinary" character as an Emacs command inserts itself; so in
  14001. this context, a special character is any character that does not
  14002. normally insert itself (such as <KBD>DEL</KBD>, for example), and quoting
  14003. it makes it insert itself as if it were not special.  Not all contexts
  14004. allow quoting.  See section <A HREF="xEMACS.HTM#SEC36">Basic Editing Commands</A>.
  14005. <DT>Read-only Buffer
  14006. <DD>A read-only buffer is one whose text you are not allowed to change.
  14007. Normally Emacs makes buffers read-only when they contain text which
  14008. has a special significance to Emacs, such asDired buffers.
  14009. Visiting a file that is write-protected also makes a read-only buffer.
  14010. See section <A HREF="xEMACS.HTM#SEC147">Using Multiple Buffers</A>.
  14011. <DT>Recursive Editing Level
  14012. <DD>A recursive editing level is a state in which part of the execution of
  14013. a command involves asking the user to edit some text.  This text may
  14014. or may not be the same as the text to which the command was applied.
  14015. The mode line indicates recursive editing levels with square brackets
  14016. (<SAMP>`['</SAMP> and <SAMP>`]'</SAMP>).  See section <A HREF="xEMACS.HTM#SEC267">Recursive Editing Levels</A>.
  14017. <DT>Redisplay
  14018. <DD>Redisplay is the process of correcting the image on the screen to
  14019. correspond to changes that have been made in the text being edited.
  14020. See section <A HREF="xEMACS.HTM#SEC9">The Emacs Screen</A>.
  14021. <DT>Regexp
  14022. <DD>See `regular expression'.
  14023. <DT>Region
  14024. <DD>The region is the text between point (q.v.) and the mark (q.v.).
  14025. Many commands operate on the text of the region.  See section <A HREF="xEMACS.HTM#SEC60">Selecting Text</A>.
  14026. <DT>Registers
  14027. <DD>Registers are named slots in which text or buffer positions or
  14028. rectangles can be saved for later use.  See section <A HREF="xEMACS.HTM#SEC84">Registers</A>.
  14029. <DT>Regular Expression
  14030. <DD>A regular expression is a pattern that can match various text strings;
  14031. for example, <SAMP>`l[0-9]+'</SAMP> matches <SAMP>`l'</SAMP> followed by one or more
  14032. digits.  See section <A HREF="xEMACS.HTM#SEC99">Syntax of Regular Expressions</A>.
  14033. <DT>Replacement
  14034. <DD>See `global substitution'.
  14035. <DT>Restriction
  14036. <DD>A buffer's restriction is the amount of text, at the beginning or the
  14037. end of the buffer, that is temporarily invisible and inaccessible.
  14038. Giving a buffer a nonzero amount of restriction is called narrowing
  14039. (q.v.).  See section <A HREF="xEMACS.HTM#SEC265">Narrowing</A>.
  14040. <DT><KBD>RET</KBD>
  14041. <DD><KBD>RET</KBD> is the character than runs the command to insert a
  14042. newline into the text.  It is also used to terminate most arguments
  14043. read in the minibuffer (q.v.).  See section <A HREF="xEMACS.HTM#SEC14">Keystrokes, Key Sequences, and Key Bindings</A>.
  14044. <DT>Saving
  14045. <DD>Saving a buffer means copying its text into the file that was visited
  14046. (q.v.) in that buffer.  To actually change a file you have edited in
  14047. Emacs, you have to save it.  See section <A HREF="xEMACS.HTM#SEC115">Saving Files</A>.
  14048. <DT>Scrolling
  14049. <DD>Scrolling means shifting the text in the Emacs window to make a
  14050. different part ot the buffer visible.  See section <A HREF="xEMACS.HTM#SEC88">Controlling the Display</A>.
  14051. <DT>Searching
  14052. <DD>Searching means moving point to the next occurrence of a specified
  14053. string.  See section <A HREF="xEMACS.HTM#SEC93">Searching and Replacement</A>.
  14054. <DT>Selecting
  14055. <DD>Selecting a buffer means making it the current (q.v.) buffer.
  14056. See section <A HREF="xEMACS.HTM#SEC147">Using Multiple Buffers</A>.
  14057. <DT>Self-documentation
  14058. <DD>Self-documentation is the feature of Emacs which can tell you what any
  14059. command does, or can give you a list of all commands related to a topic
  14060. you specify.  You ask for self-documentation with the help character,
  14061. <KBD>C-h</KBD>.  See section <A HREF="xEMACS.HTM#SEC55">Help</A>.
  14062. <DT>Sentences
  14063. <DD>Emacs has commands for moving by or killing by sentences.
  14064. See section <A HREF="xEMACS.HTM#SEC176">Sentences</A>.
  14065. <DT>Sexp
  14066. <DD>An sexp (short for `s-expression,' itself short for `symbolic
  14067. expression') is the basic syntactic unit of Lisp
  14068. in its textual form: either a list, or Lisp atom.  Many Emacs commands
  14069. operate on sexps.  The term `sexp' is generalized to languages other
  14070. than Lisp to mean a syntactically recognizable expression.
  14071. See section <A HREF="xEMACS.HTM#SEC186">Lists and Sexps</A>.
  14072. <DT>Simultaneous Editing
  14073. <DD>Simultaneous editing means two users modifying the same file at once.
  14074. If simultaneous editing is not detected, you may lose your
  14075. work.  Emacs detects all cases of simultaneous editing and warns the
  14076. user to investigate them.  See section <A HREF="xEMACS.HTM#SEC120">Protection Against Simultaneous Editing</A>.
  14077. <DT>String
  14078. <DD>A string is a kind of Lisp data object which contains a sequence of
  14079. characters.  Many Emacs variables are intended to have strings as
  14080. values.  The Lisp syntax for a string consists of the characters in
  14081. the string with a <SAMP>`"'</SAMP> before and another <SAMP>`"'</SAMP> after. Write a
  14082. <SAMP>`"'</SAMP> that is part of the string as <SAMP>`\"'</SAMP> and a
  14083. <SAMP>`\'</SAMP> that is part of the string as <SAMP>`\\'</SAMP>.  You can include all
  14084. other characters, including newline, just by writing
  14085. them inside the string. You can also include escape sequences as in C, such as
  14086. <SAMP>`\n'</SAMP> for newline or <SAMP>`\241'</SAMP> using an octal character code.
  14087. <DT>String Substitution
  14088. <DD>See `global substitution'.
  14089. <DT>Syntax Table
  14090. <DD>The syntax table tells Emacs which characters are part of a word,
  14091. which characters balance each other like parentheses, etc.
  14092. See section <A HREF="xEMACS.HTM#SEC289">The Syntax Table</A>.
  14093. <DT>Tag Table
  14094. <DD>A tag table is a file that serves as an index to the function
  14095. definitions in one or more other files.  See section <A HREF="xEMACS.HTM#SEC201">Tag Tables</A>.
  14096. <DT>Termscript File
  14097. <DD>A termscript file contains a record of all characters Emacs sent to
  14098. the terminal.  It is used for tracking down bugs in Emacs redisplay.
  14099. Emacs does not make a termscript file unless explicitly instructed to do
  14100. See section <A HREF="xEMACS.HTM#SEC309">Reporting Bugs</A>.
  14101. <DT>Text
  14102. <DD>Text has two meanings (see section <A HREF="xEMACS.HTM#SEC165">Commands for Human Languages</A>):
  14103. <DD>Data consisting of a sequence of characters, as opposed to binary
  14104. numbers, images, graphics commands, executable programs, and the like.
  14105. The contents of an Emacs buffer are always text in this sense.
  14106. <DD>Data consisting of written human language, as opposed to programs,
  14107. or something that follows the stylistic conventions of human language.
  14108. </UL>
  14109. <DT>Top Level
  14110. <DD>Top level is the normal state of Emacs, in which you are editing the
  14111. text of the file you have visited.  You are at top level whenever you
  14112. are not in a recursive editing level (q.v.) or the minibuffer
  14113. (q.v.), and not in the middle of a command.  You can get back to top
  14114. level by aborting (q.v.) and quitting (q.v.).  See section <A HREF="xEMACS.HTM#SEC301">Quitting and Aborting</A>.
  14115. <DT>Transposition
  14116. <DD>Transposing two units of text means putting each one into the place
  14117. formerly occupied by the other.  There are Emacs commands to transpose
  14118. two adjacent characters, words, sexps (q.v.), or lines
  14119. (see section <A HREF="xEMACS.HTM#SEC109">Transposing Text</A>).
  14120. <DT>Truncation
  14121. <DD>Truncating text lines in the display means leaving out any text on a
  14122. line that does not fit within the right margin of the window
  14123. displaying it.  See also `continuation line'.
  14124. See section <A HREF="xEMACS.HTM#SEC36">Basic Editing Commands</A>.
  14125. <DT>Undoing
  14126. <DD>Undoing means making your previous editing go in reverse, bringing
  14127. back the text that existed earlier in the editing session.
  14128. See section <A HREF="xEMACS.HTM#SEC46">Undoing Changes</A>.
  14129. <DT>Variable
  14130. <DD>A variable is Lisp object that can store an arbitrary value.  Emacs uses
  14131. some variables for internal purposes, and has others (known as `options'
  14132. (q.v.)) you can set to control the behavior of Emacs.  The variables
  14133. used in Emacs that you are likely to be interested in are listed in the
  14134. Variables Index of this manual.  See section <A HREF="xEMACS.HTM#SEC275">Variables</A>, for information on
  14135. variables.
  14136. <DT>Visiting
  14137. <DD>Visiting a file means loading its contents into a buffer (q.v.)
  14138. where they can be edited.  See section <A HREF="xEMACS.HTM#SEC114">Visiting Files</A>.
  14139. <DT>Whitespace
  14140. <DD>Whitespace is any run of consecutive formatting characters (spaces,
  14141. tabs, newlines, and backspaces).
  14142. <DT>Widening
  14143. <DD>Widening is removing any restriction (q.v.) on the current buffer;
  14144. it is the opposite of narrowing (q.v.).  See section <A HREF="xEMACS.HTM#SEC265">Narrowing</A>.
  14145. <DT>Window
  14146. <DD>Emacs divides the screen into one or more windows, each of which can
  14147. display the contents of one buffer (q.v.) at any time.
  14148. See section <A HREF="xEMACS.HTM#SEC9">The Emacs Screen</A>, for basic information on how Emacs uses the screen.
  14149. See section <A HREF="xEMACS.HTM#SEC153">Multiple Windows</A>, for commands to control the use of windows. Note that if
  14150. you are running Emacs under X, terminology can be confusing: Each Emacs
  14151. screen occupies a separate X window and can, in turn, be divided into
  14152. different subwindows. 
  14153. <DT>Word Abbrev
  14154. <DD>Synonymous with `abbrev'.
  14155. <DT>Word Search
  14156. <DD>Word search is searching for a sequence of words, considering the
  14157. punctuation between them as insignificant.  See section <A HREF="xEMACS.HTM#SEC97">Word Search</A>.
  14158. <DT>Yanking
  14159. <DD>Yanking means reinserting text previously killed.  It can be used to
  14160. undo a mistaken kill, or for copying or moving text.  Some other
  14161. systems call this "pasting".  See section <A HREF="xEMACS.HTM#SEC73">Yanking</A>.
  14162. </DL>
  14163. <H1><A NAME="SEC317" HREF="xEMACS_TO.HTM#SEC317">The GNU Manifesto</A></H1>
  14164. <H2><A NAME="SEC318" HREF="xEMACS_TO.HTM#SEC318">What's GNU?  GNU's Not Unix!</A></H2>
  14165. GNU, which stands for GNU's Not Unix, is the name for the complete
  14166. Unix-compatible software system which I am writing so that I can give it
  14167. away free to everyone who can use it.  Several other volunteers are helping
  14168. me.  Contributions of time, money, programs, and equipment are greatly
  14169. needed.
  14170. So far we have an Emacs text editor with Lisp for writing editor commands,
  14171. a source level debugger, a yacc-compatible parser generator, a linker, and
  14172. around 35 utilities.  A shell (command interpreter) is nearly completed.  A
  14173. new portable optimizing C compiler has compiled itself and may be released
  14174. this year.  An initial kernel exists, but many more features are needed to
  14175. emulate Unix.  When the kernel and compiler are finished, it will be
  14176. possible to distribute a GNU system suitable for program development.  We
  14177. will use TeX as our text formatter, but an nroff is being worked on.  We
  14178. will use the free, portable X window system as well.  After this we will
  14179. add a portable Common Lisp, an Empire game, a spreadsheet, and hundreds of
  14180. other things, plus online documentation.  We hope to supply, eventually,
  14181. everything useful that normally comes with a Unix system, and more.
  14182. GNU will be able to run Unix programs, but will not be identical to Unix.
  14183. We will make all improvements that are convenient, based on our experience
  14184. with other operating systems.  In particular, we plan to have longer
  14185. filenames, file version numbers, a crashproof file system, filename
  14186. completion perhaps, terminal-independent display support, and perhaps
  14187. eventually a Lisp-based window system through which several Lisp programs
  14188. and ordinary Unix programs can share a screen.  Both C and Lisp will be
  14189. available as system programming languages.  We will try to support UUCP,
  14190. MIT Chaosnet, and Internet protocols for communication.
  14191. GNU is aimed initially at machines in the 68000/16000 class with virtual
  14192. memory, because they are the easiest machines to make it run on.  The extra
  14193. effort to make it run on smaller machines will be left to someone who wants
  14194. to use it on them.
  14195. To avoid horrible confusion, please pronounce the `G' in the word `GNU'
  14196. when it is the name of this project.
  14197. <H2><A NAME="SEC319" HREF="xEMACS_TO.HTM#SEC319">Why I Must Write GNU</A></H2>
  14198. I consider that the golden rule requires that if I like a program I must
  14199. share it with other people who like it.  Software sellers want to divide
  14200. the users and conquer them, making each user agree not to share with
  14201. others.  I refuse to break solidarity with other users in this way.  I
  14202. cannot in good conscience sign a nondisclosure agreement or a software
  14203. license agreement.  For years I worked within the Artificial Intelligence
  14204. Lab to resist such tendencies and other inhospitalities, but eventually
  14205. they had gone too far: I could not remain in an institution where such
  14206. things are done for me against my will.
  14207. So that I can continue to use computers without dishonor, I have decided to
  14208. put together a sufficient body of free software so that I will be able to
  14209. get along without any software that is not free.  I have resigned from the
  14210. AI lab to deny MIT any legal excuse to prevent me from giving GNU away.
  14211. <H2><A NAME="SEC320" HREF="xEMACS_TO.HTM#SEC320">Why GNU Will Be Compatible With Unix</A></H2>
  14212. Unix is not my ideal system, but it is not too bad.  The essential features
  14213. of Unix seem to be good ones, and I think I can fill in what Unix lacks
  14214. without spoiling them.  And a system compatible with Unix would be
  14215. convenient for many other people to adopt.
  14216. <H2><A NAME="SEC321" HREF="xEMACS_TO.HTM#SEC321">How GNU Will Be Available</A></H2>
  14217. GNU is not in the public domain.  Everyone will be permitted to modify and
  14218. redistribute GNU, but no distributor will be allowed to restrict its
  14219. further redistribution.  That is to say, proprietary modifications will not
  14220. be allowed.  I want to make sure that all versions of GNU remain free.
  14221. <H2><A NAME="SEC322" HREF="xEMACS_TO.HTM#SEC322">Why Many Other Programmers Want to Help</A></H2>
  14222. I have found many other programmers who are excited about GNU and want to
  14223. help.
  14224. Many programmers are unhappy about the commercialization of system
  14225. software.  It may enable them to make more money, but it requires them to
  14226. feel in conflict with other programmers in general rather than feel as
  14227. comrades.  The fundamental act of friendship among programmers is the
  14228. sharing of programs; marketing arrangements now typically used essentially
  14229. forbid programmers to treat others as friends.  The purchaser of software
  14230. must choose between friendship and obeying the law.  Naturally, many decide
  14231. that friendship is more important.  But those who believe in law often do
  14232. not feel at ease with either choice.  They become cynical and think that
  14233. programming is just a way of making money.
  14234. By working on and using GNU rather than proprietary programs, we can be
  14235. hospitable to everyone and obey the law.  In addition, GNU serves as an
  14236. example to inspire and a banner to rally others to join us in sharing.
  14237. This can give us a feeling of harmony which is impossible if we use
  14238. software that is not free.  For about half the programmers I talk to, this
  14239. is an important happiness that money cannot replace.
  14240. <H2><A NAME="SEC323" HREF="xEMACS_TO.HTM#SEC323">How You Can Contribute</A></H2>
  14241. I am asking computer manufacturers for donations of machines and money.
  14242. I'm asking individuals for donations of programs and work.
  14243. One consequence you can expect if you donate machines is that GNU will run
  14244. on them at an early date.  The machines should be complete, ready-to-use
  14245. systems, approved for use in a residential area, and not in need of
  14246. sophisticated cooling or power.
  14247. I have found very many programmers eager to contribute part-time work for
  14248. GNU.  For most projects, such part-time distributed work would be very hard
  14249. to coordinate; the independently-written parts would not work together.
  14250. But for the particular task of replacing Unix, this problem is absent.  A
  14251. complete Unix system contains hundreds of utility programs, each of which
  14252. is documented separately.  Most interface specifications are fixed by Unix
  14253. compatibility.  If each contributor can write a compatible replacement for
  14254. a single Unix utility, and make it work properly in place of the original
  14255. on a Unix system, then these utilities will work right when put together.
  14256. Even allowing for Murphy to create a few unexpected problems, assembling
  14257. these components will be a feasible task.  (The kernel will require closer
  14258. communication and will be worked on by a small, tight group.)
  14259. If I get donations of money, I may be able to hire a few people full or
  14260. part time.  The salary won't be high by programmers' standards, but I'm
  14261. looking for people for whom building community spirit is as important as
  14262. making money.  I view this as a way of enabling dedicated people to devote
  14263. their full energies to working on GNU by sparing them the need to make a
  14264. living in another way.
  14265. <H2><A NAME="SEC324" HREF="xEMACS_TO.HTM#SEC324">Why All Computer Users Will Benefit</A></H2>
  14266. Once GNU is written, everyone will be able to obtain good system software
  14267. free, just like air.
  14268. This means much more than just saving everyone the price of a Unix license.
  14269. It means that much wasteful duplication of system programming effort will
  14270. be avoided.  This effort can go instead into advancing the state of the
  14271. Complete system sources will be available to everyone.  As a result, a user
  14272. who needs changes in the system will always be free to make them himself,
  14273. or hire any available programmer or company to make them for him.  Users
  14274. will no longer be at the mercy of one programmer or company which owns the
  14275. sources and is in sole position to make changes.
  14276. Schools will be able to provide a much more educational environment by
  14277. encouraging all students to study and improve the system code.  Harvard's
  14278. computer lab used to have the policy that no program could be installed on
  14279. the system if its sources were not on public display, and upheld it by
  14280. actually refusing to install certain programs.  I was very much inspired by
  14281. this.
  14282. Finally, the overhead of considering who owns the system software and what
  14283. one is or is not entitled to do with it will be lifted.
  14284. Arrangements to make people pay for using a program, including licensing of
  14285. copies, always incur a tremendous cost to society through the cumbersome
  14286. mechanisms necessary to figure out how much (that is, which programs) a
  14287. person must pay for.  And only a police state can force everyone to obey
  14288. them.  Consider a space station where air must be manufactured at great
  14289. cost: charging each breather per liter of air may be fair, but wearing the
  14290. metered gas mask all day and all night is intolerable even if everyone can
  14291. afford to pay the air bill.  And the TV cameras everywhere to see if you
  14292. ever take the mask off are outrageous.  It's better to support the air
  14293. plant with a head tax and chuck the masks.
  14294. Copying all or parts of a program is as natural to a programmer as
  14295. breathing, and as productive.  It ought to be as free.
  14296. <H2><A NAME="SEC325" HREF="xEMACS_TO.HTM#SEC325">Some Easily Rebutted Objections to GNU's Goals</A></H2>
  14297. <BLOCKQUOTE>
  14298. "Nobody will use it if it is free, because that means they can't rely
  14299. on any support."
  14300. "You have to charge for the program to pay for providing the
  14301. support."
  14302. </BLOCKQUOTE>
  14303. If people would rather pay for GNU plus service than get GNU free without
  14304. service, a company to provide just service to people who have obtained GNU
  14305. free ought to be profitable.
  14306. We must distinguish between support in the form of real programming work
  14307. and mere handholding.  The former is something one cannot rely on from a
  14308. software vendor.  If your problem is not shared by enough people, the
  14309. vendor will tell you to get lost.
  14310. If your business needs to be able to rely on support, the only way is to
  14311. have all the necessary sources and tools.  Then you can hire any available
  14312. person to fix your problem; you are not at the mercy of any individual.
  14313. With Unix, the price of sources puts this out of consideration for most
  14314. businesses.  With GNU this will be easy.  It is still possible for there to
  14315. be no available competent person, but this problem cannot be blamed on
  14316. distibution arrangements.  GNU does not eliminate all the world's problems,
  14317. only some of them.
  14318. Meanwhile, the users who know nothing about computers need handholding:
  14319. doing things for them which they could easily do themselves but don't know
  14320. Such services could be provided by companies that sell just hand-holding
  14321. and repair service.  If it is true that users would rather spend money and
  14322. get a product with service, they will also be willing to buy the service
  14323. having got the product free.  The service companies will compete in quality
  14324. and price; users will not be tied to any particular one.  Meanwhile, those
  14325. of us who don't need the service should be able to use the program without
  14326. paying for the service.
  14327. <BLOCKQUOTE>
  14328. "You cannot reach many people without advertising,
  14329. and you must charge for the program to support that."
  14330. "It's no use advertising a program people can get free."
  14331. </BLOCKQUOTE>
  14332. There are various forms of free or very cheap publicity that can be used to
  14333. inform numbers of computer users about something like GNU.  But it may be
  14334. true that one can reach more microcomputer users with advertising.  If this
  14335. is really so, a business which advertises the service of copying and
  14336. mailing GNU for a fee ought to be successful enough to pay for its
  14337. advertising and more.  This way, only the users who benefit from the
  14338. advertising pay for it.
  14339. On the other hand, if many people get GNU from their friends, and such
  14340. companies don't succeed, this will show that advertising was not really
  14341. necessary to spread GNU.  Why is it that free market advocates don't want
  14342. to let the free market decide this?
  14343. <BLOCKQUOTE>
  14344. "My company needs a proprietary operating system
  14345. to get a competitive edge."
  14346. </BLOCKQUOTE>
  14347. GNU will remove operating system software from the realm of competition.
  14348. You will not be able to get an edge in this area, but neither will your
  14349. competitors be able to get an edge over you.  You and they will compete in
  14350. other areas, while benefitting mutually in this one.  If your business is
  14351. selling an operating system, you will not like GNU, but that's tough on
  14352. you.  If your business is something else, GNU can save you from being
  14353. pushed into the expensive business of selling operating systems.
  14354. I would like to see GNU development supported by gifts from many
  14355. manufacturers and users, reducing the cost to each.
  14356. <BLOCKQUOTE>
  14357. "Don't programmers deserve a reward for their creativity?"
  14358. </BLOCKQUOTE>
  14359. If anything deserves a reward, it is social contribution.  Creativity can
  14360. be a social contribution, but only in so far as society is free to use the
  14361. results.  If programmers deserve to be rewarded for creating innovative
  14362. programs, by the same token they deserve to be punished if they restrict
  14363. the use of these programs.
  14364. <BLOCKQUOTE>
  14365. "Shouldn't a programmer be able to ask for a reward for his creativity?"
  14366. </BLOCKQUOTE>
  14367. There is nothing wrong with wanting pay for work, or seeking to maximize
  14368. one's income, as long as one does not use means that are destructive.  But
  14369. the means customary in the field of software today are based on
  14370. destruction.
  14371. Extracting money from users of a program by restricting their use of it is
  14372. destructive because the restrictions reduce the amount and the ways that
  14373. the program can be used.  This reduces the amount of wealth that humanity
  14374. derives from the program.  When there is a deliberate choice to restrict,
  14375. the harmful consequences are deliberate destruction.
  14376. The reason a good citizen does not use such destructive means to become
  14377. wealthier is that, if everyone did so, we would all become poorer from the
  14378. mutual destructiveness.  This is Kantian ethics; or, the Golden Rule.
  14379. Since I do not like the consequences that result if everyone hoards
  14380. information, I am required to consider it wrong for one to do so.
  14381. Specifically, the desire to be rewarded for one's creativity does not
  14382. justify depriving the world in general of all or part of that creativity.
  14383. <BLOCKQUOTE>
  14384. "Won't programmers starve?"
  14385. </BLOCKQUOTE>
  14386. I could answer that nobody is forced to be a programmer.  Most of us cannot
  14387. manage to get any money for standing on the street and making faces.  But
  14388. we are not, as a result, condemned to spend our lives standing on the
  14389. street making faces, and starving.  We do something else.
  14390. But that is the wrong answer because it accepts the questioner's implicit
  14391. assumption: that without ownership of software, programmers cannot possibly
  14392. be paid a cent.  Supposedly it is all or nothing.
  14393. The real reason programmers will not starve is that it will still be
  14394. possible for them to get paid for programming; just not paid as much as
  14395. Restricting copying is not the only basis for business in software.  It is
  14396. the most common basis because it brings in the most money.  If it were
  14397. prohibited, or rejected by the customer, software business would move to
  14398. other bases of organization which are now used less often.  There are
  14399. always numerous ways to organize any kind of business.
  14400. Probably programming will not be as lucrative on the new basis as it is
  14401. now.  But that is not an argument against the change.  It is not considered
  14402. an injustice that sales clerks make the salaries that they now do.  If
  14403. programmers made the same, that would not be an injustice either.  (In
  14404. practice they would still make considerably more than that.)
  14405. <BLOCKQUOTE>
  14406. "Don't people have a right to control how their creativity is used?"
  14407. </BLOCKQUOTE>
  14408. "Control over the use of one's ideas" really constitutes control over
  14409. other people's lives; and it is usually used to make their lives more
  14410. difficult.
  14411. People who have studied the issue of intellectual property rights carefully
  14412. (such as lawyers) say that there is no intrinsic right to intellectual
  14413. property.  The kinds of supposed intellectual property rights that the
  14414. government recognizes were created by specific acts of legislation for
  14415. specific purposes.
  14416. For example, the patent system was established to encourage inventors to
  14417. disclose the details of their inventions.  Its purpose was to help society
  14418. rather than to help inventors.  At the time, the life span of 17 years for
  14419. a patent was short compared with the rate of advance of the state of the
  14420. art.  Since patents are an issue only among manufacturers, for whom the
  14421. cost and effort of a license agreement are small compared with setting up
  14422. production, the patents often do not do much harm.  They do not obstruct
  14423. most individuals who use patented products.
  14424. The idea of copyright did not exist in ancient times, when authors
  14425. frequently copied other authors at length in works of non-fiction.  This
  14426. practice was useful, and is the only way many authors' works have survived
  14427. even in part.  The copyright system was created expressly for the purpose
  14428. of encouraging authorship.  In the domain for which it was
  14429. invented--books, which could be copied economically only on a printing
  14430. press--it did little harm, and did not obstruct most of the individuals
  14431. who read the books.
  14432. All intellectual property rights are just licenses granted by society
  14433. because it was thought, rightly or wrongly, that society as a whole would
  14434. benefit by granting them.  But in any particular situation, we have to ask:
  14435. are we really better off granting such license?  What kind of act are we
  14436. licensing a person to do?
  14437. The case of programs today is very different from that of books a hundred
  14438. years ago.  The fact that the easiest way to copy a program is from one
  14439. neighbor to another, the fact that a program has both source code and
  14440. object code which are distinct, and the fact that a program is used rather
  14441. than read and enjoyed, combine to create a situation in which a person who
  14442. enforces a copyright is harming society as a whole both materially and
  14443. spiritually; in which a person should not do so regardless of whether the
  14444. law enables him to.
  14445. <BLOCKQUOTE>
  14446. "Competition makes things get done better."
  14447. </BLOCKQUOTE>
  14448. The paradigm of competition is a race: by rewarding the winner, we
  14449. encourage everyone to run faster.  When capitalism really works this way,
  14450. it does a good job; but its defenders are wrong in assuming it always works
  14451. this way.  If the runners forget why the reward is offered and become
  14452. intent on winning, no matter how, they may find other strategies--such as,
  14453. attacking other runners.  If the runners get into a fist fight, they will
  14454. all finish late.
  14455. Proprietary and secret software is the moral equivalent of runners in a
  14456. fist fight.  Sad to say, the only referee we've got does not seem to
  14457. object to fights; he just regulates them ("For every ten yards you run,
  14458. you can fire one shot").  He really ought to break them up, and penalize
  14459. runners for even trying to fight.
  14460. <BLOCKQUOTE>
  14461. "Won't everyone stop programming without a monetary incentive?"
  14462. </BLOCKQUOTE>
  14463. Actually, many people will program with absolutely no monetary incentive.
  14464. Programming has an irresistible fascination for some people, usually the
  14465. people who are best at it.  There is no shortage of professional musicians
  14466. who keep at it even though they have no hope of making a living that way.
  14467. But really this question, though commonly asked, is not appropriate to the
  14468. situation.  Pay for programmers will not disappear, only become less.  So
  14469. the right question is, will anyone program with a reduced monetary
  14470. incentive?  My experience shows that they will.
  14471. For more than ten years, many of the world's best programmers worked at the
  14472. Artificial Intelligence Lab for far less money than they could have had
  14473. anywhere else.  They got many kinds of non-monetary rewards: fame and
  14474. appreciation, for example.  And creativity is also fun, a reward in itself.
  14475. Then most of them left when offered a chance to do the same interesting
  14476. work for a lot of money.
  14477. What the facts show is that people will program for reasons other than
  14478. riches; but if given a chance to make a lot of money as well, they will
  14479. come to expect and demand it.  Low-paying organizations do poorly in
  14480. competition with high-paying ones, but they do not have to do badly if the
  14481. high-paying ones are banned.
  14482. <BLOCKQUOTE>
  14483. "We need the programmers desperately.  If they demand that we
  14484. stop helping our neighbors, we have to obey."
  14485. </BLOCKQUOTE>
  14486. You're never so desperate that you have to obey this sort of demand.
  14487. Remember: millions for defense, but not a cent for tribute!
  14488. <BLOCKQUOTE>
  14489. "Programmers need to make a living somehow."
  14490. </BLOCKQUOTE>
  14491. In the short run, this is true.  However, there are plenty of ways that
  14492. programmers could make a living without selling the right to use a program.
  14493. This way is customary now because it brings programmers and businessmen the
  14494. most money, not because it is the only way to make a living.  It is easy to
  14495. find other ways if you want to find them.  Here are a number of examples.
  14496. A manufacturer introducing a new computer will pay for the porting of
  14497. operating systems onto the new hardware.
  14498. The sale of teaching, hand-holding, and maintenance services could also
  14499. employ programmers.
  14500. People with new ideas could distribute programs as freeware and ask for
  14501. donations from satisfied users or sell hand-holding services.  I have
  14502. met people who are already working this way successfully.
  14503. Users with related needs can form users' groups and pay dues.  A group
  14504. would contract with programming companies to write programs that the
  14505. group's members would like to use.
  14506. All sorts of development can be funded with a Software Tax:
  14507. <BLOCKQUOTE>
  14508. Suppose everyone who buys a computer has to pay a certain percent of
  14509. the price as a software tax.  The government gives this to
  14510. an agency like the NSF to spend on software development.
  14511. But if the computer buyer makes a donation to software development
  14512. himself, he can take a credit against the tax.  He can donate to
  14513. the project of his own choosing--often, chosen because he hopes to
  14514. use the results when
  14515. it is done.  He can take a credit for any amount
  14516. of donation up to the total tax he had to pay.
  14517. The total tax rate could be decided by a vote of the payers of
  14518. the tax, weighted according to the amount they will be taxed on.
  14519. The consequences:
  14520. The computer-using community supports software development.
  14521. This community decides what level of support is needed.
  14522. Users who care which projects their share is spent on
  14523. can choose this for themselves.
  14524. </UL>
  14525. </BLOCKQUOTE>
  14526. In the long run, making programs free is a step toward the post-scarcity
  14527. world, where nobody will have to work very hard just to make a living.
  14528. People will be free to devote themselves to activities that are fun, such
  14529. as programming, after spending the necessary ten hours a week on required
  14530. tasks such as legislation, family counseling, robot repair, and asteroid
  14531. prospecting.  There will be no need to be able to make a living from
  14532. programming.
  14533. We have already greatly reduced the amount of work that the whole society
  14534. must do for its actual productivity, but only a little of this has
  14535. translated itself into leisure for workers because much nonproductive
  14536. activity is required to accompany productive activity.  The main causes of
  14537. this are bureaucracy and isometric struggles against competition.  Free
  14538. software will greatly reduce these drains in the area of software
  14539. production.  We must do this, in order for technical gains in productivity
  14540. to translate into less work for us.
  14541. <H1><A NAME="SEC326" HREF="xEMACS_TO.HTM#SEC326">Key (Character) Index</A></H1>
  14542. <H2>!</H2>
  14543. <DIR>
  14544. <LI><A HREF="xEMACS.HTM#IDX492">! (query-replace)</A>
  14545. </DIR>
  14546. <H2>"</H2>
  14547. <DIR>
  14548. <LI><A HREF="xEMACS.HTM#IDX806">" (TeX mode)</A>
  14549. </DIR>
  14550. <H2>,</H2>
  14551. <DIR>
  14552. <LI><A HREF="xEMACS.HTM#IDX489">, (query-replace)</A>
  14553. </DIR>
  14554. <H2>.</H2>
  14555. <DIR>
  14556. <LI><A HREF="xEMACS.HTM#IDX491">. (query-replace)</A>
  14557. <LI><A HREF="xEMACS.HTM#IDX1283">. (Rmail)</A>
  14558. </DIR>
  14559. <H2>></H2>
  14560. <DIR>
  14561. <LI><A HREF="xEMACS.HTM#IDX1296">> (Rmail)</A>
  14562. </DIR>
  14563. <H2>^</H2>
  14564. <DIR>
  14565. <LI><A HREF="xEMACS.HTM#IDX493">^ (query-replace)</A>
  14566. </DIR>
  14567. <H2>a</H2>
  14568. <DIR>
  14569. <LI><A HREF="xEMACS.HTM#IDX1322">a (Rmail)</A>
  14570. </DIR>
  14571. <H2>b</H2>
  14572. <DIR>
  14573. <LI><A HREF="xEMACS.HTM#IDX35">button1</A>
  14574. <LI><A HREF="xEMACS.HTM#IDX38">button1up</A>
  14575. <LI><A HREF="xEMACS.HTM#IDX36">button2</A>
  14576. <LI><A HREF="xEMACS.HTM#IDX39">button2up</A>
  14577. <LI><A HREF="xEMACS.HTM#IDX37">button3</A>
  14578. <LI><A HREF="xEMACS.HTM#IDX40">button3up</A>
  14579. </DIR>
  14580. <H2>c</H2>
  14581. <DIR>
  14582. <LI><A HREF="xEMACS.HTM#IDX1373">c (Rmail)</A>
  14583. <LI><A HREF="xEMACS.HTM#IDX280">C-<</A>
  14584. <LI><A HREF="xEMACS.HTM#IDX281">C-></A>
  14585. <LI><A HREF="xEMACS.HTM#IDX1597">C-]</A>
  14586. <LI><A HREF="xEMACS.HTM#IDX208">C-_</A>
  14587. <LI><A HREF="xEMACS.HTM#IDX155">C-a</A>
  14588. <LI><A HREF="xEMACS.HTM#IDX158">C-b</A>
  14589. <LI><A HREF="xEMACS.HTM#IDX46">C-c</A>
  14590. <LI><A HREF="xEMACS.HTM#IDX1219">C-c ' (Picture mode)</A>
  14591. <LI><A HREF="xEMACS.HTM#IDX1217">C-c . (Picture mode)</A>
  14592. <LI><A HREF="xEMACS.HTM#IDX1220">C-c / (Picture mode)</A>
  14593. <LI><A HREF="xEMACS.HTM#IDX1101">C-c ; (Fortran mode)</A>
  14594. <LI><A HREF="xEMACS.HTM#IDX1214">C-c < (Picture mode)</A>
  14595. <LI><A HREF="xEMACS.HTM#IDX1215">C-c > (Picture mode)</A>
  14596. <LI><A HREF="xEMACS.HTM#IDX1221">C-c \ (Picture mode)</A>
  14597. <LI><A HREF="xEMACS.HTM#IDX1216">C-c ^ (Picture mode)</A>
  14598. <LI><A HREF="xEMACS.HTM#IDX1218">C-c ` (Picture mode)</A>
  14599. <LI><A HREF="xEMACS.HTM#IDX1413">C-c C-\ (Shell mode)</A>
  14600. <LI><A HREF="xEMACS.HTM#IDX847">C-c C-b (Outline mode)</A>
  14601. <LI><A HREF="xEMACS.HTM#IDX1223">C-c C-b (Picture mode)</A>
  14602. <LI><A HREF="xEMACS.HTM#IDX817">C-c C-b (TeX mode)</A>
  14603. <LI><A HREF="xEMACS.HTM#IDX1181">C-c C-c (Edit Abbrevs)</A>
  14604. <LI><A HREF="xEMACS.HTM#IDX774">C-c C-c (Edit Tab Stops)</A>
  14605. <LI><A HREF="xEMACS.HTM#IDX1256">C-c C-c (Mail mode)</A>
  14606. <LI><A HREF="xEMACS.HTM#IDX502">C-c C-c (Occur mode)</A>
  14607. <LI><A HREF="xEMACS.HTM#IDX1411">C-c C-c (Shell mode)</A>
  14608. <LI><A HREF="xEMACS.HTM#IDX1204">C-c C-d (Picture mode)</A>
  14609. <LI><A HREF="xEMACS.HTM#IDX1407">C-c C-d (Shell mode)</A>
  14610. <LI><A HREF="xEMACS.HTM#IDX815">C-c C-f (LaTeX mode)</A>
  14611. <LI><A HREF="xEMACS.HTM#IDX846">C-c C-f (Outline mode)</A>
  14612. <LI><A HREF="xEMACS.HTM#IDX1222">C-c C-f (Picture mode)</A>
  14613. <LI><A HREF="xEMACS.HTM#IDX1263">C-c C-f C-c (Mail mode)</A>
  14614. <LI><A HREF="xEMACS.HTM#IDX1261">C-c C-f C-s (Mail mode)</A>
  14615. <LI><A HREF="xEMACS.HTM#IDX1259">C-c C-f C-t (Mail mode)</A>
  14616. <LI><A HREF="xEMACS.HTM#IDX854">C-c C-h (Outline mode)</A>
  14617. <LI><A HREF="xEMACS.HTM#IDX858">C-c C-i (Outline mode)</A>
  14618. <LI><A HREF="xEMACS.HTM#IDX1233">C-c C-k (Picture mode)</A>
  14619. <LI><A HREF="xEMACS.HTM#IDX823">C-c C-k (TeX mode)</A>
  14620. <LI><A HREF="xEMACS.HTM#IDX825">C-c C-l (TeX mode)</A>
  14621. <LI><A HREF="xEMACS.HTM#IDX1077">C-c C-n (Fortran mode)</A>
  14622. <LI><A HREF="xEMACS.HTM#IDX841">C-c C-n (Outline mode)</A>
  14623. <LI><A HREF="xEMACS.HTM#IDX1414">C-c C-o (Shell mode)</A>
  14624. <LI><A HREF="xEMACS.HTM#IDX1076">C-c C-p (Fortran mode)</A>
  14625. <LI><A HREF="xEMACS.HTM#IDX842">C-c C-p (Outline mode)</A>
  14626. <LI><A HREF="xEMACS.HTM#IDX819">C-c C-p (TeX mode)</A>
  14627. <LI><A HREF="xEMACS.HTM#IDX1269">C-c C-q (Mail mode)</A>
  14628. <LI><A HREF="xEMACS.HTM#IDX821">C-c C-q (TeX mode)</A>
  14629. <LI><A HREF="xEMACS.HTM#IDX1104">C-c C-r (Fortran mode)</A>
  14630. <LI><A HREF="xEMACS.HTM#IDX1415">C-c C-r (Shell mode)</A>
  14631. <LI><A HREF="xEMACS.HTM#IDX827">C-c C-r (TeX mode)</A>
  14632. <LI><A HREF="xEMACS.HTM#IDX1255">C-c C-s (Mail mode)</A>
  14633. <LI><A HREF="xEMACS.HTM#IDX853">C-c C-s (Outline mode)</A>
  14634. <LI><A HREF="xEMACS.HTM#IDX848">C-c C-u (Outline mode)</A>
  14635. <LI><A HREF="xEMACS.HTM#IDX1409">C-c C-u (Shell mode)</A>
  14636. <LI><A HREF="xEMACS.HTM#IDX1106">C-c C-w (Fortran mode)</A>
  14637. <LI><A HREF="xEMACS.HTM#IDX1265">C-c C-w (Mail mode)</A>
  14638. <LI><A HREF="xEMACS.HTM#IDX1234">C-c C-w (Picture mode)</A>
  14639. <LI><A HREF="xEMACS.HTM#IDX1410">C-c C-w (Shell mode)</A>
  14640. <LI><A HREF="xEMACS.HTM#IDX1238">C-c C-x (Picture mode)</A>
  14641. <LI><A HREF="xEMACS.HTM#IDX1366">C-c C-y (Mail mode)</A>
  14642. <LI><A HREF="xEMACS.HTM#IDX1237">C-c C-y (Picture mode)</A>
  14643. <LI><A HREF="xEMACS.HTM#IDX1416">C-c C-y (Shell mode)</A>
  14644. <LI><A HREF="xEMACS.HTM#IDX1412">C-c C-z (Shell mode)</A>
  14645. <LI><A HREF="xEMACS.HTM#IDX1230">C-c TAB (Picture mode)</A>
  14646. <LI><A HREF="xEMACS.HTM#IDX808">C-c { (TeX mode)</A>
  14647. <LI><A HREF="xEMACS.HTM#IDX810">C-c } (TeX mode)</A>
  14648. <LI><A HREF="xEMACS.HTM#IDX328">C-d</A>
  14649. <LI><A HREF="xEMACS.HTM#IDX1302">C-d (Rmail)</A>
  14650. <LI><A HREF="xEMACS.HTM#IDX1408">C-d (Shell mode)</A>
  14651. <LI><A HREF="xEMACS.HTM#IDX156">C-e</A>
  14652. <LI><A HREF="xEMACS.HTM#IDX157">C-f</A>
  14653. <LI><A HREF="xEMACS.HTM#IDX1592">C-g</A>
  14654. <LI><A HREF="xEMACS.HTM#IDX456">C-g (isearch-mode)</A>
  14655. <LI><A HREF="xEMACS.HTM#IDX48">C-h</A>
  14656. <LI><A HREF="xEMACS.HTM#IDX252">C-h a</A>
  14657. <LI><A HREF="xEMACS.HTM#IDX262">C-h b</A>
  14658. <LI><A HREF="xEMACS.HTM#IDX241">C-h c</A>
  14659. <LI><A HREF="xEMACS.HTM#IDX268">C-h C-c</A>
  14660. <LI><A HREF="xEMACS.HTM#IDX270">C-h C-d</A>
  14661. <LI><A HREF="xEMACS.HTM#IDX272">C-h C-w</A>
  14662. <LI><A HREF="xEMACS.HTM#IDX1041">C-h f</A>
  14663. <LI><A HREF="xEMACS.HTM#IDX256">C-h i</A>
  14664. <LI><A HREF="xEMACS.HTM#IDX243">C-h k</A>
  14665. <LI><A HREF="xEMACS.HTM#IDX258">C-h l</A>
  14666. <LI><A HREF="xEMACS.HTM#IDX260">C-h m</A>
  14667. <LI><A HREF="xEMACS.HTM#IDX264">C-h n</A>
  14668. <LI><A HREF="xEMACS.HTM#IDX1558">C-h s</A>
  14669. <LI><A HREF="xEMACS.HTM#IDX266">C-h t</A>
  14670. <LI><A HREF="xEMACS.HTM#IDX1497">C-h v</A>
  14671. <LI><A HREF="xEMACS.HTM#IDX248">C-h w</A>
  14672. <LI><A HREF="xEMACS.HTM#IDX338">C-k</A>
  14673. <LI><A HREF="xEMACS.HTM#IDX410">C-l</A>
  14674. <LI><A HREF="xEMACS.HTM#IDX496">C-l (query-replace)</A>
  14675. <LI><A HREF="xEMACS.HTM#IDX978">C-M-@</A>
  14676. <LI><A HREF="xEMACS.HTM#IDX999">C-M-\</A>
  14677. <LI><A HREF="xEMACS.HTM#IDX981">C-M-a</A>
  14678. <LI><A HREF="xEMACS.HTM#IDX1073">C-M-a (Fortran mode)</A>
  14679. <LI><A HREF="xEMACS.HTM#IDX962">C-M-b</A>
  14680. <LI><A HREF="xEMACS.HTM#IDX1448">C-M-c</A>
  14681. <LI><A HREF="xEMACS.HTM#IDX972">C-M-d</A>
  14682. <LI><A HREF="xEMACS.HTM#IDX982">C-M-e</A>
  14683. <LI><A HREF="xEMACS.HTM#IDX1074">C-M-e (Fortran mode)</A>
  14684. <LI><A HREF="xEMACS.HTM#IDX961">C-M-f</A>
  14685. <LI><A HREF="xEMACS.HTM#IDX983">C-M-h</A>
  14686. <LI><A HREF="xEMACS.HTM#IDX1075">C-M-h (Fortran mode)</A>
  14687. <LI><A HREF="xEMACS.HTM#IDX965">C-M-k</A>
  14688. <LI><A HREF="xEMACS.HTM#IDX1336">C-M-l (Rmail)</A>
  14689. <LI><A HREF="xEMACS.HTM#IDX967">C-M-n</A>
  14690. <LI><A HREF="xEMACS.HTM#IDX1326">C-M-n (Rmail)</A>
  14691. <LI><A HREF="xEMACS.HTM#IDX759">C-M-o</A>
  14692. <LI><A HREF="xEMACS.HTM#IDX968">C-M-p</A>
  14693. <LI><A HREF="xEMACS.HTM#IDX1327">C-M-p (Rmail)</A>
  14694. <LI><A HREF="xEMACS.HTM#IDX995">C-M-q</A>
  14695. <LI><A HREF="xEMACS.HTM#IDX1084">C-M-q (Fortran mode)</A>
  14696. <LI><A HREF="xEMACS.HTM#IDX1338">C-M-r (Rmail)</A>
  14697. <LI><A HREF="xEMACS.HTM#IDX976">C-M-t</A>
  14698. <LI><A HREF="xEMACS.HTM#IDX971">C-M-u</A>
  14699. <LI><A HREF="xEMACS.HTM#IDX724">C-M-v</A>
  14700. <LI><A HREF="xEMACS.HTM#IDX364">C-M-w</A>
  14701. <LI><A HREF="xEMACS.HTM#IDX1158">C-M-x</A>
  14702. <LI><A HREF="xEMACS.HTM#IDX159">C-n</A>
  14703. <LI><A HREF="xEMACS.HTM#IDX1340">C-n (Rmail summary)</A>
  14704. <LI><A HREF="xEMACS.HTM#IDX182">C-o</A>
  14705. <LI><A HREF="xEMACS.HTM#IDX1318">C-o (Rmail)</A>
  14706. <LI><A HREF="xEMACS.HTM#IDX160">C-p</A>
  14707. <LI><A HREF="xEMACS.HTM#IDX1341">C-p (Rmail summary)</A>
  14708. <LI><A HREF="xEMACS.HTM#IDX153">C-q</A>
  14709. <LI><A HREF="xEMACS.HTM#IDX451">C-q (isearch-mode)</A>
  14710. <LI><A HREF="xEMACS.HTM#IDX434">C-r</A>
  14711. <LI><A HREF="xEMACS.HTM#IDX453">C-r (isearch-mode)</A>
  14712. <LI><A HREF="xEMACS.HTM#IDX494">C-r (query-replace)</A>
  14713. <LI><A HREF="xEMACS.HTM#IDX433">C-s</A>
  14714. <LI><A HREF="xEMACS.HTM#IDX452">C-s (isearch-mode)</A>
  14715. <LI><A HREF="xEMACS.HTM#IDX276">C-SPC</A>
  14716. <LI><A HREF="xEMACS.HTM#IDX512">C-t</A>
  14717. <LI><A HREF="xEMACS.HTM#IDX203">C-u</A>
  14718. <LI><A HREF="xEMACS.HTM#IDX1020">C-u - C-x ;</A>
  14719. <LI><A HREF="xEMACS.HTM#IDX298">C-u C-@</A>
  14720. <LI><A HREF="xEMACS.HTM#IDX296">C-u C-SPC</A>
  14721. <LI><A HREF="xEMACS.HTM#IDX626">C-u C-x v v</A>
  14722. <LI><A HREF="xEMACS.HTM#IDX998">C-u TAB</A>
  14723. <LI><A HREF="xEMACS.HTM#IDX412">C-v</A>
  14724. <LI><A HREF="xEMACS.HTM#IDX351">C-w</A>
  14725. <LI><A HREF="xEMACS.HTM#IDX455">C-w (isearch-mode)</A>
  14726. <LI><A HREF="xEMACS.HTM#IDX495">C-w (query-replace)</A>
  14727. <LI><A HREF="xEMACS.HTM#IDX47">C-x</A>
  14728. <LI><A HREF="xEMACS.HTM#IDX424">C-x $</A>
  14729. <LI><A HREF="xEMACS.HTM#IDX1513">C-x (</A>
  14730. <LI><A HREF="xEMACS.HTM#IDX1514">C-x )</A>
  14731. <LI><A HREF="xEMACS.HTM#IDX926">C-x .</A>
  14732. <LI><A HREF="xEMACS.HTM#IDX734">C-x 0</A>
  14733. <LI><A HREF="xEMACS.HTM#IDX736">C-x 1</A>
  14734. <LI><A HREF="xEMACS.HTM#IDX714">C-x 2</A>
  14735. <LI><A HREF="xEMACS.HTM#IDX716">C-x 3</A>
  14736. <LI><A HREF="xEMACS.HTM#IDX727">C-x 4</A>
  14737. <LI><A HREF="xEMACS.HTM#IDX1062">C-x 4 .</A>
  14738. <LI><A HREF="xEMACS.HTM#IDX692">C-x 4 b</A>
  14739. <LI><A HREF="xEMACS.HTM#IDX674">C-x 4 d</A>
  14740. <LI><A HREF="xEMACS.HTM#IDX560">C-x 4 f</A>
  14741. <LI><A HREF="xEMACS.HTM#IDX1245">C-x 4 m</A>
  14742. <LI><A HREF="xEMACS.HTM#IDX693">C-x 5 b</A>
  14743. <LI><A HREF="xEMACS.HTM#IDX562">C-x 5 C-f</A>
  14744. <LI><A HREF="xEMACS.HTM#IDX1027">C-x ;</A>
  14745. <LI><A HREF="xEMACS.HTM#IDX418">C-x <</A>
  14746. <LI><A HREF="xEMACS.HTM#IDX196">C-x =</A>
  14747. <LI><A HREF="xEMACS.HTM#IDX419">C-x ></A>
  14748. <LI><A HREF="xEMACS.HTM#IDX900">C-x [</A>
  14749. <LI><A HREF="xEMACS.HTM#IDX901">C-x ]</A>
  14750. <LI><A HREF="xEMACS.HTM#IDX738">C-x ^</A>
  14751. <LI><A HREF="xEMACS.HTM#IDX1116">C-x `</A>
  14752. <LI><A HREF="xEMACS.HTM#IDX1164">C-x a g</A>
  14753. <LI><A HREF="xEMACS.HTM#IDX1168">C-x a i g</A>
  14754. <LI><A HREF="xEMACS.HTM#IDX1170">C-x a i l</A>
  14755. <LI><A HREF="xEMACS.HTM#IDX1166">C-x a l</A>
  14756. <LI><A HREF="xEMACS.HTM#IDX695">C-x b</A>
  14757. <LI><A HREF="xEMACS.HTM#IDX699">C-x C-b</A>
  14758. <LI><A HREF="xEMACS.HTM#IDX131">C-x C-c</A>
  14759. <LI><A HREF="xEMACS.HTM#IDX658">C-x C-d</A>
  14760. <LI><A HREF="xEMACS.HTM#IDX1144">C-x C-e</A>
  14761. <LI><A HREF="xEMACS.HTM#IDX938">C-x C-l</A>
  14762. <LI><A HREF="xEMACS.HTM#IDX334">C-x C-o</A>
  14763. <LI><A HREF="xEMACS.HTM#IDX904">C-x C-p</A>
  14764. <LI><A HREF="xEMACS.HTM#IDX702">C-x C-q</A>
  14765. <LI><A HREF="xEMACS.HTM#IDX614">C-x C-q (version control)</A>
  14766. <LI><A HREF="xEMACS.HTM#IDX567">C-x C-s</A>
  14767. <LI><A HREF="xEMACS.HTM#IDX514">C-x C-t</A>
  14768. <LI><A HREF="xEMACS.HTM#IDX939">C-x C-u</A>
  14769. <LI><A HREF="xEMACS.HTM#IDX557">C-x C-v</A>
  14770. <LI><A HREF="xEMACS.HTM#IDX574">C-x C-w</A>
  14771. <LI><A HREF="xEMACS.HTM#IDX278">C-x C-x</A>
  14772. <LI><A HREF="xEMACS.HTM#IDX671">C-x d</A>
  14773. <LI><A HREF="xEMACS.HTM#IDX885">C-x DEL</A>
  14774. <LI><A HREF="xEMACS.HTM#IDX1515">C-x e</A>
  14775. <LI><A HREF="xEMACS.HTM#IDX228">C-x ESC</A>
  14776. <LI><A HREF="xEMACS.HTM#IDX923">C-x f</A>
  14777. <LI><A HREF="xEMACS.HTM#IDX291">C-x h</A>
  14778. <LI><A HREF="xEMACS.HTM#IDX709">C-x k</A>
  14779. <LI><A HREF="xEMACS.HTM#IDX906">C-x l</A>
  14780. <LI><A HREF="xEMACS.HTM#IDX1243">C-x m</A>
  14781. <LI><A HREF="xEMACS.HTM#IDX1436">C-x n n</A>
  14782. <LI><A HREF="xEMACS.HTM#IDX1438">C-x n w</A>
  14783. <LI><A HREF="xEMACS.HTM#IDX721">C-x o</A>
  14784. <LI><A HREF="xEMACS.HTM#IDX1521">C-x q</A>
  14785. <LI><A HREF="xEMACS.HTM#IDX404">C-x r g</A>
  14786. <LI><A HREF="xEMACS.HTM#IDX401">C-x r j</A>
  14787. <LI><A HREF="xEMACS.HTM#IDX403">C-x r s</A>
  14788. <LI><A HREF="xEMACS.HTM#IDX399">C-x r SPC</A>
  14789. <LI><A HREF="xEMACS.HTM#IDX569">C-x s</A>
  14790. <LI><A HREF="xEMACS.HTM#IDX766">C-x TAB</A>
  14791. <LI><A HREF="xEMACS.HTM#IDX207">C-x u</A>
  14792. <LI><A HREF="xEMACS.HTM#IDX638">C-x v =</A>
  14793. <LI><A HREF="xEMACS.HTM#IDX633">C-x v a</A>
  14794. <LI><A HREF="xEMACS.HTM#IDX620">C-x v c</A>
  14795. <LI><A HREF="xEMACS.HTM#IDX641">C-x v d</A>
  14796. <LI><A HREF="xEMACS.HTM#IDX650">C-x v h</A>
  14797. <LI><A HREF="xEMACS.HTM#IDX622">C-x v i</A>
  14798. <LI><A HREF="xEMACS.HTM#IDX639">C-x v l</A>
  14799. <LI><A HREF="xEMACS.HTM#IDX647">C-x v r</A>
  14800. <LI><A HREF="xEMACS.HTM#IDX645">C-x v s</A>
  14801. <LI><A HREF="xEMACS.HTM#IDX618">C-x v u</A>
  14802. <LI><A HREF="xEMACS.HTM#IDX636">C-x v ~</A>
  14803. <LI><A HREF="xEMACS.HTM#IDX740">C-x }</A>
  14804. <LI><A HREF="xEMACS.HTM#IDX359">C-y</A>
  14805. <LI><A HREF="xEMACS.HTM#IDX454">C-y (isearch-mode)</A>
  14806. <LI><A HREF="xEMACS.HTM#IDX129">C-z</A>
  14807. <LI><A HREF="xEMACS.HTM#IDX31">control key</A>
  14808. </DIR>
  14809. <H2>d</H2>
  14810. <DIR>
  14811. <LI><A HREF="xEMACS.HTM#IDX1350">d (Rmail summary)</A>
  14812. <LI><A HREF="xEMACS.HTM#IDX1301">d (Rmail)</A>
  14813. <LI><A HREF="xEMACS.HTM#IDX948">DEL</A>
  14814. <LI><A HREF="xEMACS.HTM#IDX449">DEL (isearch-mode)</A>
  14815. <LI><A HREF="xEMACS.HTM#IDX488">DEL (query-replace)</A>
  14816. <LI><A HREF="xEMACS.HTM#IDX1355">DEL (Rmail summary)</A>
  14817. <LI><A HREF="xEMACS.HTM#IDX1282">DEL (Rmail)</A>
  14818. </DIR>
  14819. <H2>e</H2>
  14820. <DIR>
  14821. <LI><A HREF="xEMACS.HTM#IDX1306">e (Rmail)</A>
  14822. <LI><A HREF="xEMACS.HTM#IDX54">ESC</A>
  14823. <LI><A HREF="xEMACS.HTM#IDX490">ESC (query-replace)</A>
  14824. </DIR>
  14825. <H2>f</H2>
  14826. <DIR>
  14827. <LI><A HREF="xEMACS.HTM#IDX1368">f (Rmail)</A>
  14828. </DIR>
  14829. <H2>g</H2>
  14830. <DIR>
  14831. <LI><A HREF="xEMACS.HTM#IDX1314">g (Rmail)</A>
  14832. </DIR>
  14833. <H2>h</H2>
  14834. <DIR>
  14835. <LI><A HREF="xEMACS.HTM#IDX1333">h (Rmail)</A>
  14836. <LI><A HREF="xEMACS.HTM#IDX56">hyper key</A>
  14837. </DIR>
  14838. <H2>i</H2>
  14839. <DIR>
  14840. <LI><A HREF="xEMACS.HTM#IDX1311">i (Rmail)</A>
  14841. </DIR>
  14842. <H2>j</H2>
  14843. <DIR>
  14844. <LI><A HREF="xEMACS.HTM#IDX1348">j (Rmail summary)</A>
  14845. <LI><A HREF="xEMACS.HTM#IDX1295">j (Rmail)</A>
  14846. </DIR>
  14847. <H2>k</H2>
  14848. <DIR>
  14849. <LI><A HREF="xEMACS.HTM#IDX1323">k (rmail)</A>
  14850. </DIR>
  14851. <H2>l</H2>
  14852. <DIR>
  14853. <LI><A HREF="xEMACS.HTM#IDX1335">l (Rmail)</A>
  14854. <LI><A HREF="xEMACS.HTM#IDX993">LFD</A>
  14855. <LI><A HREF="xEMACS.HTM#IDX813">LFD (TeX mode)</A>
  14856. </DIR>
  14857. <H2>m</H2>
  14858. <DIR>
  14859. <LI><A HREF="xEMACS.HTM#IDX1371">m (Rmail)</A>
  14860. <LI><A HREF="xEMACS.HTM#IDX1393">M-!</A>
  14861. <LI><A HREF="xEMACS.HTM#IDX529">M-$</A>
  14862. <LI><A HREF="xEMACS.HTM#IDX484">M-%</A>
  14863. <LI><A HREF="xEMACS.HTM#IDX1175">M-'</A>
  14864. <LI><A HREF="xEMACS.HTM#IDX1034">M-(</A>
  14865. <LI><A HREF="xEMACS.HTM#IDX1035">M-)</A>
  14866. <LI><A HREF="xEMACS.HTM#IDX1065">M-,</A>
  14867. <LI><A HREF="xEMACS.HTM#IDX200">M-<TT>-</TT></A>
  14868. <LI><A HREF="xEMACS.HTM#IDX525">M-<TT>-</TT> M-c</A>
  14869. <LI><A HREF="xEMACS.HTM#IDX523">M-<TT>-</TT> M-l</A>
  14870. <LI><A HREF="xEMACS.HTM#IDX524">M-<TT>-</TT> M-u</A>
  14871. <LI><A HREF="xEMACS.HTM#IDX1054">M-.</A>
  14872. <LI><A HREF="xEMACS.HTM#IDX1190">M-/</A>
  14873. <LI><A HREF="xEMACS.HTM#IDX199">M-1</A>
  14874. <LI><A HREF="xEMACS.HTM#IDX1017">M-;</A>
  14875. <LI><A HREF="xEMACS.HTM#IDX164">M-<</A>
  14876. <LI><A HREF="xEMACS.HTM#IDX194">M-=</A>
  14877. <LI><A HREF="xEMACS.HTM#IDX163">M-></A>
  14878. <LI><A HREF="xEMACS.HTM#IDX794">M-?</A>
  14879. <LI><A HREF="xEMACS.HTM#IDX876">M-@</A>
  14880. <LI><A HREF="xEMACS.HTM#IDX890">M-[</A>
  14881. <LI><A HREF="xEMACS.HTM#IDX761">M-\</A>
  14882. <LI><A HREF="xEMACS.HTM#IDX891">M-]</A>
  14883. <LI><A HREF="xEMACS.HTM#IDX762">M-^</A>
  14884. <LI><A HREF="xEMACS.HTM#IDX880">M-a</A>
  14885. <LI><A HREF="xEMACS.HTM#IDX866">M-b</A>
  14886. <LI><A HREF="xEMACS.HTM#IDX933">M-c</A>
  14887. <LI><A HREF="xEMACS.HTM#IDX470">M-C-s</A>
  14888. <LI><A HREF="xEMACS.HTM#IDX869">M-d</A>
  14889. <LI><A HREF="xEMACS.HTM#IDX872">M-DEL</A>
  14890. <LI><A HREF="xEMACS.HTM#IDX881">M-e</A>
  14891. <LI><A HREF="xEMACS.HTM#IDX1140">M-ESC</A>
  14892. <LI><A HREF="xEMACS.HTM#IDX865">M-f</A>
  14893. <LI><A HREF="xEMACS.HTM#IDX914">M-g</A>
  14894. <LI><A HREF="xEMACS.HTM#IDX894">M-h</A>
  14895. <LI><A HREF="xEMACS.HTM#IDX770">M-i</A>
  14896. <LI><A HREF="xEMACS.HTM#IDX884">M-k</A>
  14897. <LI><A HREF="xEMACS.HTM#IDX931">M-l</A>
  14898. <LI><A HREF="xEMACS.HTM#IDX1022">M-LFD</A>
  14899. <LI><A HREF="xEMACS.HTM#IDX1086">M-LFD (Fortran mode)</A>
  14900. <LI><A HREF="xEMACS.HTM#IDX757">M-m</A>
  14901. <LI><A HREF="xEMACS.HTM#IDX792">M-n</A>
  14902. <LI><A HREF="xEMACS.HTM#IDX458">M-n (isearch-mode)</A>
  14903. <LI><A HREF="xEMACS.HTM#IDX1287">M-n (Rmail)</A>
  14904. <LI><A HREF="xEMACS.HTM#IDX1418">M-n (Shell mode)</A>
  14905. <LI><A HREF="xEMACS.HTM#IDX793">M-p</A>
  14906. <LI><A HREF="xEMACS.HTM#IDX457">M-p (isearch-mode)</A>
  14907. <LI><A HREF="xEMACS.HTM#IDX1288">M-p (Rmail)</A>
  14908. <LI><A HREF="xEMACS.HTM#IDX1417">M-p (Shell mode)</A>
  14909. <LI><A HREF="xEMACS.HTM#IDX912">M-q</A>
  14910. <LI><A HREF="xEMACS.HTM#IDX165">M-r</A>
  14911. <LI><A HREF="xEMACS.HTM#IDX919">M-s</A>
  14912. <LI><A HREF="xEMACS.HTM#IDX1293">M-s (Rmail)</A>
  14913. <LI><A HREF="xEMACS.HTM#IDX332">M-SPC</A>
  14914. <LI><A HREF="xEMACS.HTM#IDX874">M-t</A>
  14915. <LI><A HREF="xEMACS.HTM#IDX1226">M-TAB</A>
  14916. <LI><A HREF="xEMACS.HTM#IDX459">M-TAB (isearch-mode)</A>
  14917. <LI><A HREF="xEMACS.HTM#IDX932">M-u</A>
  14918. <LI><A HREF="xEMACS.HTM#IDX413">M-v</A>
  14919. <LI><A HREF="xEMACS.HTM#IDX361">M-w</A>
  14920. <LI><A HREF="xEMACS.HTM#IDX235">M-x</A>
  14921. <LI><A HREF="xEMACS.HTM#IDX366">M-y</A>
  14922. <LI><A HREF="xEMACS.HTM#IDX352">M-z</A>
  14923. <LI><A HREF="xEMACS.HTM#IDX1395">M-|</A>
  14924. <LI><A HREF="xEMACS.HTM#IDX571">M-~</A>
  14925. <LI><A HREF="xEMACS.HTM#IDX53">META</A>
  14926. <LI><A HREF="xEMACS.HTM#IDX30">meta key</A>
  14927. </DIR>
  14928. <H2>n</H2>
  14929. <DIR>
  14930. <LI><A HREF="xEMACS.HTM#IDX1344">n (Rmail summary)</A>
  14931. <LI><A HREF="xEMACS.HTM#IDX1285">n (Rmail)</A>
  14932. </DIR>
  14933. <H2>o</H2>
  14934. <DIR>
  14935. <LI><A HREF="xEMACS.HTM#IDX1316">o (Rmail)</A>
  14936. </DIR>
  14937. <H2>p</H2>
  14938. <DIR>
  14939. <LI><A HREF="xEMACS.HTM#IDX1345">p (Rmail summary)</A>
  14940. <LI><A HREF="xEMACS.HTM#IDX1286">p (Rmail)</A>
  14941. </DIR>
  14942. <H2>q</H2>
  14943. <DIR>
  14944. <LI><A HREF="xEMACS.HTM#IDX1360">q (Rmail summary)</A>
  14945. <LI><A HREF="xEMACS.HTM#IDX1279">q (Rmail)</A>
  14946. </DIR>
  14947. <H2>r</H2>
  14948. <DIR>
  14949. <LI><A HREF="xEMACS.HTM#IDX1362">r (Rmail)</A>
  14950. <LI><A HREF="xEMACS.HTM#IDX147">RET</A>
  14951. <LI><A HREF="xEMACS.HTM#IDX450">RET (isearch-mode)</A>
  14952. <LI><A HREF="xEMACS.HTM#IDX1406">RET (Shell mode)</A>
  14953. </DIR>
  14954. <H2>s</H2>
  14955. <DIR>
  14956. <LI><A HREF="xEMACS.HTM#IDX1277">s (Rmail)</A>
  14957. <LI><A HREF="xEMACS.HTM#IDX34">shift key</A>
  14958. <LI><A HREF="xEMACS.HTM#IDX220">SPC</A>
  14959. <LI><A HREF="xEMACS.HTM#IDX487">SPC (query-replace)</A>
  14960. <LI><A HREF="xEMACS.HTM#IDX1354">SPC (Rmail summary)</A>
  14961. <LI><A HREF="xEMACS.HTM#IDX1281">SPC (Rmail)</A>
  14962. <LI><A HREF="xEMACS.HTM#IDX57">super key</A>
  14963. </DIR>
  14964. <H2>t</H2>
  14965. <DIR>
  14966. <LI><A HREF="xEMACS.HTM#IDX1375">t (Rmail)</A>
  14967. <LI><A HREF="xEMACS.HTM#IDX990">TAB</A>
  14968. <LI><A HREF="xEMACS.HTM#IDX1419">TAB (Shell mode)</A>
  14969. </DIR>
  14970. <H2>u</H2>
  14971. <DIR>
  14972. <LI><A HREF="xEMACS.HTM#IDX1351">u (Rmail summary)</A>
  14973. <LI><A HREF="xEMACS.HTM#IDX1308">u (Rmail)</A>
  14974. </DIR>
  14975. <H2>w</H2>
  14976. <DIR>
  14977. <LI><A HREF="xEMACS.HTM#IDX1378">w (Rmail)</A>
  14978. </DIR>
  14979. <H2>x</H2>
  14980. <DIR>
  14981. <LI><A HREF="xEMACS.HTM#IDX1358">x (Rmail summary)</A>
  14982. </DIR>
  14983. <H1><A NAME="SEC327" HREF="xEMACS_TO.HTM#SEC327">Command and Function Index</A></H1>
  14984. <H2>a</H2>
  14985. <DIR>
  14986. <LI><A HREF="xEMACS.HTM#IDX1492">abbrev-mode</A>
  14987. <LI><A HREF="xEMACS.HTM#IDX1176">abbrev-prefix-mark</A>
  14988. <LI><A HREF="xEMACS.HTM#IDX1596">abort-recursive-edit</A>
  14989. <LI><A HREF="xEMACS.HTM#IDX1047">add-change-log-entry</A>
  14990. <LI><A HREF="xEMACS.HTM#IDX1165">add-global-abbrev</A>
  14991. <LI><A HREF="xEMACS.HTM#IDX1651">add-menu</A>
  14992. <LI><A HREF="xEMACS.HTM#IDX1652">add-menu-item</A>
  14993. <LI><A HREF="xEMACS.HTM#IDX1167">add-mode-abbrev</A>
  14994. <LI><A HREF="xEMACS.HTM#IDX676">add-name-to-file</A>
  14995. <LI><A HREF="xEMACS.HTM#IDX365">append-next-kill</A>
  14996. <LI><A HREF="xEMACS.HTM#IDX385">append-to-buffer</A>
  14997. <LI><A HREF="xEMACS.HTM#IDX677">append-to-file</A>
  14998. <LI><A HREF="xEMACS.HTM#IDX255">apropos</A>
  14999. <LI><A HREF="xEMACS.HTM#IDX590">ask-user-about-lock</A>
  15000. <LI><A HREF="xEMACS.HTM#IDX1488">auto-fill-mode</A>
  15001. <LI><A HREF="xEMACS.HTM#IDX600">auto-save-mode</A>
  15002. </DIR>
  15003. <H2>b</H2>
  15004. <DIR>
  15005. <LI><A HREF="xEMACS.HTM#IDX758">back-to-indentation</A>
  15006. <LI><A HREF="xEMACS.HTM#IDX169">backward-char</A>
  15007. <LI><A HREF="xEMACS.HTM#IDX949">backward-delete-char-untabify</A>
  15008. <LI><A HREF="xEMACS.HTM#IDX887">backward-kill-sentence</A>
  15009. <LI><A HREF="xEMACS.HTM#IDX871">backward-kill-word</A>
  15010. <LI><A HREF="xEMACS.HTM#IDX970">backward-list</A>
  15011. <LI><A HREF="xEMACS.HTM#IDX903">backward-page</A>
  15012. <LI><A HREF="xEMACS.HTM#IDX892">backward-paragraph</A>
  15013. <LI><A HREF="xEMACS.HTM#IDX882">backward-sentence</A>
  15014. <LI><A HREF="xEMACS.HTM#IDX964">backward-sexp</A>
  15015. <LI><A HREF="xEMACS.HTM#IDX790">backward-text-line</A>
  15016. <LI><A HREF="xEMACS.HTM#IDX973">backward-up-list</A>
  15017. <LI><A HREF="xEMACS.HTM#IDX868">backward-word</A>
  15018. <LI><A HREF="xEMACS.HTM#IDX1134">batch-byte-compile</A>
  15019. <LI><A HREF="xEMACS.HTM#IDX174">beginning-of-buffer</A>
  15020. <LI><A HREF="xEMACS.HTM#IDX984">beginning-of-defun</A>
  15021. <LI><A HREF="xEMACS.HTM#IDX1078">beginning-of-fortran-subprogram</A>
  15022. <LI><A HREF="xEMACS.HTM#IDX166">beginning-of-line</A>
  15023. <LI><A HREF="xEMACS.HTM#IDX711">buffer-menu</A>
  15024. <LI><A HREF="xEMACS.HTM#IDX1608">byte-compile-and-load-file</A>
  15025. <LI><A HREF="xEMACS.HTM#IDX1609">byte-compile-buffer</A>
  15026. <LI><A HREF="xEMACS.HTM#IDX1130">byte-compile-file</A>
  15027. <LI><A HREF="xEMACS.HTM#IDX1133">byte-recompile-directory</A>
  15028. </DIR>
  15029. <H2>c</H2>
  15030. <DIR>
  15031. <LI><A HREF="xEMACS.HTM#IDX991">c-indent-line</A>
  15032. <LI><A HREF="xEMACS.HTM#IDX1518">call-last-kbd-macro</A>
  15033. <LI><A HREF="xEMACS.HTM#IDX1152">cancel-debug-on-entry</A>
  15034. <LI><A HREF="xEMACS.HTM#IDX937">capitalize-word</A>
  15035. <LI><A HREF="xEMACS.HTM#IDX921">center-line</A>
  15036. <LI><A HREF="xEMACS.HTM#IDX396">clear-rectangle</A>
  15037. <LI><A HREF="xEMACS.HTM#IDX1422">comint-delchar-or-maybe-eof</A>
  15038. <LI><A HREF="xEMACS.HTM#IDX1431">comint-dynamic-complete</A>
  15039. <LI><A HREF="xEMACS.HTM#IDX1430">comint-next-input</A>
  15040. <LI><A HREF="xEMACS.HTM#IDX1429">comint-previous-input</A>
  15041. <LI><A HREF="xEMACS.HTM#IDX253">command-apropos</A>
  15042. <LI><A HREF="xEMACS.HTM#IDX1649">compare-windows</A>
  15043. <LI><A HREF="xEMACS.HTM#IDX1112">compile</A>
  15044. <LI><A HREF="xEMACS.HTM#IDX1611">compile-defun</A>
  15045. <LI><A HREF="xEMACS.HTM#IDX1137">convert-mocklisp-buffer</A>
  15046. <LI><A HREF="xEMACS.HTM#IDX1610">conx</A>
  15047. <LI><A HREF="xEMACS.HTM#IDX1465">conx-buffer</A>
  15048. <LI><A HREF="xEMACS.HTM#IDX1468">conx-init</A>
  15049. <LI><A HREF="xEMACS.HTM#IDX1466">conx-load</A>
  15050. <LI><A HREF="xEMACS.HTM#IDX1467">conx-region</A>
  15051. <LI><A HREF="xEMACS.HTM#IDX1469">conx-save</A>
  15052. <LI><A HREF="xEMACS.HTM#IDX678">copy-file</A>
  15053. <LI><A HREF="xEMACS.HTM#IDX1428">copy-last-shell-input</A>
  15054. <LI><A HREF="xEMACS.HTM#IDX362">copy-region-as-kill</A>
  15055. <LI><A HREF="xEMACS.HTM#IDX408">copy-region-to-rectangle</A>
  15056. <LI><A HREF="xEMACS.HTM#IDX387">copy-to-buffer</A>
  15057. <LI><A HREF="xEMACS.HTM#IDX405">copy-to-register</A>
  15058. <LI><A HREF="xEMACS.HTM#IDX907">count-lines-page</A>
  15059. <LI><A HREF="xEMACS.HTM#IDX195">count-lines-region</A>
  15060. <LI><A HREF="xEMACS.HTM#IDX499">count-matches</A>
  15061. <LI><A HREF="xEMACS.HTM#IDX791">count-text-lines</A>
  15062. </DIR>
  15063. <H2>d</H2>
  15064. <DIR>
  15065. <LI><A HREF="xEMACS.HTM#IDX1191">dabbrev-expand</A>
  15066. <LI><A HREF="xEMACS.HTM#IDX1153">debug</A>
  15067. <LI><A HREF="xEMACS.HTM#IDX1151">debug-on-entry</A>
  15068. <LI><A HREF="xEMACS.HTM#IDX1509">default-value</A>
  15069. <LI><A HREF="xEMACS.HTM#IDX1189">define-abbrevs</A>
  15070. <LI><A HREF="xEMACS.HTM#IDX1549">define-key</A>
  15071. <LI><A HREF="xEMACS.HTM#IDX506">delete-backward-char</A>
  15072. <LI><A HREF="xEMACS.HTM#IDX335">delete-blank-lines</A>
  15073. <LI><A HREF="xEMACS.HTM#IDX1205">delete-char</A>
  15074. <LI><A HREF="xEMACS.HTM#IDX680">delete-file</A>
  15075. <LI><A HREF="xEMACS.HTM#IDX763">delete-horizontal-space</A>
  15076. <LI><A HREF="xEMACS.HTM#IDX764">delete-indentation</A>
  15077. <LI><A HREF="xEMACS.HTM#IDX501">delete-matching-lines</A>
  15078. <LI><A HREF="xEMACS.HTM#IDX1653">delete-menu-item</A>
  15079. <LI><A HREF="xEMACS.HTM#IDX500">delete-non-matching-lines</A>
  15080. <LI><A HREF="xEMACS.HTM#IDX737">delete-other-windows</A>
  15081. <LI><A HREF="xEMACS.HTM#IDX392">delete-rectangle</A>
  15082. <LI><A HREF="xEMACS.HTM#IDX735">delete-window</A>
  15083. <LI><A HREF="xEMACS.HTM#IDX263">describe-bindings</A>
  15084. <LI><A HREF="xEMACS.HTM#IDX269">describe-copying</A>
  15085. <LI><A HREF="xEMACS.HTM#IDX271">describe-distribution</A>
  15086. <LI><A HREF="xEMACS.HTM#IDX1042">describe-function</A>
  15087. <LI><A HREF="xEMACS.HTM#IDX244">describe-key</A>
  15088. <LI><A HREF="xEMACS.HTM#IDX242">describe-key-briefly</A>
  15089. <LI><A HREF="xEMACS.HTM#IDX261">describe-mode</A>
  15090. <LI><A HREF="xEMACS.HTM#IDX273">describe-no-warranty</A>
  15091. <LI><A HREF="xEMACS.HTM#IDX1559">describe-syntax</A>
  15092. <LI><A HREF="xEMACS.HTM#IDX1498">describe-variable</A>
  15093. <LI><A HREF="xEMACS.HTM#IDX662">diff</A>
  15094. <LI><A HREF="xEMACS.HTM#IDX664">diff-backup</A>
  15095. <LI><A HREF="xEMACS.HTM#IDX201">digit-argument</A>
  15096. <LI><A HREF="xEMACS.HTM#IDX670">dired</A>
  15097. <LI><A HREF="xEMACS.HTM#IDX731">dired-other-window</A>
  15098. <LI><A HREF="xEMACS.HTM#IDX1553">disable-command</A>
  15099. <LI><A HREF="xEMACS.HTM#IDX1654">disable-menu-item</A>
  15100. <LI><A HREF="xEMACS.HTM#IDX1135">disassemble</A>
  15101. <LI><A HREF="xEMACS.HTM#IDX12">display-time</A>
  15102. <LI><A HREF="xEMACS.HTM#IDX1454">dissociated-press</A>
  15103. <LI><A HREF="xEMACS.HTM#IDX602">do-auto-save</A>
  15104. <LI><A HREF="xEMACS.HTM#IDX1601">doctor</A>
  15105. <LI><A HREF="xEMACS.HTM#IDX974">down-list</A>
  15106. <LI><A HREF="xEMACS.HTM#IDX941">downcase-region</A>
  15107. <LI><A HREF="xEMACS.HTM#IDX935">downcase-word</A>
  15108. </DIR>
  15109. <H2>e</H2>
  15110. <DIR>
  15111. <LI><A HREF="xEMACS.HTM#IDX1180">edit-abbrevs</A>
  15112. <LI><A HREF="xEMACS.HTM#IDX1182">edit-abbrevs-redefine</A>
  15113. <LI><A HREF="xEMACS.HTM#IDX1502">edit-options</A>
  15114. <LI><A HREF="xEMACS.HTM#IDX1193">edit-picture</A>
  15115. <LI><A HREF="xEMACS.HTM#IDX781">edit-tab-stops</A>
  15116. <LI><A HREF="xEMACS.HTM#IDX773">edit-tab-stops-note-changes</A>
  15117. <LI><A HREF="xEMACS.HTM#IDX1477">edt-emulation-off</A>
  15118. <LI><A HREF="xEMACS.HTM#IDX1476">edt-emulation-on</A>
  15119. <LI><A HREF="xEMACS.HTM#IDX795">electric-nroff-mode</A>
  15120. <LI><A HREF="xEMACS.HTM#IDX1139">emacs-lisp-mode</A>
  15121. <LI><A HREF="xEMACS.HTM#IDX1603">emacs-version</A>
  15122. <LI><A HREF="xEMACS.HTM#IDX1554">enable-command</A>
  15123. <LI><A HREF="xEMACS.HTM#IDX1655">enable-menu-item</A>
  15124. <LI><A HREF="xEMACS.HTM#IDX1517">end-kbd-macro</A>
  15125. <LI><A HREF="xEMACS.HTM#IDX175">end-of-buffer</A>
  15126. <LI><A HREF="xEMACS.HTM#IDX985">end-of-defun</A>
  15127. <LI><A HREF="xEMACS.HTM#IDX1079">end-of-fortran-subprogram</A>
  15128. <LI><A HREF="xEMACS.HTM#IDX167">end-of-line</A>
  15129. <LI><A HREF="xEMACS.HTM#IDX739">enlarge-window</A>
  15130. <LI><A HREF="xEMACS.HTM#IDX741">enlarge-window-horizontally</A>
  15131. <LI><A HREF="xEMACS.HTM#IDX1147">eval-current-buffer</A>
  15132. <LI><A HREF="xEMACS.HTM#IDX1143">eval-defun</A>
  15133. <LI><A HREF="xEMACS.HTM#IDX1141">eval-expression</A>
  15134. <LI><A HREF="xEMACS.HTM#IDX1145">eval-last-sexp</A>
  15135. <LI><A HREF="xEMACS.HTM#IDX1146">eval-region</A>
  15136. <LI><A HREF="xEMACS.HTM#IDX279">exchange-point-and-mark</A>
  15137. <LI><A HREF="xEMACS.HTM#IDX238">execute-extended-command</A>
  15138. <LI><A HREF="xEMACS.HTM#IDX1449">exit-recursive-edit</A>
  15139. <LI><A HREF="xEMACS.HTM#IDX1174">expand-abbrev</A>
  15140. <LI><A HREF="xEMACS.HTM#IDX1178">expand-region-abbrevs</A>
  15141. </DIR>
  15142. <H2>f</H2>
  15143. <DIR>
  15144. <LI><A HREF="xEMACS.HTM#IDX929">fill-individual-paragraphs</A>
  15145. <LI><A HREF="xEMACS.HTM#IDX913">fill-paragraph</A>
  15146. <LI><A HREF="xEMACS.HTM#IDX915">fill-region</A>
  15147. <LI><A HREF="xEMACS.HTM#IDX916">fill-region-as-paragraph</A>
  15148. <LI><A HREF="xEMACS.HTM#IDX558">find-alternate-file</A>
  15149. <LI><A HREF="xEMACS.HTM#IDX549">find-file</A>
  15150. <LI><A HREF="xEMACS.HTM#IDX563">find-file-other-screen</A>
  15151. <LI><A HREF="xEMACS.HTM#IDX729">find-file-other-window</A>
  15152. <LI><A HREF="xEMACS.HTM#IDX1055">find-tag</A>
  15153. <LI><A HREF="xEMACS.HTM#IDX1063">find-tag-other-window</A>
  15154. <LI><A HREF="xEMACS.HTM#IDX1612">find-this-file</A>
  15155. <LI><A HREF="xEMACS.HTM#IDX1613">find-this-file-other-window</A>
  15156. <LI><A HREF="xEMACS.HTM#IDX1105">fortran-column-ruler</A>
  15157. <LI><A HREF="xEMACS.HTM#IDX1102">fortran-comment-region</A>
  15158. <LI><A HREF="xEMACS.HTM#IDX1083">fortran-indent-line</A>
  15159. <LI><A HREF="xEMACS.HTM#IDX1085">fortran-indent-subprogram</A>
  15160. <LI><A HREF="xEMACS.HTM#IDX1072">fortran-mode</A>
  15161. <LI><A HREF="xEMACS.HTM#IDX1082">fortran-next-statement</A>
  15162. <LI><A HREF="xEMACS.HTM#IDX1081">fortran-previous-statement</A>
  15163. <LI><A HREF="xEMACS.HTM#IDX1087">fortran-split-line</A>
  15164. <LI><A HREF="xEMACS.HTM#IDX1107">fortran-window-create</A>
  15165. <LI><A HREF="xEMACS.HTM#IDX168">forward-char</A>
  15166. <LI><A HREF="xEMACS.HTM#IDX969">forward-list</A>
  15167. <LI><A HREF="xEMACS.HTM#IDX902">forward-page</A>
  15168. <LI><A HREF="xEMACS.HTM#IDX893">forward-paragraph</A>
  15169. <LI><A HREF="xEMACS.HTM#IDX883">forward-sentence</A>
  15170. <LI><A HREF="xEMACS.HTM#IDX963">forward-sexp</A>
  15171. <LI><A HREF="xEMACS.HTM#IDX789">forward-text-line</A>
  15172. <LI><A HREF="xEMACS.HTM#IDX867">forward-word</A>
  15173. </DIR>
  15174. <H2>g</H2>
  15175. <DIR>
  15176. <LI><A HREF="xEMACS.HTM#IDX1550">global-set-key</A>
  15177. <LI><A HREF="xEMACS.HTM#IDX176">goto-char</A>
  15178. <LI><A HREF="xEMACS.HTM#IDX177">goto-line</A>
  15179. </DIR>
  15180. <H2>h</H2>
  15181. <DIR>
  15182. <LI><A HREF="xEMACS.HTM#IDX1471">hanoi</A>
  15183. <LI><A HREF="xEMACS.HTM#IDX267">help-with-tutorial</A>
  15184. <LI><A HREF="xEMACS.HTM#IDX860">hide-body</A>
  15185. <LI><A HREF="xEMACS.HTM#IDX849">hide-entry</A>
  15186. <LI><A HREF="xEMACS.HTM#IDX856">hide-leaves</A>
  15187. <LI><A HREF="xEMACS.HTM#IDX851">hide-subtree</A>
  15188. </DIR>
  15189. <H2>i</H2>
  15190. <DIR>
  15191. <LI><A HREF="xEMACS.HTM#IDX997">indent-c-exp</A>
  15192. <LI><A HREF="xEMACS.HTM#IDX1019">indent-for-comment</A>
  15193. <LI><A HREF="xEMACS.HTM#IDX1025">indent-new-comment-line</A>
  15194. <LI><A HREF="xEMACS.HTM#IDX1000">indent-region</A>
  15195. <LI><A HREF="xEMACS.HTM#IDX769">indent-relative</A>
  15196. <LI><A HREF="xEMACS.HTM#IDX768">indent-rigidly</A>
  15197. <LI><A HREF="xEMACS.HTM#IDX996">indent-sexp</A>
  15198. <LI><A HREF="xEMACS.HTM#IDX785">indented-text-mode</A>
  15199. <LI><A HREF="xEMACS.HTM#IDX257">info</A>
  15200. <LI><A HREF="xEMACS.HTM#IDX1188">insert-abbrevs</A>
  15201. <LI><A HREF="xEMACS.HTM#IDX682">insert-file</A>
  15202. <LI><A HREF="xEMACS.HTM#IDX1520">insert-kbd-macro</A>
  15203. <LI><A HREF="xEMACS.HTM#IDX1036">insert-parentheses</A>
  15204. <LI><A HREF="xEMACS.HTM#IDX406">insert-register</A>
  15205. <LI><A HREF="xEMACS.HTM#IDX237">interactive</A>
  15206. <LI><A HREF="xEMACS.HTM#IDX1423">interrupt-shell-subjob</A>
  15207. <LI><A HREF="xEMACS.HTM#IDX1169">inverse-add-global-abbrev</A>
  15208. <LI><A HREF="xEMACS.HTM#IDX1171">inverse-add-mode-abbrev</A>
  15209. <LI><A HREF="xEMACS.HTM#IDX1614">invert-face</A>
  15210. <LI><A HREF="xEMACS.HTM#IDX445">isearch-abort</A>
  15211. <LI><A HREF="xEMACS.HTM#IDX436">isearch-backward</A>
  15212. <LI><A HREF="xEMACS.HTM#IDX472">isearch-backward-regexp</A>
  15213. <LI><A HREF="xEMACS.HTM#IDX448">isearch-complete</A>
  15214. <LI><A HREF="xEMACS.HTM#IDX438">isearch-delete-char</A>
  15215. <LI><A HREF="xEMACS.HTM#IDX439">isearch-exit</A>
  15216. <LI><A HREF="xEMACS.HTM#IDX435">isearch-forward</A>
  15217. <LI><A HREF="xEMACS.HTM#IDX471">isearch-forward-regexp</A>
  15218. <LI><A HREF="xEMACS.HTM#IDX440">isearch-quote-char</A>
  15219. <LI><A HREF="xEMACS.HTM#IDX442">isearch-repeat-backward</A>
  15220. <LI><A HREF="xEMACS.HTM#IDX441">isearch-repeat-forward</A>
  15221. <LI><A HREF="xEMACS.HTM#IDX447">isearch-ring-advance</A>
  15222. <LI><A HREF="xEMACS.HTM#IDX446">isearch-ring-retreat</A>
  15223. <LI><A HREF="xEMACS.HTM#IDX443">isearch-yank-line</A>
  15224. <LI><A HREF="xEMACS.HTM#IDX444">isearch-yank-word</A>
  15225. </DIR>
  15226. <H2>j</H2>
  15227. <DIR>
  15228. <LI><A HREF="xEMACS.HTM#IDX719">jump-to-register</A>
  15229. <LI><A HREF="xEMACS.HTM#IDX333">just-one-space</A>
  15230. </DIR>
  15231. <H2>k</H2>
  15232. <DIR>
  15233. <LI><A HREF="xEMACS.HTM#IDX1522">kbd-macro-query</A>
  15234. <LI><A HREF="xEMACS.HTM#IDX1172">kill-all-abbrevs</A>
  15235. <LI><A HREF="xEMACS.HTM#IDX707">kill-buffer</A>
  15236. <LI><A HREF="xEMACS.HTM#IDX1021">kill-comment</A>
  15237. <LI><A HREF="xEMACS.HTM#IDX1115">kill-compilation</A>
  15238. <LI><A HREF="xEMACS.HTM#IDX339">kill-line</A>
  15239. <LI><A HREF="xEMACS.HTM#IDX1507">kill-local-variable</A>
  15240. <LI><A HREF="xEMACS.HTM#IDX1426">kill-output-from-shell</A>
  15241. <LI><A HREF="xEMACS.HTM#IDX393">kill-rectangle</A>
  15242. <LI><A HREF="xEMACS.HTM#IDX340">kill-region</A>
  15243. <LI><A HREF="xEMACS.HTM#IDX886">kill-sentence</A>
  15244. <LI><A HREF="xEMACS.HTM#IDX966">kill-sexp</A>
  15245. <LI><A HREF="xEMACS.HTM#IDX708">kill-some-buffers</A>
  15246. <LI><A HREF="xEMACS.HTM#IDX870">kill-word</A>
  15247. </DIR>
  15248. <H2>l</H2>
  15249. <DIR>
  15250. <LI><A HREF="xEMACS.HTM#IDX802">LaTeX-mode</A>
  15251. <LI><A HREF="xEMACS.HTM#IDX804">latex-mode</A>
  15252. <LI><A HREF="xEMACS.HTM#IDX1040">lisp-complete-symbol</A>
  15253. <LI><A HREF="xEMACS.HTM#IDX992">lisp-indent-line</A>
  15254. <LI><A HREF="xEMACS.HTM#IDX1155">lisp-interaction-mode</A>
  15255. <LI><A HREF="xEMACS.HTM#IDX1157">lisp-mode</A>
  15256. <LI><A HREF="xEMACS.HTM#IDX1159">lisp-send-defun</A>
  15257. <LI><A HREF="xEMACS.HTM#IDX1179">list-abbrevs</A>
  15258. <LI><A HREF="xEMACS.HTM#IDX700">list-buffers</A>
  15259. <LI><A HREF="xEMACS.HTM#IDX227">list-command-history</A>
  15260. <LI><A HREF="xEMACS.HTM#IDX657">list-directory</A>
  15261. <LI><A HREF="xEMACS.HTM#IDX497">list-matching-lines</A>
  15262. <LI><A HREF="xEMACS.HTM#IDX1501">list-options</A>
  15263. <LI><A HREF="xEMACS.HTM#IDX1069">list-tags</A>
  15264. <LI><A HREF="xEMACS.HTM#IDX1121">load</A>
  15265. <LI><A HREF="xEMACS.HTM#IDX1625">load-default-sounds</A>
  15266. <LI><A HREF="xEMACS.HTM#IDX1120">load-file</A>
  15267. <LI><A HREF="xEMACS.HTM#IDX1122">load-library</A>
  15268. <LI><A HREF="xEMACS.HTM#IDX1626">load-sound-file</A>
  15269. <LI><A HREF="xEMACS.HTM#IDX1545">local-set-key</A>
  15270. <LI><A HREF="xEMACS.HTM#IDX1546">local-unset-key</A>
  15271. <LI><A HREF="xEMACS.HTM#IDX1628">locate-library</A>
  15272. <LI><A HREF="xEMACS.HTM#IDX1443">lpr-buffer</A>
  15273. <LI><A HREF="xEMACS.HTM#IDX1444">lpr-region</A>
  15274. </DIR>
  15275. <H2>m</H2>
  15276. <DIR>
  15277. <LI><A HREF="xEMACS.HTM#IDX1244">mail</A>
  15278. <LI><A HREF="xEMACS.HTM#IDX1264">mail-cc</A>
  15279. <LI><A HREF="xEMACS.HTM#IDX1270">mail-fill-yanked-message</A>
  15280. <LI><A HREF="xEMACS.HTM#IDX1252">mail-interactive-insert-alias</A>
  15281. <LI><A HREF="xEMACS.HTM#IDX1246">mail-other-window</A>
  15282. <LI><A HREF="xEMACS.HTM#IDX1257">mail-send</A>
  15283. <LI><A HREF="xEMACS.HTM#IDX1258">mail-send-and-exit</A>
  15284. <LI><A HREF="xEMACS.HTM#IDX1266">mail-signature</A>
  15285. <LI><A HREF="xEMACS.HTM#IDX1262">mail-subject</A>
  15286. <LI><A HREF="xEMACS.HTM#IDX1260">mail-to</A>
  15287. <LI><A HREF="xEMACS.HTM#IDX1367">mail-yank-original</A>
  15288. <LI><A HREF="xEMACS.HTM#IDX1629">make-directory</A>
  15289. <LI><A HREF="xEMACS.HTM#IDX1615">make-face-bold</A>
  15290. <LI><A HREF="xEMACS.HTM#IDX1616">make-face-bold-italic</A>
  15291. <LI><A HREF="xEMACS.HTM#IDX1617">make-face-italic</A>
  15292. <LI><A HREF="xEMACS.HTM#IDX1580">make-face-larger</A>
  15293. <LI><A HREF="xEMACS.HTM#IDX1581">make-face-smaller</A>
  15294. <LI><A HREF="xEMACS.HTM#IDX1618">make-face-unbold</A>
  15295. <LI><A HREF="xEMACS.HTM#IDX1619">make-face-unitalic</A>
  15296. <LI><A HREF="xEMACS.HTM#IDX1504">make-local-variable</A>
  15297. <LI><A HREF="xEMACS.HTM#IDX1129">make-obsolete</A>
  15298. <LI><A HREF="xEMACS.HTM#IDX1657">make-screen</A>
  15299. <LI><A HREF="xEMACS.HTM#IDX683">make-symbolic-link</A>
  15300. <LI><A HREF="xEMACS.HTM#IDX1505">make-variable-buffer-local</A>
  15301. <LI><A HREF="xEMACS.HTM#IDX1045">manual-entry</A>
  15302. <LI><A HREF="xEMACS.HTM#IDX1631">mark-beginning-of-buffer</A>
  15303. <LI><A HREF="xEMACS.HTM#IDX986">mark-defun</A>
  15304. <LI><A HREF="xEMACS.HTM#IDX1632">mark-end-of-buffer</A>
  15305. <LI><A HREF="xEMACS.HTM#IDX1080">mark-fortran-subprogram</A>
  15306. <LI><A HREF="xEMACS.HTM#IDX905">mark-page</A>
  15307. <LI><A HREF="xEMACS.HTM#IDX895">mark-paragraph</A>
  15308. <LI><A HREF="xEMACS.HTM#IDX979">mark-sexp</A>
  15309. <LI><A HREF="xEMACS.HTM#IDX295">mark-whole-buffer</A>
  15310. <LI><A HREF="xEMACS.HTM#IDX877">mark-word</A>
  15311. <LI><A HREF="xEMACS.HTM#IDX219">minibuffer-complete</A>
  15312. <LI><A HREF="xEMACS.HTM#IDX221">minibuffer-complete-word</A>
  15313. <LI><A HREF="xEMACS.HTM#IDX1557">modify-syntax-entry</A>
  15314. <LI><A HREF="xEMACS.HTM#IDX1633">mouse-del-char</A>
  15315. <LI><A HREF="xEMACS.HTM#IDX1634">mouse-delete-window</A>
  15316. <LI><A HREF="xEMACS.HTM#IDX1635">mouse-keep-one-window</A>
  15317. <LI><A HREF="xEMACS.HTM#IDX1636">mouse-kill-line</A>
  15318. <LI><A HREF="xEMACS.HTM#IDX1637">mouse-line-length</A>
  15319. <LI><A HREF="xEMACS.HTM#IDX1638">mouse-scroll</A>
  15320. <LI><A HREF="xEMACS.HTM#IDX1639">mouse-select</A>
  15321. <LI><A HREF="xEMACS.HTM#IDX1640">mouse-select-and-split</A>
  15322. <LI><A HREF="xEMACS.HTM#IDX1641">mouse-set-mark</A>
  15323. <LI><A HREF="xEMACS.HTM#IDX1642">mouse-set-point</A>
  15324. <LI><A HREF="xEMACS.HTM#IDX1643">mouse-track</A>
  15325. <LI><A HREF="xEMACS.HTM#IDX1644">mouse-track-adjust</A>
  15326. <LI><A HREF="xEMACS.HTM#IDX1645">mouse-track-and-copy-to-cutbuffer</A>
  15327. <LI><A HREF="xEMACS.HTM#IDX1646">mouse-track-delete-and-insert</A>
  15328. <LI><A HREF="xEMACS.HTM#IDX1647">mouse-track-insert</A>
  15329. <LI><A HREF="xEMACS.HTM#IDX1648">mouse-window-to-region</A>
  15330. <LI><A HREF="xEMACS.HTM#IDX1037">move-over-close-and-reindent</A>
  15331. <LI><A HREF="xEMACS.HTM#IDX178">move-to-window-line</A>
  15332. </DIR>
  15333. <H2>n</H2>
  15334. <DIR>
  15335. <LI><A HREF="xEMACS.HTM#IDX1519">name-last-kbd-macro</A>
  15336. <LI><A HREF="xEMACS.HTM#IDX1437">narrow-to-region</A>
  15337. <LI><A HREF="xEMACS.HTM#IDX202">negative-argument</A>
  15338. <LI><A HREF="xEMACS.HTM#IDX150">newline</A>
  15339. <LI><A HREF="xEMACS.HTM#IDX994">newline-and-indent</A>
  15340. <LI><A HREF="xEMACS.HTM#IDX232">next-complex-command</A>
  15341. <LI><A HREF="xEMACS.HTM#IDX1117">next-error</A>
  15342. <LI><A HREF="xEMACS.HTM#IDX1068">next-file</A>
  15343. <LI><A HREF="xEMACS.HTM#IDX170">next-line</A>
  15344. <LI><A HREF="xEMACS.HTM#IDX572">not-modified</A>
  15345. <LI><A HREF="xEMACS.HTM#IDX788">nroff-mode</A>
  15346. </DIR>
  15347. <H2>o</H2>
  15348. <DIR>
  15349. <LI><A HREF="xEMACS.HTM#IDX498">occur</A>
  15350. <LI><A HREF="xEMACS.HTM#IDX1604">open-dribble-file</A>
  15351. <LI><A HREF="xEMACS.HTM#IDX185">open-line</A>
  15352. <LI><A HREF="xEMACS.HTM#IDX395">open-rectangle</A>
  15353. <LI><A HREF="xEMACS.HTM#IDX1606">open-termscript</A>
  15354. <LI><A HREF="xEMACS.HTM#IDX722">other-window</A>
  15355. <LI><A HREF="xEMACS.HTM#IDX723">other-window-any-screen</A>
  15356. <LI><A HREF="xEMACS.HTM#IDX845">outline-backward-same-level</A>
  15357. <LI><A HREF="xEMACS.HTM#IDX844">outline-forward-same-level</A>
  15358. <LI><A HREF="xEMACS.HTM#IDX839">outline-next-visible-heading</A>
  15359. <LI><A HREF="xEMACS.HTM#IDX840">outline-previous-visible-heading</A>
  15360. <LI><A HREF="xEMACS.HTM#IDX843">outline-up-heading</A>
  15361. <LI><A HREF="xEMACS.HTM#IDX1490">overwrite-mode</A>
  15362. </DIR>
  15363. <H2>p</H2>
  15364. <DIR>
  15365. <LI><A HREF="xEMACS.HTM#IDX1200">picture-backward-clear-column</A>
  15366. <LI><A HREF="xEMACS.HTM#IDX1196">picture-backward-column</A>
  15367. <LI><A HREF="xEMACS.HTM#IDX1201">picture-clear-column</A>
  15368. <LI><A HREF="xEMACS.HTM#IDX1202">picture-clear-line</A>
  15369. <LI><A HREF="xEMACS.HTM#IDX1235">picture-clear-rectangle</A>
  15370. <LI><A HREF="xEMACS.HTM#IDX1236">picture-clear-rectangle-to-register</A>
  15371. <LI><A HREF="xEMACS.HTM#IDX1195">picture-forward-column</A>
  15372. <LI><A HREF="xEMACS.HTM#IDX1224">picture-motion</A>
  15373. <LI><A HREF="xEMACS.HTM#IDX1225">picture-motion-reverse</A>
  15374. <LI><A HREF="xEMACS.HTM#IDX1197">picture-move-down</A>
  15375. <LI><A HREF="xEMACS.HTM#IDX1198">picture-move-up</A>
  15376. <LI><A HREF="xEMACS.HTM#IDX1207">picture-movement-down</A>
  15377. <LI><A HREF="xEMACS.HTM#IDX1208">picture-movement-left</A>
  15378. <LI><A HREF="xEMACS.HTM#IDX1211">picture-movement-ne</A>
  15379. <LI><A HREF="xEMACS.HTM#IDX1210">picture-movement-nw</A>
  15380. <LI><A HREF="xEMACS.HTM#IDX1209">picture-movement-right</A>
  15381. <LI><A HREF="xEMACS.HTM#IDX1213">picture-movement-se</A>
  15382. <LI><A HREF="xEMACS.HTM#IDX1212">picture-movement-sw</A>
  15383. <LI><A HREF="xEMACS.HTM#IDX1206">picture-movement-up</A>
  15384. <LI><A HREF="xEMACS.HTM#IDX1199">picture-newline</A>
  15385. <LI><A HREF="xEMACS.HTM#IDX1203">picture-open-line</A>
  15386. <LI><A HREF="xEMACS.HTM#IDX1231">picture-set-tab-stops</A>
  15387. <LI><A HREF="xEMACS.HTM#IDX1229">picture-tab</A>
  15388. <LI><A HREF="xEMACS.HTM#IDX1227">picture-tab-search</A>
  15389. <LI><A HREF="xEMACS.HTM#IDX1239">picture-yank-rectangle</A>
  15390. <LI><A HREF="xEMACS.HTM#IDX1240">picture-yank-rectangle-from-register</A>
  15391. <LI><A HREF="xEMACS.HTM#IDX803">plain-TeX-mode</A>
  15392. <LI><A HREF="xEMACS.HTM#IDX801">plain-tex-mode</A>
  15393. <LI><A HREF="xEMACS.HTM#IDX1627">play-sound</A>
  15394. <LI><A HREF="xEMACS.HTM#IDX400">point-to-register</A>
  15395. <LI><A HREF="xEMACS.HTM#IDX386">prepend-to-buffer</A>
  15396. <LI><A HREF="xEMACS.HTM#IDX233">previous-complex-command</A>
  15397. <LI><A HREF="xEMACS.HTM#IDX171">previous-line</A>
  15398. <LI><A HREF="xEMACS.HTM#IDX1441">print-buffer</A>
  15399. <LI><A HREF="xEMACS.HTM#IDX1442">print-region</A>
  15400. </DIR>
  15401. <H2>q</H2>
  15402. <DIR>
  15403. <LI><A HREF="xEMACS.HTM#IDX485">query-replace</A>
  15404. <LI><A HREF="xEMACS.HTM#IDX486">query-replace-regexp</A>
  15405. <LI><A HREF="xEMACS.HTM#IDX1185">quietly-read-abbrev-file</A>
  15406. <LI><A HREF="xEMACS.HTM#IDX1425">quit-shell-subjob</A>
  15407. <LI><A HREF="xEMACS.HTM#IDX154">quoted-insert</A>
  15408. </DIR>
  15409. <H2>r</H2>
  15410. <DIR>
  15411. <LI><A HREF="xEMACS.HTM#IDX474">re-search-backward</A>
  15412. <LI><A HREF="xEMACS.HTM#IDX473">re-search-forward</A>
  15413. <LI><A HREF="xEMACS.HTM#IDX1184">read-abbrev-file</A>
  15414. <LI><A HREF="xEMACS.HTM#IDX44">read-key-sequence</A>
  15415. <LI><A HREF="xEMACS.HTM#IDX411">recenter</A>
  15416. <LI><A HREF="xEMACS.HTM#IDX604">recover-file</A>
  15417. <LI><A HREF="xEMACS.HTM#IDX402">register-to-point</A>
  15418. <LI><A HREF="xEMACS.HTM#IDX1656">relabel-menu-item</A>
  15419. <LI><A HREF="xEMACS.HTM#IDX1630">remove-directory</A>
  15420. <LI><A HREF="xEMACS.HTM#IDX705">rename-buffer</A>
  15421. <LI><A HREF="xEMACS.HTM#IDX684">rename-file</A>
  15422. <LI><A HREF="xEMACS.HTM#IDX229">repeat-complex-command</A>
  15423. <LI><A HREF="xEMACS.HTM#IDX480">replace-regexp</A>
  15424. <LI><A HREF="xEMACS.HTM#IDX479">replace-string</A>
  15425. <LI><A HREF="xEMACS.HTM#IDX593">revert-buffer</A>
  15426. <LI><A HREF="xEMACS.HTM#IDX1274">rmail</A>
  15427. <LI><A HREF="xEMACS.HTM#IDX1324">rmail-add-label</A>
  15428. <LI><A HREF="xEMACS.HTM#IDX1284">rmail-beginning-of-message</A>
  15429. <LI><A HREF="xEMACS.HTM#IDX1374">rmail-continue</A>
  15430. <LI><A HREF="xEMACS.HTM#IDX1304">rmail-delete-backward</A>
  15431. <LI><A HREF="xEMACS.HTM#IDX1303">rmail-delete-forward</A>
  15432. <LI><A HREF="xEMACS.HTM#IDX1379">rmail-edit-current-message</A>
  15433. <LI><A HREF="xEMACS.HTM#IDX1307">rmail-expunge</A>
  15434. <LI><A HREF="xEMACS.HTM#IDX1369">rmail-forward</A>
  15435. <LI><A HREF="xEMACS.HTM#IDX1315">rmail-get-new-mail</A>
  15436. <LI><A HREF="xEMACS.HTM#IDX1312">rmail-input</A>
  15437. <LI><A HREF="xEMACS.HTM#IDX1325">rmail-kill-label</A>
  15438. <LI><A HREF="xEMACS.HTM#IDX1298">rmail-last-message</A>
  15439. <LI><A HREF="xEMACS.HTM#IDX1372">rmail-mail</A>
  15440. <LI><A HREF="xEMACS.HTM#IDX1328">rmail-next-labeled-message</A>
  15441. <LI><A HREF="xEMACS.HTM#IDX1291">rmail-next-message</A>
  15442. <LI><A HREF="xEMACS.HTM#IDX1289">rmail-next-undeleted-message</A>
  15443. <LI><A HREF="xEMACS.HTM#IDX1319">rmail-output</A>
  15444. <LI><A HREF="xEMACS.HTM#IDX1317">rmail-output-to-rmail-file</A>
  15445. <LI><A HREF="xEMACS.HTM#IDX1329">rmail-previous-labeled-message</A>
  15446. <LI><A HREF="xEMACS.HTM#IDX1292">rmail-previous-message</A>
  15447. <LI><A HREF="xEMACS.HTM#IDX1290">rmail-previous-undeleted-message</A>
  15448. <LI><A HREF="xEMACS.HTM#IDX1280">rmail-quit</A>
  15449. <LI><A HREF="xEMACS.HTM#IDX1363">rmail-reply</A>
  15450. <LI><A HREF="xEMACS.HTM#IDX1278">rmail-save</A>
  15451. <LI><A HREF="xEMACS.HTM#IDX1294">rmail-search</A>
  15452. <LI><A HREF="xEMACS.HTM#IDX1297">rmail-show-message</A>
  15453. <LI><A HREF="xEMACS.HTM#IDX1334">rmail-summary</A>
  15454. <LI><A HREF="xEMACS.HTM#IDX1337">rmail-summary-by-labels</A>
  15455. <LI><A HREF="xEMACS.HTM#IDX1339">rmail-summary-by-recipients</A>
  15456. <LI><A HREF="xEMACS.HTM#IDX1352">rmail-summary-delete-forward</A>
  15457. <LI><A HREF="xEMACS.HTM#IDX1359">rmail-summary-exit</A>
  15458. <LI><A HREF="xEMACS.HTM#IDX1349">rmail-summary-goto-msg</A>
  15459. <LI><A HREF="xEMACS.HTM#IDX1342">rmail-summary-next-all</A>
  15460. <LI><A HREF="xEMACS.HTM#IDX1346">rmail-summary-next-msg</A>
  15461. <LI><A HREF="xEMACS.HTM#IDX1343">rmail-summary-previous-all</A>
  15462. <LI><A HREF="xEMACS.HTM#IDX1347">rmail-summary-previous-msg</A>
  15463. <LI><A HREF="xEMACS.HTM#IDX1361">rmail-summary-quit</A>
  15464. <LI><A HREF="xEMACS.HTM#IDX1356">rmail-summary-scroll-msg-down</A>
  15465. <LI><A HREF="xEMACS.HTM#IDX1357">rmail-summary-scroll-msg-up</A>
  15466. <LI><A HREF="xEMACS.HTM#IDX1353">rmail-summary-undelete</A>
  15467. <LI><A HREF="xEMACS.HTM#IDX1376">rmail-toggle-header</A>
  15468. <LI><A HREF="xEMACS.HTM#IDX1309">rmail-undelete-previous-message</A>
  15469. <LI><A HREF="xEMACS.HTM#IDX1156">run-lisp</A>
  15470. </DIR>
  15471. <H2>s</H2>
  15472. <DIR>
  15473. <LI><A HREF="xEMACS.HTM#IDX568">save-buffer</A>
  15474. <LI><A HREF="xEMACS.HTM#IDX132">save-buffers-kill-emacs</A>
  15475. <LI><A HREF="xEMACS.HTM#IDX570">save-some-buffers</A>
  15476. <LI><A HREF="xEMACS.HTM#IDX415">scroll-down</A>
  15477. <LI><A HREF="xEMACS.HTM#IDX420">scroll-left</A>
  15478. <LI><A HREF="xEMACS.HTM#IDX725">scroll-other-window</A>
  15479. <LI><A HREF="xEMACS.HTM#IDX421">scroll-right</A>
  15480. <LI><A HREF="xEMACS.HTM#IDX414">scroll-up</A>
  15481. <LI><A HREF="xEMACS.HTM#IDX464">search-backward</A>
  15482. <LI><A HREF="xEMACS.HTM#IDX463">search-forward</A>
  15483. <LI><A HREF="xEMACS.HTM#IDX151">self-insert</A>
  15484. <LI><A HREF="xEMACS.HTM#IDX1420">send-shell-input</A>
  15485. <LI><A HREF="xEMACS.HTM#IDX1028">set-comment-column</A>
  15486. <LI><A HREF="xEMACS.HTM#IDX591">set-default-file-modes</A>
  15487. <LI><A HREF="xEMACS.HTM#IDX1620">set-face-background</A>
  15488. <LI><A HREF="xEMACS.HTM#IDX1621">set-face-background-pixmap</A>
  15489. <LI><A HREF="xEMACS.HTM#IDX1622">set-face-font</A>
  15490. <LI><A HREF="xEMACS.HTM#IDX1623">set-face-foreground</A>
  15491. <LI><A HREF="xEMACS.HTM#IDX1624">set-face-underline-p</A>
  15492. <LI><A HREF="xEMACS.HTM#IDX924">set-fill-column</A>
  15493. <LI><A HREF="xEMACS.HTM#IDX927">set-fill-prefix</A>
  15494. <LI><A HREF="xEMACS.HTM#IDX1479">set-gnu-bindings</A>
  15495. <LI><A HREF="xEMACS.HTM#IDX179">set-goal-column</A>
  15496. <LI><A HREF="xEMACS.HTM#IDX1478">set-gosmacs-bindings</A>
  15497. <LI><A HREF="xEMACS.HTM#IDX277">set-mark-command</A>
  15498. <LI><A HREF="xEMACS.HTM#IDX1313">set-rmail-inbox-list</A>
  15499. <LI><A HREF="xEMACS.HTM#IDX423">set-selective-display</A>
  15500. <LI><A HREF="xEMACS.HTM#IDX1500">set-variable</A>
  15501. <LI><A HREF="xEMACS.HTM#IDX573">set-visited-file-name</A>
  15502. <LI><A HREF="xEMACS.HTM#IDX1508">setq-default</A>
  15503. <LI><A HREF="xEMACS.HTM#IDX1399">shell</A>
  15504. <LI><A HREF="xEMACS.HTM#IDX1394">shell-command</A>
  15505. <LI><A HREF="xEMACS.HTM#IDX1396">shell-command-on-region</A>
  15506. <LI><A HREF="xEMACS.HTM#IDX1421">shell-send-eof</A>
  15507. <LI><A HREF="xEMACS.HTM#IDX861">show-all</A>
  15508. <LI><A HREF="xEMACS.HTM#IDX857">show-branches</A>
  15509. <LI><A HREF="xEMACS.HTM#IDX859">show-children</A>
  15510. <LI><A HREF="xEMACS.HTM#IDX850">show-entry</A>
  15511. <LI><A HREF="xEMACS.HTM#IDX1427">show-output-from-shell</A>
  15512. <LI><A HREF="xEMACS.HTM#IDX852">show-subtree</A>
  15513. <LI><A HREF="xEMACS.HTM#IDX1390">sort-columns</A>
  15514. <LI><A HREF="xEMACS.HTM#IDX1388">sort-fields</A>
  15515. <LI><A HREF="xEMACS.HTM#IDX1385">sort-lines</A>
  15516. <LI><A HREF="xEMACS.HTM#IDX1389">sort-numeric-fields</A>
  15517. <LI><A HREF="xEMACS.HTM#IDX1387">sort-pages</A>
  15518. <LI><A HREF="xEMACS.HTM#IDX1386">sort-paragraphs</A>
  15519. <LI><A HREF="xEMACS.HTM#IDX531">spell-buffer</A>
  15520. <LI><A HREF="xEMACS.HTM#IDX532">spell-region</A>
  15521. <LI><A HREF="xEMACS.HTM#IDX533">spell-string</A>
  15522. <LI><A HREF="xEMACS.HTM#IDX530">spell-word</A>
  15523. <LI><A HREF="xEMACS.HTM#IDX760">split-line</A>
  15524. <LI><A HREF="xEMACS.HTM#IDX717">split-window-horizontally</A>
  15525. <LI><A HREF="xEMACS.HTM#IDX715">split-window-vertically</A>
  15526. <LI><A HREF="xEMACS.HTM#IDX1516">start-kbd-macro</A>
  15527. <LI><A HREF="xEMACS.HTM#IDX1424">stop-shell-subjob</A>
  15528. <LI><A HREF="xEMACS.HTM#IDX1548">substitute-key-definition</A>
  15529. <LI><A HREF="xEMACS.HTM#IDX130">suspend-emacs</A>
  15530. <LI><A HREF="xEMACS.HTM#IDX696">switch-to-buffer</A>
  15531. <LI><A HREF="xEMACS.HTM#IDX697">switch-to-buffer-other-screen</A>
  15532. <LI><A HREF="xEMACS.HTM#IDX728">switch-to-buffer-other-window</A>
  15533. <LI><A HREF="xEMACS.HTM#IDX698">switch-to-other-buffer</A>
  15534. </DIR>
  15535. <H2>t</H2>
  15536. <DIR>
  15537. <LI><A HREF="xEMACS.HTM#IDX780">tab-to-tab-stop</A>
  15538. <LI><A HREF="xEMACS.HTM#IDX777">tabify</A>
  15539. <LI><A HREF="xEMACS.HTM#IDX1070">tags-apropos</A>
  15540. <LI><A HREF="xEMACS.HTM#IDX1066">tags-loop-continue</A>
  15541. <LI><A HREF="xEMACS.HTM#IDX1067">tags-query-replace</A>
  15542. <LI><A HREF="xEMACS.HTM#IDX1064">tags-search</A>
  15543. <LI><A HREF="xEMACS.HTM#IDX816">tex-buffer</A>
  15544. <LI><A HREF="xEMACS.HTM#IDX814">tex-close-latex-block</A>
  15545. <LI><A HREF="xEMACS.HTM#IDX807">tex-insert-braces</A>
  15546. <LI><A HREF="xEMACS.HTM#IDX805">tex-insert-quote</A>
  15547. <LI><A HREF="xEMACS.HTM#IDX822">tex-kill-job</A>
  15548. <LI><A HREF="xEMACS.HTM#IDX799">TeX-mode</A>
  15549. <LI><A HREF="xEMACS.HTM#IDX800">tex-mode</A>
  15550. <LI><A HREF="xEMACS.HTM#IDX818">tex-print</A>
  15551. <LI><A HREF="xEMACS.HTM#IDX824">tex-recenter-output-buffer</A>
  15552. <LI><A HREF="xEMACS.HTM#IDX826">tex-region</A>
  15553. <LI><A HREF="xEMACS.HTM#IDX820">tex-show-print-queue</A>
  15554. <LI><A HREF="xEMACS.HTM#IDX812">tex-terminate-paragraph</A>
  15555. <LI><A HREF="xEMACS.HTM#IDX784">text-mode</A>
  15556. <LI><A HREF="xEMACS.HTM#IDX703">toggle-read-only</A>
  15557. <LI><A HREF="xEMACS.HTM#IDX1598">top-level</A>
  15558. <LI><A HREF="xEMACS.HTM#IDX513">transpose-chars</A>
  15559. <LI><A HREF="xEMACS.HTM#IDX515">transpose-lines</A>
  15560. <LI><A HREF="xEMACS.HTM#IDX977">transpose-sexps</A>
  15561. <LI><A HREF="xEMACS.HTM#IDX875">transpose-words</A>
  15562. </DIR>
  15563. <H2>u</H2>
  15564. <DIR>
  15565. <LI><A HREF="xEMACS.HTM#IDX1383">undigestify-rmail-message</A>
  15566. <LI><A HREF="xEMACS.HTM#IDX209">undo</A>
  15567. <LI><A HREF="xEMACS.HTM#IDX1177">unexpand-abbrev</A>
  15568. <LI><A HREF="xEMACS.HTM#IDX204">universal-argument</A>
  15569. <LI><A HREF="xEMACS.HTM#IDX778">untabify</A>
  15570. <LI><A HREF="xEMACS.HTM#IDX809">up-list</A>
  15571. <LI><A HREF="xEMACS.HTM#IDX942">upcase-region</A>
  15572. <LI><A HREF="xEMACS.HTM#IDX936">upcase-word</A>
  15573. </DIR>
  15574. <H2>v</H2>
  15575. <DIR>
  15576. <LI><A HREF="xEMACS.HTM#IDX811">validate-tex-buffer</A>
  15577. <LI><A HREF="xEMACS.HTM#IDX621">vc-cancel-version</A>
  15578. <LI><A HREF="xEMACS.HTM#IDX646">vc-create-snapshot</A>
  15579. <LI><A HREF="xEMACS.HTM#IDX637">vc-diff</A>
  15580. <LI><A HREF="xEMACS.HTM#IDX642">vc-directory</A>
  15581. <LI><A HREF="xEMACS.HTM#IDX651">vc-insert-headers</A>
  15582. <LI><A HREF="xEMACS.HTM#IDX627">vc-next-action</A>
  15583. <LI><A HREF="xEMACS.HTM#IDX640">vc-print-log</A>
  15584. <LI><A HREF="xEMACS.HTM#IDX623">vc-register</A>
  15585. <LI><A HREF="xEMACS.HTM#IDX643">vc-rename-file</A>
  15586. <LI><A HREF="xEMACS.HTM#IDX648">vc-retrieve-snapshot</A>
  15587. <LI><A HREF="xEMACS.HTM#IDX619">vc-revert-buffer</A>
  15588. <LI><A HREF="xEMACS.HTM#IDX634">vc-update-change-log</A>
  15589. <LI><A HREF="xEMACS.HTM#IDX635">vc-version-other-window</A>
  15590. <LI><A HREF="xEMACS.HTM#IDX1481">vi-mode</A>
  15591. <LI><A HREF="xEMACS.HTM#IDX706">view-buffer</A>
  15592. <LI><A HREF="xEMACS.HTM#IDX265">view-emacs-news</A>
  15593. <LI><A HREF="xEMACS.HTM#IDX685">view-file</A>
  15594. <LI><A HREF="xEMACS.HTM#IDX259">view-lossage</A>
  15595. <LI><A HREF="xEMACS.HTM#IDX398">view-register</A>
  15596. <LI><A HREF="xEMACS.HTM#IDX1482">vip-mode</A>
  15597. <LI><A HREF="xEMACS.HTM#IDX1053">visit-tags-table</A>
  15598. </DIR>
  15599. <H2>w</H2>
  15600. <DIR>
  15601. <LI><A HREF="xEMACS.HTM#IDX197">what-cursor-position</A>
  15602. <LI><A HREF="xEMACS.HTM#IDX191">what-line</A>
  15603. <LI><A HREF="xEMACS.HTM#IDX190">what-page</A>
  15604. <LI><A HREF="xEMACS.HTM#IDX249">where-is</A>
  15605. <LI><A HREF="xEMACS.HTM#IDX1439">widen</A>
  15606. <LI><A HREF="xEMACS.HTM#IDX720">window-configuration-to-register</A>
  15607. <LI><A HREF="xEMACS.HTM#IDX467">word-search-backward</A>
  15608. <LI><A HREF="xEMACS.HTM#IDX466">word-search-forward</A>
  15609. <LI><A HREF="xEMACS.HTM#IDX1183">write-abbrev-file</A>
  15610. <LI><A HREF="xEMACS.HTM#IDX575">write-file</A>
  15611. </DIR>
  15612. <H2>x</H2>
  15613. <DIR>
  15614. <LI><A HREF="xEMACS.HTM#IDX372">x-copy-primary-selection</A>
  15615. <LI><A HREF="xEMACS.HTM#IDX1589">x-create-screen</A>
  15616. <LI><A HREF="xEMACS.HTM#IDX373">x-delete-primary-selection</A>
  15617. <LI><A HREF="xEMACS.HTM#IDX374">x-insert-selection</A>
  15618. <LI><A HREF="xEMACS.HTM#IDX375">x-kill-primary-selection</A>
  15619. <LI><A HREF="xEMACS.HTM#IDX376">x-mouse-kill</A>
  15620. <LI><A HREF="xEMACS.HTM#IDX377">x-own-secondary-selection</A>
  15621. <LI><A HREF="xEMACS.HTM#IDX378">x-own-selection</A>
  15622. <LI><A HREF="xEMACS.HTM#IDX379">x-set-point-and-insert-selection</A>
  15623. </DIR>
  15624. <H2>y</H2>
  15625. <DIR>
  15626. <LI><A HREF="xEMACS.HTM#IDX360">Yank</A>
  15627. <LI><A HREF="xEMACS.HTM#IDX367">yank-pop</A>
  15628. <LI><A HREF="xEMACS.HTM#IDX394">yank-rectangle</A>
  15629. <LI><A HREF="xEMACS.HTM#IDX1472">yow</A>
  15630. </DIR>
  15631. <H2>z</H2>
  15632. <DIR>
  15633. <LI><A HREF="xEMACS.HTM#IDX353">zap-to-char</A>
  15634. <LI><A HREF="xEMACS.HTM#IDX383">zmacs-activate-region</A>
  15635. <LI><A HREF="xEMACS.HTM#IDX384">zmacs-deactivate-region</A>
  15636. </DIR>
  15637. <H1><A NAME="SEC328" HREF="xEMACS_TO.HTM#SEC328">Variable Index</A></H1>
  15638. <H2>a</H2>
  15639. <DIR>
  15640. <LI><A HREF="xEMACS.HTM#IDX1173">abbrev-all-caps</A>
  15641. <LI><A HREF="xEMACS.HTM#IDX1186">abbrev-file-name</A>
  15642. <LI><A HREF="xEMACS.HTM#IDX1163">abbrev-mode</A>
  15643. <LI><A HREF="xEMACS.HTM#IDX1127">after-load-alist</A>
  15644. <LI><A HREF="xEMACS.HTM#IDX578">after-save-hook</A>
  15645. <LI><A HREF="xEMACS.HTM#IDX918">auto-fill-inhibit-regexp</A>
  15646. <LI><A HREF="xEMACS.HTM#IDX23">auto-lower-screen</A>
  15647. <LI><A HREF="xEMACS.HTM#IDX751">auto-mode-alist</A>
  15648. <LI><A HREF="xEMACS.HTM#IDX24">auto-raise-screen</A>
  15649. <LI><A HREF="xEMACS.HTM#IDX599">auto-save-default</A>
  15650. <LI><A HREF="xEMACS.HTM#IDX601">auto-save-interval</A>
  15651. <LI><A HREF="xEMACS.HTM#IDX603">auto-save-timeout</A>
  15652. <LI><A HREF="xEMACS.HTM#IDX597">auto-save-visited-file-name</A>
  15653. </DIR>
  15654. <H2>b</H2>
  15655. <DIR>
  15656. <LI><A HREF="xEMACS.HTM#IDX585">backup-by-copying</A>
  15657. <LI><A HREF="xEMACS.HTM#IDX586">backup-by-copying-when-linked</A>
  15658. <LI><A HREF="xEMACS.HTM#IDX587">backup-by-copying-when-mismatch</A>
  15659. <LI><A HREF="xEMACS.HTM#IDX1573">bell-volume</A>
  15660. <LI><A HREF="xEMACS.HTM#IDX1014">blink-matching-paren</A>
  15661. <LI><A HREF="xEMACS.HTM#IDX1015">blink-matching-paren-distance</A>
  15662. <LI><A HREF="xEMACS.HTM#IDX553">buffer-file-name</A>
  15663. <LI><A HREF="xEMACS.HTM#IDX555">buffer-file-truename</A>
  15664. <LI><A HREF="xEMACS.HTM#IDX704">buffer-read-only</A>
  15665. <LI><A HREF="xEMACS.HTM#IDX1059">buffer-tag-table</A>
  15666. </DIR>
  15667. <H2>c</H2>
  15668. <DIR>
  15669. <LI><A HREF="xEMACS.HTM#IDX1010">c-argdecl-indent</A>
  15670. <LI><A HREF="xEMACS.HTM#IDX1004">c-auto-newline</A>
  15671. <LI><A HREF="xEMACS.HTM#IDX1007">c-brace-imaginary-offset</A>
  15672. <LI><A HREF="xEMACS.HTM#IDX1009">c-brace-offset</A>
  15673. <LI><A HREF="xEMACS.HTM#IDX1008">c-continued-statement-offset</A>
  15674. <LI><A HREF="xEMACS.HTM#IDX1006">c-indent-level</A>
  15675. <LI><A HREF="xEMACS.HTM#IDX1011">c-label-offset</A>
  15676. <LI><A HREF="xEMACS.HTM#IDX951">c-mode-hook</A>
  15677. <LI><A HREF="xEMACS.HTM#IDX1530">c-mode-map</A>
  15678. <LI><A HREF="xEMACS.HTM#IDX1005">c-tab-always-indent</A>
  15679. <LI><A HREF="xEMACS.HTM#IDX482">case-fold-search</A>
  15680. <LI><A HREF="xEMACS.HTM#IDX481">case-replace</A>
  15681. <LI><A HREF="xEMACS.HTM#IDX234">command-history</A>
  15682. <LI><A HREF="xEMACS.HTM#IDX136">command-line-args</A>
  15683. <LI><A HREF="xEMACS.HTM#IDX1026">comment-column</A>
  15684. <LI><A HREF="xEMACS.HTM#IDX1031">comment-end</A>
  15685. <LI><A HREF="xEMACS.HTM#IDX1033">comment-indent-hook</A>
  15686. <LI><A HREF="xEMACS.HTM#IDX1099">comment-line-start</A>
  15687. <LI><A HREF="xEMACS.HTM#IDX1100">comment-line-start-skip</A>
  15688. <LI><A HREF="xEMACS.HTM#IDX1032">comment-multi-line</A>
  15689. <LI><A HREF="xEMACS.HTM#IDX1030">comment-start</A>
  15690. <LI><A HREF="xEMACS.HTM#IDX1029">comment-start-skip</A>
  15691. <LI><A HREF="xEMACS.HTM#IDX667">compare-ignore-case</A>
  15692. <LI><A HREF="xEMACS.HTM#IDX1113">compile-command</A>
  15693. <LI><A HREF="xEMACS.HTM#IDX223">completion-auto-help</A>
  15694. <LI><A HREF="xEMACS.HTM#IDX222">completion-ignored-extensions</A>
  15695. <LI><A HREF="xEMACS.HTM#IDX20">create-screen-hook</A>
  15696. <LI><A HREF="xEMACS.HTM#IDX429">ctl-arrow</A>
  15697. <LI><A HREF="xEMACS.HTM#IDX1539">ctl-x-map</A>
  15698. </DIR>
  15699. <H2>d</H2>
  15700. <DIR>
  15701. <LI><A HREF="xEMACS.HTM#IDX1149">debug-on-error</A>
  15702. <LI><A HREF="xEMACS.HTM#IDX1150">debug-on-quit</A>
  15703. <LI><A HREF="xEMACS.HTM#IDX536">default-directory</A>
  15704. <LI><A HREF="xEMACS.HTM#IDX537">default-directory-alist</A>
  15705. <LI><A HREF="xEMACS.HTM#IDX752">default-major-mode</A>
  15706. <LI><A HREF="xEMACS.HTM#IDX18">default-screen-alist</A>
  15707. <LI><A HREF="xEMACS.HTM#IDX598">delete-auto-save-files</A>
  15708. <LI><A HREF="xEMACS.HTM#IDX247">describe-function-show-arglist</A>
  15709. <LI><A HREF="xEMACS.HTM#IDX663">diff-switches</A>
  15710. <LI><A HREF="xEMACS.HTM#IDX675">dired-kept-versions</A>
  15711. <LI><A HREF="xEMACS.HTM#IDX672">dired-listing-switches</A>
  15712. <LI><A HREF="xEMACS.HTM#IDX733">display-buffer-function</A>
  15713. </DIR>
  15714. <H2>e</H2>
  15715. <DIR>
  15716. <LI><A HREF="xEMACS.HTM#IDX428">echo-keystrokes</A>
  15717. <LI><A HREF="xEMACS.HTM#IDX953">emacs-lisp-mode-hook</A>
  15718. <LI><A HREF="xEMACS.HTM#IDX1511">enable-local-variables</A>
  15719. <LI><A HREF="xEMACS.HTM#IDX216">enable-recursive-minibuffers</A>
  15720. <LI><A HREF="xEMACS.HTM#IDX1541">esc-map</A>
  15721. <LI><A HREF="xEMACS.HTM#IDX1400">explicit-shell-file-name</A>
  15722. </DIR>
  15723. <H2>f</H2>
  15724. <DIR>
  15725. <LI><A HREF="xEMACS.HTM#IDX922">fill-column</A>
  15726. <LI><A HREF="xEMACS.HTM#IDX928">fill-prefix</A>
  15727. <LI><A HREF="xEMACS.HTM#IDX554">find-file-compare-truenames</A>
  15728. <LI><A HREF="xEMACS.HTM#IDX565">find-file-hooks</A>
  15729. <LI><A HREF="xEMACS.HTM#IDX566">find-file-not-found-hooks</A>
  15730. <LI><A HREF="xEMACS.HTM#IDX559">find-file-run-dired</A>
  15731. <LI><A HREF="xEMACS.HTM#IDX552">find-file-use-truenames</A>
  15732. <LI><A HREF="xEMACS.HTM#IDX1094">fortran-check-all-num-for-matching-do</A>
  15733. <LI><A HREF="xEMACS.HTM#IDX1098">fortran-comment-indent-char</A>
  15734. <LI><A HREF="xEMACS.HTM#IDX1096">fortran-comment-indent-style</A>
  15735. <LI><A HREF="xEMACS.HTM#IDX1097">fortran-comment-line-column</A>
  15736. <LI><A HREF="xEMACS.HTM#IDX1103">fortran-comment-region</A>
  15737. <LI><A HREF="xEMACS.HTM#IDX1090">fortran-continuation-char</A>
  15738. <LI><A HREF="xEMACS.HTM#IDX1093">fortran-continuation-indent</A>
  15739. <LI><A HREF="xEMACS.HTM#IDX1091">fortran-do-indent</A>
  15740. <LI><A HREF="xEMACS.HTM#IDX1089">fortran-electric-line-number</A>
  15741. <LI><A HREF="xEMACS.HTM#IDX1092">fortran-if-indent</A>
  15742. <LI><A HREF="xEMACS.HTM#IDX1088">fortran-line-number-indent</A>
  15743. <LI><A HREF="xEMACS.HTM#IDX1095">fortran-minimum-statement-indent</A>
  15744. </DIR>
  15745. <H2>g</H2>
  15746. <DIR>
  15747. <LI><A HREF="xEMACS.HTM#IDX1528">global-map</A>
  15748. </DIR>
  15749. <H2>h</H2>
  15750. <DIR>
  15751. <LI><A HREF="xEMACS.HTM#IDX1540">help-map</A>
  15752. </DIR>
  15753. <H2>i</H2>
  15754. <DIR>
  15755. <LI><A HREF="xEMACS.HTM#IDX776">indent-tabs-mode</A>
  15756. <LI><A HREF="xEMACS.HTM#IDX1564">init-file-user</A>
  15757. <LI><A HREF="xEMACS.HTM#IDX124">initial-major-mode</A>
  15758. <LI><A HREF="xEMACS.HTM#IDX1404">input-ring-size</A>
  15759. <LI><A HREF="xEMACS.HTM#IDX542">insert-default-directory</A>
  15760. <LI><A HREF="xEMACS.HTM#IDX426">inverse-video</A>
  15761. <LI><A HREF="xEMACS.HTM#IDX1538">isearch-mode-map</A>
  15762. </DIR>
  15763. <H2>k</H2>
  15764. <DIR>
  15765. <LI><A HREF="xEMACS.HTM#IDX583">kept-new-versions</A>
  15766. <LI><A HREF="xEMACS.HTM#IDX582">kept-old-versions</A>
  15767. <LI><A HREF="xEMACS.HTM#IDX41">keyboard-translate-table</A>
  15768. <LI><A HREF="xEMACS.HTM#IDX368">kill-ring-max</A>
  15769. </DIR>
  15770. <H2>l</H2>
  15771. <DIR>
  15772. <LI><A HREF="xEMACS.HTM#IDX830">LaTeX-mode-hook</A>
  15773. <LI><A HREF="xEMACS.HTM#IDX1003">lisp-body-indention</A>
  15774. <LI><A HREF="xEMACS.HTM#IDX1002">lisp-indent-offset</A>
  15775. <LI><A HREF="xEMACS.HTM#IDX954">lisp-interaction-mode-hook</A>
  15776. <LI><A HREF="xEMACS.HTM#IDX952">lisp-mode-hook</A>
  15777. <LI><A HREF="xEMACS.HTM#IDX1531">lisp-mode-map</A>
  15778. <LI><A HREF="xEMACS.HTM#IDX659">list-directory-brief-switches</A>
  15779. <LI><A HREF="xEMACS.HTM#IDX660">list-directory-verbose-switches</A>
  15780. <LI><A HREF="xEMACS.HTM#IDX1124">load-path</A>
  15781. <LI><A HREF="xEMACS.HTM#IDX1445">lpr-switches</A>
  15782. </DIR>
  15783. <H2>m</H2>
  15784. <DIR>
  15785. <LI><A HREF="xEMACS.HTM#IDX1249">mail-abbrev-mailrc-file</A>
  15786. <LI><A HREF="xEMACS.HTM#IDX1251">mail-abbrev-mode-regexp</A>
  15787. <LI><A HREF="xEMACS.HTM#IDX1253">mail-alias-seperator-string</A>
  15788. <LI><A HREF="xEMACS.HTM#IDX1254">mail-archive-file-name</A>
  15789. <LI><A HREF="xEMACS.HTM#IDX1247">mail-header-separator</A>
  15790. <LI><A HREF="xEMACS.HTM#IDX1271">mail-mode-hook</A>
  15791. <LI><A HREF="xEMACS.HTM#IDX580">make-backup-files</A>
  15792. <LI><A HREF="xEMACS.HTM#IDX1060">make-tags-files-invisible</A>
  15793. <LI><A HREF="xEMACS.HTM#IDX300">mark-ring</A>
  15794. <LI><A HREF="xEMACS.HTM#IDX299">mark-ring-max</A>
  15795. <LI><A HREF="xEMACS.HTM#IDX55">meta-flag</A>
  15796. <LI><A HREF="xEMACS.HTM#IDX1658">minibuffer-confirm-incomplete</A>
  15797. <LI><A HREF="xEMACS.HTM#IDX1535">minibuffer-local-completion-map</A>
  15798. <LI><A HREF="xEMACS.HTM#IDX1533">minibuffer-local-map</A>
  15799. <LI><A HREF="xEMACS.HTM#IDX1536">minibuffer-local-must-match-map</A>
  15800. <LI><A HREF="xEMACS.HTM#IDX1534">minibuffer-local-ns-map</A>
  15801. <LI><A HREF="xEMACS.HTM#IDX425">mode-line-inverse-video</A>
  15802. <LI><A HREF="xEMACS.HTM#IDX956">muddle-mode-hook</A>
  15803. </DIR>
  15804. <H2>n</H2>
  15805. <DIR>
  15806. <LI><A HREF="xEMACS.HTM#IDX416">next-screen-context-lines</A>
  15807. <LI><A HREF="xEMACS.HTM#IDX427">no-redraw-on-reenter</A>
  15808. <LI><A HREF="xEMACS.HTM#IDX796">nroff-mode-hook</A>
  15809. </DIR>
  15810. <H2>o</H2>
  15811. <DIR>
  15812. <LI><A HREF="xEMACS.HTM#IDX835">outline-mode-hook</A>
  15813. <LI><A HREF="xEMACS.HTM#IDX838">outline-regexp</A>
  15814. </DIR>
  15815. <H2>p</H2>
  15816. <DIR>
  15817. <LI><A HREF="xEMACS.HTM#IDX908">page-delimiter</A>
  15818. <LI><A HREF="xEMACS.HTM#IDX897">paragraph-separate</A>
  15819. <LI><A HREF="xEMACS.HTM#IDX896">paragraph-start</A>
  15820. <LI><A HREF="xEMACS.HTM#IDX1556">parse-sexp-ignore-comments</A>
  15821. <LI><A HREF="xEMACS.HTM#IDX1194">picture-mode-hook</A>
  15822. <LI><A HREF="xEMACS.HTM#IDX1228">picture-tab-chars</A>
  15823. <LI><A HREF="xEMACS.HTM#IDX831">plain-TeX-mode-hook</A>
  15824. </DIR>
  15825. <H2>r</H2>
  15826. <DIR>
  15827. <LI><A HREF="xEMACS.HTM#IDX1537">repeat-complex-command-map</A>
  15828. <LI><A HREF="xEMACS.HTM#IDX576">require-final-newline</A>
  15829. <LI><A HREF="xEMACS.HTM#IDX1364">rmail-dont-reply-to</A>
  15830. <LI><A HREF="xEMACS.HTM#IDX1380">rmail-edit-mode-hook</A>
  15831. <LI><A HREF="xEMACS.HTM#IDX1377">rmail-ignored-headers</A>
  15832. </DIR>
  15833. <H2>s</H2>
  15834. <DIR>
  15835. <LI><A HREF="xEMACS.HTM#IDX1187">save-abbrevs</A>
  15836. <LI><A HREF="xEMACS.HTM#IDX955">scheme-mode-hook</A>
  15837. <LI><A HREF="xEMACS.HTM#IDX138">screen-icon-title-format</A>
  15838. <LI><A HREF="xEMACS.HTM#IDX137">screen-title-format</A>
  15839. <LI><A HREF="xEMACS.HTM#IDX417">scroll-step</A>
  15840. <LI><A HREF="xEMACS.HTM#IDX460">search-slow-speed</A>
  15841. <LI><A HREF="xEMACS.HTM#IDX461">search-slow-window-lines</A>
  15842. <LI><A HREF="xEMACS.HTM#IDX862">selective-display-ellipses</A>
  15843. <LI><A HREF="xEMACS.HTM#IDX888">sentence-end</A>
  15844. <LI><A HREF="xEMACS.HTM#IDX1403">shell-cd-regexp</A>
  15845. <LI><A HREF="xEMACS.HTM#IDX1397">shell-file-name</A>
  15846. <LI><A HREF="xEMACS.HTM#IDX1402">shell-popd-regexp</A>
  15847. <LI><A HREF="xEMACS.HTM#IDX1432">shell-prompt-pattern</A>
  15848. <LI><A HREF="xEMACS.HTM#IDX1401">shell-pushd-regexp</A>
  15849. <LI><A HREF="xEMACS.HTM#IDX1569">sound-alist</A>
  15850. </DIR>
  15851. <H2>t</H2>
  15852. <DIR>
  15853. <LI><A HREF="xEMACS.HTM#IDX775">tab-stop-list</A>
  15854. <LI><A HREF="xEMACS.HTM#IDX430">tab-width</A>
  15855. <LI><A HREF="xEMACS.HTM#IDX1061">tag-mark-stack-max</A>
  15856. <LI><A HREF="xEMACS.HTM#IDX1056">tag-table-alist</A>
  15857. <LI><A HREF="xEMACS.HTM#IDX1051">tags-always-build-completion-table</A>
  15858. <LI><A HREF="xEMACS.HTM#IDX1058">tags-build-completion-table</A>
  15859. <LI><A HREF="xEMACS.HTM#IDX1057">tags-file-name</A>
  15860. <LI><A HREF="xEMACS.HTM#IDX1565">term-file-prefix</A>
  15861. <LI><A HREF="xEMACS.HTM#IDX1566">term-setup-hook</A>
  15862. <LI><A HREF="xEMACS.HTM#IDX829">TeX-mode-hook</A>
  15863. <LI><A HREF="xEMACS.HTM#IDX786">text-mode-hook</A>
  15864. <LI><A HREF="xEMACS.HTM#IDX180">track-eol</A>
  15865. <LI><A HREF="xEMACS.HTM#IDX584">trim-versions-without-asking</A>
  15866. <LI><A HREF="xEMACS.HTM#IDX188">truncate-lines</A>
  15867. <LI><A HREF="xEMACS.HTM#IDX718">truncate-partial-width-windows</A>
  15868. </DIR>
  15869. <H2>v</H2>
  15870. <DIR>
  15871. <LI><A HREF="xEMACS.HTM#IDX629">vc-command-messages</A>
  15872. <LI><A HREF="xEMACS.HTM#IDX653">vc-comment-alist</A>
  15873. <LI><A HREF="xEMACS.HTM#IDX624">vc-default-back-end</A>
  15874. <LI><A HREF="xEMACS.HTM#IDX652">vc-header-alist</A>
  15875. <LI><A HREF="xEMACS.HTM#IDX625">vc-initial-comment</A>
  15876. <LI><A HREF="xEMACS.HTM#IDX617">vc-keep-workfiles</A>
  15877. <LI><A HREF="xEMACS.HTM#IDX632">vc-log-mode-hook</A>
  15878. <LI><A HREF="xEMACS.HTM#IDX616">vc-make-backup-files</A>
  15879. <LI><A HREF="xEMACS.HTM#IDX630">vc-mistrust-permissions</A>
  15880. <LI><A HREF="xEMACS.HTM#IDX631">vc-path</A>
  15881. <LI><A HREF="xEMACS.HTM#IDX654">vc-static-header-alist</A>
  15882. <LI><A HREF="xEMACS.HTM#IDX628">vc-suppress-confirm</A>
  15883. <LI><A HREF="xEMACS.HTM#IDX581">version-control</A>
  15884. </DIR>
  15885. <H2>w</H2>
  15886. <DIR>
  15887. <LI><A HREF="xEMACS.HTM#IDX742">window-min-height</A>
  15888. <LI><A HREF="xEMACS.HTM#IDX743">window-min-width</A>
  15889. <LI><A HREF="xEMACS.HTM#IDX577">write-file-hooks</A>
  15890. </DIR>
  15891. <H2>x</H2>
  15892. <DIR>
  15893. <LI><A HREF="xEMACS.HTM#IDX1659">x-mode-pointer-shape</A>
  15894. <LI><A HREF="xEMACS.HTM#IDX1660">x-nontext-pointer-shape</A>
  15895. <LI><A HREF="xEMACS.HTM#IDX1661">x-pointer-background-color</A>
  15896. <LI><A HREF="xEMACS.HTM#IDX1662">x-pointer-foreground-color</A>
  15897. <LI><A HREF="xEMACS.HTM#IDX1663">x-pointer-shape</A>
  15898. <LI><A HREF="xEMACS.HTM#IDX19">x-screen-defaults</A>
  15899. </DIR>
  15900. <H2>z</H2>
  15901. <DIR>
  15902. <LI><A HREF="xEMACS.HTM#IDX382">zmacs-region-stays</A>
  15903. <LI><A HREF="xEMACS.HTM#IDX1664">zmacs-regions</A>
  15904. </DIR>
  15905. <H1><A NAME="SEC329" HREF="xEMACS_TO.HTM#SEC329">Concept Index</A></H1>
  15906. <H2>.</H2>
  15907. <DIR>
  15908. <LI><A HREF="xEMACS.HTM#IDX1250">.mailrc file</A>
  15909. </DIR>
  15910. <H2>a</H2>
  15911. <DIR>
  15912. <LI><A HREF="xEMACS.HTM#IDX1491">Abbrev mode</A>
  15913. <LI><A HREF="xEMACS.HTM#IDX1160">abbrevs</A>
  15914. <LI><A HREF="xEMACS.HTM#IDX1595">aborting</A>
  15915. <LI><A HREF="xEMACS.HTM#IDX390">accumulating text</A>
  15916. <LI><A HREF="xEMACS.HTM#IDX380">active regions</A>
  15917. <LI><A HREF="xEMACS.HTM#IDX113">adding menu items</A>
  15918. <LI><A HREF="xEMACS.HTM#IDX111">adding menus</A>
  15919. <LI><A HREF="xEMACS.HTM#IDX1456">againformation</A>
  15920. <LI><A HREF="xEMACS.HTM#IDX254">apropos</A>
  15921. <LI><A HREF="xEMACS.HTM#IDX134">arguments (from shell)</A>
  15922. <LI><A HREF="xEMACS.HTM#IDX26">ASCII</A>
  15923. <LI><A HREF="xEMACS.HTM#IDX1321">attribute (Rmail)</A>
  15924. <LI><A HREF="xEMACS.HTM#IDX1567">audible bell, changing</A>
  15925. <LI><A HREF="xEMACS.HTM#IDX98">Auto Delete Selection menu item</A>
  15926. <LI><A HREF="xEMACS.HTM#IDX1487">Auto Fill mode</A>
  15927. <LI><A HREF="xEMACS.HTM#IDX595">Auto-Save mode</A>
  15928. <LI><A HREF="xEMACS.HTM#IDX1126">autoload</A>
  15929. </DIR>
  15930. <H2>b</H2>
  15931. <DIR>
  15932. <LI><A HREF="xEMACS.HTM#IDX579">backup file</A>
  15933. <LI><A HREF="xEMACS.HTM#IDX135">batch mode</A>
  15934. <LI><A HREF="xEMACS.HTM#IDX1568">bell, changing</A>
  15935. <LI><A HREF="xEMACS.HTM#IDX61">binding</A>
  15936. <LI><A HREF="xEMACS.HTM#IDX1023">blank lines</A>
  15937. <LI><A HREF="xEMACS.HTM#IDX837">body lines (Outline mode)</A>
  15938. <LI><A HREF="xEMACS.HTM#IDX1470">boredom</A>
  15939. <LI><A HREF="xEMACS.HTM#IDX6">buffer</A>
  15940. <LI><A HREF="xEMACS.HTM#IDX710">buffer menu</A>
  15941. <LI><A HREF="xEMACS.HTM#IDX687">buffers</A>
  15942. <LI><A HREF="xEMACS.HTM#IDX108">Buffers menu</A>
  15943. <LI><A HREF="xEMACS.HTM#IDX105">Buffers Menu Length... menu item</A>
  15944. <LI><A HREF="xEMACS.HTM#IDX106">Buffers Sub-Menus menu item</A>
  15945. <LI><A HREF="xEMACS.HTM#IDX1461">buggestion</A>
  15946. <LI><A HREF="xEMACS.HTM#IDX1602">bugs</A>
  15947. <LI><A HREF="xEMACS.HTM#IDX1128">byte code</A>
  15948. </DIR>
  15949. <H2>c</H2>
  15950. <DIR>
  15951. <LI><A HREF="xEMACS.HTM#IDX944">C</A>
  15952. <LI><A HREF="xEMACS.HTM#IDX946">C mode</A>
  15953. <LI><A HREF="xEMACS.HTM#IDX930">case conversion</A>
  15954. <LI><A HREF="xEMACS.HTM#IDX96">Case Sensitive Search menu item</A>
  15955. <LI><A HREF="xEMACS.HTM#IDX920">centering</A>
  15956. <LI><A HREF="xEMACS.HTM#IDX1046">change log</A>
  15957. <LI><A HREF="xEMACS.HTM#IDX690">changing buffers</A>
  15958. <LI><A HREF="xEMACS.HTM#IDX121">changing menu items</A>
  15959. <LI><A HREF="xEMACS.HTM#IDX25">character set</A>
  15960. <LI><A HREF="xEMACS.HTM#IDX612">checking in files</A>
  15961. <LI><A HREF="xEMACS.HTM#IDX611">checking out files</A>
  15962. <LI><A HREF="xEMACS.HTM#IDX90">Clear menu item</A>
  15963. <LI><A HREF="xEMACS.HTM#IDX369">clipboard selections</A>
  15964. <LI><A HREF="xEMACS.HTM#IDX1523">command</A>
  15965. <LI><A HREF="xEMACS.HTM#IDX225">command history</A>
  15966. <LI><A HREF="xEMACS.HTM#IDX133">command line arguments</A>
  15967. <LI><A HREF="xEMACS.HTM#IDX1525">command name</A>
  15968. <LI><A HREF="xEMACS.HTM#IDX1016">comments</A>
  15969. <LI><A HREF="xEMACS.HTM#IDX666">comparing files</A>
  15970. <LI><A HREF="xEMACS.HTM#IDX1110">compilation errors</A>
  15971. <LI><A HREF="xEMACS.HTM#IDX1114">compiling files</A>
  15972. <LI><A HREF="xEMACS.HTM#IDX217">completion</A>
  15973. <LI><A HREF="xEMACS.HTM#IDX1038">completion (symbol names)</A>
  15974. <LI><A HREF="xEMACS.HTM#IDX187">continuation line</A>
  15975. <LI><A HREF="xEMACS.HTM#IDX957">Control-Meta</A>
  15976. <LI><A HREF="xEMACS.HTM#IDX88">Copy menu item</A>
  15977. <LI><A HREF="xEMACS.HTM#IDX679">copying files</A>
  15978. <LI><A HREF="xEMACS.HTM#IDX389">copying text</A>
  15979. <LI><A HREF="xEMACS.HTM#IDX596">crashes</A>
  15980. <LI><A HREF="xEMACS.HTM#IDX540">creating directories</A>
  15981. <LI><A HREF="xEMACS.HTM#IDX556">creating files</A>
  15982. <LI><A HREF="xEMACS.HTM#IDX689">current buffer</A>
  15983. <LI><A HREF="xEMACS.HTM#IDX1154">current stack frame</A>
  15984. <LI><A HREF="xEMACS.HTM#IDX143">cursor</A>
  15985. <LI><A HREF="xEMACS.HTM#IDX302">cursor shapes</A>
  15986. <LI><A HREF="xEMACS.HTM#IDX1484">customization</A>
  15987. <LI><A HREF="xEMACS.HTM#IDX370">cut buffers</A>
  15988. <LI><A HREF="xEMACS.HTM#IDX87">Cut menu item</A>
  15989. <LI><A HREF="xEMACS.HTM#IDX326">cutting</A>
  15990. </DIR>
  15991. <H2>d</H2>
  15992. <DIR>
  15993. <LI><A HREF="xEMACS.HTM#IDX1148">debugger</A>
  15994. <LI><A HREF="xEMACS.HTM#IDX212">default argument</A>
  15995. <LI><A HREF="xEMACS.HTM#IDX980">defuns</A>
  15996. <LI><A HREF="xEMACS.HTM#IDX80">Delete Screen menu item</A>
  15997. <LI><A HREF="xEMACS.HTM#IDX115">deleting menu items</A>
  15998. <LI><A HREF="xEMACS.HTM#IDX327">deletion</A>
  15999. <LI><A HREF="xEMACS.HTM#IDX681">deletion (of files)</A>
  16000. <LI><A HREF="xEMACS.HTM#IDX1299">deletion (Rmail)</A>
  16001. <LI><A HREF="xEMACS.HTM#IDX1381">digest message</A>
  16002. <LI><A HREF="xEMACS.HTM#IDX1572">ding</A>
  16003. <LI><A HREF="xEMACS.HTM#IDX656">directory listing</A>
  16004. <LI><A HREF="xEMACS.HTM#IDX668">Dired</A>
  16005. <LI><A HREF="xEMACS.HTM#IDX1552">disabled command</A>
  16006. <LI><A HREF="xEMACS.HTM#IDX119">disabling menu items</A>
  16007. <LI><A HREF="xEMACS.HTM#IDX3">Distribution</A>
  16008. <LI><A HREF="xEMACS.HTM#IDX1600">doctor</A>
  16009. <LI><A HREF="xEMACS.HTM#IDX594">drastic changes</A>
  16010. <LI><A HREF="xEMACS.HTM#IDX1605">dribble file</A>
  16011. </DIR>
  16012. <H2>e</H2>
  16013. <DIR>
  16014. <LI><A HREF="xEMACS.HTM#IDX9">echo area</A>
  16015. <LI><A HREF="xEMACS.HTM#IDX85">Edit menu</A>
  16016. <LI><A HREF="xEMACS.HTM#IDX1594">editing level, recursive</A>
  16017. <LI><A HREF="xEMACS.HTM#IDX1474">EDT</A>
  16018. <LI><A HREF="xEMACS.HTM#IDX1599">Eliza</A>
  16019. <LI><A HREF="xEMACS.HTM#IDX1561">Emacs initialization file</A>
  16020. <LI><A HREF="xEMACS.HTM#IDX1138">Emacs-Lisp mode</A>
  16021. <LI><A HREF="xEMACS.HTM#IDX118">enabling menu items</A>
  16022. <LI><A HREF="xEMACS.HTM#IDX92">End Macro Recording menu item</A>
  16023. <LI><A HREF="xEMACS.HTM#IDX122">entering Emacs</A>
  16024. <LI><A HREF="xEMACS.HTM#IDX123">entering XEmacs</A>
  16025. <LI><A HREF="xEMACS.HTM#IDX1398">environment</A>
  16026. <LI><A HREF="xEMACS.HTM#IDX1111">error log</A>
  16027. <LI><A HREF="xEMACS.HTM#IDX1049">etags program</A>
  16028. <LI><A HREF="xEMACS.HTM#IDX1483">evi</A>
  16029. <LI><A HREF="xEMACS.HTM#IDX93">Execute Last Macro menu item</A>
  16030. <LI><A HREF="xEMACS.HTM#IDX84">Exit Emacs menu item</A>
  16031. <LI><A HREF="xEMACS.HTM#IDX1450">exiting</A>
  16032. <LI><A HREF="xEMACS.HTM#IDX1161">expansion (of abbrevs)</A>
  16033. <LI><A HREF="xEMACS.HTM#IDX960">expression</A>
  16034. <LI><A HREF="xEMACS.HTM#IDX1300">expunging (Rmail)</A>
  16035. </DIR>
  16036. <H2>f</H2>
  16037. <DIR>
  16038. <LI><A HREF="xEMACS.HTM#IDX588">file dates</A>
  16039. <LI><A HREF="xEMACS.HTM#IDX655">file directory</A>
  16040. <LI><A HREF="xEMACS.HTM#IDX70">File menu</A>
  16041. <LI><A HREF="xEMACS.HTM#IDX535">file names</A>
  16042. <LI><A HREF="xEMACS.HTM#IDX592">file protection</A>
  16043. <LI><A HREF="xEMACS.HTM#IDX544">files</A>
  16044. <LI><A HREF="xEMACS.HTM#IDX925">fill prefix</A>
  16045. <LI><A HREF="xEMACS.HTM#IDX909">filling</A>
  16046. <LI><A HREF="xEMACS.HTM#IDX102">Font menu item</A>
  16047. <LI><A HREF="xEMACS.HTM#IDX899">formfeed</A>
  16048. <LI><A HREF="xEMACS.HTM#IDX1071">Fortran mode</A>
  16049. <LI><A HREF="xEMACS.HTM#IDX1370">forward a message</A>
  16050. <LI><A HREF="xEMACS.HTM#IDX1524">function</A>
  16051. </DIR>
  16052. <H2>g</H2>
  16053. <DIR>
  16054. <LI><A HREF="xEMACS.HTM#IDX2">General Public License</A>
  16055. <LI><A HREF="xEMACS.HTM#IDX1527">global keymap</A>
  16056. <LI><A HREF="xEMACS.HTM#IDX478">global substitution</A>
  16057. <LI><A HREF="xEMACS.HTM#IDX144">graphic characters</A>
  16058. <LI><A HREF="xEMACS.HTM#IDX989">grinding</A>
  16059. </DIR>
  16060. <H2>h</H2>
  16061. <DIR>
  16062. <LI><A HREF="xEMACS.HTM#IDX1440">hardcopy</A>
  16063. <LI><A HREF="xEMACS.HTM#IDX828">header (TeX mode)</A>
  16064. <LI><A HREF="xEMACS.HTM#IDX1248">headers (of mail message)</A>
  16065. <LI><A HREF="xEMACS.HTM#IDX836">heading lines (Outline mode)</A>
  16066. <LI><A HREF="xEMACS.HTM#IDX239">help</A>
  16067. <LI><A HREF="xEMACS.HTM#IDX109">Help menu</A>
  16068. <LI><A HREF="xEMACS.HTM#IDX226">history of commands</A>
  16069. <LI><A HREF="xEMACS.HTM#IDX422">horizontal scrolling</A>
  16070. </DIR>
  16071. <H2>i</H2>
  16072. <DIR>
  16073. <LI><A HREF="xEMACS.HTM#IDX1458">ignoriginal</A>
  16074. <LI><A HREF="xEMACS.HTM#IDX1310">inbox file</A>
  16075. <LI><A HREF="xEMACS.HTM#IDX1018">indentation</A>
  16076. <LI><A HREF="xEMACS.HTM#IDX1108">inferior process</A>
  16077. <LI><A HREF="xEMACS.HTM#IDX1560">init file</A>
  16078. <LI><A HREF="xEMACS.HTM#IDX73">Insert File... menu item</A>
  16079. <LI><A HREF="xEMACS.HTM#IDX141">insertion</A>
  16080. <LI><A HREF="xEMACS.HTM#IDX834">invisible lines</A>
  16081. </DIR>
  16082. <H2>j</H2>
  16083. <DIR>
  16084. <LI><A HREF="xEMACS.HTM#IDX917">justification</A>
  16085. </DIR>
  16086. <H2>k</H2>
  16087. <DIR>
  16088. <LI><A HREF="xEMACS.HTM#IDX1562">key rebinding, permanent</A>
  16089. <LI><A HREF="xEMACS.HTM#IDX1542">key rebinding, this session</A>
  16090. <LI><A HREF="xEMACS.HTM#IDX1512">keyboard macros</A>
  16091. <LI><A HREF="xEMACS.HTM#IDX59">keycode</A>
  16092. <LI><A HREF="xEMACS.HTM#IDX1526">keymap</A>
  16093. <LI><A HREF="xEMACS.HTM#IDX27">keystroke</A>
  16094. <LI><A HREF="xEMACS.HTM#IDX29">keysym</A>
  16095. <LI><A HREF="xEMACS.HTM#IDX58">keysyms</A>
  16096. <LI><A HREF="xEMACS.HTM#IDX77">Kill Buffer menu item</A>
  16097. <LI><A HREF="xEMACS.HTM#IDX356">kill ring</A>
  16098. <LI><A HREF="xEMACS.HTM#IDX325">killing</A>
  16099. <LI><A HREF="xEMACS.HTM#IDX126">killing Emacs</A>
  16100. </DIR>
  16101. <H2>l</H2>
  16102. <DIR>
  16103. <LI><A HREF="xEMACS.HTM#IDX1320">label (Rmail)</A>
  16104. <LI><A HREF="xEMACS.HTM#IDX798">LaTeX</A>
  16105. <LI><A HREF="xEMACS.HTM#IDX1118">libraries</A>
  16106. <LI><A HREF="xEMACS.HTM#IDX1">license to copy Emacs</A>
  16107. <LI><A HREF="xEMACS.HTM#IDX192">line number</A>
  16108. <LI><A HREF="xEMACS.HTM#IDX943">Lisp</A>
  16109. <LI><A HREF="xEMACS.HTM#IDX945">Lisp mode</A>
  16110. <LI><A HREF="xEMACS.HTM#IDX958">list</A>
  16111. <LI><A HREF="xEMACS.HTM#IDX1123">loading libraries</A>
  16112. <LI><A HREF="xEMACS.HTM#IDX1119">loading Lisp code</A>
  16113. <LI><A HREF="xEMACS.HTM#IDX1529">local keymap</A>
  16114. <LI><A HREF="xEMACS.HTM#IDX1503">local variables</A>
  16115. <LI><A HREF="xEMACS.HTM#IDX1510">local variables in files</A>
  16116. <LI><A HREF="xEMACS.HTM#IDX613">locking and version control</A>
  16117. <LI><A HREF="xEMACS.HTM#IDX615">log entry</A>
  16118. </DIR>
  16119. <H2>m</H2>
  16120. <DIR>
  16121. <LI><A HREF="xEMACS.HTM#IDX1241">mail</A>
  16122. <LI><A HREF="xEMACS.HTM#IDX747">major modes</A>
  16123. <LI><A HREF="xEMACS.HTM#IDX1109">make</A>
  16124. <LI><A HREF="xEMACS.HTM#IDX274">mark</A>
  16125. <LI><A HREF="xEMACS.HTM#IDX297">mark ring</A>
  16126. <LI><A HREF="xEMACS.HTM#IDX1457">Markov chain</A>
  16127. <LI><A HREF="xEMACS.HTM#IDX608">master file</A>
  16128. <LI><A HREF="xEMACS.HTM#IDX1012">matching parentheses</A>
  16129. <LI><A HREF="xEMACS.HTM#IDX746">menus</A>
  16130. <LI><A HREF="xEMACS.HTM#IDX1273">message</A>
  16131. <LI><A HREF="xEMACS.HTM#IDX1276">message number</A>
  16132. <LI><A HREF="xEMACS.HTM#IDX864">Meta</A>
  16133. <LI><A HREF="xEMACS.HTM#IDX1532">minibuffer</A>
  16134. <LI><A HREF="xEMACS.HTM#IDX1485">minor modes</A>
  16135. <LI><A HREF="xEMACS.HTM#IDX504">mistakes, correcting</A>
  16136. <LI><A HREF="xEMACS.HTM#IDX1136">mocklisp</A>
  16137. <LI><A HREF="xEMACS.HTM#IDX950">mode hook</A>
  16138. <LI><A HREF="xEMACS.HTM#IDX1486">mode line</A>
  16139. <LI><A HREF="xEMACS.HTM#IDX547">modified (buffer)</A>
  16140. <LI><A HREF="xEMACS.HTM#IDX28">modifier key</A>
  16141. <LI><A HREF="xEMACS.HTM#IDX60">modifier mapping</A>
  16142. <LI><A HREF="xEMACS.HTM#IDX308">mouse operations</A>
  16143. <LI><A HREF="xEMACS.HTM#IDX301">mouse selection</A>
  16144. <LI><A HREF="xEMACS.HTM#IDX354">moving text</A>
  16145. <LI><A HREF="xEMACS.HTM#IDX14">multi-screen Emacs</A>
  16146. </DIR>
  16147. <H2>n</H2>
  16148. <DIR>
  16149. <LI><A HREF="xEMACS.HTM#IDX649">named configurations (RCS)</A>
  16150. <LI><A HREF="xEMACS.HTM#IDX1435">narrowing</A>
  16151. <LI><A HREF="xEMACS.HTM#IDX79">New Screen menu item</A>
  16152. <LI><A HREF="xEMACS.HTM#IDX148">newline</A>
  16153. <LI><A HREF="xEMACS.HTM#IDX462">non-incremental search</A>
  16154. <LI><A HREF="xEMACS.HTM#IDX787">nroff</A>
  16155. <LI><A HREF="xEMACS.HTM#IDX198">numeric arguments</A>
  16156. </DIR>
  16157. <H2>o</H2>
  16158. <DIR>
  16159. <LI><A HREF="xEMACS.HTM#IDX71">Open File, New Screen... menu item</A>
  16160. <LI><A HREF="xEMACS.HTM#IDX72">Open File... menu item</A>
  16161. <LI><A HREF="xEMACS.HTM#IDX1499">option</A>
  16162. <LI><A HREF="xEMACS.HTM#IDX94">Options menu</A>
  16163. <LI><A HREF="xEMACS.HTM#IDX1473">other editors</A>
  16164. <LI><A HREF="xEMACS.HTM#IDX832">outlines</A>
  16165. <LI><A HREF="xEMACS.HTM#IDX1460">outragedy</A>
  16166. <LI><A HREF="xEMACS.HTM#IDX97">Overstrike menu item</A>
  16167. <LI><A HREF="xEMACS.HTM#IDX1489">Overwrite mode</A>
  16168. </DIR>
  16169. <H2>p</H2>
  16170. <DIR>
  16171. <LI><A HREF="xEMACS.HTM#IDX193">page number</A>
  16172. <LI><A HREF="xEMACS.HTM#IDX898">pages</A>
  16173. <LI><A HREF="xEMACS.HTM#IDX889">paragraphs</A>
  16174. <LI><A HREF="xEMACS.HTM#IDX101">Paren Highlighting menu item</A>
  16175. <LI><A HREF="xEMACS.HTM#IDX1013">parentheses</A>
  16176. <LI><A HREF="xEMACS.HTM#IDX89">Paste menu item</A>
  16177. <LI><A HREF="xEMACS.HTM#IDX358">pasting</A>
  16178. <LI><A HREF="xEMACS.HTM#IDX1506">per-buffer variables</A>
  16179. <LI><A HREF="xEMACS.HTM#IDX1192">pictures</A>
  16180. <LI><A HREF="xEMACS.HTM#IDX142">point</A>
  16181. <LI><A HREF="xEMACS.HTM#IDX50">prefix key sequence</A>
  16182. <LI><A HREF="xEMACS.HTM#IDX1455">presidentagon</A>
  16183. <LI><A HREF="xEMACS.HTM#IDX1275">primary mail file</A>
  16184. <LI><A HREF="xEMACS.HTM#IDX371">primary selections</A>
  16185. <LI><A HREF="xEMACS.HTM#IDX78">Print Buffer menu item</A>
  16186. <LI><A HREF="xEMACS.HTM#IDX211">prompt</A>
  16187. <LI><A HREF="xEMACS.HTM#IDX1462">properbose</A>
  16188. <LI><A HREF="xEMACS.HTM#IDX745">Pull-down Menus</A>
  16189. </DIR>
  16190. <H2>q</H2>
  16191. <DIR>
  16192. <LI><A HREF="xEMACS.HTM#IDX483">query replace</A>
  16193. <LI><A HREF="xEMACS.HTM#IDX1591">quitting</A>
  16194. <LI><A HREF="xEMACS.HTM#IDX437">quitting (in search)</A>
  16195. <LI><A HREF="xEMACS.HTM#IDX152">quoting</A>
  16196. </DIR>
  16197. <H2>r</H2>
  16198. <DIR>
  16199. <LI><A HREF="xEMACS.HTM#IDX1463">random sentences</A>
  16200. <LI><A HREF="xEMACS.HTM#IDX606">RCS</A>
  16201. <LI><A HREF="xEMACS.HTM#IDX95">Read Only menu item</A>
  16202. <LI><A HREF="xEMACS.HTM#IDX701">read-only buffer</A>
  16203. <LI><A HREF="xEMACS.HTM#IDX1563">rebinding keys, permanently</A>
  16204. <LI><A HREF="xEMACS.HTM#IDX1543">rebinding keys, this session</A>
  16205. <LI><A HREF="xEMACS.HTM#IDX1232">rectangle</A>
  16206. <LI><A HREF="xEMACS.HTM#IDX391">rectangles</A>
  16207. <LI><A HREF="xEMACS.HTM#IDX1593">recursive editing level</A>
  16208. <LI><A HREF="xEMACS.HTM#IDX1551">redefining keys</A>
  16209. <LI><A HREF="xEMACS.HTM#IDX469">regexp</A>
  16210. <LI><A HREF="xEMACS.HTM#IDX940">region</A>
  16211. <LI><A HREF="xEMACS.HTM#IDX609">registered file</A>
  16212. <LI><A HREF="xEMACS.HTM#IDX397">registers</A>
  16213. <LI><A HREF="xEMACS.HTM#IDX468">regular expression</A>
  16214. <LI><A HREF="xEMACS.HTM#IDX541">removing directories</A>
  16215. <LI><A HREF="xEMACS.HTM#IDX476">replacement</A>
  16216. <LI><A HREF="xEMACS.HTM#IDX1365">reply to a message</A>
  16217. <LI><A HREF="xEMACS.HTM#IDX1434">restriction</A>
  16218. <LI><A HREF="xEMACS.HTM#IDX76">Revert Buffer menu item</A>
  16219. <LI><A HREF="xEMACS.HTM#IDX1272">Rmail</A>
  16220. </DIR>
  16221. <H2>s</H2>
  16222. <DIR>
  16223. <LI><A HREF="xEMACS.HTM#IDX75">Save Buffer As ... menu item</A>
  16224. <LI><A HREF="xEMACS.HTM#IDX74">Save Buffer menu item</A>
  16225. <LI><A HREF="xEMACS.HTM#IDX107">Save Options</A>
  16226. <LI><A HREF="xEMACS.HTM#IDX546">saving</A>
  16227. <LI><A HREF="xEMACS.HTM#IDX607">SCCS</A>
  16228. <LI><A HREF="xEMACS.HTM#IDX947">Scheme mode</A>
  16229. <LI><A HREF="xEMACS.HTM#IDX4">screen</A>
  16230. <LI><A HREF="xEMACS.HTM#IDX409">scrolling</A>
  16231. <LI><A HREF="xEMACS.HTM#IDX432">searching</A>
  16232. <LI><A HREF="xEMACS.HTM#IDX688">selected buffer</A>
  16233. <LI><A HREF="xEMACS.HTM#IDX713">selected window</A>
  16234. <LI><A HREF="xEMACS.HTM#IDX833">selective display</A>
  16235. <LI><A HREF="xEMACS.HTM#IDX240">self-documentation</A>
  16236. <LI><A HREF="xEMACS.HTM#IDX879">sentences</A>
  16237. <LI><A HREF="xEMACS.HTM#IDX1495">setting variables</A>
  16238. <LI><A HREF="xEMACS.HTM#IDX959">sexp</A>
  16239. <LI><A HREF="xEMACS.HTM#IDX1392">shell commands</A>
  16240. <LI><A HREF="xEMACS.HTM#IDX1405">Shell mode</A>
  16241. <LI><A HREF="xEMACS.HTM#IDX45">shift modifer</A>
  16242. <LI><A HREF="xEMACS.HTM#IDX128">shrinking XEmacs screen</A>
  16243. <LI><A HREF="xEMACS.HTM#IDX589">simultaneous editing</A>
  16244. <LI><A HREF="xEMACS.HTM#IDX103">Size menu item</A>
  16245. <LI><A HREF="xEMACS.HTM#IDX644">snapshots and version control</A>
  16246. <LI><A HREF="xEMACS.HTM#IDX1384">sorting</A>
  16247. <LI><A HREF="xEMACS.HTM#IDX528">spelling</A>
  16248. <LI><A HREF="xEMACS.HTM#IDX81">Split Screen</A>
  16249. <LI><A HREF="xEMACS.HTM#IDX91">Start Macro Recording menu item</A>
  16250. <LI><A HREF="xEMACS.HTM#IDX477">string substitution</A>
  16251. <LI><A HREF="xEMACS.HTM#IDX1391">subshell</A>
  16252. <LI><A HREF="xEMACS.HTM#IDX855">subtree (Outline mode)</A>
  16253. <LI><A HREF="xEMACS.HTM#IDX1332">summary (Rmail)</A>
  16254. <LI><A HREF="xEMACS.HTM#IDX127">suspending</A>
  16255. <LI><A HREF="xEMACS.HTM#IDX691">switching buffers</A>
  16256. <LI><A HREF="xEMACS.HTM#IDX100">Syntax Highlighting menu item</A>
  16257. <LI><A HREF="xEMACS.HTM#IDX1555">syntax table</A>
  16258. </DIR>
  16259. <H2>t</H2>
  16260. <DIR>
  16261. <LI><A HREF="xEMACS.HTM#IDX1048">tag table</A>
  16262. <LI><A HREF="xEMACS.HTM#IDX99">Teach Extended Commands menu item</A>
  16263. <LI><A HREF="xEMACS.HTM#IDX1459">techniquitous</A>
  16264. <LI><A HREF="xEMACS.HTM#IDX363">television</A>
  16265. <LI><A HREF="xEMACS.HTM#IDX1607">termscript file</A>
  16266. <LI><A HREF="xEMACS.HTM#IDX797">TeX</A>
  16267. <LI><A HREF="xEMACS.HTM#IDX779">text</A>
  16268. <LI><A HREF="xEMACS.HTM#IDX782">Text mode</A>
  16269. <LI><A HREF="xEMACS.HTM#IDX11">top level</A>
  16270. <LI><A HREF="xEMACS.HTM#IDX975">transposition</A>
  16271. <LI><A HREF="xEMACS.HTM#IDX189">truncation</A>
  16272. <LI><A HREF="xEMACS.HTM#IDX503">typos</A>
  16273. </DIR>
  16274. <H2>u</H2>
  16275. <DIR>
  16276. <LI><A HREF="xEMACS.HTM#IDX83">Un-split (Keep Others)</A>
  16277. <LI><A HREF="xEMACS.HTM#IDX82">Un-split (Keep This)</A>
  16278. <LI><A HREF="xEMACS.HTM#IDX1305">undeletion (Rmail)</A>
  16279. <LI><A HREF="xEMACS.HTM#IDX1382">undigestify</A>
  16280. <LI><A HREF="xEMACS.HTM#IDX205">undo</A>
  16281. <LI><A HREF="xEMACS.HTM#IDX86">Undo menu item</A>
  16282. </DIR>
  16283. <H2>v</H2>
  16284. <DIR>
  16285. <LI><A HREF="xEMACS.HTM#IDX1493">variable</A>
  16286. <LI><A HREF="xEMACS.HTM#IDX66">variables</A>
  16287. <LI><A HREF="xEMACS.HTM#IDX605">version control</A>
  16288. <LI><A HREF="xEMACS.HTM#IDX1650">version number</A>
  16289. <LI><A HREF="xEMACS.HTM#IDX1475">vi</A>
  16290. <LI><A HREF="xEMACS.HTM#IDX686">viewing</A>
  16291. <LI><A HREF="xEMACS.HTM#IDX545">visiting</A>
  16292. <LI><A HREF="xEMACS.HTM#IDX543">visiting files</A>
  16293. </DIR>
  16294. <H2>w</H2>
  16295. <DIR>
  16296. <LI><A HREF="xEMACS.HTM#IDX104">Weight menu item</A>
  16297. <LI><A HREF="xEMACS.HTM#IDX1433">widening</A>
  16298. <LI><A HREF="xEMACS.HTM#IDX5">window</A>
  16299. <LI><A HREF="xEMACS.HTM#IDX712">windows</A>
  16300. <LI><A HREF="xEMACS.HTM#IDX744">Windows menu</A>
  16301. <LI><A HREF="xEMACS.HTM#IDX465">word search</A>
  16302. <LI><A HREF="xEMACS.HTM#IDX934">words</A>
  16303. <LI><A HREF="xEMACS.HTM#IDX610">work file</A>
  16304. </DIR>
  16305. <H2>x</H2>
  16306. <DIR>
  16307. <LI><A HREF="xEMACS.HTM#IDX1588">X resources</A>
  16308. </DIR>
  16309. <H2>y</H2>
  16310. <DIR>
  16311. <LI><A HREF="xEMACS.HTM#IDX357">yanking</A>
  16312. </DIR>
  16313. </BODY>
  16314. </HTML>
  16315.