efaq.texi 153 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.info
Glenn Morris's avatar
Glenn Morris committed
4
@settitle GNU Emacs FAQ
5
@include docstyle.texi
Glenn Morris's avatar
Glenn Morris committed
6 7
@c %**end of header

8
@include emacsver.texi
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
Paul Eggert's avatar
Paul Eggert committed
15
Copyright @copyright{} 2001--2015 Free Software Foundation, Inc.@*
16 17 18 19
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
20 21 22 23

@quotation
This list of frequently asked questions about GNU Emacs with answers
(``FAQ'') may be translated into other languages, transformed into other
24
formats (e.g., Texinfo, Info, WWW, WAIS), and updated with new information.
Glenn Morris's avatar
Glenn Morris committed
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42

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
Glenn Morris's avatar
Glenn Morris committed
43
* Emacs FAQ: (efaq).            Frequently Asked Questions about Emacs.
Glenn Morris's avatar
Glenn Morris committed
44 45 46 47 48 49 50 51 52 53 54 55 56
@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

57 58
@contents

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

62
This is the GNU Emacs FAQ.
Glenn Morris's avatar
Glenn Morris committed
63 64 65 66 67

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.

68
This is the version of the FAQ distributed with Emacs @value{EMACSVER}, and
69
mainly describes that version.  Although there is some information on
Glenn Morris's avatar
Glenn Morris committed
70
older versions, details about very old releases (now only of historical
71 72 73 74 75 76 77 78 79 80
interest) have been removed.  If you are interested in this, consult
either the version of the FAQ distributed with older versions of Emacs,
or the history of this document in the Emacs source repository.

Since Emacs releases are very stable, we recommend always running the
latest release.

This FAQ is not updated very frequently.  When you have a question about
Emacs, the Emacs manual is often the best starting point.

81 82
@ifnottex
@insertcopying
Paul Eggert's avatar
Paul Eggert committed
83
@end ifnottex
84

Glenn Morris's avatar
Glenn Morris committed
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
@menu
* FAQ notation::
* General questions::
* Getting help::
* Status of Emacs::
* Common requests::
* Bugs and problems::
* Compiling and installing Emacs::
* Finding Emacs and related packages::
* Key bindings::
* Alternate character sets::
* Mail and news::
* Concept index::
@end menu

@c ------------------------------------------------------------
Glenn Morris's avatar
Glenn Morris committed
101
@node FAQ notation
Glenn Morris's avatar
Glenn Morris committed
102 103 104 105 106 107 108 109 110 111 112
@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::
113
* Emacs manual::
Glenn Morris's avatar
Glenn Morris committed
114 115 116 117
* File-name conventions::
* Common acronyms::
@end menu

Glenn Morris's avatar
Glenn Morris committed
118
@node Basic keys
Glenn Morris's avatar
Glenn Morris committed
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 186 187 188 189 190 191 192 193
@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
194
@kbd{C-?}  a ``control'' key, since 127 has both bits 5 and 6 turned ON@.
Glenn Morris's avatar
Glenn Morris committed
195
Also, on very few keyboards does @kbd{C-?} generate @acronym{ASCII} code 127.
196
@c FIXME I cannot understand the previous sentence.
Glenn Morris's avatar
Glenn Morris committed
197

198
@xref{Keys,,, emacs, The GNU Emacs Manual}.
Glenn Morris's avatar
Glenn Morris committed
199

Glenn Morris's avatar
Glenn Morris committed
200
@node Extended commands
Glenn Morris's avatar
Glenn Morris committed
201 202 203 204 205 206 207 208 209 210 211 212 213 214
@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
Glenn Morris's avatar
Glenn Morris committed
215 216
@kbd{M-n} (or up-arrow and down-arrow) to see previous commands entered.
An Emacs @dfn{command} is an @dfn{interactive} Emacs function.
Glenn Morris's avatar
Glenn Morris committed
217 218 219 220 221 222 223 224 225

@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}.

226 227 228 229 230
@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
231 232
@cindex Info, finding topics in

233
When we refer you to some @var{topic} in the Emacs manual, you can
Glenn Morris's avatar
Glenn Morris committed
234 235 236 237 238 239 240 241 242 243 244 245 246
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.

Glenn Morris's avatar
Glenn Morris committed
247 248 249
If you are reading this FAQ in Info, you can simply press @key{RET} on a
reference to follow it.

Glenn Morris's avatar
Glenn Morris committed
250 251 252
@xref{Getting a printed manual}, if you would like a paper copy of the
Emacs manual.

Glenn Morris's avatar
Glenn Morris committed
253
@node File-name conventions
254
@section What are @file{src/config.h}, @file{site-lisp/default.el}, etc.?
Glenn Morris's avatar
Glenn Morris committed
255 256 257 258 259
@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
260 261 262
into subdirectories; e.g., @file{etc}, @file{lisp}, and @file{src}.
Some of these (e.g., @file{etc} and @file{lisp}) are present both in
an installed Emacs and in the sources, but some (e.g., @file{src}) are
Glenn Morris's avatar
Glenn Morris committed
263
only found in the sources.
Glenn Morris's avatar
Glenn Morris committed
264 265 266 267 268 269 270 271

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.)

272
The location of your Info directory (i.e., where Info documentation
Glenn Morris's avatar
Glenn Morris committed
273 274 275 276
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
Glenn Morris's avatar
Glenn Morris committed
277
default, Emacs Info documentation is placed in @file{/usr/local/share/info}.
Glenn Morris's avatar
Glenn Morris committed
278

Glenn Morris's avatar
Glenn Morris committed
279 280
For information on some of the files in the @file{etc} directory,
@pxref{Informational files for Emacs}.
Glenn Morris's avatar
Glenn Morris committed
281

Glenn Morris's avatar
Glenn Morris committed
282
@node Common acronyms
283
@section What are FSF, LPF, GNU, RMS, FTP, and GPL?
Glenn Morris's avatar
Glenn Morris committed
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316
@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

317
Avoid confusing the FSF and the LPF@.  The LPF opposes
Glenn Morris's avatar
Glenn Morris committed
318
look-and-feel copyrights and software patents.  The FSF aims to make
319
high quality free software available for everyone.
Glenn Morris's avatar
Glenn Morris committed
320 321 322 323 324 325 326 327 328

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
329
@node General questions
Glenn Morris's avatar
Glenn Morris committed
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345
@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
346
@node The LPF
Glenn Morris's avatar
Glenn Morris committed
347 348 349 350 351 352 353
@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
354 355
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
356

Glenn Morris's avatar
Glenn Morris committed
357
@node Real meaning of copyleft
Glenn Morris's avatar
Glenn Morris committed
358 359 360 361 362 363 364 365 366
@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
367 368
set any precedents.  Although legal actions have been brought against
companies for violating the terms of the GPL, so far all have been
Paul Eggert's avatar
Paul Eggert committed
369
settled out of court (in favor of the plaintiffs).  Please take any
370 371 372
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
373 374 375 376 377 378 379 380 381 382 383 384 385

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
386
@node Guidelines for newsgroup postings
387
@section  What are appropriate messages for the various Emacs newsgroups?
Glenn Morris's avatar
Glenn Morris committed
388 389 390 391 392 393 394
@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
395 396 397
The Emacs mailing lists are described at
@uref{http://savannah.gnu.org/mail/?group=emacs, the Emacs Savannah
page}. Some of them are gatewayed to newsgroups.
Glenn Morris's avatar
Glenn Morris committed
398 399

The newsgroup @uref{news:comp.emacs} is for discussion of Emacs programs
400
in general.  The newsgroup @uref{news:gnu.emacs.help} is specifically
401 402
for GNU Emacs.  It therefore makes no sense to cross-post to both
groups, since only one can be appropriate to any question.
Glenn Morris's avatar
Glenn Morris committed
403 404 405 406 407 408 409 410 411 412 413 414

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
415
@node Newsgroup archives
Glenn Morris's avatar
Glenn Morris committed
416 417 418 419 420 421 422
@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
Glenn Morris's avatar
Glenn Morris committed
423 424 425
archive can be browsed over the web at
@uref{http://lists.gnu.org/archive/html/, the GNU mail archive}.  Raw
files can be downloaded from @uref{ftp://lists.gnu.org/}.
Glenn Morris's avatar
Glenn Morris committed
426 427

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

Glenn Morris's avatar
Glenn Morris committed
431
You can also read the archives of the @code{gnu.*} groups and post new
432
messages at @uref{http://gmane.org/, Gmane}.  Gmane is a service that
Glenn Morris's avatar
Glenn Morris committed
433 434
presents mailing lists as newsgroups (even those without a traditional
mail-to-news gateway).
Glenn Morris's avatar
Glenn Morris committed
435

Glenn Morris's avatar
Glenn Morris committed
436
@node Reporting bugs
Glenn Morris's avatar
Glenn Morris committed
437 438 439 440 441 442 443 444
@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
445 446 447
essential information and the correct e-mail address,
@email{bug-gnu-emacs@@gnu.org}.
Anything sent there also appears in the
Glenn Morris's avatar
Glenn Morris committed
448 449 450 451 452 453 454
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}).
455
(@xref{Emacs manual}, if you don't know how to read the manual.)
Glenn Morris's avatar
Glenn Morris committed
456 457 458 459

RMS says:

@quotation
460 461 462 463 464 465 466 467 468 469 470
Sending bug reports to
@url{http://lists.gnu.org/mailman/listinfo/help-gnu-emacs,
the help-gnu-emacs mailing list}
(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.
@url{http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs, The
bug-gnu-emacs list} 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.
Glenn Morris's avatar
Glenn Morris committed
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490
@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
491
@node Unsubscribing from Emacs lists
492
@section  How do I unsubscribe from a mailing list?
Glenn Morris's avatar
Glenn Morris committed
493 494 495
@cindex Unsubscribing from GNU mailing lists
@cindex Removing yourself from GNU mailing lists

496
If you are receiving a GNU mailing list named @var{list}, you should be
Glenn Morris's avatar
Glenn Morris committed
497
able to unsubscribe from it by sending a request to the address
498 499 500 501
@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
502

Glenn Morris's avatar
Glenn Morris committed
503
@node Contacting the FSF
Glenn Morris's avatar
Glenn Morris committed
504
@section  How do I contact the FSF?
Glenn Morris's avatar
Glenn Morris committed
505 506 507
@cindex Contracting the FSF
@cindex Free Software Foundation, contacting

Glenn Morris's avatar
Glenn Morris committed
508 509
For up-to-date information, see
@uref{http://www.fsf.org/about/contact.html, the FSF contact web-page}.
Glenn Morris's avatar
Glenn Morris committed
510
You can send general correspondence to @email{info@@fsf.org}.
Glenn Morris's avatar
Glenn Morris committed
511 512 513

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

@c ------------------------------------------------------------
Glenn Morris's avatar
Glenn Morris committed
517
@node Getting help
Glenn Morris's avatar
Glenn Morris committed
518 519 520
@chapter Getting help
@cindex Getting help

521
This chapter tells you how to get help with Emacs.
Glenn Morris's avatar
Glenn Morris committed
522 523 524 525 526 527 528 529 530 531 532 533 534 535

@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
536
@node Basic editing
Glenn Morris's avatar
Glenn Morris committed
537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555
@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
556
sequence listed.  Each of the resulting key sequences (e.g., @key{F1} is
557
common) invokes help.
Glenn Morris's avatar
Glenn Morris committed
558 559 560 561

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

562 563 564
Some Emacs slides and tutorials can be found at
@uref{http://web.psung.name/emacs/}.

Glenn Morris's avatar
Glenn Morris committed
565
@node Learning how to do something
Glenn Morris's avatar
Glenn Morris committed
566 567 568 569 570 571 572 573 574 575 576 577
@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
578
The complete text of the Emacs manual is available via the Info
Glenn Morris's avatar
Glenn Morris committed
579 580 581 582 583 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
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
618
You can order a hardcopy of the manual from the FSF@.  @xref{Getting a
Glenn Morris's avatar
Glenn Morris committed
619 620 621 622 623
printed manual}.

@cindex Reference cards, in other languages
@item
You can get a printed reference card listing commands and keys to
624
invoke them.  You can order one from the FSF for $2 (or 10 for $18),
Glenn Morris's avatar
Glenn Morris committed
625
or you can print your own from the @file{etc/refcards/refcard.tex} or
626
@file{etc/refcards/refcard.pdf} files in the Emacs distribution.
Glenn Morris's avatar
Glenn Morris committed
627 628 629 630 631
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}
Paul Eggert's avatar
Paul Eggert committed
632
and @file{etc/refcards/de-refcard.pdf}.
Glenn Morris's avatar
Glenn Morris committed
633 634 635 636 637 638 639 640

@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
641
@node Getting a printed manual
Glenn Morris's avatar
Glenn Morris committed
642 643 644 645 646
@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

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

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

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

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

Glenn Morris's avatar
Glenn Morris committed
660
@xref{Learning how to do something}, for how to view the manual from Emacs.
Glenn Morris's avatar
Glenn Morris committed
661

Glenn Morris's avatar
Glenn Morris committed
662
@node Emacs Lisp documentation
Glenn Morris's avatar
Glenn Morris committed
663 664 665 666 667 668 669 670 671 672 673
@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
Glenn Morris's avatar
Glenn Morris committed
674 675
in Info format (@pxref{Top, Emacs Lisp,, elisp, The
Emacs Lisp Reference Manual}).
Glenn Morris's avatar
Glenn Morris committed
676

Glenn Morris's avatar
Glenn Morris committed
677 678 679
You can also order a hardcopy of the manual from the FSF, for details
see the @uref{http://shop.fsf.org/, FSF on-line store}.  (This manual is
not always in print.)
Glenn Morris's avatar
Glenn Morris committed
680 681 682 683 684

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
685
@node Installing Texinfo documentation
Glenn Morris's avatar
Glenn Morris committed
686 687 688 689 690 691 692
@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

Glenn Morris's avatar
Glenn Morris committed
693 694 695 696 697 698 699 700
Emacs releases come with pre-built Info files, and the normal install
process places them in the correct location.  This is true for most
applications that provide Info files.  The following section is only
relevant if you want to install extra Info files by hand.

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

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

For information about the Texinfo format, read the Texinfo manual which
comes with the Texinfo package.  This manual also comes installed in
706
Info format, so you can read it from Emacs; type @kbd{C-h i m texinfo
Glenn Morris's avatar
Glenn Morris committed
707 708
@key{RET}}.

Glenn Morris's avatar
Glenn Morris committed
709 710
@c FIXME is this a complete alternative?
@c Probably not, given that we require makeinfo to build Emacs.
Glenn Morris's avatar
Glenn Morris committed
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
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
Glenn Morris's avatar
Glenn Morris committed
780
(add-to-list 'Info-default-directory-list "~/Info")
Glenn Morris's avatar
Glenn Morris committed
781 782 783
@end lisp

You will need a top-level Info file named @file{dir} in this directory
Glenn Morris's avatar
Glenn Morris committed
784 785 786 787 788 789
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 (fortuitously) 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.
Glenn Morris's avatar
Glenn Morris committed
790 791 792

@end itemize

Glenn Morris's avatar
Glenn Morris committed
793
@node Printing a Texinfo file
Glenn Morris's avatar
Glenn Morris committed
794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814
@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
815
@file{doc/misc/texinfo.tex} (or copy or link it into the current directory).
Glenn Morris's avatar
Glenn Morris committed
816 817 818 819

@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
Glenn Morris's avatar
Glenn Morris committed
820 821
printed copy.  The @samp{texi2dvi} script is part of the GNU Texinfo
distribution.
Glenn Morris's avatar
Glenn Morris committed
822

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

Glenn Morris's avatar
Glenn Morris committed
825 826 827 828 829 830 831 832 833 834 835
@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
836
@node Viewing Info files outside of Emacs
Glenn Morris's avatar
Glenn Morris committed
837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857
@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
858
@node Informational files for Emacs
Glenn Morris's avatar
Glenn Morris committed
859 860 861 862 863 864 865 866 867 868 869 870
@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{MACHINES}, 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.

Glenn Morris's avatar
Glenn Morris committed
871 872 873 874 875
The following files (and others) are available in the @file{etc}
directory of the Emacs distribution (see @ref{File-name conventions}, if
you're not sure where that is).  Many of these files are 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
876 877 878 879 880 881 882

@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

@item MACHINES
Status of Emacs on Various Machines and Systems

@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
900
@node Help installing Emacs
Glenn Morris's avatar
Glenn Morris committed
901 902 903 904 905
@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
906
@ref{Problems building Emacs}, if you have problems with the installation.
Glenn Morris's avatar
Glenn Morris committed
907

Glenn Morris's avatar
Glenn Morris committed
908 909 910
@uref{http://www.fsf.org/resources/service/, The GNU Service directory}
lists companies and individuals willing to sell you help in installing
or using Emacs and other GNU software.
Glenn Morris's avatar
Glenn Morris committed
911

Glenn Morris's avatar
Glenn Morris committed
912
@node Obtaining the FAQ
Glenn Morris's avatar
Glenn Morris committed
913 914 915 916
@section Where can I get the latest version of this FAQ?
@cindex FAQ, obtaining the
@cindex Latest FAQ version, obtaining the

917 918 919
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
Glenn Morris's avatar
Glenn Morris committed
920
C-f} (@kbd{M-x view-emacs-FAQ}).  The very latest version is available
921
in the Emacs development repository (@pxref{Latest version of Emacs}).
Glenn Morris's avatar
Glenn Morris committed
922 923

@c ------------------------------------------------------------
Glenn Morris's avatar
Glenn Morris committed
924
@node Status of Emacs
Glenn Morris's avatar
Glenn Morris committed
925 926 927
@chapter Status of Emacs
@cindex Status of Emacs

928 929
This chapter gives you basic information about Emacs, including the
status of its latest version.
Glenn Morris's avatar
Glenn Morris committed
930 931 932 933

@menu
* Origin of the term Emacs::
* Latest version of Emacs::
934
* New in Emacs 24::
935
* New in Emacs 23::
Glenn Morris's avatar
Glenn Morris committed
936
* New in Emacs 22::
937 938
* New in Emacs 21::
* New in Emacs 20::
Glenn Morris's avatar
Glenn Morris committed
939 940
@end menu

Glenn Morris's avatar
Glenn Morris committed
941
@node Origin of the term Emacs
Glenn Morris's avatar
Glenn Morris committed
942 943 944 945 946 947
@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

948
Emacs originally was an acronym for Editor MACroS@.  RMS says he ``picked
Glenn Morris's avatar
Glenn Morris committed
949 950 951
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
Glenn Morris's avatar
Glenn Morris committed
952 953 954
Editor and COrrector) under ITS (the Incompatible Timesharing System) on
a PDP-10.  RMS had already extended TECO with a ``real-time''
full-screen mode with reprogrammable keys.  Emacs was started by
955 956
@c gls@@east.sun.com
Guy Steele as a project to unify the many
Glenn Morris's avatar
Glenn Morris committed
957 958
divergent TECO command sets and key bindings at MIT, and completed by
RMS.
Glenn Morris's avatar
Glenn Morris committed
959 960 961 962 963 964 965 966 967 968 969 970

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
971
@node Latest version of Emacs
Glenn Morris's avatar
Glenn Morris committed
972 973 974
@section What is the latest version of Emacs?
@cindex Version, latest
@cindex Latest version of Emacs
975 976
@cindex Development, Emacs
@cindex Repository, Emacs
Eli Zaretskii's avatar
Eli Zaretskii committed
977
@cindex Bazaar repository, Emacs
Glenn Morris's avatar
Glenn Morris committed
978

979
Emacs @value{EMACSVER} is the current version as of this writing.  A version
980
number with two components (e.g., @samp{22.1}) indicates a released
981
version; three components indicate a development
982
version (e.g., @samp{23.0.50} is what will eventually become @samp{23.1}).
983

984
Emacs is under active development, hosted at
985 986
@uref{http://savannah.gnu.org/projects/emacs/, Savannah}.
Follow the instructions given there to clone the project repository.
987

988 989 990
Because Emacs undergoes many changes before a release, the version
number of a development version is not especially meaningful.  It is
better to refer to the date on which the sources were retrieved from the
991 992 993
development repository.  The development version is usually quite robust
for every-day use, but if stability is more important to you than the
latest features, you may want to stick to the releases.
994 995 996 997 998 999 1000

The following sections list some of the major new features in the last
few Emacs releases.  For full details of the changes in any version of
Emacs, type @kbd{C-h C-n} (@kbd{M-x view-emacs-news}).  As of Emacs 22,
you can give this command a prefix argument to read about which features
were new in older versions.

1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040
@node New in Emacs 24
@section What is different about Emacs 24?
@cindex Differences between Emacs 23 and Emacs 24
@cindex Emacs 24, new features in

@itemize
@cindex packages, installing more
@item
Emacs now includes a package manager.  Type @kbd{M-x list-packages} to
get started.  You can use this to download and automatically install
many more Lisp packages.

@cindex lexical binding
@item
Emacs Lisp now supports lexical binding on a per-file basis.  In
@emph{lexical binding}, variable references must be located textually
within the binding construct.  This contrasts with @emph{dynamic
binding}, where programs can refer to variables defined outside their
local textual scope.  A Lisp file can use a local variable setting of
@code{lexical-binding: t} to indicate that the contents should be
interpreted using lexical binding.  See the Emacs Lisp Reference
Manual for more details.

@cindex bidirectional display
@cindex right-to-left languages
@item
Some human languages, such as English, are written from left to right.
Others, such as Arabic, are written from right to left.  Emacs now has
support for any mixture of these forms---this is ``bidirectional text''.

@item
Handling of text selections has been improved, and now integrates
better with external clipboards.

@cindex themes
@item
A new command @kbd{customize-themes} allows you to easily change the
appearance of your Emacs.

@item
1041
Emacs can be compiled with the GTK+ 3 toolkit.
1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074

@item
Support for several new external libraries can be included at compile
time:

@itemize

@item
``Security-Enhanced Linux'' (SELinux) is a Linux kernel feature that
provides more sophisticated file access controls than ordinary
``Unix-style'' file permissions.

@item
The ImageMagick display library.  This allows you to display many more
image format in Emacs, as well as carry out transformations such as
rotations.

@item
The GnuTLS library for secure network communications.  Emacs uses this
transparently for email if your mail server supports it.

@item
The libxml2 library for parsing XML structures.
@end itemize

@item
Much more flexibility in the handling of windows and buffer display.

@end itemize

As always, consult the @file{NEWS} file for more information.


1075 1076 1077 1078
@node New in Emacs 23
@section What is different about Emacs 23?
@cindex Differences between Emacs 22 and Emacs 23
@cindex Emacs 23, new features in
Glenn Morris's avatar
Glenn Morris committed
1079

1080
@itemize
Glenn Morris's avatar
Glenn Morris committed
1081

1082 1083 1084 1085 1086 1087 1088
@cindex Anti-aliased fonts
@cindex Freetype fonts
@item
Emacs has a new font code that can use multiple font backends,
including freetype and fontconfig.  Emacs can use the Xft library for
anti-aliasing, and the otf and m17n libraries for complex text layout and
text shaping.
Glenn Morris's avatar
Glenn Morris committed
1089

1090 1091 1092 1093 1094
@cindex Unicode
@cindex Character sets
@item
The Emacs character set is now a superset of Unicode.  Several new
language environments have been added.
Glenn Morris's avatar
Glenn Morris committed
1095

1096 1097 1098 1099 1100
@cindex Multi-tty support
@cindex X and tty displays
@item
Emacs now supports using both X displays and ttys in the same session
(@samp{multi-tty}).
Glenn Morris's avatar
Glenn Morris committed
1101

1102 1103 1104
@cindex Daemon mode
@item
Emacs can be started as a daemon in the background.
Glenn Morris's avatar
Glenn Morris committed
1105

1106
@cindex NeXTstep port
1107 1108 1109
@cindex GNUstep port
@cindex Mac OS X Cocoa
@item
1110
There is a new NeXTstep port of Emacs.  This supports GNUstep and Mac OS
1111 1112
X (via the Cocoa libraries).  The Carbon port of Emacs, which supported
Mac OS X in Emacs 22, has been removed.
Glenn Morris's avatar
Glenn Morris committed
1113

1114 1115 1116 1117
@cindex Directory-local variables
@item
Directory-local variables can now be defined, in a similar manner to
file-local variables.
Glenn Morris's avatar
Glenn Morris committed
1118

1119 1120 1121 1122 1123 1124 1125 1126 1127 1128
@item
Transient Mark mode (@pxref{Highlighting a region}) is on by default.

@end itemize

@noindent
Other changes include: support for serial port access; D-Bus bindings; a
new Visual Line mode for line-motion; improved completion; a new mode
(@samp{DocView}) for viewing of PDF, PostScript, and DVI documents; nXML
mode (for editing XML documents) is included; VC has been updated for
1129
newer version control systems; etc.
Glenn Morris's avatar
Glenn Morris committed
1130 1131


Glenn Morris's avatar
Glenn Morris committed
1132
@node New in Emacs 22
Glenn Morris's avatar
Glenn Morris committed
1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150
@section What is different about Emacs 22?
@cindex Differences between Emacs 21 and Emacs 22
@cindex Emacs 22, new features in

@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
1151
The native MS-Windows, and Mac OS X builds include full support
Glenn Morris's avatar
Glenn Morris committed
1152 1153 1154 1155 1156 1157 1158
for images, toolbar, and tooltips.

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

@item
1159 1160
The maximum size of buffers is increased: on 32-bit machines, it is
256 MBytes for Emacs 23.1, and 512 MBytes for Emacs 23.2 and above.
Glenn Morris's avatar
Glenn Morris committed
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 1193 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 1223 1224 1225 1226

@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

1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264

@node New in Emacs 21
@section What is different about Emacs 21?
@cindex Differences between Emacs 20 and Emacs 21
@cindex Emacs 21, new features in

@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}.


@node New in Emacs 20
@section What is different about Emacs 20?
@cindex Differences between Emacs 19 and Emacs 20
@cindex Emacs 20, new features in

The differences between Emacs versions 18 and 19 were 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.
Glenn Morris's avatar
Glenn Morris committed
1265 1266

@c ------------------------------------------------------------
Glenn Morris's avatar
Glenn Morris committed
1267
@node Common requests
Glenn Morris's avatar
Glenn Morris committed
1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 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
@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::
* 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
1323
@node Setting up a customization file
Glenn Morris's avatar
Glenn Morris committed
1324 1325 1326 1327 1328 1329
@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

1330
@xref{Init File,,, emacs, The GNU Emacs Manual}.
Glenn Morris's avatar
Glenn Morris committed
1331

1332 1333
In general, new Emacs users should not be provided with @file{.emacs}
files, because this can cause confusing non-standard behavior.  Then
1334 1335 1336
they send questions to
@url{http://lists.gnu.org/mailman/listinfo/help-gnu-emacs,
the help-gnu-emacs mailing list} asking why Emacs
1337
isn't behaving as documented.
Glenn Morris's avatar
Glenn Morris committed
1338

1339 1340 1341 1342
Emacs includes the 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.
Glenn Morris's avatar
Glenn Morris committed
1343 1344 1345 1346

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
1347 1348
rather completely in @ref{Init File,,, emacs, The GNU Emacs Manual},
for users interested in performing frequently requested, basic tasks.
Glenn Morris's avatar
Glenn Morris committed
1349 1350 1351 1352 1353

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
1354
@node Using Customize
Glenn Morris's avatar
Glenn Morris committed
1355 1356 1357 1358 1359 1360 1361 1362 1363
@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.
1364
@xref{Easy Customization,,, emacs, The GNU Emacs Manual}.
Glenn Morris's avatar
Glenn Morris committed
1365

1366
If you know the name of the group in advance (e.g., ``shell''), use
Glenn Morris's avatar
Glenn Morris committed
1367 1368 1369 1370 1371 1372
@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
1373
@node Colors on a TTY
Glenn Morris's avatar
Glenn Morris committed
1374 1375 1376 1377 1378 1379
@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,
1380
i.e., on Unix and GNU/Linux text-only terminals and consoles, and when
1381
invoked as @samp{emacs -nw} on X, and MS-Windows.  (Colors and faces were
Glenn Morris's avatar
Glenn Morris committed
1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392
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
1393
@node Debugging a customization file
Glenn Morris's avatar
Glenn Morris committed
1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414
@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
1415
@node Displaying the current line or column
Glenn Morris's avatar
Glenn Morris committed
1416 1417 1418 1419 1420 1421 1422
@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}

1423 1424 1425 1426
By default, Emacs displays the current line number of the point in the
mode line.  You can toggle this feature off or on with the command
@kbd{M-x line-number-mode}, or by setting the variable
@code{line-number-mode}.  Note that Emacs will not display the line
Glenn Morris's avatar
Glenn Morris committed
1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437
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
1438
in your @file{.emacs} file.  This feature is off by default.
Glenn Morris's avatar
Glenn Morris committed
1439 1440 1441 1442 1443 1444 1445 1446

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.

@cindex Set number capability in @code{vi} emulators
1447 1448 1449 1450 1451
The @samp{linum} package (distributed with Emacs since version 23.1)
displays line numbers in the left margin, like the ``set number''
capability of @code{vi}.  The packages @samp{setnu} and
@samp{wb-line-number} (not distributed with Emacs) also implement this
feature.
Glenn Morris's avatar
Glenn Morris committed
1452

Glenn Morris's avatar
Glenn Morris committed
1453
@node Displaying the current file name in the titlebar
Glenn Morris's avatar
Glenn Morris committed
1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471
@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
1472
(multiple-frames "%b" ("" invocation-name "@@" (system-name)))
Glenn Morris's avatar
Glenn Morris committed
1473 1474 1475 1476 1477 1478 1479 1480 1481 1482
@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
1483
@node Turning on abbrevs by default
Glenn Morris's avatar
Glenn Morris committed
1484 1485 1486
@section How do I turn on abbrevs by default just in mode @var{mymode}?
@cindex Abbrevs, turning on by default

1487 1488 1489
Abbrev mode expands abbreviations as you type them.  To turn it on in a
specific buffer, use @kbd{M-x abbrev-mode}.  To turn it on in every
buffer by default, put this in your @file{.emacs} file:
Glenn Morris's avatar
Glenn Morris committed
1490 1491

@lisp
1492 1493 1494 1495
(setq-default abbrev-mode t)
@end lisp

@noindent To turn it on in a specific mode, use:
Glenn Morris's avatar
Glenn Morris committed
1496

1497
@lisp
Glenn Morris's avatar
Glenn Morris committed
1498 1499 1500 1501 1502
(add-hook '@var{mymode}-mode-hook
          (lambda ()
           (setq abbrev-mode t)))
@end lisp

1503 1504 1505 1506 1507 1508 1509
@noindent If your Emacs version is older then 22.1, you will also need to use:

@lisp
(condition-case ()
   (quietly-read-abbrev-file)
  (file-error nil))
@end lisp
Glenn Morris's avatar
Glenn Morris committed
1510

Glenn Morris's avatar
Glenn Morris committed
1511
@node Associating modes with files
Glenn Morris's avatar
Glenn Morris committed
1512 1513 1514 1515 1516 1517 1518 1519 1520 1521
@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
1522
(add-to-list 'auto-mode-alist '("\\.@var{bar}\\'" . @var{foo}-mode))
Glenn Morris's avatar
Glenn Morris committed
1523 1524
@end lisp

1525
Alternatively, put this somewhere in the first line of any file you want to
Glenn Morris's avatar
Glenn Morris committed
1526 1527 1528 1529 1530 1531 1532 1533
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
1534
The variable @code{interpreter-mode-alist} specifies which mode to use
1535
when loading an interpreted script (e.g., shell, python, etc.).  Emacs
Glenn Morris's avatar
Glenn Morris committed
1536
determines which interpreter you're using by examining the first line of
1537 1538
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
1539

Glenn Morris's avatar
Glenn Morris committed
1540
@node Highlighting a region
Glenn Morris's avatar
Glenn Morris committed
1541 1542 1543 1544 1545 1546 1547 1548 1549 1550
@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
1551
(transient-mark-mode 1)
Glenn Morris's avatar
Glenn Morris committed
1552 1553 1554
@end lisp

@noindent
1555
in your @file{.emacs} file.  Since Emacs 23.1, this feature is on by default.
Glenn Morris's avatar
Glenn Morris committed
1556

Glenn Morris's avatar
Glenn Morris committed
1557
@node Replacing highlighted text
Glenn Morris's avatar
Glenn Morris committed
1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574
@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

According to the documentation string for @code{delete-selection-mode}
(which you can read using @kbd{M-x describe-function @key{RET}
delete-selection-mode @key{RET}}):

@quotation
1575 1576 1577
When Delete Selection mode is enabled, typed text replaces the selection
if the selection is active.  Otherwise, typed text is just inserted at
point regardless of any selection.
Glenn Morris's avatar
Glenn Morris committed
1578 1579 1580 1581 1582
@end quotation

This mode also allows you to delete (not kill) the highlighted region by
pressing @key{DEL}.

Glenn Morris's avatar
Glenn Morris committed
1583
@node Controlling case sensitivity
Glenn Morris's avatar
Glenn Morris committed
1584 1585 1586 1587 1588 1589
@section How do I control Emacs's case-sensitivity when searching/replacing?
@cindex @code{case-fold-search}
@cindex Case sensitivity of searches
@cindex Searching without case sensitivity
@cindex Ignoring case in searches

1590 1591 1592
@c FIXME
The value of the variable @code{case-fold-search} determines whether
searches are case sensitive:
Glenn Morris's avatar
Glenn Morris committed
1593 1594