faq.texi 173 KB
Newer Older
Glenn Morris's avatar
Glenn Morris committed
1 2
\input texinfo   @c -*- mode: texinfo; -*-
@c %**start of header
3
@setfilename ../../info/efaq
Glenn Morris's avatar
Glenn Morris committed
4 5 6 7
@settitle GNU Emacs FAQ
@c %**end of header

@c This is used in many places
Chong Yidong's avatar
Chong Yidong committed
8
@set VER 23.0.94
Glenn Morris's avatar
Glenn Morris committed
9 10 11 12 13 14

@c This file is maintained by Romain Francoise <rfrancoise@gnu.org>.
@c Feel free to install changes without prior permission (but I'd
@c appreciate a notice if you do).

@copying
Glenn Morris's avatar
Glenn Morris committed
15
Copyright @copyright{} 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Glenn Morris's avatar
Glenn Morris committed
16
Free Software Foundation, Inc.@*
17 18 19 20
Copyright @copyright{} 1994, 1995, 1996, 1997, 1998, 1999, 2000
Reuven M. Lerner@*
Copyright @copyright{} 1992, 1993 Steven Byrnes@*
Copyright @copyright{} 1990, 1991, 1992 Joseph Brian Wells@*
Glenn Morris's avatar
Glenn Morris committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57

@quotation
This list of frequently asked questions about GNU Emacs with answers
(``FAQ'') may be translated into other languages, transformed into other
formats (e.g. Texinfo, Info, WWW, WAIS), and updated with new information.

The same conditions apply to any derivative of the FAQ as apply to the FAQ
itself.  Every copy of the FAQ must include this notice or an approved
translation, information on who is currently maintaining the FAQ and how to
contact them (including their e-mail address), and information on where the
latest version of the FAQ is archived (including FTP information).

The FAQ may be copied and redistributed under these conditions, except that
the FAQ may not be embedded in a larger literary work unless that work
itself allows free copying and redistribution.

[This version has been heavily edited since it was included in the Emacs
distribution.]
@end quotation
@end copying

@dircategory Emacs
@direntry
* Emacs FAQ: (efaq).	Frequently Asked Questions about Emacs.
@end direntry

@c The @titlepage stuff only appears in the printed version
@titlepage
@sp 10
@center @titlefont{GNU Emacs FAQ}

@c The following two commands start the copyright page.
@page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage

58 59
@contents

Glenn Morris's avatar
Glenn Morris committed
60 61
@node Top, FAQ notation, (dir), (dir)
@top The GNU Emacs FAQ
Glenn Morris's avatar
Glenn Morris committed
62

63
@c FIXME @today is just the day we ran `makeinfo'.
Glenn Morris's avatar
Glenn Morris committed
64 65 66 67 68 69
This is the GNU Emacs FAQ, last updated on @today{}.

This FAQ is maintained as a part of GNU Emacs.  If you find any errors,
or have any suggestions, please use @kbd{M-x report-emacs-bug} to report
them.

70 71 72 73
@ifnottex
@insertcopying
@end ifnottex 

Glenn Morris's avatar
Glenn Morris committed
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
@menu
* FAQ notation::
* General questions::
* Getting help::
* Status of Emacs::
* Common requests::
* Bugs and problems::
* Compiling and installing Emacs::
* Finding Emacs and related packages::
* Major packages and programs::
* Key bindings::
* Alternate character sets::
* Mail and news::
* Concept index::
@end menu

@c ------------------------------------------------------------
Glenn Morris's avatar
Glenn Morris committed
91
@node FAQ notation
Glenn Morris's avatar
Glenn Morris committed
92 93 94 95 96 97 98 99 100 101 102
@chapter FAQ notation
@cindex FAQ notation

This chapter describes notation used in the GNU Emacs FAQ, as well as in
the Emacs documentation.  Consult this section if this is the first time
you are reading the FAQ, or if you are confused by notation or terms
used in the FAQ.

@menu
* Basic keys::
* Extended commands::
103
* Emacs manual::
Glenn Morris's avatar
Glenn Morris committed
104 105 106 107
* File-name conventions::
* Common acronyms::
@end menu

Glenn Morris's avatar
Glenn Morris committed
108
@node Basic keys
Glenn Morris's avatar
Glenn Morris committed
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
@section What do these mean: @kbd{C-h}, @kbd{C-M-a}, @key{RET}, @kbd{@key{ESC} a}, etc.?
@cindex Basic keys
@cindex Control key, notation for
@cindex @key{Meta} key, notation for
@cindex Control-Meta characters, notation for
@cindex @kbd{C-h}, definition of
@cindex @kbd{C-M-h}, definition of
@cindex @key{DEL}, definition of
@cindex @key{ESC}, definition of
@cindex @key{LFD}, definition of
@cindex @key{RET}, definition of
@cindex @key{SPC}, definition of
@cindex @key{TAB}, definition of
@cindex Notation for keys

@itemize @bullet

@item
@kbd{C-x}: press the @key{x} key while holding down the @key{Control} key

@item
@kbd{M-x}: press the @key{x} key while holding down the @key{Meta} key
(if your computer doesn't have a @key{Meta} key, @pxref{No Meta key})

@item
@kbd{M-C-x}: press the @key{x} key while holding down both @key{Control}
and @key{Meta}

@item
@kbd{C-M-x}: a synonym for the above

@item
@key{LFD}: Linefeed or Newline; same as @kbd{C-j}

@item
@key{RET}: @key{Return}, sometimes marked @key{Enter}; same as @kbd{C-m}

@item
@key{DEL}: @key{Delete}, usually @strong{not} the same as
@key{Backspace}; same as @kbd{C-?} (see @ref{Backspace invokes help}, if
deleting invokes Emacs help)

@item
@key{ESC}: Escape; same as @kbd{C-[}

@item
@key{TAB}: Tab; same as @kbd{C-i}

@item
@key{SPC}: Space bar

@end itemize

Key sequences longer than one key (and some single-key sequences) are
written inside quotes or on lines by themselves, like this:

@display
  @kbd{M-x frobnicate-while-foo RET}
@end display

@noindent
Any real spaces in such a key sequence should be ignored; only @key{SPC}
really means press the space key.

The @acronym{ASCII} code sent by @kbd{C-x} (except for @kbd{C-?}) is the value
that would be sent by pressing just @key{x} minus 96 (or 64 for
upper-case @key{X}) and will be from 0 to 31.  On Unix and GNU/Linux
terminals, the @acronym{ASCII} code sent by @kbd{M-x} is the sum of 128 and the
@acronym{ASCII} code that would be sent by pressing just @key{x}.  Essentially,
@key{Control} turns off bits 5 and 6 and @key{Meta} turns on bit
7@footnote{
DOS and Windows terminals don't set bit 7 when the @key{Meta} key is
pressed.}.

@kbd{C-?} (aka @key{DEL}) is @acronym{ASCII} code 127.  It is a misnomer to call
@kbd{C-?}  a ``control'' key, since 127 has both bits 5 and 6 turned ON.
Also, on very few keyboards does @kbd{C-?} generate @acronym{ASCII} code 127.
186
@c FIXME I cannot understand the previous sentence.
Glenn Morris's avatar
Glenn Morris committed
187

188 189
@inforef{Keys, Keys, emacs}, for more information.  (@xref{Emacs
manual}, for more information about Info.)
Glenn Morris's avatar
Glenn Morris committed
190

Glenn Morris's avatar
Glenn Morris committed
191
@node Extended commands
Glenn Morris's avatar
Glenn Morris committed
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
@section What does @file{M-x @var{command}} mean?
@cindex Extended commands
@cindex Commands, extended
@cindex M-x, meaning of

@kbd{M-x @var{command}} means type @kbd{M-x}, then type the name of the
command, then type @key{RET}.  (@xref{Basic keys}, if you're not sure
what @kbd{M-x} and @key{RET} mean.)

@kbd{M-x} (by default) invokes the command
@code{execute-extended-command}.  This command allows you to run any
Emacs command if you can remember the command's name.  If you can't
remember the command's name, you can type @key{TAB} and @key{SPC} for
completion, @key{?} for a list of possibilities, and @kbd{M-p} and
@kbd{M-n} (or up-arrow and down-arrow on terminals that have these
editing keys) to see previous commands entered.  An Emacs @dfn{command}
is an @dfn{interactive} Emacs function.

@cindex @key{Do} key
Your system administrator may have bound other key sequences to invoke
@code{execute-extended-command}.  A function key labeled @kbd{Do} is a
good candidate for this, on keyboards that have such a key.

If you need to run non-interactive Emacs functions, see @ref{Evaluating
Emacs Lisp code}.

218 219 220 221 222
@node Emacs manual
@section How do I read topic XXX in the Emacs manual?
@cindex Emacs manual, reading topics in
@cindex Reading topics in the Emacs manual
@cindex Finding topics in the Emacs manual
Glenn Morris's avatar
Glenn Morris committed
223 224
@cindex Info, finding topics in

225
When we refer you to some @var{topic} in the Emacs manual, you can
Glenn Morris's avatar
Glenn Morris committed
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
read this manual node inside Emacs (assuming nothing is broken) by
typing @kbd{C-h i m emacs @key{RET} m @var{topic} @key{RET}}.

This invokes Info, the GNU hypertext documentation browser.  If you don't
already know how to use Info, type @key{?} from within Info.

If we refer to @var{topic}:@var{subtopic}, type @kbd{C-h i m emacs
@key{RET} m @var{topic} @key{RET} m @var{subtopic} @key{RET}}.

If these commands don't work as expected, your system administrator may
not have installed the Info files, or may have installed them
improperly.  In this case you should complain.

@xref{Getting a printed manual}, if you would like a paper copy of the
Emacs manual.

Glenn Morris's avatar
Glenn Morris committed
242
@node File-name conventions
243
@section What are @file{etc/GNU}, @file{src/config.h}, and @file{site-lisp/default.el}?
Glenn Morris's avatar
Glenn Morris committed
244 245 246 247 248
@cindex File-name conventions
@cindex Conventions for file names
@cindex Directories and files that come with Emacs

These are files that come with Emacs.  The Emacs distribution is divided
249
into subdirectories; e.g. @file{etc}, @file{lisp}, and @file{src}.
Glenn Morris's avatar
Glenn Morris committed
250 251 252 253 254 255 256 257

If you use Emacs, but don't know where it is kept on your system, start
Emacs, then type @kbd{C-h v data-directory @key{RET}}.  The directory
name displayed by this will be the full pathname of the installed
@file{etc} directory.  (This full path is recorded in the Emacs variable
@code{data-directory}, and @kbd{C-h v} displays the value and the
documentation of a variable.)

258
The location of your Info directory (i.e., where Info documentation
Glenn Morris's avatar
Glenn Morris committed
259 260 261 262
is stored) is kept in the variable @code{Info-default-directory-list}.  Use
@kbd{C-h v Info-default-directory-list @key{RET}} to see the value of
this variable, which will be a list of directory names.  The last
directory in that list is probably where most Info files are stored.  By
263
default, Info documentation is placed in @file{/usr/local/share/info}.
Glenn Morris's avatar
Glenn Morris committed
264 265 266 267 268 269 270

Some of these files are available individually via FTP or e-mail; see
@ref{Informational files for Emacs}.  They all are available in the
source distribution.  Many of the files in the @file{etc} directory are
also available via the Emacs @samp{Help} menu, or by typing @kbd{C-h ?}
(@kbd{M-x help-for-help}).

Glenn Morris's avatar
Glenn Morris committed
271
@node Common acronyms
272
@section What are FSF, LPF, GNU, RMS, FTP, and GPL?
Glenn Morris's avatar
Glenn Morris committed
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305
@cindex FSF, definition of
@cindex LPF, definition of
@cindex GNU, definition of
@cindex RMS, definition of
@cindex Stallman, Richard, acronym for
@cindex Richard Stallman, acronym for
@cindex FTP, definition of
@cindex GPL, definition of
@cindex Acronyms, definitions for
@cindex Common acronyms, definitions for

@table @asis

@item FSF
Free Software Foundation

@item LPF
League for Programming Freedom

@item GNU
GNU's Not Unix

@item RMS
Richard Matthew Stallman

@item FTP
File Transfer Protocol

@item GPL
GNU General Public License

@end table

306
Avoid confusing the FSF and the LPF.  The LPF opposes
Glenn Morris's avatar
Glenn Morris committed
307
look-and-feel copyrights and software patents.  The FSF aims to make
308
high quality free software available for everyone.
Glenn Morris's avatar
Glenn Morris committed
309 310 311 312 313 314 315 316 317

The word ``free'' in the title of the Free Software Foundation refers to
``freedom,'' not ``zero cost.''  Anyone can charge any price for
GPL-covered software that they want to.  However, in practice, the
freedom enforced by the GPL leads to low prices, because you can always
get the software for less money from someone else, since everyone has
the right to resell or give away GPL-covered software.

@c ------------------------------------------------------------
Glenn Morris's avatar
Glenn Morris committed
318
@node General questions
Glenn Morris's avatar
Glenn Morris committed
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334
@chapter General questions
@cindex General questions

This chapter contains general questions having to do with Emacs, the
Free Software Foundation, and related organizations.

@menu
* The LPF::
* Real meaning of copyleft::
* Guidelines for newsgroup postings::
* Newsgroup archives::
* Reporting bugs::
* Unsubscribing from Emacs lists::
* Contacting the FSF::
@end menu

Glenn Morris's avatar
Glenn Morris committed
335
@node The LPF
Glenn Morris's avatar
Glenn Morris committed
336 337 338 339 340 341 342
@section What is the LPF?
@cindex LPF, description of
@cindex League for Programming Freedom
@cindex Software patents, opposition to
@cindex Patents for software, opposition to

The LPF opposes the expanding danger of software patents and
343 344
look-and-feel copyrights.  More information on the LPF's views is
available at @uref{http://progfree.org/, the LPF home page}.
Glenn Morris's avatar
Glenn Morris committed
345

Glenn Morris's avatar
Glenn Morris committed
346
@node Real meaning of copyleft
Glenn Morris's avatar
Glenn Morris committed
347 348 349 350 351 352 353 354 355
@section What is the real legal meaning of the GNU copyleft?
@cindex Copyleft, real meaning of
@cindex GPL, real meaning of
@cindex General Public License, real meaning of
@cindex Discussion of the GPL

The real legal meaning of the GNU General Public License (copyleft) will
only be known if and when a judge rules on its validity and scope.
There has never been a copyright infringement case involving the GPL to
356 357 358 359 360 361
set any precedents.  Although legal actions have been brought against
companies for violating the terms of the GPL, so far all have been
settled out of court (in favour of the plaintiffs).  Please take any
discussion regarding this issue to the newsgroup
@uref{news:gnu.misc.discuss}, which was created to hold the extensive
flame wars on the subject.
Glenn Morris's avatar
Glenn Morris committed
362 363 364 365 366 367 368 369 370 371 372 373 374

RMS writes:

@quotation
The legal meaning of the GNU copyleft is less important than the spirit,
which is that Emacs is a free software project and that work pertaining
to Emacs should also be free software.  ``Free'' means that all users
have the freedom to study, share, change and improve Emacs.  To make
sure everyone has this freedom, pass along source code when you
distribute any version of Emacs or a related program, and give the
recipients the same freedom that you enjoyed.
@end quotation

Glenn Morris's avatar
Glenn Morris committed
375
@node Guidelines for newsgroup postings
376
@section  What are appropriate messages for the various Emacs newsgroups?
Glenn Morris's avatar
Glenn Morris committed
377 378 379 380 381 382 383 384 385 386 387 388 389
@cindex Newsgroups, appropriate messages for
@cindex GNU newsgroups, appropriate messages for
@cindex Usenet groups, appropriate messages for
@cindex Mailing lists, appropriate messages for
@cindex Posting messages to newsgroups

@cindex GNU mailing lists
The file @file{etc/MAILINGLISTS} describes the purpose of each GNU
mailing list.  (@xref{Informational files for Emacs}, if you want a copy
of the file.)  For those lists which are gatewayed with newsgroups, it
lists both the newsgroup name and the mailing list address.

The newsgroup @uref{news:comp.emacs} is for discussion of Emacs programs
390 391
in general.  The newsgroup @uref{news:gnu.emacs.help} is specifically
for GNU Emacs.
Glenn Morris's avatar
Glenn Morris committed
392 393 394 395 396 397 398 399 400 401 402 403

Messages advocating ``non-free'' software are considered unacceptable on
any of the @code{gnu.*} newsgroups except for @uref{news:gnu.misc.discuss},
which was created to hold the extensive flame-wars on the subject.
``Non-free'' software includes any software for which the end user can't
freely modify the source code and exchange enhancements.  Be careful to
remove the @code{gnu.*} groups from the @samp{Newsgroups:} line when
posting a followup that recommends such software.

@uref{news:gnu.emacs.bug} is a place where bug reports appear, but avoid
posting bug reports to this newsgroup directly (@pxref{Reporting bugs}).

Glenn Morris's avatar
Glenn Morris committed
404
@node Newsgroup archives
Glenn Morris's avatar
Glenn Morris committed
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420
@section Where can I get old postings to @uref{news:gnu.emacs.help} and other GNU groups?
@cindex Archived postings from @code{gnu.emacs.help}
@cindex Usenet archives for GNU groups
@cindex Old Usenet postings for GNU groups

The FSF has maintained archives of all of the GNU mailing lists for many
years, although there may be some unintentional gaps in coverage.  The
archive is not particularly well organized or easy to retrieve
individual postings from, but pretty much everything is there.

The archive is at @uref{ftp://lists.gnu.org/}.

The archive can be browsed over the web at
@uref{http://lists.gnu.org/archive/html/, the GNU mail archive}.

Web-based Usenet search services, such as
421
@uref{http://groups.google.com/groups/dir?q=gnu&, Google}, also
Glenn Morris's avatar
Glenn Morris committed
422 423 424
archive the @code{gnu.*} groups.

You can read the archives of the @code{gnu.*} groups and post new
425 426
messages at @uref{http://gmane.org/, Gmane}.  Gmane is a service that
presents mailing lists as newsgroups.
Glenn Morris's avatar
Glenn Morris committed
427

Glenn Morris's avatar
Glenn Morris committed
428
@node Reporting bugs
Glenn Morris's avatar
Glenn Morris committed
429 430 431 432 433 434 435 436
@section Where should I report bugs and other problems with Emacs?
@cindex Bug reporting
@cindex Good bug reports
@cindex How to submit a bug report
@cindex Reporting bugs

The correct way to report Emacs bugs is to use the command
@kbd{M-x report-emacs-bug}.  It sets up a mail buffer with the
437
essential information and the correct e-mail address, which is
Glenn Morris's avatar
Glenn Morris committed
438 439 440 441 442 443 444 445 446
@email{bug-gnu-emacs@@gnu.org} for the released versions of Emacs.
Anything sent to @email{bug-gnu-emacs@@gnu.org} also appears in the
newsgroup @uref{news:gnu.emacs.bug}, but please use e-mail instead of
news to submit the bug report.  This ensures a reliable return address
so you can be contacted for further details.

Be sure to read the ``Bugs'' section of the Emacs manual before reporting
a bug!  The manual describes in detail how to submit a useful bug
report (@pxref{Bugs, , Reporting Bugs, emacs, The GNU Emacs Manual}).
447
(@xref{Emacs manual}, if you don't know how to read the manual.)
Glenn Morris's avatar
Glenn Morris committed
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478

RMS says:

@quotation
Sending bug reports to @email{help-gnu-emacs@@gnu.org} (which has the
effect of posting on @uref{news:gnu.emacs.help}) is undesirable because
it takes the time of an unnecessarily large group of people, most of
whom are just users and have no idea how to fix these problem.
@email{bug-gnu-emacs@@gnu.org} reaches a much smaller group of people
who are more likely to know what to do and have expressed a wish to
receive more messages about Emacs than the others.
@end quotation

RMS says it is sometimes fine to post to @uref{news:gnu.emacs.help}:

@quotation
If you have reported a bug and you don't hear about a possible fix,
then after a suitable delay (such as a week) it is okay to post on
@code{gnu.emacs.help} asking if anyone can help you.
@end quotation

If you are unsure whether you have found a bug, consider the following
non-exhaustive list, courtesy of RMS:

@quotation
If Emacs crashes, that is a bug.  If Emacs gets compilation errors
while building, that is a bug.  If Emacs crashes while building, that
is a bug.  If Lisp code does not do what the documentation says it
does, that is a bug.
@end quotation

Glenn Morris's avatar
Glenn Morris committed
479
@node Unsubscribing from Emacs lists
480
@section  How do I unsubscribe from a mailing list?
Glenn Morris's avatar
Glenn Morris committed
481 482 483
@cindex Unsubscribing from GNU mailing lists
@cindex Removing yourself from GNU mailing lists

484
If you are receiving a GNU mailing list named @var{list}, you should be
Glenn Morris's avatar
Glenn Morris committed
485
able to unsubscribe from it by sending a request to the address
486 487 488 489
@email{@var{list}-request@@gnu.org}.  Mailing lists mails normally
contain information in either the message header
(@samp{List-Unsubscribe:}) or as a footer that tells you how to
unsubscribe.
Glenn Morris's avatar
Glenn Morris committed
490

Glenn Morris's avatar
Glenn Morris committed
491
@node Contacting the FSF
Glenn Morris's avatar
Glenn Morris committed
492 493 494 495 496 497 498 499 500
@section  What is the current address of the FSF?
@cindex Snail mail address of the FSF
@cindex Postal address of the FSF
@cindex Contracting the FSF
@cindex Free Software Foundation, contacting

@table @asis

@item E-mail
501
info@@fsf.org
Glenn Morris's avatar
Glenn Morris committed
502 503 504 505 506 507 508 509

@item Telephone
+1-617-542-5942

@item Fax
+1-617-542-2652

@item World Wide Web
510
@uref{http://www.fsf.org/}
Glenn Morris's avatar
Glenn Morris committed
511 512 513 514 515 516 517 518 519 520 521

@item Postal address
Free Software Foundation@*
51 Franklin Street, Fifth Floor@*
Boston, MA 02110-1301@*
USA@*

@end table

@cindex Ordering GNU software
For details on how to order items directly from the FSF, see the
522
@uref{http://shop.fsf.org/, FSF on-line store}.
Glenn Morris's avatar
Glenn Morris committed
523 524

@c ------------------------------------------------------------
Glenn Morris's avatar
Glenn Morris committed
525
@node Getting help
Glenn Morris's avatar
Glenn Morris committed
526 527 528
@chapter Getting help
@cindex Getting help

529
This chapter tells you how to get help with Emacs.
Glenn Morris's avatar
Glenn Morris committed
530 531 532 533 534 535 536 537 538 539 540 541 542 543

@menu
* Basic editing::
* Learning how to do something::
* Getting a printed manual::
* Emacs Lisp documentation::
* Installing Texinfo documentation::
* Printing a Texinfo file::
* Viewing Info files outside of Emacs::
* Informational files for Emacs::
* Help installing Emacs::
* Obtaining the FAQ::
@end menu

Glenn Morris's avatar
Glenn Morris committed
544
@node Basic editing
Glenn Morris's avatar
Glenn Morris committed
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563
@section I'm just starting Emacs; how do I do basic editing?
@cindex Basic editing with Emacs
@cindex Beginning editing
@cindex Tutorial, invoking the
@cindex Self-paced tutorial, invoking the
@cindex Help system, entering the

Type @kbd{C-h t} to invoke the self-paced tutorial.  Just typing
@kbd{C-h} enters the help system.  Starting with Emacs 22, the tutorial
is available in many foreign languages such as French, German, Japanese,
Russian, etc.  Use @kbd{M-x help-with-tutorial-spec-language @key{RET}}
to choose your language and start the tutorial.

Your system administrator may have changed @kbd{C-h} to act like
@key{DEL} to deal with local keyboards.  You can use @kbd{M-x
help-for-help} instead to invoke help.  To discover what key (if any)
invokes help on your system, type @kbd{M-x where-is @key{RET}
help-for-help @key{RET}}.  This will print a comma-separated list of key
sequences in the echo area.  Ignore the last character in each key
564 565
sequence listed.  Each of the resulting key sequences (e.g. @key{F1} is
common) invokes help.
Glenn Morris's avatar
Glenn Morris committed
566 567 568 569

Emacs help works best if it is invoked by a single key whose value
should be stored in the variable @code{help-char}.

Glenn Morris's avatar
Glenn Morris committed
570
@node Learning how to do something
Glenn Morris's avatar
Glenn Morris committed
571 572 573 574 575 576 577 578 579 580 581 582
@section How do I find out how to do something in Emacs?
@cindex Help for Emacs
@cindex Learning to do something in Emacs
@cindex Reference card for Emacs
@cindex Overview of help systems

There are several methods for finding out how to do things in Emacs.

@itemize @bullet

@cindex Reading the Emacs manual
@item
583
The complete text of the Emacs manual is available via the Info
Glenn Morris's avatar
Glenn Morris committed
584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628
hypertext reader.  Type @kbd{C-h r} to display the manual in Info mode.
Typing @key{h} immediately after entering Info will provide a short
tutorial on how to use it.

@cindex Lookup a subject in a manual
@cindex Index search in a manual
@item
To quickly locate the section of the manual which discusses a certain
issue, or describes a command or a variable, type @kbd{C-h i m emacs
@key{RET} i @var{topic} @key{RET}}, where @var{topic} is the name of the
topic, the command, or the variable which you are looking for.  If this
does not land you on the right place in the manual, press @kbd{,}
(comma) repeatedly until you find what you need.  (The @kbd{i} and
@kbd{,} keys invoke the index-searching functions, which look for the
@var{topic} you type in all the indices of the Emacs manual.)

@cindex Apropos
@item
You can list all of the commands whose names contain a certain word
(actually which match a regular expression) using @kbd{C-h a} (@kbd{M-x
command-apropos}).

@cindex Command description in the manual
@item
The command @kbd{C-h F} (@code{Info-goto-emacs-command-node}) prompts
for the name of a command, and then attempts to find the section in the
Emacs manual where that command is described.

@cindex Finding commands and variables
@item
You can list all of the functions and variables whose names contain a
certain word using @kbd{M-x apropos}.

@item
You can list all of the functions and variables whose documentation
matches a regular expression or a string, using @kbd{M-x
apropos-documentation}.

@item
You can order a hardcopy of the manual from the FSF.  @xref{Getting a
printed manual}.

@cindex Reference cards, in other languages
@item
You can get a printed reference card listing commands and keys to
629
invoke them.  You can order one from the FSF for $2 (or 10 for $18),
Glenn Morris's avatar
Glenn Morris committed
630
or you can print your own from the @file{etc/refcards/refcard.tex} or
631
@file{etc/refcards/refcard.pdf} files in the Emacs distribution.
Glenn Morris's avatar
Glenn Morris committed
632 633 634 635 636
Beginning with version 21.1, the Emacs distribution comes with
translations of the reference card into several languages; look for
files named @file{etc/refcards/@var{lang}-refcard.*}, where @var{lang}
is a two-letter code of the language.  For example, the German version
of the reference card is in the files @file{etc/refcards/de-refcard.tex}
637
and @file{etc/recards/de-refcard.pdf}.
Glenn Morris's avatar
Glenn Morris committed
638 639 640 641 642 643 644 645

@item
There are many other commands in Emacs for getting help and
information.  To get a list of these commands, type @samp{?} after
@kbd{C-h}.

@end itemize

Glenn Morris's avatar
Glenn Morris committed
646
@node Getting a printed manual
Glenn Morris's avatar
Glenn Morris committed
647 648 649 650 651 652
@section How do I get a printed copy of the Emacs manual?
@cindex Printed Emacs manual, obtaining
@cindex Manual, obtaining a printed or HTML copy of
@cindex Emacs manual, obtaining a printed or HTML copy of

You can order a printed copy of the Emacs manual from the FSF.  For
653
details see the @uref{http://shop.fsf.org/, FSF on-line store}.
Glenn Morris's avatar
Glenn Morris committed
654

655
The full Texinfo source for the manual also comes in the @file{doc/emacs}
Glenn Morris's avatar
Glenn Morris committed
656
directory of the Emacs distribution, if you're daring enough to try to
657
print out this several-hundred-page manual yourself (@pxref{Printing a Texinfo
Glenn Morris's avatar
Glenn Morris committed
658 659 660
file}).

If you absolutely have to print your own copy, and you don't have @TeX{},
661
you can get a PostScript or PDF (or HTML) version from
Glenn Morris's avatar
Glenn Morris committed
662 663 664

@uref{http://www.gnu.org/software/emacs/manual/}

665
@xref{Learning how to do something}, for how to view the manual.
Glenn Morris's avatar
Glenn Morris committed
666

Glenn Morris's avatar
Glenn Morris committed
667
@node Emacs Lisp documentation
Glenn Morris's avatar
Glenn Morris committed
668 669 670 671 672 673 674 675 676 677 678
@section Where can I get documentation on Emacs Lisp?
@cindex Documentation on Emacs Lisp
@cindex Function documentation
@cindex Variable documentation
@cindex Emacs Lisp Reference Manual
@cindex Reference manual for Emacs Lisp

Within Emacs, you can type @kbd{C-h f} to get the documentation for a
function, @kbd{C-h v} for a variable.

For more information, the Emacs Lisp Reference Manual is available
679
in Info format.  @xref{Top, Emacs Lisp,, elisp, The
Glenn Morris's avatar
Glenn Morris committed
680 681 682
Emacs Lisp Reference Manual}.

You can also order a hardcopy of the manual, details on ordering it from
683
FSF are on the @uref{http://shop.fsf.org/, FSF on-line store}.
Glenn Morris's avatar
Glenn Morris committed
684 685 686 687 688

An HTML version of the Emacs Lisp Reference Manual is available at

@uref{http://www.gnu.org/software/emacs/elisp-manual/elisp.html}

Glenn Morris's avatar
Glenn Morris committed
689
@node Installing Texinfo documentation
Glenn Morris's avatar
Glenn Morris committed
690 691 692 693 694 695 696 697
@section How do I install a piece of Texinfo documentation?
@cindex Texinfo documentation, installing
@cindex Installing Texinfo documentation
@cindex New Texinfo files, installing
@cindex Documentation, installing new Texinfo files
@cindex Info files, how to install

First, you must turn the Texinfo files into Info files.  You may do this
698
using the stand-alone @file{makeinfo} program, available as part of the
Glenn Morris's avatar
Glenn Morris committed
699 700
Texinfo package at

701
@uref{http://www.gnu.org/software/texinfo/}
Glenn Morris's avatar
Glenn Morris committed
702 703 704

For information about the Texinfo format, read the Texinfo manual which
comes with the Texinfo package.  This manual also comes installed in
705
Info format, so you can read it from Emacs; type @kbd{C-h i m texinfo
Glenn Morris's avatar
Glenn Morris committed
706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789
@key{RET}}.

Alternatively, you could use the Emacs command @kbd{M-x
texinfo-format-buffer}, after visiting the Texinfo source file of the
manual you want to convert.

Neither @code{texinfo-format-buffer} nor @file{makeinfo} installs the
resulting Info files in Emacs's Info tree.  To install Info files,
perform these steps:

@enumerate
@item
Move the files to the @file{info} directory in the installed Emacs
distribution.  @xref{File-name conventions}, if you don't know where that
is.

@item
Run the @code{install-info} command, which is part of the Texinfo
distribution, to update the main Info directory menu, like this:

@example
 install-info --info-dir=@var{dir-path} @var{dir-path}/@var{file}
@end example

@noindent
where @var{dir-path} is the full path to the directory where you copied
the produced Info file(s), and @var{file} is the name of the Info file
you produced and want to install.

If you don't have the @code{install-info} command installed, you can
edit the file @file{info/dir} in the installed Emacs distribution, and
add a line for the top level node in the Info package that you are
installing.  Follow the examples already in this file.  The format is:

@example
* Topic: (relative-pathname).  Short description of topic.
@end example

@end enumerate

If you want to install Info files and you don't have the necessary
privileges, you have several options:

@itemize @bullet
@item
Info files don't actually need to be installed before being used.
You can use a prefix argument for the @code{info} command and specify
the name of the Info file in the minibuffer.  This goes to the node
named @samp{Top} in that file.  For example, to view a Info file named
@file{@var{info-file}} in your home directory, you can type this:

@example
@kbd{C-u C-h i ~/@var{info-file} @key{RET}}
@end example

Alternatively, you can feed a file name to the @code{Info-goto-node}
command (invoked by pressing @key{g} in Info mode) by typing the name
of the file in parentheses, like this:

@example
@kbd{C-h i g (~/@var{info-file}) @key{RET}}
@end example

@item
You can create your own Info directory.  You can tell Emacs where that
Info directory is by adding its pathname to the value of the variable
@code{Info-default-directory-list}.  For example, to use a private Info
directory which is a subdirectory of your home directory named @file{Info},
you could put this in your @file{.emacs} file:

@lisp
(setq Info-default-directory-list
      (cons "~/Info" Info-default-directory-list))
@end lisp

You will need a top-level Info file named @file{dir} in this directory
which has everything the system @file{dir} file has in it, except it should
list only entries for Info files in that directory.  You might not need
it if all files in this directory were referenced by other @file{dir}
files.  The node lists from all @file{dir} files in
@code{Info-default-directory-list} are merged by the Info system.

@end itemize

Glenn Morris's avatar
Glenn Morris committed
790
@node Printing a Texinfo file
Glenn Morris's avatar
Glenn Morris committed
791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811
@section How do I print a Texinfo file?
@cindex Printing a Texinfo file
@cindex Texinfo file, printing
@cindex Printing documentation

You can't get nicely printed output from Info files; you must still have
the original Texinfo source file for the manual you want to print.

Assuming you have @TeX{} installed on your system, follow these steps:

@enumerate

@item
Make sure the first line of the Texinfo file looks like this:

@example
\input texinfo
@end example

You may need to change @samp{texinfo} to the full pathname of the
@file{texinfo.tex} file, which comes with Emacs as
812
@file{doc/misc/texinfo.tex} (or copy or link it into the current directory).
Glenn Morris's avatar
Glenn Morris committed
813 814 815 816 817 818 819 820 821

@item
Type @kbd{texi2dvi @var{texinfo-source}}, where @var{texinfo-source} is
the name of the Texinfo source file for which you want to produce a
printed copy.

The @samp{texi2dvi} script is part of the GNU Texinfo distribution
(@pxref{Installing Texinfo documentation}).

822 823
Alternatively, @samp{texi2pdf} produces PDF files.

Glenn Morris's avatar
Glenn Morris committed
824 825 826 827 828 829 830 831 832 833 834
@item
Print the DVI file @file{@var{texinfo-source}.dvi} in the normal way for
printing DVI files at your site.  For example, if you have a PostScript
printer, run the @code{dvips} program to print the DVI file on that
printer.

@end enumerate

To get more general instructions, retrieve the latest Texinfo package
(@pxref{Installing Texinfo documentation}).

Glenn Morris's avatar
Glenn Morris committed
835
@node Viewing Info files outside of Emacs
Glenn Morris's avatar
Glenn Morris committed
836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856
@section Can I view Info files without using Emacs?
@cindex Viewing Info files
@cindex Info file viewers
@cindex Alternative Info file viewers

Yes.  Here are some alternative programs:

@itemize @bullet

@item
@code{info}, a stand-alone version of the Info program, comes as part of
the Texinfo package.  @xref{Installing Texinfo documentation}, for
details.

@item
Tkinfo, an Info viewer that runs under X Window system and uses Tcl/Tk.
You can get Tkinfo at
@uref{http://math-www.uni-paderborn.de/~axel/tkinfo/}.

@end itemize

Glenn Morris's avatar
Glenn Morris committed
857
@node Informational files for Emacs
Glenn Morris's avatar
Glenn Morris committed
858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882
@section What informational files are available for Emacs?
@cindex Informational files included with Emacs
@cindex Files included with Emacs
@cindex @file{COPYING}, description of file
@cindex @file{DISTRIB}, description of file
@cindex @file{GNU}, description of file
@cindex @file{INTERVIEW}, description of file
@cindex @file{MACHINES}, description of file
@cindex @file{MAILINGLISTS}, description of file
@cindex @file{NEWS}, description of file

This isn't a frequently asked question, but it should be!  A variety of
informational files about Emacs and relevant aspects of the GNU project
are available for you to read.

The following files are available in the @file{etc} directory of the
Emacs distribution (see @ref{File-name conventions}, if you're not sure
where that is).

@table @file

@item COPYING
GNU General Public License

@item DISTRIB
883
Emacs Availability Information
Glenn Morris's avatar
Glenn Morris committed
884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909

@item GNU
The GNU Manifesto

@item INTERVIEW
Richard Stallman discusses his public-domain UNIX-compatible software
system with BYTE editors

@item MACHINES
Status of Emacs on Various Machines and Systems

@item MAILINGLISTS
GNU Project Electronic Mailing Lists

@item NEWS
Emacs news, a history of recent user-visible changes

@end table

More GNU information, including back issues of the @cite{GNU's
Bulletin}, are at

@uref{http://www.gnu.org/bulletins/bulletins.html} and

@uref{http://www.cs.pdx.edu/~trent/gnu/gnu.html}

Glenn Morris's avatar
Glenn Morris committed
910
@node Help installing Emacs
Glenn Morris's avatar
Glenn Morris committed
911 912 913 914 915
@section Where can I get help in installing Emacs?
@cindex Installation help
@cindex Help installing Emacs

@xref{Installing Emacs}, for some basic installation hints, and see
916
@ref{Problems building Emacs}, if you have problems with the installation.
Glenn Morris's avatar
Glenn Morris committed
917

918 919 920
The web-page @uref{http://www.fsf.org/resources/service/} lists
companies and individuals willing to sell you help in installing or
using Emacs.
Glenn Morris's avatar
Glenn Morris committed
921

Glenn Morris's avatar
Glenn Morris committed
922
@node Obtaining the FAQ
Glenn Morris's avatar
Glenn Morris committed
923 924 925 926
@section Where can I get the latest version of this FAQ?
@cindex FAQ, obtaining the
@cindex Latest FAQ version, obtaining the

927 928 929 930
The Emacs FAQ is distributed with Emacs in Info format.  You can read it
by selecting the @samp{Emacs FAQ} option from the @samp{Help} menu of
the Emacs menu bar at the top of any Emacs frame, or by typing @kbd{C-h
C-f} (@kbd{M-x view-emacs-FAQ}).
Glenn Morris's avatar
Glenn Morris committed
931 932 933


@c ------------------------------------------------------------
Glenn Morris's avatar
Glenn Morris committed
934
@node Status of Emacs
Glenn Morris's avatar
Glenn Morris committed
935 936 937 938 939 940 941 942 943 944 945 946 947 948
@chapter Status of Emacs
@cindex Status of Emacs

This chapter gives you basic information about Emacs, including its
latest version status.

@menu
* Origin of the term Emacs::
* Latest version of Emacs::
* New in Emacs 20::
* New in Emacs 21::
* New in Emacs 22::
@end menu

Glenn Morris's avatar
Glenn Morris committed
949
@node Origin of the term Emacs
Glenn Morris's avatar
Glenn Morris committed
950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976
@section Where does the name ``Emacs'' come from?
@cindex Origin of the term ``Emacs''
@cindex Emacs name origin
@cindex TECO
@cindex Original version of Emacs

Emacs originally was an acronym for Editor MACroS.  RMS says he ``picked
the name Emacs because @key{E} was not in use as an abbreviation on ITS at
the time.''  The first Emacs was a set of macros written in 1976 at MIT
by RMS for the editor TECO (Text Editor and COrrector, originally Tape
Editor and COrrector) under ITS on a PDP-10.  RMS had already extended
TECO with a ``real-time'' full-screen mode with reprogrammable keys.
Emacs was started by @email{gls@@east.sun.com, Guy Steele} as a project
to unify the many divergent TECO command sets and key bindings at MIT,
and completed by RMS.

Many people have said that TECO code looks a lot like line noise; you
can read more at @uref{news:alt.lang.teco}.  Someone has written a TECO
implementation in Emacs Lisp (to find it, see @ref{Packages that do not
come with Emacs}); it would be an interesting project to run the
original TECO Emacs inside of Emacs.

@cindex Why Emacs?
For some not-so-serious alternative reasons for Emacs to have that
name, check out the file @file{etc/JOKES} (@pxref{File-name
conventions}).

Glenn Morris's avatar
Glenn Morris committed
977
@node Latest version of Emacs
Glenn Morris's avatar
Glenn Morris committed
978 979 980 981
@section What is the latest version of Emacs?
@cindex Version, latest
@cindex Latest version of Emacs

982 983 984 985
Emacs @value{VER} is the current version as of this writing.  A version
number with two components (e.g. @samp{22.1}) indicates a released
version; three components (e.g. @samp{23.0.50}) indicate a development
version.
Glenn Morris's avatar
Glenn Morris committed
986

Glenn Morris's avatar
Glenn Morris committed
987
@node New in Emacs 20
Glenn Morris's avatar
Glenn Morris committed
988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012
@section What is different about Emacs 20?
@cindex Differences between Emacs 19 and Emacs 20
@cindex Emacs 20, new features in

To find out what has changed in recent versions, type @kbd{C-h C-n}
(@kbd{M-x view-emacs-news}).  The oldest changes are at the bottom of
the file, so you might want to read it starting there, rather than at
the top.

The differences between Emacs versions 18 and 19 was rather dramatic;
the introduction of frames, faces, and colors on windowing systems was
obvious to even the most casual user.

There are differences between Emacs versions 19 and 20 as well, but many
are more subtle or harder to find.  Among the changes are the inclusion
of MULE code for languages that use non-Latin characters and for mixing
several languages in the same document; the ``Customize'' facility for
modifying variables without having to use Lisp; and automatic conversion
of files from Macintosh, Microsoft, and Unix platforms.

A number of older Lisp packages, such as Gnus, Supercite and the
calendar/diary, have been updated and enhanced to work with Emacs 20,
and are now included with the standard distribution.


Glenn Morris's avatar
Glenn Morris committed
1013
@node New in Emacs 21
Glenn Morris's avatar
Glenn Morris committed
1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034
@section What is different about Emacs 21?
@cindex Differences between Emacs 20 and Emacs 21
@cindex Emacs 21, new features in
@cindex Recently introduced features

@cindex Variable-size fonts
@cindex Toolbar support
Emacs 21 features a thorough rewrite of the display engine.  The new
display engine supports variable-size fonts, images, and can play sounds
on platforms which support that.  As a result, the visual appearance of
Emacs, when it runs on a windowed display, is much more reminiscent of
modern GUI programs, and includes 3D widgets (used for the mode line and
the scroll bars), a configurable and extensible toolbar, tooltips
(a.k.a.@: balloon help), and other niceties.

@cindex Colors on text-only terminals
@cindex TTY colors
In addition, Emacs 21 supports faces on text-only terminals.  This means
that you can now have colors when you run Emacs on a GNU/Linux console
and on @code{xterm} with @kbd{emacs -nw}.

Glenn Morris's avatar
Glenn Morris committed
1035
@node New in Emacs 22
Glenn Morris's avatar
Glenn Morris committed
1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055
@section What is different about Emacs 22?
@cindex Differences between Emacs 21 and Emacs 22
@cindex Emacs 22, new features in
@cindex Recently introduced features
@cindex Default features

@itemize
@cindex GTK+ Toolkit
@cindex Drag-and-drop
@item
Emacs can be built with GTK+ widgets, and supports drag-and-drop
operation on X.

@cindex Supported systems
@item
Emacs 22 features support for GNU/Linux systems on S390 and x86-64
machines, as well as support for the Mac OS X and Cygwin operating
systems.

@item
1056
The native MS-Windows, and Mac OS X builds include full support
Glenn Morris's avatar
Glenn Morris committed
1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135
for images, toolbar, and tooltips.

@item
Font Lock mode, Auto Compression mode, and File Name Shadow Mode are
enabled by default.

@item
The maximum size of buffers has been doubled and is 256M on 32-bit
machines.

@item
Links can be followed with @kbd{mouse-1}, in addition to @kbd{mouse-2}.

@cindex Mouse wheel
@item
Mouse wheel support is enabled by default.

@item
Window fringes are customizable.

@item
The mode line of the selected window is now highlighted.

@item
The minibuffer prompt is displayed in a distinct face.

@item
Abbrev definitions are read automatically at startup.

@item
Grep mode is separate from Compilation mode and has many new options and
commands specific to grep.

@item
The original Emacs macro system has been replaced by the new Kmacro
package, which provides many new commands and features and a simple
interface that uses the function keys F3 and F4.  Macros are stored in a
macro ring, and can be debugged and edited interactively.

@item
The Grand Unified Debugger (GUD) can be used with a full graphical user
interface to GDB; this provides many features found in traditional
development environments, making it easy to manipulate breakpoints, add
watch points, display the call stack, etc.  Breakpoints are visually
indicated in the source buffer.

@item
@cindex New modes
Many new modes and packages have been included in Emacs, such as Calc,
TRAMP, URL, IDO, CUA, ERC, rcirc, Table, Image-Dired, SES, Ruler, Org,
PGG, Flymake, Password, Printing, Reveal, wdired, t-mouse, longlines,
savehist, Conf mode, Python mode, DNS mode, etc.

@cindex Multilingual Environment
@item
Leim is now part of Emacs.  Unicode support has been much improved, and
the following input methods have been added: belarusian, bulgarian-bds,
bulgarian-phonetic, chinese-sisheng, croatian, dutch, georgian,
latin-alt-postfix, latin-postfix, latin-prefix, latvian-keyboard,
lithuanian-numeric, lithuanian-keyboard, malayalam-inscript, rfc1345,
russian-computer, sgml, slovenian, tamil-inscript, ucs,
ukrainian-computer, vietnamese-telex, and welsh.

The following language environments have also been added: Belarusian,
Bulgarian, Chinese-EUC-TW, Croatian, French, Georgian, Italian, Latin-6,
Latin-7, Latvian, Lithuanian, Malayalam, Russian, Slovenian, Swedish,
Tajik, Tamil, UTF-8, Ukrainian, Welsh, and Windows-1255.

@cindex Documentation
@cindex Emacs Lisp Manual
@item
In addition, Emacs 22 now includes the Emacs Lisp Reference Manual
(@pxref{Emacs Lisp documentation}) and the Emacs Lisp Intro.
@end itemize

Many other changes have been made in Emacs 22, use @kbd{C-h n} to get a
full list.

@c ------------------------------------------------------------
Glenn Morris's avatar
Glenn Morris committed
1136
@node Common requests
Glenn Morris's avatar
Glenn Morris committed
1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192
@chapter Common requests
@cindex Common requests

@menu
* Setting up a customization file::
* Using Customize::
* Colors on a TTY::
* Debugging a customization file::
* Displaying the current line or column::
* Displaying the current file name in the titlebar::
* Turning on abbrevs by default::
* Associating modes with files::
* Highlighting a region::
* Replacing highlighted text::
* Controlling case sensitivity::
* Working with unprintable characters::
* Searching for/replacing newlines::
* Yanking text in isearch::
* Wrapping words automatically::
* Turning on auto-fill by default::
* Changing load-path::
* Using an already running Emacs process::
* Compiler error messages::
* Indenting switch statements::
* Customizing C and C++ indentation::
* Horizontal scrolling::
* Overwrite mode::
* Turning off beeping::
* Turning the volume down::
* Automatic indentation::
* Matching parentheses::
* Hiding #ifdef lines::
* Repeating commands::
* Valid X resources::
* Evaluating Emacs Lisp code::
* Changing the length of a Tab::
* Inserting text at the beginning of each line::
* Underlining paragraphs::
* Forcing the cursor to remain in the same column::
* Forcing Emacs to iconify itself::
* Using regular expressions::
* Replacing text across multiple files::
* Documentation for etags::
* Disabling backups::
* Disabling auto-save-mode::
* Going to a line by number::
* Modifying pull-down menus::
* Deleting menus and menu options::
* Turning on syntax highlighting::
* Scrolling only one line::
* Editing MS-DOS files::
* Filling paragraphs with a single space::
* Escape sequences in shell output::
* Fullscreen mode on MS-Windows::
@end menu

Glenn Morris's avatar
Glenn Morris committed
1193
@node Setting up a customization file
Glenn Morris's avatar
Glenn Morris committed
1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222
@section How do I set up a @file{.emacs} file properly?
@cindex @file{.emacs} file, setting up
@cindex @file{.emacs} file, locating
@cindex Init file, setting up
@cindex Customization file, setting up

@inforef{Init File, Init File, emacs}.

In general, new Emacs users should not have @file{.emacs} files, because
it causes confusing non-standard behavior.  Then they send questions to
@email{help-gnu-emacs@@gnu.org} asking why Emacs isn't behaving as
documented.

Beginning with version 20.1, Emacs includes the new Customize facility
(@pxref{Using Customize}).  This allows users who are unfamiliar with
Emacs Lisp to modify their @file{.emacs} files in a relatively
straightforward way, using menus rather than Lisp code.  Most packages
support Customize as of this writing.

While Customize might indeed make it easier to configure Emacs,
consider taking a bit of time to learn Emacs Lisp and modifying your
@file{.emacs} directly.  Simple configuration options are described
rather completely in @inforef{Init File, Init File, emacs}, for users
interested in performing frequently requested, basic tasks.

Sometimes users are unsure as to where their @file{.emacs} file should
be found.  Visiting the file as @file{~/.emacs} from Emacs will find
the correct file.

Glenn Morris's avatar
Glenn Morris committed
1223
@node Using Customize
Glenn Morris's avatar
Glenn Morris committed
1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241
@section How do I start using Customize?
@cindex Customize groups
@cindex Customizing variables
@cindex Customizing faces

The main Customize entry point is @kbd{M-x customize @key{RET}}.  This
command takes you to a buffer listing all the available Customize
groups.  From there, you can access all customizable options and faces,
change their values, and save your changes to your init file.
@inforef{Easy Customization, Easy Customization, emacs}.

If you know the name of the group in advance (e.g. ``shell''), use
@kbd{M-x customize-group @key{RET}}.

If you wish to customize a single option, use @kbd{M-x customize-option
@key{RET}}.  This command prompts you for the name of the option to
customize, with completion.

Glenn Morris's avatar
Glenn Morris committed
1242
@node Colors on a TTY
Glenn Morris's avatar
Glenn Morris committed
1243 1244 1245 1246 1247 1248 1249
@section How do I get colors and syntax highlighting on a TTY?
@cindex Colors on a TTY
@cindex Syntax highlighting on a TTY
@cindex Console, colors

In Emacs 21.1 and later, colors and faces are supported in non-windowed mode,
i.e.@: on Unix and GNU/Linux text-only terminals and consoles, and when
1250
invoked as @samp{emacs -nw} on X, and MS-Windows.  (Colors and faces were
Glenn Morris's avatar
Glenn Morris committed
1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261
supported in the MS-DOS port since Emacs 19.29.)  Emacs automatically
detects color support at startup and uses it if available.  If you think
that your terminal supports colors, but Emacs won't use them, check the
@code{termcap} entry for your display type for color-related
capabilities.

The command @kbd{M-x list-colors-display} pops up a window which
exhibits all the colors Emacs knows about on the current display.

Syntax highlighting is on by default since version 22.1.

Glenn Morris's avatar
Glenn Morris committed
1262
@node Debugging a customization file
Glenn Morris's avatar
Glenn Morris committed
1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283
@section How do I debug a @file{.emacs} file?
@cindex Debugging @file{.emacs} file
@cindex @file{.emacs} debugging
@cindex Init file debugging
@cindex @samp{-debug-init} option

Start Emacs with the @samp{-debug-init} command-line option.  This
enables the Emacs Lisp debugger before evaluating your @file{.emacs}
file, and places you in the debugger if something goes wrong.  The top
line in the @file{trace-back} buffer will be the error message, and the
second or third line of that buffer will display the Lisp code from your
@file{.emacs} file that caused the problem.

You can also evaluate an individual function or argument to a function
in your @file{.emacs} file by moving the cursor to the end of the
function or argument and typing @kbd{C-x C-e} (@kbd{M-x
eval-last-sexp}).

Use @kbd{C-h v} (@kbd{M-x describe-variable}) to check the value of
variables which you are trying to set or use.

Glenn Morris's avatar
Glenn Morris committed
1284
@node Displaying the current line or column
Glenn Morris's avatar
Glenn Morris committed
1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334
@section How do I make Emacs display the current line (or column) number?
@cindex @code{line-number-mode}
@cindex Displaying the current line or column
@cindex Line number, displaying the current
@cindex Column, displaying the current
@cindex @code{mode-line-format}

To have Emacs automatically display the current line number of the point
in the mode line, do @kbd{M-x line-number-mode}.  You can also put the
form

@lisp
(setq line-number-mode t)
@end lisp

@noindent
in your @file{.emacs} file to achieve this whenever you start Emacs.
(Line number display is on by default, unless your site-specific
initialization disables it.) Note that Emacs will not display the line
number if the buffer's size in bytes is larger than the value of the
variable @code{line-number-display-limit}.

You can similarly display the current column with
@kbd{M-x column-number-mode}, or by putting the form

@lisp
(setq column-number-mode t)
@end lisp

@noindent
in your @file{.emacs} file.

The @code{"%c"} format specifier in the variable @code{mode-line-format}
will insert the current column's value into the mode line.  See the
documentation for @code{mode-line-format} (using @kbd{C-h v
mode-line-format @key{RET}}) for more information on how to set and use
this variable.

Users of all Emacs versions can display the current column using the
@samp{column} package written by @email{abraham@@dina.kvl.dk, Per
Abrahamsen}.  @xref{Packages that do not come with Emacs}, for
instructions on how to get it.

@cindex Set number capability in @code{vi} emulators
None of the @code{vi} emulation modes provide the ``set number''
capability of @code{vi} (as far as we know).  The @samp{setnu} package
written by @email{kyle@@wonderworks.com, Kyle Jones} provides this
feature.  So too does @samp{wb-line-number}, written by
@email{naoki.y.nakamura@@nifty.com, Naoki Nakamura}.

Glenn Morris's avatar
Glenn Morris committed
1335
@node Displaying the current file name in the titlebar
Glenn Morris's avatar
Glenn Morris committed
1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364
@section How can I modify the titlebar to contain the current file name?
@cindex Titlebar, displaying the current file name in
@cindex File name, displaying in the titlebar
@cindex @code{frame-title-format}

The contents of an Emacs frame's titlebar is controlled by the variable
@code{frame-title-format}, which has the same structure as the variable
@code{mode-line-format}.  (Use @kbd{C-h v} or @kbd{M-x
describe-variable} to get information about one or both of these
variables.)

By default, the titlebar for a frame does contain the name of the buffer
currently being visited, except if there is a single frame.  In such a
case, the titlebar contains Emacs invocation name and the name of the
machine at which Emacs was invoked.  This is done by setting
@code{frame-title-format} to the default value of

@lisp
(multiple-frames "%b" ("" invocation-name "@@" system-name))
@end lisp

To modify the behavior such that frame titlebars contain the buffer's
name regardless of the number of existing frames, include the following
in your @file{.emacs}:

@lisp
(setq frame-title-format "%b")
@end lisp

Glenn Morris's avatar
Glenn Morris committed
1365
@node Turning on abbrevs by default
Glenn Morris's avatar
Glenn Morris committed
1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383
@section How do I turn on abbrevs by default just in mode @var{mymode}?
@cindex Abbrevs, turning on by default

Put this in your @file{.emacs} file:

@lisp
(condition-case ()
   (quietly-read-abbrev-file)
  (file-error nil))

(add-hook '@var{mymode}-mode-hook
          (lambda ()
           (setq abbrev-mode t)))
@end lisp

Starting with Emacs 22, the standard abbrevs file is read automatically
at startup, so the first of these two forms becomes unnecessary.

Glenn Morris's avatar
Glenn Morris committed
1384
@node Associating modes with files
Glenn Morris's avatar
Glenn Morris committed
1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409
@section How do I make Emacs use a certain major mode for certain files?
@cindex Associating modes with files
@cindex File extensions and modes
@cindex @code{auto-mode-alist}, modifying
@cindex Modes, associating with file extensions

If you want to use a certain mode @var{foo} for all files whose names end
with the extension @file{.@var{bar}}, this will do it for you:

@lisp
(setq auto-mode-alist (cons '("\\.@var{bar}\\'" . @var{foo}-mode) auto-mode-alist))
@end lisp

Otherwise put this somewhere in the first line of any file you want to
edit in the mode @var{foo} (in the second line, if the first line begins
with @samp{#!}):

@example
-*- @var{foo} -*-
@end example

@cindex Major mode for shell scripts
Beginning with Emacs 19, the variable @code{interpreter-mode-alist}
specifies which mode to use when loading a shell script.  (Emacs
determines which interpreter you're using by examining the first line of
1410 1411
the script.)  Use @kbd{C-h v} (or @kbd{M-x describe-variable})
on @code{interpreter-mode-alist} to learn more.
Glenn Morris's avatar
Glenn Morris committed
1412

Glenn Morris's avatar
Glenn Morris committed
1413
@node Highlighting a region
Glenn Morris's avatar
Glenn Morris committed
1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429
@section How can I highlight a region of text in Emacs?
@cindex Highlighting text
@cindex Text, highlighting
@cindex @code{transient-mark-mode}
@cindex Region, highlighting a

You can cause the region to be highlighted when the mark is active by
including

@lisp
(transient-mark-mode t)
@end lisp

@noindent
in your @file{.emacs} file.

Glenn Morris's avatar
Glenn Morris committed
1430
@node Replacing highlighted text
Glenn Morris's avatar
Glenn Morris committed
1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454
@section How can I replace highlighted text with what I type?
@cindex @code{delete-selection-mode}
@cindex Replacing highlighted text
@cindex Highlighting and replacing text

Use @code{delete-selection-mode}, which you can start automatically by
placing the following Lisp form in your @file{.emacs} file:

@lisp
(delete-selection-mode 1)
@end lisp