1 \input texinfo @c -*-texinfo-*- -*- coding: latin-1 -*-
3 @setfilename ../info/efaq
4 @settitle GNU Emacs FAQ
9 @c The @ifinfo stuff only appears in the Info version
13 * Emacs FAQ: (efaq). Frequently Asked Questions about Emacs.
16 Copyright 1994,1995,1996,1997,1998,1999 Reuven M. Lerner@*
17 Copyright 1992,1993 Steven Byrnes@*
18 Copyright 1990,1991,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.]
39 @c The @titlepage stuff only appears in the printed version
42 @center @titlefont{GNU Emacs FAQ}
44 @c The following two commands start the copyright page.
46 @vskip 0pt plus 1filll
47 Copyright @copyright{} 1994,1995,1996,1997,1998,1999 Reuven M. Lerner@*
48 Copyright @copyright{} 1992,1993 Steven Byrnes@*
49 Copyright @copyright{} 1990,1991,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.]
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}.
86 * Compiling and installing Emacs::
87 * Finding Emacs and related packages::
88 * Major packages and programs::
90 * Alternate character sets::
95 @c ------------------------------------------------------------
96 @node FAQ notation, General questions, Top, Top
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
107 * Extended commands::
109 * Filename conventions::
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.?
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
131 @kbd{C-x}: press the @key{x} key while holding down the @key{Control} key
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})
138 @kbd{M-C-x}: press the @key{x} key while holding down both @key{Control}
142 @kbd{C-M-x}: a synonym for the above
145 @key{LFD}: Linefeed or Newline; same as @kbd{C-j}
148 @key{RET}: @key{Return}, sometimes marked @key{Enter}; same as @kbd{C-m}
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)
155 @key{ESC}: Escape; same as @kbd{C-[}
158 @key{TAB}: Tab; same as @kbd{C-i}
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
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
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
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
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
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
280 Free Software Foundation
283 League for Programming Freedom
286 Open Software Foundation
292 Richard Matthew Stallman
295 File Transfer Protocol
298 GNU General Public License
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
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.
325 * Real meaning of copyleft::
326 * Guidelines for newsgroup postings::
327 * Newsgroup archives::
329 * Unsubscribing from Emacs lists::
330 * Contacting the FSF::
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
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.
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.
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
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
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.
457 RMS says it is sometimes fine to post to @uref{news:gnu.emacs.help}:
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.
465 If you are unsure whether you have found a bug, consider the following
466 non-exhaustive list, courtesy of RMS:
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
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
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
509 @uref{http://www.gnu.org/}
512 Free Software Foundation@*
513 59 Temple Place - Suite 330@*
514 Boston, MA 02111-1307@*
519 For details on how to order items directly from the FSF, see the file
522 @c ------------------------------------------------------------
523 @node Getting help, Status of Emacs, General questions, Top
524 @chapter Getting help
527 This section tells you how to get help with Emacs
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::
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.
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
587 You can order a hardcopy of the manual from the FSF. @xref{Getting a
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.
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
602 You can list all of the functions and variables whose names contain a
603 certain word using @kbd{M-x apropos}.
606 There are many other commands in Emacs for getting help and
607 information. To get a list of these commands, type @samp{?} after
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
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
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:
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:
698 * Topic: (relative-pathname). Short description of topic.
703 If you want to install Info files and you don't have the necessary
704 privileges, you have several options:
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
717 C-h i g (~/XXX) @key{RET}
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:
728 (setq Info-default-directory-list
729 (cons "~/Info" Info-default-directory-list))
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.
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:
753 @item Make sure the first line of the Texinfo file looks like this:
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.
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:
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/}.
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).
828 Emacs General Public License
831 Emacs Availability Information, including the popular "Free Software
832 Foundation Order Form"
835 Emacs Frequently Asked Questions (You're reading it)
838 How to get GNU Software by Internet FTP or by UUCP
844 Richard Stallman discusses his public-domain UNIX-compatible software
845 system with BYTE editors
848 Why you should join the League for Programming Freedom
851 Status of Emacs on Various Machines and Systems
854 GNU Project Electronic Mailing Lists
857 Emacs news, a history of user-visible changes
860 GNU Service Directory
863 including "Using Emacstool with GNU Emacs"
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:
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}).
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:
918 ?GNU Emacs Frequently Asked Questions?rc:m
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
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/}
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}).
942 Via the World Wide Web. A hypertext version is available at
944 @uref{http://www.lerner.co.il/emacs/}
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
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
969 For more information, send email to @email{mail-server@@rtfm.mit.edu}
970 with "help" and "index" in the body on separate lines.
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
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.
989 * Origin of the term Emacs::
990 * Latest version of Emacs::
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
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
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
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
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::
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::
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::
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
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
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
1168 (setq line-number-mode t)
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
1179 (setq column-number-mode t)
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
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
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
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
1217 (multiple-frames "%b" ("" invocation-name "@@" system-name))
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}:
1225 (setq frame-title-format "%b")
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:
1236 (quietly-read-abbrev-file)
1239 (add-hook 'XXX-mode-hook
1241 (setq abbrev-mode t)))
1244 @node Turning on auto-fill by default, Associating modes with files, Turning on abbrevs by default, Common requests
1245 @section How do I turn on @code{auto-fill-mode} by default?
1246 @cindex @code{auto-fill-mode}, activating automatically
1247 @cindex Filling automatically
1248 @cindex Automatic entry to @code{auto-fill-mode}
1250 To turn on @code{auto-fill-mode} just once for one buffer, use @kbd{M-x
1253 To turn it on for every buffer in a certain mode, you must use the hook
1254 for that mode. For example, to turn on @code{auto-fill} mode for all
1255 text buffers, including the following in your @file{.emacs} file:
1258 (add-hook 'text-mode-hook 'turn-on-auto-fill)
1261 If you want @code{auto-fill} mode on in all major modes, do this:
1264 (setq-default auto-fill-function 'do-auto-fill)
1267 @node Associating modes with files, Working with unprintable characters, Turning on auto-fill by default, Common requests
1268 @section How do I make Emacs use a certain major mode for certain files?
1269 @cindex Associating modes with files
1270 @cindex File extensions and modes
1271 @cindex @code{auto-mode-alist}, modifying
1272 @cindex Modes, associating with file extensions
1274 If you want to use XXX mode for all files which end with the extension
1275 @samp{.YYY}, this will do it for you:
1278 (setq auto-mode-alist (cons '("\\.YYY\\'" . XXX-mode) auto-mode-alist))
1281 Otherwise put this somewhere in the first line of any file you want to
1282 edit in XXX mode (in the second line, if the first line begins with
1289 Beginning with Emacs 19, the variable @code{interpreter-mode-alist}
1290 specifies which mode to use when loading a shell script. (Emacs
1291 determines which interpreter you're using by examining the first line of
1292 the file.) This feature only applies when the file name doesn't
1293 indicate which mode to use. Use @kbd{C-h v} (or @kbd{M-x
1294 describe-variable}) on @code{interpreter-mode-alist} to learn more.
1296 @node Working with unprintable characters, Highlighting a region, Associating modes with files, Common requests
1297 @section How do I search for, delete, or replace unprintable (eight-bit or control) characters?
1298 @cindex Unprintable characters, working with
1299 @cindex Working with unprintable characters
1300 @cindex Control characters, working with
1301 @cindex Eight-bit characters, working with
1302 @cindex Searching for unprintable characters
1303 @cindex Regexps and unprintable characters
1305 To search for a single character that appears in the buffer as, for
1306 example, @samp{\237}, you can type @kbd{C-s C-q 2 3 7}. (This assumes
1307 the value of @code{search-quote-char} is 17 (i.e., @kbd{C-q}).)
1308 Searching for ALL unprintable characters is best done with a regular
1309 expression ("regexp") search. The easiest regexp to use for the
1310 unprintable chars is the complement of the regexp for the printable
1316 Regexp for the printable chars: @samp{[\t\n\r\f -~]}
1319 Regexp for the unprintable chars: @samp{[^\t\n\r\f -~]}
1323 To type these special characters in an interactive argument to
1324 @code{isearch-forward-regexp} or @code{re-search-forward}, you need to
1325 use @kbd{C-q}. (@samp{\t}, @samp{\n}, @samp{\r}, and @samp{\f} stand
1326 respectively for @key{TAB}, @key{LFD}, @key{RET}, and @kbd{C-l}.) So,
1327 to search for unprintable characters using @code{re-search-forward}:
1329 @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}}
1331 Using @code{isearch-forward-regexp}:
1333 @kbd{M-C-s [^ @key{TAB} @key{RET} C-q @key{RET} C-q C-l @key{SPC} -~]}
1335 To delete all unprintable characters, simply use replace-regexp:
1337 @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}}
1339 Replacing is similar to the above. To replace all unprintable
1340 characters with a colon, use:
1342 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}
1346 @item You don't need to quote @key{TAB} with either isearch or typing
1347 something in the minibuffer.
1351 @node Highlighting a region, Controlling case sensitivity, Working with unprintable characters, Common requests
1352 @section How can I highlight a region of text in Emacs?
1353 @cindex Highlighting text
1354 @cindex Text, highlighting
1355 @cindex @code{transient-mark-mode}
1356 @cindex Region, highlighting a
1358 If you are using a windowing system such as X, you can cause the region
1359 to be highlighted when the mark is active by including
1362 (transient-mark-mode t)
1365 in your @file{.emacs} file. (Also see @xref{Turning on syntax highlighting}.)
1367 @node Controlling case sensitivity, Wrapping words automatically, Highlighting a region, Common requests
1368 @section How do I control Emacs's case-sensitivity when searching/replacing?
1369 @cindex @code{case-fold-search}
1370 @cindex Case sensitivity of searches
1371 @cindex @code{case-replace}
1372 @cindex Searching without case sensitivity
1373 @cindex Ignoring case in searches
1375 For searching, the value of the variable @code{case-fold-search}
1376 determines whether they are case sensitive:
1379 (setq case-fold-search nil) ; make searches case sensitive
1380 (setq case-fold-search t) ; make searches case insensitive
1383 Similarly, for replacing the variable @code{case-replace} determines
1384 whether replacements preserve case.
1386 To change the case sensitivity just for one major mode, use the major
1387 mode's hook. For example:
1390 (add-hook 'XXX-mode-hook
1392 (setq case-fold-search nil)))
1395 @node Wrapping words automatically, Spell-checkers, Controlling case sensitivity, Common requests
1396 @section How do I make Emacs wrap words for me?
1397 @cindex Wrapping word automatically
1398 @cindex @code{auto-fill-mode}, introduction to
1399 @cindex Maximum line width, default value
1400 @cindex @code{fill-column}, default value
1402 Use @code{auto-fill-mode}, activated by typing @kbd{M-x auto-fill-mode}.
1403 The default maximum line width is 70, determined by the variable
1404 @code{fill-column}. To learn how to turn this on automatically, @pxref{Turning on auto-fill by default}.
1406 @node Spell-checkers, Checking TeX and *roff documents, Wrapping words automatically, Common requests
1407 @section Where can I get a better spelling checker for Emacs?
1408 @cindex Checking spelling
1409 @cindex Spelling, checking text documents
1411 Use Ispell. @xref{Ispell}.
1413 @node Checking TeX and *roff documents, Changing load-path, Spell-checkers, Common requests
1414 @section How can I spell-check @TeX{} or *roff documents?
1415 @cindex Spelling, checking @TeX{} documents
1416 @cindex @TeX{} documents, checking spelling in
1418 Use Ispell. Ispell can handle @TeX{} and *roff documents.
1421 @node Changing load-path, Using an already running Emacs process, Checking TeX and *roff documents, Common requests
1422 @section How do I change @code{load-path}?
1423 @cindex @code{load-path}, modifying
1424 @cindex Modifying @code{load-path}
1425 @cindex Adding to @code{load-path}
1427 In general, you should only add to the @code{load-path}. You can add
1428 directory @var{/XXX/YYY} to the load path like this:
1431 (setq load-path (cons "/XXX/YYY/" load-path))
1434 To do this relative to your home directory:
1437 (setq load-path (cons "~/YYY/" load-path)
1440 @node Using an already running Emacs process, Compiler error messages, Changing load-path, Common requests
1441 @section How do I use an already running Emacs from another window?
1442 @cindex @code{emacsclient}
1443 @cindex Emacs server functions
1444 @cindex Using an existing Emacs process
1446 @code{emacsclient}, which comes with Emacs, is for editing a file using
1447 an already running Emacs rather than starting up a new Emacs. It does
1448 this by sending a request to the already running Emacs, which must be
1449 expecting the request.
1456 Emacs must have executed the @code{server-start} function for
1457 @samp{emacsclient} to work. This can be done either by a command line
1461 emacs -f server-start
1464 or by invoking @code{server-start} from @file{.emacs}:
1467 (if (some conditions are met) (server-start))
1470 When this is done, Emacs starts a subprocess running a program called
1471 @samp{server}. @samp{server} creates a Unix domain socket. The socket
1472 is either named @file{.emacs_server}, in the user's home directory,
1473 or @file{esrv-@var{USER-ID}-@var{SYSTEM-NAME}}, in the @file{/tmp}
1474 directory, depending on how @samp{emacsserver} was compiled.
1476 To get your news reader, mail reader, etc., to invoke
1477 @samp{emacsclient}, try setting the environment variable @code{EDITOR}
1478 (or sometimes @code{VISUAL}) to the value @samp{emacsclient}. You may
1479 have to specify the full pathname of the @samp{emacsclient} program
1484 setenv EDITOR emacsclient
1486 # using full pathname
1487 setenv EDITOR /usr/local/emacs/etc/emacsclient
1490 EDITOR=emacsclient ; export EDITOR
1495 When @samp{emacsclient} is run, it connects to the @file{.emacs_server}
1496 socket and passes its command line options to @samp{server}. When
1497 @samp{server} receives these requests, it sends this information on the
1498 the Emacs process, which at the next opportunity will visit the files
1499 specified. (Line numbers can be specified just like with Emacs.) The
1500 user will have to switch to the Emacs window by hand. When the user is
1501 done editing a file, the user can type @kbd{C-x #} (or @kbd{M-x
1502 server-edit}) to indicate this. If there is another buffer requested by
1503 emacsclient, Emacs will switch to it; otherwise emacsclient will exit,
1504 signaling the calling program to continue.
1506 @samp{emacsclient} and @samp{server} must be running on machines which
1507 share the same filesystem for this to work. The pathnames that
1508 @samp{emacsclient} specifies should be correct for the filesystem that
1509 the Emacs process sees. The Emacs process should not be suspended at
1510 the time @samp{emacsclient} is invoked. @samp{emacsclient} should
1511 either be invoked from another X window or from a shell window inside
1514 There is an enhanced version of @samp{emacsclient}/server called
1515 @samp{gnuserv} by @email{ange@@hplb.hpl.hp.com, Andy Norman} which is
1516 available in the Emacs Lisp Archive (@pxref{Packages that do not come
1517 with Emacs}). @samp{gnuserv} uses Internet domain sockets, so it can
1518 work across most network connections. It also supports the execution of
1519 arbitrary Emacs Lisp forms and does not require the client program to
1520 wait for completion.
1522 The alpha version of an enhanced @samp{gnuserv} is available
1525 @uref{ftp://ftp.wellfleet.com/netman/psmith/emacs/gnuserv-2.1alpha.tar.gz}
1529 @node Compiler error messages, Indenting switch statements, Using an already running Emacs process, Common requests
1530 @section How do I make Emacs recognize my compiler's funny error messages?
1531 @cindex Compiler error messages, recognizing
1532 @cindex Recognizing non-standard compiler errors
1533 @cindex Regexps for recognizing compiler errors
1534 @cindex Errors, recognizing compiler
1536 The variable @code{compilation-error-regexp-alist} helps control how
1537 Emacs parses your compiler output. It is a list of triples of the form:
1538 @code{(@var{regexp} @var{file-idx} @var{line-idx})}, where @var{regexp}, @var{file-idx} and
1539 @var{line-idx} are strings. To help determine what the constituent
1540 elements should be, load @file{compile.el} and then use @kbd{C-h v
1541 compilation-error-regexp-alist @key{RET}}
1543 to see the current value. A good idea is to look at @file{compile.el}
1544 itself as the comments included for this variable are quite useful ---
1545 the regular expressions required for your compiler's output may be very
1546 close to one already provided. Once you have determined the proper
1547 regexps, use the following to inform Emacs of your changes:
1550 (setq compilation-error-regexp-alist
1551 (cons '(REGEXP FILE-IDX LINE-IDX)
1552 compilation-error-regexp-alist))
1555 @node Indenting switch statements, Horizontal scrolling, Compiler error messages, Common requests
1556 @section How do I change the indentation for @code{switch}?
1557 @cindex @code{switch}, indenting
1558 @cindex Indenting of @code{switch}
1560 Many people want to indent their @code{switch} statements like this:
1578 The solution at first appears to be: set @code{c-indent-level} to 4 and
1579 @code{c-label-offset} to -2. However, this will give you an indentation
1580 spacing of four instead of two.
1582 The solution is to use @code{cc-mode} (the default mode for C
1583 programming in Emacs 20) and add the following line:
1586 (c-set-offset 'case-label '+)
1589 There appears to be no way to do this with the old @code{c-mode}.
1591 @node Horizontal scrolling, Overwrite mode, Indenting switch statements, Common requests
1592 @section How can I make Emacs automatically scroll horizontally?
1593 @cindex @code{hscroll-mode}
1594 @cindex Horizontal scrolling
1595 @cindex Scrolling horizontally
1597 Use @code{hscroll-mode}, included in Emacs 20. Here is some information from
1598 the documentation, available by typing @kbd{C-h f hscroll-mode @key{RET}}:
1600 Automatically scroll horizontally when the point moves off the
1601 left or right edge of the window.
1605 @item Type @kbd{M-x hscroll-mode} to enable it in the current buffer.
1606 @item Type @kbd{M-x hscroll-global-mode} to enable it in every buffer.
1607 @item @code{turn-on-hscroll} is useful in mode hooks as in:
1610 (add-hook 'text-mode-hook 'turn-on-hscroll)
1613 @item @code{hscroll-margin} controls how close the cursor can get to the
1616 @item @code{hscroll-step-percent} controls how far to jump once we decide to do so.
1620 @node Overwrite mode, Turning off beeping, Horizontal scrolling, Common requests
1621 @section How do I make Emacs "typeover" or "overwrite" instead of inserting?
1622 @cindex @key{Insert}
1623 @cindex @code{overwrite-mode}
1624 @cindex Overwriting existing text
1625 @cindex Toggling @code{overwrite-mode}
1627 @kbd{M-x overwrite-mode} (a minor mode). This toggles
1628 @code{overwrite-mode} on and off, so exiting from @code{overwrite-mode}
1629 is as easy as another @kbd{M-x overwrite-mode}.
1631 On some workstations, @key{Insert} toggles @code{overwrite-mode} on and off.
1633 @node Turning off beeping, Turning the volume down, Overwrite mode, Common requests
1634 @section How do I stop Emacs from beeping on a terminal?
1635 @cindex Beeping, turning off
1636 @cindex Visible bell
1637 @cindex Bell, visible
1639 @email{martin@@cc.gatech.edu, Martin R. Frank} writes:
1641 Tell Emacs to use the "visible bell" instead of the audible bell, and
1642 set the visible bell to nothing.
1644 That is, put the following in your @code{TERMCAP} environment variable
1645 (assuming you have one):
1651 And evaluate the following Lisp form:
1654 (setq visible-bell t)
1657 @node Turning the volume down, Automatic indentation, Turning off beeping, Common requests
1658 @section How do I turn down the bell volume in Emacs running under X Windows?
1659 @cindex Bell, volume of
1660 @cindex Volume of bell
1662 You can adjust the bell volume and duration for all programs with the
1663 shell command @file{xset}.
1665 Invoking @file{xset} without any arguments produces some basic information,
1666 including the following:
1669 usage: xset [-display host:dpy] option ...
1672 To set bell volume, pitch and duration:
1673 b [vol [pitch [dur]]] b on
1676 @node Automatic indentation, Matching parentheses, Turning the volume down, Common requests
1677 @section How do I tell Emacs to automatically indent a new line to the indentation of the previous line?
1678 @cindex Indenting new lines
1679 @cindex New lines, indenting of
1680 @cindex Previous line, indenting according to
1682 Such behavior is automatic in Emacs 20. From the NEWS file for Emacs
1686 ** In Text mode, now only blank lines separate paragraphs. This makes
1687 it possible to get the full benefit of Adaptive Fill mode in Text mode,
1688 and other modes derived from it (such as Mail mode). @key{TAB} in Text
1689 mode now runs the command @code{indent-relative}; this makes a practical
1690 difference only when you use indented paragraphs.
1692 As a result, the old Indented Text mode is now identical to Text mode,
1693 and is an alias for it.
1695 If you want spaces at the beginning of a line to start a paragraph, use
1696 the new mode, Paragraph Indent Text mode.
1699 If you have @code{auto-fill-mode} on (@pxref{Turning on auto-fill by
1700 default}), you can tell Emacs to prefix every line with a certain
1701 character sequence, the "fill prefix." Type the prefix at the beginning
1702 of a line, position point after it, and then type @kbd{C-x .}
1703 (@code{set-fill-prefix}) to set the fill prefix. Thereafter,
1704 auto-filling will automatically put the fill prefix at the beginning of
1705 new lines, and @kbd{M-q} (@code{fill-paragraph}) will maintain any fill
1706 prefix when refilling the paragraph.
1708 If you have paragraphs with different levels of indentation, you will
1709 have to set the fill prefix to the correct value each time you move to a
1710 new paragraph. To avoid this hassle, try one of the many packages
1711 available from the Emacs Lisp Archive (@pxref{Packages that do not come
1712 with Emacs}.) Look up "fill" and "indent" in the Lisp Code Directory
1715 @node Matching parentheses, Hiding #ifdef lines, Automatic indentation, Common requests
1716 @section How do I show which parenthesis matches the one I'm looking at?
1717 @cindex Parentheses, matching
1718 @cindex @file{paren.el}
1719 @cindex Highlighting matching parentheses
1720 @cindex Pairs of parentheses, highlighting
1721 @cindex Matching parentheses
1723 As of version 19, Emacs comes with @file{paren.el}, which (when loaded)
1724 will automatically highlight matching parentheses whenever point (i.e.,
1725 the cursor) is located over one. To load @file{paren.el} automatically,
1732 in your @file{.emacs} file. @email{shutkoa@@ugsolutions.com, Alan Shutko}
1733 reports that as of version 20.1, you must also call @code{show-paren-mode} in
1734 your @file{.emacs} file:
1740 @code{customize} will let you turn on @code{show-paren-mode}. Use
1741 @kbd{M-x customize-group @key{RET} paren-showing @key{RET}}. From
1742 within @code{customize}, you can also go directly to the "paren-showing"
1745 Alternatives to paren include:
1750 If you're looking at a right parenthesis (or brace or bracket) you can
1751 delete it and reinsert it. Emacs will blink the cursor on the matching
1755 @kbd{M-C-f} (@code{forward-sexp}) and @kbd{M-C-b} (@code{backward-sexp})
1756 will skip over one set of balanced parentheses, so you can see which
1757 parentheses match. (You can train it to skip over balanced brackets
1758 and braces at the same time by modifying the syntax @key{TAB}le.)
1761 Here is some Emacs Lisp that will make the @key{%} key show the matching
1762 parenthesis, like in vi. In addition, if the cursor isn't over a
1763 parenthesis, it simply inserts a % like normal.
1766 ;; By an unknown contributor
1768 (global-set-key "%" 'match-paren)
1770 (defun match-paren (arg)
1771 "Go to the matching paren if on a paren; otherwise insert %."
1773 (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
1774 ((looking-at "\\s\)") (forward-char 1) (backward-list 1))
1775 (t (self-insert-command (or arg 1)))))
1780 @node Hiding #ifdef lines, Repeating commands, Matching parentheses, Common requests
1781 @section In C mode, can I show just the lines that will be left after @code{#ifdef} commands are handled by the compiler?
1782 @cindex @code{#ifdef}, selective display of
1783 @cindex @code{hide-ifdef-mode}
1784 @cindex Hiding @code{#ifdef} text
1785 @cindex Selectively displaying @code{#ifdef} code
1787 @kbd{M-x hide-ifdef-mode}. (This is a minor mode.) You might also want
1788 to try @file{cpp.el}, available at the Emacs Lisp Archive
1789 (@pxref{Packages that do not come with Emacs}).
1791 @node Repeating commands, Valid X resources, Hiding #ifdef lines, Common requests
1792 @section Is there an equivalent to the @code{.} (dot) command of vi?
1793 @cindex Repeating commands as with vi
1794 @cindex Command, repeat last
1795 @cindex @code{.}, equivalent to vi command
1797 (@code{.} is the redo command in vi. It redoes the last insertion/deletion.)
1799 As of Emacs 20.3, there is indeed a @code{repeat} command (@kbd{C-x .})
1800 that repeats the last command. If you preface it with a prefix
1801 argument, the prefix arg is applied to the command.
1803 You can also type @kbd{C-x @key{ESC} @key{ESC}}
1804 (@code{repeat-complex-command}) to reinvoke commands that used the
1805 minibuffer to get arguments. In @code{repeat-complex-command} you can
1806 type @kbd{M-p} and @kbd{M-n} to scan through all the different complex
1807 commands you've typed.
1809 To repeat a set of commands, use keyboard macros. (@inforef{Keyboard
1810 Macros, Keyboard Macros, emacs}.)
1812 If you're really desperate for the @code{.} command, use VIPER, which comes
1813 with Emacs, and which appears to support it. (@xref{VIPER}.)
1815 @node Valid X resources, Evaluating Emacs Lisp code, Repeating commands, Common requests
1816 @section What are the valid X resource settings (i.e., stuff in .Xdefaults)?
1817 @cindex Resources, X
1819 @cindex Setting X resources
1821 @inforef{Resources X, Resources X, emacs}.
1823 You can also use a resource editor, such as editres (for X11R5 and
1824 onwards), to look at the resource names for the menu bar, assuming Emacs
1825 was compiled with the X toolkit.
1827 @node Evaluating Emacs Lisp code, Changing the length of a Tab, Valid X resources, Common requests
1828 @section How do I execute ("evaluate") a piece of Emacs Lisp code?
1829 @cindex Evaluating Lisp code
1830 @cindex Lisp forms, evaluating
1832 There are a number of ways to execute ("evaluate," in Lisp lingo) an
1838 If you want it evaluated every time you run Emacs, put it in a file
1839 named @file{.emacs} in your home directory. This is known as your ".emacs
1840 file," and contains all of your personal customizations.
1843 You can type the form in the @file{*scratch*} buffer, and then type
1844 @key{LFD} (or @kbd{C-j}) after it. The result of evaluating the form
1845 will be inserted in the buffer.
1848 In @code{emacs-lisp-mode}, typing @kbd{M-C-x} evaluates a top-level form
1849 before or around point.
1852 Typing @kbd{C-x C-e} in any buffer evaluates the Lisp form immediately
1853 before point and prints its value in the echo area.
1856 Typing @kbd{M-:} or @kbd{M-x eval-expression} allows you to type a Lisp
1857 form in the minibuffer which will be evaluated.
1860 You can use @kbd{M-x load-file} to have Emacs evaluate all the Lisp
1861 forms in a file. (To do this from Lisp use the function @code{load}
1864 The functions @code{load-library}, @code{eval-region},
1865 @code{eval-current-buffer}, @code{require}, and @code{autoload} are also
1866 useful; @pxref{Emacs Lisp documentation} if you want to learn more about
1871 @node Changing the length of a Tab, Inserting > at the beginning of each line, Evaluating Emacs Lisp code, Common requests
1872 @section How do I change Emacs's idea of the @key{TAB} character's length?
1874 @cindex Length of tab character
1875 @cindex @code{default-tab-width}
1877 Set the variable @code{default-tab-width}. For example, to set
1878 @key{TAB} stops every 10 characters, insert the following in your
1882 (setq default-tab-width 10)
1885 Do not confuse variable @code{tab-width} with variable
1886 @code{tab-stop-list}. The former is used for the display of literal
1887 @key{TAB} characters. The latter controls what characters are inserted
1888 when you press the @key{TAB} character in certain modes.
1890 @node Inserting > at the beginning of each line, Underlining paragraphs, Changing the length of a Tab, Common requests
1891 @section How do I insert @samp{>} at the beginning of every line?
1892 @cindex Prefix character, inserting in mail/news replies
1893 @cindex Replies to mail/news, inserting a prefix character
1894 @cindex @code{mail-yank-prefix}
1895 @cindex Mail replies, inserting a prefix character
1896 @cindex News replies, inserting a prefix character
1898 To do this to an entire buffer, type @kbd{M-< M-x replace-regexp
1899 @key{RET} ^ @key{RET} > @key{RET}}.
1901 To do this to a region, use @code{string-rectangle} (@kbd{C-x r t}).
1902 Set the mark (@kbd{C-@key{SPC}}) at the beginning of the first line you
1903 want to prefix, move the cursor to last line to be prefixed, and type
1904 @kbd{C-x r t > @key{RET}}. To do this for the whole buffer, type
1905 @kbd{C-x h C-x r t > @key{RET}}.
1907 If you are trying to prefix a yanked mail message with @samp{>}, you
1908 might want to set the variable @code{mail-yank-prefix}. Better yet, get
1909 the Supercite package (@pxref{Supercite}), which provides flexible
1910 citation for yanked mail and news messages. @xref{Changing the included
1911 text prefix}, for additional information.
1913 @node Underlining paragraphs, Repeating a command as many times as possible, Inserting > at the beginning of each line, Common requests
1914 @section How do I insert "_^H" before each character in a region to get an underlined paragraph?
1915 @cindex Underlining a region of text
1916 @cindex @code{underline-region}
1918 @kbd{M-x underline-region}.
1920 @node Repeating a command as many times as possible, Forcing the cursor to remain in the same column, Underlining paragraphs, Common requests
1921 @section How do I repeat a command as many times as possible?
1922 @cindex Repeating commands
1923 @cindex Commands, repeating
1925 Use @kbd{C-x (} and @kbd{C-x )} to make a keyboard macro that invokes
1926 the command and then type @kbd{M-0 C-x e}.
1928 Any messages your command prints in the echo area will be suppressed.
1930 @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
1931 @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?
1932 @cindex @code{picture-mode}
1933 @cindex Remaining in the same column, regardless of contents
1934 @cindex Vertical movement in empty documents
1936 @kbd{M-x picture-mode}.
1938 @node Forcing Emacs to iconify itself, Using regular expressions, Forcing the cursor to remain in the same column, Common requests
1939 @section How do I tell Emacs to iconify itself?
1940 @cindex Iconification under X Windows
1941 @cindex X Windows and iconification
1942 @cindex Suspending Emacs
1944 @kbd{C-z} iconifies Emacs when running under X Windows and suspends Emacs
1945 otherwise. @inforef{Misc X, Misc X, emacs}.
1947 @node Using regular expressions, Replacing text across multiple files, Forcing Emacs to iconify itself, Common requests
1948 @section How do I use regexps (regular expressions) in Emacs?
1950 @cindex Regular expressions
1951 @cindex Differences between Unix and Emacs regexps
1952 @cindex Unix regeps, differences from Emacs
1953 @cindex Text strings, putting regexps in
1955 @inforef{Regexps, Regexps, emacs}.
1957 The "or" operator is @samp{\|}, not @samp{|}, and the grouping operators
1958 are @samp{\(} and @samp{\)}. Also, the string syntax for a backslash is
1959 @samp{\\}. To specify a regular expression like @samp{xxx\(foo\|bar\)}
1960 in a Lisp string, use @samp{xxx\\(foo\\|bar\\)}.
1962 Notice the doubled backslashes!
1966 @item Unlike in Unix @file{grep}, @file{sed}, etc., a complement
1967 character set (@samp{[^...]}) can match a newline character (@key{LFD}
1968 aka @kbd{C-j} aka @samp{\n}), unless newline is mentioned as one of the
1969 characters not to match.
1971 @item The character syntax regexps (e.g., @samp{\sw}) are not
1972 meaningful inside character set regexps (e.g., @samp{[aeiou]}). (This
1973 is actually typical for regexp syntax.)
1977 @node Replacing text across multiple files, Documentation for etags, Using regular expressions, Common requests
1978 @section How do I perform a replace operation across more than one file?
1979 @cindex Replacing strings across files
1980 @cindex Multiple files, replacing across
1981 @cindex Files, replacing strings across multiple
1983 The "tags" feature of Emacs includes the command
1984 @code{tags-query-replace} which performs a query-replace across all the
1985 files mentioned in the TAGS file. @inforef{Tags Search, Tags Search,
1988 As of Emacs 19.29, Dired mode (@kbd{M-x dired @key{RET}}, or @kbd{C-x
1989 d}) supports the command @code{dired-do-query-replace}, which allows
1990 users to replace regular expressions in multiple files.
1992 @node Documentation for etags, Disabling backups, Replacing text across multiple files, Common requests
1993 @section Where is the documentation for @file{etags}?
1994 @cindex Documentation for @file{etags}
1995 @cindex @file{etags}, documentation for
1997 The @file{etags} man page should be in the same place as the
1998 @file{emacs} man page.
2000 Quick command-line switch descriptions are also available. For example,
2003 @node Disabling backups, Disabling auto-save-mode, Documentation for etags, Common requests
2004 @section How do I disable backup files?
2005 @cindex Backups, disabling
2006 @cindex Disabling backups
2008 You probably don't want to do this, since backups are useful.
2010 To avoid seeing backup files (and other "uninteresting" files) in Dired,
2011 load dired-x by adding the following to your @file{.emacs} file:
2014 (add-hook 'dired-load-hook
2019 With dired-x loaded, @kbd{M-o} toggles omitting in each dired buffer.
2020 You can make omitting the default for new dired buffers by putting the
2021 following in your @file{.emacs}:
2024 (setq initial-dired-omit-files-p t)
2027 If you're tired of seeing backup files whenever you do an "ls" at the
2028 Unix shell, try GNU ls with the "-B" option. GNU ls is part of the GNU
2029 fileutils package, available at mirrors of @samp{ftp.gnu.org} (@pxref{Current GNU distributions} ).
2031 To disable or change how backups are made, see "Backup Names" in the
2034 @node Disabling auto-save-mode, Modifying pull-down menus, Disabling backups, Common requests
2035 @section How do I disable @code{auto-save-mode}?
2036 @cindex Disabling @code{auto-save-mode}
2038 @cindex Saving at frequent intervals
2040 You probably don't want to do this, since auto-saving is useful,
2041 especially when Emacs or your computer crashes while you are editing a
2044 Instead, you might want to change the variable
2045 @code{auto-save-interval}, which specifies how many keystrokes Emacs
2046 waits before auto-saving. Increasing this value forces Emacs to wait
2047 longer between auto-saves, which might annoy you less.
2049 You might also want to look into Sebastian Kremer's @code{auto-save}
2050 package, available from the Lisp Code Archive (@pxref{Packages that do not come
2052 package also allows you to place all auto-save files in one directory,
2053 such as @file{/tmp}.
2055 To disable or change how @code{auto-save-mode} works, see "Auto Save" in the
2058 @node Modifying pull-down menus, Deleting menus and menu options, Disabling auto-save-mode, Common requests
2059 @section How can I create or modify new pull-down menu options?
2060 @cindex Pull-down menus, creating or modifying
2061 @cindex Menus, creating or modifying
2062 @cindex Creating new menu options
2063 @cindex Modifying pull-down menus
2064 @cindex Menus and keymaps
2065 @cindex Keymaps and menus
2067 Each menu title (e.g., Buffers, File, Edit) represents a local or global
2068 keymap. Selecting a menu title with the mouse displays that keymap's
2069 non-nil contents in the form of a menu.
2071 So to add a menu option to an existing menu, all you have to do is add a
2072 new definition to the appropriate keymap. Adding a "forward word"
2073 command to the "Edit" menu thus requires the following Lisp code:
2076 (define-key global-map
2077 [menu-bar edit forward]
2078 '("Forward word" . forward-word))
2081 The first line adds the entry to the global keymap, which includes
2082 global menu bar entries. Replacing the reference to @code{global-map}
2083 with a local keymap would add this menu option only within a particular
2086 The second line describes the path from the menu-bar to the new entry.
2087 Placing this menu entry underneath the "File" menu would mean changing
2088 the word "edit" in the second line to "file."
2090 The third line is a cons cell whose first element is the title that will
2091 be displayed, and whose second element is the function that will be
2092 called when that menu option is invoked.
2094 To add a new menu, rather than a new option to an existing menu, we must
2095 define an entirely new keymap:
2098 (define-key global-map [menu-bar words]
2099 (cons "Words" (make-sparse-keymap "Words")))
2102 The above code creates a new sparse keymap, gives it the name "Words",
2103 and attaches it to the global menu bar. Adding the "forward word"
2104 command to this new menu would thus require the following code:
2107 (define-key global-map
2108 [menu-bar words forward]
2109 '("Forward word" . forward-word))
2112 Note that because of the way keymaps work, menu options are displayed
2113 with the more recently defined items at the top. Thus if you were to
2114 define menu options "foo", "bar", and "baz" (in that order), menu option
2115 "baz" would appear at the top, and "foo" would be at the bottom.
2117 One way to avoid this problem is to use the function @code{define-key-after},
2118 which works the same as @code{define-key}, but lets you modify where items
2119 appear. The following Lisp code would insert the "forward word" function
2120 in the "edit" menu immediately following the "undo" option:
2124 (lookup-key global-map [menu-bar edit])
2126 '("Forward word" . forward-word)
2130 Note how the second and third arguments to @code{define-key-after} are
2131 different from those of @code{define-key}, and that we have added a new
2132 (final) argument, the function after which our new key should be
2135 To move a menu option from one position to another, simply evaluate
2136 @code{define-key-after} with the appropriate final argument.
2138 More detailed information --- and more examples of how to create and
2139 modify menu options --- are in the Emacs Lisp Reference Manual, under
2140 "Keymaps". (@pxref{Emacs Lisp documentation} for information on this
2143 @node Deleting menus and menu options, Turning on syntax highlighting, Modifying pull-down menus, Common requests
2144 @section How do I delete menus and menu options?
2145 @cindex Deleting menus and menu options
2146 @cindex Menus, deleting
2148 The simplest way to remove a menu is to set its keymap to @samp{nil}.
2149 For example, to delete the "Words" menu (@pxref{Modifying pull-down
2153 (define-key global-map [menu-bar words] nil)
2156 Similarly, removing a menu option requires redefining a keymap entry to
2157 @code{nil}. For example, to delete the "Forward word" menu option from the
2158 "Edit" menu (we added it in @ref{Modifying pull-down menus}), use:
2161 (define-key global-map [menu-bar edit forward] nil)
2164 @node Turning on syntax highlighting, Scrolling only one line, Deleting menus and menu options, Common requests
2165 @section How do I turn on syntax highlighting?
2166 @cindex Syntax highlighting
2167 @cindex @code{font-lock-mode}
2168 @cindex Highlighting based on syntax
2169 @cindex Colorizing text
2170 @cindex FAQ, @code{font-lock-mode}
2172 @code{font-lock-mode} is the standard way to have Emacs perform syntax
2173 highlighting. With @code{font-lock-mode} invoked, different types of
2174 text will appear in different colors. For instance, if you turn on
2175 @code{font-lock-mode} in a programming mode, variables will appear in one
2176 face, keywords in a second, and comments in a third.
2178 Earlier versions of Emacs supported hilit19, a similar package. Use of
2179 hilit19 is now considered non-standard, although @file{hilit19.el} comes
2180 with the stock Emacs distribution. It is no longer maintained.
2182 To turn @code{font-lock-mode} on within an existing buffer, use @kbd{M-x
2183 font-lock-mode @key{RET}}.
2185 To automatically invoke @code{font-lock-mode} when a particular major
2186 mode is invoked, set the major mode's hook. For example, to fontify all
2187 @code{c-mode} buffers, add the following to your @file{.emacs} file:
2190 (add-hook 'c-mode-hook 'turn-on-font-lock)
2193 To automatically invoke @code{font-lock-mode} for all major modes, you
2194 can turn on @code{global-font-lock-mode} by including the following line
2195 in your @file{.emacs} file:
2198 (global-font-lock-mode 1)
2201 This instructs Emacs to turn on font-lock mode in those buffers for
2202 which a font-lock mode definition has been provided (in the variable
2203 @code{font-lock-global-modes}). If you edit a file in
2204 @code{pie-ala-mode}, and no font-lock definitions have been provided for
2205 @code{pie-ala} files, then the above setting will have no effect on that
2208 Highlighting with @code{font-lock-mode} can take quite a while, and thus
2209 different levels of decoration are available, from slight to gaudy. To
2210 control how decorated your buffers should become, set the value of
2211 @code{font-lock-maximum-decoration} in your @file{.emacs} file, with a
2212 @code{nil} value indicating default (usually minimum) decoration, and a
2213 @code{t} value indicating the maximum decoration. For the gaudiest
2214 possible look, then, include the line
2217 (setq font-lock-maximum-decoration t)
2220 in your @file{.emacs} file. You can also set this variable such that
2221 different modes are highlighted in a different ways; for more
2222 information, see the documentation for
2223 @code{font-lock-maximum-decoration} with @kbd{C-h v} (or @kbd{M-x
2224 describe-variable @key{RET}}).
2226 You might also want to investigate @code{fast-lock-mode} and
2227 @code{lazy-lock-mode}, versions of @code{font-lock-mode} that speed up
2228 highlighting. The advantage of @code{lazy-lock-mode} is that it only
2229 fontifies buffers when certain conditions are met, such as after a
2230 certain amount of idle time, or after you have finished scrolling
2231 through text. See the documentation for @code{lazy-lock-mode} by typing @kbd{C-h f
2232 @code{lazy-lock-mode}} (@kbd{M-x describe-function @key{RET}
2233 lazy-lock-mode @key{RET}}).
2235 Also see the documentation for the function @code{font-lock-mode},
2236 available by typing @kbd{C-h f font-lock-mode} (@kbd{M-x
2237 describe-function @key{RET} font-lock-mode @key{RET}}).
2239 For more information on font-lock mode, take a look at the
2240 @code{font-lock-mode} FAQ, maintained by
2241 @email{jari.aalto@@ntc.nokia.com, Jari Aalto} at
2243 @uref{ftp://cs.uta.fi/pub/ssjaaa/ema-font.gui}
2245 To print buffers with the faces (i.e., colors and fonts) intact, use
2246 @kbd{M-x ps-print-buffer-with-faces} or @kbd{M-x
2247 ps-print-region-with-faces}.
2249 @node Scrolling only one line, Replacing highlighted text, Turning on syntax highlighting, Common requests
2250 @section How can I force Emacs to scroll only one line when I move past the bottom of the screen?
2251 @cindex Scrolling only one line
2252 @cindex Reducing the increment when scrollng
2254 Place the following Lisp form in your @file{.emacs} file:
2257 (setq scroll-step 1)
2260 @inforef{Scrolling, Scrolling, emacs}.
2262 @node Replacing highlighted text, Editing MS-DOS files, Scrolling only one line, Common requests
2263 @section How can I replace highlighted text with what I type?
2264 @cindex @code{delete-selection-mode}
2265 @cindex Replacing highlighted text
2266 @cindex Highlighing and replacing text
2268 Use @code{delete-selection mode}, which you can start automatically by
2269 placing the following Lisp form in your @file{.emacs} file:
2272 (delete-selection-mode t)
2275 According to the documentation string for delete-selection mode (which
2276 you can read using @kbd{M-x describe-function @key{RET}
2277 delete-selection-mode @key{RET}}):
2280 When ON, typed text replaces the selection if the selection is active.
2281 When OFF, typed text is just inserted at point.
2284 This mode also allows you to delete (not kill) the highlighted region by
2287 @node Editing MS-DOS files, Filling paragraphs with a single space, Replacing highlighted text, Common requests
2288 @section How can I edit MS-DOS files using Emacs?
2289 @cindex Editing MS-DOS files
2290 @cindex MS-DOS files, editing
2291 @cindex Microsoft files, editing
2292 @cindex Windows files, editing
2294 As of Emacs 20, detection and handling of MS-DOS (and Windows) files is
2295 performed transparently. You can open MS-DOS files on a Unix system,
2296 edit it, and save it without having to worry about the file format.
2298 When editing an MS-DOS style file, a backslash (@samp{\}) will appear in
2301 If you are running an earlier version of Emacs, get @code{crypt++} from
2302 the Emacs Lisp Archive (@pxref{Packages that do not come with Emacs}).
2303 Among other things, @code{crypt++} transparently modifies MS-DOS files
2304 as they are loaded and saved, allowing you to ignore the different
2305 conventions that Unix and MS-DOS have for delineating the end of a line.
2307 @node Filling paragraphs with a single space, , Editing MS-DOS files, Common requests
2308 @section How can I tell Emacs to fill paragraphs with a single space after each period?
2309 @cindex One space following periods
2310 @cindex Single space following periods
2311 @cindex Periods, one space following
2313 @email{ulm@@vsnhd1.cern.ch, Ulrich Mueller} suggests adding the
2314 following two lines to your @file{.emacs} file:
2317 (setq sentence-end "[.?!][]\"')@}]*\\($\\|[ \t]\\)[ \t\n]*")
2318 (setq sentence-end-double-space nil)
2321 @c ------------------------------------------------------------
2322 @node Bugs and problems, Compiling and installing Emacs, Common requests, Top
2323 @chapter Bugs and problems
2324 @cindex Bugs and problems
2327 * Problems with very large files::
2328 * ^M in the shell buffer::
2329 * Shell process exits abnormally::
2330 * Termcap/Terminfo entries for Emacs::
2331 * Spontaneous entry into isearch-mode::
2332 * Problems talking to certain hosts::
2333 * Errors with init files::
2334 * Emacs ignores X resources::
2335 * Emacs takes a long time to visit files::
2336 * Editing files with $ in the name::
2337 * Shell mode loses the current directory::
2338 * Security risks with Emacs::
2339 * Dired claims that no file is on this line::
2342 @node Problems with very large files, ^M in the shell buffer, Bugs and problems, Bugs and problems
2343 @section Does Emacs have problems with files larger than 8 megabytes?
2344 @cindex Very large files, opening
2345 @cindex Large files, opening
2346 @cindex Opening very large files
2347 @cindex Maximum file size
2348 @cindex Files, maximum size
2350 Old versions (i.e., anything before 19.29) of Emacs had problems editing
2351 files larger than 8 megabytes. As of version 19.29, the maximum buffer
2352 size is at least 2^27-1, or 134,217,727 bytes.
2354 If you are using an older version of Emacs and cannot upgrade, you will
2355 have to recompile. @email{lnz@@lucid.com, Leonard N. Zubkoff} suggests
2356 putting the following two lines in @file{src/config.h} before compiling
2357 Emacs to allow for 26-bit integers and pointers (and thus file sizes of
2358 up to 33,554,431 bytes):
2362 #define GCTYPEBITS 5
2365 This method may result in "ILLEGAL DATATYPE" and other random errors on
2368 @email{daveg@@csvax.cs.caltech.edu, David Gillespie} explains how this
2369 problems crops up; while his numbers are true only for pre-19.29
2370 versions of Emacs, the theory remains the same with current versions.
2373 Emacs is largely written in a dialect of Lisp; Lisp is a freely-typed
2374 language in the sense that you can put any value of any type into any
2375 variable, or return it from a function, and so on. So each value
2376 must carry a "tag" along with it identifying what kind of thing it is,
2377 e.g., integer, pointer to a list, pointer to an editing buffer, and so
2378 on. Emacs uses standard 32-bit integers for data objects, taking the
2379 top 8 bits for the tag and the bottom 24 bits for the value. So
2380 integers (and pointers) are somewhat restricted compared to true C
2381 integers and pointers.
2384 @node ^M in the shell buffer, Shell process exits abnormally, Problems with very large files, Bugs and problems
2385 @section How do I get rid of @samp{^M} or echoed commands in my shell buffer?
2386 @cindex Shell buffer, echoed commands and @samp{^M} in
2387 @cindex Echoed commands in @code{shell-mode}
2389 Try typing @kbd{M-x shell-strip-ctrl-m @key{RET}} while in @code{shell-mode} to
2390 make them go away. If that doesn't work, you have several options:
2392 For tcsh, put this in your @file{.cshrc} (or @file{.tcshrc}) file:
2396 if ("$EMACS" == t) then
2397 if ($?tcsh) unset edit
2403 Or put this in your @file{.emacs_tcsh} file:
2410 Alternatively, use @file{csh} in your shell buffers instead of
2411 @file{tcsh}. One way is:
2414 (setq explicit-shell-file-name "/bin/csh")
2417 and another is to do this in your @file{.cshrc} (or @file{.tcshrc})
2421 setenv ESHELL /bin/csh
2424 (You must start Emacs over again with the environment variable properly
2425 set for this to take effect.)
2427 You can also set the @code{ESHELL} environment variable in Emacs Lisp
2428 with the following Lisp form,
2431 (setenv "ESHELL" "/bin/csh")
2434 On a related note: If your shell is echoing your input line in the shell
2435 buffer, you might want to try the following command in your shell
2439 stty -icrnl -onlcr -echo susp ^Z
2442 @node Shell process exits abnormally, Termcap/Terminfo entries for Emacs, ^M in the shell buffer, Bugs and problems
2443 @section Why do I get "Process shell exited abnormally with code 1"?
2444 @cindex Abnormal exits from @code{shell-mode}
2445 @cindex @code{shell-mode} exits
2447 The most likely reason for this message is that the @samp{env} program
2448 is not properly installed. Compile this program for your architecture,
2449 and install it with @samp{a+x} permission in the architecture-dependent
2450 Emacs program directory. (You can find what this directory is at your
2451 site by inspecting the value of the variable @code{exec-directory} by
2452 typing @kbd{C-h v exec-directory @key{RET}}.)
2454 You should also check for other programs named @samp{env} in your path
2455 (e.g., SunOS has a program named @file{/usr/bin/env}). We don't
2456 understand why this can cause a failure and don't know a general
2457 solution for working around the problem in this case.
2459 The @samp{make clean} command will remove @samp{env} and other vital
2460 programs, so be careful when using it.
2462 It has been reported that this sometimes happened when Emacs was started
2463 as an X client from an xterm window (i.e., had a controlling tty) but the
2464 xterm was later terminated.
2466 See also @samp{PROBLEMS} (in the top-level directory when you unpack the
2467 Emacs source) for other possible causes of this message.
2469 @node Termcap/Terminfo entries for Emacs, Spontaneous entry into isearch-mode, Shell process exits abnormally, Bugs and problems
2470 @section Where is the termcap/terminfo entry for terminal type "emacs"?
2473 @cindex Emacs entries for termcap/terminfo
2475 The termcap entry for terminal type @samp{emacs} is ordinarily put in
2476 the @samp{TERMCAP} environment variable of subshells. It may help in
2477 certain situations (e.g., using rlogin from shell buffer) to add an
2478 entry for @samp{emacs} to the system-wide termcap file. Here is a
2479 correct termcap entry for @samp{emacs}:
2485 To make a terminfo entry for "emacs", use "tic" or "captoinfo." You need
2486 to generate @file{/usr/lib/terminfo/e/emacs}. It may work to simply copy
2487 @file{/usr/lib/terminfo/d/dumb} to @file{/usr/lib/terminfo/e/emac}s.
2489 Having a termcap/terminfo entry will not enable the use of full screen
2490 programs in shell buffers. Use @kbd{M-x terminal-emulator} for that
2493 A workaround to the problem of missing termcap/terminfo entries is to
2494 change terminal type "emacs" to type "dumb" or "unknown" in your shell
2495 start up file. "csh" users could put this in their .cshrc files:
2498 if ("$term" == emacs) set term=dumb
2501 @node Spontaneous entry into isearch-mode, Problems talking to certain hosts, Termcap/Terminfo entries for Emacs, Bugs and problems
2502 @section Why does Emacs spontaneously start displaying "I-search:" and beeping?
2503 @cindex Spontaneous entry into isearch-mode
2504 @cindex isearch-mode, spontaneous entry into
2505 @cindex Beeping without obvious reason
2507 Your terminal (or something between your terminal and the computer) is
2508 sending @kbd{C-s} and @kbd{C-q} for flow control, and Emacs is receiving
2509 these characters and interpreting them as commands. (The @kbd{C-s}
2510 character normally invokes the @code{isearch-forward} command.) For
2511 possible solutions, @pxref{Handling C-s and C-q with flow control}.
2513 @node Problems talking to certain hosts, Errors with init files, Spontaneous entry into isearch-mode, Bugs and problems
2514 @section Why can't Emacs talk to certain hosts (or certain hostnames)?
2515 @cindex Hosts, Emacs cannot talk to
2516 @cindex @code{gethostbyname}, problematic version
2518 The problem may be that Emacs is linked with a wimpier version of
2519 @code{gethostbyname} than the rest of the programs on the machine. This
2520 is often manifested as a message on startup of "X server not responding.
2521 Check your @samp{DISPLAY} environment variable." or a message of
2522 "Unknown host" from @code{open-network-stream}.
2524 On a Sun, this may be because Emacs had to be linked with the static C
2525 library. The version of @code{gethostbyname} in the static C library
2526 may only look in @file{/etc/hosts} and the NIS (YP) maps, while the
2527 version in the dynamic C library may be smart enough to check DNS in
2528 addition to or instead of NIS. On a Motorola Delta running System V
2529 R3.6, the version of @code{gethostbyname} in the standard library works,
2530 but the one that works with NIS doesn't (the one you get with -linet).
2531 Other operating systems have similar problems.
2538 Explicitly add the host you want to communicate with to @file{/etc/hosts}.
2541 Relink Emacs with this line in @file{src/config.h}:
2544 #define LIBS_SYSTEM -lresolv
2548 Replace @code{gethostbyname} and friends in @file{libc.a} with more
2549 useful versions such as the ones in @file{libresolv.a}. Then relink
2553 If you are actually running NIS, make sure that "ypbind" is properly
2554 told to do DNS lookups with the correct command line switch.
2558 @node Errors with init files, Emacs ignores X resources, Problems talking to certain hosts, Bugs and problems
2559 @section Why does Emacs say "Error in init file"?
2560 @cindex Error in @file{.emacs}
2561 @cindex Error in init file
2562 @cindex Init file, errors in
2563 @cindex @file{.emacs} file, errors in
2564 @cindex Debugging @file{.emacs} file
2566 An error occurred while loading either your @file{.emacs} file or the
2567 system-wide file @file{lisp/default.el}.
2569 For information on how to debug your @file{.emacs} file,
2570 @pxref{Debugging a customization file}.
2572 It may be the case that you need to load some package first, or use a
2573 hook that will be evaluated after the package is loaded. A common case
2574 of this is explained in @ref{Terminal setup code works after Emacs has
2577 @node Emacs ignores X resources, Emacs takes a long time to visit files, Errors with init files, Bugs and problems
2578 @section Why does Emacs ignore my X resources (my .Xdefaults file)?
2579 @cindex X resources being ignored
2580 @cindex Ignored X resources
2581 @cindex @file{.Xdefaults}
2583 As of version 19, Emacs searches for X resources in the files specified
2584 by the following environment variables:
2588 @item @code{XFILESEARCHPATH}
2589 @item @code{XUSERFILESEARCHPATH}
2590 @item @code{XAPPLRESDIR}
2594 This emulates the functionality provided by programs written using Xt.
2596 @code{XFILESEARCHPATH} and @code{XUSERFILESEARCHPATH} should be a list
2597 of file names separated by colons. @code{XAPPLRESDIR} should be a list
2598 of directory names separated by colons.
2600 Emacs searches for X resources:
2604 @item specified on the command line, with the @samp{-xrm RESOURCESTRING} option,
2605 @item then in the value of the @samp{XENVIRONMENT} environment variable,
2609 @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 @item then in the screen-specific and server-wide resource properties provided by the server,
2617 @item or if those properties are unset, in the file named ~/.Xdefaults if it exists,
2621 @item then in the files listed in @samp{XUSERFILESEARCHPATH},
2625 @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,
2626 @item or in files named Emacs in the directories listed in @samp{XAPPLRESDIR}
2627 @item or in @file{~/LANG/Emacs} (if the @samp{LANG} environment variable is set),
2628 @item or in @file{~/Emacs},
2632 @item then in the files listed in @code{XFILESEARCHPATH}.
2636 @node Emacs takes a long time to visit files, Editing files with $ in the name, Emacs ignores X resources, Bugs and problems
2637 @section Why does Emacs take 20 seconds to visit a file?
2638 @cindex Visiting files takes a long time
2639 @cindex Delay when visiting files
2640 @cindex Files, take a long time to visit
2642 Old versions of Emacs (i.e., versions before Emacs 20.x) often
2643 encountered this when the master lock file, @file{!!!SuperLock!!!} has
2644 been left in the lock directory somehow. Delete it.
2646 @email{meuer@@geom.umn.edu, Mark Meuer} says that NeXT NFS has a bug
2647 where an exclusive create succeeds but returns an error status. This
2648 can cause the same problem. Since Emacs's file locking doesn't work
2649 over NFS anyway, the best solution is to recompile Emacs with
2650 @code{CLASH_DETECTION} undefined.
2652 @node Editing files with $ in the name, Shell mode loses the current directory, Emacs takes a long time to visit files, Bugs and problems
2653 @section How do I edit a file with a @samp{$} in its name?
2654 @cindex Editing files with @samp{$} in the name
2655 @cindex @samp{$} in filenames
2656 @cindex Filenames containing @samp{$}, editing
2658 When entering a filename in the minibuffer, Emacs will attempt to expand
2659 a @samp{$} followed by a word as an environment variable. To suppress
2660 this behavior, type @kbd{$$} instead.
2662 @node Shell mode loses the current directory, Security risks with Emacs, Editing files with $ in the name, Bugs and problems
2663 @section Why does shell mode lose track of the shell's current directory?
2664 @cindex Current directory and @code{shell-mode}
2665 @cindex @code{shell-mode} and current directory
2666 @cindex Directory, current in @code{shell-mode}
2668 Emacs has no way of knowing when the shell actually changes its
2669 directory. This is an intrinsic limitation of Unix. So it tries to
2670 guess by recognizing @samp{cd} commands. If you type "cd" followed by a
2671 directory name with a variable reference (@samp{cd $HOME/bin}) or with a
2672 shell metacharacter (@samp{cd ../lib*}), Emacs will fail to correctly
2673 guess the shell's new current directory. A huge variety of fixes and
2674 enhancements to shell mode for this problem have been written to handle
2675 this problem. Check the Lisp Code Directory (@pxref{Finding a package
2676 with particular functionality}).
2678 You can tell Emacs the shell's current directory with the command
2681 @node Security risks with Emacs, Dired claims that no file is on this line, Shell mode loses the current directory, Bugs and problems
2682 @section Are there any security risks in Emacs?
2683 @cindex Security with Emacs
2684 @cindex @samp{movemail} and security
2685 @cindex @code{file-local-variable} and security
2686 @cindex Synthetic X events and security
2687 @cindex X events and security
2691 @item The @file{movemail} incident (No, this is not a risk.)
2693 In his book @emph{The Cuckoo's Egg}, Cliff Stoll describes this in
2694 chapter 4. The site at LBL had installed the @file{etc/movemail}
2695 program setuid root. (As of version 19, @file{movemail} is in your
2696 architecture-specific directory; type @kbd{C-h v exec-directory
2697 @key{RET}} to see what it is.) Since @file{movemail} had not been
2698 designed for this situation, a security hole was created and users could
2699 get root privileges.
2701 @file{movemail} has since been changed so that this security hole will
2702 not exist, even if it is installed setuid root. However,
2703 @file{movemail} no longer needs to be installed setuid root, which
2704 should eliminate this particular risk.
2706 We have heard unverified reports that the 1988 Internet worm took
2707 advantage of this configuration problem.
2709 @item The @code{file-local-variable} feature (Yes, a risk, but easy to change.)
2711 There is an Emacs feature that allows the setting of local values for
2712 variables when editing a file by including specially formatted text near
2713 the end of the file. This feature also includes the ability to have
2714 arbitrary Emacs Lisp code evaluated when the file is visited.
2715 Obviously, there is a potential for Trojan horses to exploit this
2718 Emacs 18 allowed this feature by default; users could disable it by
2719 setting the variable @code{inhibit-local-variables} to a non-nil value.
2721 As of Emacs 19, Emacs has a list of local variables that create a
2722 security risk. If a file tries to set one of them, it asks the user to
2723 confirm whether the variables should be set. You can also tell Emacs
2724 whether to allow the evaluation of Emacs Lisp code found at the bottom
2725 of files by setting the variable @code{enable-local-eval}.
2727 For more information, @inforef{File Variables, File Variables, emacs}.
2729 @item Synthetic X events (Yes, a risk; use @samp{MIT-MAGIC-COOKIE-1} or better.)
2731 Emacs accepts synthetic X events generated by the SendEvent request as
2732 though they were regular events. As a result, if you are using the
2733 trivial host-based authentication, other users who can open X
2734 connections to your X workstation can make your Emacs process do
2735 anything, including run other processes with your privileges.
2737 The only fix for this is to prevent other users from being able to open
2738 X connections. The standard way to prevent this is to use a real
2739 authentication mechanism, such as @samp{MIT-MAGIC-COOKIE-1}. If using
2740 the @file{xauth} program has any effect, then you are probably using
2741 @samp{MIT-MAGIC-COOKIE-1}. Your site may be using a superior
2742 authentication method; ask your system administrator.
2744 If real authentication is not a possibility, you may be satisfied by
2745 just allowing hosts access for brief intervals while you start your X
2746 programs, then removing the access. This reduces the risk somewhat by
2747 narrowing the time window when hostile users would have access, but
2748 @emph{does not eliminate the risk}.
2750 On most computers running Unix and X Windows, you enable and disable
2751 access using the @file{xhost} command. To allow all hosts access to
2758 at the shell prompt, which (on an HP machine, at least) produces the
2762 access control disabled, clients can connect from any host
2765 To deny all hosts access to your X server (except those explicitly
2766 allowed by name), use
2772 On the test HP computer, this command generated the following message:
2775 access control enabled, only authorized clients can connect
2780 @node Dired claims that no file is on this line, , Security risks with Emacs, Bugs and problems
2781 @section Dired says, "no file on this line" when I try to do something.
2782 @cindex Dired does not see a file
2784 Chances are you're using a localized version of Unix that doesn't use US
2785 date format in dired listings. You can check this by looking at dired
2786 listings or by typing @code{ls -l} to a shell and looking at the dates that
2789 Dired uses a regular expression to find the beginning of a file name.
2790 In a long Unix-style directory listing ("ls -l"), the file name starts
2791 after the date. The regexp has thus been written to look for the date,
2792 the format of which can vary on non-US systems.
2794 There are two approaches to solving this. The first one involves
2795 setting things up so that "ls -l" outputs US date format. This can be
2796 done by setting the locale. See your OS manual for more information.
2798 The second approach involves changing the regular expression used by
2799 dired, @code{dired-move-to-filename-regexp}.
2801 @c ------------------------------------------------------------
2802 @node Compiling and installing Emacs, Finding Emacs and related packages, Bugs and problems, Top
2803 @chapter Compiling and installing Emacs
2804 @cindex Compiling and installing Emacs
2807 * Installing Emacs::
2809 * Problems building Emacs::
2810 * Linking with -lX11 fails::
2813 @node Installing Emacs, Updating Emacs, Compiling and installing Emacs, Compiling and installing Emacs
2814 @section How do I install Emacs?
2815 @cindex Installing Emacs
2816 @cindex Unix systems, installing Emacs on
2817 @cindex Downloading and installing Emacs
2818 @cindex Retrieving and installing Emacs
2819 @cindex Building Emacs from source
2820 @cindex Source code, building Emacs from
2821 @cindex Unpacking and installing Emacs
2823 This answer is meant for users of Unix and Unix-like systems. Users of
2824 other operating systems should see the series of questions beginning
2825 with @ref{Emacs for MS-DOS}, which describe where to get non-Unix source
2826 and binaries. These packages should come with installation
2829 For Unix and Unix-like systems, the easiest way is often to compile it
2830 from scratch. You will need:
2835 Emacs sources. @xref{Current GNU distributions}, for a list of ftp sites
2836 that make them available. On @file{ftp.gnu.org}, the main GNU
2837 distribution site, sources are available at
2839 @uref{ftp://ftp.gnu.org/pub/gnu/emacs/emacs-20.5.tar.gz}
2841 The above will obviously change as new versions of Emacs come out. For
2842 instance, when Emacs 21 is released, it will most probably be
2845 @uref{ftp://ftp.gnu.org/pub/gnu/emacs/emacs-21.1.tar.gz}
2847 Again, you should use one of the GNU mirror sites (@xref{Current GNU
2848 distributions}, and adjust the URL accordingly) so as to reduce load on
2852 @code{gzip}, the GNU compression utility. You can get @code{gzip} via
2853 anonymous ftp at mirrors of @file{ftp.gnu.org} sites; it should compile
2854 and install without much trouble on most systems. Once you have
2855 retrieved the Emacs sources, you will probably be able to uncompress
2856 them with the command
2859 gunzip --verbose emacs-20.5.tar.gz
2862 changing the Emacs version (20.5), as necessary. Once gunzip has
2863 finished doing its job, a file by the name of "emacs-20.5.tar" should
2864 be in your build directory.
2867 @file{tar}, the "tape archiving" program, which moves multiple files
2868 into and out of archive files, or "tarfiles." All of the files
2869 comprising the Emacs source come in a single tarfile, and must be
2870 extracted using @file{tar} before you can build Emacs. Typically, the
2871 extraction command would look like
2874 tar -xvvf emacs-20.5.tar
2877 The @samp{x} indicates that we want to extract files from this tarfile,
2878 the two @samp{v}s force verbose output, and the @samp{f} tells
2879 @file{tar} to use a disk file, rather than one on tape.
2881 If you're using GNU @file{tar} (available at mirrors of
2882 @file{ftp.gnu.org}), you can combine this step and the previous one by
2886 tar -zxvvf emacs-20.5.tar.gz
2889 The additional @samp{z} at the beginning of the options list tells GNU tar
2890 to uncompress the file with gunzip before extracting the tarfile's
2895 At this point, the Emacs sources (all 25+ megabytes of them) should be
2896 sitting in a directory called @file{emacs-20.5}. On most common Unix and
2897 Unix-like systems, you should be able to compile Emacs (with X Windows
2898 support) with the following commands:
2901 cd emacs-20.5 # change directory to emacs-20.5
2902 ./configure # configure Emacs for your particular system
2903 make # use Makefile to build components, then Emacs
2906 If the @code{make} completes successfully, the odds are fairly good that
2907 the build has gone well. (@pxref{Problems building Emacs} if you weren't
2910 By default, Emacs is installed in the following directories:
2914 @item /usr/local/bin
2917 @item /usr/local/share/emacs/20.xx
2918 Lisp code and support files
2920 @item /usr/local/info
2925 To install files in those default directories, become the superuser and
2932 Note that @code{make install} will overwrite @file{/usr/local/bin/emacs}
2933 and any Emacs Info files that might be in @file{/usr/local/info}.
2935 Much more verbose instructions (with many more hints and suggestions)
2936 come with the Emacs sources, in the file @file{INSTALL}.
2938 @node Updating Emacs, Problems building Emacs, Installing Emacs, Compiling and installing Emacs
2939 @section How do I update Emacs to the latest version?
2940 @cindex Updating Emacs
2942 @xref{Installing Emacs}, and follow the instructions there for
2945 Most files are placed in version-specific directories. Emacs 20.5, for
2946 instance, places files in @file{/usr/local/share/emacs/20.5}.
2948 Upgrading should overwrite only, @file{/usr/local/bin/emacs} (the Emacs
2949 binary) and documentation in @file{/usr/local/info}. Back up these
2950 files before you upgrade, and you shouldn't have too much trouble.
2952 @node Problems building Emacs, Linking with -lX11 fails, Updating Emacs, Compiling and installing Emacs
2953 @section What should I do if I have trouble building Emacs?
2954 @cindex Problems building Emacs
2955 @cindex Errors when building Emacs
2957 First look in the file @file{PROBLEMS} (in the top-level directory when
2958 you unpack the Emacs source) to see if there is already a solution for
2959 your problem. Next, look for other questions in this FAQ that have to
2960 do with Emacs installation and compilation problems.
2962 If you'd like to have someone look at your problem and help solve it,
2963 @pxref{Help installing Emacs}.
2965 If you cannot find a solution in the documentation, send a message to
2966 @email{bug-gnu-emacs@@gnu.org}.
2968 Please do not post it to @uref{news:gnu.emacs.help} or send e-mail to
2969 @email{help-gnu-emacs@@gnu.org}. For further guidelines,
2970 @pxref{Guidelines for newsgroup postings} and @ref{Reporting bugs}.
2972 @node Linking with -lX11 fails, , Problems building Emacs, Compiling and installing Emacs
2973 @section Why does linking Emacs with -lX11 fail?
2974 @cindex Linking with -lX11 fails
2975 @cindex lX11, linking fails with
2977 Emacs needs to be linked with the static version of the X11 library,
2978 @file{libX11.a}. This may be missing.
2980 Under OpenWindows, you may need to use "add_services" to add the
2981 "OpenWindows Programmers" optional software category from the CD-ROM.
2983 Under HP-UX 8.0, you may need to run "update" again to load the X11-PRG
2984 "fileset". This may be missing even if you specified "all filesets" the
2985 first time. If @file{libcurses.a} is missing, you may need to load the
2986 "Berkeley Development Option."
2988 @email{zoo@@armadillo.com, David Zuhn} says that MIT X builds shared
2989 libraries by default, and only shared libraries, on those platforms that
2990 support them. These shared libraries can't be used when undumping
2991 temacs (the last stage of the Emacs build process). To get regular
2992 libraries in addition to shared libraries, add this to @file{site.cf}:
2995 #define ForceNormalLib YES
2998 Other systems may have similar problems. You can always define
2999 CANNOT_DUMP and link with the shared libraries instead.
3001 To get the Xmenu stuff to work, you need to find a copy of MIT's
3004 @c ------------------------------------------------------------
3005 @node Finding Emacs and related packages, Major packages and programs, Compiling and installing Emacs, Top
3006 @chapter Finding Emacs and related packages
3007 @cindex Finding Emacs and related packages
3010 * Finding Emacs on the Internet::
3011 * Finding a package with particular functionality::
3012 * Packages that do not come with Emacs::
3013 * Submitting to the Emacs Lisp Archive::
3014 * Current GNU distributions::
3015 * Difference between Emacs and XEmacs::
3016 * Emacs for MS-DOS::
3017 * Emacs for Windows::
3019 * Emacs for Atari ST::
3020 * Emacs for the Amiga ::
3021 * Emacs for NeXTSTEP::
3022 * Emacs for Apple computers::
3023 * Emacs for VMS and DECwindows::
3024 * Modes for various languages::
3025 * Translating names to IP addresses::
3028 @node Finding Emacs on the Internet, Finding a package with particular functionality, Finding Emacs and related packages, Finding Emacs and related packages
3029 @section Where can I get Emacs on the net (or by snail mail)?
3030 @cindex Finding Emacs on the Internet
3031 @cindex Snail mail, ordering Emacs via
3032 @cindex Postal service, ordering Emacs via
3033 @cindex Distribution, retrieving Emacs
3034 @cindex Internet, retreiving from
3036 Look in the files @file{etc/DISTRIB} and @file{etc/FTP} for information
3037 on nearby archive sites and @file{etc/ORDERS} for mail orders. If you
3038 don't already have Emacs, @pxref{Informational files for Emacs} for how
3041 @xref{Installing Emacs}, for information on how to obtain and build the latest
3042 version of Emacs, and @pxref{Current GNU distributions} for a list of
3043 archive sites that make GNU software available.
3045 @node Finding a package with particular functionality, Packages that do not come with Emacs, Finding Emacs on the Internet, Finding Emacs and related packages
3046 @section How do I find a Emacs Lisp package that does XXX?
3047 @cindex Package, finding
3048 @cindex Finding an Emacs Lisp package
3049 @cindex Functionality, finding a particular package
3051 First of all, you should check to make sure that the package isn't
3052 already available. For example, typing @kbd{M-x apropos @key{RET}
3053 wordstar @key{RET}} lists all functions and variables containing the
3054 string @samp{wordstar}.
3056 It is also possible that the package is on your system, but has not been
3057 loaded. To see which packages are available for loading, look through
3058 your computer's lisp directory (@pxref{Filename conventions}). The Lisp
3059 source to most most packages contains a short description of how they
3060 should be loaded, invoked, and configured --- so before you use or
3061 modify a Lisp package, see if the author has provided any hints in the
3064 If a package does not come with Emacs, check the Lisp Code Directory.
3065 The LCD was originally maintained by @email{brennan@@hal.com, Dave
3066 Brennan}, but was recently taken over by @email{toby@@world.std.com,
3067 toby knudsen}, who maintains @uref{http://www.emacs.org}. The LCD is
3068 currently being reorganized and updated, but you can meanwhile find many
3069 packages at @uref{ftp://ftp.emacs.org/pub}.
3071 For now, you can search through the LCD with @file{lispdir.el}, which is
3072 in the process of being updated. Download it from the LCD, in the
3073 @file{emacs-lisp-attic/misc} directory, and then evaluate the following
3074 Lisp form (@pxref{Evaluating Emacs Lisp code}):
3077 (setq lisp-code-directory
3078 "/anonymous@@ftp.emacs.org:pub/emacs-lisp-attic/emacs-lisp/LCD-datafile.gz"
3079 elisp-archive-host "ftp.emacs.org"
3080 elisp-archive-directory "/pub/emacs-lisp-attic/emacs-lisp/")
3083 Once you have installed @file{lispdir.el}, you can use @kbd{M-x
3084 lisp-dir-apropos} to search the listing. For example, @kbd{M-x
3085 lisp-dir-apropos @key{RET} ange-ftp @key{RET}} produces this output:
3088 GNU Emacs Lisp Code Directory Apropos --- "ange-ftp"
3089 "~/" refers to archive.cis.ohio-state.edu:pub/elisp-archive/
3091 ange-ftp (4.18) 15-Jul-1992
3092 Andy Norman, <ange@@hplb.hpl.hp.com>
3093 ~/packages/ange-ftp.tar.Z
3094 transparent FTP Support for GNU Emacs
3095 auto-save (1.19) 01-May-1992
3096 Sebastian Kremer, <sk@@thp.uni-koeln.de>
3097 ~/misc/auto-save.el.Z
3098 Safer autosaving with support for ange-ftp and /tmp
3099 ftp-quik (1.0) 28-Jul-1993
3100 Terrence Brannon, <tb06@@pl122f.eecs.lehigh.edu>
3101 ~/modes/ftp-quik.el.Z
3102 Quik access to dired'ing of ange-ftp and normal paths
3105 @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
3106 @section Where can I get Emacs Lisp packages that don't come with Emacs?
3107 @cindex Unbundled packages
3108 @cindex Finding other packages
3109 @cindex Lisp packages that do not come with Emacs
3110 @cindex Packages, those that do not come with Emacs
3111 @cindex Emacs Lisp Archive, description of
3112 @cindex Archive, description of the Emacs Lisp
3114 First, check the Lisp Code Directory to find the name of the package you
3115 are looking for (@pxref{Finding a package with particular
3116 functionality}). Next, check local archives and the Emacs Lisp Archive
3117 to find a copy of the relevant files. If you still haven't found it,
3118 you can send e-mail to the author asking for a copy. If you find Emacs
3119 Lisp code that doesn't appear in the LCD, please submit a copy to the
3120 LCD (@pxref{Submitting to the Emacs Lisp Archive}).
3122 You can access the Emacs Lisp Archive at
3124 @uref{ftp://archive.cis.ohio-state.edu/pub/emacs-lisp/}
3126 Retrieve and read the file @file{README} first.
3130 @item The archive maintainers do not have time to answer individual
3131 requests for packages or the list of packages in the archive. If you
3132 cannot use FTP or UUCP to access the archive yourself, try to find a
3133 friend who can, but please don't ask the maintainers.
3135 @item Any files with names ending in @samp{.Z}, @samp{.z}, or @samp{.gz} are
3136 compressed, so you should use "binary" mode in FTP to retrieve them.
3137 You should also use binary mode whenever you retrieve any files with
3138 names ending in @samp{.elc}.
3142 @node Submitting to the Emacs Lisp Archive, Current GNU distributions, Packages that do not come with Emacs, Finding Emacs and related packages
3143 @section How do I submit code to the Emacs Lisp Archive?
3144 @cindex Submitting code to the Emacs Lisp Archive
3145 @cindex Emacs Lisp Archive, submissions to
3146 @cindex Lisp Archive, submissions to
3147 @cindex Archive, submitting to the Emacs Lisp
3149 Guidelines and procedures for submission to the archive can be found in
3150 the file @file{GUIDELINES} in the archive directory (@ref{Packages that
3151 do not come with Emacs}). It covers documentation, copyrights,
3152 packaging, submission, and the Lisp Code Directory Record. Anonymous
3153 FTP uploads are not permitted. Instead, all submissions are mailed to
3154 @email{elisp-archive@@cis.ohio-state.edu}. The @file{lispdir.el}
3155 package has a function named @code{submit-lcd-entry} which will help you
3158 @node Current GNU distributions, Difference between Emacs and XEmacs, Submitting to the Emacs Lisp Archive, Finding Emacs and related packages
3159 @section Where can I get other up-to-date GNU stuff?
3160 @cindex Current GNU distributions
3161 @cindex Sources for current GNU distributions
3162 @cindex Stuff, current GNU
3163 @cindex Up-to-date GNU stuff
3164 @cindex Finding current GNU software
3165 @cindex Official GNU software sites
3167 The most up-to-date official GNU software is normally kept at
3169 @uref{ftp://ftp.gnu.org/pub/gnu}
3171 Read the files @file{etc/DISTRIB} and @file{etc/FTP} for more
3174 A list of sites mirroring @samp{ftp.gnu.org} can be found at
3176 @uref{http://www.gnu.org/order/ftp.html}
3178 @node Difference between Emacs and XEmacs, Emacs for MS-DOS, Current GNU distributions, Finding Emacs and related packages
3179 @section What is the difference between Emacs and XEmacs (formerly "Lucid Emacs")?
3181 @cindex Difference Emacs and XEmacs
3185 First of all, they're both GNU Emacs. XEmacs is just as much a later
3186 version of GNU Emacs as the FSF-distributed version. This FAQ refers to
3187 the latest version to be distributed by the FSF as "Emacs," partly
3188 because the XEmacs maintainers now refer to their product using the
3189 "XEmacs" name, and partly because there isn't any accurate way to
3190 differentiate between the two without getting mired in paragraphs of
3191 legalese and history.
3193 XEmacs, which began life as Lucid Emacs, is based on an early version of
3194 Emacs 19 and Epoch, an X-aware version of Emacs 18.
3196 Emacs (i.e., the version distributed by the FSF) has a larger installed
3197 base and now always contains the MULE multilingual facilities.
3198 XEmacs can do some clever tricks with X Windows, such as
3199 putting arbitrary graphics in a buffer. Similar facilities have been
3200 implemented for Emacs as part of a new redisplay implementation for
3201 Emacs 21, expected to be released after Emacs 20.5.
3202 Emacs and XEmacs each come with
3203 Lisp packages that are lacking in the other; RMS says that the FSF would
3204 include more packages that come with XEmacs, but that the XEmacs
3205 maintainers don't always keep track of the authors of contributed code,
3206 which makes it impossible for the FSF to have certain legal papers
3207 signed. (Without these legal papers, the FSF will not distribute Lisp
3208 packages with Emacs.) The two versions have some
3209 significant differences at the Lisp programming level.
3211 Many XEmacs features have found their way into recent versions of Emacs,
3212 and more features can be expected in the future, but there are still many
3213 differences between the two.
3215 @node Emacs for MS-DOS, Emacs for Windows, Difference between Emacs and XEmacs, Finding Emacs and related packages
3216 @section Where can I get Emacs for my PC running MS-DOS?
3217 @cindex MS-DOS, Emacs for
3218 @cindex DOS, Emacs for
3219 @cindex Compiling Emacs for DOS
3220 @cindex Emacs for MS-DOS
3221 @cindex Tools needed to compile Emacs under DOS
3223 A pre-built binary distribution of Emacs is available from the Simtel
3224 archives. This version apparently works under MS-DOS and Windows (3.x,
3225 95x, and NT) and supports long file names under Windows 9x. More
3226 information is available from
3228 @uref{ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/emacs.README}
3230 The binary itself is available in the files em1934*.zip in the
3233 @uref{ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/}
3235 If you prefer to compile Emacs for yourself, you can do so with the
3236 current distribution directly. You will need a 386 (or
3237 better) processor, and to be running MS-DOS 3.0 or later. According to
3238 @email{eliz@@is.elta.co.il, Eli Zaretskii} and
3239 @email{hankedr@@dms.auburn.edu, Darrel Hankerson}, you will need the
3245 djgpp version 1.12 maint 1 or later. Djgpp 2.0 or later is
3246 recommended, since 1.x is being phased out. Djgpp 2 supports
3247 long filenames under Windows 9x.
3249 You can get the latest release of djgpp by retrieving all of
3252 @uref{ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp}
3254 @item Gunzip and tar
3255 The easiest way is to use "djtar" which comes with djgpp v2.x,
3256 because it can open gzip'ed tarfiles (i.e., those ending with
3257 ".tar.gz") in one step. Djtar comes in "djdev201.zip", from
3258 the URL mentioned above.
3260 @item make, mv, sed, and rm
3261 All of these utilities are available at
3263 @uref{ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu}
3265 16-bit utilities can be found in GNUish, at
3267 @uref{ftp://ftp.simtel.net/pub/simtelnet/gnu/gnuish}
3271 The files @file{INSTALL} and @file{PROBLEMS} in the top-level directory
3272 of the Emacs source contains some additional information regarding Emacs
3275 For a list of other MS-DOS implementations of Emacs (and Emacs
3276 look-alikes), consult the list of "Emacs implementations and literature,"
3279 @uref{ftp://rtfm.mit.edu/pub/usenet/comp.emacs/}
3281 Note that while many of these programs look similar to Emacs, they often
3282 lack certain features, such as the Emacs Lisp extension language.
3284 @node Emacs for Windows, Emacs for OS/2, Emacs for MS-DOS, Finding Emacs and related packages
3285 @section Where can I get Emacs for Microsoft Windows
3286 @cindex FAQ for NT Emacs
3287 @cindex Microsoft Windows, Emacs for
3288 @cindex Windows NT, Emacs for
3289 @cindex Windows '95 and '98, Emacs for
3291 For information on Emacs for Windows 95 and NT, read the FAQ produced by
3292 @email{voelker@@cs.washington.edu, Geoff Voelker}, available at
3294 @uref{http://www.gnu.org/software/emacs/windows/ntemacs.html}
3296 @xref{Emacs for MS-DOS}, for Windows 3.1.
3298 @node Emacs for OS/2, Emacs for Atari ST, Emacs for Windows, Finding Emacs and related packages
3299 @section Where can I get Emacs for my PC running OS/2?
3300 @cindex OS/2, Emacs for
3302 Emacs 19.33 is ported for emx on OS/2 2.0 or 2.1, and is available at
3304 @uref{ftp://hobbes.nmsu.edu/pub/os2/apps/editors/emacs/v19.33/}
3306 @node Emacs for Atari ST, Emacs for the Amiga , Emacs for OS/2, Finding Emacs and related packages
3307 @section Where can I get Emacs for my Atari ST?
3308 @cindex Atari ST, Emacs for
3309 @cindex TOS, Emacs for
3311 Roland Schäuble reports that Emacs 18.58 running on plain TOS and MiNT
3313 @uref{ftp://atari.archive.umich.edu/Editors/Emacs-18-58/1858b-d3.zoo}.
3315 @node Emacs for the Amiga , Emacs for NeXTSTEP, Emacs for Atari ST, Finding Emacs and related packages
3316 @section Where can I get Emacs for my Amiga?
3317 @cindex Amiga, Emacs for
3319 The files you need are available at
3321 @uref{ftp://ftp.wustl.edu/pub/aminet/util/gnu/}
3323 @email{dgilbert@@gamiga.guelphnet.dweomer.org, David Gilbert} has released a
3324 beta version of Emacs 19.25 for the Amiga. You can get the binary at
3326 @uref{ftp://ftp.wustl.edu/pub/aminet/util/gnu/a2.0bEmacs-bin.lha}
3328 @node Emacs for NeXTSTEP, Emacs for Apple computers, Emacs for the Amiga , Finding Emacs and related packages
3329 @section Where can I get Emacs for NeXTSTEP?
3330 @cindex NeXTSTEP, Emacs for
3332 Emacs.app is a NeXTSTEP version of Emacs 19.34 which supports colors,
3333 menus, and multiple frames. You can get it from
3335 @uref{ftp://next-ftp.peak.org/pub/next/apps/emacs/Emacs_for_NeXTstep.4.20a1.NIHS.b.tar.gz}
3337 @node Emacs for Apple computers, Emacs for VMS and DECwindows, Emacs for NeXTSTEP, Finding Emacs and related packages
3338 @section Where can I get Emacs for my Apple computer?
3339 @cindex Apple computers, Emacs for
3341 An unofficial port of GNU Emacs 18.59 to the Macintosh is available at a
3342 number of ftp sites, the home being
3343 @uref{ftp://ftp.cs.cornell.edu/pub/parmet/Emacs-1.17.sit.bin}.
3345 A port of Emacs 20.4 is available at
3346 @uref{http://www.cs.hku.hk/~choi/emacs/index.html}.
3348 Apple's forthcoming "OS X" is based largely on NeXTSTEP and OpenStep.
3349 @xref{Emacs for NeXTSTEP}, for more details about that version.
3351 @node Emacs for VMS and DECwindows, Modes for various languages, Emacs for Apple computers, Finding Emacs and related packages
3352 @section Where do I get Emacs that runs on VMS under DECwindows?
3353 @cindex DECwindows, Emacs for
3354 @cindex VMS, Emacs for
3356 Up-to-date information about GNU software (including Emacs) for VMS is
3357 available at @uref{http://vms.gnu.org/}.
3359 @node Modes for various languages, Translating names to IP addresses, Emacs for VMS and DECwindows, Finding Emacs and related packages
3360 @section Where can I get modes for Lex, Yacc/Bison, Bourne shell, csh, C++, Objective-C, Pascal, Java, and Awk?
3361 @cindex Awk, mode for
3362 @cindex @code{awk-mode}
3363 @cindex Bison, mode for
3364 @cindex Bourne Shell, mode for
3365 @cindex C++, mode for
3366 @cindex Java, mode for
3368 @cindex Objective-C, mode for
3369 @cindex @code{pascal-mode}
3372 @cindex @file{csh} mode
3373 @cindex @code{sh-mode}
3374 @cindex @code{cc-mode}
3376 Most of these modes are now available in standard Emacs distribution.
3377 To get additional modes, look in the Lisp Code Directory (@pxref{Finding
3378 a package with particular functionality}). For C++, if you use
3379 @code{lisp-dir-apropos}, you must specify the pattern with something
3380 like @kbd{M-x lisp-dir-apropos @key{RET} c\+\+ @key{RET}}.
3382 Barry Warsaw's @code{cc-mode} now works for C, C++, Objective-C, and
3383 Java code. You can get the latest version from the Emacs Lisp Archive;
3384 @pxref{Packages that do not come with Emacs} for details. A FAQ for
3385 @code{cc-mode} is available at
3386 @uref{http://www.python.org/emacs/cc-mode/}.
3388 @node Translating names to IP addresses, , Modes for various languages, Finding Emacs and related packages
3389 @section What is the IP address of XXX.YYY.ZZZ?
3390 @cindex Translating names to IP addresses
3391 @cindex IP addresses from names
3392 @cindex Using BIND to translate addresses
3393 @cindex DNS and IP addresses
3395 If you are on a Unix machine, try using the @samp{nslookup} command,
3396 included in the Berkeley BIND package. For example, to find the IP
3397 address of @samp{ftp.gnu.org}, you would type @code{nslookup
3400 Your computer should then provide the IP address of that computer.
3402 If your site's nameserver is deficient, you can use IP addresses to FTP
3403 files. You can get this information by
3408 To: dns@@[134.214.84.25] (to grasp.insa-lyon.fr)
3409 Body: ip XXX.YYY.ZZZ (or "help" for more information
3410 and options - no quotes)
3416 To: resolve@@[147.31.254.130] (to laverne.cs.widener.edu)
3417 Body: site XXX.YYY.ZZZ
3420 @c ------------------------------------------------------------
3421 @node Major packages and programs, Key bindings, Finding Emacs and related packages, Top
3422 @chapter Major packages and programs
3423 @cindex Major packages and programs
3440 @node VM, Supercite, Major packages and programs, Major packages and programs
3441 @section VM (View Mail) --- another mail reader within Emacs, with MIME support
3443 @cindex Alternative mail software
3445 @cindex E-mail reader, VM
3450 @email{kyle@@uunet.uu.net, Kyle Jones}
3452 @item Latest version
3456 @uref{ftp://ftp.wonderworks.com/pub/vm/vm.tar.gz}
3458 @item Informational newsgroup/mailing list
3459 @uref{news:gnu.emacs.vm.info}@*
3460 Subscription requests to @email{info-vm-request@@uunet.uu.net}@*
3461 Submissions to @email{info-vm@@uunet.uu.net}
3463 @item Bug reports newsgroup/mailing list
3464 @uref{news:gnu.emacs.vm.bug}@*
3465 Subscription requests to @email{bug-vm-request@@uunet.uu.net}@*
3466 Submissions to @email{bug-vm@@uunet.uu.net}
3469 VM 6 works with Emacs 20.4, and may cause problems with Emacs 20.3 and
3470 below. (Note that many people seem to use Emacs 20.3 with VM 6, without
3471 any problems.) Risk-averse users might wish to try VM 5.97, available
3472 from @uref{ftp://ftp.wonderworks.com/pub/vm/, the same FTP site}.
3474 @node Supercite, Calc, VM, Major packages and programs
3475 @section Supercite --- mail and news citation package within Emacs
3478 @cindex Mail and news citations
3479 @cindex News and mail citations
3480 @cindex Citations in mail and news
3485 @email{bwarsaw@@cen.com, Barry Warsaw}
3487 @item Latest version
3488 3.1 (comes with Emacs 20)
3491 @uref{http://www.python.org/emacs/supercite.tar.gz}
3494 Subscription requests to @email{supercite-request@@python.org}@*
3495 Submissions @email{supercite@@python.org}
3499 Superyank is an old version of Supercite.
3501 @node Calc, VIPER, Supercite, Major packages and programs
3502 @section Calc --- poor man's Mathematica within Emacs
3503 @cindex Programmable calculator
3509 @email{daveg@@csvax.cs.caltech.edu, Dave Gillespie}
3511 @item Latest version
3515 @uref{ftp://ftp.gnu.org/pub/gnu/calc/calc-2.02f.tar.gz}
3519 @node VIPER, AUC-TeX, Calc, Major packages and programs
3520 @section VIPER --- vi emulation for Emacs
3521 @cindex vi emulation
3523 @cindex Emulation of vi
3525 Since Emacs 19.29, the preferred vi emulation in Emacs is VIPER
3526 (@kbd{M-x viper-mode @key{RET}}), which comes with Emacs. It extends
3527 and supersedes VIP (including VIP 4.3) and provides vi emulation at
3528 several levels, from one that closely follows vi to one that departs
3529 from vi in several significant ways.
3531 For Emacs 19.28 and earlier, the following version of VIP is generally
3532 better than the one distributed with Emacs:
3536 @email{sane@@cs.uiuc.edu, Aamod Sane}
3538 @item Latest version
3542 @uref{ftp://archive.cis.ohio-state.edu/pub/emacs-lisp/modes/vip-mode.tar.Z}
3546 @node AUC-TeX, BBDB, VIPER, Major packages and programs
3547 @section AUC TeX --- enhanced LaTeX mode with debugging facilities
3548 @cindex Mode for @TeX{}
3550 @cindex AUC-TeX mode for editing @TeX{}
3551 @cindex Writing and debugging @TeX{}
3556 @email{krab@@iesd.auc.dk, Kresten Krab Thorup} and@*
3557 @email{abraham@@iesd.auc.dk, Per Abrahamsen}
3559 @item Latest version
3563 @uref{ftp://sunsite.auc.dk/packages/auctex/auctex.tar.gz}
3566 @uref{http://sunsite.auc.dk/auctex/}
3569 Subscription requests to @email{auc-tex-request@@iesd.auc.dk}@*
3570 Submissions to @email{auc-tex@@iesd.auc.dk}@*
3571 Development team is at @email{auc-tex_mgr@@iesd.auc.dk}
3575 @node BBDB, Ispell, AUC-TeX, Major packages and programs
3576 @section BBDB --- personal Info Rolodex integrated with mail/news readers
3578 @cindex Rolodex-like functionality
3579 @cindex Integrated contact database
3580 @cindex Contact database
3581 @cindex Big Brother Database
3582 @cindex Address book
3587 @email{simmonmt@@acm.org, Matt Simmons}
3589 @item Latest version
3593 @uref{http://www.netcom.com/~simmonmt/bbdb/index.html}
3596 Subscription requests to @email{info-bbdb-request@@xemacs.org}@*
3597 Submissions to @email{info-bbdb@@xemacs.org}@*
3598 Release announcements: @email{bbdb-announce-request@@xemacs.org}
3602 @node Ispell, w3-mode, BBDB, Major packages and programs
3603 @section Ispell --- spell checker in C with interface for Emacs
3604 @cindex Spell-checker
3605 @cindex Checking spelling
3611 @email{geoff@@itcorp.com, Geoff Kuenning}
3613 @item Latest version
3617 @uref{ftp://ftp.cs.ucla.edu/pub/ispell/ispell-3.1.20.tar.gz}@*
3620 @uref{http://fmg-www.cs.ucla.edu/geoff/ispell.html}
3626 @item Do not ask Geoff to send you the latest version of Ispell. He does not have free e-mail.
3628 @item This Ispell program is distinct from GNU Ispell 4.0. GNU Ispell
3629 4.0 is no longer a supported product.
3633 @node w3-mode, EDB, Ispell, Major packages and programs
3634 @section w3-mode --- A World Wide Web browser inside of Emacs
3637 @cindex Browser in Emacs
3638 @cindex @code{w3-mode}
3643 @email{wmperry@@spry.com, Bill Perry}
3645 @item Latest version
3649 @uref{ftp://ftp.cs.indiana.edu/pub/elisp/w3/w3.tar.gz}
3652 Receive announcements from @email{w3-announce-request@@indiana.edu}@*
3653 Become a beta tester at @email{w3-beta-request@@indiana.edu}@*
3654 Help to develop @code{w3-mode} at @email{w3-dev@@indiana.edu}
3658 @node EDB, Mailcrypt, w3-mode, Major packages and programs
3659 @section EDB --- Database program for Emacs; replaces forms editing modes
3666 @email{mernst@@theory.lcs.mit.edu, Michael Ernst}
3668 @item Latest version
3672 @uref{ftp://theory.lcs.mit.edu/pub/emacs/edb}
3676 @node Mailcrypt, JDE, EDB, Major packages and programs
3677 @section Mailcrypt --- PGP interface within Emacs mail and news
3680 @cindex Interface to PGP from Emacs mail and news
3681 @cindex News, interface to PGP from
3682 @cindex Mail, interface to PGP from
3683 @cindex Encryption software, interface to
3688 @email{patl@@lcs.mit.edu, Patrick J. LoPresti} and @email{jin@@atype.com, Jin S. Choi}
3691 @email{lbudney@@pobox.com, Len Budney}
3693 @item Latest version
3697 @uref{http://www.nb.net/~lbudney/linux/software/mailcrypt/mailcrypt-3.5.3.tar.gz}
3700 @uref{http://www.nb.net/~lbudney/linux/software/mailcrypt.html}
3704 @node JDE, Patch, Mailcrypt, Major packages and programs
3705 @section JDE --- Integrated development environment for Java
3706 @cindex Java development environment
3707 @cindex Integrated Java development environment
3713 @email{paulk@@mathworks.com, Paul Kinnucan}
3716 jde-subscribe@@sunsite.auc.dk
3718 @item Latest version
3722 @uref{http://sunsite.auc.dk/jde/}
3726 @node Patch, , JDE, Major packages and programs
3727 @section Patch --- program to apply "diffs" for updating files
3728 @cindex Updating files with diffs
3729 @cindex Patching source files with diffs
3730 @cindex Diffs and patching
3731 @cindex @file{patch}
3736 @email{lwall@@wall.org, Larry Wall} (with GNU modifications)
3738 @item Latest version
3742 @xref{Current GNU distributions}.
3746 @c ------------------------------------------------------------
3747 @node Key bindings, Alternate character sets, Major packages and programs, Top
3748 @chapter Key bindings
3749 @cindex Key bindings
3752 * Binding keys to commands::
3753 * Invalid prefix characters::
3754 * Terminal setup code works after Emacs has begun::
3755 * Using function keys under X::
3756 * Working with function and arrow keys::
3757 * X key translations for Emacs::
3758 * Handling C-s and C-q with flow control::
3759 * Binding C-s and C-q::
3760 * Backspace invokes help::
3761 * stty and Backspace key::
3763 * Producing C-XXX with the keyboard::
3766 * Compose Character::
3767 * Binding combinations of modifiers and function keys::
3768 * Meta key does not work in xterm::
3769 * ExtendChar key does not work as Meta::
3772 @node Binding keys to commands, Invalid prefix characters, Key bindings, Key bindings
3773 @section How do I bind keys (including function keys) to commands?
3774 @cindex Binding keys to commands
3775 @cindex Keys, binding to commands
3776 @cindex Commands, binding keys to
3778 Keys can be bound to commands either interactively or in your
3779 @file{.emacs} file. To interactively bind keys for all modes, type
3780 @kbd{M-x global-set-key @key{RET} KEY CMD @key{RET}}.
3782 To bind a key just in the current major mode, type @kbd{M-x local-set-key @key{RET} KEY CMD @key{RET}}.
3784 See @inforef{Key Bindings, Key Bindings, emacs} for further details.
3786 To bind keys on starting Emacs or on starting any given mode, use the
3787 following "trick": First bind the key interactively, then immediately
3788 type @kbd{C-x @key{ESC} @key{ESC} C-a C-k C-g}. Now, the command needed
3789 to bind the key is in the kill ring, and can be yanked into your
3790 @file{.emacs} file. If the key binding is global, no changes to the
3791 command are required. For example,
3794 (global-set-key (quote [f1]) (quote help-for-help))
3797 can be placed directly into the @file{.emacs} file. If the key binding is
3798 local, the command is used in conjunction with the "add-hook" command.
3799 For example, in tex-mode, a local binding might be
3802 (add-hook 'tex-mode-hook
3804 (local-set-key (quote [f1]) (quote help-for-help))))
3810 @item Control characters in key sequences, in the form yanked from the
3811 kill ring are given in their graphic form --- i.e., @key{CTRL} is shown
3812 as @samp{^}, @key{TAB} as a set of spaces (usually 8), etc. You may
3813 want to convert these into their vector or string forms.
3815 @item If a prefix key of the character sequence to be bound is already
3816 bound as a complete key, then you must unbind it before the new
3817 binding. For example, if "ESC @{" is previously bound:
3820 (global-unset-key [?\e ?@{]) ;; or
3821 (local-unset-key [?\e ?@{])
3824 @item Aside from commands and "lambda lists," a vector or string also
3825 can be bound to a key and thus treated as a macro. For example:
3828 (global-set-key [f10] [?\C-x?\e?\e?\C-a?\C-k?\C-g]) ;; or
3829 (global-set-key [f10] "\C-x\e\e\C-a\C-k\C-g")
3834 @node Invalid prefix characters, Terminal setup code works after Emacs has begun, Binding keys to commands, Key bindings
3835 @section Why does Emacs say "Key sequence XXX uses invalid prefix characters"?
3836 @cindex Prefix characters, invalid
3837 @cindex Invalid prefix characters
3838 @cindex Misspecified key sequences
3840 Usually, one of two things has happened. In one case, the control
3841 character in the key sequence has been misspecified (e.g. @samp{C-f}
3842 used instead of @samp{\C-f} within a Lisp expression). In the other
3843 case, a "prefix key" in the keystroke sequence you were trying to bind
3844 was already bound as a "complete key." Historically, the @samp{ESC [}
3845 prefix was usually the problem, in which case you should evaluate either
3846 of these forms before attempting to bind the key sequence:
3849 (global-unset-key [?\e ?[]) ;; or
3850 (global-unset-key "\e[")
3853 @node Terminal setup code works after Emacs has begun, Using function keys under X, Invalid prefix characters, Key bindings
3854 @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?
3855 @cindex Terminal setup code in @file{.emacs}
3857 During startup, Emacs initializes itself according to a given code/file
3858 order. If some of the code executed in your @file{.emacs} file needs to
3859 be postponed until the initial terminal or window-system setup code has
3860 been executed but is not, then you will experience this problem (this
3861 code/file execution order is not enforced after startup).
3863 To postpone the execution of Emacs Lisp code until after terminal or
3864 window-system setup, treat the code as a "lambda list" and set the value
3865 of either the @code{term-setup-hook} or @code{window-setup-hook}
3866 variable to this "lambda function." For example,
3869 (add-hook 'term-setup-hook
3871 (when (string-match "\\`vt220" (or (getenv "TERM") ""))
3872 ;; Make vt220's "Do" key behave like M-x:
3873 (global-set-key [do] 'execute-extended-command))))
3876 For information on what Emacs does every time it is started, see the
3877 @file{lisp/startup.el} file.
3879 @node Using function keys under X, Working with function and arrow keys, Terminal setup code works after Emacs has begun, Key bindings
3880 @section How do I use function keys under X Windows?
3881 @cindex Function keys
3882 @cindex X Windows and function keys
3883 @cindex Binding function keys
3885 With Emacs 19, functions keys under X are bound like any other key. @xref{Binding keys to commands}, for details.
3887 @node Working with function and arrow keys, X key translations for Emacs, Using function keys under X, Key bindings
3888 @section How do I tell what characters or symbols my function or arrow keys emit?
3889 @cindex Working with arrow keys
3890 @cindex Arrow keys, symbols generated by
3891 @cindex Working with function keys
3892 @cindex Function keys, symbols generated by
3893 @cindex Symbols generated by function keys
3895 Type @kbd{C-h c} then the function or arrow keys. The command will
3896 return either a function key symbol or character sequence (see the
3897 Emacs on-line documentation for an explanation). This works for other
3900 @node X key translations for Emacs, Handling C-s and C-q with flow control, Working with function and arrow keys, Key bindings
3901 @section How do I set the X key "translations" for Emacs?
3902 @cindex X key translations
3903 @cindex Key translations under X
3904 @cindex Translations for keys under X
3906 Emacs is not written using the Xt library by default, so there are no
3907 "translations" to be set. (We aren't sure how to set such translations
3908 if you do build Emacs with Xt; please let us know if you've done this!)
3910 The only way to affect the behavior of keys within Emacs is through
3911 "xmodmap" (outside Emacs) or @code{define-key} (inside Emacs). The
3912 @code{define-key} command should be used in conjunction with the
3913 @code{function-key-map} map. For instance,
3916 (define-key function-key-map [M-@key{TAB}] [?\M-\t])
3919 defines the @kbd{M-@key{TAB}} key sequence.
3921 @node Handling C-s and C-q with flow control, Binding C-s and C-q, X key translations for Emacs, Key bindings
3922 @section How do I handle @kbd{C-s} and @kbd{C-q} being used for flow control?
3923 @cindex Flow control, @kbd{C-s} and @kbd{C-q} with
3924 @cindex @kbd{C-s} and @kbd{C-q} with flow control
3926 @kbd{C-s} and @kbd{C-q} are used in the XON/XOFF flow control protocol.
3927 This messes things up when you're using Emacs, because Emacs binds these
3928 keys to commands by default. Because Emacs won't honor them as flow
3929 control characters, too many of these characters are not passed on and
3930 overwhelm output buffers. Sometimes, intermediate software using
3931 XON/XOFF flow control will prevent Emacs from ever seeing @kbd{C-s} and
3938 @item Disable the use of @kbd{C-s} and @kbd{C-q} for flow control.
3940 You need to determine the cause of the flow control.
3946 Your terminal may use XON/XOFF flow control to have time to display
3947 all the characters it receives. For example, VT series terminals do
3948 this. It may be possible to turn this off from a setup menu. For
3949 example, on a VT220 you may select "No XOFF" in the setup menu. This
3950 is also true for some terminal emulation programs on PCs.
3952 When you turn off flow control at the terminal, you will also need to
3953 turn it off at the other end, which might be at the computer you are
3954 logged in to or at some terminal server in between.
3956 If you turn off flow control, characters may be lost; using a printer
3957 connected to the terminal may fail. You may be able to get around
3958 this problem by modifying the "termcap" entry for your terminal to
3959 include extra NUL padding characters.
3963 If you are using a dialup connection, the modems may be using
3964 XON/XOFF flow control. It's not clear how to get around this.
3966 @item a router or terminal server
3968 Some network box between the terminal and your computer may be using
3969 XON/XOFF flow control. It may be possible to make it use some other
3970 kind of flow control. You will probably have to ask your local
3971 network experts for help with this.
3973 @item tty and/or pty devices
3975 If your connection to Emacs goes through multiple tty and/or pty
3976 devices, they may be using XON/XOFF flow control even when it is not
3979 @email{eirik@@theory.tn.cornell.edu, Eirik Fuller} writes:
3982 Some versions of "rlogin" (and possibly telnet) do not pass flow
3983 control characters to the remote system to which they connect. On
3984 such systems, Emacs on the remote system cannot disable flow
3985 control on the local system. Sometimes "rlogin -8" will avoid this
3988 One way to cure this is to disable flow control on the local host
3989 (the one running rlogin, not the one running rlogind) using the
3990 stty command, before starting the rlogin process. On many systems,
3991 @samp{stty start u stop u} will do this.
3993 Some versions of @samp{tcsh} will prevent even this from working. One
3994 way around this is to start another shell before starting rlogin,
3995 and issue the @samp{stty} command to disable flow control from that shell.
3998 Use @samp{stty -ixon} instead of @samp{stty start u stop u} on some systems.
4002 @item Make Emacs speak the XON/XOFF flow control protocol.
4004 You can make Emacs treat @kbd{C-s} and @kbd{C-q} as flow control characters by
4008 (enable-flow-control)
4011 to unconditionally enable flow control or
4014 (enable-flow-control-on "vt100" "h19")
4017 (using your terminal names instead of @samp{vt100} or @samp{h19}) to
4018 enable selectively. These commands will automatically swap @kbd{C-s}
4019 and @kbd{C-q} to @kbd{C-\} and @kbd{C-^}. Variables can be used to
4020 change the default swap keys (@code{flow-control-c-s-replacement} and
4021 @code{flow-control-c-q-replacement}).
4023 If you are fixing this for yourself, simply put the form in your
4024 @file{.emacs} file. If you are fixing this for your entire site, the
4025 best place to put it is in the @file{lisp/site-start.el} file. Putting
4026 this form in @file{lisp/default.el} has the problem that if the user's
4027 @file{.emacs} file has an error, this will prevent
4028 @file{lisp/default.el} from being loaded and Emacs may be unusable for
4029 the user, even for correcting their @file{.emacs} file (unless they're
4030 smart enough to move it to another name).
4034 For further discussion of this issue, read the file @file{PROBLEMS} (in
4035 the top-level directory when you unpack the Emacs source).
4037 @node Binding C-s and C-q, Backspace invokes help, Handling C-s and C-q with flow control, Key bindings
4038 @section How do I bind @kbd{C-s} and @kbd{C-q} (or any key) if these keys are filtered out?
4039 @cindex Binding @kbd{C-s} and @kbd{C-q}
4040 @cindex @kbd{C-s} and @kbd{C-q}, binding
4042 To bind @kbd{C-s} and @kbd{C-q}, use either @code{enable-flow-control}
4043 or @sc{enable-flow-control-on}. @xref{Handling C-s and C-q with flow
4044 control}, for usage and implementation details.
4046 To bind other keys, use @code{keyboard-translate}. @xref{Swapping keys},
4047 for usage details. To do this for an entire site, you should swap the
4048 keys in @file{lisp/site-start.el}. @xref{Handling C-s and C-q with flow
4049 control}, for an explanation of why @file{lisp/default.el} should not be
4054 @item If you do this for an entire site, the users will be confused by
4055 the disparity between what the documentation says and how Emacs
4060 @node Backspace invokes help, stty and Backspace key, Binding C-s and C-q, Key bindings
4061 @section Why does the @key{Backspace} key invoke help?
4062 @cindex Backspace key invokes help
4063 @cindex Help invoked by Backspace
4065 The @key{Backspace} key (on most keyboards) generates ASCII code 8.
4066 @kbd{C-h} sends the same code. In Emacs by default @kbd{C-h} invokes
4067 help-command. This is intended to be easy to remember since the first
4068 letter of @samp{help} is @samp{h}. The easiest solution to this problem
4069 is to use @kbd{C-h} (and @key{Backspace}) for help and @key{DEL} (the
4070 @key{Delete} key) for deleting the previous character.
4072 For many people this solution may be problematic:
4077 They normally use @key{Backspace} outside of Emacs for deleting the
4078 previous character. This can be solved by making @key{DEL} the command
4079 for deleting the previous character outside of Emacs. On many Unix
4080 systems, this command will remap @key{DEL}:
4087 The person may prefer using the @key{Backspace} key for deleting the
4088 previous character because it is more conveniently located on their
4089 keyboard or because they don't even have a separate Delete key. In
4090 this case, the @key{Backspace} key should be made to behave like
4091 @key{Delete}. There are several methods.
4094 Some terminals (e.g., VT3## terminals) allow the character generated
4095 by the @key{Backspace} key to be changed from a setup menu.
4098 You may be able to get a keyboard that is completely programmable.
4101 Under X or on a dumb terminal, it is possible to swap the
4102 @key{Backspace} and @key{Delete} keys inside Emacs:
4105 (keyboard-translate ?\C-h ?\C-?)
4108 @xref{Swapping keys}, for further details of "keyboard-translate".
4111 Another approach is to switch key bindings and put help on @kbd{C-x h}
4115 (global-set-key "\C-h" 'delete-backward-char)
4117 ;;; overrides mark-whole-buffer
4118 (global-set-key "\C-xh" 'help-command)
4121 Other popular key bindings for help are @kbd{M-?} and @kbd{C-x ?}.
4123 Don't try to bind @key{DEL} to @code{help-command}, because there are
4124 many modes that have local bindings of @key{DEL} that will interfere.
4128 @node stty and Backspace key, Swapping keys, Backspace invokes help, Key bindings
4129 @section Why doesn't Emacs look at the @file{stty} settings for @key{Backspace} vs. @key{Delete}?
4130 @cindex @file{stty} and Emacs
4131 @cindex Backspace and @file{stty}
4132 @cindex Delete and @file{stty}
4136 @node Swapping keys, Producing C-XXX with the keyboard, stty and Backspace key, Key bindings
4137 @section How do I swap two keys?
4138 @cindex Swapping keys
4139 @cindex Keys, swapping
4140 @cindex @code{keyboard-translate}
4142 In Emacs 19, you can swap two keys (or key sequences) by using the
4143 @code{keyboard-translate} function. For example, to turn @kbd{C-h} into
4144 @key{DEL} and @key{DEL} to @kbd{C-h}, use
4147 (keyboard-translate ?\C-h ?\C-?) ; translate `C-h' to DEL
4148 (keyboard-translate ?\C-? ?\C-h) ; translate DEL to `C-h'.
4151 The first key sequence of the pair after the function identifies what is
4152 produced by the keyboard; the second, what is matched for in the
4155 Keyboard translations are not the same as key bindings in keymaps.
4156 Emacs contains numerous keymaps that apply in different situations, but
4157 there is only one set of keyboard translations, and it applies to every
4158 character that Emacs reads from the terminal. Keyboard translations
4159 take place at the lowest level of input processing; the keys that are
4160 looked up in keymaps contain the characters that result from keyboard
4163 @inforef{Keyboard Translations, Keyboard Translations, emacs}.
4165 @node Producing C-XXX with the keyboard, No Meta key, Swapping keys, Key bindings
4166 @section How do I produce C-XXX with my keyboard?
4167 @cindex Producing control characters
4168 @cindex Generating control characters
4169 @cindex Control characters, generating
4171 On terminals (but not under X), some common "aliases" are:
4175 @item @kbd{C-2} or @kbd{C-@key{SPC}}
4181 @item @kbd{C-7} or @kbd{C-S--}
4195 Often other aliases exist; use the @kbd{C-h c} command and try
4196 @key{CTRL} with all of the digits on your keyboard to see what gets
4197 generated. You can also try the @kbd{C-h w} command if you know the
4198 name of the command.
4200 @node No Meta key, No Escape key, Producing C-XXX with the keyboard, Key bindings
4201 @section What if I don't have a @key{Meta} key?
4202 @cindex No @key{Meta} key
4203 @cindex @key{Meta} key, what to do if you lack it
4205 Instead of typing @kbd{M-a}, you can type @kbd{@key{ESC} a}. In fact,
4206 Emacs converts @kbd{M-a} internally into @kbd{@key{ESC} a} anyway
4207 (depending on the value of @code{meta-prefix-char}). Note that you
4208 press @key{Meta} and @key{a} together, while you press @kbd{ESC},
4209 release it, and then press @key{a}.
4211 @node No Escape key, Compose Character, No Meta key, Key bindings
4212 @section What if I don't have an @key{Escape} key?
4213 @cindex No Escape key
4214 @cindex Lacking an Escape key
4215 @cindex Escape key, lacking
4217 Type @kbd{C-[} instead. This should send ASCII code 27 just like an
4218 Escape key would. @kbd{C-3} may also work on some terminal (but not
4219 under X). For many terminals (notably DEC terminals) @key{F11}
4220 generates @key{ESC}. If not, the following form can be used to bind it:
4223 ;;; F11 is the documented ESC replacement on DEC terminals.
4224 (define-key function-key-map [f11] [?\e])
4227 @node Compose Character, Binding combinations of modifiers and function keys, No Escape key, Key bindings
4228 @section Can I make my @key{Compose Character} key behave like a @key{Meta} key?
4229 @cindex @key{Compose Character} key, using as @key{Meta}
4230 @cindex @key{Meta}, using @key{Compose Character} for
4232 On a dumb terminal such as a VT220, no. It is rumored that certain
4233 VT220 clones could have their @key{Compose} key configured this way. If
4234 you're using X, you might be able to do this with the @file{xmodmap} program.
4236 @node Binding combinations of modifiers and function keys, Meta key does not work in xterm, Compose Character, Key bindings
4237 @section How do I bind a combination of modifier key and function key?
4238 @cindex Modifiers and function keys
4239 @cindex Function keys and modifiers
4240 @cindex Binding modifiers and function keys
4242 With Emacs 19 you can represent modified function keys in vector format
4243 by adding prefixes to the function key symbol. For example (from the
4244 on-line documentation):
4247 (global-set-key [?\C-x right] 'forward-page)
4250 where @samp{?\C-x} is the Lisp character constant for the character @kbd{C-x}.
4252 You can use the modifier keys @key{Control}, @key{Meta}, @key{Hyper},
4253 @key{Super}, @key{Alt}, and @key{Shift} with function keys. To
4254 represent these modifiers, prepend the strings @samp{C-}, @samp{M-},
4255 @samp{H-}, @samp{s-}, @samp{A-}, and @samp{S-} to the symbol name. Here
4256 is how to make @kbd{H-M-RIGHT} move forward a word:
4259 (global-set-key [H-M-right] 'forward-word)
4264 @item Not all modifiers are permitted in all situations. @key{Hyper},
4265 @key{Super}, and @key{Alt} are available only under X (provided there
4266 are such keys). Non-ASCII keys and mouse events (e.g. @kbd{C-=} and
4267 @kbd{mouse-1}) also fall under this category.
4271 @xref{Binding keys to commands}, for general key binding instructions.
4273 @node Meta key does not work in xterm, ExtendChar key does not work as Meta, Binding combinations of modifiers and function keys, Key bindings
4274 @section Why doesn't my @key{Meta} key work in an xterm window?
4275 @cindex @key{Meta} key and xterm
4276 @cindex Xterm and @key{Meta} key
4278 Try all of these methods before asking for further help:
4283 You may have big problems using @file{mwm} as your window manager.
4284 (Does anyone know a good generic solution to allow the use of the
4285 @key{Meta} key in Emacs with @file{mwm}?)
4288 For X11: Make sure it really is a @key{Meta} key. Use @file{xev} to
4289 find out what keysym your @key{Meta} key generates. It should be either
4290 @key{Meta}_L or @key{Meta}_R. If it isn't, use @file{xmodmap} to fix
4294 Make sure the pty the xterm is using is passing 8 bit characters.
4295 @samp{stty -a} (or @samp{stty everything}) should show @samp{cs8} somewhere.
4296 If it shows @samp{cs7} instead, use @samp{stty cs8 -istrip} (or @samp{stty
4300 If there is an rlogin connection between the xterm and the Emacs, the
4301 "-8" argument may need to be given to rlogin to make it pass all 8 bits
4305 If the Emacs is running under Ultrix, it is reported that evaluating
4306 @code{(set-input-mode t nil)} helps.
4309 If all else fails, you can make xterm generate @kbd{@key{ESC} W} when
4310 you type @kbd{M-W}, which is the same conversion Emacs would make if it
4311 got the @kbd{M-W} anyway. In X11R4, the following resource
4312 specification will do this:
4315 XTerm.VT100.EightBitInput: false
4318 (This changes the behavior of the @code{insert-eight-bit} action.)
4320 With older xterms, you can specify this behavior with a translation:
4323 XTerm.VT100.Translations: #override \
4324 Meta<KeyPress>: string(0x1b) insert()
4327 You might have to replace @samp{Meta} with @samp{Alt}.
4331 @node ExtendChar key does not work as Meta, , Meta key does not work in xterm, Key bindings
4332 @section Why doesn't my @key{ExtendChar} key work as a @key{Meta} key under HP-UX 8.0 and 9.x?
4333 @cindex @key{ExtendChar} key as @key{Meta}
4334 @cindex @key{Meta}, using @key{ExtendChar} for
4336 This is a result of an internationalization extension in X11R4 and the
4337 fact that HP is now using this extension. Emacs assumes that
4338 XLookupString returns the same result regardless of the @key{Meta} key
4339 state which is no longer necessarily true. Until Emacs is fixed, the
4340 temporary kludge is to run this command after each time the X server is
4341 started but preferably before any xterm clients are:
4344 xmodmap -e 'remove mod1 = Mode_switch'
4347 This will disable the use of the extra keysyms systemwide, which may be
4348 undesirable if you actually intend to use them.
4350 @c ------------------------------------------------------------
4351 @node Alternate character sets, Mail and news, Key bindings, Top
4352 @chapter Alternate character sets
4353 @cindex Alternate character sets
4356 * Emacs does not display 8-bit characters::
4357 * Inputting eight-bit characters::
4358 * Kanji and Chinese characters::
4359 * Right-to-left alphabets::
4362 @node Emacs does not display 8-bit characters, Inputting eight-bit characters, Alternate character sets, Alternate character sets
4363 @section How do I make Emacs display 8-bit characters?
4364 @cindex Displaying eight-bit characters
4365 @cindex Eight-bit characters, displaying
4367 See @inforef{Single-Byte European Support, Single-byte European
4368 Character Support, emacs}. On a non-window-system display you typically
4369 need to use @code{set-terminal-coding-system} to tell Emacs what the
4370 terminal can display, even after setting the language environment.
4371 Otherwise non-ASCII characters will display as @samp{?}.
4373 @node Inputting eight-bit characters, Kanji and Chinese characters, Emacs does not display 8-bit characters, Alternate character sets
4374 @section How do I input eight-bit characters?
4375 @cindex Entering eight-bit characters
4376 @cindex Eight-bit characters, entering
4378 Various methods are available for input of eight-bit characters. See
4379 @inforef{Single-Byte European Support, Single-byte European Character
4380 Support, emacs}. For more sophisticated methods, see @inforef{Input
4381 Methods, Input Methods, emacs}.
4383 @node Kanji and Chinese characters, Right-to-left alphabets, Inputting eight-bit characters, Alternate character sets
4384 @section Where can I get an Emacs that handles kanji, Chinese, or other character sets?
4385 @cindex Kanji, handling with Emacs
4386 @cindex Chinese, handling with Emacs
4387 @cindex Japanese, handling with Emacs
4388 @cindex Korean, handling with Emacs
4390 Emacs 20 now includes many of the features of MULE, the Multilingual
4391 Enhancement of Emacs. @xref{Installing Emacs}, for information on where
4392 to find and download Emacs.
4394 @node Right-to-left alphabets, , Kanji and Chinese characters, Alternate character sets
4395 @section Where is an Emacs that can handle Semitic (right-to-left) alphabets?
4396 @cindex Right-to-left alphabets
4397 @cindex Hebrew, handling with Emacs
4398 @cindex Semitic alphabets
4400 Emacs 20 supports Hebrew characters (ISO 8859-8), but does not yet
4401 support right-to-left character entry.
4403 @email{joel@@exc.com, Joel M. Hoffman} has written a Lisp package called
4404 @file{hebrew.el} that allows right-to-left editing of Hebrew. It
4405 reportedly works out of the box with Emacs 19, but requires patches for
4406 Emacs 18. Write to Joel if you want the patches or package.
4408 @file{hebrew.el} requires a Hebrew screen font, but no other Hardware support.
4409 Joel has a screen font for PCs running MS-DOS and Linux.
4411 You might also try to query archie for files named with "hebrew";
4412 several ftp sites in Israel may also have the necessary files.
4414 @c ------------------------------------------------------------
4415 @node Mail and news, Concept index, Alternate character sets, Top
4416 @chapter Mail and news
4417 @cindex Mail and news
4420 * Changing the included text prefix::
4421 * Saving a copy of outgoing mail::
4422 * Expanding aliases when sending mail::
4423 * Rmail thinks all messages are one big one::
4424 * Sorting the messages in an Rmail folder::
4425 * Rmail writes to /usr/spool/mail::
4426 * Recovering mail files when Rmail munges them::
4427 * Replying to the sender of a message::
4428 * MIME with Emacs mail packages::
4429 * Automatically starting a mail or news reader::
4430 * Reading news with Emacs::
4431 * Gnus does not work with NNTP::
4432 * Viewing articles with embedded underlining::
4433 * Saving a multi-part Gnus posting::
4434 * Starting Gnus faster::
4435 * Catching up in all newsgroups::
4436 * Killing based on nonstandard headers::
4437 * Removing flashing messages::
4438 * Catch-up is slow in Gnus::
4439 * Gnus hangs for a long time::
4440 * Learning more about Gnus::
4443 @node Changing the included text prefix, Saving a copy of outgoing mail, Mail and news, Mail and news
4444 @section How do I change the included text prefix in mail/news followups?
4445 @cindex Prefix in mail/news followups, changing
4446 @cindex Included text prefix, changing
4447 @cindex Setting the included text character
4449 If you read mail with Rmail or news with Gnus, set the variable
4450 @code{mail-yank-prefix}. For VM, set @code{vm-included-text-prefix}.
4451 For mh-e, set @code{mh-ins-buf-prefix}.
4453 For fancier control of citations, use Supercite. @xref{Supercite}.
4455 To prevent Emacs from including various headers of the replied-to
4456 message, set the value of @code{mail-yank-ignored-headers} to an
4459 @node Saving a copy of outgoing mail, Expanding aliases when sending mail, Changing the included text prefix, Mail and news
4460 @section How do I save a copy of outgoing mail?
4461 @cindex Saving a copy of outgoing mail
4462 @cindex Copying outgoing mail to a file
4463 @cindex Filing outgoing mail
4464 @cindex Automatic filing of outgoing mail
4465 @cindex Mail, saving outgoing automatically
4467 You can either mail yourself a copy by including a @samp{BCC} header in the
4468 mail message, or store a copy of the message directly to a file by
4469 including an @samp{FCC} header.
4471 If you use standard mail, you can automatically create a @samp{BCC} to
4475 (setq mail-self-blind t)
4478 in your @file{.emacs} file. You can automatically include an "FCC:" field by
4479 putting something like the following in your @file{.emacs} file:
4482 (setq mail-archive-file-name (expand-file-name "~/outgoing"))
4485 The output file will be in Unix mail format, which can be read directly
4486 by VM, but not always by Rmail. @xref{Learning how to do something}.
4488 If you use @code{mh-e}, add an @samp{FCC} or @samp{BCC} field to your
4491 It does not work to put "set record filename" in the @file{.mailrc}
4494 @node Expanding aliases when sending mail, Rmail thinks all messages are one big one, Saving a copy of outgoing mail, Mail and news
4495 @section Why doesn't Emacs expand my aliases when sending mail?
4496 @cindex Expanding aliases when sending mail
4497 @cindex Mail alias expansion
4498 @cindex Sending mail with aliases
4503 You must separate multiple addresses in the headers of the mail buffer
4504 with commas. This is because Emacs supports RFC822 standard addresses
4508 To: Willy Smith <wks@@xpnsv.lwyrs.com>
4511 However, you do not need to --- and probably should not, unless your
4512 system's version of @file{/usr/ucb/mail} (aka mailx) supports RFC822
4513 -- separate addresses with commas in your @file{~/.mailrc} file.
4516 Emacs normally only reads the @file{.mailrc} file once per session,
4517 when you start to compose your first mail message. If you edit
4518 .mailrc, you can type @kbd{M-x rebuild-mail-abbrevs @key{RET}} to
4519 make Emacs reread @file{~/.mailrc}.
4522 If you like, you can expand mail aliases as abbrevs, as soon as you
4523 type them in. To enable this feature, execute the following:
4526 (add-hook 'mail-setup-hook 'mail-abbrevs-setup)
4529 Note that the aliases are expanded automatically only after you type
4530 @key{RET} or a punctuation character (e.g. @kbd{,}). You can force their
4531 expansion by moving point to the end of the alias and typing @kbd{C-x a e}
4532 @kbd{M-x expand-abbrev}.
4535 @node Rmail thinks all messages are one big one, Sorting the messages in an Rmail folder, Expanding aliases when sending mail, Mail and news
4536 @section Why does Rmail think all my saved messages are one big message?
4537 @cindex Rmail thinks all messages are one large message
4539 A file created through the @samp{FCC} field in a message is in Unix mail
4540 format, not the format that Rmail uses (BABYL format). Rmail will try
4541 to convert a Unix mail file into BABYL format on input, but sometimes it
4542 makes errors. For guaranteed safety, you can make the
4543 @file{saved-messages} file be an inbox for your Rmail file by using the
4544 function @code{set-rmail-inbox-list}.
4546 @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
4547 @section How can I sort the messages in my Rmail folder?
4548 @cindex Rmail, sorting messages in
4549 @cindex Folder, sorting messages in an Rmail
4550 @cindex Sorting messages in an Rmail folder
4552 In Rmail, type @kbd{C-c C-s C-h} to get a list of sorting functions
4553 and their key bindings.
4555 @node Rmail writes to /usr/spool/mail, Recovering mail files when Rmail munges them, Sorting the messages in an Rmail folder, Mail and news
4556 @section Why does Rmail need to write to @file{/usr/spool/mail}?
4557 @cindex Rmail and @file{/usr/spool/mail}
4558 @cindex @file{/usr/spool/mail} and Rmail
4560 This is the behavior of the @file{movemail} program which Rmail uses.
4561 This indicates that @file{movemail} is configured to use lock files.
4566 Certain systems require lock files to interlock access to mail files.
4567 On these systems, @file{movemail} must write lock files, or you risk losing
4568 mail. You simply must arrange to let @file{movemail} write them.
4570 Other systems use the flock system call to interlock access. On these
4571 systems, you should configure @file{movemail} to use @code{flock}.
4574 @node Recovering mail files when Rmail munges them, Replying to the sender of a message, Rmail writes to /usr/spool/mail, Mail and news
4575 @section How do I recover my mail files after Rmail munges their format?
4576 @cindex Recovering munged mail files
4577 @cindex Rmail munged my files
4578 @cindex Mail files, recovering those munged by Rmail
4580 If you have just done @code{rmail-input} on a file and you don't want to
4581 save it in Rmail's format (called BABYL), just kill the buffer (with
4584 If you typed @kbd{M-x rmail} and it read some messages out of your inbox
4585 and you want to put them in a Unix mail file, use @kbd{C-o} on each
4588 If you want to convert an existing file from BABYL format to Unix mail
4589 format, use the command @kbd{M-x unrmail}: it will prompt you for the
4590 input and output file names.
4592 @node Replying to the sender of a message, MIME with Emacs mail packages, Recovering mail files when Rmail munges them, Mail and news
4593 @section How can I force Rmail to reply to the sender of a message, but not the other recipients?
4594 @cindex Replying only to the sender of a message
4595 @cindex Sender, replying only to
4596 @cindex Rmail, replying to the sender of a message in
4598 @email{isaacson@@seas.upenn.edu, Ron Isaacson} says: When you hit
4599 @key{r} to reply in Rmail, by default it CCs all of the original
4600 recipients (everyone on the original @samp{To} and @samp{CC}
4601 lists). With a prefix argument (i.e., typing @kbd{C-u} before @key{r}),
4602 it replies only to the sender. However, going through the whole
4603 @kbd{C-u} business every time you want to reply is a pain. This is the
4604 best fix I've been able to come up with:
4607 (defun rmail-reply-t ()
4608 "Reply only to the sender of the current message. (See rmail-reply.)"
4612 (add-hook 'rmail-mode-hook
4614 (define-key rmail-mode-map "r" 'rmail-reply-t)
4615 (define-key rmail-mode-map "R" 'rmail-reply)))
4618 @node MIME with Emacs mail packages, Automatically starting a mail or news reader, Replying to the sender of a message, Mail and news
4619 @section How can I get my favorite Emacs mail package to support MIME?
4620 @cindex MIME and Emacs mail packages
4621 @cindex Mail packages and MIME
4622 @cindex FAQ for MIME and Emacs
4624 Read the Emacs MIME FAQ, maintained by @email{trey@@cs.berkeley.edu,
4625 MacDonald Hall Jackson} at
4627 @uref{http://bmrc.berkeley.edu/~trey/emacs/mime.html}
4629 Version 6.x of VM supports MIME. @xref{VM}.
4631 @node Automatically starting a mail or news reader, Reading news with Emacs, MIME with Emacs mail packages, Mail and news
4632 @section How do I make Emacs automatically start my mail/news reader?
4633 @cindex Mail reader, starting automatically
4634 @cindex News reader, starting automatically
4635 @cindex Starting mail/news reader automatically
4637 To start Emacs in Gnus:
4649 A more convenient way to start with Gnus:
4652 alias gnus 'emacs -f gnus'
4656 It is probably unwise to automatically start your mail or news reader
4657 from your @file{.emacs} file. This would cause problems if you needed to run
4658 two copies of Emacs at one time. Also, this would make it difficult for
4659 you to start Emacs quickly when you needed to.
4661 @node Reading news with Emacs, Gnus does not work with NNTP, Automatically starting a mail or news reader, Mail and news
4662 @section How do I read news under Emacs?
4663 @cindex Reading news under Emacs
4664 @cindex Usenet reader in Emacs
4665 @cindex Gnus newsreader
4667 Use @kbd{M-x gnus}. It is documented in Info (@pxref{Learning how to do something}).
4669 @node Gnus does not work with NNTP, Viewing articles with embedded underlining, Reading news with Emacs, Mail and news
4670 @section Why doesn't Gnus work via NNTP?
4671 @cindex Gnus and NNTP
4672 @cindex NNTP, Gnus fails to work with
4674 There is a bug in NNTP version 1.5.10, such that when multiple requests
4675 are sent to the NNTP server, the server only handles the first one
4676 before blocking waiting for more input which never comes. NNTP version
4677 1.5.11 claims to fix this.
4679 You can work around the bug inside Emacs like this:
4682 (setq nntp-maximum-request 1)
4685 You can find out what version of NNTP your news server is running by
4686 telnetting to the NNTP port (usually 119) on the news server machine
4687 (i.e., "telnet server-machine 119"). The server should give its version
4688 number in the welcome message. Type "quit" to get out.
4690 @xref{Spontaneous entry into isearch-mode}, for some additional ideas.
4692 @node Viewing articles with embedded underlining, Saving a multi-part Gnus posting, Gnus does not work with NNTP, Mail and news
4693 @section How do I view news articles with embedded underlining (e.g., ClariNews)?
4694 @cindex Underlining, embedded in news articles
4695 @cindex News articles with embedded underlining
4696 @cindex Embedded underlining in news articles
4698 Underlining appears like this:
4701 _^Hu_^Hn_^Hd_^He_^Hr_^Hl_^Hi_^Hn_^Hi_^Hn_^Hg
4704 @email{amanda@@iesd.auc.dk, Per Abrahamsen} suggests using the following
4705 code, which uses the underline face to turn such text into true
4709 (defun gnus-article-prepare-overstrike ()
4710 ;; Prepare article for overstrike commands.
4712 (set-buffer gnus-article-buffer)
4713 (let ((buffer-read-only nil))
4714 (goto-char (point-min))
4715 (while (search-forward "\b" nil t)
4716 (let ((next (following-char))
4717 (previous (char-after (- (point) 2))))
4718 (cond ((eq next previous)
4719 (delete-region (- (point) 2) (point))
4720 (put-text-property (point) (1+ (point))
4723 (delete-region (1- (point)) (1+ (point)))
4724 (put-text-property (1- (point)) (point)
4727 (delete-region (- (point) 2) (point))
4728 (put-text-property (point) (1+ (point))
4729 'face 'underline))))))))
4731 (add-hook 'gnus-article-prepare-hook 'gnus-article-prepare-overstrike)
4734 If you prefer to do away with underlining altogether, you can
4735 destructively remove it with @kbd{M-x ununderline-region}; do this
4739 (add-hook 'gnus-article-prepare-hook
4740 '(lambda () (ununderline-region (point-min) (point-max))))
4743 @node Saving a multi-part Gnus posting, Starting Gnus faster, Viewing articles with embedded underlining, Mail and news
4744 @section How do I save all the items of a multi-part posting in Gnus?
4745 @cindex Multi-part postings in Gnus, saving
4746 @cindex Saving multi-part postings in Gnus
4747 @cindex Gnus, saving multi-part postings in
4749 Use @code{gnus-uu}. Type @kbd{C-c C-v C-h} in the Gnus summary buffer
4750 to see a list of available commands.
4752 @node Starting Gnus faster, Catching up in all newsgroups, Saving a multi-part Gnus posting, Mail and news
4753 @section How do I make Gnus start up faster?
4754 @cindex Faster, starting Gnus
4755 @cindex Starting Gnus faster
4756 @cindex Gnus, starting faster
4758 From the Gnus FAQ (@pxref{Learning more about Gnus}):
4761 @email{pktiwari@@eos.ncsu.edu, Pranav Kumar Tiwari} writes: I posted
4762 the same query recently and I got an answer to it. I am going to
4763 repeat the answer. What you need is a newer version of gnus, version
4764 5.0.4+. I am using 5.0.12 and it works fine with me with the
4768 (setq gnus-check-new-newsgroups nil
4769 gnus-read-active-file 'some
4770 gnus-nov-is-evil nil
4771 gnus-select-method '(nntp gnus-nntp-server))
4775 @node Catching up in all newsgroups, Killing based on nonstandard headers, Starting Gnus faster, Mail and news
4776 @section How do I catch up all newsgroups in Gnus?
4777 @cindex Catching up all newsgroups in Gnus
4778 @cindex Gnus, Catching up all newsgroups in
4780 In the @file{*Newsgroup*} buffer, type @kbd{M-< C-x ( c y C-x ) M-0 C-x e}
4782 Leave off the initial @kbd{M-<} if you only want to catch up from point
4783 to the end of the @file{*Newsgroup*} buffer.
4785 @node Killing based on nonstandard headers, Removing flashing messages, Catching up in all newsgroups, Mail and news
4786 @section Why can't I kill in Gnus based on the Newsgroups/Keywords/Control headers?
4787 @cindex Killing articles based on nonstandard headers
4788 @cindex Newsgroups header, killing articles based on
4789 @cindex Keywords header, killing articles based on
4790 @cindex Control header, killing articles based on
4792 Gnus will complain that the @samp{Newsgroups}, @samp{Keywords}, and
4793 @samp{Control} headers are "Unknown header" fields.
4795 For the @samp{Newsgroups} header, there is an easy workaround: kill on the
4796 @samp{Xref} header instead, which will be present on any cross-posted article
4797 (as long as your site carries the cross-post group).
4799 If you really want to kill on one of these headers, you can do it like
4803 (gnus-kill nil "^Newsgroups: .*\\(bad\\.group\\|worse\\.group\\)")
4806 @node Removing flashing messages, Catch-up is slow in Gnus, Killing based on nonstandard headers, Mail and news
4807 @section How do I get rid of flashing messages in Gnus for slow connections?
4808 @cindex Flashing Gnus messages, removing
4809 @cindex Removing flashing Gnus messages
4810 @cindex Slow connections causing flashing messages in Gnus
4811 @cindex Gnus, flashing messages in
4813 Set @code{nntp-debug-read} to @code{nil}.
4815 @node Catch-up is slow in Gnus, Gnus hangs for a long time, Removing flashing messages, Mail and news
4816 @section Why is catch up slow in Gnus?
4817 @cindex Slow catch up in Gnus
4818 @cindex Gnus is slow when catching up
4819 @cindex Crosspostings make Gnus catching up slow
4821 Because Gnus is marking crosspostings read. You can control this with
4822 the variable @code{gnus-use-cross-reference}.
4824 @node Gnus hangs for a long time, Learning more about Gnus, Catch-up is slow in Gnus, Mail and news
4825 @section Why does Gnus hang for a long time when posting?
4826 @cindex Hangs in Gnus
4827 @cindex Gnus hangs while posting
4828 @cindex Posting, Gnus hangs wile
4830 @email{tale@@uunet.uu.net, David Lawrence} explains:
4833 The problem is almost always interaction between NNTP and C News. NNTP
4834 POST asks C News's inews to not background itself but rather hang around
4835 and give its exit status so it knows whether the post was successful.
4836 (That wait will on some systems not return the exit status of the
4837 waited for job is a different sort of problem.) It ends up taking a
4838 long time because inews is calling relaynews, which often waits for
4839 another relaynews to free the lock on the news system so it can file the
4842 My preferred solution is to change inews to not call relaynews, but
4843 rather use newsspool. This loses some error-catching functionality, but
4844 is for the most part safe as inews will detect a lot of the errors on
4845 its own. The C News folks have sped up inews, too, so speed should look
4846 better to most folks as that update propagates around.
4849 @node Learning more about Gnus, , Gnus hangs for a long time, Mail and news
4850 @section Where can I find out more about Gnus?
4851 @cindex FAQ for Gnus
4853 @cindex Learning more about GNU
4855 Look for the Gnus FAQ, available at
4857 @uref{http://www.ccs.neu.edu/software/contrib/gnus/}
4859 @node Concept index, , Mail and news, Top
4860 @unnumbered Concept Index