(define-key-after): Default AFTER to t. Doc fix.
[emacs.git] / man / faq.texi
blobabcb4fa914f5a3925931732da2ca3b1814624c48
1 \input texinfo   @c -*-texinfo-*-  -*- coding: latin-1 -*-
2 @c %**start of header
3 @setfilename ../info/efaq
4 @settitle GNU Emacs FAQ
5 @c %**end of header
7 @setchapternewpage odd
9 @c The @ifinfo stuff only appears in the Info version
10 @ifinfo
11 @dircategory Editors
12 @direntry
13 * Emacs FAQ: (efaq).    Frequently Asked Questions about Emacs.
14 @end direntry
16 Copyright 1994-1999 Reuven M. Lerner@*
17 Copyright 1992-1993 Steven Byrnes@*
18 Copyright 1990-1992 Joseph Brian Wells@*
20 This list of frequently asked questions about GNU Emacs with answers
21 ("FAQ") may be translated into other languages, transformed into other
22 formats (e.g. Texinfo, Info, WWW, WAIS), and updated with new information.
24 The same conditions apply to any derivative of the FAQ as apply to the FAQ
25 itself.  Every copy of the FAQ must include this notice or an approved
26 translation, information on who is currently maintaining the FAQ and how to
27 contact them (including their e-mail address), and information on where the
28 latest version of the FAQ is archived (including FTP information).
30 The FAQ may be copied and redistributed under these conditions, except that
31 the FAQ may not be embedded in a larger literary work unless that work
32 itself allows free copying and redistribution.
34 [This version has been somewhat edited from the last-posted version
35 (as of August 1999) for inclusion in the Emacs distribution.]
37 @end ifinfo
39 @c The @titlepage stuff only appears in the printed version
40 @titlepage
41 @sp 10
42 @center @titlefont{GNU Emacs FAQ}
44 @c The following two commands start the copyright page.
45 @page
46 @vskip 0pt plus 1filll
47 Copyright @copyright{} 1994-1999 Reuven M. Lerner@*
48 Copyright @copyright{} 1992-1993 Steven Byrnes@*
49 Copyright @copyright{} 1990-1992 Joseph Brian Wells@*
51 This list of frequently asked questions about GNU Emacs with answers
52 ("FAQ") may be translated into other languages, transformed into other
53 formats (e.g. Texinfo, Info, WWW, WAIS), and updated with new information.
55 The same conditions apply to any derivative of the FAQ as apply to the FAQ
56 itself.  Every copy of the FAQ must include this notice or an approved
57 translation, information on who is currently maintaining the FAQ and how to
58 contact them (including their e-mail address), and information on where the
59 latest version of the FAQ is archived (including FTP information).
61 The FAQ may be copied and redistributed under these conditions, except that
62 the FAQ may not be embedded in a larger literary work unless that work
63 itself allows free copying and redistribution.
65 [This version has been somewhat edited from the last-posted version
66 (as of August 1999) for inclusion in the Emacs distribution.]
67 @end titlepage
69 @node    Top, FAQ notation, (dir), (dir)
71 This is the GNU Emacs FAQ, last updated on @today{}.
73 The FAQ is slowly but surely being turned into a Texinfo document,
74 allowing us to create HTML, Info, and TeX documents from a single source
75 file.  Please bear with us as we improve on this format.  If you have
76 any suggestions or questions, please contact
77 @email{emacs-faq@@lerner.co.il, the FAQ maintainers}.
79 @menu
80 * FAQ notation::                
81 * General questions::           
82 * Getting help::                
83 * Status of Emacs::             
84 * Common requests::             
85 * Bugs and problems::           
86 * Compiling and installing Emacs::  
87 * Finding Emacs and related packages::  
88 * Major packages and programs::  
89 * Key bindings::                
90 * Alternate character sets::    
91 * Mail and news::               
92 * Concept index::               
93 @end menu
95 @c ------------------------------------------------------------
96 @node FAQ notation, General questions, Top, Top
97 @chapter FAQ notation
98 @cindex FAQ notation
100 This section describes notation used in the GNU Emacs FAQ, as well as in
101 the Emacs documentation.  Consult this section if this is the first time
102 you are reading the FAQ, or if you are confused by notation or terms
103 used in the FAQ.
105 @menu
106 * Basic keys::                  
107 * Extended commands::           
108 * On-line manual::              
109 * Filename conventions::        
110 * Common acronyms::             
111 @end menu
113 @node Basic keys, Extended commands, FAQ notation, FAQ notation
114 @section What do these mean: @kbd{C-h}, @kbd{M-C-a}, @key{RET}, @kbd{@key{ESC} a}, etc.?
115 @cindex Basic keys
116 @cindex Control key, notation for
117 @cindex @key{Meta} key, notation for
118 @cindex Control-meta characters, notation for
119 @cindex @kbd{C-h}, definition of
120 @cindex @kbd{M-C-h}, definition of
121 @cindex @key{DEL}, definition of
122 @cindex @key{ESC}, definition of
123 @cindex @key{LFD}, definition of
124 @cindex @key{RET}, definition of
125 @cindex @key{SPC}, definition of
126 @cindex @key{TAB}, definition of
128 @itemize @bullet
130 @item
131 @kbd{C-x}: press the @key{x} key while holding down the @key{Control} key
133 @item
134 @kbd{M-x}: press the @key{x} key while holding down the @key{Meta} key
135 (if your computer doesn't have a @key{Meta} key, see @pxref{No Meta key})
137 @item
138 @kbd{M-C-x}: press the @key{x} key while holding down both @key{Control}
139 and @key{Meta}
141 @item
142 @kbd{C-M-x}: a synonym for the above
144 @item
145 @key{LFD}: Linefeed or Newline; same as @kbd{C-j}
147 @item
148 @key{RET}: @key{Return}, sometimes marked @key{Enter}; same as @kbd{C-m}
150 @item
151 @key{DEL}: @key{Delete}, usually not the same as @key{Backspace}; same
152      as @kbd{C-?}  (@pxref{Backspace invokes help} if deleting invokes Emacs help)
154 @item
155 @key{ESC}: Escape; same as @kbd{C-[}
157 @item
158 @key{TAB}: Tab; same as @kbd{C-i}
160 @item
161 @key{SPC}: Space bar
163 @end itemize
165 Key sequences longer than one key (and some single-key sequences) are
166 inside double quotes or on lines by themselves.  Any real spaces in such
167 a key sequence should be ignored; only @key{SPC} really means press the
168 space key.
170 The ASCII code sent by @kbd{C-x} (except for @kbd{C-?}) is the value
171 that would be sent by pressing just @key{x} minus 96 (or 64 for
172 uppercase @key{X}) and will be from 0 to 31.  The ASCII code sent by
173 @kbd{M-x} is the sum of 128 and the ASCII code that would be sent by
174 pressing just @key{x}.  Essentially, @key{Control} turns off bits 5 and
175 6 and @key{Meta} turns on bit 7.
177 @kbd{C-?} (aka @key{DEL}) is ASCII code 127.  It is a misnomer to call
178 @kbd{C-?}  a "control" key, since 127 has both bits 5 and 6 turned ON.
179 Also, on very few keyboards does @kbd{C-?} generate ASCII code 127.
181 @inforef{Characters, Characters, emacs} and @inforef{Keys, Keys, emacs}
182 for more information.  (@pxref{On-line manual} for more information about
183 Info.)
185 @node Extended commands, On-line manual, Basic keys, FAQ notation
186 @section What does @file{M-x @var{command}} mean?
187 @cindex Extended commands
188 @cindex Commands, extended
189 @cindex M-x, meaning of
191 @kbd{M-x @var{command}} means type @kbd{M-x}, then type the name of the
192 command, then type @key{RET}.  (@pxref{Basic keys} if you're not sure
193 what @kbd{M-x} and @key{RET} mean.)
195 @kbd{M-x} (by default) invokes the command
196 @code{execute-extended-command}.  This command allows you to run any
197 Emacs command if you can remember the command's name.  If you can't
198 remember the command's name, you can type @key{TAB} and @key{SPC} for
199 completion, @key{?} for a list of possibilities, and @kbd{M-p} and
200 @kbd{M-n} to see previous commands entered.  An Emacs "command" is any
201 "interactive" Emacs function.
203 Your system administrator may have bound other key sequences to invoke
204 @code{execute-extended-command}.  A function key labeled @kbd{Do} is a
205 good candidate for this.
207 To run non-interactive Emacs functions, @pxref{Evaluating Emacs Lisp code}.
209 @node On-line manual, Filename conventions, Extended commands, FAQ notation
210 @section How do I read topic XXX in the on-line manual?
211 @cindex On-line manual, reading topics in
212 @cindex Reading topics in the on-line manual
213 @cindex Finding topics in the on-line manual
214 @cindex Info, finding topics in
216 When we refer you to topic XXX in the on-line manual, you can read this
217 manual node inside Emacs (assuming nothing is broken) by typing @kbd{C-h
218 i m emacs @key{RET} m XXX @key{RET}}.
220 This invokes Info, the GNU hypertext documentation browser.  If you don't
221 already know how to use Info, type @key{?} from within Info.
223 If we refer to topic XXX:YYY, type @kbd{C-h i m emacs @key{RET} m XXX
224 @key{RET} m YYY @key{RET}}.
226 Your system administrator may not have installed the Info files, or may
227 have installed them improperly.  In this case you should complain.
229 @xref{Getting a printed manual}, if you would like a paper copy of the
230 Emacs manual.
232 @node Filename conventions, Common acronyms, On-line manual, FAQ notation
233 @section What are @file{etc/SERVICE}, @file{src/config.h}, and @file{lisp/default.el}?
234 @cindex Filename conventions
235 @cindex Conventions for filenames
236 @cindex Directories and files that come with Emacs
238 These are files that come with Emacs.  The Emacs distribution is divided
239 into subdirectories; the important ones are @file{etc}, @file{lisp}, and
240 @file{src}.
242 If you use Emacs, but don't know where it is kept on your system, start
243 Emacs, then type @kbd{C-h v data-directory @key{RET}}.  The directory
244 name displayed by this will be the full pathname of the installed
245 @file{etc} directory.
247 The location of your Info directory (i.e., where on-line documentation
248 is stored) is kept in the variable @code{Info-default-directory-list}.  Use
249 @kbd{C-h v Info-default-directory-list @key{RET}} to see the contents of
250 this variable, which will be a list of directory names.  The last
251 directory in that list is probably where most Info files are stored.  By
252 default, Info documentation is placed in @file{/usr/local/info}.
254 Some of these files are available individually via FTP or e-mail;
255 @pxref{Informational files for Emacs}.  All are available in the source
256 distribution.  Many of the files in the @file{etc} directory are also
257 available via the Emacs "help" menu, or by typing @kbd{C-h ?} (@kbd{M-x
258 help-for-help}).
260 Your system administrator may have removed the @file{src} directory and
261 many files from the @file{etc} directory.
263 @node Common acronyms,  , Filename conventions, FAQ notation
264 @section What are FSF, LPF, OSF, GNU, RMS, FTP, and GPL?
265 @cindex FSF, definition of
266 @cindex LPF, definition of
267 @cindex OSF, definition of
268 @cindex GNU, definition of
269 @cindex RMS, definition of
270 @cindex Stallman, Richard, acronym for
271 @cindex Richard Stallman, acronym for
272 @cindex FTP, definition of
273 @cindex GPL, definition of
274 @cindex Acronyms, definitions for
275 @cindex Common acronyms, definitions for
277 @table @asis
279 @item FSF
280 Free Software Foundation
282 @item LPF
283 League for Programming Freedom
285 @item OSF
286 Open Software Foundation
288 @item GNU
289 GNU's Not Unix
291 @item RMS
292 Richard Matthew Stallman
294 @item FTP
295 File Transfer Protocol
297 @item GPL
298 GNU General Public License
300 @end table
302 Avoid confusing the FSF, the LPF, and the OSF.  The LPF opposes
303 look-and-feel copyrights and software patents.  The FSF aims to make
304 high quality free software available for everyone.  The OSF is a
305 consortium of computer vendors which develops commercial software for
306 Unix systems.
308 The word "free" in the title of the Free Software Foundation refers to
309 "freedom," not "zero dollars."  Anyone can charge any price for
310 GPL-covered software that they want to.  However, in practice, the
311 freedom enforced by the GPL leads to low prices, because you can always
312 get the software for less money from someone else, because everyone has
313 the right to resell or give away GPL-covered software.
315 @c ------------------------------------------------------------
316 @node    General questions, Getting help, FAQ notation, Top
317 @chapter General questions
318 @cindex General questions
320 This section contains general questions having to do with Emacs, the
321 Free Software Foundation, and related organizations.
323 @menu
324 * The LPF::                     
325 * Real meaning of copyleft::    
326 * Guidelines for newsgroup postings::  
327 * Newsgroup archives::          
328 * Reporting bugs::              
329 * Unsubscribing from Emacs lists::  
330 * Contacting the FSF::          
331 @end menu
333 @node The LPF, Real meaning of copyleft, General questions, General questions
334 @section What is the LPF?
335 @cindex LPF, description of
336 @cindex League for Programming Freedom
337 @cindex Software patents, opposition to
338 @cindex Patents for software, opposition to
340 The LPF opposes the expanding danger of software patents and
341 look-and-feel copyrights.  To get more information, feel free to contact
342 the LPF via e-mail or otherwise.  You may also contact
343 @email{jbw@@cs.bu.edu, Joe Wells}; he will be happy to talk with you
344 about the LPF.
346 You can find more information about the LPF in the file @file{etc/LPF}.
347 More papers describing the LPF's views are available on the Internet and
348 also from @uref{http://lpf.ai.mit.edu/, the LPF}.
350 @node Real meaning of copyleft, Guidelines for newsgroup postings, The LPF, General questions
351 @section What is the real legal meaning of the GNU copyleft?
352 @cindex Copyleft, real meaning of
353 @cindex GPL, real meaning of
354 @cindex General Public License, real meaning of
355 @cindex Discussion of the GPL
357 The real legal meaning of the GNU General Public License (copyleft) will
358 only be known if and when a judge rules on its validity and scope.
359 There has never been a copyright infringement case involving the GPL to
360 set any precedents.  Please take any discussion regarding this issue to
361 the newsgroup @uref{news:gnu.misc.discuss}, which was created to hold the
362 extensive flame wars on the subject.
364 RMS writes:
366 @quotation
367 The legal meaning of the GNU copyleft is less important than the spirit,
368 which is that Emacs is a free software project and that work pertaining
369 to Emacs should also be free software.  "Free" means that all users have
370 the freedom to study, share, change and improve Emacs.  To make sure
371 everyone has this freedom, pass along source code when you distribute
372 any version of Emacs or a related program, and give the recipients the
373 same freedom that you enjoyed.
374 @end quotation
376 @node Guidelines for newsgroup postings, Newsgroup archives, Real meaning of copyleft, General questions
377 @section  What are appropriate messages for @uref{news:gnu.emacs.help}, @uref{news:gnu.emacs.bug}, @uref{news:comp.emacs}, etc.?
378 @cindex Newsgroups, appropriate messages for
379 @cindex GNU newsgroups, appropriate messages for
380 @cindex Usenet groups, appropriate messages for
381 @cindex Mailing lists, appropriate messages for
383 The file @file{etc/MAILINGLISTS} discusses the purpose of each GNU
384 mailing-list.  (@pxref{Informational files for Emacs} if you want a copy
385 of the file.)  For those lists which are gatewayed with newsgroups, it
386 lists both the newsgroup name and the mailing list address.
388 @uref{news:comp.emacs} is for discussion of Emacs programs in general.
389 This includes Emacs along with various other implementations, such as
390 JOVE, MicroEmacs, Freemacs, MG, Unipress, CCA, and Epsilon.
392 Many people post Emacs questions to @uref{news:comp.emacs} because they
393 don't receive any of the gnu.* newsgroups.  Arguments have been made
394 both for and against posting GNU-Emacs-specific material to
395 @uref{news:comp.emacs}.  You have to decide for yourself.
397 Messages advocating "non-free" software are considered unacceptable on
398 any of the gnu.* newsgroups except for @uref{news:gnu.misc.discuss},
399 which was created to hold the extensive flame-wars on the subject.
400 "Non-free" software includes any software for which the end user can't
401 freely modify the source code and exchange enhancements.  Be careful to
402 remove the gnu.* groups from the "Newsgroups:" line when posting a
403 followup that recommends such software.
405 @uref{news:gnu.emacs.bug} is a place where bug reports appear, but avoid
406 posting bug reports to this newsgroup (@pxref{Reporting bugs}).
408 @node Newsgroup archives, Reporting bugs, Guidelines for newsgroup postings, General questions
409 @section Where can I get old postings to @uref{news:gnu.emacs.help} and other GNU groups?
410 @cindex Archived postings from @uref{news:gnu.emacs.help}
411 @cindex Usenet archives for GNU groups
412 @cindex Old Usenet postings for GNU groups
414 The FSF has maintained archives of all of the GNU mailing lists for many
415 years, although there may be some unintentional gaps in coverage.  The
416 archive is not particularly well organized or easy to retrieve
417 individual postings from, but pretty much everything is there.
419 The archive is at @uref{ftp://ftp-mailing-list-archives.gnu.org}.
421 As of this writing, the archives are not yet working.
423 Web-based Usenet search services, such as
424 @uref{http://www.dejanews.com, DejaNews}, also archive the
425 gnu.* groups.
427 @node Reporting bugs, Unsubscribing from Emacs lists, Newsgroup archives, General questions
428 @section Where should I report bugs and other problems with Emacs?
429 @cindex Bug reporting
430 @cindex Good bug reports
431 @cindex How to submit a bug report
432 @cindex Reporting bugs
434 The correct way to report Emacs bugs is by e-mail to
435 @email{bug-gnu-emacs@@gnu.org}.  Anything sent here also appears in the
436 newsgroup @uref{news:gnu.emacs.bug}, but please use e-mail instead of
437 news to submit the bug report.  This ensures a reliable return address
438 so you can be contacted for further details.
440 Be sure to read the "Bugs" section of the Emacs manual before reporting
441 a bug to bug-gnu-emacs!  The manual describes in detail how to submit a
442 useful bug report.  (@pxref{On-line manual} if you don't know how to read the
443 manual.)
445 RMS says:
447 @quotation
448 Sending bug reports to @email{help-gnu-emacs@@gnu.org} (which has the
449 effect of posting on @uref{news:gnu.emacs.help}) is undesirable because
450 it takes the time of an unnecessarily large group of people, most of
451 whom are just users and have no idea how to fix these problem.
452 @email{bug-gnu-emacs@@gnu.org} reaches a much smaller group of people
453 who are more likely to know what to do and have expressed a wish to
454 receive more messages about Emacs than the others.
455 @end quotation
457 RMS says it is sometimes fine to post to @uref{news:gnu.emacs.help}:
459 @quotation
460 If you have reported a bug and you don't hear about a possible fix,
461 then after a suitable delay (such as a week) it is okay to post on
462 gnu.emacs.help asking if anyone can help you.
463 @end quotation
465 If you are unsure whether you have found a bug, consider the following
466 non-exhaustive list, courtesy of RMS:
468 @quotation
469 If Emacs crashes, that is a bug.  If Emacs gets compilation errors
470 while building, that is a bug.  If Emacs crashes while building, that
471 is a bug.  If Lisp code does not do what the documentation says it
472 does, that is a bug.
473 @end quotation
475 @node Unsubscribing from Emacs lists, Contacting the FSF, Reporting bugs, General questions
476 @section  How do I unsubscribe from this mailing list?
477 @cindex Unsubscribing from GNU mailing lists
478 @cindex Removing yourself from GNU mailing lists
480 If you are receiving a GNU mailing list named "XXX", you might be able
481 to unsubscribe from it by sending a request to the address
482 @email{XXX-request@@gnu.org}.  However, this will not work if you are
483 not listed on the main mailing list, but instead receive the mail from a
484 distribution point.  In that case, you will have to track down at which
485 distribution point you are listed.  Inspecting the @samp{Received} headers
486 on the mail messages may help, along with liberal use of the "EXPN" or
487 "VRFY" sendmail commands through "telnet <site-address> smtp".  Ask your
488 postmaster for help.
490 @node Contacting the FSF,  , Unsubscribing from Emacs lists, General questions
491 @section  What is the current address of the FSF?
492 @cindex Snail mail address of the FSF
493 @cindex Postal address of the FSF
494 @cindex Contracting the FSF
495 @cindex Free Software Foundation, contacting
497 @table @asis
499 @item E-mail
500 gnu@@gnu.org
502 @item Telephone
503 +1-617-542-5942
505 @item Fax
506 +1-617-542-2652
508 @item World Wide Web
509 @uref{http://www.gnu.org/}
511 @item Postal address
512 Free Software Foundation@*
513 59 Temple Place - Suite 330@*
514 Boston, MA 02111-1307@*
515 USA@*
517 @end table
519 For details on how to order items directly from the FSF, see the file
520 @file{etc/ORDERS}.
522 @c ------------------------------------------------------------
523 @node Getting help, Status of Emacs, General questions, Top
524 @chapter Getting help
525 @cindex Getting help
527 This section tells you how to get help with Emacs
529 @menu
530 * Basic editing::               
531 * Learning how to do something::  
532 * Getting a printed manual::    
533 * Emacs Lisp documentation::    
534 * Installing Texinfo documentation::  
535 * Printing a Texinfo file::     
536 * Viewing Info files outside of Emacs::  
537 * Informational files for Emacs::  
538 * Help installing Emacs::       
539 * Obtaining the FAQ::           
540 @end menu
542 @node Basic editing, Learning how to do something, Getting help, Getting help
543 @section I'm just starting Emacs; how do I do basic editing?
544 @cindex Basic editing with Emacs
545 @cindex Beginning editing
546 @cindex Tutorial, invoking the
547 @cindex Self-paced tutorial, invoking the
548 @cindex Help system, entering the
550 Type @kbd{C-h t} to invoke the self-paced tutorial.  Just typing @kbd{C-h}
551 enters the help system.
553 Your system administrator may have changed @kbd{C-h} to act like
554 @key{DEL} to deal with local keyboards.  You can use @kbd{M-x
555 help-for-help} instead to invoke help.  To discover what key (if any)
556 invokes help on your system, type @kbd{M-x where-is @key{RET}
557 help-for-help @key{RET}}.  This will print a comma-separated list of key
558 sequences in the echo area.  Ignore the last character in each key
559 sequence listed.  Each of the resulting key sequences invokes help.
561 Emacs help works best if it is invoked by a single key whose value
562 should be stored in the variable @code{help-char}.
564 There is also a WWW-based tutorial for Emacs 18, much of which is also
565 relevant for Emacs 20, available at
567 @uref{http://kufacts.cc.ukans.edu/cwis/writeups/misc/emacsguide.html}
569 @node Learning how to do something, Getting a printed manual, Basic editing, Getting help
570 @section How do I find out how to do something in Emacs?
571 @cindex Help for Emacs
572 @cindex Learning to do something in Emacs
573 @cindex Reference card for Emacs
574 @cindex Overview of help systems
576 There are several methods for finding out how to do things in Emacs.
578 @itemize @bullet
580 @item
581 The complete text of the Emacs manual is available on-line via the Info
582 hypertext reader.  Type @kbd{C-h i} to invoke Info.  Typing @key{h}
583 immediately after entering Info will provide a short tutorial on how to
584 use it.
586 @item
587 You can order a hardcopy of the manual from the FSF.  @xref{Getting a
588 printed manual}.
590 @item
591 You can get a printed reference card listing commands and keys to
592 invoke them.  You can order one from the FSF for $1 (or 10 for $5),
593 or you can print your own from the @file{etc/refcard.tex} or
594 @file{etc/refcard.ps} files in the Emacs distribution.
596 @item
597 You can list all of the commands whose names contain a certain word
598 (actually which match a regular expression) using @kbd{C-h a} (@kbd{M-x
599 command-apropos}).
601 @item
602 You can list all of the functions and variables whose names contain a
603 certain word using @kbd{M-x apropos}.
605 @item
606 There are many other commands in Emacs for getting help and
607 information.  To get a list of these commands, type @samp{?} after
608 @kbd{C-h}.
610 @end itemize
612 @node Getting a printed manual, Emacs Lisp documentation, Learning how to do something, Getting help
613 @section How do I get a printed copy of the Emacs manual?
614 @cindex Printed Emacs manual, obtaining
615 @cindex Manual, obtaining a printed copy of
616 @cindex Emacs manual, obtaining a printed copy of
618 You can order a printed copy of the Emacs manual from the FSF.  For
619 details see the file @file{etc/ORDERS}.
621 The full @TeX{} source for the manual also comes in the @file{man}
622 directory of the Emacs distribution, if you're daring enough to try to
623 print out this 440-page manual yourself (@pxref{Printing a Texinfo
624 file}).
626 If you absolutely have to print your own copy, and you don't have @TeX{},
627 you can get a PostScript version from
629 @uref{http://www.gnu.org/manual/emacs/ps/emacs.ps.gz}
631 A WWW version of the manual is at
633 @uref{www.gnu.org/manual/emacs/index.html}
635 @xref{Learning how to do something}, for how to view the manual on-line.
637 @node Emacs Lisp documentation, Installing Texinfo documentation, Getting a printed manual, Getting help
638 @section Where can I get documentation on Emacs Lisp?
639 @cindex Documentation on Emacs Lisp
640 @cindex Function documentation
641 @cindex Variable documentation
642 @cindex Emacs Lisp Reference Manual
643 @cindex Reference manual for Emacs Lisp
645 Within Emacs, you can type @kbd{C-h f} to get the documentation for a
646 function, @kbd{C-h v} for a variable.
648 For more information, obtain the Emacs Lisp Reference Manual.  Details on
649 ordering it from FSF are in file @file{etc/ORDERS}.
651 The Emacs Lisp Reference Manual is also available on-line, in Info
652 format.  Texinfo source for the manual (along with pregenerated Info
653 files) is available at
655 @uref{ftp://ftp.gnu.org/pub/gnu/emacs/elisp-manual-20-2.5.tar.gz}
657 and all mirrors of @samp{ftp.gnu.org} (@pxref{Current GNU distributions} for a
658 list).  @xref{Installing Texinfo documentation}, if you want to install
659 the Info files, or @ref{Printing a Texinfo file} if you want to use the
660 Texinfo source to print the manual yourself.
662 A WWW version of the Emacs Lisp Reference Manual is available at
664 @uref{http://www.gnu.org/manual/elisp-manual-20-2.5/elisp.html}
666 @node Installing Texinfo documentation, Printing a Texinfo file, Emacs Lisp documentation, Getting help
667 @section How do I install a piece of Texinfo documentation?
668 @cindex Texinfo documentation, installing
669 @cindex Installing Texinfo documentation
670 @cindex New Texinfo files, installing
671 @cindex Documentation, installing new Texinfo files
673 First, you must turn the Texinfo files into Info files.  You may do this
674 using the stand-alone @file{makeinfo} program, available as part of the latest
675 Texinfo package at
677 @uref{ftp://ftp.gnu.org/pub/gnu/texinfo/texinfo-3.12.tar.gz}
679 and all mirrors of @samp{ftp.gnu.org} (@pxref{Current GNU distributions} for a list).
681 For information about the Texinfo format, read the Texinfo manual which
682 comes with Emacs.  This manual also comes installed in Info format, so
683 you can read it on-line.
685 Neither @code{texinfo-format-buffer} nor @file{makeinfo} installs the
686 resulting Info files in Emacs's Info tree.  To install Info files:
688 @enumerate
690 @item Move the files to the @file{info} directory in the installed Emacs
691  distribution.  @xref{Filename conventions}, if you don't know where that is.
693 @item Edit the file @file{info/dir} in the installed Emacs distribution,
694  and add a line for the top level node in the Info package that you are
695  installing.  Follow the examples already in this file.  The format is:
697 @example
698 * Topic: (relative-pathname).  Short description of topic.
699 @end example
701 @end enumerate 
703 If you want to install Info files and you don't have the necessary
704 privileges, you have several options:
706 @itemize @bullet
708 @item
709 Info files don't actually need to be installed before being used.  You
710 can feed a file name to the @code{Info-goto-node} command (invoked by
711 pressing @key{g} in Info mode) by typing the name of the file in
712 parentheses.  This goes to the node named "Top" in that file.  For
713 example, to view a Info file named "XXX" in your home directory, you can
714 type this:
716 @lisp
717 C-h i g (~/XXX) @key{RET}
718 @end lisp
720 @item
721 You can create your own Info directory.  You can tell Emacs where the
722 Info directory is by adding its pathname to the value of the variable
723 @code{Info-default-directory-list}.  For example, to use a private Info
724 directory which is a subdirectory of your home directory named "Info",
725 you could put this in your @file{.emacs} file:
727 @lisp
728 (setq Info-default-directory-list
729       (cons "~/Info" Info-default-directory-list))
730 @end lisp
732 You will need a top-level Info file named @file{dir} in this directory
733 which has everything the system dir file has in it, except it should
734 list only entries for Info files in that directory.  You might not need
735 it if all files in this directory were referenced by other @file{dir}
736 files.  The node lists from all @file{dir} files in
737 @code{Info-default-directory-list} are merged by the Info system.
739 @end itemize
741 @node Printing a Texinfo file, Viewing Info files outside of Emacs, Installing Texinfo documentation, Getting help
742 @section How do I print a Texinfo file?
743 @cindex Printing a Texinfo file
744 @cindex Texinfo file, printing
746 You can't get nicely printed output from Info files; you must still have
747 the original Texinfo source file for the manual you want to print.
749 Assuming you have @TeX{} installed on your system, follow these steps:
751 @enumerate
753 @item Make sure the first line of the Texinfo file looks like this:
755 @example
756 \input texinfo
757 @end example
759  You may need to change @samp{texinfo} to the full pathname of the
760  texinfo.tex file, which comes with Emacs as @samp{man/texinfo.tex} (or
761  copy or link it into the current directory).
763 @item @code{tex XXX.texinfo}
765 @item @code{texindex XXX.??}
767  The @samp{texindex} program comes with Emacs as @file{man/texindex.c}.
769 @item @code{tex XXX.texinfo}
771 @item Print the DVI file @file{XXX.dvi} in the normal way for printing DVI files at your site.
773 @end enumerate
775 To get more general instructions, retrieve the latest Texinfo package
776 (@pxref{Installing Texinfo documentation}).
778 @node Viewing Info files outside of Emacs, Informational files for Emacs, Printing a Texinfo file, Getting help
779 @section Can I view Info files without using Emacs?
780 @cindex Viewing Info files
781 @cindex Info file viewers
782 @cindex Alternative Info file viewers
784 Yes.  Here are some alternative programs:
786 @itemize @bullet
788 @item Info, a stand-alone version of the Info program, comes as part of the
789 Texinfo package.  @xref{Installing Texinfo documentation}, for details.
791 @item Xinfo, a stand-alone version of the Info program that runs under X
792 Windows.  You can get it at
793 @uref{ftp://ftp.gnu.org/pub/gnu/xinfo/xinfo-1.01.01.tar.gz} and all
794 mirrors of @samp{ftp.gnu.org} (@pxref{Current GNU distributions}  for a list).
796 @item Tkinfo, an Info viewer that runs under X Windows and uses Tcl/Tk.  You
797 can get Tkinfo at @uref{http://math-www.uni-paderborn.de/~axel/tkinfo/}.
799 @end itemize
801 @node Informational files for Emacs, Help installing Emacs, Viewing Info files outside of Emacs, Getting help
802 @section What informational files are available for Emacs?
803 @cindex Informational files included with Emacs
804 @cindex Files included with Emacs
805 @cindex @file{COPYING}, description of file
806 @cindex @file{DISTRIB}, description of file
807 @cindex @file{FAQ}, description of file
808 @cindex @file{FTP}, description of file
809 @cindex @file{GNU}, description of file
810 @cindex @file{INTERVIEW}, description of file
811 @cindex @file{LPF}, description of file
812 @cindex @file{MACHINES}, description of file
813 @cindex @file{MAILINGLISTS}, description of file
814 @cindex @file{NEWS}, description of file
815 @cindex @file{SERVICE}, description of file
816 @cindex @file{SUN-SUPPORT}, description of file
818 This isn't a frequently asked question, but it should be!  A variety of
819 informational files about Emacs and relevant aspects of the GNU project
820 are available for you to read.
822 The following files are available in the @file{etc} directory of the
823 Emacs distribution (@pxref{Filename conventions}  if you're not sure where that is).
825 @table @file
827 @item COPYING
828 Emacs General Public License
830 @item DISTRIB
831 Emacs Availability Information, including the popular "Free Software
832 Foundation Order Form"
834 @item FAQ
835 Emacs Frequently Asked Questions (You're reading it)
837 @item FTP
838 How to get GNU Software by Internet FTP or by UUCP
840 @item GNU
841 The GNU Manifesto
843 @item INTERVIEW
844 Richard Stallman discusses his public-domain UNIX-compatible software
845 system with BYTE editors
847 @item LPF
848 Why you should join the League for Programming Freedom
850 @item MACHINES
851 Status of Emacs on Various Machines and Systems
853 @item MAILINGLISTS
854 GNU Project Electronic Mailing Lists
856 @item NEWS
857 Emacs news, a history of user-visible changes
859 @item SERVICE
860 GNU Service Directory
862 @item SUN-SUPPORT
863 including "Using Emacstool with GNU Emacs"
865 @end table
867 Latest versions of the above files also available at
869 @uref{ftp://ftp.gnu.org/pub/gnu/GNUinfo/}
871 More GNU information, including back issues of the "GNU's Bulletin", are
874 @uref{http://www.gnu.org/bulletins/bulletins.html} and
876 @uref{http://www.cs.pdx.edu/~trent/gnu/gnu.html}
878 @node Help installing Emacs, Obtaining the FAQ, Informational files for Emacs, Getting help
879 @section Where can I get help in installing Emacs?
880 @cindex Installation help
881 @cindex Help installing Emacs
883 @xref{Installing Emacs}, for some basic installation hints, and question
884 83 if you have problems with the installation.
886 The file @file{etc/SERVICE} (@pxref{Filename conventions} if you're not
887 sure where that is) lists companies and individuals willing to sell you
888 help in installing or using Emacs.  An up-to-date version this file is
889 available on @samp{ftp.gnu.org} (@pxref{Informational files for Emacs}).
891 @node Obtaining the FAQ,  , Help installing Emacs, Getting help
892 @section Where can I get the latest version of this FAQ?
893 @cindex FAQ, obtaining the
894 @cindex Latest FAQ version, obtaining the
895 @cindex Retrieving the latest FAQ version
896 @cindex E-mail, retrieving the FAQ via
897 @cindex Web, reading the FAQ on the
899 The Emacs FAQ is available in several ways:
901 @itemize @bullet
903 @item
904 Inside of Emacs itself.  You can get it from selecting the "Emacs FAQ"
905 option from the "Help" menu at the top of any Emacs frame, or by typing
906 @kbd{C-h F} (@kbd{M-x view-emacs-FAQ}).
908 @item
909 Via USENET.  If you can read news, the FAQ should be available in your
910 news spool, in both the @uref{news:gnu.emacs.help} and
911 @uref{news:comp.emacs} newsgroups.  Every news reader should allow you
912 to read any news article that is still in the news spool, even if you
913 have read the article before.  You may need to read the instructions for
914 your news reader to discover how to do this.  In @file{rn}, this command
915 will do this for you at the article selection level:
917 @example
918 ?GNU Emacs Frequently Asked Questions?rc:m
919 @end example
921 In Gnus, you should type @kbd{C-u C-x C-s} from the @file{*Summary*}
922 buffer or @kbd{C-u @key{SPC}} from the @file{*Newsgroup*} buffer to view
923 all articles in a newsgroup.
925 If the FAQ articles have expired and been deleted from your news spool,
926 it might (or might not) do some good to complain to your news
927 administrator, because the most recent FAQ should not expire for a
928 while.
930 @item Via HTTP or FTP.  You can always fetch the latest FAQ from
932 @uref{http://www.lerner.co.il/emacs/} and
934 @uref{ftp://ftp.lerner.co.il/pub/emacs/}
936 @item
937 In the Emacs distribution.  Since Emacs 18.56, the FAQ at the time
938 of release has been part of the Emacs distribution as @file{etc/FAQ}
939 (@pxref{Filename conventions}).
941 @item
942 Via the World Wide Web.  A hypertext version is available at
944 @uref{http://www.lerner.co.il/emacs/}
946 @item
947 Via anonymous ftp and e-mail from @file{rtfm.mit.edu} (and its mirror in
948 Europe), the main repository for FAQs and other items posted to
949 news.answers.  The Emacs FAQs are available at
951 @uref{ftp://rtfm.mit.edu/pub/usenet/comp.emacs/} and
953 @uref{ftp://ftp.uni-paderborn.de/pub/doc/FAQ/comp/emacs/}
955 If you do not have access to anonymous FTP, you can access the archives
956 using the @file{rtfm.mit.edu} mail server.  The Emacs FAQ can be
957 retrieved by sending mail to @email{mail-server@@rtfm.mit.edu} with a
958 blank subject and containing
960 @example
961 send usenet/news.answers/GNU-Emacs-FAQ/diffs
962 send usenet/news.answers/GNU-Emacs-FAQ/part1
963 send usenet/news.answers/GNU-Emacs-FAQ/part2
964 send usenet/news.answers/GNU-Emacs-FAQ/part3
965 send usenet/news.answers/GNU-Emacs-FAQ/part4
966 send usenet/news.answers/GNU-Emacs-FAQ/part5
967 @end example
969 For more information, send email to @email{mail-server@@rtfm.mit.edu}
970 with "help" and "index" in the body on separate lines.
972 @item
973 As the very last resort, you can e-mail a request to
974 @email{emacs-faq@@lerner.co.il}.  Don't do this unless you have made a
975 serious effort to obtain the FAQ list via one of the methods listed
976 above.
978 @end itemize
980 @c ------------------------------------------------------------
981 @node    Status of Emacs, Common requests, Getting help, Top
982 @chapter Status of Emacs
983 @cindex Status of Emacs
985 This section gives you basic information about Emacs, including its
986 latest version status.
988 @menu
989 * Origin of the term Emacs::    
990 * Latest version of Emacs::     
991 * New in Emacs 20::             
992 @end menu
994 @node Origin of the term Emacs, Latest version of Emacs, Status of Emacs, Status of Emacs
995 @section Where does the name "Emacs" come from?
996 @cindex Origin of the term "Emacs"
997 @cindex Emacs name origin
998 @cindex TECO
999 @cindex Original version of Emacs
1001 Emacs originally was an acronym for Editor MACroS.  RMS says he "picked
1002 the name Emacs because @key{E} was not in use as an abbreviation on ITS at
1003 the time."  The first Emacs was a set of macros written in 1976 at MIT
1004 by RMS for the editor TECO (Text Editor and COrrector, originally Tape
1005 Editor and COrrector) under ITS on a PDP-10.  RMS had already extended
1006 TECO with a "real-time" full screen mode with reprogrammable keys.
1007 Emacs was started by @email{gls@@east.sun.com, Guy Steele} as a project
1008 to unify the many divergent TECO command sets and key bindings at MIT,
1009 and completed by RMS.
1011 Many people have said that TECO code looks a lot like line noise; you
1012 can read more at @uref{news:alt.lang.teco}.  Someone has written a TECO
1013 implementation in Emacs Lisp (to find it, @ref{Packages that do not come
1014 with Emacs}); it would be an interesting project to run the original
1015 TECO Emacs inside of Emacs.
1017 For some not-so-serious alternative reasons for Emacs to have that
1018 name, check out @file{etc/JOKES} (@pxref{Filename conventions}).
1020 @node Latest version of Emacs, New in Emacs 20, Origin of the term Emacs, Status of Emacs
1021 @section What is the latest version of Emacs?
1022 @cindex Version, latest
1023 @cindex Latest version
1025 Emacs 20.5 is the current version as of this writing.
1027 @node New in Emacs 20,  , Latest version of Emacs, Status of Emacs
1028 @section What is different about Emacs 20?
1029 @cindex Differences between Emacs 19 and Emacs 20
1030 @cindex Emacs 20, new features in
1031 @cindex Recently introduced features
1033 To find out what has changed in recent versions, type @kbd{C-h n}
1034 (@kbd{M-x view-emacs-news}).  The oldest changes are at the bottom of
1035 the file, so you might want to read it starting there, rather than at
1036 the top.
1038 The differences between Emacs versions 18 and 19 was rather dramatic;
1039 the introduction of frames, faces, and colors on windowing systems was
1040 obvious to even the most casual user.
1042 There are differences between Emacs versions 19 and 20 as well, but many
1043 are more subtle or harder to find.  Among the changes are the inclusion
1044 of MULE code for languages that use non-Latin characters, the "customize"
1045 facility for modifying variables without having to use Lisp, and
1046 automatic conversion of files from Macintosh, Microsoft, and Unix
1047 platforms.
1049 A number of older Lisp packages, such as Gnus, Supercite and the
1050 calendar/diary, have been updated and enhanced to work with Emacs 20,
1051 and are now included with the standard distribution.
1054 @c ------------------------------------------------------------
1055 @node    Common requests, Bugs and problems, Status of Emacs, Top
1056 @chapter Common requests
1057 @cindex Common requests
1059 @menu
1060 * Setting up a customization file::  
1061 * Debugging a customization file::  
1062 * Displaying the current line or column::  
1063 * Displaying the current filename in the titlebar::  
1064 * Turning on abbrevs by default::  
1065 * Turning on auto-fill by default::  
1066 * Associating modes with files::  
1067 * Working with unprintable characters::  
1068 * Highlighting a region::       
1069 * Controlling case sensitivity::  
1070 * Wrapping words automatically::  
1071 * Spell-checkers::              
1072 * Checking TeX and *roff documents::  
1073 * Changing load-path::          
1074 * Using an already running Emacs process::  
1075 * Compiler error messages::     
1076 * Indenting switch statements::  
1077 * Horizontal scrolling::        
1078 * Overwrite mode::              
1079 * Turning off beeping::         
1080 * Turning the volume down::     
1081 * Automatic indentation::       
1082 * Matching parentheses::        
1083 * Hiding #ifdef lines::         
1084 * Repeating commands::          
1085 * Valid X resources::           
1086 * Evaluating Emacs Lisp code::  
1087 * Changing the length of a Tab::  
1088 * Inserting > at the beginning of each line::  
1089 * Underlining paragraphs::      
1090 * Repeating a command as many times as possible::  
1091 * Forcing the cursor to remain in the same column::  
1092 * Forcing Emacs to iconify itself::  
1093 * Using regular expressions::   
1094 * Replacing text across multiple files::  
1095 * Documentation for etags::     
1096 * Disabling backups::           
1097 * Disabling auto-save-mode::    
1098 * Modifying pull-down menus::   
1099 * Deleting menus and menu options::  
1100 * Turning on syntax highlighting::  
1101 * Scrolling only one line::     
1102 * Replacing highlighted text::  
1103 * Editing MS-DOS files::        
1104 * Filling paragraphs with a single space::  
1105 @end menu
1107 @node Setting up a customization file, Debugging a customization file, Common requests, Common requests
1108 @section How do I set up a @file{.emacs} file properly?
1109 @cindex @file{.emacs} file, setting up
1110 @cindex Init file, setting up
1111 @cindex Customization file, setting up
1113 @inforef{Init File, Init File, emacs}
1115 In general, new Emacs users should not have @file{.emacs} files, because
1116 it causes confusing non-standard behavior.  Then they send questions to
1117 @email{help-gnu-emacs@@gnu.org} asking why Emacs isn't behaving as
1118 documented.
1120 Emacs 20 includes the new @code{customize} facility, which can be
1121 invoked using @kbd{M-x customize @key{RET}}.  This allows users who are
1122 unfamiliar with Emacs Lisp to modify their @file{.emacs} files in a
1123 relatively straightforward way, using menus rather than Lisp code.  Not
1124 all packages support Customize as of this writing, but the number is
1125 growing fairly steadily.
1127 While @code{customize} might indeed make it easier to configure Emacs,
1128 consider taking a bit of time to learn Emacs Lisp and modifying your
1129 @file{.emacs} directly. Simple configuration options are described
1130 rather completely in @inforef{Init File, Init File, emacs}, for users
1131 interested in performing frequently requested, basic tasks.
1133 @node Debugging a customization file, Displaying the current line or column, Setting up a customization file, Common requests
1134 @section How do I debug a @file{.emacs} file?
1135 @cindex Debugging @file{.emacs} file
1136 @cindex @file{.emacs} debugging
1137 @cindex Init file debugging
1138 @cindex @samp{-debug-init}
1140 Start Emacs with the @samp{-debug-init} command-line option.  This
1141 enables the Emacs Lisp debugger before evaluating your @file{.emacs}
1142 file, and places you in the debugger if something goes wrong.  The top
1143 line in the @file{trace-back} buffer will be the error message, and the
1144 second or third line of that buffer will display the Lisp code from your
1145 @file{.emacs} file that caused the problem.
1147 You can also evaluate an individual function or argument to a function
1148 in your @file{.emacs} file by moving the cursor to the end of the
1149 function or argument and typing @kbd{C-x C-e} (@kbd{M-x
1150 eval-last-sexp}).
1152 Use @kbd{C-h v} (@kbd{M-x describe-variable}) to check the value of
1153 variables which you are trying to set or use.
1155 @node Displaying the current line or column, Displaying the current filename in the titlebar, Debugging a customization file, Common requests
1156 @section How do I make Emacs display the current line (or column) number?
1157 @cindex @code{line-number-mode}
1158 @cindex Displaying the current line or column
1159 @cindex Line number, displaying the current
1160 @cindex Column, displaying the current
1161 @cindex @code{mode-line-format}
1163 To have Emacs automatically display the current line number of the point
1164 in the mode line, do @kbd{M-x line-number-mode}.  You can also put the
1165 form
1167 @lisp
1168 (setq line-number-mode t)
1169 @end lisp
1171 in your @file{.emacs} file to achieve this whenever you start Emacs.
1172 Note that Emacs will not display the line number if the buffer is larger
1173 than the value of the variable @code{line-number-display-limit}.
1175 As of Emacs 20, you can similarly display the current column with
1176 @kbd{M-x column-number-mode}, or by putting the form
1178 @lisp
1179 (setq column-number-mode t) 
1180 @end lisp
1182 in your @file{.emacs} file.
1184 The "%c" format specifier in the variable @code{mode-line-format} will
1185 insert the current column's value into the mode line.  See the
1186 documentation for @code{mode-line-format} (using @kbd{C-h v
1187 mode-line-format @key{RET}}) for more information on how to set and use
1188 this variable.
1190 Users of all Emacs versions can display the current column using
1191 @email{abraham@@iesd.auc.dk, Per Abrahamsen's} "column" package.
1192 @xref{Packages that do not come with Emacs}, for instructions on how to
1193 get it.
1195 None of the vi emulation modes provide the "set number" capability of vi
1196 (as far as we know).
1198 @node Displaying the current filename in the titlebar, Turning on abbrevs by default, Displaying the current line or column, Common requests
1199 @section How can I modify the titlebar to contain the current filename?
1200 @cindex Titlebar, displaying the current filename in
1201 @cindex Filename, displaying in the titlebar
1202 @cindex @code{frame-title-format}
1204 The contains of an Emacs frame's titlebar is controlled by the variable
1205 @code{frame-title-format}, which has the same structure as the variable
1206 @code{mode-line-format}.  (Use @kbd{C-h v} or @kbd{M-x
1207 describe-variable} to get information about one or both of these
1208 variables.)
1210 By default, the titlebar for a frame does contain the name of the buffer
1211 currently being visited, except if there is a single frame.  In such a
1212 case, the titlebar contains the name of the user and the machine at
1213 which Emacs was invoked.  This is done by setting
1214 @code{frame-title-format} to the default value of
1216 @lisp
1217 (multiple-frames "%b" ("" invocation-name "@@" system-name))
1218 @end lisp
1220 To modify the behavior such that frame titlebars contain the buffer's
1221 name regardless of the number of existing frames, include the following
1222 in your @file{.emacs}:
1224 @lisp
1225 (setq frame-title-format "%b")
1226 @end lisp
1228 @node Turning on abbrevs by default, Turning on auto-fill by default, Displaying the current filename in the titlebar, Common requests
1229 @section How do I turn on abbrevs by default just in mode XXX?
1230 @cindex Abbrevs, turning on by default
1232 Put this in your @file{.emacs} file:
1234 @lisp
1235 (condition-case ()
1236    (quietly-read-abbrev-file)
1237   (file-error nil))
1239 (add-hook 'XXX-mode-hook
1240           (function
1241             (lambda ()
1242              (setq abbrev-mode t))))
1243 @end lisp
1245 @node Turning on auto-fill by default, Associating modes with files, Turning on abbrevs by default, Common requests
1246 @section How do I turn on @code{auto-fill-mode} by default?
1247 @cindex @code{auto-fill-mode}, activating automatically
1248 @cindex Filling automatically
1249 @cindex Automatic entry to @code{auto-fill-mode}
1251 To turn on @code{auto-fill-mode} just once for one buffer, use @kbd{M-x
1252 auto-fill-mode}.
1254 To turn it on for every buffer in a certain mode, you must use the hook
1255 for that mode.  For example, to turn on @code{auto-fill} mode for all
1256 text buffers, including the following in your @file{.emacs} file:
1258 @lisp
1259 (add-hook 'text-mode-hook 'turn-on-auto-fill)
1260 @end lisp
1262 If you want @code{auto-fill} mode on in all major modes, do this:
1264 @lisp
1265 (setq-default auto-fill-function 'do-auto-fill)
1266 @end lisp
1268 @node Associating modes with files, Working with unprintable characters, Turning on auto-fill by default, Common requests
1269 @section How do I make Emacs use a certain major mode for certain files?
1270 @cindex Associating modes with files
1271 @cindex File extensions and modes
1272 @cindex @code{auto-mode-alist}, modifying
1273 @cindex Modes, associating with file extensions
1275 If you want to use XXX mode for all files which end with the extension
1276 @samp{.YYY}, this will do it for you:
1278 @lisp
1279 (setq auto-mode-alist (cons '("\\.YYY\\'" . XXX-mode) auto-mode-alist))
1280 @end lisp
1282 Otherwise put this somewhere in the first line of any file you want to
1283 edit in XXX mode (in the second line, if the first line begins with
1284 @samp{#!}):
1286 @example
1287 -*-XXX-*-
1288 @end example
1290 Beginning with Emacs 19, the variable @code{interpreter-mode-alist}
1291 specifies which mode to use when loading a shell script.  (Emacs
1292 determines which interpreter you're using by examining the first line of
1293 the file.)  This feature only applies when the file name doesn't
1294 indicate which mode to use.  Use @kbd{C-h v} (or @kbd{M-x
1295 describe-variable}) on @code{interpreter-mode-alist} to learn more.
1297 @node Working with unprintable characters, Highlighting a region, Associating modes with files, Common requests
1298 @section How do I search for, delete, or replace unprintable (eight-bit or control) characters?
1299 @cindex Unprintable characters, working with
1300 @cindex Working with unprintable characters
1301 @cindex Control characters, working with
1302 @cindex Eight-bit characters, working with
1303 @cindex Searching for unprintable characters
1304 @cindex Regexps and unprintable characters
1306 To search for a single character that appears in the buffer as, for
1307 example, @samp{\237}, you can type @kbd{C-s C-q 2 3 7}.  (This assumes
1308 the value of @code{search-quote-char} is 17 (i.e., @kbd{C-q}).)
1309 Searching for ALL unprintable characters is best done with a regular
1310 expression ("regexp") search.  The easiest regexp to use for the
1311 unprintable chars is the complement of the regexp for the printable
1312 chars.
1314 @itemize @bullet
1316 @item
1317 Regexp for the printable chars: @samp{[\t\n\r\f -~]}
1319 @item
1320 Regexp for the unprintable chars: @samp{[^\t\n\r\f -~]}
1322 @end itemize
1324 To type these special characters in an interactive argument to
1325 @code{isearch-forward-regexp} or @code{re-search-forward}, you need to
1326 use @kbd{C-q}.  (@samp{\t}, @samp{\n}, @samp{\r}, and @samp{\f} stand
1327 respectively for @key{TAB}, @key{LFD}, @key{RET}, and @kbd{C-l}.)  So,
1328 to search for unprintable characters using @code{re-search-forward}:
1330 @kbd{M-x re-search-forward @key{RET} [^ @key{TAB} C-q @key{LFD} C-q @key{RET} C-q C-l @key{SPC} -~] @key{RET}}
1332 Using @code{isearch-forward-regexp}:
1334 @kbd{M-C-s [^ @key{TAB} @key{RET} C-q @key{RET} C-q C-l @key{SPC} -~]}
1336 To delete all unprintable characters, simply use replace-regexp:
1338 @kbd{M-x replace-regexp @key{RET} [^ @key{TAB} C-q @key{LFD} C-q @key{RET} C-q C-l @key{SPC} -~] @key{RET} @key{RET}}
1340 Replacing is similar to the above.  To replace all unprintable
1341 characters with a colon, use:
1343 M-x replace-regexp @key{RET} [^ @key{TAB} C-q @key{LFD} C-q @key{RET} C-q C-l @key{SPC} -~] @key{RET} : @key{RET}
1345 @itemize @bullet
1347 @item You don't need to quote @key{TAB} with either isearch or typing
1348 something in the minibuffer.
1350 @end itemize
1352 @node Highlighting a region, Controlling case sensitivity, Working with unprintable characters, Common requests
1353 @section How can I highlight a region of text in Emacs?
1354 @cindex Highlighting text
1355 @cindex Text, highlighting
1356 @cindex @code{transient-mark-mode}
1357 @cindex Region, highlighting a
1359 If you are using a windowing system such as X, you can cause the region
1360 to be highlighted when the mark is active by including
1362 @lisp
1363 (transient-mark-mode t)
1364 @end lisp
1366 in your @file{.emacs} file.  (Also see @xref{Turning on syntax highlighting}.)
1368 @node Controlling case sensitivity, Wrapping words automatically, Highlighting a region, Common requests
1369 @section How do I control Emacs's case-sensitivity when searching/replacing?
1370 @cindex @code{case-fold-search}
1371 @cindex Case sensitivity of searches
1372 @cindex @code{case-replace}
1373 @cindex Searching without case sensitivity
1374 @cindex Ignoring case in searches
1376 For searching, the value of the variable @code{case-fold-search}
1377 determines whether they are case sensitive:
1379 @lisp
1380 (setq case-fold-search nil) ; make searches case sensitive
1381 (setq case-fold-search t)   ; make searches case insensitive
1382 @end lisp
1384 Similarly, for replacing the variable @code{case-replace} determines
1385 whether replacements preserve case.
1387 To change the case sensitivity just for one major mode, use the major
1388 mode's hook.  For example:
1390 @lisp
1391 (add-hook 'XXX-mode-hook
1392       (function
1393        (lambda ()
1394          (setq case-fold-search nil))))
1395 @end lisp
1397 @node Wrapping words automatically, Spell-checkers, Controlling case sensitivity, Common requests
1398 @section How do I make Emacs wrap words for me?
1399 @cindex Wrapping word automatically
1400 @cindex @code{auto-fill-mode}, introduction to
1401 @cindex Maximum line width, default value
1402 @cindex @code{fill-column}, default value
1404 Use @code{auto-fill-mode}, activated by typing @kbd{M-x auto-fill-mode}.
1405 The default maximum line width is 70, determined by the variable
1406 @code{fill-column}.  To learn how to turn this on automatically, @pxref{Turning on auto-fill by default}.
1408 @node Spell-checkers, Checking TeX and *roff documents, Wrapping words automatically, Common requests
1409 @section Where can I get a better spelling checker for Emacs?
1410 @cindex Checking spelling
1411 @cindex Spelling, checking text documents
1413 Use Ispell.  @xref{Ispell}.
1415 @node Checking TeX and *roff documents, Changing load-path, Spell-checkers, Common requests
1416 @section How can I spell-check @TeX{} or *roff documents?
1417 @cindex Spelling, checking @TeX{} documents
1418 @cindex @TeX{} documents, checking spelling in
1420 Use Ispell.  Ispell can handle @TeX{} and *roff documents.
1421 @xref{Ispell}.
1423 @node Changing load-path, Using an already running Emacs process, Checking TeX and *roff documents, Common requests
1424 @section How do I change @code{load-path}?
1425 @cindex @code{load-path}, modifying
1426 @cindex Modifying @code{load-path}
1427 @cindex Adding to @code{load-path}
1429 In general, you should only add to the @code{load-path}.  You can add
1430 directory @var{/XXX/YYY} to the load path like this:
1432 @lisp
1433 (setq load-path (cons "/XXX/YYY/" load-path))
1434 @end lisp
1436 To do this relative to your home directory:
1438 @lisp
1439 (setq load-path (cons "~/YYY/" load-path)
1440 @end lisp
1442 @node Using an already running Emacs process, Compiler error messages, Changing load-path, Common requests
1443 @section How do I use an already running Emacs from another window?
1444 @cindex @code{emacsclient}
1445 @cindex Emacs server functions
1446 @cindex Using an existing Emacs process
1448 @code{emacsclient}, which comes with Emacs, is for editing a file using
1449 an already running Emacs rather than starting up a new Emacs.  It does
1450 this by sending a request to the already running Emacs, which must be
1451 expecting the request.
1453 @itemize @bullet
1455 @item
1456 Setup
1458 Emacs must have executed the @code{server-start} function for
1459 @samp{emacsclient} to work.  This can be done either by a command line
1460 option:
1462 @example
1463 emacs -f server-start
1464 @end example
1466 or by invoking @code{server-start} from @file{.emacs}:
1468 @lisp
1469 (if (some conditions are met) (server-start))
1470 @end lisp
1472 When this is done, Emacs starts a subprocess running a program called
1473 @samp{server}.  @samp{server} creates a Unix domain socket.  The socket
1474 is either named @file{.emacs_server}, in the user's home directory,
1475 or @file{esrv-@var{USER-ID}-@var{SYSTEM-NAME}}, in the @file{/tmp}
1476 directory, depending on how @samp{emacsserver} was compiled.
1478 To get your news reader, mail reader, etc., to invoke
1479 @samp{emacsclient}, try setting the environment variable @code{EDITOR}
1480 (or sometimes @code{VISUAL}) to the value @samp{emacsclient}.  You may
1481 have to specify the full pathname of the @samp{emacsclient} program
1482 instead.  Examples:
1484 @example
1485 # csh commands:
1486 setenv EDITOR emacsclient
1488 # using full pathname
1489 setenv EDITOR /usr/local/emacs/etc/emacsclient  
1491 # sh command:
1492 EDITOR=emacsclient ; export EDITOR
1493 @end example
1495 @item Normal use
1497 When @samp{emacsclient} is run, it connects to the @file{.emacs_server}
1498 socket and passes its command line options to @samp{server}.  When
1499 @samp{server} receives these requests, it sends this information on the
1500 the Emacs process, which at the next opportunity will visit the files
1501 specified.  (Line numbers can be specified just like with Emacs.)  The
1502 user will have to switch to the Emacs window by hand.  When the user is
1503 done editing a file, the user can type @kbd{C-x #} (or @kbd{M-x
1504 server-edit}) to indicate this.  If there is another buffer requested by
1505 emacsclient, Emacs will switch to it; otherwise emacsclient will exit,
1506 signaling the calling program to continue.
1508 @samp{emacsclient} and @samp{server} must be running on machines which
1509 share the same filesystem for this to work.  The pathnames that
1510 @samp{emacsclient} specifies should be correct for the filesystem that
1511 the Emacs process sees.  The Emacs process should not be suspended at
1512 the time @samp{emacsclient} is invoked.  @samp{emacsclient} should
1513 either be invoked from another X window or from a shell window inside
1514 Emacs itself.
1516 There is an enhanced version of @samp{emacsclient}/server called
1517 @samp{gnuserv} by @email{ange@@hplb.hpl.hp.com, Andy Norman} which is
1518 available in the Emacs Lisp Archive (@pxref{Packages that do not come
1519 with Emacs}).  @samp{gnuserv} uses Internet domain sockets, so it can
1520 work across most network connections.  It also supports the execution of
1521 arbitrary Emacs Lisp forms and does not require the client program to
1522 wait for completion.
1524 The alpha version of an enhanced @samp{gnuserv} is available
1527 @uref{ftp://ftp.wellfleet.com/netman/psmith/emacs/gnuserv-2.1alpha.tar.gz}
1529 @end itemize
1531 @node Compiler error messages, Indenting switch statements, Using an already running Emacs process, Common requests
1532 @section How do I make Emacs recognize my compiler's funny error messages?
1533 @cindex Compiler error messages, recognizing
1534 @cindex Recognizing non-standard compiler errors
1535 @cindex Regexps for recognizing compiler errors
1536 @cindex Errors, recognizing compiler
1538 The variable @code{compilation-error-regexp-alist} helps control how
1539 Emacs parses your compiler output.  It is a list of triples of the form:
1540 @code{(@var{regexp} @var{file-idx} @var{line-idx})}, where @var{regexp}, @var{file-idx} and
1541 @var{line-idx} are strings.  To help determine what the constituent
1542 elements should be, load @file{compile.el} and then use @kbd{C-h v
1543 compilation-error-regexp-alist @key{RET}}
1545 to see the current value.  A good idea is to look at @file{compile.el}
1546 itself as the comments included for this variable are quite useful ---
1547 the regular expressions required for your compiler's output may be very
1548 close to one already provided.  Once you have determined the proper
1549 regexps, use the following to inform Emacs of your changes:
1551 @lisp
1552 (setq compilation-error-regexp-alist
1553       (cons '(REGEXP FILE-IDX LINE-IDX)
1554          compilation-error-regexp-alist))
1555 @end lisp
1557 @node Indenting switch statements, Horizontal scrolling, Compiler error messages, Common requests
1558 @section How do I change the indentation for @code{switch}?
1559 @cindex @code{switch}, indenting
1560 @cindex Indenting of @code{switch}
1562 Many people want to indent their @code{switch} statements like this:
1564 @example
1567   switch(x) @{
1568     case A:
1569       x1;
1570       break;
1571     case B:
1572       x2;
1573       break;
1574     default:
1575       x3;
1576   @}
1578 @end example
1580 The solution at first appears to be: set @code{c-indent-level} to 4 and
1581 @code{c-label-offset} to -2.  However, this will give you an indentation
1582 spacing of four instead of two.
1584 The solution is to use @code{cc-mode} (the default mode for C
1585 programming in Emacs 20) and add the following line:
1587 @lisp
1588 (c-set-offset 'case-label '+)
1589 @end lisp
1591 There appears to be no way to do this with the old @code{c-mode}.
1593 @node Horizontal scrolling, Overwrite mode, Indenting switch statements, Common requests
1594 @section How can I make Emacs automatically scroll horizontally?
1595 @cindex @code{hscroll-mode}
1596 @cindex Horizontal scrolling
1597 @cindex Scrolling horizontally
1599 Use @code{hscroll-mode}, included in Emacs 20.  Here is some information from
1600 the documentation, available by typing @kbd{C-h f hscroll-mode @key{RET}}:
1602 Automatically scroll horizontally when the point moves off the
1603 left or right edge of the window.  
1605 @itemize @minus
1607 @item Type @kbd{M-x hscroll-mode} to enable it in the current buffer.
1608 @item Type @kbd{M-x hscroll-global-mode} to enable it in every buffer.
1609 @item @code{turn-on-hscroll} is useful in mode hooks as in:
1611 @lisp
1612 (add-hook 'text-mode-hook 'turn-on-hscroll)
1613 @end lisp
1615 @item @code{hscroll-margin} controls how close the cursor can get to the
1616 edge of the window. 
1618 @item @code{hscroll-step-percent} controls how far to jump once we decide to do so.
1620 @end itemize
1622 @node Overwrite mode, Turning off beeping, Horizontal scrolling, Common requests
1623 @section How do I make Emacs "typeover" or "overwrite" instead of inserting?
1624 @cindex @key{Insert}
1625 @cindex @code{overwrite-mode}
1626 @cindex Overwriting existing text
1627 @cindex Toggling @code{overwrite-mode}
1629 @kbd{M-x overwrite-mode} (a minor mode).  This toggles
1630 @code{overwrite-mode} on and off, so exiting from @code{overwrite-mode}
1631 is as easy as another @kbd{M-x overwrite-mode}.
1633 On some workstations, @key{Insert} toggles @code{overwrite-mode} on and off.
1635 @node Turning off beeping, Turning the volume down, Overwrite mode, Common requests
1636 @section How do I stop Emacs from beeping on a terminal?
1637 @cindex Beeping, turning off
1638 @cindex Visible bell
1639 @cindex Bell, visible
1641 @email{martin@@cc.gatech.edu, Martin R. Frank} writes:
1643 Tell Emacs to use the "visible bell" instead of the audible bell, and
1644 set the visible bell to nothing.
1646 That is, put the following in your @code{TERMCAP} environment variable
1647 (assuming you have one):
1649 @example
1650 ... :vb=: ...                    
1651 @end example
1653 And evaluate the following Lisp form:
1655 @example
1656 (setq visible-bell t)
1657 @end example
1659 @node Turning the volume down, Automatic indentation, Turning off beeping, Common requests
1660 @section How do I turn down the bell volume in Emacs running under X Windows?
1661 @cindex Bell, volume of
1662 @cindex Volume of bell
1664 You can adjust the bell volume and duration for all programs with the
1665 shell command @file{xset}.
1667 Invoking @file{xset} without any arguments produces some basic information,
1668 including the following:
1670 @example
1671 usage:  xset [-display host:dpy] option ...
1672   To turn bell off:
1673       -b                b off               b 0
1674   To set bell volume, pitch and duration:
1675        b [vol [pitch [dur]]]          b on
1676 @end example
1678 @node Automatic indentation, Matching parentheses, Turning the volume down, Common requests
1679 @section How do I tell Emacs to automatically indent a new line to the indentation of the previous line?
1680 @cindex Indenting new lines
1681 @cindex New lines, indenting of
1682 @cindex Previous line, indenting according to
1684 Such behavior is automatic in Emacs 20.  From the NEWS file for Emacs
1685 20.2:
1687 @example
1688 ** In Text mode, now only blank lines separate paragraphs.  This makes
1689 it possible to get the full benefit of Adaptive Fill mode in Text mode,
1690 and other modes derived from it (such as Mail mode).  @key{TAB} in Text
1691 mode now runs the command @code{indent-relative}; this makes a practical
1692 difference only when you use indented paragraphs.
1694 As a result, the old Indented Text mode is now identical to Text mode,
1695 and is an alias for it.
1697 If you want spaces at the beginning of a line to start a paragraph, use
1698 the new mode, Paragraph Indent Text mode.
1699 @end example
1701 If you have @code{auto-fill-mode} on (@pxref{Turning on auto-fill by
1702 default}), you can tell Emacs to prefix every line with a certain
1703 character sequence, the "fill prefix."  Type the prefix at the beginning
1704 of a line, position point after it, and then type @kbd{C-x .}
1705 (@code{set-fill-prefix}) to set the fill prefix.  Thereafter,
1706 auto-filling will automatically put the fill prefix at the beginning of
1707 new lines, and @kbd{M-q} (@code{fill-paragraph}) will maintain any fill
1708 prefix when refilling the paragraph.
1710 If you have paragraphs with different levels of indentation, you will
1711 have to set the fill prefix to the correct value each time you move to a
1712 new paragraph.  To avoid this hassle, try one of the many packages
1713 available from the Emacs Lisp Archive (@pxref{Packages that do not come
1714 with Emacs}.)  Look up "fill" and "indent" in the Lisp Code Directory
1715 for guidance.
1717 @node Matching parentheses, Hiding #ifdef lines, Automatic indentation, Common requests
1718 @section How do I show which parenthesis matches the one I'm looking at?
1719 @cindex Parentheses, matching
1720 @cindex @file{paren.el}
1721 @cindex Highlighting matching parentheses
1722 @cindex Pairs of parentheses, highlighting
1723 @cindex Matching parentheses
1725 As of version 19, Emacs comes with @file{paren.el}, which (when loaded)
1726 will automatically highlight matching parentheses whenever point (i.e.,
1727 the cursor) is located over one.  To load @file{paren.el} automatically,
1728 include the line
1730 @lisp
1731 (require 'paren)
1732 @end lisp
1734 in your @file{.emacs} file.  @email{shutkoa@@ugsolutions.com, Alan Shutko}
1735 reports that as of version 20.1, you must also call @code{show-paren-mode} in
1736 your @file{.emacs} file:
1738 @lisp
1739 (show-paren-mode 1)
1740 @end lisp
1742 @code{customize} will let you turn on @code{show-paren-mode}.  Use
1743 @kbd{M-x customize-group @key{RET} paren-showing @key{RET}}.  From
1744 within @code{customize}, you can also go directly to the "paren-showing"
1745 group.
1747   Alternatives to paren include:
1749 @itemize @bullet
1751 @item
1752 If you're looking at a right parenthesis (or brace or bracket) you can
1753 delete it and reinsert it.  Emacs will blink the cursor on the matching
1754 parenthesis.
1756 @item
1757 @kbd{M-C-f} (@code{forward-sexp}) and @kbd{M-C-b} (@code{backward-sexp})
1758 will skip over one set of balanced parentheses, so you can see which
1759 parentheses match.  (You can train it to skip over balanced brackets
1760 and braces at the same time by modifying the syntax @key{TAB}le.)
1762 @item
1763 Here is some Emacs Lisp that will make the @key{%} key show the matching
1764 parenthesis, like in vi.  In addition, if the cursor isn't over a
1765 parenthesis, it simply inserts a % like normal.
1767 @lisp
1768 ;; By an unknown contributor
1770 (global-set-key "%" 'match-paren)
1772 (defun match-paren (arg)
1773   "Go to the matching paren if on a paren; otherwise insert %."
1774   (interactive "p")
1775   (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
1776         ((looking-at "\\s\)") (forward-char 1) (backward-list 1))
1777         (t (self-insert-command (or arg 1)))))
1778 @end lisp
1780 @end itemize
1782 @node Hiding #ifdef lines, Repeating commands, Matching parentheses, Common requests
1783 @section In C mode, can I show just the lines that will be left after @code{#ifdef} commands are handled by the compiler?
1784 @cindex @code{#ifdef}, selective display of
1785 @cindex @code{hide-ifdef-mode}
1786 @cindex Hiding @code{#ifdef} text
1787 @cindex Selectively displaying @code{#ifdef} code
1789 @kbd{M-x hide-ifdef-mode}.  (This is a minor mode.)  You might also want
1790 to try @file{cpp.el}, available at the Emacs Lisp Archive
1791 (@pxref{Packages that do not come with Emacs}).
1793 @node Repeating commands, Valid X resources, Hiding #ifdef lines, Common requests
1794 @section Is there an equivalent to the @code{.} (dot) command of vi?
1795 @cindex Repeating commands as with vi
1796 @cindex Command, repeat last
1797 @cindex @code{.}, equivalent to vi command
1799 (@code{.} is the redo command in vi.  It redoes the last insertion/deletion.)
1801 As of Emacs 20.3, there is indeed a @code{repeat} command (@kbd{C-x .})
1802 that repeats the last command.  If you preface it with a prefix
1803 argument, the prefix arg is applied to the command.
1805 You can also type @kbd{C-x @key{ESC} @key{ESC}}
1806 (@code{repeat-complex-command}) to reinvoke commands that used the
1807 minibuffer to get arguments.  In @code{repeat-complex-command} you can
1808 type @kbd{M-p} and @kbd{M-n} to scan through all the different complex
1809 commands you've typed.
1811 To repeat a set of commands, use keyboard macros.  (@inforef{Keyboard
1812 Macros, Keyboard Macros, emacs}.)
1814 If you're really desperate for the @code{.} command, use VIPER, which comes
1815 with Emacs, and which appears to support it.  (@xref{VIPER}.)
1817 @node Valid X resources, Evaluating Emacs Lisp code, Repeating commands, Common requests
1818 @section What are the valid X resource settings (i.e., stuff in .Xdefaults)?
1819 @cindex Resources, X
1820 @cindex X resources
1821 @cindex Setting X resources
1823 @inforef{Resources X, Resources X, emacs}.
1825 You can also use a resource editor, such as editres (for X11R5 and
1826 onwards), to look at the resource names for the menu bar, assuming Emacs
1827 was compiled with the X toolkit.
1829 @node Evaluating Emacs Lisp code, Changing the length of a Tab, Valid X resources, Common requests
1830 @section How do I execute ("evaluate") a piece of Emacs Lisp code?
1831 @cindex Evaluating Lisp code
1832 @cindex Lisp forms, evaluating
1834 There are a number of ways to execute ("evaluate," in Lisp lingo) an
1835 Emacs Lisp "form":
1837 @itemize @bullet
1839 @item
1840 If you want it evaluated every time you run Emacs, put it in a file
1841 named @file{.emacs} in your home directory.  This is known as your ".emacs
1842 file," and contains all of your personal customizations.
1844 @item
1845 You can type the form in the @file{*scratch*} buffer, and then type
1846 @key{LFD} (or @kbd{C-j}) after it.  The result of evaluating the form
1847 will be inserted in the buffer.
1849 @item
1850 In @code{emacs-lisp-mode}, typing @kbd{M-C-x} evaluates a top-level form
1851 before or around point.
1853 @item
1854 Typing @kbd{C-x C-e} in any buffer evaluates the Lisp form immediately
1855 before point and prints its value in the echo area.
1857 @item
1858 Typing @kbd{M-:} or @kbd{M-x eval-expression} allows you to type a Lisp
1859 form in the minibuffer which will be evaluated.
1861 @item
1862 You can use @kbd{M-x load-file} to have Emacs evaluate all the Lisp
1863 forms in a file.  (To do this from Lisp use the function @code{load}
1864 instead.)
1866 The functions @code{load-library}, @code{eval-region},
1867 @code{eval-current-buffer}, @code{require}, and @code{autoload} are also
1868 useful; @pxref{Emacs Lisp documentation} if you want to learn more about
1869 them.
1871 @end itemize
1873 @node Changing the length of a Tab, Inserting > at the beginning of each line, Evaluating Emacs Lisp code, Common requests
1874 @section How do I change Emacs's idea of the @key{TAB} character's length?
1875 @cindex Tab length
1876 @cindex Length of tab character
1877 @cindex @code{default-tab-width} 
1879 Set the variable @code{default-tab-width}.  For example, to set
1880 @key{TAB} stops every 10 characters, insert the following in your
1881 @file{.emacs} file:
1883 @lisp
1884 (setq default-tab-width 10)
1885 @end lisp
1887 Do not confuse variable @code{tab-width} with variable
1888 @code{tab-stop-list}.  The former is used for the display of literal
1889 @key{TAB} characters.  The latter controls what characters are inserted
1890 when you press the @key{TAB} character in certain modes.
1892 @node Inserting > at the beginning of each line, Underlining paragraphs, Changing the length of a Tab, Common requests
1893 @section How do I insert @samp{>} at the beginning of every line?
1894 @cindex Prefix character, inserting in mail/news replies
1895 @cindex Replies to mail/news, inserting a prefix character
1896 @cindex @code{mail-yank-prefix}
1897 @cindex Mail replies, inserting a prefix character
1898 @cindex News replies, inserting a prefix character
1900 To do this to an entire buffer, type @kbd{M-< M-x replace-regexp
1901 @key{RET} ^ @key{RET} > @key{RET}}.
1903 To do this to a region, use @code{string-rectangle} (@kbd{C-x r t}).
1904 Set the mark (@kbd{C-@key{SPC}}) at the beginning of the first line you
1905 want to prefix, move the cursor to last line to be prefixed, and type
1906 @kbd{C-x r t > @key{RET}}.  To do this for the whole buffer, type
1907 @kbd{C-x h C-x r t > @key{RET}}.
1909 If you are trying to prefix a yanked mail message with @samp{>}, you
1910 might want to set the variable @code{mail-yank-prefix}.  Better yet, get
1911 the Supercite package (@pxref{Supercite}), which provides flexible
1912 citation for yanked mail and news messages.  @xref{Changing the included
1913 text prefix}, for additional information.
1915 @node Underlining paragraphs, Repeating a command as many times as possible, Inserting > at the beginning of each line, Common requests
1916 @section How do I insert "_^H" before each character in a region to get an underlined paragraph?
1917 @cindex Underlining a region of text
1918 @cindex @code{underline-region}
1920 @kbd{M-x underline-region}.
1922 @node Repeating a command as many times as possible, Forcing the cursor to remain in the same column, Underlining paragraphs, Common requests
1923 @section How do I repeat a command as many times as possible?
1924 @cindex Repeating commands
1925 @cindex Commands, repeating
1927 Use @kbd{C-x (} and @kbd{C-x )} to make a keyboard macro that invokes
1928 the command and then type @kbd{M-0 C-x e}.
1930 Any messages your command prints in the echo area will be suppressed.
1932 @node Forcing the cursor to remain in the same column, Forcing Emacs to iconify itself, Repeating a command as many times as possible, Common requests
1933 @section How do I make Emacs behave like this: when I go up or down, the cursor should stay in the same column even if the line is too short?
1934 @cindex @code{picture-mode}
1935 @cindex Remaining in the same column, regardless of contents
1936 @cindex Vertical movement in empty documents
1938 @kbd{M-x picture-mode}.
1940 @node Forcing Emacs to iconify itself, Using regular expressions, Forcing the cursor to remain in the same column, Common requests
1941 @section How do I tell Emacs to iconify itself?
1942 @cindex Iconification under X Windows
1943 @cindex X Windows and iconification
1944 @cindex Suspending Emacs
1946 @kbd{C-z} iconifies Emacs when running under X Windows and suspends Emacs
1947 otherwise.  @inforef{Misc X, Misc X, emacs}.
1949 @node Using regular expressions, Replacing text across multiple files, Forcing Emacs to iconify itself, Common requests
1950 @section How do I use regexps (regular expressions) in Emacs?
1951 @cindex Regexps
1952 @cindex Regular expressions
1953 @cindex Differences between Unix and Emacs regexps
1954 @cindex Unix regeps, differences from Emacs
1955 @cindex Text strings, putting regexps in
1957 @inforef{Regexps, Regexps, emacs}.
1959 The "or" operator is @samp{\|}, not @samp{|}, and the grouping operators
1960 are @samp{\(} and @samp{\)}.  Also, the string syntax for a backslash is
1961 @samp{\\}.  To specify a regular expression like @samp{xxx\(foo\|bar\)}
1962 in a Lisp string, use @samp{xxx\\(foo\\|bar\\)}.
1964 Notice the doubled backslashes!
1966 @itemize @bullet
1968 @item Unlike in Unix @file{grep}, @file{sed}, etc., a complement
1969 character set (@samp{[^...]})  can match a newline character (@key{LFD}
1970 aka @kbd{C-j} aka @samp{\n}), unless newline is mentioned as one of the
1971 characters not to match.
1973 @item The character syntax regexps (e.g., @samp{\sw}) are not
1974 meaningful inside character set regexps (e.g., @samp{[aeiou]}).  (This
1975 is actually typical for regexp syntax.)
1977 @end itemize
1979 @node Replacing text across multiple files, Documentation for etags, Using regular expressions, Common requests
1980 @section How do I perform a replace operation across more than one file?
1981 @cindex Replacing strings across files
1982 @cindex Multiple files, replacing across
1983 @cindex Files, replacing strings across multiple
1985 The "tags" feature of Emacs includes the command
1986 @code{tags-query-replace} which performs a query-replace across all the
1987 files mentioned in the TAGS file.  @inforef{Tags Search, Tags Search,
1988 emacs}.
1990 As of Emacs 19.29, Dired mode (@kbd{M-x dired @key{RET}}, or @kbd{C-x
1991 d}) supports the command @code{dired-do-query-replace}, which allows
1992 users to replace regular expressions in multiple files.
1994 @node Documentation for etags, Disabling backups, Replacing text across multiple files, Common requests
1995 @section Where is the documentation for @file{etags}?
1996 @cindex Documentation for @file{etags}
1997 @cindex @file{etags}, documentation for
1999 The @file{etags} man page should be in the same place as the
2000 @file{emacs} man page.
2002 Quick command-line switch descriptions are also available.  For example,
2003 @samp{etags -H}.
2005 @node Disabling backups, Disabling auto-save-mode, Documentation for etags, Common requests
2006 @section How do I disable backup files?
2007 @cindex Backups, disabling
2008 @cindex Disabling backups
2010 You probably don't want to do this, since backups are useful.
2012 To avoid seeing backup files (and other "uninteresting" files) in Dired,
2013 load dired-x by adding the following to your @file{.emacs} file:
2015 @lisp
2016 (add-hook 'dired-load-hook
2017           (function (lambda ()
2018                       (load "dired-x"))))
2019 @end lisp
2021 With dired-x loaded, @kbd{M-o} toggles omitting in each dired buffer.
2022 You can make omitting the default for new dired buffers by putting the
2023 following in your @file{.emacs}:
2025 @lisp
2026 (setq initial-dired-omit-files-p t)
2027 @end lisp
2029 If you're tired of seeing backup files whenever you do an "ls" at the
2030 Unix shell, try GNU ls with the "-B" option.  GNU ls is part of the GNU
2031 fileutils package, available at mirrors of @samp{ftp.gnu.org} (@pxref{Current GNU distributions} ).
2033 To disable or change how backups are made, see "Backup Names" in the
2034 on-line manual.
2036 @node Disabling auto-save-mode, Modifying pull-down menus, Disabling backups, Common requests
2037 @section How do I disable @code{auto-save-mode}?
2038 @cindex Disabling @code{auto-save-mode}
2039 @cindex Auto-saving
2040 @cindex Saving at frequent intervals
2042 You probably don't want to do this, since auto-saving is useful,
2043 especially when Emacs or your computer crashes while you are editing a
2044 document.
2046 Instead, you might want to change the variable
2047 @code{auto-save-interval}, which specifies how many keystrokes Emacs
2048 waits before auto-saving.  Increasing this value forces Emacs to wait
2049 longer between auto-saves, which might annoy you less.
2051 You might also want to look into Sebastian Kremer's @code{auto-save}
2052 package, available from the Lisp Code Archive (@pxref{Packages that do not come
2053 with Emacs}).  This
2054 package also allows you to place all auto-save files in one directory,
2055 such as @file{/tmp}.
2057 To disable or change how @code{auto-save-mode} works, see "Auto Save" in the
2058 on-line manual.
2060 @node Modifying pull-down menus, Deleting menus and menu options, Disabling auto-save-mode, Common requests
2061 @section How can I create or modify new pull-down menu options?
2062 @cindex Pull-down menus, creating or modifying
2063 @cindex Menus, creating or modifying
2064 @cindex Creating new menu options
2065 @cindex Modifying pull-down menus
2066 @cindex Menus and keymaps
2067 @cindex Keymaps and menus
2069 Each menu title (e.g., Buffers, File, Edit) represents a local or global
2070 keymap.  Selecting a menu title with the mouse displays that keymap's
2071 non-nil contents in the form of a menu.
2073 So to add a menu option to an existing menu, all you have to do is add a
2074 new definition to the appropriate keymap.  Adding a "forward word"
2075 command to the "Edit" menu thus requires the following Lisp code:
2077 @lisp
2078 (define-key global-map           
2079   [menu-bar edit forward]        
2080   '("Forward word" . forward-word))
2081 @end lisp
2083 The first line adds the entry to the global keymap, which includes
2084 global menu bar entries.  Replacing the reference to @code{global-map}
2085 with a local keymap would add this menu option only within a particular
2086 mode.
2088 The second line describes the path from the menu-bar to the new entry.
2089 Placing this menu entry underneath the "File" menu would mean changing
2090 the word "edit" in the second line to "file."
2092 The third line is a cons cell whose first element is the title that will
2093 be displayed, and whose second element is the function that will be
2094 called when that menu option is invoked.
2096 To add a new menu, rather than a new option to an existing menu, we must
2097 define an entirely new keymap:
2099 @lisp
2100 (define-key global-map [menu-bar words]
2101   (cons "Words" (make-sparse-keymap "Words")))
2102 @end lisp
2104 The above code creates a new sparse keymap, gives it the name "Words",
2105 and attaches it to the global menu bar.  Adding the "forward word"
2106 command to this new menu would thus require the following code:
2108 @lisp
2109 (define-key global-map
2110   [menu-bar words forward]
2111   '("Forward word" . forward-word))
2112 @end lisp
2114 Note that because of the way keymaps work, menu options are displayed
2115 with the more recently defined items at the top.  Thus if you were to
2116 define menu options "foo", "bar", and "baz" (in that order), menu option
2117 "baz" would appear at the top, and "foo" would be at the bottom.
2119 One way to avoid this problem is to use the function @code{define-key-after},
2120 which works the same as @code{define-key}, but lets you modify where items
2121 appear.  The following Lisp code would insert the "forward word" function
2122 in the "edit" menu immediately following the "undo" option:
2124 @lisp
2125 (define-key-after
2126   (lookup-key global-map [menu-bar edit])
2127   [forward]
2128   '("Forward word" . forward-word)
2129   'undo)
2130 @end lisp
2132 Note how the second and third arguments to @code{define-key-after} are
2133 different from those of @code{define-key}, and that we have added a new
2134 (final) argument, the function after which our new key should be
2135 defined.
2137 To move a menu option from one position to another, simply evaluate
2138 @code{define-key-after} with the appropriate final argument.
2140 More detailed information --- and more examples of how to create and
2141 modify menu options --- are in the Emacs Lisp Reference Manual, under
2142 "Keymaps".  (@pxref{Emacs Lisp documentation} for information on this
2143 manual.)
2145 @node Deleting menus and menu options, Turning on syntax highlighting, Modifying pull-down menus, Common requests
2146 @section How do I delete menus and menu options?
2147 @cindex Deleting menus and menu options
2148 @cindex Menus, deleting
2150 The simplest way to remove a menu is to set its keymap to @samp{nil}.
2151 For example, to delete the "Words" menu (@pxref{Modifying pull-down
2152 menus}), use:
2154 @lisp
2155 (define-key global-map [menu-bar words] nil)
2156 @end lisp
2158 Similarly, removing a menu option requires redefining a keymap entry to
2159 @code{nil}.  For example, to delete the "Forward word" menu option from the
2160 "Edit" menu (we added it in @ref{Modifying pull-down menus}), use:
2162 @lisp
2163 (define-key global-map [menu-bar edit forward] nil)
2164 @end lisp
2166 @node Turning on syntax highlighting, Scrolling only one line, Deleting menus and menu options, Common requests
2167 @section How do I turn on syntax highlighting?
2168 @cindex Syntax highlighting
2169 @cindex @code{font-lock-mode}
2170 @cindex Highlighting based on syntax
2171 @cindex Colorizing text
2172 @cindex FAQ, @code{font-lock-mode}
2174 @code{font-lock-mode} is the standard way to have Emacs perform syntax
2175 highlighting.  With @code{font-lock-mode} invoked, different types of
2176 text will appear in different colors.  For instance, if you turn on
2177 @code{font-lock-mode} in a programming mode, variables will appear in one
2178 face, keywords in a second, and comments in a third.
2180 Earlier versions of Emacs supported hilit19, a similar package.  Use of
2181 hilit19 is now considered non-standard, although @file{hilit19.el} comes
2182 with the stock Emacs distribution.  It is no longer maintained.
2184 To turn @code{font-lock-mode} on within an existing buffer, use @kbd{M-x
2185 font-lock-mode @key{RET}}.
2187 To automatically invoke @code{font-lock-mode} when a particular major
2188 mode is invoked, set the major mode's hook.  For example, to fontify all
2189 @code{c-mode} buffers, add the following to your @file{.emacs} file:
2191 @lisp
2192 (add-hook 'c-mode-hook 'turn-on-font-lock)
2193 @end lisp
2195 To automatically invoke @code{font-lock-mode} for all major modes, you
2196 can turn on @code{global-font-lock-mode} by including the following line
2197 in your @file{.emacs} file:
2199 @lisp
2200 (global-font-lock-mode 1)
2201 @end lisp
2203 This instructs Emacs to turn on font-lock mode in those buffers for
2204 which a font-lock mode definition has been provided (in the variable
2205 @code{font-lock-global-modes}).  If you edit a file in
2206 @code{pie-ala-mode}, and no font-lock definitions have been provided for
2207 @code{pie-ala} files, then the above setting will have no effect on that
2208 particular buffer.
2210 Highlighting with @code{font-lock-mode} can take quite a while, and thus
2211 different levels of decoration are available, from slight to gaudy.  To
2212 control how decorated your buffers should become, set the value of
2213 @code{font-lock-maximum-decoration} in your @file{.emacs} file, with a
2214 @code{nil} value indicating default (usually minimum) decoration, and a
2215 @code{t} value indicating the maximum decoration.  For the gaudiest
2216 possible look, then, include the line
2218 @lisp
2219 (setq font-lock-maximum-decoration t)
2220 @end lisp
2222 in your @file{.emacs} file.  You can also set this variable such that
2223 different modes are highlighted in a different ways; for more
2224 information, see the documentation for
2225 @code{font-lock-maximum-decoration} with @kbd{C-h v} (or @kbd{M-x
2226 describe-variable @key{RET}}).
2228 You might also want to investigate @code{fast-lock-mode} and
2229 @code{lazy-lock-mode}, versions of @code{font-lock-mode} that speed up
2230 highlighting.  The advantage of @code{lazy-lock-mode} is that it only
2231 fontifies buffers when certain conditions are met, such as after a
2232 certain amount of idle time, or after you have finished scrolling
2233 through text.  See the documentation for @code{lazy-lock-mode} by typing @kbd{C-h f
2234 @code{lazy-lock-mode}} (@kbd{M-x describe-function @key{RET}
2235 lazy-lock-mode @key{RET}}).
2237 Also see the documentation for the function @code{font-lock-mode},
2238 available by typing @kbd{C-h f font-lock-mode} (@kbd{M-x
2239 describe-function @key{RET} font-lock-mode @key{RET}}).
2241 For more information on font-lock mode, take a look at the
2242 @code{font-lock-mode} FAQ, maintained by
2243 @email{jari.aalto@@ntc.nokia.com, Jari Aalto} at
2245 @uref{ftp://cs.uta.fi/pub/ssjaaa/ema-font.gui}
2247 To print buffers with the faces (i.e., colors and fonts) intact, use
2248 @kbd{M-x ps-print-buffer-with-faces} or @kbd{M-x
2249 ps-print-region-with-faces}.
2251 @node Scrolling only one line, Replacing highlighted text, Turning on syntax highlighting, Common requests
2252 @section How can I force Emacs to scroll only one line when I move past the bottom of the screen?
2253 @cindex Scrolling only one line
2254 @cindex Reducing the increment when scrollng
2256 Place the following Lisp form in your @file{.emacs} file:
2258 @lisp
2259 (setq scroll-step 1)
2260 @end lisp
2262 @inforef{Scrolling, Scrolling, emacs}.
2264 @node Replacing highlighted text, Editing MS-DOS files, Scrolling only one line, Common requests
2265 @section How can I replace highlighted text with what I type?
2266 @cindex @code{delete-selection-mode}
2267 @cindex Replacing highlighted text
2268 @cindex Highlighing and replacing text
2270 Use @code{delete-selection mode}, which you can start automatically by
2271 placing the following Lisp form in your @file{.emacs} file:
2273 @lisp
2274 (delete-selection-mode t)
2275 @end lisp
2277 According to the documentation string for delete-selection mode (which
2278 you can read using @kbd{M-x describe-function @key{RET}
2279 delete-selection-mode @key{RET}}):
2281 @quotation
2282 When ON, typed text replaces the selection if the selection is active.
2283 When OFF, typed text is just inserted at point.
2284 @end quotation
2286 This mode also allows you to delete (not kill) the highlighted region by
2287 pressing @key{DEL}.
2289 @node Editing MS-DOS files, Filling paragraphs with a single space, Replacing highlighted text, Common requests
2290 @section How can I edit MS-DOS files using Emacs?
2291 @cindex Editing MS-DOS files
2292 @cindex MS-DOS files, editing
2293 @cindex Microsoft files, editing
2294 @cindex Windows files, editing
2296 As of Emacs 20, detection and handling of MS-DOS (and Windows) files is
2297 performed transparently. You can open MS-DOS files on a Unix system,
2298 edit it, and save it without having to worry about the file format.
2300 When editing an MS-DOS style file, a backslash (@samp{\}) will appear in
2301 the mode line.
2303 If you are running an earlier version of Emacs, get @code{crypt++} from
2304 the Emacs Lisp Archive (@pxref{Packages that do not come with Emacs}).
2305 Among other things, @code{crypt++} transparently modifies MS-DOS files
2306 as they are loaded and saved, allowing you to ignore the different
2307 conventions that Unix and MS-DOS have for delineating the end of a line.
2309 @node Filling paragraphs with a single space,  , Editing MS-DOS files, Common requests
2310 @section How can I tell Emacs to fill paragraphs with a single space after each period?
2311 @cindex One space following periods
2312 @cindex Single space following periods
2313 @cindex Periods, one space following
2315 @email{ulm@@vsnhd1.cern.ch, Ulrich Mueller} suggests adding the
2316 following two lines to your @file{.emacs} file:
2318 @lisp
2319 (setq sentence-end "[.?!][]\"')@}]*\\($\\|[ \t]\\)[ \t\n]*")
2320 (setq sentence-end-double-space nil)
2321 @end lisp
2323 @c ------------------------------------------------------------
2324 @node    Bugs and problems, Compiling and installing Emacs, Common requests, Top
2325 @chapter Bugs and problems
2326 @cindex Bugs and problems
2328 @menu
2329 * Problems with very large files::  
2330 * ^M in the shell buffer::      
2331 * Shell process exits abnormally::  
2332 * Termcap/Terminfo entries for Emacs::  
2333 * Spontaneous entry into isearch-mode::  
2334 * Problems talking to certain hosts::  
2335 * Errors with init files::      
2336 * Emacs ignores X resources::   
2337 * Emacs takes a long time to visit files::  
2338 * Editing files with $ in the name::  
2339 * Shell mode loses the current directory::  
2340 * Security risks with Emacs::   
2341 * Dired claims that no file is on this line::  
2342 @end menu
2344 @node Problems with very large files, ^M in the shell buffer, Bugs and problems, Bugs and problems
2345 @section Does Emacs have problems with files larger than 8 megabytes?
2346 @cindex Very large files, opening
2347 @cindex Large files, opening
2348 @cindex Opening very large files
2349 @cindex Maximum file size
2350 @cindex Files, maximum size
2352 Old versions (i.e., anything before 19.29) of Emacs had problems editing
2353 files larger than 8 megabytes.  As of version 19.29, the maximum buffer
2354 size is at least 2^27-1, or 134,217,727 bytes.
2356 If you are using an older version of Emacs and cannot upgrade, you will
2357 have to recompile. @email{lnz@@lucid.com, Leonard N. Zubkoff} suggests
2358 putting the following two lines in @file{src/config.h} before compiling
2359 Emacs to allow for 26-bit integers and pointers (and thus file sizes of
2360 up to 33,554,431 bytes):
2362 @example
2363 #define VALBITS 26
2364 #define GCTYPEBITS 5
2365 @end example
2367 This method may result in "ILLEGAL DATATYPE" and other random errors on
2368 some machines.
2370 @email{daveg@@csvax.cs.caltech.edu, David Gillespie} explains how this
2371 problems crops up; while his numbers are true only for pre-19.29
2372 versions of Emacs, the theory remains the same with current versions.
2374 @quotation
2375 Emacs is largely written in a dialect of Lisp; Lisp is a freely-typed
2376 language in the sense that you can put any value of any type into any
2377 variable, or return it from a function, and so on.  So each value
2378 must carry a "tag" along with it identifying what kind of thing it is,
2379 e.g., integer, pointer to a list, pointer to an editing buffer, and so
2380 on.  Emacs uses standard 32-bit integers for data objects, taking the
2381 top 8 bits for the tag and the bottom 24 bits for the value.  So
2382 integers (and pointers) are somewhat restricted compared to true C
2383 integers and pointers.
2384 @end quotation
2386 @node ^M in the shell buffer, Shell process exits abnormally, Problems with very large files, Bugs and problems
2387 @section How do I get rid of @samp{^M} or echoed commands in my shell buffer?
2388 @cindex Shell buffer, echoed commands and @samp{^M} in
2389 @cindex Echoed commands in @code{shell-mode}
2391 Try typing @kbd{M-x shell-strip-ctrl-m @key{RET}} while in @code{shell-mode} to
2392 make them go away.  If that doesn't work, you have several options:
2394 For tcsh, put this in your @file{.cshrc} (or @file{.tcshrc}) file:
2396 @example
2397 if ($?EMACS) then
2398     if ("$EMACS" == t) then
2399         if ($?tcsh) unset edit
2400         stty nl
2401     endif
2402 endif
2403 @end example
2405 Or put this in your @file{.emacs_tcsh} file:
2407 @example
2408 unset edit
2409 stty nl
2410 @end example
2412 Alternatively, use @file{csh} in your shell buffers instead of
2413 @file{tcsh}.  One way is:
2415 @lisp
2416 (setq explicit-shell-file-name "/bin/csh")
2417 @end lisp
2419 and another is to do this in your @file{.cshrc} (or @file{.tcshrc})
2420 file:
2422 @example
2423 setenv ESHELL /bin/csh
2424 @end example
2426 (You must start Emacs over again with the environment variable properly
2427 set for this to take effect.)
2429 You can also set the @code{ESHELL} environment variable in Emacs Lisp
2430 with the following Lisp form,
2432 @lisp
2433 (setenv "ESHELL" "/bin/csh")
2434 @end lisp
2436 On a related note: If your shell is echoing your input line in the shell
2437 buffer, you might want to try the following command in your shell
2438 start-up file:
2440 @example
2441 stty -icrnl -onlcr -echo susp ^Z
2442 @end example
2444 @node Shell process exits abnormally, Termcap/Terminfo entries for Emacs, ^M in the shell buffer, Bugs and problems
2445 @section Why do I get "Process shell exited abnormally with code 1"?
2446 @cindex Abnormal exits from @code{shell-mode}
2447 @cindex @code{shell-mode} exits
2449 The most likely reason for this message is that the @samp{env} program
2450 is not properly installed.  Compile this program for your architecture,
2451 and install it with @samp{a+x} permission in the architecture-dependent
2452 Emacs program directory.  (You can find what this directory is at your
2453 site by inspecting the value of the variable @code{exec-directory} by
2454 typing @kbd{C-h v exec-directory @key{RET}}.)
2456 You should also check for other programs named @samp{env} in your path
2457 (e.g., SunOS has a program named @file{/usr/bin/env}).  We don't
2458 understand why this can cause a failure and don't know a general
2459 solution for working around the problem in this case.
2461 The @samp{make clean} command will remove @samp{env} and other vital
2462 programs, so be careful when using it.
2464 It has been reported that this sometimes happened when Emacs was started
2465 as an X client from an xterm window (i.e., had a controlling tty) but the
2466 xterm was later terminated.
2468 See also @samp{PROBLEMS} (in the top-level directory when you unpack the
2469 Emacs source) for other possible causes of this message.
2471 @node Termcap/Terminfo entries for Emacs, Spontaneous entry into isearch-mode, Shell process exits abnormally, Bugs and problems
2472 @section Where is the termcap/terminfo entry for terminal type "emacs"?
2473 @cindex Termcap
2474 @cindex Terminfo
2475 @cindex Emacs entries for termcap/terminfo
2477 The termcap entry for terminal type @samp{emacs} is ordinarily put in
2478 the @samp{TERMCAP} environment variable of subshells.  It may help in
2479 certain situations (e.g., using rlogin from shell buffer) to add an
2480 entry for @samp{emacs} to the system-wide termcap file.  Here is a
2481 correct termcap entry for @samp{emacs}:
2483 @example
2484 emacs:tc=unknown:
2485 @end example
2487 To make a terminfo entry for "emacs", use "tic" or "captoinfo."  You need
2488 to generate @file{/usr/lib/terminfo/e/emacs}.  It may work to simply copy
2489 @file{/usr/lib/terminfo/d/dumb} to @file{/usr/lib/terminfo/e/emac}s.
2491 Having a termcap/terminfo entry will not enable the use of full screen
2492 programs in shell buffers.  Use @kbd{M-x terminal-emulator} for that
2493 instead.
2495 A workaround to the problem of missing termcap/terminfo entries is to
2496 change terminal type "emacs" to type "dumb" or "unknown" in your shell
2497 start up file.  "csh" users could put this in their .cshrc files:
2499 @example
2500 if ("$term" == emacs) set term=dumb
2501 @end example
2503 @node Spontaneous entry into isearch-mode, Problems talking to certain hosts, Termcap/Terminfo entries for Emacs, Bugs and problems
2504 @section Why does Emacs spontaneously start displaying "I-search:" and beeping?
2505 @cindex Spontaneous entry into isearch-mode
2506 @cindex isearch-mode, spontaneous entry into
2507 @cindex Beeping without obvious reason
2509 Your terminal (or something between your terminal and the computer) is
2510 sending @kbd{C-s} and @kbd{C-q} for flow control, and Emacs is receiving
2511 these characters and interpreting them as commands.  (The @kbd{C-s}
2512 character normally invokes the @code{isearch-forward} command.)  For
2513 possible solutions, @pxref{Handling C-s and C-q with flow control}.
2515 @node Problems talking to certain hosts, Errors with init files, Spontaneous entry into isearch-mode, Bugs and problems
2516 @section Why can't Emacs talk to certain hosts (or certain hostnames)?
2517 @cindex Hosts, Emacs cannot talk to
2518 @cindex @code{gethostbyname}, problematic version
2520 The problem may be that Emacs is linked with a wimpier version of
2521 @code{gethostbyname} than the rest of the programs on the machine.  This
2522 is often manifested as a message on startup of "X server not responding.
2523 Check your @samp{DISPLAY} environment variable." or a message of
2524 "Unknown host" from @code{open-network-stream}.
2526 On a Sun, this may be because Emacs had to be linked with the static C
2527 library.  The version of @code{gethostbyname} in the static C library
2528 may only look in @file{/etc/hosts} and the NIS (YP) maps, while the
2529 version in the dynamic C library may be smart enough to check DNS in
2530 addition to or instead of NIS.  On a Motorola Delta running System V
2531 R3.6, the version of @code{gethostbyname} in the standard library works,
2532 but the one that works with NIS doesn't (the one you get with -linet).
2533 Other operating systems have similar problems.
2535 Try these options:
2537 @itemize @bullet
2539 @item
2540 Explicitly add the host you want to communicate with to @file{/etc/hosts}.
2542 @item
2543 Relink Emacs with this line in @file{src/config.h}:
2545 @example
2546 #define LIBS_SYSTEM -lresolv
2547 @end example
2549 @item
2550 Replace @code{gethostbyname} and friends in @file{libc.a} with more
2551 useful versions such as the ones in @file{libresolv.a}.  Then relink
2552 Emacs.
2554 @item
2555 If you are actually running NIS, make sure that "ypbind" is properly
2556 told to do DNS lookups with the correct command line switch.
2558 @end itemize
2560 @node Errors with init files, Emacs ignores X resources, Problems talking to certain hosts, Bugs and problems
2561 @section Why does Emacs say "Error in init file"?
2562 @cindex Error in @file{.emacs}
2563 @cindex Error in init file
2564 @cindex Init file, errors in
2565 @cindex @file{.emacs} file, errors in
2566 @cindex Debugging @file{.emacs} file
2568 An error occurred while loading either your @file{.emacs} file or the
2569 system-wide file @file{lisp/default.el}.
2571 For information on how to debug your @file{.emacs} file,
2572 @pxref{Debugging a customization file}.
2574 It may be the case that you need to load some package first, or use a
2575 hook that will be evaluated after the package is loaded.  A common case
2576 of this is explained in @ref{Terminal setup code works after Emacs has
2577 begun}.
2579 @node Emacs ignores X resources, Emacs takes a long time to visit files, Errors with init files, Bugs and problems
2580 @section Why does Emacs ignore my X resources (my .Xdefaults file)?
2581 @cindex X resources being ignored
2582 @cindex Ignored X resources
2583 @cindex @file{.Xdefaults}
2585 As of version 19, Emacs searches for X resources in the files specified
2586 by the following environment variables:
2588 @itemize @bullet
2590 @item @code{XFILESEARCHPATH}
2591 @item @code{XUSERFILESEARCHPATH}
2592 @item @code{XAPPLRESDIR} 
2594 @end itemize
2596 This emulates the functionality provided by programs written using Xt.
2598 @code{XFILESEARCHPATH} and @code{XUSERFILESEARCHPATH} should be a list
2599 of file names separated by colons.  @code{XAPPLRESDIR} should be a list
2600 of directory names separated by colons.
2602 Emacs searches for X resources:
2604 @enumerate
2606 @item specified on the command line, with the @samp{-xrm RESOURCESTRING} option,
2607 @item then in the value of the @samp{XENVIRONMENT} environment variable,
2609 @itemize @minus 
2611 @item or if that is unset, in the file named @samp{~/.Xdefaults-HOSTNAME} if it exists (where @samp{HOSTNAME} is the hostname of the machine Emacs is running on),
2613 @end itemize
2615 @item then in the screen-specific and server-wide resource properties provided by the server,
2617 @itemize @minus
2619 @item or if those properties are unset, in the file named ~/.Xdefaults if it exists,
2621 @end itemize
2623 @item then in the files listed in @samp{XUSERFILESEARCHPATH},
2625 @itemize @minus
2627 @item or in files named @file{LANG/Emacs} in directories listed in @samp{XAPPLRESDIR} (where @samp{LANG} is the value of the @samp{LANG} environment variable), if the @samp{LANG} environment variable is set,
2628 @item or in files named Emacs in the directories listed in @samp{XAPPLRESDIR}
2629 @item or in @file{~/LANG/Emacs} (if the @samp{LANG} environment variable is set),
2630 @item  or in @file{~/Emacs},
2632 @end itemize
2634 @item then in the files listed in  @code{XFILESEARCHPATH}.
2636 @end enumerate
2638 @node Emacs takes a long time to visit files, Editing files with $ in the name, Emacs ignores X resources, Bugs and problems
2639 @section Why does Emacs take 20 seconds to visit a file?
2640 @cindex Visiting files takes a long time
2641 @cindex Delay when visiting files
2642 @cindex Files, take a long time to visit
2644 Old versions of Emacs (i.e., versions before Emacs 20.x) often
2645 encountered this when the master lock file, @file{!!!SuperLock!!!} has
2646 been left in the lock directory somehow.  Delete it.
2648 @email{meuer@@geom.umn.edu, Mark Meuer} says that NeXT NFS has a bug
2649 where an exclusive create succeeds but returns an error status.  This
2650 can cause the same problem.  Since Emacs's file locking doesn't work
2651 over NFS anyway, the best solution is to recompile Emacs with
2652 @code{CLASH_DETECTION} undefined.
2654 @node Editing files with $ in the name, Shell mode loses the current directory, Emacs takes a long time to visit files, Bugs and problems
2655 @section How do I edit a file with a @samp{$} in its name?
2656 @cindex Editing files with @samp{$} in the name
2657 @cindex @samp{$} in filenames
2658 @cindex Filenames containing @samp{$}, editing
2660 When entering a filename in the minibuffer, Emacs will attempt to expand
2661 a @samp{$} followed by a word as an environment variable.  To suppress
2662 this behavior, type @kbd{$$} instead.
2664 @node Shell mode loses the current directory, Security risks with Emacs, Editing files with $ in the name, Bugs and problems
2665 @section Why does shell mode lose track of the shell's current directory?
2666 @cindex Current directory and @code{shell-mode}
2667 @cindex @code{shell-mode} and current directory
2668 @cindex Directory, current in @code{shell-mode}
2670 Emacs has no way of knowing when the shell actually changes its
2671 directory.  This is an intrinsic limitation of Unix.  So it tries to
2672 guess by recognizing @samp{cd} commands.  If you type "cd" followed by a
2673 directory name with a variable reference (@samp{cd $HOME/bin}) or with a
2674 shell metacharacter (@samp{cd ../lib*}), Emacs will fail to correctly
2675 guess the shell's new current directory.  A huge variety of fixes and
2676 enhancements to shell mode for this problem have been written to handle
2677 this problem.  Check the Lisp Code Directory (@pxref{Finding a package
2678 with particular functionality}).
2680 You can tell Emacs the shell's current directory with the command
2681 @kbd{M-x dirs}.
2683 @node Security risks with Emacs, Dired claims that no file is on this line, Shell mode loses the current directory, Bugs and problems
2684 @section Are there any security risks in Emacs?
2685 @cindex Security with Emacs
2686 @cindex @samp{movemail} and security
2687 @cindex @code{file-local-variable} and security
2688 @cindex Synthetic X events and security
2689 @cindex X events and security
2691 @itemize @bullet
2693 @item The @file{movemail} incident (No, this is not a risk.)
2695 In his book @emph{The Cuckoo's Egg}, Cliff Stoll describes this in
2696 chapter 4.  The site at LBL had installed the @file{etc/movemail}
2697 program setuid root.  (As of version 19, @file{movemail} is in your
2698 architecture-specific directory; type @kbd{C-h v exec-directory
2699 @key{RET}} to see what it is.)  Since @file{movemail} had not been
2700 designed for this situation, a security hole was created and users could
2701 get root privileges.
2703 @file{movemail} has since been changed so that this security hole will
2704 not exist, even if it is installed setuid root.  However,
2705 @file{movemail} no longer needs to be installed setuid root, which
2706 should eliminate this particular risk.
2708 We have heard unverified reports that the 1988 Internet worm took
2709 advantage of this configuration problem.
2711 @item The @code{file-local-variable} feature (Yes, a risk, but easy to change.)
2713 There is an Emacs feature that allows the setting of local values for
2714 variables when editing a file by including specially formatted text near
2715 the end of the file.  This feature also includes the ability to have
2716 arbitrary Emacs Lisp code evaluated when the file is visited.
2717 Obviously, there is a potential for Trojan horses to exploit this
2718 feature.
2720 Emacs 18 allowed this feature by default; users could disable it by
2721 setting the variable @code{inhibit-local-variables} to a non-nil value.
2723 As of Emacs 19, Emacs has a list of local variables that create a
2724 security risk.  If a file tries to set one of them, it asks the user to
2725 confirm whether the variables should be set.  You can also tell Emacs
2726 whether to allow the evaluation of Emacs Lisp code found at the bottom
2727 of files by setting the variable @code{enable-local-eval}.
2729 For more information, @inforef{File Variables, File Variables, emacs}.
2731 @item Synthetic X events (Yes, a risk; use @samp{MIT-MAGIC-COOKIE-1} or better.)
2733 Emacs accepts synthetic X events generated by the SendEvent request as
2734 though they were regular events.  As a result, if you are using the
2735 trivial host-based authentication, other users who can open X
2736 connections to your X workstation can make your Emacs process do
2737 anything, including run other processes with your privileges.
2739 The only fix for this is to prevent other users from being able to open
2740 X connections.  The standard way to prevent this is to use a real
2741 authentication mechanism, such as @samp{MIT-MAGIC-COOKIE-1}.  If using
2742 the @file{xauth} program has any effect, then you are probably using
2743 @samp{MIT-MAGIC-COOKIE-1}.  Your site may be using a superior
2744 authentication method; ask your system administrator.
2746 If real authentication is not a possibility, you may be satisfied by
2747 just allowing hosts access for brief intervals while you start your X
2748 programs, then removing the access.  This reduces the risk somewhat by
2749 narrowing the time window when hostile users would have access, but
2750 @emph{does not eliminate the risk}.
2752 On most computers running Unix and X Windows, you enable and disable
2753 access using the @file{xhost} command.  To allow all hosts access to
2754 your X server, use
2756 @example
2757 xhost +
2758 @end example
2760 at the shell prompt, which (on an HP machine, at least) produces the
2761 following message:
2763 @example
2764 access control disabled, clients can connect from any host
2765 @end example
2767 To deny all hosts access to your X server (except those explicitly
2768 allowed by name), use
2770 @example
2771 xhost -
2772 @end example
2774 On the test HP computer, this command generated the following message:
2776 @example
2777 access control enabled, only authorized clients can connect
2778 @end example
2780 @end itemize
2782 @node Dired claims that no file is on this line,  , Security risks with Emacs, Bugs and problems
2783 @section Dired says, "no file on this line" when I try to do something.
2784 @cindex Dired does not see a file
2786 Chances are you're using a localized version of Unix that doesn't use US
2787 date format in dired listings.  You can check this by looking at dired
2788 listings or by typing @code{ls -l} to a shell and looking at the dates that
2789 come out.
2791 Dired uses a regular expression to find the beginning of a file name.
2792 In a long Unix-style directory listing ("ls -l"), the file name starts
2793 after the date.  The regexp has thus been written to look for the date,
2794 the format of which can vary on non-US systems.
2796 There are two approaches to solving this.  The first one involves
2797 setting things up so that "ls -l" outputs US date format.  This can be
2798 done by setting the locale.  See your OS manual for more information.
2800 The second approach involves changing the regular expression used by
2801 dired, @code{dired-move-to-filename-regexp}.
2803 @c ------------------------------------------------------------
2804 @node Compiling and installing Emacs, Finding Emacs and related packages, Bugs and problems, Top
2805 @chapter    Compiling and installing Emacs
2806 @cindex    Compiling and installing Emacs
2808 @menu
2809 * Installing Emacs::            
2810 * Updating Emacs::              
2811 * Problems building Emacs::     
2812 * Linking with -lX11 fails::    
2813 @end menu
2815 @node Installing Emacs, Updating Emacs, Compiling and installing Emacs, Compiling and installing Emacs
2816 @section How do I install Emacs?
2817 @cindex Installing Emacs
2818 @cindex Unix systems, installing Emacs on
2819 @cindex Downloading and installing Emacs
2820 @cindex Retrieving and installing Emacs
2821 @cindex Building Emacs from source
2822 @cindex Source code, building Emacs from
2823 @cindex Unpacking and installing Emacs
2825 This answer is meant for users of Unix and Unix-like systems.  Users of
2826 other operating systems should see the series of questions beginning
2827 with @ref{Emacs for MS-DOS}, which describe where to get non-Unix source
2828 and binaries.  These packages should come with installation
2829 instructions.
2831 For Unix and Unix-like systems, the easiest way is often to compile it
2832 from scratch.  You will need:
2834 @itemize @bullet
2836 @item
2837 Emacs sources.  @xref{Current GNU distributions}, for a list of ftp sites
2838 that make them available.  On @file{ftp.gnu.org}, the main GNU
2839 distribution site, sources are available at
2841 @uref{ftp://ftp.gnu.org/pub/gnu/emacs/emacs-20.5.tar.gz}
2843 The above will obviously change as new versions of Emacs come out.  For
2844 instance, when Emacs 21 is released, it will most probably be
2845 available at
2847 @uref{ftp://ftp.gnu.org/pub/gnu/emacs/emacs-21.1.tar.gz}
2849 Again, you should use one of the GNU mirror sites (@xref{Current GNU
2850 distributions}, and adjust the URL accordingly) so as to reduce load on
2851 @file{ftp.gnu.org}.
2853 @item
2854 @code{gzip}, the GNU compression utility.  You can get @code{gzip} via
2855 anonymous ftp at mirrors of @file{ftp.gnu.org} sites; it should compile
2856 and install without much trouble on most systems.  Once you have
2857 retrieved the Emacs sources, you will probably be able to uncompress
2858 them with the command
2860 @example
2861 gunzip --verbose emacs-20.5.tar.gz
2862 @end example
2864 changing the Emacs version (20.5), as necessary.  Once gunzip has
2865 finished doing its job, a file by the name of "emacs-20.5.tar" should
2866 be in your build directory.
2868 @item 
2869 @file{tar}, the "tape archiving" program, which moves multiple files
2870 into and out of archive files, or "tarfiles."  All of the files
2871 comprising the Emacs source come in a single tarfile, and must be
2872 extracted using @file{tar} before you can build Emacs.  Typically, the
2873 extraction command would look like
2875 @example
2876 tar -xvvf emacs-20.5.tar
2877 @end example
2879 The @samp{x} indicates that we want to extract files from this tarfile,
2880 the two @samp{v}s force verbose output, and the @samp{f} tells
2881 @file{tar} to use a disk file, rather than one on tape.
2883 If you're using GNU @file{tar} (available at mirrors of
2884 @file{ftp.gnu.org}), you can combine this step and the previous one by
2885 using the command
2887 @example
2888 tar -zxvvf emacs-20.5.tar.gz
2889 @end example
2891 The additional @samp{z} at the beginning of the options list tells GNU tar
2892 to uncompress the file with gunzip before extracting the tarfile's
2893 components.
2895 @end itemize
2897 At this point, the Emacs sources (all 25+ megabytes of them) should be
2898 sitting in a directory called @file{emacs-20.5}.  On most common Unix and
2899 Unix-like systems, you should be able to compile Emacs (with X Windows
2900 support) with the following commands:
2902 @example
2903 cd emacs-20.5       # change directory to emacs-20.5
2904 ./configure         # configure Emacs for your particular system 
2905 make                # use Makefile to build components, then Emacs 
2906 @end example
2908 If the @code{make} completes successfully, the odds are fairly good that
2909 the build has gone well.  (@pxref{Problems building Emacs} if you weren't
2910 successful.)
2912 By default, Emacs is installed in the following directories:
2914 @table @file
2916 @item /usr/local/bin
2917 binaries
2919 @item /usr/local/share/emacs/20.xx
2920 Lisp code and support files
2922 @item /usr/local/info
2923 Info documentation
2925 @end table
2927 To install files in those default directories, become the superuser and
2928 type
2930 @example
2931 make install
2932 @end example
2934 Note that @code{make install} will overwrite @file{/usr/local/bin/emacs}
2935 and any Emacs Info files that might be in @file{/usr/local/info}.
2937 Much more verbose instructions (with many more hints and suggestions)
2938 come with the Emacs sources, in the file @file{INSTALL}.
2940 @node Updating Emacs, Problems building Emacs, Installing Emacs, Compiling and installing Emacs
2941 @section How do I update Emacs to the latest version?
2942 @cindex Updating Emacs
2944 @xref{Installing Emacs}, and follow the instructions there for
2945 installation.
2947 Most files are placed in version-specific directories.  Emacs 20.5, for
2948 instance, places files in @file{/usr/local/share/emacs/20.5}.
2950 Upgrading should overwrite only, @file{/usr/local/bin/emacs} (the Emacs
2951 binary) and documentation in @file{/usr/local/info}.  Back up these
2952 files before you upgrade, and you shouldn't have too much trouble.
2954 @node Problems building Emacs, Linking with -lX11 fails, Updating Emacs, Compiling and installing Emacs
2955 @section What should I do if I have trouble building Emacs?
2956 @cindex Problems building Emacs
2957 @cindex Errors when building Emacs
2959 First look in the file @file{PROBLEMS} (in the top-level directory when
2960 you unpack the Emacs source) to see if there is already a solution for
2961 your problem.  Next, look for other questions in this FAQ that have to
2962 do with Emacs installation and compilation problems.
2964 If you'd like to have someone look at your problem and help solve it,
2965 @pxref{Help installing Emacs}.
2967 If you cannot find a solution in the documentation, send a message to
2968 @email{bug-gnu-emacs@@gnu.org}.
2970 Please do not post it to @uref{news:gnu.emacs.help} or send e-mail to
2971 @email{help-gnu-emacs@@gnu.org}.  For further guidelines,
2972 @pxref{Guidelines for newsgroup postings} and @ref{Reporting bugs}.
2974 @node Linking with -lX11 fails,  , Problems building Emacs, Compiling and installing Emacs
2975 @section Why does linking Emacs with -lX11 fail?
2976 @cindex Linking with -lX11 fails
2977 @cindex lX11, linking fails with
2979 Emacs needs to be linked with the static version of the X11 library,
2980 @file{libX11.a}.  This may be missing.
2982 Under OpenWindows, you may need to use "add_services" to add the
2983 "OpenWindows Programmers" optional software category from the CD-ROM.
2985 Under HP-UX 8.0, you may need to run "update" again to load the X11-PRG
2986 "fileset".  This may be missing even if you specified "all filesets" the
2987 first time.  If @file{libcurses.a} is missing, you may need to load the
2988 "Berkeley Development Option."
2990 @email{zoo@@armadillo.com, David Zuhn} says that MIT X builds shared
2991 libraries by default, and only shared libraries, on those platforms that
2992 support them.  These shared libraries can't be used when undumping
2993 temacs (the last stage of the Emacs build process).  To get regular
2994 libraries in addition to shared libraries, add this to @file{site.cf}:
2996 @example
2997 #define ForceNormalLib YES
2998 @end example
3000 Other systems may have similar problems.  You can always define
3001 CANNOT_DUMP and link with the shared libraries instead.
3003 To get the Xmenu stuff to work, you need to find a copy of MIT's
3004 @file{liboldX.a}.
3006 @c ------------------------------------------------------------
3007 @node Finding Emacs and related packages, Major packages and programs, Compiling and installing Emacs, Top
3008 @chapter Finding Emacs and related packages
3009 @cindex Finding Emacs and related packages
3011 @menu
3012 * Finding Emacs on the Internet::  
3013 * Finding a package with particular functionality::  
3014 * Packages that do not come with Emacs::  
3015 * Submitting to the Emacs Lisp Archive::  
3016 * Current GNU distributions::   
3017 * Difference between Emacs and XEmacs::  
3018 * Emacs for MS-DOS::            
3019 * Emacs for Windows::           
3020 * Emacs for OS/2::              
3021 * Emacs for Atari ST::          
3022 * Emacs for the Amiga ::        
3023 * Emacs for NeXTSTEP::          
3024 * Emacs for Apple computers::   
3025 * Emacs for VMS and DECwindows::  
3026 * Modes for various languages::  
3027 * Translating names to IP addresses::  
3028 @end menu
3030 @node Finding Emacs on the Internet, Finding a package with particular functionality, Finding Emacs and related packages, Finding Emacs and related packages
3031 @section Where can I get Emacs on the net (or by snail mail)?
3032 @cindex Finding Emacs on the Internet
3033 @cindex Snail mail, ordering Emacs via
3034 @cindex Postal service, ordering Emacs via
3035 @cindex Distribution, retrieving Emacs 
3036 @cindex Internet, retreiving from
3038 Look in the files @file{etc/DISTRIB} and @file{etc/FTP} for information
3039 on nearby archive sites and @file{etc/ORDERS} for mail orders.  If you
3040 don't already have Emacs, @pxref{Informational files for Emacs} for how
3041 to get these files.
3043 @xref{Installing Emacs}, for information on how to obtain and build the latest
3044 version of Emacs, and @pxref{Current GNU distributions} for a list of
3045 archive sites that make GNU software available.
3047 @node Finding a package with particular functionality, Packages that do not come with Emacs, Finding Emacs on the Internet, Finding Emacs and related packages
3048 @section How do I find a Emacs Lisp package that does XXX?
3049 @cindex Package, finding
3050 @cindex Finding an Emacs Lisp package
3051 @cindex Functionality, finding a particular package 
3053 First of all, you should check to make sure that the package isn't
3054 already available.  For example, typing @kbd{M-x apropos @key{RET}
3055 wordstar @key{RET}} lists all functions and variables containing the
3056 string @samp{wordstar}.
3058 It is also possible that the package is on your system, but has not been
3059 loaded.  To see which packages are available for loading, look through
3060 your computer's lisp directory (@pxref{Filename conventions}).  The Lisp
3061 source to most most packages contains a short description of how they
3062 should be loaded, invoked, and configured --- so before you use or
3063 modify a Lisp package, see if the author has provided any hints in the
3064 source code.
3066 If a package does not come with Emacs, check the Lisp Code Directory.
3067 The LCD was originally maintained by @email{brennan@@hal.com, Dave
3068 Brennan}, but was recently taken over by @email{toby@@world.std.com,
3069 toby knudsen}, who maintains @uref{http://www.emacs.org}.  The LCD is
3070 currently being reorganized and updated, but you can meanwhile find many
3071 packages at @uref{ftp://ftp.emacs.org/pub}.
3073 For now, you can search through the LCD with @file{lispdir.el}, which is
3074 in the process of being updated.  Download it from the LCD, in the
3075 @file{emacs-lisp-attic/misc} directory, and then evaluate the following
3076 Lisp form (@pxref{Evaluating Emacs Lisp code}):
3078 @lisp
3079 (setq lisp-code-directory
3080  "/anonymous@@ftp.emacs.org:pub/emacs-lisp-attic/emacs-lisp/LCD-datafile.gz"
3081   elisp-archive-host "ftp.emacs.org"
3082   elisp-archive-directory "/pub/emacs-lisp-attic/emacs-lisp/")
3083 @end lisp
3085 Once you have installed @file{lispdir.el}, you can use @kbd{M-x
3086 lisp-dir-apropos} to search the listing.  For example, @kbd{M-x
3087 lisp-dir-apropos @key{RET} ange-ftp @key{RET}} produces this output:
3089 @example
3090          GNU Emacs Lisp Code Directory Apropos --- "ange-ftp"
3091 "~/" refers to archive.cis.ohio-state.edu:pub/elisp-archive/
3093      ange-ftp (4.18)       15-Jul-1992
3094           Andy Norman, <ange@@hplb.hpl.hp.com>
3095           ~/packages/ange-ftp.tar.Z
3096           transparent FTP Support for GNU Emacs
3097      auto-save (1.19)      01-May-1992
3098           Sebastian Kremer, <sk@@thp.uni-koeln.de>
3099           ~/misc/auto-save.el.Z
3100           Safer autosaving with support for ange-ftp and /tmp
3101      ftp-quik (1.0)        28-Jul-1993
3102           Terrence Brannon, <tb06@@pl122f.eecs.lehigh.edu>
3103           ~/modes/ftp-quik.el.Z
3104           Quik access to dired'ing of ange-ftp and normal paths
3105 @end example
3107 @node Packages that do not come with Emacs, Submitting to the Emacs Lisp Archive, Finding a package with particular functionality, Finding Emacs and related packages
3108 @section Where can I get Emacs Lisp packages that don't come with Emacs?
3109 @cindex Unbundled packages
3110 @cindex Finding other packages
3111 @cindex Lisp packages that do not come with Emacs
3112 @cindex Packages, those that do not come with Emacs
3113 @cindex Emacs Lisp Archive, description of
3114 @cindex Archive, description of the Emacs Lisp
3116 First, check the Lisp Code Directory to find the name of the package you
3117 are looking for (@pxref{Finding a package with particular
3118 functionality}).  Next, check local archives and the Emacs Lisp Archive
3119 to find a copy of the relevant files.  If you still haven't found it,
3120 you can send e-mail to the author asking for a copy.  If you find Emacs
3121 Lisp code that doesn't appear in the LCD, please submit a copy to the
3122 LCD (@pxref{Submitting to the Emacs Lisp Archive}).
3124 You can access the Emacs Lisp Archive at
3126 @uref{ftp://archive.cis.ohio-state.edu/pub/emacs-lisp/}
3128 Retrieve and read the file @file{README} first.
3130 @itemize @bullet
3132 @item The archive maintainers do not have time to answer individual
3133 requests for packages or the list of packages in the archive.  If you
3134 cannot use FTP or UUCP to access the archive yourself, try to find a
3135 friend who can, but please don't ask the maintainers.
3137 @item Any files with names ending in @samp{.Z}, @samp{.z}, or @samp{.gz} are
3138 compressed, so you should use "binary" mode in FTP to retrieve them.
3139 You should also use binary mode whenever you retrieve any files with
3140 names ending in @samp{.elc}.
3142 @end itemize
3144 @node Submitting to the Emacs Lisp Archive, Current GNU distributions, Packages that do not come with Emacs, Finding Emacs and related packages
3145 @section How do I submit code to the Emacs Lisp Archive?
3146 @cindex Submitting code to the Emacs Lisp Archive
3147 @cindex Emacs Lisp Archive, submissions to
3148 @cindex Lisp Archive, submissions to
3149 @cindex Archive, submitting to the Emacs Lisp
3151 Guidelines and procedures for submission to the archive can be found in
3152 the file @file{GUIDELINES} in the archive directory (@ref{Packages that
3153 do not come with Emacs}).  It covers documentation, copyrights,
3154 packaging, submission, and the Lisp Code Directory Record.  Anonymous
3155 FTP uploads are not permitted.  Instead, all submissions are mailed to
3156 @email{elisp-archive@@cis.ohio-state.edu}.  The @file{lispdir.el}
3157 package has a function named @code{submit-lcd-entry} which will help you
3158 with this.
3160 @node Current GNU distributions, Difference between Emacs and XEmacs, Submitting to the Emacs Lisp Archive, Finding Emacs and related packages
3161 @section Where can I get other up-to-date GNU stuff?
3162 @cindex Current GNU distributions
3163 @cindex Sources for current GNU distributions
3164 @cindex Stuff, current GNU
3165 @cindex Up-to-date GNU stuff
3166 @cindex Finding current GNU software
3167 @cindex Official GNU software sites
3169 The most up-to-date official GNU software is normally kept at
3171 @uref{ftp://ftp.gnu.org/pub/gnu}
3173 Read the files @file{etc/DISTRIB} and @file{etc/FTP} for more
3174 information.
3176 A list of sites mirroring @samp{ftp.gnu.org} can be found at
3178 @uref{http://www.gnu.org/order/ftp.html}
3180 @node Difference between Emacs and XEmacs, Emacs for MS-DOS, Current GNU distributions, Finding Emacs and related packages
3181 @section What is the difference between Emacs and XEmacs (formerly "Lucid Emacs")?
3182 @cindex XEmacs
3183 @cindex Difference Emacs and XEmacs
3184 @cindex Lucid Emacs
3185 @cindex Epoch
3187 First of all, they're both GNU Emacs.  XEmacs is just as much a later
3188 version of GNU Emacs as the FSF-distributed version.  This FAQ refers to
3189 the latest version to be distributed by the FSF as "Emacs," partly
3190 because the XEmacs maintainers now refer to their product using the
3191 "XEmacs" name, and partly because there isn't any accurate way to
3192 differentiate between the two without getting mired in paragraphs of
3193 legalese and history.
3195 XEmacs, which began life as Lucid Emacs, is based on an early version of
3196 Emacs 19 and Epoch, an X-aware version of Emacs 18.
3198 Emacs (i.e., the version distributed by the FSF) has a larger installed
3199 base and now always contains the MULE multilingual facilities.
3200 XEmacs can do some clever tricks with X Windows, such as
3201 putting arbitrary graphics in a buffer.  Similar facilities have been
3202 implemented for Emacs as part of a new redisplay implementation for
3203 Emacs 21, expected to be released after Emacs 20.5.
3204 Emacs and XEmacs each come with
3205 Lisp packages that are lacking in the other; RMS says that the FSF would
3206 include more packages that come with XEmacs, but that the XEmacs
3207 maintainers don't always keep track of the authors of contributed code,
3208 which makes it impossible for the FSF to have certain legal papers
3209 signed.  (Without these legal papers, the FSF will not distribute Lisp
3210 packages with Emacs.)  The two versions have some
3211 significant differences at the Lisp programming level.
3213 Many XEmacs features have found their way into recent versions of Emacs,
3214 and more features can be expected in the future, but there are still many
3215 differences between the two.
3217 @node Emacs for MS-DOS, Emacs for Windows, Difference between Emacs and XEmacs, Finding Emacs and related packages
3218 @section Where can I get Emacs for my PC running MS-DOS?
3219 @cindex MS-DOS, Emacs for
3220 @cindex DOS, Emacs for
3221 @cindex Compiling Emacs for DOS
3222 @cindex Emacs for MS-DOS
3223 @cindex Tools needed to compile Emacs under DOS
3225 A pre-built binary distribution of Emacs is available from the Simtel
3226 archives.  This version apparently works under MS-DOS and Windows (3.x,
3227 95x, and NT) and supports long file names under Windows 9x.  More
3228 information is available from
3230 @uref{ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/emacs.README}
3232 The binary itself is available in the files em1934*.zip in the
3233 directory
3235 @uref{ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/}
3237 If you prefer to compile Emacs for yourself, you can do so with the
3238 current distribution directly.  You will need a 386 (or
3239 better) processor, and to be running MS-DOS 3.0 or later.  According to
3240 @email{eliz@@is.elta.co.il, Eli Zaretskii} and
3241 @email{hankedr@@dms.auburn.edu, Darrel Hankerson}, you will need the
3242 following:
3244 @table @emph
3246 @item Compiler
3247 djgpp version 1.12 maint 1 or later.  Djgpp 2.0 or later is
3248 recommended, since 1.x is being phased out.  Djgpp 2 supports
3249 long filenames under Windows 9x.
3251 You can get the latest release of djgpp by retrieving all of
3252 the files in
3254 @uref{ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp}
3256 @item Gunzip and tar
3257 The easiest way is to use "djtar" which comes with djgpp v2.x,
3258 because it can open gzip'ed tarfiles (i.e., those ending with
3259 ".tar.gz") in one step.  Djtar comes in "djdev201.zip", from
3260 the URL mentioned above.
3262 @item make, mv, sed, and rm
3263 All of these utilities are available at
3265 @uref{ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu}
3267 16-bit utilities can be found in GNUish, at
3269 @uref{ftp://ftp.simtel.net/pub/simtelnet/gnu/gnuish}
3271 @end table
3273 The files @file{INSTALL} and @file{PROBLEMS} in the top-level directory
3274 of the Emacs source contains some additional information regarding Emacs
3275 under MS-DOS.
3277 For a list of other MS-DOS implementations of Emacs (and Emacs
3278 look-alikes), consult the list of "Emacs implementations and literature,"
3279 available at
3281 @uref{ftp://rtfm.mit.edu/pub/usenet/comp.emacs/}
3283 Note that while many of these programs look similar to Emacs, they often
3284 lack certain features, such as the Emacs Lisp extension language.
3286 @node Emacs for Windows, Emacs for OS/2, Emacs for MS-DOS, Finding Emacs and related packages
3287 @section Where can I get Emacs for Microsoft Windows
3288 @cindex FAQ for NT Emacs
3289 @cindex Microsoft Windows, Emacs for
3290 @cindex Windows NT, Emacs for
3291 @cindex Windows '95 and '98, Emacs for
3293 For information on Emacs for Windows 95 and NT, read the FAQ produced by
3294 @email{voelker@@cs.washington.edu, Geoff Voelker}, available at
3296 @uref{http://www.gnu.org/software/emacs/windows/ntemacs.html}
3298 @xref{Emacs for MS-DOS}, for Windows 3.1.
3300 @node Emacs for OS/2, Emacs for Atari ST, Emacs for Windows, Finding Emacs and related packages
3301 @section Where can I get Emacs for my PC running OS/2?
3302 @cindex OS/2, Emacs for
3304 Emacs 19.33 is ported for emx on OS/2 2.0 or 2.1, and is available at
3306 @uref{ftp://hobbes.nmsu.edu/pub/os2/apps/editors/emacs/v19.33/}
3308 @node Emacs for Atari ST, Emacs for the Amiga , Emacs for OS/2, Finding Emacs and related packages
3309 @section Where can I get Emacs for my Atari ST?
3310 @cindex Atari ST, Emacs for
3311 @cindex TOS, Emacs for
3313 Roland Schäuble reports that Emacs 18.58 running on plain TOS and MiNT
3314 is available at
3315 @uref{ftp://atari.archive.umich.edu/Editors/Emacs-18-58/1858b-d3.zoo}.
3317 @node Emacs for the Amiga , Emacs for NeXTSTEP, Emacs for Atari ST, Finding Emacs and related packages
3318 @section Where can I get Emacs for my Amiga?
3319 @cindex Amiga, Emacs for
3321 The files you need are available at
3323 @uref{ftp://ftp.wustl.edu/pub/aminet/util/gnu/}
3325 @email{dgilbert@@gamiga.guelphnet.dweomer.org, David Gilbert} has released a
3326 beta version of Emacs 19.25 for the Amiga.  You can get the binary at
3328 @uref{ftp://ftp.wustl.edu/pub/aminet/util/gnu/a2.0bEmacs-bin.lha}
3330 @node Emacs for NeXTSTEP, Emacs for Apple computers, Emacs for the Amiga , Finding Emacs and related packages
3331 @section Where can I get Emacs for NeXTSTEP?
3332 @cindex NeXTSTEP, Emacs for
3334 Emacs.app is a NeXTSTEP version of Emacs 19.34 which supports colors,
3335 menus, and multiple frames.  You can get it from
3337 @uref{ftp://next-ftp.peak.org/pub/next/apps/emacs/Emacs_for_NeXTstep.4.20a1.NIHS.b.tar.gz}
3339 @node Emacs for Apple computers, Emacs for VMS and DECwindows, Emacs for NeXTSTEP, Finding Emacs and related packages
3340 @section Where can I get Emacs for my Apple computer?
3341 @cindex Apple computers, Emacs for
3343 An unofficial port of GNU Emacs 18.59 to the Macintosh is available at a
3344 number of ftp sites, the home being
3345 @uref{ftp://ftp.cs.cornell.edu/pub/parmet/Emacs-1.17.sit.bin}.
3347 A port of Emacs 20.4 is available at
3348 @uref{http://www.cs.hku.hk/~choi/emacs/index.html}.
3350 Apple's forthcoming "OS X" is based largely on NeXTSTEP and OpenStep.
3351 @xref{Emacs for NeXTSTEP}, for more details about that version.
3353 @node Emacs for VMS and DECwindows, Modes for various languages, Emacs for Apple computers, Finding Emacs and related packages
3354 @section Where do I get Emacs that runs on VMS under DECwindows?
3355 @cindex DECwindows, Emacs for
3356 @cindex VMS, Emacs for
3358 Up-to-date information about GNU software (including Emacs) for VMS is
3359 available at @uref{http://vms.gnu.org/}.
3361 @node Modes for various languages, Translating names to IP addresses, Emacs for VMS and DECwindows, Finding Emacs and related packages
3362 @section Where can I get modes for Lex, Yacc/Bison, Bourne shell, csh, C++, Objective-C, Pascal, Java, and Awk?
3363 @cindex Awk, mode for
3364 @cindex @code{awk-mode}
3365 @cindex Bison, mode for
3366 @cindex Bourne Shell, mode for
3367 @cindex C++, mode for
3368 @cindex Java, mode for
3369 @cindex Lex mode
3370 @cindex Objective-C, mode for
3371 @cindex @code{pascal-mode}
3372 @cindex Shell mode
3373 @cindex Yacc mode
3374 @cindex @file{csh} mode
3375 @cindex @code{sh-mode}
3376 @cindex @code{cc-mode}
3378 Most of these modes are now available in standard Emacs distribution.
3379 To get additional modes, look in the Lisp Code Directory (@pxref{Finding
3380 a package with particular functionality}).  For C++, if you use
3381 @code{lisp-dir-apropos}, you must specify the pattern with something
3382 like @kbd{M-x lisp-dir-apropos @key{RET} c\+\+ @key{RET}}.
3384 Barry Warsaw's @code{cc-mode} now works for C, C++, Objective-C, and
3385 Java code.  You can get the latest version from the Emacs Lisp Archive;
3386 @pxref{Packages that do not come with Emacs} for details.  A FAQ for
3387 @code{cc-mode} is available at
3388 @uref{http://www.python.org/emacs/cc-mode/}.
3390 @node Translating names to IP addresses,  , Modes for various languages, Finding Emacs and related packages
3391 @section What is the IP address of XXX.YYY.ZZZ?
3392 @cindex Translating names to IP addresses
3393 @cindex IP addresses from names
3394 @cindex Using BIND to translate addresses
3395 @cindex DNS and IP addresses
3397 If you are on a Unix machine, try using the @samp{nslookup} command,
3398 included in the Berkeley BIND package.  For example, to find the IP
3399 address of @samp{ftp.gnu.org}, you would type @code{nslookup
3400 ftp.gnu.org}.
3402 Your computer should then provide the IP address of that computer.
3404 If your site's nameserver is deficient, you can use IP addresses to FTP
3405 files.  You can get this information by
3407 * E-mail:
3409 @example
3410 To: dns@@[134.214.84.25]    (to grasp.insa-lyon.fr)
3411 Body: ip XXX.YYY.ZZZ        (or "help" for more information 
3412                              and options - no quotes) 
3413 @end example
3417 @example
3418 To: resolve@@[147.31.254.130]         (to laverne.cs.widener.edu)
3419 Body: site XXX.YYY.ZZZ
3420 @end example
3422 @c ------------------------------------------------------------
3423 @node Major packages and programs, Key bindings, Finding Emacs and related packages, Top
3424 @chapter Major packages and programs
3425 @cindex Major packages and programs
3427 @menu
3428 * VM::                          
3429 * Supercite::                   
3430 * Calc::                        
3431 * VIPER::                       
3432 * AUC-TeX::                     
3433 * BBDB::                        
3434 * Ispell::                      
3435 * w3-mode::                     
3436 * EDB::                         
3437 * Mailcrypt::                   
3438 * JDE::                         
3439 * Patch::                       
3440 @end menu
3442 @node VM, Supercite, Major packages and programs, Major packages and programs
3443 @section VM (View Mail) --- another mail reader within Emacs, with MIME support
3444 @cindex VM
3445 @cindex Alternative mail software
3446 @cindex View Mail
3447 @cindex E-mail reader, VM
3449 @table @b
3451 @item Author
3452 @email{kyle@@uunet.uu.net, Kyle Jones}
3454 @item Latest version
3455 6.72
3457 @item Distribution
3458 @uref{ftp://ftp.wonderworks.com/pub/vm/vm.tar.gz}
3460 @item Informational newsgroup/mailing list
3461 @uref{news:gnu.emacs.vm.info}@*
3462 Subscription requests to @email{info-vm-request@@uunet.uu.net}@*
3463 Submissions to @email{info-vm@@uunet.uu.net}
3465 @item Bug reports newsgroup/mailing list
3466 @uref{news:gnu.emacs.vm.bug}@*
3467 Subscription requests to @email{bug-vm-request@@uunet.uu.net}@*
3468 Submissions to @email{bug-vm@@uunet.uu.net}
3469 @end table
3471 VM 6 works with Emacs 20.4, and may cause problems with Emacs 20.3 and
3472 below.  (Note that many people seem to use Emacs 20.3 with VM 6, without
3473 any problems.)  Risk-averse users might wish to try VM 5.97, available
3474 from @uref{ftp://ftp.wonderworks.com/pub/vm/, the same FTP site}.
3476 @node Supercite, Calc, VM, Major packages and programs
3477 @section Supercite --- mail and news citation package within Emacs
3478 @cindex Supercite
3479 @cindex Superyank
3480 @cindex Mail and news citations
3481 @cindex News and mail citations
3482 @cindex Citations in mail and news
3484 @table @b
3486 @item Author
3487 @email{bwarsaw@@cen.com, Barry Warsaw}
3489 @item Latest version
3490 3.1 (comes with Emacs 20)
3492 @item Distribution
3493 @uref{http://www.python.org/emacs/supercite.tar.gz}
3495 @item Mailing list
3496 Subscription requests to @email{supercite-request@@python.org}@*
3497 Submissions @email{supercite@@python.org}
3499 @end table
3501 Superyank is an old version of Supercite.
3503 @node Calc, VIPER, Supercite, Major packages and programs
3504 @section Calc --- poor man's Mathematica within Emacs
3505 @cindex Programmable calculator
3506 @cindex Calc
3508 @table @b
3510 @item Author
3511 @email{daveg@@csvax.cs.caltech.edu, Dave Gillespie}
3513 @item Latest version
3514 2.02f
3516 @item Distribution
3517 @uref{ftp://ftp.gnu.org/pub/gnu/calc/calc-2.02f.tar.gz}
3519 @end table
3521 @node VIPER, AUC-TeX, Calc, Major packages and programs
3522 @section VIPER --- vi emulation for Emacs
3523 @cindex vi emulation
3524 @cindex VIPER
3525 @cindex Emulation of vi
3527 Since Emacs 19.29, the preferred vi emulation in Emacs is VIPER
3528 (@kbd{M-x viper-mode @key{RET}}), which comes with Emacs.  It extends
3529 and supersedes VIP (including VIP 4.3) and provides vi emulation at
3530 several levels, from one that closely follows vi to one that departs
3531 from vi in several significant ways.
3533 For Emacs 19.28 and earlier, the following version of VIP is generally
3534 better than the one distributed with Emacs:
3536 @table @b
3537 @item Author
3538 @email{sane@@cs.uiuc.edu, Aamod Sane}
3540 @item Latest version
3543 @item Distribution
3544 @uref{ftp://archive.cis.ohio-state.edu/pub/emacs-lisp/modes/vip-mode.tar.Z}
3546 @end table
3548 @node AUC-TeX, BBDB, VIPER, Major packages and programs
3549 @section AUC TeX --- enhanced LaTeX mode with debugging facilities
3550 @cindex Mode for @TeX{}
3551 @cindex @TeX{} mode
3552 @cindex AUC-TeX mode for editing @TeX{}
3553 @cindex Writing and debugging @TeX{}
3555 @table @b
3557 @item Authors
3558 @email{krab@@iesd.auc.dk, Kresten Krab Thorup} and@*
3559 @email{abraham@@iesd.auc.dk, Per Abrahamsen}
3561 @item Latest version
3562 9.9p
3564 @item Distribution
3565 @uref{ftp://sunsite.auc.dk/packages/auctex/auctex.tar.gz}
3567 @item Web site
3568 @uref{http://sunsite.auc.dk/auctex/}
3570 @item Mailing list:
3571 Subscription requests to @email{auc-tex-request@@iesd.auc.dk}@*
3572 Submissions to @email{auc-tex@@iesd.auc.dk}@*
3573 Development team is at @email{auc-tex_mgr@@iesd.auc.dk}
3575 @end table
3577 @node BBDB, Ispell, AUC-TeX, Major packages and programs
3578 @section BBDB --- personal Info Rolodex integrated with mail/news readers
3579 @cindex BBDB
3580 @cindex Rolodex-like functionality
3581 @cindex Integrated contact database
3582 @cindex Contact database
3583 @cindex Big Brother Database
3584 @cindex Address book
3586 @table @b
3588 @item Maintainer
3589 @email{simmonmt@@acm.org, Matt Simmons}
3591 @item Latest version
3592 2.00
3594 @item Distribution
3595 @uref{http://www.netcom.com/~simmonmt/bbdb/index.html}
3597 @item Mailing lists
3598 Subscription requests to @email{info-bbdb-request@@xemacs.org}@*
3599 Submissions to @email{info-bbdb@@xemacs.org}@*
3600 Release announcements: @email{bbdb-announce-request@@xemacs.org}
3602 @end table
3604 @node Ispell, w3-mode, BBDB, Major packages and programs
3605 @section Ispell --- spell checker in C with interface for Emacs
3606 @cindex Spell-checker
3607 @cindex Checking spelling
3608 @cindex Ispell
3610 @table @b
3612 @item Author
3613 @email{geoff@@itcorp.com, Geoff Kuenning}
3615 @item Latest version
3616 3.1.20
3618 @item Distribution
3619 @uref{ftp://ftp.cs.ucla.edu/pub/ispell/ispell-3.1.20.tar.gz}@*
3621 @item Web site
3622 @uref{http://fmg-www.cs.ucla.edu/geoff/ispell.html}
3624 @end table
3626 @itemize @bullet
3628 @item Do not ask Geoff to send you the latest version of Ispell. He does not have free e-mail.
3630 @item This Ispell program is distinct from GNU Ispell 4.0. GNU Ispell
3631 4.0 is no longer a supported product.
3633 @end itemize
3635 @node w3-mode, EDB, Ispell, Major packages and programs
3636 @section w3-mode --- A World Wide Web browser inside of Emacs
3637 @cindex WWW browser
3638 @cindex Web browser
3639 @cindex Browser in Emacs
3640 @cindex @code{w3-mode}
3642 @table @b
3644 @item Author
3645 @email{wmperry@@spry.com, Bill Perry}
3647 @item Latest version
3648 4.0pre.39
3650 @item Distribution
3651 @uref{ftp://ftp.cs.indiana.edu/pub/elisp/w3/w3.tar.gz}
3653 @item Mailing lists
3654 Receive announcements from @email{w3-announce-request@@indiana.edu}@*
3655 Become a beta tester at @email{w3-beta-request@@indiana.edu}@*
3656 Help to develop @code{w3-mode} at @email{w3-dev@@indiana.edu}
3658 @end table
3660 @node EDB, Mailcrypt, w3-mode, Major packages and programs
3661 @section EDB --- Database program for Emacs; replaces forms editing modes
3662 @cindex EDB
3663 @cindex Database
3664 @cindex Forms mode
3666 @table @b
3667 @item Author
3668 @email{mernst@@theory.lcs.mit.edu, Michael Ernst}
3670 @item Latest version
3671 1.21
3673 @item Distribution
3674 @uref{ftp://theory.lcs.mit.edu/pub/emacs/edb}
3676 @end table
3678 @node Mailcrypt, JDE, EDB, Major packages and programs
3679 @section Mailcrypt --- PGP interface within Emacs mail and news
3680 @cindex PGP
3681 @cindex GPG
3682 @cindex Interface to PGP from Emacs mail and news
3683 @cindex News, interface to PGP from
3684 @cindex Mail, interface to PGP from
3685 @cindex Encryption software, interface to
3687 @table @b
3689 @item Authors
3690 @email{patl@@lcs.mit.edu, Patrick J. LoPresti} and @email{jin@@atype.com, Jin S. Choi}
3692 @item Maintainer
3693 @email{lbudney@@pobox.com, Len Budney}
3695 @item Latest version
3696 3.5.3
3698 @item Distribution
3699 @uref{http://www.nb.net/~lbudney/linux/software/mailcrypt/mailcrypt-3.5.3.tar.gz}
3701 @item Web site
3702 @uref{http://www.nb.net/~lbudney/linux/software/mailcrypt.html}
3704 @end table
3706 @node JDE, Patch, Mailcrypt, Major packages and programs
3707 @section JDE --- Integrated development environment for Java
3708 @cindex Java development environment
3709 @cindex Integrated Java development environment
3710 @cindex JDE
3712 @table @b
3714 @item Author
3715 @email{paulk@@mathworks.com, Paul Kinnucan}
3717 @item Mailing list
3718 jde-subscribe@@sunsite.auc.dk
3720 @item Latest version
3721 2.1.1
3723 @item Web site
3724 @uref{http://sunsite.auc.dk/jde/}
3726 @end table
3728 @node Patch,  , JDE, Major packages and programs
3729 @section Patch --- program to apply "diffs" for updating files
3730 @cindex Updating files with diffs
3731 @cindex Patching source files with diffs
3732 @cindex Diffs and patching
3733 @cindex @file{patch}
3735 @table @b
3737 @item Author
3738 @email{lwall@@wall.org, Larry Wall} (with GNU modifications)
3740 @item Latest version
3743 @item Distribution
3744 @xref{Current GNU distributions}.
3746 @end table
3748 @c ------------------------------------------------------------
3749 @node Key bindings, Alternate character sets, Major packages and programs, Top
3750 @chapter Key bindings
3751 @cindex Key bindings
3753 @menu
3754 * Binding keys to commands::    
3755 * Invalid prefix characters::   
3756 * Terminal setup code works after Emacs has begun::  
3757 * Using function keys under X::  
3758 * Working with function and arrow keys::  
3759 * X key translations for Emacs::  
3760 * Handling C-s and C-q with flow control::  
3761 * Binding C-s and C-q::         
3762 * Backspace invokes help::      
3763 * stty and Backspace key::      
3764 * Swapping keys::               
3765 * Producing C-XXX with the keyboard::  
3766 * No Meta key::                 
3767 * No Escape key::               
3768 * Compose Character::           
3769 * Binding combinations of modifiers and function keys::  
3770 * Meta key does not work in xterm::  
3771 * ExtendChar key does not work as Meta::  
3772 @end menu
3774 @node Binding keys to commands, Invalid prefix characters, Key bindings, Key bindings
3775 @section How do I bind keys (including function keys) to commands?
3776 @cindex Binding keys to commands
3777 @cindex Keys, binding to commands
3778 @cindex Commands, binding keys to
3780 Keys can be bound to commands either interactively or in your
3781 @file{.emacs} file.  To interactively bind keys for all modes, type
3782 @kbd{M-x global-set-key @key{RET} KEY CMD @key{RET}}.
3784 To bind a key just in the current major mode, type @kbd{M-x local-set-key @key{RET} KEY CMD @key{RET}}.
3786 See @inforef{Key Bindings, Key Bindings, emacs} for further details.
3788 To bind keys on starting Emacs or on starting any given mode, use the
3789 following "trick": First bind the key interactively, then immediately
3790 type @kbd{C-x @key{ESC} @key{ESC} C-a C-k C-g}.  Now, the command needed
3791 to bind the key is in the kill ring, and can be yanked into your
3792 @file{.emacs} file.  If the key binding is global, no changes to the
3793 command are required.  For example,
3795 @lisp
3796 (global-set-key (quote [f1]) (quote help-for-help))
3797 @end lisp
3799 can be placed directly into the @file{.emacs} file.  If the key binding is
3800 local, the command is used in conjunction with the "add-hook" command.
3801 For example, in tex-mode, a local binding might be
3803 @lisp
3804 (add-hook 'tex-mode-hook
3805   (function (lambda ()
3806     (local-set-key (quote [f1]) (quote help-for-help)))))
3807 @end lisp
3810 @itemize @bullet
3812 @item Control characters in key sequences, in the form yanked from the
3813 kill ring are given in their graphic form --- i.e., @key{CTRL} is shown
3814 as @samp{^}, @key{TAB} as a set of spaces (usually 8), etc.  You may
3815 want to convert these into their vector or string forms.
3817 @item If a prefix key of the character sequence to be bound is already
3818 bound as a complete key, then you must unbind it before the new
3819 binding.  For example, if "ESC @{" is previously bound:
3821 @lisp
3822 (global-unset-key [?\e ?@{])   ;;   or
3823 (local-unset-key [?\e ?@{])
3824 @end lisp
3826 @item Aside from commands and "lambda lists," a vector or string also
3827 can be bound to a key and thus treated as a macro.  For example:
3829 @lisp
3830 (global-set-key [f10] [?\C-x?\e?\e?\C-a?\C-k?\C-g])  ;;  or
3831 (global-set-key [f10] "\C-x\e\e\C-a\C-k\C-g")
3832 @end lisp
3834 @end itemize
3836 @node Invalid prefix characters, Terminal setup code works after Emacs has begun, Binding keys to commands, Key bindings
3837 @section Why does Emacs say "Key sequence XXX uses invalid prefix characters"?
3838 @cindex Prefix characters, invalid
3839 @cindex Invalid prefix characters
3840 @cindex Misspecified key sequences
3842 Usually, one of two things has happened.  In one case, the control
3843 character in the key sequence has been misspecified (e.g. @samp{C-f}
3844 used instead of @samp{\C-f} within a Lisp expression).  In the other
3845 case, a "prefix key" in the keystroke sequence you were trying to bind
3846 was already bound as a "complete key."  Historically, the @samp{ESC [}
3847 prefix was usually the problem, in which case you should evaluate either
3848 of these forms before attempting to bind the key sequence:
3850 @lisp
3851 (global-unset-key [?\e ?[])  ;;  or
3852 (global-unset-key "\e[")
3853 @end lisp
3855 @node Terminal setup code works after Emacs has begun, Using function keys under X, Invalid prefix characters, Key bindings
3856 @section Why doesn't this [terminal or window-system setup] code work in my @file{.emacs} file, but it works just fine after Emacs starts up?
3857 @cindex Terminal setup code in @file{.emacs}
3859 During startup, Emacs initializes itself according to a given code/file
3860 order.  If some of the code executed in your @file{.emacs} file needs to
3861 be postponed until the initial terminal or window-system setup code has
3862 been executed but is not, then you will experience this problem (this
3863 code/file execution order is not enforced after startup).
3865 To postpone the execution of Emacs Lisp code until after terminal or
3866 window-system setup, treat the code as a "lambda list" and set the value
3867 of either the @code{term-setup-hook} or @code{window-setup-hook}
3868 variable to this "lambda function."  For example,
3870 @lisp
3871 (setq term-setup-hook
3872       (function
3873        (lambda ()
3874          (cond ((string-match "\\`vt220" (or (getenv "TERM") ""))
3875                 ;; Make vt220's "Do" key behave like M-x:
3876                 (global-set-key [do] 'execute-extended-command))
3877                ))))
3878 @end lisp
3880 For information on what Emacs does every time it is started, see the
3881 @file{lisp/startup.el} file.
3883 @node Using function keys under X, Working with function and arrow keys, Terminal setup code works after Emacs has begun, Key bindings
3884 @section How do I use function keys under X Windows?
3885 @cindex Function keys
3886 @cindex X Windows and function keys
3887 @cindex Binding function keys
3889 With Emacs 19, functions keys under X are bound like any other key.  @xref{Binding keys to commands}, for details.
3891 @node Working with function and arrow keys, X key translations for Emacs, Using function keys under X, Key bindings
3892 @section How do I tell what characters or symbols my function or arrow keys emit?
3893 @cindex Working with arrow keys
3894 @cindex Arrow keys, symbols generated by
3895 @cindex Working with function keys
3896 @cindex Function keys, symbols generated by
3897 @cindex Symbols generated by function keys
3899 Type @kbd{C-h c} then the function or arrow keys.  The command will
3900 return either a function key symbol or character sequence (see the
3901 Emacs on-line documentation for an explanation).  This works for other
3902 keys as well.
3904 @node X key translations for Emacs, Handling C-s and C-q with flow control, Working with function and arrow keys, Key bindings
3905 @section How do I set the X key "translations" for Emacs?
3906 @cindex X key translations
3907 @cindex Key translations under X
3908 @cindex Translations for keys under X
3910 Emacs is not written using the Xt library by default, so there are no
3911 "translations" to be set.  (We aren't sure how to set such translations
3912 if you do build Emacs with Xt; please let us know if you've done this!)
3914 The only way to affect the behavior of keys within Emacs is through
3915 "xmodmap" (outside Emacs) or @code{define-key} (inside Emacs).  The
3916 @code{define-key} command should be used in conjunction with the
3917 @code{function-key-map} map.  For instance,
3919 @lisp
3920 (define-key function-key-map [M-@key{TAB}] [?\M-\t])
3921 @end lisp
3923 defines the @kbd{M-@key{TAB}} key sequence.
3925 @node Handling C-s and C-q with flow control, Binding C-s and C-q, X key translations for Emacs, Key bindings
3926 @section How do I handle @kbd{C-s} and @kbd{C-q} being used for flow control?
3927 @cindex Flow control, @kbd{C-s} and @kbd{C-q} with
3928 @cindex @kbd{C-s} and @kbd{C-q} with flow control
3930 @kbd{C-s} and @kbd{C-q} are used in the XON/XOFF flow control protocol.
3931 This messes things up when you're using Emacs, because Emacs binds these
3932 keys to commands by default.  Because Emacs won't honor them as flow
3933 control characters, too many of these characters are not passed on and
3934 overwhelm output buffers.  Sometimes, intermediate software using
3935 XON/XOFF flow control will prevent Emacs from ever seeing @kbd{C-s} and
3936 @kbd{C-q}.
3938 Possible solutions:
3940 @itemize @bullet
3942 @item Disable the use of @kbd{C-s} and @kbd{C-q} for flow control.
3944 You need to determine the cause of the flow control.
3946 @itemize @minus
3948 @item your terminal
3950 Your terminal may use XON/XOFF flow control to have time to display
3951 all the characters it receives.  For example, VT series terminals do
3952 this.  It may be possible to turn this off from a setup menu.  For
3953 example, on a VT220 you may select "No XOFF" in the setup menu.  This
3954 is also true for some terminal emulation programs on PCs.
3956 When you turn off flow control at the terminal, you will also need to
3957 turn it off at the other end, which might be at the computer you are
3958 logged in to or at some terminal server in between.
3960 If you turn off flow control, characters may be lost; using a printer
3961 connected to the terminal may fail.  You may be able to get around
3962 this problem by modifying the "termcap" entry for your terminal to
3963 include extra NUL padding characters.
3965 @item a modem
3967 If you are using a dialup connection, the modems may be using
3968 XON/XOFF flow control.  It's not clear how to get around this.
3970 @item a router or terminal server
3972 Some network box between the terminal and your computer may be using
3973 XON/XOFF flow control.  It may be possible to make it use some other
3974 kind of flow control.  You will probably have to ask your local
3975 network experts for help with this.
3977 @item tty and/or pty devices
3979 If your connection to Emacs goes through multiple tty and/or pty
3980 devices, they may be using XON/XOFF flow control even when it is not
3981 necessary.
3983 @email{eirik@@theory.tn.cornell.edu, Eirik Fuller} writes:
3985 @quotation
3986 Some versions of "rlogin" (and possibly telnet) do not pass flow
3987 control characters to the remote system to which they connect.  On
3988 such systems, Emacs on the remote system cannot disable flow
3989 control on the local system.  Sometimes "rlogin -8" will avoid this
3990 problem.
3992 One way to cure this is to disable flow control on the local host
3993 (the one running rlogin, not the one running rlogind) using the
3994 stty command, before starting the rlogin process.  On many systems,
3995 @samp{stty start u stop u} will do this.
3997 Some versions of @samp{tcsh} will prevent even this from working.  One
3998 way around this is to start another shell before starting rlogin,
3999 and issue the @samp{stty} command to disable flow control from that shell.
4000 @end quotation
4002 Use @samp{stty -ixon} instead of @samp{stty start u stop u} on some systems.
4004 @end itemize
4006 @item Make Emacs speak the XON/XOFF flow control protocol.
4008 You can make Emacs treat @kbd{C-s} and @kbd{C-q} as flow control characters by
4009 evaluating the form
4011 @lisp
4012 (enable-flow-control)
4013 @end lisp
4015 to unconditionally enable flow control or
4017 @lisp
4018 (enable-flow-control-on "vt100" "h19")
4019 @end lisp
4021 (using your terminal names instead of @samp{vt100} or @samp{h19}) to
4022 enable selectively.  These commands will automatically swap @kbd{C-s}
4023 and @kbd{C-q} to @kbd{C-\} and @kbd{C-^}.  Variables can be used to
4024 change the default swap keys (@code{flow-control-c-s-replacement} and
4025 @code{flow-control-c-q-replacement}).
4027 If you are fixing this for yourself, simply put the form in your
4028 @file{.emacs} file.  If you are fixing this for your entire site, the
4029 best place to put it is in the @file{lisp/site-start.el} file.  Putting
4030 this form in @file{lisp/default.el} has the problem that if the user's
4031 @file{.emacs} file has an error, this will prevent
4032 @file{lisp/default.el} from being loaded and Emacs may be unusable for
4033 the user, even for correcting their @file{.emacs} file (unless they're
4034 smart enough to move it to another name).
4036 @end itemize
4038 For further discussion of this issue, read the file @file{PROBLEMS} (in
4039 the top-level directory when you unpack the Emacs source).
4041 @node Binding C-s and C-q, Backspace invokes help, Handling C-s and C-q with flow control, Key bindings
4042 @section How do I bind @kbd{C-s} and @kbd{C-q} (or any key) if these keys are filtered out?
4043 @cindex Binding @kbd{C-s} and @kbd{C-q}
4044 @cindex @kbd{C-s} and @kbd{C-q}, binding
4046 To bind @kbd{C-s} and @kbd{C-q}, use either @code{enable-flow-control}
4047 or @sc{enable-flow-control-on}.  @xref{Handling C-s and C-q with flow
4048 control}, for usage and implementation details.
4050 To bind other keys, use @code{keyboard-translate}.  @xref{Swapping keys},
4051 for usage details.  To do this for an entire site, you should swap the
4052 keys in @file{lisp/site-start.el}.  @xref{Handling C-s and C-q with flow
4053 control}, for an explanation of why @file{lisp/default.el} should not be
4054 used.
4056 @itemize @bullet
4058 @item If you do this for an entire site, the users will be confused by
4059 the disparity between what the documentation says and how Emacs
4060 actually behaves.
4062 @end itemize
4064 @node Backspace invokes help, stty and Backspace key, Binding C-s and C-q, Key bindings
4065 @section Why does the @key{Backspace} key invoke help?
4066 @cindex Backspace key invokes help
4067 @cindex Help invoked by Backspace
4069 The @key{Backspace} key (on most keyboards) generates ASCII code 8.
4070 @kbd{C-h} sends the same code.  In Emacs by default @kbd{C-h} invokes
4071 help-command.  This is intended to be easy to remember since the first
4072 letter of @samp{help} is @samp{h}.  The easiest solution to this problem
4073 is to use @kbd{C-h} (and @key{Backspace}) for help and @key{DEL} (the
4074 @key{Delete} key) for deleting the previous character.
4076 For many people this solution may be problematic:
4078 @itemize @bullet
4080 @item
4081 They normally use @key{Backspace} outside of Emacs for deleting the
4082 previous character.  This can be solved by making @key{DEL} the command
4083 for deleting the previous character outside of Emacs.  On many Unix
4084 systems, this command will remap @key{DEL}:
4086 @example
4087 stty erase `^?'
4088 @end example
4090 @item
4091 The person may prefer using the @key{Backspace} key for deleting the
4092 previous character because it is more conveniently located on their
4093 keyboard or because they don't even have a separate Delete key.  In
4094 this case, the @key{Backspace} key should be made to behave like
4095 @key{Delete}.  There are several methods.
4097 @item
4098 Some terminals (e.g., VT3## terminals) allow the character generated
4099 by the @key{Backspace} key to be changed from a setup menu.
4101 @item
4102 You may be able to get a keyboard that is completely programmable.
4104 @item
4105 Under X or on a dumb terminal, it is possible to swap the
4106 @key{Backspace} and @key{Delete} keys inside Emacs:
4108 @lisp
4109 (keyboard-translate ?\C-h ?\C-?)
4110 @end lisp
4112 @xref{Swapping keys}, for further details of "keyboard-translate".
4114 @item
4115 Another approach is to switch key bindings and put help on @kbd{C-x h}
4116 instead:
4118 @lisp
4119 (global-set-key "\C-h" 'delete-backward-char)
4121 ;;; overrides mark-whole-buffer
4122 (global-set-key "\C-xh" 'help-command) 
4123 @end lisp
4125 Other popular key bindings for help are @kbd{M-?} and @kbd{C-x ?}.
4127 Don't try to bind @key{DEL} to @code{help-command}, because there are
4128 many modes that have local bindings of @key{DEL} that will interfere.
4130 @end itemize
4132 @node stty and Backspace key, Swapping keys, Backspace invokes help, Key bindings
4133 @section Why doesn't Emacs look at the @file{stty} settings for @key{Backspace} vs. @key{Delete}?
4134 @cindex @file{stty} and Emacs
4135 @cindex Backspace and @file{stty}
4136 @cindex Delete and @file{stty}
4138 Good question!
4140 @node Swapping keys, Producing C-XXX with the keyboard, stty and Backspace key, Key bindings
4141 @section How do I swap two keys?
4142 @cindex Swapping keys
4143 @cindex Keys, swapping
4144 @cindex @code{keyboard-translate}
4146 In Emacs 19, you can swap two keys (or key sequences) by using the
4147 @code{keyboard-translate} function.  For example, to turn @kbd{C-h} into
4148 @key{DEL} and @key{DEL} to @kbd{C-h}, use
4150 @lisp
4151 (keyboard-translate ?\C-h ?\C-?)  ; translate `C-h' to DEL
4152 (keyboard-translate ?\C-? ?\C-h)  ; translate DEL to `C-h'.
4153 @end lisp
4155 The first key sequence of the pair after the function identifies what is
4156 produced by the keyboard; the second, what is matched for in the
4157 keymaps.
4159 Keyboard translations are not the same as key bindings in keymaps.
4160 Emacs contains numerous keymaps that apply in different situations, but
4161 there is only one set of keyboard translations, and it applies to every
4162 character that Emacs reads from the terminal.  Keyboard translations
4163 take place at the lowest level of input processing; the keys that are
4164 looked up in keymaps contain the characters that result from keyboard
4165 translation.
4167 @inforef{Keyboard Translations, Keyboard Translations, emacs}.
4169 @node Producing C-XXX with the keyboard, No Meta key, Swapping keys, Key bindings
4170 @section How do I produce C-XXX with my keyboard?
4171 @cindex Producing control characters
4172 @cindex Generating control characters
4173 @cindex Control characters, generating
4175 On terminals (but not under X), some common "aliases" are:
4177 @table @asis
4179 @item @kbd{C-2}  or  @kbd{C-@key{SPC}}
4180 @kbd{C-@@}
4182 @item @kbd{C-6}
4183 @kbd{C-^}
4185 @item @kbd{C-7}  or  @kbd{C-S--}
4186 @kbd{C-_}
4188 @item @kbd{C-4}
4189 @kbd{C-\}
4191 @item @kbd{C-5}
4192 @kbd{C-]}
4194 @item @kbd{C-/}
4195 @kbd{C-?}
4197 @end table
4199 Often other aliases exist; use the @kbd{C-h c} command and try
4200 @key{CTRL} with all of the digits on your keyboard to see what gets
4201 generated.  You can also try the @kbd{C-h w} command if you know the
4202 name of the command.
4204 @node No Meta key, No Escape key, Producing C-XXX with the keyboard, Key bindings
4205 @section What if I don't have a @key{Meta} key?
4206 @cindex No @key{Meta} key
4207 @cindex @key{Meta} key, what to do if you lack it
4209 Instead of typing @kbd{M-a}, you can type @kbd{@key{ESC} a}.  In fact,
4210 Emacs converts @kbd{M-a} internally into @kbd{@key{ESC} a} anyway
4211 (depending on the value of @code{meta-prefix-char}).  Note that you
4212 press @key{Meta} and @key{a} together, while you press @kbd{ESC},
4213 release it, and then press @key{a}.
4215 @node No Escape key, Compose Character, No Meta key, Key bindings
4216 @section What if I don't have an @key{Escape} key?
4217 @cindex No Escape key
4218 @cindex Lacking an Escape key
4219 @cindex Escape key, lacking
4221 Type @kbd{C-[} instead.  This should send ASCII code 27 just like an
4222 Escape key would.  @kbd{C-3} may also work on some terminal (but not
4223 under X).  For many terminals (notably DEC terminals) @key{F11}
4224 generates @key{ESC}.  If not, the following form can be used to bind it:
4226 @lisp
4227 ;;; F11 is the documented ESC replacement on DEC terminals.
4228 (define-key function-key-map [f11] [?\e])  
4229 @end lisp
4231 @node Compose Character, Binding combinations of modifiers and function keys, No Escape key, Key bindings
4232 @section Can I make my @key{Compose Character} key behave like a @key{Meta} key?
4233 @cindex @key{Compose Character} key, using as @key{Meta}
4234 @cindex @key{Meta}, using @key{Compose Character} for
4236 On a dumb terminal such as a VT220, no.  It is rumored that certain
4237 VT220 clones could have their @key{Compose} key configured this way.  If
4238 you're using X, you might be able to do this with the @file{xmodmap} program.
4240 @node Binding combinations of modifiers and function keys, Meta key does not work in xterm, Compose Character, Key bindings
4241 @section How do I bind a combination of modifier key and function key?
4242 @cindex Modifiers and function keys
4243 @cindex Function keys and modifiers
4244 @cindex Binding modifiers and function keys
4246 With Emacs 19 you can represent modified function keys in vector format
4247 by adding prefixes to the function key symbol.  For example (from the
4248 on-line documentation):
4250 @lisp
4251 (global-set-key [?\C-x right] 'forward-page)
4252 @end lisp
4254 where @samp{?\C-x} is the Lisp character constant for the character @kbd{C-x}.
4256 You can use the modifier keys @key{Control}, @key{Meta}, @key{Hyper},
4257 @key{Super}, @key{Alt}, and @key{Shift} with function keys.  To
4258 represent these modifiers, prepend the strings @samp{C-}, @samp{M-},
4259 @samp{H-}, @samp{s-}, @samp{A-}, and @samp{S-} to the symbol name.  Here
4260 is how to make @kbd{H-M-RIGHT} move forward a word:
4262 @lisp
4263 (global-set-key [H-M-right] 'forward-word)
4264 @end lisp
4266 @itemize @bullet
4268 @item Not all modifiers are permitted in all situations.  @key{Hyper},
4269 @key{Super}, and @key{Alt} are available only under X (provided there
4270 are such keys).  Non-ASCII keys and mouse events (e.g. @kbd{C-=} and
4271 @kbd{mouse-1}) also fall under this category.
4273 @end itemize
4275 @xref{Binding keys to commands}, for general key binding instructions.
4277 @node Meta key does not work in xterm, ExtendChar key does not work as Meta, Binding combinations of modifiers and function keys, Key bindings
4278 @section Why doesn't my @key{Meta} key work in an xterm window?
4279 @cindex @key{Meta} key and xterm
4280 @cindex Xterm and @key{Meta} key
4282 Try all of these methods before asking for further help:
4284 @itemize @bullet
4286 @item
4287 You may have big problems using @file{mwm} as your window manager.
4288 (Does anyone know a good generic solution to allow the use of the
4289 @key{Meta} key in Emacs with @file{mwm}?)
4291 @item
4292 For X11: Make sure it really is a @key{Meta} key.  Use @file{xev} to
4293 find out what keysym your @key{Meta} key generates.  It should be either
4294 @key{Meta}_L or @key{Meta}_R.  If it isn't, use @file{xmodmap} to fix
4295 the situation.
4297 @item
4298 Make sure the pty the xterm is using is passing 8 bit characters.
4299 @samp{stty -a} (or @samp{stty everything}) should show @samp{cs8} somewhere.
4300 If it shows @samp{cs7} instead, use @samp{stty cs8 -istrip} (or @samp{stty
4301 pass8}) to fix it.
4303 @item
4304 If there is an rlogin connection between the xterm and the Emacs, the
4305 "-8" argument may need to be given to rlogin to make it pass all 8 bits
4306 of every character.
4308 @item
4309 If the Emacs is running under Ultrix, it is reported that evaluating
4310 @code{(set-input-mode t nil)} helps.
4312 @item
4313 If all else fails, you can make xterm generate @kbd{@key{ESC} W} when
4314 you type @kbd{M-W}, which is the same conversion Emacs would make if it
4315 got the @kbd{M-W} anyway.  In X11R4, the following resource
4316 specification will do this:
4318 @example
4319 XTerm.VT100.EightBitInput: false
4320 @end example
4322 (This changes the behavior of the @code{insert-eight-bit} action.)
4324 With older xterms, you can specify this behavior with a translation:
4326 @example
4327 XTerm.VT100.Translations: #override \
4328   Meta<KeyPress>: string(0x1b) insert()
4329 @end example
4331 You might have to replace @samp{Meta} with @samp{Alt}.
4333 @end itemize
4335 @node ExtendChar key does not work as Meta,  , Meta key does not work in xterm, Key bindings
4336 @section Why doesn't my @key{ExtendChar} key work as a @key{Meta} key under HP-UX 8.0 and 9.x?
4337 @cindex @key{ExtendChar} key as @key{Meta}
4338 @cindex @key{Meta}, using @key{ExtendChar} for
4340 This is a result of an internationalization extension in X11R4 and the
4341 fact that HP is now using this extension.  Emacs assumes that
4342 XLookupString returns the same result regardless of the @key{Meta} key
4343 state which is no longer necessarily true.  Until Emacs is fixed, the
4344 temporary kludge is to run this command after each time the X server is
4345 started but preferably before any xterm clients are:
4347 @example
4348 xmodmap -e 'remove mod1 = Mode_switch'
4349 @end example
4351 This will disable the use of the extra keysyms systemwide, which may be
4352 undesirable if you actually intend to use them.
4354 @c ------------------------------------------------------------
4355 @node Alternate character sets, Mail and news, Key bindings, Top
4356 @chapter Alternate character sets
4357 @cindex Alternate character sets
4359 @menu
4360 * Emacs does not display 8-bit characters::  
4361 * Inputting eight-bit characters::  
4362 * Kanji and Chinese characters::  
4363 * Right-to-left alphabets::     
4364 @end menu
4366 @node Emacs does not display 8-bit characters, Inputting eight-bit characters, Alternate character sets, Alternate character sets
4367 @section How do I make Emacs display 8-bit characters?
4368 @cindex Displaying eight-bit characters
4369 @cindex Eight-bit characters, displaying
4371 Emacs 19 has built-in support for eight-bit characters.  See
4372 @inforef{European Display, European Display, emacs}, from which this
4373 excerpt is taken:
4375 @quotation
4376 Some European languages use accented letters and other special symbols.
4377 The ISO 8859 Latin-1 character set defines character codes for many
4378 European languages in the range 160 to 255.
4380 Emacs can display those characters according to Latin-1, provided the
4381 terminal or font in use supports them.  The @kbd{M-x
4382 standard-display-european} command toggles European character display
4383 mode.  With a numeric argument, @kbd{M-x standard-display-european}
4384 enables European character display if and only if the argument is
4385 positive.
4387 Some operating systems let you specify the language you are using by
4388 setting a locale.  Emacs handles one common special case of this: if
4389 your locale name for character types contains the string "8859-1" or
4390 "88591", Emacs automatically enables European character display mode
4391 when it starts up.
4392 @end quotation
4394 @node Inputting eight-bit characters, Kanji and Chinese characters, Emacs does not display 8-bit characters, Alternate character sets
4395 @section How do I input eight-bit characters?
4396 @cindex Entering eight-bit characters
4397 @cindex Eight-bit characters, entering
4399 @inforef{European Display, European Display, emacs}, from which this is
4400 taken:
4402 @quotation
4403 If you enter non-ASCII ISO Latin-1 characters often, you might find ISO
4404 Accents mode convenient.  When this minor mode is enabled, @key{`},
4405 @key{'}, @key{"}, @key{^}, @key{/} and @key{~} modify the following
4406 letter by adding the corresponding diacritical mark to it, if possible.
4407 To enable or disable ISO Accents mode, use the command @kbd{M-x
4408 iso-accents-mode}.  This command affects only the current buffer.
4410 To enter one of those six special characters, type the character,
4411 followed by a space.  Some of those characters have a corresponding
4412 "dead key" accent character in the ISO Latin-1 character set; to enter
4413 that character, type the corresponding ASCII character twice.  For
4414 example, @kbd{''} enters the Latin-1 character acute-accent (character
4415 code 0264).
4416 @end quotation
4418 @node Kanji and Chinese characters, Right-to-left alphabets, Inputting eight-bit characters, Alternate character sets
4419 @section Where can I get an Emacs that handles kanji, Chinese, or other character sets?
4420 @cindex Kanji, handling with Emacs
4421 @cindex Chinese, handling with Emacs
4422 @cindex Japanese, handling with Emacs
4423 @cindex Korean, handling with Emacs
4425 Emacs 20 now includes many of the features of MULE, the Multilingual
4426 Enhancement of Emacs.  @xref{Installing Emacs}, for information on where
4427 to find and download Emacs.
4429 @node Right-to-left alphabets,  , Kanji and Chinese characters, Alternate character sets
4430 @section Where is an Emacs that can handle Semitic (right-to-left) alphabets?
4431 @cindex Right-to-left alphabets
4432 @cindex Hebrew, handling with Emacs
4433 @cindex Semitic alphabets
4435 Emacs 20 supports Hebrew characters (ISO 8859-8), but does not yet
4436 support right-to-left character entry.
4438 @email{joel@@exc.com, Joel M. Hoffman} has written a Lisp package called
4439 @file{hebrew.el} that allows right-to-left editing of Hebrew.  It
4440 reportedly works out of the box with Emacs 19, but requires patches for
4441 Emacs 18.  Write to Joel if you want the patches or package.
4443 @file{hebrew.el} requires a Hebrew screen font, but no other Hardware support.
4444 Joel has a screen font for PCs running MS-DOS and Linux.
4446 You might also try to query archie for files named with "hebrew";
4447 several ftp sites in Israel may also have the necessary files.
4449 @c ------------------------------------------------------------
4450 @node Mail and news, Concept index, Alternate character sets, Top
4451 @chapter Mail and news
4452 @cindex Mail and news
4454 @menu
4455 * Changing the included text prefix::  
4456 * Saving a copy of outgoing mail::  
4457 * Expanding aliases when sending mail::  
4458 * Rmail thinks all messages are one big one::  
4459 * Sorting the messages in an Rmail folder::  
4460 * Rmail writes to /usr/spool/mail::  
4461 * Recovering mail files when Rmail munges them::  
4462 * Replying to the sender of a message::  
4463 * MIME with Emacs mail packages::  
4464 * Automatically starting a mail or news reader::  
4465 * Reading news with Emacs::     
4466 * Gnus does not work with NNTP::  
4467 * Viewing articles with embedded underlining::  
4468 * Saving a multi-part Gnus posting::  
4469 * Starting Gnus faster::        
4470 * Catching up in all newsgroups::  
4471 * Killing based on nonstandard headers::  
4472 * Removing flashing messages::  
4473 * Catch-up is slow in Gnus::    
4474 * Gnus hangs for a long time::  
4475 * Learning more about Gnus::    
4476 @end menu
4478 @node Changing the included text prefix, Saving a copy of outgoing mail, Mail and news, Mail and news
4479 @section How do I change the included text prefix in mail/news followups?
4480 @cindex Prefix in mail/news followups, changing
4481 @cindex Included text prefix, changing
4482 @cindex Setting the included text character
4484 If you read mail with Rmail or news with Gnus, set the variable
4485 @code{mail-yank-prefix}.  For VM, set @code{vm-included-text-prefix}.
4486 For mh-e, set @code{mh-ins-buf-prefix}.
4488 For fancier control of citations, use Supercite.  @xref{Supercite}.
4490 To prevent Emacs from including various headers of the replied-to
4491 message, set the value of @code{mail-yank-ignored-headers} to an
4492 appropriate regexp.
4494 @node Saving a copy of outgoing mail, Expanding aliases when sending mail, Changing the included text prefix, Mail and news
4495 @section How do I save a copy of outgoing mail?
4496 @cindex Saving a copy of outgoing mail
4497 @cindex Copying outgoing mail to a file
4498 @cindex Filing outgoing mail
4499 @cindex Automatic filing of outgoing mail
4500 @cindex Mail, saving outgoing automatically
4502 You can either mail yourself a copy by including a @samp{BCC} header in the
4503 mail message, or store a copy of the message directly to a file by
4504 including an @samp{FCC} header.
4506 If you use standard mail, you can automatically create a @samp{BCC} to
4507 yourself by putting
4509 @lisp
4510 (setq mail-self-blind t)
4511 @end lisp
4513 in your @file{.emacs} file.  You can automatically include an "FCC:" field by
4514 putting something like the following in your @file{.emacs} file:
4516 @lisp
4517 (setq mail-archive-file-name (expand-file-name "~/outgoing"))
4518 @end lisp
4520 The output file will be in Unix mail format, which can be read directly
4521 by VM, but not always by Rmail.  @xref{Learning how to do something}.
4523 If you use @code{mh-e}, add an @samp{FCC} or @samp{BCC} field to your
4524 components file.
4526 It does not work to put "set record filename" in the @file{.mailrc}
4527 file.
4529 @node Expanding aliases when sending mail, Rmail thinks all messages are one big one, Saving a copy of outgoing mail, Mail and news
4530 @section Why doesn't Emacs expand my aliases when sending mail?
4531 @cindex Expanding aliases when sending mail
4532 @cindex Mail alias expansion
4533 @cindex Sending mail with aliases
4535 @itemize @bullet
4537 @item
4538 You must separate multiple addresses in the headers of the mail buffer
4539 with commas.  This is because Emacs supports RFC822 standard addresses
4540 like this one:
4542 @example
4543 To: Willy Smith <wks@@xpnsv.lwyrs.com>
4544 @end example
4546 However, you do not need to --- and probably should not, unless your
4547 system's version of @file{/usr/ucb/mail} (aka mailx) supports RFC822
4548 -- separate addresses with commas in your @file{~/.mailrc} file.
4550 @item
4551 Emacs normally only reads the @file{.mailrc} file once per session,
4552 when you start to compose your first mail message.  If you edit
4553 .mailrc, you can type @kbd{M-x rebuild-mail-abbrevs @key{RET}} to
4554 make Emacs reread @file{~/.mailrc}.
4556 @item
4557 If you like, you can expand mail aliases as abbrevs, as soon as you
4558 type them in.  To enable this feature, execute the following:
4560 @lisp
4561 (add-hook 'mail-setup-hook 'mail-abbrevs-setup)
4562 @end lisp
4564 Note that the aliases are expanded automatically only after you type
4565 @key{RET} or a punctuation character (e.g. @kbd{,}).  You can force their
4566 expansion by moving point to the end of the alias and typing @kbd{C-x a e}
4567 @kbd{M-x expand-abbrev}.
4568 @end itemize
4570 @node Rmail thinks all messages are one big one, Sorting the messages in an Rmail folder, Expanding aliases when sending mail, Mail and news
4571 @section Why does Rmail think all my saved messages are one big message?
4572 @cindex Rmail thinks all messages are one large message
4574 A file created through the @samp{FCC} field in a message is in Unix mail
4575 format, not the format that Rmail uses (BABYL format).  Rmail will try
4576 to convert a Unix mail file into BABYL format on input, but sometimes it
4577 makes errors.  For guaranteed safety, you can make the
4578 @file{saved-messages} file be an inbox for your Rmail file by using the
4579 function @code{set-rmail-inbox-list}.
4581 @node Sorting the messages in an Rmail folder, Rmail writes to /usr/spool/mail, Rmail thinks all messages are one big one, Mail and news
4582 @section How can I sort the messages in my Rmail folder?
4583 @cindex Rmail, sorting messages in
4584 @cindex Folder, sorting messages in an Rmail
4585 @cindex Sorting messages in an Rmail folder
4587 In Rmail, type @kbd{C-c C-s C-h} to get a list of sorting functions
4588 and their key bindings.
4590 @node Rmail writes to /usr/spool/mail, Recovering mail files when Rmail munges them, Sorting the messages in an Rmail folder, Mail and news
4591 @section Why does Rmail need to write to @file{/usr/spool/mail}?
4592 @cindex Rmail and @file{/usr/spool/mail}
4593 @cindex @file{/usr/spool/mail} and Rmail
4595 This is the behavior of the @file{movemail} program which Rmail uses.
4596 This indicates that @file{movemail} is configured to use lock files.
4598 RMS writes:
4600 @quotation
4601 Certain systems require lock files to interlock access to mail files.
4602 On these systems, @file{movemail} must write lock files, or you risk losing
4603 mail.  You simply must arrange to let @file{movemail} write them.
4605 Other systems use the flock system call to interlock access.  On these
4606 systems, you should configure @file{movemail} to use @code{flock}.
4607 @end quotation
4609 @node Recovering mail files when Rmail munges them, Replying to the sender of a message, Rmail writes to /usr/spool/mail, Mail and news
4610 @section How do I recover my mail files after Rmail munges their format?
4611 @cindex Recovering munged mail files
4612 @cindex Rmail munged my files
4613 @cindex Mail files, recovering those munged by Rmail
4615 If you have just done @code{rmail-input} on a file and you don't want to
4616 save it in Rmail's format (called BABYL), just kill the buffer (with
4617 @kbd{C-x k}).
4619 If you typed @kbd{M-x rmail} and it read some messages out of your inbox
4620 and you want to put them in a Unix mail file, use @kbd{C-o} on each
4621 message.
4623 If you want to convert an existing file from BABYL format to Unix mail
4624 format, use the command @kbd{M-x unrmail}: it will prompt you for the
4625 input and output file names.
4627 @node Replying to the sender of a message, MIME with Emacs mail packages, Recovering mail files when Rmail munges them, Mail and news
4628 @section How can I force Rmail to reply to the sender of a message, but not the other recipients?
4629 @cindex Replying only to the sender of a message
4630 @cindex Sender, replying only to
4631 @cindex Rmail, replying to the sender of a message in
4633 @email{isaacson@@seas.upenn.edu, Ron Isaacson} says: When you hit
4634 @key{r} to reply in Rmail, by default it CCs all of the original
4635 recipients (everyone on the original @samp{To} and @samp{CC}
4636 lists). With a prefix argument (i.e., typing @kbd{C-u} before @key{r}),
4637 it replies only to the sender.  However, going through the whole
4638 @kbd{C-u} business every time you want to reply is a pain.  This is the
4639 best fix I've been able to come up with:
4641 @lisp
4642 (defun rmail-reply-t ()
4643   "Reply only to the sender of the current message. (See rmail-reply.)"
4644   (interactive)
4645   (rmail-reply t))
4647 (add-hook 'rmail-mode-hook
4648   '(lambda ()
4649      (define-key rmail-mode-map "r" 'rmail-reply-t)
4650      (define-key rmail-mode-map "R" 'rmail-reply)))
4651 @end lisp
4653 @node MIME with Emacs mail packages, Automatically starting a mail or news reader, Replying to the sender of a message, Mail and news
4654 @section How can I get my favorite Emacs mail package to support MIME?  
4655 @cindex MIME and Emacs mail packages
4656 @cindex Mail packages and MIME
4657 @cindex FAQ for MIME and Emacs
4659 Read the Emacs MIME FAQ, maintained by @email{trey@@cs.berkeley.edu,
4660 MacDonald Hall Jackson} at
4662 @uref{http://bmrc.berkeley.edu/~trey/emacs/mime.html}
4664 Version 6.x of VM supports MIME.  @xref{VM}.
4666 @node Automatically starting a mail or news reader, Reading news with Emacs, MIME with Emacs mail packages, Mail and news
4667 @section How do I make Emacs automatically start my mail/news reader?
4668 @cindex Mail reader, starting automatically
4669 @cindex News reader, starting automatically
4670 @cindex Starting mail/news reader automatically
4672 To start Emacs in Gnus:
4674 @example
4675 emacs -f gnus
4676 @end example
4678 in Rmail:
4680 @example
4681 emacs -f rmail
4682 @end example
4684 A more convenient way to start with Gnus:
4686 @example
4687 alias gnus 'emacs -f gnus'
4688 gnus
4689 @end example
4691 It is probably unwise to automatically start your mail or news reader
4692 from your @file{.emacs} file.  This would cause problems if you needed to run
4693 two copies of Emacs at one time.  Also, this would make it difficult for
4694 you to start Emacs quickly when you needed to.
4696 @node Reading news with Emacs, Gnus does not work with NNTP, Automatically starting a mail or news reader, Mail and news
4697 @section How do I read news under Emacs?
4698 @cindex Reading news under Emacs
4699 @cindex Usenet reader in Emacs
4700 @cindex Gnus newsreader
4702 Use @kbd{M-x gnus}.  It is documented in Info (@pxref{Learning how to do something}).
4704 @node Gnus does not work with NNTP, Viewing articles with embedded underlining, Reading news with Emacs, Mail and news
4705 @section Why doesn't Gnus work via NNTP?
4706 @cindex Gnus and NNTP
4707 @cindex NNTP, Gnus fails to work with
4709 There is a bug in NNTP version 1.5.10, such that when multiple requests
4710 are sent to the NNTP server, the server only handles the first one
4711 before blocking waiting for more input which never comes.  NNTP version
4712 1.5.11 claims to fix this.
4714 You can work around the bug inside Emacs like this:
4716 @lisp
4717 (setq nntp-maximum-request 1)
4718 @end lisp
4720 You can find out what version of NNTP your news server is running by
4721 telnetting to the NNTP port (usually 119) on the news server machine
4722 (i.e., "telnet server-machine 119").  The server should give its version
4723 number in the welcome message.  Type "quit" to get out.
4725 @xref{Spontaneous entry into isearch-mode}, for some additional ideas.
4727 @node Viewing articles with embedded underlining, Saving a multi-part Gnus posting, Gnus does not work with NNTP, Mail and news
4728 @section How do I view news articles with embedded underlining (e.g., ClariNews)?
4729 @cindex Underlining, embedded in news articles
4730 @cindex News articles with embedded underlining
4731 @cindex Embedded underlining in news articles
4733 Underlining appears like this:
4735 @example
4736 _^Hu_^Hn_^Hd_^He_^Hr_^Hl_^Hi_^Hn_^Hi_^Hn_^Hg
4737 @end example
4739 @email{amanda@@iesd.auc.dk, Per Abrahamsen} suggests using the following
4740 code, which uses the underline face to turn such text into true
4741 underlining:
4743 @lisp
4744 (defun gnus-article-prepare-overstrike ()
4745   ;; Prepare article for overstrike commands.
4746   (save-excursion
4747     (set-buffer gnus-article-buffer)
4748     (let ((buffer-read-only nil))
4749     (goto-char (point-min))
4750       (while (search-forward "\b" nil t)
4751         (let ((next (following-char))
4752               (previous (char-after (- (point) 2))))
4753           (cond ((eq next previous)
4754                  (delete-region (- (point) 2) (point))
4755                  (put-text-property (point) (1+ (point))
4756                                     'face 'bold))
4757                 ((eq next ?_)
4758                  (delete-region (1- (point)) (1+ (point)))
4759                  (put-text-property (1- (point)) (point)
4760                                     'face 'underline))
4761                 ((eq previous ?_)
4762                  (delete-region (- (point) 2) (point))
4763                  (put-text-property (point) (1+ (point))
4764                                     'face 'underline))))))))
4766 (add-hook 'gnus-article-prepare-hook 'gnus-article-prepare-overstrike)
4767 @end lisp
4769 If you prefer to do away with underlining altogether, you can
4770 destructively remove it with @kbd{M-x ununderline-region}; do this
4771 automatically via
4773 @lisp
4774 (add-hook 'gnus-article-prepare-hook
4775   '(lambda () (ununderline-region (point-min) (point-max))))
4776 @end lisp
4778 @node Saving a multi-part Gnus posting, Starting Gnus faster, Viewing articles with embedded underlining, Mail and news
4779 @section How do I save all the items of a multi-part posting in Gnus?
4780 @cindex Multi-part postings in Gnus, saving
4781 @cindex Saving multi-part postings in Gnus
4782 @cindex Gnus, saving multi-part postings in
4784 Use @code{gnus-uu}.  Type @kbd{C-c C-v C-h} in the Gnus summary buffer
4785 to see a list of available commands.
4787 @node Starting Gnus faster, Catching up in all newsgroups, Saving a multi-part Gnus posting, Mail and news
4788 @section How do I make Gnus start up faster?
4789 @cindex Faster, starting Gnus
4790 @cindex Starting Gnus faster
4791 @cindex Gnus, starting faster
4793 From the Gnus FAQ (@pxref{Learning more about Gnus}):
4795 @quotation
4796 @email{pktiwari@@eos.ncsu.edu, Pranav Kumar Tiwari} writes: I posted
4797 the same query recently and I got an answer to it. I am going to
4798 repeat the answer. What you need is a newer version of gnus, version
4799 5.0.4+. I am using 5.0.12 and it works fine with me with the
4800 following settings:
4802 @lisp
4803 (setq gnus-check-new-newsgroups nil
4804       gnus-read-active-file 'some
4805       gnus-nov-is-evil nil
4806       gnus-select-method '(nntp gnus-nntp-server))
4807 @end lisp
4808 @end quotation
4810 @node Catching up in all newsgroups, Killing based on nonstandard headers, Starting Gnus faster, Mail and news
4811 @section How do I catch up all newsgroups in Gnus?
4812 @cindex Catching up all newsgroups in Gnus
4813 @cindex Gnus, Catching up all newsgroups in
4815 In the @file{*Newsgroup*} buffer, type @kbd{M-< C-x ( c y C-x ) M-0 C-x e}
4817 Leave off the initial @kbd{M-<} if you only want to catch up from point
4818 to the end of the @file{*Newsgroup*} buffer.
4820 @node Killing based on nonstandard headers, Removing flashing messages, Catching up in all newsgroups, Mail and news
4821 @section Why can't I kill in Gnus based on the Newsgroups/Keywords/Control headers?
4822 @cindex Killing articles based on nonstandard headers
4823 @cindex Newsgroups header, killing articles based on
4824 @cindex Keywords header, killing articles based on
4825 @cindex Control header, killing articles based on
4827 Gnus will complain that the @samp{Newsgroups}, @samp{Keywords}, and
4828 @samp{Control} headers are "Unknown header" fields.
4830 For the @samp{Newsgroups} header, there is an easy workaround: kill on the
4831 @samp{Xref} header instead, which will be present on any cross-posted article
4832 (as long as your site carries the cross-post group).
4834 If you really want to kill on one of these headers, you can do it like
4835 this:
4837 @lisp
4838 (gnus-kill nil "^Newsgroups: .*\\(bad\\.group\\|worse\\.group\\)")
4839 @end lisp
4841 @node Removing flashing messages, Catch-up is slow in Gnus, Killing based on nonstandard headers, Mail and news
4842 @section How do I get rid of flashing messages in Gnus for slow connections?
4843 @cindex Flashing Gnus messages, removing
4844 @cindex Removing flashing Gnus messages
4845 @cindex Slow connections causing flashing messages in Gnus
4846 @cindex Gnus, flashing messages in
4848 Set @code{nntp-debug-read} to @code{nil}.
4850 @node Catch-up is slow in Gnus, Gnus hangs for a long time, Removing flashing messages, Mail and news
4851 @section Why is catch up slow in Gnus?
4852 @cindex Slow catch up in Gnus
4853 @cindex Gnus is slow when catching up
4854 @cindex Crosspostings make Gnus catching up slow
4856 Because Gnus is marking crosspostings read.  You can control this with
4857 the variable @code{gnus-use-cross-reference}.
4859 @node Gnus hangs for a long time, Learning more about Gnus, Catch-up is slow in Gnus, Mail and news
4860 @section Why does Gnus hang for a long time when posting?
4861 @cindex Hangs in Gnus
4862 @cindex Gnus hangs while posting
4863 @cindex Posting, Gnus hangs wile
4865 @email{tale@@uunet.uu.net, David Lawrence} explains:
4867 @quotation
4868 The problem is almost always interaction between NNTP and C News.  NNTP
4869 POST asks C News's inews to not background itself but rather hang around
4870 and give its exit status so it knows whether the post was successful.
4871 (That wait will on some systems not return the exit status of the
4872 waited for job is a different sort of problem.)  It ends up taking a
4873 long time because inews is calling relaynews, which often waits for
4874 another relaynews to free the lock on the news system so it can file the
4875 article.
4877 My preferred solution is to change inews to not call relaynews, but
4878 rather use newsspool.  This loses some error-catching functionality, but
4879 is for the most part safe as inews will detect a lot of the errors on
4880 its own.  The C News folks have sped up inews, too, so speed should look
4881 better to most folks as that update propagates around.
4882 @end quotation
4884 @node Learning more about Gnus,  , Gnus hangs for a long time, Mail and news
4885 @section Where can I find out more about Gnus?
4886 @cindex FAQ for Gnus
4887 @cindex Gnus FAQ
4888 @cindex Learning more about GNU
4890 Look for the Gnus FAQ, available at
4892 @uref{http://www.ccs.neu.edu/software/contrib/gnus/}
4894 @node Concept index,  , Mail and news, Top
4895 @unnumbered Concept Index
4896 @printindex cp
4898 @contents
4899 @bye