This is ../../info/emacs, produced by makeinfo version 4.13 from
emacs.texi.

This is the Sixteenth edition of the `GNU Emacs Manual',
updated for Emacs version 23.4.

   Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011, 2012  Free Software Foundation, Inc.

     Permission is granted to copy, distribute and/or modify this
     document under the terms of the GNU Free Documentation License,
     Version 1.3 or any later version published by the Free Software
     Foundation; with the Invariant Sections being "The GNU Manifesto,"
     "Distribution" and "GNU GENERAL PUBLIC LICENSE," with the
     Front-Cover texts being "A GNU Manual," and with the Back-Cover
     Texts as in (a) below.  A copy of the license is included in the
     section entitled "GNU Free Documentation License."

     (a) The FSF's Back-Cover Text is: "You have the freedom to copy and
     modify this GNU manual.  Buying copies from the FSF supports it in
     developing GNU and promoting software freedom."

INFO-DIR-SECTION Emacs
START-INFO-DIR-ENTRY
* Emacs: (emacs).       The extensible self-documenting text editor.
END-INFO-DIR-ENTRY


File: emacs,  Node: Named ASCII Chars,  Next: Mouse Buttons,  Prev: Function Keys,  Up: Key Bindings

57.4.9 Named ASCII Control Characters
-------------------------------------

<TAB>, <RET>, <BS>, <LFD>, <ESC> and <DEL> started out as names for
certain ASCII control characters, used so often that they have special
keys of their own.  For instance, <TAB> was another name for `C-i'.
Later, users found it convenient to distinguish in Emacs between these
keys and the "same" control characters typed with the <CTRL> key.
Therefore, on most modern terminals, they are no longer the same: <TAB>
is different from `C-i'.

   Emacs can distinguish these two kinds of input if the keyboard does.
It treats the "special" keys as function keys named `tab', `return',
`backspace', `linefeed', `escape', and `delete'.  These function keys
translate automatically into the corresponding ASCII characters _if_
they have no bindings of their own.  As a result, neither users nor
Lisp programs need to pay attention to the distinction unless they care
to.

   If you do not want to distinguish between (for example) <TAB> and
`C-i', make just one binding, for the ASCII character <TAB> (octal code
011).  If you do want to distinguish, make one binding for this ASCII
character, and another for the "function key" `tab'.

   With an ordinary ASCII terminal, there is no way to distinguish
between <TAB> and `C-i' (and likewise for other such pairs), because
the terminal sends the same character in both cases.


File: emacs,  Node: Mouse Buttons,  Next: Disabling,  Prev: Named ASCII Chars,  Up: Key Bindings

57.4.10 Rebinding Mouse Buttons
-------------------------------

Emacs uses Lisp symbols to designate mouse buttons, too.  The ordinary
mouse events in Emacs are "click" events; these happen when you press a
button and release it without moving the mouse.  You can also get
"drag" events, when you move the mouse while holding the button down.
Drag events happen when you finally let go of the button.

   The symbols for basic click events are `mouse-1' for the leftmost
button, `mouse-2' for the next, and so on.  Here is how you can
redefine the second mouse button to split the current window:

     (global-set-key [mouse-2] 'split-window-vertically)

   The symbols for drag events are similar, but have the prefix `drag-'
before the word `mouse'.  For example, dragging the first button
generates a `drag-mouse-1' event.

   You can also define bindings for events that occur when a mouse
button is pressed down.  These events start with `down-' instead of
`drag-'.  Such events are generated only if they have key bindings.
When you get a button-down event, a corresponding click or drag event
will always follow.

   If you wish, you can distinguish single, double, and triple clicks.
A double click means clicking a mouse button twice in approximately the
same place.  The first click generates an ordinary click event.  The
second click, if it comes soon enough, generates a double-click event
instead.  The event type for a double-click event starts with
`double-': for example, `double-mouse-3'.

   This means that you can give a special meaning to the second click at
the same place, but it must act on the assumption that the ordinary
single click definition has run when the first click was received.

   This constrains what you can do with double clicks, but user
interface designers say that this constraint ought to be followed in
any case.  A double click should do something similar to the single
click, only "more so."  The command for the double-click event should
perform the extra work for the double click.

   If a double-click event has no binding, it changes to the
corresponding single-click event.  Thus, if you don't define a
particular double click specially, it executes the single-click command
twice.

   Emacs also supports triple-click events whose names start with
`triple-'.  Emacs does not distinguish quadruple clicks as event types;
clicks beyond the third generate additional triple-click events.
However, the full number of clicks is recorded in the event list, so if
you know Emacs Lisp you can distinguish if you really want to (*note
Click Events: (elisp)Click Events.).  We don't recommend distinct
meanings for more than three clicks, but sometimes it is useful for
subsequent clicks to cycle through the same set of three meanings, so
that four clicks are equivalent to one click, five are equivalent to
two, and six are equivalent to three.

   Emacs also records multiple presses in drag and button-down events.
For example, when you press a button twice, then move the mouse while
holding the button, Emacs gets a `double-drag-' event.  And at the
moment when you press it down for the second time, Emacs gets a
`double-down-' event (which is ignored, like all button-down events, if
it has no binding).

   The variable `double-click-time' specifies how much time can elapse
between clicks and still allow them to be grouped as a multiple click.
Its value is in units of milliseconds.  If the value is `nil', double
clicks are not detected at all.  If the value is `t', then there is no
time limit.  The default is 500.

   The variable `double-click-fuzz' specifies how much the mouse can
move between clicks and still allow them to be grouped as a multiple
click.  Its value is in units of pixels on windowed displays and in
units of 1/8 of a character cell on text-mode terminals; the default is
3.

   The symbols for mouse events also indicate the status of the modifier
keys, with the usual prefixes `C-', `M-', `H-', `s-', `A-' and `S-'.
These always precede `double-' or `triple-', which always precede
`drag-' or `down-'.

   A frame includes areas that don't show text from the buffer, such as
the mode line and the scroll bar.  You can tell whether a mouse button
comes from a special area of the screen by means of dummy "prefix
keys."  For example, if you click the mouse in the mode line, you get
the prefix key `mode-line' before the ordinary mouse-button symbol.
Thus, here is how to define the command for clicking the first button in
a mode line to run `scroll-up':

     (global-set-key [mode-line mouse-1] 'scroll-up)

   Here is the complete list of these dummy prefix keys and their
meanings:

`mode-line'
     The mouse was in the mode line of a window.

`vertical-line'
     The mouse was in the vertical line separating side-by-side
     windows.  (If you use scroll bars, they appear in place of these
     vertical lines.)

`vertical-scroll-bar'
     The mouse was in a vertical scroll bar.  (This is the only kind of
     scroll bar Emacs currently supports.)

`menu-bar'
     The mouse was in the menu bar.

`header-line'
     The mouse was in a header line.

   You can put more than one mouse button in a key sequence, but it
isn't usual to do so.


File: emacs,  Node: Disabling,  Prev: Mouse Buttons,  Up: Key Bindings

57.4.11 Disabling Commands
--------------------------

Disabling a command means that invoking it interactively asks for
confirmation from the user.  The purpose of disabling a command is to
prevent users from executing it by accident; we do this for commands
that might be confusing to the uninitiated.

   Attempting to invoke a disabled command interactively in Emacs
displays a window containing the command's name, its documentation, and
some instructions on what to do immediately; then Emacs asks for input
saying whether to execute the command as requested, enable it and
execute it, or cancel.  If you decide to enable the command, you must
then answer another question--whether to do this permanently, or just
for the current session.  (Enabling permanently works by automatically
editing your `.emacs' file.)  You can also type `!' to enable _all_
commands, for the current session only.

   The direct mechanism for disabling a command is to put a non-`nil'
`disabled' property on the Lisp symbol for the command.  Here is the
Lisp program to do this:

     (put 'delete-region 'disabled t)

   If the value of the `disabled' property is a string, that string is
included in the message displayed when the command is used:

     (put 'delete-region 'disabled
          "It's better to use `kill-region' instead.\n")

   You can make a command disabled either by editing the `.emacs' file
directly, or with the command `M-x disable-command', which edits the
`.emacs' file for you.  Likewise, `M-x enable-command' edits `.emacs'
to enable a command permanently.  *Note Init File::.

   If Emacs was invoked with the `-q' or `--no-init-file' options
(*note Initial Options::), it will not edit your `~/.emacs' init file.
Doing so could lose information because Emacs has not read your init
file.

   Whether a command is disabled is independent of what key is used to
invoke it; disabling also applies if the command is invoked using
`M-x'.  However, disabling a command has no effect on calling it as a
function from Lisp programs.


File: emacs,  Node: Syntax,  Next: Init File,  Prev: Key Bindings,  Up: Customization

57.5 The Syntax Table
=====================

All the Emacs commands which parse words or balance parentheses are
controlled by the "syntax table".  The syntax table says which
characters are opening delimiters, which are parts of words, which are
string quotes, and so on.  It does this by assigning each character to
one of fifteen-odd "syntax classes".  In some cases it specifies some
additional information also.

   Each major mode has its own syntax table (though related major modes
sometimes share one syntax table), which it installs in each buffer
that uses the mode.  The syntax table installed in the current buffer
is the one that all commands use, so we call it "the" syntax table.

   To display a description of the contents of the current syntax
table, type `C-h s' (`describe-syntax').  The description of each
character includes the string you would have to give to
`modify-syntax-entry' to set up that character's current syntax,
starting with the character which designates its syntax class, plus
some English text to explain its meaning.

   A syntax table is actually a Lisp object, a char-table, whose
elements are cons cells.  For full information on the syntax table, see
*note Syntax Tables: (elisp)Syntax Tables.


File: emacs,  Node: Init File,  Prev: Syntax,  Up: Customization

57.6 The Init File, `~/.emacs'
==============================

When Emacs is started, it normally tries to load a Lisp program from an
"initialization file", or "init file" for short.  This file, if it
exists, specifies how to initialize Emacs for you.  Emacs looks for
your init file using the filenames `~/.emacs', `~/.emacs.el', or
`~/.emacs.d/init.el'; you can choose to use any one of these three
names (*note Find Init::).  Here, `~/' stands for your home directory.

   You can use the command line switch `-q' to prevent loading your
init file, and `-u' (or `--user') to specify a different user's init
file (*note Initial Options::).

   There can also be a "default init file", which is the library named
`default.el', found via the standard search path for libraries.  The
Emacs distribution contains no such library; your site may create one
for local customizations.  If this library exists, it is loaded
whenever you start Emacs (except when you specify `-q').  But your init
file, if any, is loaded first; if it sets `inhibit-default-init'
non-`nil', then `default' is not loaded.

   Your site may also have a "site startup file"; this is named
`site-start.el', if it exists.  Like `default.el', Emacs finds this
file via the standard search path for Lisp libraries.  Emacs loads this
library before it loads your init file.  To inhibit loading of this
library, use the option `--no-site-file'.  *Note Initial Options::.  We
recommend against using `site-start.el' for changes that some users may
not like.  It is better to put them in `default.el', so that users can
more easily override them.

   You can place `default.el' and `site-start.el' in any of the
directories which Emacs searches for Lisp libraries.  The variable
`load-path' (*note Lisp Libraries::) specifies these directories.  Many
sites put these files in the `site-lisp' subdirectory of the Emacs
installation directory, typically `/usr/local/share/emacs/site-lisp'.

   Byte-compiling your init file is not recommended (*note Byte
Compilation: (elisp)Byte Compilation.).  It generally does not speed up
startup very much, and often leads to problems when you forget to
recompile the file.  A better solution is to use the Emacs server to
reduce the number of times you have to start Emacs (*note Emacs
Server::).  If your init file defines many functions, consider moving
them to a separate (byte-compiled) file that you load in your init file.

   If you are going to write actual Emacs Lisp programs that go beyond
minor customization, you should read the `Emacs Lisp Reference Manual'.
*Note Emacs Lisp: (elisp)Top.

* Menu:

* Init Syntax::         Syntax of constants in Emacs Lisp.
* Init Examples::       How to do some things with an init file.
* Terminal Init::       Each terminal type can have an init file.
* Find Init::           How Emacs finds the init file.
* Init Non-ASCII::      Using non-ASCII characters in an init file.


File: emacs,  Node: Init Syntax,  Next: Init Examples,  Up: Init File

57.6.1 Init File Syntax
-----------------------

The init file contains one or more Lisp expressions.  Each of these
consists of a function name followed by arguments, all surrounded by
parentheses.  For example, `(setq fill-column 60)' calls the function
`setq' to set the variable `fill-column' (*note Filling::) to 60.

   You can set any Lisp variable with `setq', but with certain
variables `setq' won't do what you probably want in the `.emacs' file.
Some variables automatically become buffer-local when set with `setq';
what you want in `.emacs' is to set the default value, using
`setq-default'.  Some customizable minor mode variables do special
things to enable the mode when you set them with Customize, but
ordinary `setq' won't do that; to enable the mode in your `.emacs'
file, call the minor mode command.  The following section has examples
of both of these methods.

   The second argument to `setq' is an expression for the new value of
the variable.  This can be a constant, a variable, or a function call
expression.  In `.emacs', constants are used most of the time.  They
can be:

Numbers:
     Numbers are written in decimal, with an optional initial minus
     sign.

Strings:
     Lisp string syntax is the same as C string syntax with a few extra
     features.  Use a double-quote character to begin and end a string
     constant.

     In a string, you can include newlines and special characters
     literally.  But often it is cleaner to use backslash sequences for
     them: `\n' for newline, `\b' for backspace, `\r' for carriage
     return, `\t' for tab, `\f' for formfeed (control-L), `\e' for
     escape, `\\' for a backslash, `\"' for a double-quote, or `\OOO'
     for the character whose octal code is OOO.  Backslash and
     double-quote are the only characters for which backslash sequences
     are mandatory.

     `\C-' can be used as a prefix for a control character, as in
     `\C-s' for ASCII control-S, and `\M-' can be used as a prefix for
     a Meta character, as in `\M-a' for `Meta-A' or `\M-\C-a' for
     `Control-Meta-A'.

     *Note Init Non-ASCII::, for information about including non-ASCII
     in your init file.

Characters:
     Lisp character constant syntax consists of a `?' followed by
     either a character or an escape sequence starting with `\'.
     Examples: `?x', `?\n', `?\"', `?\)'.  Note that strings and
     characters are not interchangeable in Lisp; some contexts require
     one and some contexts require the other.

     *Note Init Non-ASCII::, for information about binding commands to
     keys which send non-ASCII characters.

True:
     `t' stands for `true'.

False:
     `nil' stands for `false'.

Other Lisp objects:
     Write a single-quote (`'') followed by the Lisp object you want.


File: emacs,  Node: Init Examples,  Next: Terminal Init,  Prev: Init Syntax,  Up: Init File

57.6.2 Init File Examples
-------------------------

Here are some examples of doing certain commonly desired things with
Lisp expressions:

   * Add a directory to the variable `load-path'.  You can then put
     Lisp libraries that are not included with Emacs in this directory,
     and load them with `M-x load-library'.  *Note Lisp Libraries::.

          (add-to-list 'load-path "/path/to/lisp/libraries")

   * Make <TAB> in C mode just insert a tab if point is in the middle
     of a line.

          (setq c-tab-always-indent nil)

     Here we have a variable whose value is normally `t' for `true' and
     the alternative is `nil' for `false'.

   * Make searches case sensitive by default (in all buffers that do not
     override this).

          (setq-default case-fold-search nil)

     This sets the default value, which is effective in all buffers
     that do not have local values for the variable (*note Locals::).
     Setting `case-fold-search' with `setq' affects only the current
     buffer's local value, which is probably not what you want to do in
     an init file.

   * Specify your own email address, if Emacs can't figure it out
     correctly.

          (setq user-mail-address "cheney@torture.gov")

     Various Emacs packages, such as Message mode, consult
     `user-mail-address' when they need to know your email address.
     *Note Mail Headers::.

   * Make Text mode the default mode for new buffers.

          (setq-default major-mode 'text-mode)

     Note that `text-mode' is used because it is the command for
     entering Text mode.  The single-quote before it makes the symbol a
     constant; otherwise, `text-mode' would be treated as a variable
     name.

   * Set up defaults for the Latin-1 character set which supports most
     of the languages of Western Europe.

          (set-language-environment "Latin-1")

   * Turn off Line Number mode, a global minor mode.

          (line-number-mode 0)

   * Turn on Auto Fill mode automatically in Text mode and related
     modes.

          (add-hook 'text-mode-hook
            '(lambda () (auto-fill-mode 1)))

     This shows how to add a hook function to a normal hook variable
     (*note Hooks::).  The function we supply is a list starting with
     `lambda', with a single-quote in front of it to make it a list
     constant rather than an expression.

     It's beyond the scope of this manual to explain Lisp functions,
     but for this example it is enough to know that the effect is to
     execute `(auto-fill-mode 1)' when Text mode is entered.  You can
     replace that with any other expression that you like, or with
     several expressions in a row.

     Emacs comes with a function named `turn-on-auto-fill' whose
     definition is `(lambda () (auto-fill-mode 1))'.  Thus, a simpler
     way to write the above example is as follows:

          (add-hook 'text-mode-hook 'turn-on-auto-fill)

   * Load the installed Lisp library named `foo' (actually a file
     `foo.elc' or `foo.el' in a standard Emacs directory).

          (load "foo")

     When the argument to `load' is a relative file name, not starting
     with `/' or `~', `load' searches the directories in `load-path'
     (*note Lisp Libraries::).

   * Load the compiled Lisp file `foo.elc' from your home directory.

          (load "~/foo.elc")

     Here an absolute file name is used, so no searching is done.

   * Tell Emacs to find the definition for the function `myfunction' by
     loading a Lisp library named `mypackage' (i.e. a file
     `mypackage.elc' or `mypackage.el'):

          (autoload 'myfunction "mypackage" "Do what I say." t)

     Here the string `"Do what I say."' is the function's documentation
     string.  You specify it in the `autoload' definition so it will be
     available for help commands even when the package is not loaded.
     The last argument, `t', indicates that this function is
     interactive; that is, it can be invoked interactively by typing
     `M-x myfunction <RET>' or by binding it to a key.  If the function
     is not interactive, omit the `t' or use `nil'.

   * Rebind the key `C-x l' to run the function `make-symbolic-link'
     (*note Init Rebinding::).

          (global-set-key "\C-xl" 'make-symbolic-link)

     or

          (define-key global-map "\C-xl" 'make-symbolic-link)

     Note once again the single-quote used to refer to the symbol
     `make-symbolic-link' instead of its value as a variable.

   * Do the same thing for Lisp mode only.

          (define-key lisp-mode-map "\C-xl" 'make-symbolic-link)

   * Redefine all keys which now run `next-line' in Fundamental mode so
     that they run `forward-line' instead.

          (substitute-key-definition 'next-line 'forward-line
                                     global-map)

   * Make `C-x C-v' undefined.

          (global-unset-key "\C-x\C-v")

     One reason to undefine a key is so that you can make it a prefix.
     Simply defining `C-x C-v ANYTHING' will make `C-x C-v' a prefix,
     but `C-x C-v' must first be freed of its usual non-prefix
     definition.

   * Make `$' have the syntax of punctuation in Text mode.  Note the
     use of a character constant for `$'.

          (modify-syntax-entry ?\$ "." text-mode-syntax-table)

   * Enable the use of the command `narrow-to-region' without
     confirmation.

          (put 'narrow-to-region 'disabled nil)

   * Adjusting the configuration to various platforms and Emacs
     versions.

     Users typically want Emacs to behave the same on all systems, so
     the same init file is right for all platforms.  However, sometimes
     it happens that a function you use for customizing Emacs is not
     available on some platforms or in older Emacs versions.  To deal
     with that situation, put the customization inside a conditional
     that tests whether the function or facility is available, like
     this:

          (if (fboundp 'blink-cursor-mode)
              (blink-cursor-mode 0))

          (if (boundp 'coding-category-utf-8)
              (set-coding-priority '(coding-category-utf-8)))

     You can also simply disregard the errors that occur if the
     function is not defined.

          (condition case ()
              (set-face-background 'region "grey75")
            (error nil))

     A `setq' on a variable which does not exist is generally harmless,
     so those do not need a conditional.


File: emacs,  Node: Terminal Init,  Next: Find Init,  Prev: Init Examples,  Up: Init File

57.6.3 Terminal-specific Initialization
---------------------------------------

Each terminal type can have a Lisp library to be loaded into Emacs when
it is run on that type of terminal.  For a terminal type named
TERMTYPE, the library is called `term/TERMTYPE' and it is found by
searching the directories `load-path' as usual and trying the suffixes
`.elc' and `.el'.  Normally it appears in the subdirectory `term' of
the directory where most Emacs libraries are kept.

   The usual purpose of the terminal-specific library is to map the
escape sequences used by the terminal's function keys onto more
meaningful names, using `input-decode-map' (or `function-key-map'
before it).  See the file `term/lk201.el' for an example of how this is
done.  Many function keys are mapped automatically according to the
information in the Termcap data base; the terminal-specific library
needs to map only the function keys that Termcap does not specify.

   When the terminal type contains a hyphen, only the part of the name
before the first hyphen is significant in choosing the library name.
Thus, terminal types `aaa-48' and `aaa-30-rv' both use the library
`term/aaa'.  The code in the library can use `(getenv "TERM")' to find
the full terminal type name.

   The library's name is constructed by concatenating the value of the
variable `term-file-prefix' and the terminal type.  Your `.emacs' file
can prevent the loading of the terminal-specific library by setting
`term-file-prefix' to `nil'.

   Emacs runs the hook `term-setup-hook' at the end of initialization,
after both your `.emacs' file and any terminal-specific library have
been read in.  Add hook functions to this hook if you wish to override
part of any of the terminal-specific libraries and to define
initializations for terminals that do not have a library.  *Note
Hooks::.


File: emacs,  Node: Find Init,  Next: Init Non-ASCII,  Prev: Terminal Init,  Up: Init File

57.6.4 How Emacs Finds Your Init File
-------------------------------------

Normally Emacs uses the environment variable `HOME' (*note HOME:
General Variables.) to find `.emacs'; that's what `~' means in a file
name.  If `.emacs' is not found inside `~/' (nor `.emacs.el'), Emacs
looks for `~/.emacs.d/init.el' (which, like `~/.emacs.el', can be
byte-compiled).

   However, if you run Emacs from a shell started by `su', Emacs tries
to find your own `.emacs', not that of the user you are currently
pretending to be.  The idea is that you should get your own editor
customizations even if you are running as the super user.

   More precisely, Emacs first determines which user's init file to use.
It gets your user name from the environment variables `LOGNAME' and
`USER'; if neither of those exists, it uses effective user-ID.  If that
user name matches the real user-ID, then Emacs uses `HOME'; otherwise,
it looks up the home directory corresponding to that user name in the
system's data base of users.


File: emacs,  Node: Init Non-ASCII,  Prev: Find Init,  Up: Init File

57.6.5 Non-ASCII Characters in Init Files
-----------------------------------------

Language and coding systems may cause problems if your init file
contains non-ASCII characters, such as accented letters, in strings or
key bindings.

   If you want to use non-ASCII characters in your init file, you
should put a `-*-coding: CODING-SYSTEM-*-' tag on the first line of the
init file, and specify a coding system that supports the character(s)
in question.  *Note Recognize Coding::.  This is because the defaults
for decoding non-ASCII text might not yet be set up by the time Emacs
reads those parts of your init file which use such strings, possibly
leading Emacs to decode those strings incorrectly.  You should then
avoid adding Emacs Lisp code that modifies the coding system in other
ways, such as calls to `set-language-environment'.

   To bind non-ASCII keys, you must use a vector (*note Init
Rebinding::).  The string syntax cannot be used, since the non-ASCII
characters will be interpreted as meta keys.  For instance:

     (global-set-key [?CHAR] 'some-function)

Type `C-q', followed by the key you want to bind, to insert CHAR.

   *Warning:* if you change the keyboard encoding, or change between
multibyte and unibyte mode, or anything that would alter which code
`C-q' would insert for that character, this key binding may stop
working.  It is therefore advisable to use one and only one coding
system, for your init file as well as the files you edit.  For example,
don't mix the `latin-1' and `latin-9' coding systems.


File: emacs,  Node: Quitting,  Next: Lossage,  Prev: Customization,  Up: Top

58 Quitting and Aborting
************************

`C-g'
`C-<BREAK> (MS-DOS only)'
     Quit: cancel running or partially typed command.

`C-]'
     Abort innermost recursive editing level and cancel the command
     which invoked it (`abort-recursive-edit').

`<ESC> <ESC> <ESC>'
     Either quit or abort, whichever makes sense
     (`keyboard-escape-quit').

`M-x top-level'
     Abort all recursive editing levels that are currently executing.

`C-/'
`C-x u'
`C-_'
     Cancel a previously made change in the buffer contents (`undo').

   There are two ways of canceling a command before it has finished:
"quitting" with `C-g', and "aborting" with `C-]' or `M-x top-level'.
Quitting cancels a partially typed command, or one which is still
running.  Aborting exits a recursive editing level and cancels the
command that invoked the recursive edit.  (*Note Recursive Edit::.)

   Quitting with `C-g' is the way to get rid of a partially typed
command, or a numeric argument that you don't want.  Furthermore, if
you are in the middle of a command that is running, `C-g' stops the
command in a relatively safe way.  For example, if you quit out of a
kill command that is taking a long time, either your text will _all_
still be in the buffer, or it will _all_ be in the kill ring, or maybe
both.  If the region is active, `C-g' deactivates the mark, unless
Transient Mark mode is off (*note Persistent Mark::).  If you are in
the middle of an incremental search, `C-g' does special things; it may
take two successive `C-g' characters to get out of a search.  *Note
Incremental Search::, for details.

   On MS-DOS, the character `C-<BREAK>' serves as a quit character like
`C-g'.  The reason is that it is not feasible, on MS-DOS, to recognize
`C-g' while a command is running, between interactions with the user.
By contrast, it _is_ feasible to recognize `C-<BREAK>' at all times.
*Note MS-DOS Keyboard::.

   `C-g' works by setting the variable `quit-flag' to `t' the instant
`C-g' is typed; Emacs Lisp checks this variable frequently, and quits
if it is non-`nil'.  `C-g' is only actually executed as a command if
you type it while Emacs is waiting for input.  In that case, the
command it runs is `keyboard-quit'.

   On a text terminal, if you quit with `C-g' a second time before the
first `C-g' is recognized, you activate the "emergency escape" feature
and return to the shell.  *Note Emergency Escape::.

   There are some situations where you cannot quit.  When Emacs is
waiting for the operating system to do something, quitting is
impossible unless special pains are taken for the particular system
call within Emacs where the waiting occurs.  We have done this for the
system calls that users are likely to want to quit from, but it's
possible you will encounter a case not handled.  In one very common
case--waiting for file input or output using NFS--Emacs itself knows
how to quit, but many NFS implementations simply do not allow user
programs to stop waiting for NFS when the NFS server is hung.

   Aborting with `C-]' (`abort-recursive-edit') is used to get out of a
recursive editing level and cancel the command which invoked it.
Quitting with `C-g' does not do this, and could not do this, because it
is used to cancel a partially typed command _within_ the recursive
editing level.  Both operations are useful.  For example, if you are in
a recursive edit and type `C-u 8' to enter a numeric argument, you can
cancel that argument with `C-g' and remain in the recursive edit.

   The sequence `<ESC> <ESC> <ESC>' (`keyboard-escape-quit') can either
quit or abort.  (We defined it this way because <ESC> means "get out"
in many PC programs.)  It can cancel a prefix argument, clear a
selected region, or get out of a Query Replace, like `C-g'.  It can get
out of the minibuffer or a recursive edit, like `C-]'.  It can also get
out of splitting the frame into multiple windows, as with `C-x 1'.  One
thing it cannot do, however, is stop a command that is running.  That's
because it executes as an ordinary command, and Emacs doesn't notice it
until it is ready for the next command.

   The command `M-x top-level' is equivalent to "enough" `C-]' commands
to get you out of all the levels of recursive edits that you are in; it
also exits the minibuffer if it is active.  `C-]' gets you out one
level at a time, but `M-x top-level' goes out all levels at once.  Both
`C-]' and `M-x top-level' are like all other commands, and unlike
`C-g', in that they take effect only when Emacs is ready for a command.
`C-]' is an ordinary key and has its meaning only because of its
binding in the keymap.  *Note Recursive Edit::.

   `C-/' (`undo') is not strictly speaking a way of canceling a
command, but you can think of it as canceling a command that already
finished executing.  *Note Undo::, for more information about the undo
facility.


File: emacs,  Node: Lossage,  Next: Bugs,  Prev: Quitting,  Up: Top

59 Dealing with Emacs Trouble
*****************************

This section describes various conditions in which Emacs fails to work
normally, and how to recognize them and correct them.  For a list of
additional problems you might encounter, see *note Bugs and problems:
(efaq)Bugs and problems, and the file `etc/PROBLEMS' in the Emacs
distribution.  Type `C-h C-f' to read the FAQ; type `C-h C-p' to read
the `PROBLEMS' file.

* Menu:

* DEL Does Not Delete::   What to do if <DEL> doesn't delete.
* Stuck Recursive::       `[...]' in mode line around the parentheses.
* Screen Garbled::        Garbage on the screen.
* Text Garbled::          Garbage in the text.
* Memory Full::           How to cope when you run out of memory.
* After a Crash::         Recovering editing in an Emacs session that crashed.
* Emergency Escape::      Emergency escape---
                            What to do if Emacs stops responding.
* Total Frustration::     When you are at your wits' end.


File: emacs,  Node: DEL Does Not Delete,  Next: Stuck Recursive,  Up: Lossage

59.1 If <DEL> Fails to Delete
=============================

Every keyboard has a large key, usually labelled <Backspace>, which is
ordinarily used to erase the last character that you typed.  We call
this key "the usual erasure key".  In Emacs, it is supposed to be
equivalent to <DEL>.

   When Emacs starts up on a graphical display, it determines
automatically which key should be <DEL>.  In some unusual cases, Emacs
gets the wrong information from the system.  If the usual erasure key
deletes forwards instead of backwards, that is probably what
happened--Emacs ought to be treating the <Backspace> key as <DEL>, but
it isn't.

   Some keyboards also have a <Delete> key, which is ordinarily used to
delete forwards.  If this key deletes backward in Emacs, that too
suggests Emacs got the wrong information--but in the opposite sense.

   On a text-only terminal, if you find the usual erasure key prompts
for a Help command, like `Control-h', instead of deleting a character,
it means that key is actually sending the <BS> character.  Emacs ought
to be treating <BS> as <DEL>, but it isn't.

   In all of those cases, the immediate remedy is the same: use the
command `M-x normal-erase-is-backspace-mode'.  This toggles between the
two modes that Emacs supports for handling <DEL>, so if Emacs starts in
the wrong mode, this should switch to the right mode.  On a text-only
terminal, if you want to ask for help when <BS> is treated as <DEL>,
use <F1>; `C-?' may also work, if it sends character code 127.

   To fix the problem automatically for every Emacs session, you can
put one of the following lines into your `.emacs' file (*note Init
File::).  For the first case above, where <Backspace> deletes forwards
instead of backwards, use this line to make <Backspace> act as <DEL>
(resulting in behavior compatible with Emacs 20 and previous versions):

     (normal-erase-is-backspace-mode 0)

For the other two cases, use this line:

     (normal-erase-is-backspace-mode 1)

   Another way to fix the problem for every Emacs session is to
customize the variable `normal-erase-is-backspace': the value `t'
specifies the mode where <BS> or <BACKSPACE> is <DEL>, and `nil'
specifies the other mode.  *Note Easy Customization::.


File: emacs,  Node: Stuck Recursive,  Next: Screen Garbled,  Prev: DEL Does Not Delete,  Up: Lossage

59.2 Recursive Editing Levels
=============================

Recursive editing levels are important and useful features of Emacs, but
they can seem like malfunctions if you do not understand them.

   If the mode line has square brackets `[...]' around the parentheses
that contain the names of the major and minor modes, you have entered a
recursive editing level.  If you did not do this on purpose, or if you
don't understand what that means, you should just get out of the
recursive editing level.  To do so, type `M-x top-level'.  This is
called getting back to top level.  *Note Recursive Edit::.


File: emacs,  Node: Screen Garbled,  Next: Text Garbled,  Prev: Stuck Recursive,  Up: Lossage

59.3 Garbage on the Screen
==========================

If the text on a text terminal looks wrong, the first thing to do is
see whether it is wrong in the buffer.  Type `C-l' to redisplay the
entire screen.  If the screen appears correct after this, the problem
was entirely in the previous screen update.  (Otherwise, see the
following section.)

   Display updating problems often result from an incorrect terminfo
entry for the terminal you are using.  The file `etc/TERMS' in the
Emacs distribution gives the fixes for known problems of this sort.
`INSTALL' contains general advice for these problems in one of its
sections.  To investigate the possibility that you have this sort of
problem, try Emacs on another terminal made by a different
manufacturer.  If problems happen frequently on one kind of terminal
but not another kind, it is likely to be a bad terminfo entry, though
it could also be due to a bug in Emacs that appears for terminals that
have or that lack specific features.


File: emacs,  Node: Text Garbled,  Next: Memory Full,  Prev: Screen Garbled,  Up: Lossage

59.4 Garbage in the Text
========================

If `C-l' shows that the text is wrong, first type `C-h l' to see what
commands you typed to produce the observed results.  Then try undoing
the changes step by step using `C-x u', until it gets back to a state
you consider correct.

   If a large portion of text appears to be missing at the beginning or
end of the buffer, check for the word `Narrow' in the mode line.  If it
appears, the text you don't see is probably still present, but
temporarily off-limits.  To make it accessible again, type `C-x n w'.
*Note Narrowing::.


File: emacs,  Node: Memory Full,  Next: After a Crash,  Prev: Text Garbled,  Up: Lossage

59.5 Running out of Memory
==========================

If you get the error message `Virtual memory exceeded', save your
modified buffers with `C-x s'.  This method of saving them has the
smallest need for additional memory.  Emacs keeps a reserve of memory
which it makes available when this error happens; that should be enough
to enable `C-x s' to complete its work.  When the reserve has been
used, `!MEM FULL!' appears at the beginning of the mode line,
indicating there is no more reserve.

   Once you have saved your modified buffers, you can exit this Emacs
session and start another, or you can use `M-x kill-some-buffers' to
free space in the current Emacs job.  If this frees up sufficient
space, Emacs will refill its memory reserve, and `!MEM FULL!' will
disappear from the mode line.  That means you can safely go on editing
in the same Emacs session.

   Do not use `M-x buffer-menu' to save or kill buffers when you run
out of memory, because the buffer menu needs a fair amount of memory
itself, and the reserve supply may not be enough.


File: emacs,  Node: After a Crash,  Next: Emergency Escape,  Prev: Memory Full,  Up: Lossage

59.6 Recovery After a Crash
===========================

If Emacs or the computer crashes, you can recover the files you were
editing at the time of the crash from their auto-save files.  To do
this, start Emacs again and type the command `M-x recover-session'.

   This command initially displays a buffer which lists interrupted
session files, each with its date.  You must choose which session to
recover from.  Typically the one you want is the most recent one.  Move
point to the one you choose, and type `C-c C-c'.

   Then `recover-session' considers each of the files that you were
editing during that session; for each such file, it asks whether to
recover that file.  If you answer `y' for a file, it shows the dates of
that file and its auto-save file, then asks once again whether to
recover that file.  For the second question, you must confirm with
`yes'.  If you do, Emacs visits the file but gets the text from the
auto-save file.

   When `recover-session' is done, the files you've chosen to recover
are present in Emacs buffers.  You should then save them.  Only
this--saving them--updates the files themselves.

   As a last resort, if you had buffers with content which were not
associated with any files, or if the autosave was not recent enough to
have recorded important changes, you can use the `etc/emacs-buffer.gdb'
script with GDB (the GNU Debugger) to retrieve them from a core
dump-provided that a core dump was saved, and that the Emacs executable
was not stripped of its debugging symbols.

   As soon as you get the core dump, rename it to another name such as
`core.emacs', so that another crash won't overwrite it.

   To use this script, run `gdb' with the file name of your Emacs
executable and the file name of the core dump, e.g. `gdb /usr/bin/emacs
core.emacs'.  At the `(gdb)' prompt, load the recovery script: `source
/usr/src/emacs/etc/emacs-buffer.gdb'.  Then type the command
`ybuffer-list' to see which buffers are available.  For each buffer, it
lists a buffer number.  To save a buffer, use `ysave-buffer'; you
specify the buffer number, and the file name to write that buffer into.
You should use a file name which does not already exist; if the file
does exist, the script does not make a backup of its old contents.


File: emacs,  Node: Emergency Escape,  Next: Total Frustration,  Prev: After a Crash,  Up: Lossage

59.7 Emergency Escape
=====================

On text-only terminals, the "emergency escape" feature suspends Emacs
immediately if you type `C-g' a second time before Emacs can actually
respond to the first one by quitting.  This is so you can always get
out of GNU Emacs no matter how badly it might be hung.  When things are
working properly, Emacs recognizes and handles the first `C-g' so fast
that the second one won't trigger emergency escape.  However, if some
problem prevents Emacs from handling the first `C-g' properly, then the
second one will get you back to the shell.

   When you resume Emacs after a suspension caused by emergency escape,
it asks two questions before going back to what it had been doing:

     Auto-save? (y or n)
     Abort (and dump core)? (y or n)

Answer each one with `y' or `n' followed by <RET>.

   Saying `y' to `Auto-save?' causes immediate auto-saving of all
modified buffers in which auto-saving is enabled.  Saying `n' skips
this.

   Saying `y' to `Abort (and dump core)?' causes Emacs to crash,
dumping core.  This is to enable a wizard to figure out why Emacs was
failing to quit in the first place.  Execution does not continue after
a core dump.

   If you answer this question `n', Emacs execution resumes.  With
luck, Emacs will ultimately do the requested quit.  If not, each
subsequent `C-g' invokes emergency escape again.

   If Emacs is not really hung, just slow, you may invoke the double
`C-g' feature without really meaning to.  Then just resume and answer
`n' to both questions, and you will get back to the former state.  The
quit you requested will happen by and by.

   Emergency escape is active only for text terminals.  On graphical
displays, you can use the mouse to kill Emacs or switch to another
program.

   On MS-DOS, you must type `C-<BREAK>' (twice) to cause emergency
escape--but there are cases where it won't work, when system call hangs
or when Emacs is stuck in a tight loop in C code.


File: emacs,  Node: Total Frustration,  Prev: Emergency Escape,  Up: Lossage

59.8 Help for Total Frustration
===============================

If using Emacs (or something else) becomes terribly frustrating and none
of the techniques described above solve the problem, Emacs can still
help you.

   First, if the Emacs you are using is not responding to commands, type
`C-g C-g' to get out of it and then start a new one.

   Second, type `M-x doctor <RET>'.

   The Emacs psychotherapist will help you feel better.  Each time you
say something to the psychotherapist, you must end it by typing <RET>
<RET>.  This indicates you are finished typing.


File: emacs,  Node: Bugs,  Next: Contributing,  Prev: Lossage,  Up: Top

60 Reporting Bugs
*****************

If you think you have found a bug in Emacs, please report it.  We
cannot promise to fix it, or always to agree that it is a bug, but we
certainly want to hear about it.  The same applies for new features you
would like to see added.  The following sections will help you to
construct an effective bug report.

* Menu:

* Known Problems::               How to read about known problems and bugs.
* Criteria:  Bug Criteria.       Have you really found a bug?
* Understanding Bug Reporting::  How to report a bug effectively.
* Checklist::                    Steps to follow for a good bug report.
* Sending Patches::              How to send a patch for GNU Emacs.


File: emacs,  Node: Known Problems,  Next: Bug Criteria,  Up: Bugs

60.1 Reading Existing Bug Reports and Known Problems
====================================================

Before reporting a bug, if at all possible please check to see if it is
already known about.  Indeed, it may already have been fixed in a later
release of Emacs, or in the development version.  Here is a list of the
main places you can read about known issues:

   * The `etc/PROBLEMS' file in the Emacs distribution; type `C-h C-p'
     to read it.  This file contains a list of particularly well-known
     issues that have been encountered in compiling, installing and
     running Emacs.  Often, there are suggestions for workarounds and
     solutions.

   * Some additional user-level problems can be found in *note Bugs and
     problems: (efaq)Bugs and problems.

   * The `bug-gnu-emacs' mailing list (also available as the newsgroup
     `gnu.emacs.bug').  You can read the list archives at
     `http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs'.  If you
     like, you can also subscribe to the list.  Be aware that the sole
     purpose of this list is to provide the Emacs maintainers with
     information about bugs and feature requests.  Reports may contain
     fairly large amounts of data; spectators should not complain about
     this.

   * The bug tracker at `http://debbugs.gnu.org'.  From early 2008,
     reports from the `bug-gnu-emacs' list have also been sent here.
     The tracker contains the same information as the mailing list,
     just in a different format.  You may prefer to browse and read
     reports using the tracker.

   * The `emacs-pretest-bug' mailing list.  This list is no longer
     used, and is mainly of historical interest.  At one time, it was
     used for bug reports in development (i.e., not yet released)
     versions of Emacs.  You can read the archives for 2003 to mid 2007
     at `http://lists.gnu.org/archive/html/emacs-pretest-bug/'.  From
     late 2007 to mid 2008, the address was an alias for the
     `emacs-devel' mailing list.  From mid 2008 onwards, it has been an
     alias for `bug-gnu-emacs'.

   * The `emacs-devel' mailing list.  Sometimes people report bugs to
     this mailing list.  This is not the main purpose of the list,
     however, and it is much better to send bug reports to the bug
     list.  You should not feel obliged to read this list before
     reporting a bug.



File: emacs,  Node: Bug Criteria,  Next: Understanding Bug Reporting,  Prev: Known Problems,  Up: Bugs

60.2 When Is There a Bug
========================

If Emacs accesses an invalid memory location ("segmentation fault"), or
exits with an operating system error message that indicates a problem
in the program (as opposed to something like "disk full"), then it is
certainly a bug.

   If Emacs updates the display in a way that does not correspond to
what is in the buffer, then it is certainly a bug.  If a command seems
to do the wrong thing but the problem corrects itself if you type
`C-l', it is a case of incorrect display updating.

   Taking forever to complete a command can be a bug, but you must make
certain that it was really Emacs's fault.  Some commands simply take a
long time.  Type `C-g' (`C-<BREAK>' on MS-DOS) and then `C-h l' to see
whether the input Emacs received was what you intended to type; if the
input was such that you _know_ it should have been processed quickly,
report a bug.  If you don't know whether the command should take a long
time, find out by looking in the manual or by asking for assistance.

   If a command you are familiar with causes an Emacs error message in a
case where its usual definition ought to be reasonable, it is probably a
bug.

   If a command does the wrong thing, that is a bug.  But be sure you
know for certain what it ought to have done.  If you aren't familiar
with the command, or don't know for certain how the command is supposed
to work, then it might actually be working right.  Rather than jumping
to conclusions, show the problem to someone who knows for certain.

   Finally, a command's intended definition may not be the best
possible definition for editing with.  This is a very important sort of
problem, but it is also a matter of judgment.  Also, it is easy to come
to such a conclusion out of ignorance of some of the existing features.
It is probably best not to complain about such a problem until you have
checked the documentation in the usual ways, feel confident that you
understand it, and know for certain that what you want is not
available.  Ask other Emacs users, too.  If you are not sure what the
command is supposed to do after a careful reading of the manual, check
the index and glossary for any terms that may be unclear.

   If after careful rereading of the manual you still do not understand
what the command should do, that indicates a bug in the manual, which
you should report.  The manual's job is to make everything clear to
people who are not Emacs experts--including you.  It is just as
important to report documentation bugs as program bugs.

   If the on-line documentation string of a function or variable
disagrees with the manual, one of them must be wrong; that is a bug.


File: emacs,  Node: Understanding Bug Reporting,  Next: Checklist,  Prev: Bug Criteria,  Up: Bugs

60.3 Understanding Bug Reporting
================================

When you decide that there is a bug, it is important to report it and to
report it in a way which is useful.  What is most useful is an exact
description of what commands you type, starting with the shell command
to run Emacs, until the problem happens.

   The most important principle in reporting a bug is to report
_facts_.  Hypotheses and verbal descriptions are no substitute for the
detailed raw data.  Reporting the facts is straightforward, but many
people strain to posit explanations and report them instead of the
facts.  If the explanations are based on guesses about how Emacs is
implemented, they will be useless; meanwhile, lacking the facts, we will
have no real information about the bug.

   For example, suppose that you type `C-x C-f /glorp/baz.ugh <RET>',
visiting a file which (you know) happens to be rather large, and Emacs
displays `I feel pretty today'.  The best way to report the bug is with
a sentence like the preceding one, because it gives all the facts.

   A bad way would be to assume that the problem is due to the size of
the file and say, "I visited a large file, and Emacs displayed `I feel
pretty today'."  This is what we mean by "guessing explanations."  The
problem is just as likely to be due to the fact that there is a `z' in
the file name.  If this is so, then when we got your report, we would
try out the problem with some "large file," probably with no `z' in its
name, and not see any problem.  There is no way in the world that we
could guess that we should try visiting a file with a `z' in its name.

   Alternatively, the problem might be due to the fact that the file
starts with exactly 25 spaces.  For this reason, you should make sure
that you inform us of the exact contents of any file that is needed to
reproduce the bug.  What if the problem only occurs when you have typed
the `C-x C-a' command previously?  This is why we ask you to give the
exact sequence of characters you typed since starting the Emacs session.

   You should not even say "visit a file" instead of `C-x C-f' unless
you _know_ that it makes no difference which visiting command is used.
Similarly, rather than saying "if I have three characters on the line,"
say "after I type `<RET> A B C <RET> C-p'," if that is the way you
entered the text.

   So please don't guess any explanations when you report a bug.  If you
want to actually _debug_ the problem, and report explanations that are
more than guesses, that is useful--but please include the facts as well.


File: emacs,  Node: Checklist,  Next: Sending Patches,  Prev: Understanding Bug Reporting,  Up: Bugs

60.4 Checklist for Bug Reports
==============================

Before reporting a bug, first try to see if the problem has already
been reported (*note Known Problems::).

   If you are able to, try the latest release of Emacs to see if the
problem has already been fixed.  Even better is to try the latest
development version.  We recognize that this is not easy for some
people, so do not feel that you absolutely must do this before making a
report.

   The best way to write a bug report for Emacs is to use the command
`M-x report-emacs-bug'.  This sets up a mail buffer (*note Sending
Mail::) and automatically inserts _some_ of the essential information.
However, it cannot supply all the necessary information; you should
still read and follow the guidelines below, so you can enter the other
crucial information by hand before you send the message.  You may feel
that some of the information inserted by `M-x report-emacs-bug' is not
relevant, but unless you are absolutely sure it is best to leave it, so
that the developers can decide for themselves.

   When you have finished writing your report, type `C-c C-c' and it
will be sent to the Emacs maintainers at <bug-gnu-emacs@gnu.org>.  (If
you want to suggest an improvement or new feature, use the same
address.)  If you cannot send mail from inside Emacs, you can copy the
text of your report to your normal mail client and send it to that
address.  Or you can simply send an email to that address describing
the problem.

   Your report will be sent to the `bug-gnu-emacs' mailing list, and
stored in the tracker at `http://debbugs.gnu.org'.  Please try to
include a valid reply email address, in case we need to ask you for
more information about your report.  Submissions are moderated, so
there may be a delay before your report appears.

   You do not need to know how the `http://debbugs.gnu.org' bug tracker
works in order to report a bug, but if you want to, you can read the
tracker's online documentation to see the various features you can use.

   All mail sent to the `bug-gnu-emacs' mailing list is also gatewayed
to the `gnu.emacs.bug' newsgroup.  The reverse is also true, but we ask
you not to post bug reports (or replies) via the newsgroup.  It can
make it much harder to contact you if we need to ask for more
information, and it does not integrate well with the bug tracker.

   If your data is more than 500,000 bytes, please don't include it
directly in the bug report; instead, offer to send it on request, or
make it available by ftp and say where.

   To enable maintainers to investigate a bug, your report should
include all these things:

   * The version number of Emacs.  Without this, we won't know whether
     there is any point in looking for the bug in the current version
     of GNU Emacs.

     `M-x report-emacs-bug' includes this information automatically,
     but if you are not using that command for your report you can get
     the version number by typing `M-x emacs-version <RET>'.  If that
     command does not work, you probably have something other than GNU
     Emacs, so you will have to report the bug somewhere else.

   * The type of machine you are using, and the operating system name
     and version number (again, automatically included by `M-x
     report-emacs-bug').  `M-x emacs-version <RET>' provides this
     information too.  Copy its output from the `*Messages*' buffer, so
     that you get it all and get it accurately.

   * The operands given to the `configure' command when Emacs was
     installed (automatically included by `M-x report-emacs-bug').

   * A complete list of any modifications you have made to the Emacs
     source.  (We may not have time to investigate the bug unless it
     happens in an unmodified Emacs.  But if you've made modifications
     and you don't tell us, you are sending us on a wild goose chase.)

     Be precise about these changes.  A description in English is not
     enough--send a context diff for them.

     Adding files of your own, or porting to another machine, is a
     modification of the source.

   * Details of any other deviations from the standard procedure for
     installing GNU Emacs.

   * The complete text of any files needed to reproduce the bug.

     If you can tell us a way to cause the problem without visiting any
     files, please do so.  This makes it much easier to debug.  If you
     do need files, make sure you arrange for us to see their exact
     contents.  For example, it can matter whether there are spaces at
     the ends of lines, or a newline after the last line in the buffer
     (nothing ought to care whether the last line is terminated, but
     try telling the bugs that).

   * The precise commands we need to type to reproduce the bug.  If at
     all possible, give a full recipe for an Emacs started with the
     `-Q' option (*note Initial Options::).  This bypasses your
     `.emacs' customizations.

     One way to record the input to Emacs precisely is to write a
     dribble file.  To start the file, execute the Lisp expression

          (open-dribble-file "~/dribble")

     using `M-:' or from the `*scratch*' buffer just after starting
     Emacs.  From then on, Emacs copies all your input to the specified
     dribble file until the Emacs process is killed.

   * For possible display bugs, the terminal type (the value of
     environment variable `TERM'), the complete termcap entry for the
     terminal from `/etc/termcap' (since that file is not identical on
     all machines), and the output that Emacs actually sent to the
     terminal.

     The way to collect the terminal output is to execute the Lisp
     expression

          (open-termscript "~/termscript")

     using `M-:' or from the `*scratch*' buffer just after starting
     Emacs.  From then on, Emacs copies all terminal output to the
     specified termscript file as well, until the Emacs process is
     killed.  If the problem happens when Emacs starts up, put this
     expression into your `.emacs' file so that the termscript file
     will be open when Emacs displays the screen for the first time.

     Be warned: it is often difficult, and sometimes impossible, to fix
     a terminal-dependent bug without access to a terminal of the type
     that stimulates the bug.

   * If non-ASCII text or internationalization is relevant, the locale
     that was current when you started Emacs.  On GNU/Linux and Unix
     systems, or if you use a Posix-style shell such as Bash, you can
     use this shell command to view the relevant values:

          echo LC_ALL=$LC_ALL LC_COLLATE=$LC_COLLATE LC_CTYPE=$LC_CTYPE \
            LC_MESSAGES=$LC_MESSAGES LC_TIME=$LC_TIME LANG=$LANG

     Alternatively, use the `locale' command, if your system has it, to
     display your locale settings.

     You can use the `M-!' command to execute these commands from
     Emacs, and then copy the output from the `*Messages*' buffer into
     the bug report.  Alternatively, `M-x getenv <RET> LC_ALL <RET>'
     will display the value of `LC_ALL' in the echo area, and you can
     copy its output from the `*Messages*' buffer.

   * A description of what behavior you observe that you believe is
     incorrect.  For example, "The Emacs process gets a fatal signal,"
     or, "The resulting text is as follows, which I think is wrong."

     Of course, if the bug is that Emacs gets a fatal signal, then one
     can't miss it.  But if the bug is incorrect text, the maintainer
     might fail to notice what is wrong.  Why leave it to chance?

     Even if the problem you experience is a fatal signal, you should
     still say so explicitly.  Suppose something strange is going on,
     such as, your copy of the source is out of sync, or you have
     encountered a bug in the C library on your system.  (This has
     happened!)  Your copy might crash and the copy here might not.  If
     you _said_ to expect a crash, then when Emacs here fails to crash,
     we would know that the bug was not happening.  If you don't say to
     expect a crash, then we would not know whether the bug was
     happening--we would not be able to draw any conclusion from our
     observations.

   * If the bug is that the Emacs Manual or the Emacs Lisp Reference
     Manual fails to describe the actual behavior of Emacs, or that the
     text is confusing, copy in the text from the online manual which
     you think is at fault.  If the section is small, just the section
     name is enough.

   * If the manifestation of the bug is an Emacs error message, it is
     important to report the precise text of the error message, and a
     backtrace showing how the Lisp program in Emacs arrived at the
     error.

     To get the error message text accurately, copy it from the
     `*Messages*' buffer into the bug report.  Copy all of it, not just
     part.

     To make a backtrace for the error, use `M-x toggle-debug-on-error'
     before the error happens (that is to say, you must give that
     command and then make the bug happen).  This causes the error to
     start the Lisp debugger, which shows you a backtrace.  Copy the
     text of the debugger's backtrace into the bug report.  *Note The
     Lisp Debugger: (elisp)Debugger, for information on debugging Emacs
     Lisp programs with the Edebug package.

     This use of the debugger is possible only if you know how to make
     the bug happen again.  If you can't make it happen again, at least
     copy the whole error message.

     If Emacs appears to be stuck in an infinite loop or in a very long
     operation, typing `C-g' with the variable `debug-on-quit'
     non-`nil' will start the Lisp debugger and show a backtrace.  This
     backtrace is useful for debugging such long loops, so if you can
     produce it, copy it into the bug report.

   * Check whether any programs you have loaded into the Lisp world,
     including your `.emacs' file, set any variables that may affect the
     functioning of Emacs.  Also, see whether the problem happens in a
     freshly started Emacs without loading your `.emacs' file (start
     Emacs with the `-Q' switch to prevent loading the init files).  If
     the problem does _not_ occur then, you must report the precise
     contents of any programs that you must load into the Lisp world in
     order to cause the problem to occur.

   * If the problem does depend on an init file or other Lisp programs
     that are not part of the standard Emacs system, then you should
     make sure it is not a bug in those programs by complaining to
     their maintainers first.  After they verify that they are using
     Emacs in a way that is supposed to work, they should report the
     bug.

   * If you wish to mention something in the GNU Emacs source, show the
     line of code with a few lines of context.  Don't just give a line
     number.

     The line numbers in the development sources don't match those in
     your sources.  It would take extra work for the maintainers to
     determine what code is in your version at a given line number, and
     we could not be certain.

   * Additional information from a C debugger such as GDB might enable
     someone to find a problem on a machine which he does not have
     available.  If you don't know how to use GDB, please read the GDB
     manual--it is not very long, and using GDB is easy.  You can find
     the GDB distribution, including the GDB manual in online form, in
     most of the same places you can find the Emacs distribution.  To
     run Emacs under GDB, you should switch to the `src' subdirectory
     in which Emacs was compiled, then do `gdb emacs'.  It is important
     for the directory `src' to be current so that GDB will read the
     `.gdbinit' file in this directory.

     However, you need to think when you collect the additional
     information if you want it to show what causes the bug.

     For example, many people send just a backtrace, but that is not
     very useful by itself.  A simple backtrace with arguments often
     conveys little about what is happening inside GNU Emacs, because
     most of the arguments listed in the backtrace are pointers to Lisp
     objects.  The numeric values of these pointers have no
     significance whatever; all that matters is the contents of the
     objects they point to (and most of the contents are themselves
     pointers).

     To provide useful information, you need to show the values of Lisp
     objects in Lisp notation.  Do this for each variable which is a
     Lisp object, in several stack frames near the bottom of the stack.
     Look at the source to see which variables are Lisp objects,
     because the debugger thinks of them as integers.

     To show a variable's value in Lisp syntax, first print its value,
     then use the user-defined GDB command `pr' to print the Lisp
     object in Lisp syntax.  (If you must use another debugger, call
     the function `debug_print' with the object as an argument.)  The
     `pr' command is defined by the file `.gdbinit', and it works only
     if you are debugging a running process (not with a core dump).

     To make Lisp errors stop Emacs and return to GDB, put a breakpoint
     at `Fsignal'.

     For a short listing of Lisp functions running, type the GDB
     command `xbacktrace'.

     The file `.gdbinit' defines several other commands that are useful
     for examining the data types and contents of Lisp objects.  Their
     names begin with `x'.  These commands work at a lower level than
     `pr', and are less convenient, but they may work even when `pr'
     does not, such as when debugging a core dump or when Emacs has had
     a fatal signal.

     More detailed advice and other useful techniques for debugging
     Emacs are available in the file `etc/DEBUG' in the Emacs
     distribution.  That file also includes instructions for
     investigating problems whereby Emacs stops responding (many people
     assume that Emacs is "hung," whereas in fact it might be in an
     infinite loop).

     To find the file `etc/DEBUG' in your Emacs installation, use the
     directory name stored in the variable `data-directory'.

   Here are some things that are not necessary in a bug report:

   * A description of the envelope of the bug--this is not necessary
     for a reproducible bug.

     Often people who encounter a bug spend a lot of time investigating
     which changes to the input file will make the bug go away and which
     changes will not affect it.

     This is often time-consuming and not very useful, because the way
     we will find the bug is by running a single example under the
     debugger with breakpoints, not by pure deduction from a series of
     examples.  You might as well save time by not searching for
     additional examples.  It is better to send the bug report right
     away, go back to editing, and find another bug to report.

     Of course, if you can find a simpler example to report _instead_ of
     the original one, that is a convenience.  Errors in the output
     will be easier to spot, running under the debugger will take less
     time, etc.

     However, simplification is not vital; if you can't do this or
     don't have time to try, please report the bug with your original
     test case.

   * A core dump file.

     Debugging the core dump might be useful, but it can only be done on
     your machine, with your Emacs executable.  Therefore, sending the
     core dump file to the Emacs maintainers won't be useful.  Above
     all, don't include the core file in an email bug report!  Such a
     large message can be extremely inconvenient.

   * A system-call trace of Emacs execution.

     System-call traces are very useful for certain special kinds of
     debugging, but in most cases they give little useful information.
     It is therefore strange that many people seem to think that _the_
     way to report information about a crash is to send a system-call
     trace.  Perhaps this is a habit formed from experience debugging
     programs that don't have source code or debugging symbols.

     In most programs, a backtrace is normally far, far more
     informative than a system-call trace.  Even in Emacs, a simple
     backtrace is generally more informative, though to give full
     information you should supplement the backtrace by displaying
     variable values and printing them as Lisp objects with `pr' (see
     above).

   * A patch for the bug.

     A patch for the bug is useful if it is a good one.  But don't omit
     the other information that a bug report needs, such as the test
     case, on the assumption that a patch is sufficient.  We might see
     problems with your patch and decide to fix the problem another
     way, or we might not understand it at all.  And if we can't
     understand what bug you are trying to fix, or why your patch
     should be an improvement, we mustn't install it.

     *Note Sending Patches::, for guidelines on how to make it easy for
     us to understand and install your patches.

   * A guess about what the bug is or what it depends on.

     Such guesses are usually wrong.  Even experts can't guess right
     about such things without first using the debugger to find the
     facts.


File: emacs,  Node: Sending Patches,  Prev: Checklist,  Up: Bugs

60.5 Sending Patches for GNU Emacs
==================================

If you would like to write bug fixes or improvements for GNU Emacs,
that is very helpful.  When you send your changes, please follow these
guidelines to make it easy for the maintainers to use them.  If you
don't follow these guidelines, your information might still be useful,
but using it will take extra work.  Maintaining GNU Emacs is a lot of
work in the best of circumstances, and we can't keep up unless you do
your best to help.

   * Send an explanation with your changes of what problem they fix or
     what improvement they bring about.  For a fix for an existing bug,
     it is best to reply to the relevant discussion on the
     `bug-gnu-emacs' list, or item in the `http://debbugs.gnu.org'
     tracker.  Explain why your change fixes the bug.

   * Always include a proper bug report for the problem you think you
     have fixed.  We need to convince ourselves that the change is
     right before installing it.  Even if it is correct, we might have
     trouble understanding it if we don't have a way to reproduce the
     problem.

   * Include all the comments that are appropriate to help people
     reading the source in the future understand why this change was
     needed.

   * Don't mix together changes made for different reasons.  Send them
     _individually_.

     If you make two changes for separate reasons, then we might not
     want to install them both.  We might want to install just one.  If
     you send them all jumbled together in a single set of diffs, we
     have to do extra work to disentangle them--to figure out which
     parts of the change serve which purpose.  If we don't have time
     for this, we might have to ignore your changes entirely.

     If you send each change as soon as you have written it, with its
     own explanation, then two changes never get tangled up, and we can
     consider each one properly without any extra work to disentangle
     them.

   * Send each change as soon as that change is finished.  Sometimes
     people think they are helping us by accumulating many changes to
     send them all together.  As explained above, this is absolutely
     the worst thing you could do.

     Since you should send each change separately, you might as well
     send it right away.  That gives us the option of installing it
     immediately if it is important.

   * Use `diff -c' to make your diffs.  Diffs without context are hard
     to install reliably.  More than that, they are hard to study; we
     must always study a patch to decide whether we want to install it.
     Unidiff format is better than contextless diffs, but not as easy
     to read as `-c' format.

     If you have GNU diff, use `diff -c -F'^[_a-zA-Z0-9$]+ *('' when
     making diffs of C code.  This shows the name of the function that
     each change occurs in.

   * Avoid any ambiguity as to which is the old version and which is
     the new.  Please make the old version the first argument to diff,
     and the new version the second argument.  And please give one
     version or the other a name that indicates whether it is the old
     version or your new changed one.

   * Write the change log entries for your changes.  This is both to
     save us the extra work of writing them, and to help explain your
     changes so we can understand them.

     The purpose of the change log is to show people where to find what
     was changed.  So you need to be specific about what functions you
     changed; in large functions, it's often helpful to indicate where
     within the function the change was.

     On the other hand, once you have shown people where to find the
     change, you need not explain its purpose in the change log.  Thus,
     if you add a new function, all you need to say about it is that it
     is new.  If you feel that the purpose needs explaining, it
     probably does--but put the explanation in comments in the code.
     It will be more useful there.

     Please read the `ChangeLog' files in the `src' and `lisp'
     directories to see what sorts of information to put in, and to
     learn the style that we use.  *Note Change Log::.

   * When you write the fix, keep in mind that we can't install a
     change that would break other systems.  Please think about what
     effect your change will have if compiled on another type of system.

     Sometimes people send fixes that _might_ be an improvement in
     general--but it is hard to be sure of this.  It's hard to install
     such changes because we have to study them very carefully.  Of
     course, a good explanation of the reasoning by which you concluded
     the change was correct can help convince us.

     The safest changes are changes to the configuration files for a
     particular machine.  These are safe because they can't create new
     bugs on other machines.

     Please help us keep up with the workload by designing the patch in
     a form that is clearly safe to install.


File: emacs,  Node: Contributing,  Next: Service,  Prev: Bugs,  Up: Top

61 Contributing to Emacs Development
************************************

If you would like to help pretest Emacs releases to assure they work
well, or if you would like to work on improving Emacs, please contact
the maintainers at <emacs-devel@gnu.org>.  A pretester should be
prepared to investigate bugs as well as report them.  If you'd like to
work on improving Emacs, please ask for suggested projects or suggest
your own ideas.

   If you have already written an improvement, please tell us about it.
If you have not yet started work, it is useful to contact
<emacs-devel@gnu.org> before you start; it might be possible to suggest
ways to make your extension fit in better with the rest of Emacs.

   The development version of Emacs can be downloaded from the
repository where it is actively maintained by a group of developers.
See the Emacs project page `http://savannah.gnu.org/projects/emacs/'
for details.

   For more information on how to contribute, see the `etc/CONTRIBUTE'
file in the Emacs distribution.


File: emacs,  Node: Service,  Next: Copying,  Prev: Contributing,  Up: Top

62 How To Get Help with GNU Emacs
*********************************

If you need help installing, using or changing GNU Emacs, there are two
ways to find it:

   * Send a message to the mailing list <help-gnu-emacs@gnu.org>, or
     post your request on newsgroup `gnu.emacs.help'.  (This mailing
     list and newsgroup interconnect, so it does not matter which one
     you use.)

   * Look in the service directory for someone who might help you for a
     fee.  The service directory is found in the file named
     `etc/SERVICE' in the Emacs distribution.


File: emacs,  Node: Copying,  Next: GNU Free Documentation License,  Prev: Service,  Up: Top

Appendix A GNU GENERAL PUBLIC LICENSE
*************************************

                        Version 3, 29 June 2007

     Copyright (C) 2007 Free Software Foundation, Inc. `http://fsf.org/'

     Everyone is permitted to copy and distribute verbatim copies of this
     license document, but changing it is not allowed.

Preamble
========

The GNU General Public License is a free, copyleft license for software
and other kinds of works.

   The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains
free software for all its users.  We, the Free Software Foundation, use
the GNU General Public License for most of our software; it applies
also to any other work released this way by its authors.  You can apply
it to your programs, too.

   When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

   To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you
have certain responsibilities if you distribute copies of the software,
or if you modify it: responsibilities to respect the freedom of others.

   For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

   Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

   For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

   Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the
manufacturer can do so.  This is fundamentally incompatible with the
aim of protecting users' freedom to change the software.  The
systematic pattern of such abuse occurs in the area of products for
individuals to use, which is precisely where it is most unacceptable.
Therefore, we have designed this version of the GPL to prohibit the
practice for those products.  If such problems arise substantially in
other domains, we stand ready to extend this provision to those domains
in future versions of the GPL, as needed to protect the freedom of
users.

   Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

   The precise terms and conditions for copying, distribution and
modification follow.

TERMS AND CONDITIONS
====================

  0. Definitions.

     "This License" refers to version 3 of the GNU General Public
     License.

     "Copyright" also means copyright-like laws that apply to other
     kinds of works, such as semiconductor masks.

     "The Program" refers to any copyrightable work licensed under this
     License.  Each licensee is addressed as "you".  "Licensees" and
     "recipients" may be individuals or organizations.

     To "modify" a work means to copy from or adapt all or part of the
     work in a fashion requiring copyright permission, other than the
     making of an exact copy.  The resulting work is called a "modified
     version" of the earlier work or a work "based on" the earlier work.

     A "covered work" means either the unmodified Program or a work
     based on the Program.

     To "propagate" a work means to do anything with it that, without
     permission, would make you directly or secondarily liable for
     infringement under applicable copyright law, except executing it
     on a computer or modifying a private copy.  Propagation includes
     copying, distribution (with or without modification), making
     available to the public, and in some countries other activities as
     well.

     To "convey" a work means any kind of propagation that enables other
     parties to make or receive copies.  Mere interaction with a user
     through a computer network, with no transfer of a copy, is not
     conveying.

     An interactive user interface displays "Appropriate Legal Notices"
     to the extent that it includes a convenient and prominently visible
     feature that (1) displays an appropriate copyright notice, and (2)
     tells the user that there is no warranty for the work (except to
     the extent that warranties are provided), that licensees may
     convey the work under this License, and how to view a copy of this
     License.  If the interface presents a list of user commands or
     options, such as a menu, a prominent item in the list meets this
     criterion.

  1. Source Code.

     The "source code" for a work means the preferred form of the work
     for making modifications to it.  "Object code" means any
     non-source form of a work.

     A "Standard Interface" means an interface that either is an
     official standard defined by a recognized standards body, or, in
     the case of interfaces specified for a particular programming
     language, one that is widely used among developers working in that
     language.

     The "System Libraries" of an executable work include anything,
     other than the work as a whole, that (a) is included in the normal
     form of packaging a Major Component, but which is not part of that
     Major Component, and (b) serves only to enable use of the work
     with that Major Component, or to implement a Standard Interface
     for which an implementation is available to the public in source
     code form.  A "Major Component", in this context, means a major
     essential component (kernel, window system, and so on) of the
     specific operating system (if any) on which the executable work
     runs, or a compiler used to produce the work, or an object code
     interpreter used to run it.

     The "Corresponding Source" for a work in object code form means all
     the source code needed to generate, install, and (for an executable
     work) run the object code and to modify the work, including
     scripts to control those activities.  However, it does not include
     the work's System Libraries, or general-purpose tools or generally
     available free programs which are used unmodified in performing
     those activities but which are not part of the work.  For example,
     Corresponding Source includes interface definition files
     associated with source files for the work, and the source code for
     shared libraries and dynamically linked subprograms that the work
     is specifically designed to require, such as by intimate data
     communication or control flow between those subprograms and other
     parts of the work.

     The Corresponding Source need not include anything that users can
     regenerate automatically from other parts of the Corresponding
     Source.

     The Corresponding Source for a work in source code form is that
     same work.

  2. Basic Permissions.

     All rights granted under this License are granted for the term of
     copyright on the Program, and are irrevocable provided the stated
     conditions are met.  This License explicitly affirms your unlimited
     permission to run the unmodified Program.  The output from running
     a covered work is covered by this License only if the output,
     given its content, constitutes a covered work.  This License
     acknowledges your rights of fair use or other equivalent, as
     provided by copyright law.

     You may make, run and propagate covered works that you do not
     convey, without conditions so long as your license otherwise
     remains in force.  You may convey covered works to others for the
     sole purpose of having them make modifications exclusively for
     you, or provide you with facilities for running those works,
     provided that you comply with the terms of this License in
     conveying all material for which you do not control copyright.
     Those thus making or running the covered works for you must do so
     exclusively on your behalf, under your direction and control, on
     terms that prohibit them from making any copies of your
     copyrighted material outside their relationship with you.

     Conveying under any other circumstances is permitted solely under
     the conditions stated below.  Sublicensing is not allowed; section
     10 makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

     No covered work shall be deemed part of an effective technological
     measure under any applicable law fulfilling obligations under
     article 11 of the WIPO copyright treaty adopted on 20 December
     1996, or similar laws prohibiting or restricting circumvention of
     such measures.

     When you convey a covered work, you waive any legal power to forbid
     circumvention of technological measures to the extent such
     circumvention is effected by exercising rights under this License
     with respect to the covered work, and you disclaim any intention
     to limit operation or modification of the work as a means of
     enforcing, against the work's users, your or third parties' legal
     rights to forbid circumvention of technological measures.

  4. Conveying Verbatim Copies.

     You may convey verbatim copies of the Program's source code as you
     receive it, in any medium, provided that you conspicuously and
     appropriately publish on each copy an appropriate copyright notice;
     keep intact all notices stating that this License and any
     non-permissive terms added in accord with section 7 apply to the
     code; keep intact all notices of the absence of any warranty; and
     give all recipients a copy of this License along with the Program.

     You may charge any price or no price for each copy that you convey,
     and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

     You may convey a work based on the Program, or the modifications to
     produce it from the Program, in the form of source code under the
     terms of section 4, provided that you also meet all of these
     conditions:

       a. The work must carry prominent notices stating that you
          modified it, and giving a relevant date.

       b. The work must carry prominent notices stating that it is
          released under this License and any conditions added under
          section 7.  This requirement modifies the requirement in
          section 4 to "keep intact all notices".

       c. You must license the entire work, as a whole, under this
          License to anyone who comes into possession of a copy.  This
          License will therefore apply, along with any applicable
          section 7 additional terms, to the whole of the work, and all
          its parts, regardless of how they are packaged.  This License
          gives no permission to license the work in any other way, but
          it does not invalidate such permission if you have separately
          received it.

       d. If the work has interactive user interfaces, each must display
          Appropriate Legal Notices; however, if the Program has
          interactive interfaces that do not display Appropriate Legal
          Notices, your work need not make them do so.

     A compilation of a covered work with other separate and independent
     works, which are not by their nature extensions of the covered
     work, and which are not combined with it such as to form a larger
     program, in or on a volume of a storage or distribution medium, is
     called an "aggregate" if the compilation and its resulting
     copyright are not used to limit the access or legal rights of the
     compilation's users beyond what the individual works permit.
     Inclusion of a covered work in an aggregate does not cause this
     License to apply to the other parts of the aggregate.

  6. Conveying Non-Source Forms.

     You may convey a covered work in object code form under the terms
     of sections 4 and 5, provided that you also convey the
     machine-readable Corresponding Source under the terms of this
     License, in one of these ways:

       a. Convey the object code in, or embodied in, a physical product
          (including a physical distribution medium), accompanied by the
          Corresponding Source fixed on a durable physical medium
          customarily used for software interchange.

       b. Convey the object code in, or embodied in, a physical product
          (including a physical distribution medium), accompanied by a
          written offer, valid for at least three years and valid for
          as long as you offer spare parts or customer support for that
          product model, to give anyone who possesses the object code
          either (1) a copy of the Corresponding Source for all the
          software in the product that is covered by this License, on a
          durable physical medium customarily used for software
          interchange, for a price no more than your reasonable cost of
          physically performing this conveying of source, or (2) access
          to copy the Corresponding Source from a network server at no
          charge.

       c. Convey individual copies of the object code with a copy of
          the written offer to provide the Corresponding Source.  This
          alternative is allowed only occasionally and noncommercially,
          and only if you received the object code with such an offer,
          in accord with subsection 6b.

       d. Convey the object code by offering access from a designated
          place (gratis or for a charge), and offer equivalent access
          to the Corresponding Source in the same way through the same
          place at no further charge.  You need not require recipients
          to copy the Corresponding Source along with the object code.
          If the place to copy the object code is a network server, the
          Corresponding Source may be on a different server (operated
          by you or a third party) that supports equivalent copying
          facilities, provided you maintain clear directions next to
          the object code saying where to find the Corresponding Source.
          Regardless of what server hosts the Corresponding Source, you
          remain obligated to ensure that it is available for as long
          as needed to satisfy these requirements.

       e. Convey the object code using peer-to-peer transmission,
          provided you inform other peers where the object code and
          Corresponding Source of the work are being offered to the
          general public at no charge under subsection 6d.


     A separable portion of the object code, whose source code is
     excluded from the Corresponding Source as a System Library, need
     not be included in conveying the object code work.

     A "User Product" is either (1) a "consumer product", which means
     any tangible personal property which is normally used for personal,
     family, or household purposes, or (2) anything designed or sold for
     incorporation into a dwelling.  In determining whether a product
     is a consumer product, doubtful cases shall be resolved in favor of
     coverage.  For a particular product received by a particular user,
     "normally used" refers to a typical or common use of that class of
     product, regardless of the status of the particular user or of the
     way in which the particular user actually uses, or expects or is
     expected to use, the product.  A product is a consumer product
     regardless of whether the product has substantial commercial,
     industrial or non-consumer uses, unless such uses represent the
     only significant mode of use of the product.

     "Installation Information" for a User Product means any methods,
     procedures, authorization keys, or other information required to
     install and execute modified versions of a covered work in that
     User Product from a modified version of its Corresponding Source.
     The information must suffice to ensure that the continued
     functioning of the modified object code is in no case prevented or
     interfered with solely because modification has been made.

     If you convey an object code work under this section in, or with,
     or specifically for use in, a User Product, and the conveying
     occurs as part of a transaction in which the right of possession
     and use of the User Product is transferred to the recipient in
     perpetuity or for a fixed term (regardless of how the transaction
     is characterized), the Corresponding Source conveyed under this
     section must be accompanied by the Installation Information.  But
     this requirement does not apply if neither you nor any third party
     retains the ability to install modified object code on the User
     Product (for example, the work has been installed in ROM).

     The requirement to provide Installation Information does not
     include a requirement to continue to provide support service,
     warranty, or updates for a work that has been modified or
     installed by the recipient, or for the User Product in which it
     has been modified or installed.  Access to a network may be denied
     when the modification itself materially and adversely affects the
     operation of the network or violates the rules and protocols for
     communication across the network.

     Corresponding Source conveyed, and Installation Information
     provided, in accord with this section must be in a format that is
     publicly documented (and with an implementation available to the
     public in source code form), and must require no special password
     or key for unpacking, reading or copying.

  7. Additional Terms.

     "Additional permissions" are terms that supplement the terms of
     this License by making exceptions from one or more of its
     conditions.  Additional permissions that are applicable to the
     entire Program shall be treated as though they were included in
     this License, to the extent that they are valid under applicable
     law.  If additional permissions apply only to part of the Program,
     that part may be used separately under those permissions, but the
     entire Program remains governed by this License without regard to
     the additional permissions.

     When you convey a copy of a covered work, you may at your option
     remove any additional permissions from that copy, or from any part
     of it.  (Additional permissions may be written to require their own
     removal in certain cases when you modify the work.)  You may place
     additional permissions on material, added by you to a covered work,
     for which you have or can give appropriate copyright permission.

     Notwithstanding any other provision of this License, for material
     you add to a covered work, you may (if authorized by the copyright
     holders of that material) supplement the terms of this License
     with terms:

       a. Disclaiming warranty or limiting liability differently from
          the terms of sections 15 and 16 of this License; or

       b. Requiring preservation of specified reasonable legal notices
          or author attributions in that material or in the Appropriate
          Legal Notices displayed by works containing it; or

       c. Prohibiting misrepresentation of the origin of that material,
          or requiring that modified versions of such material be
          marked in reasonable ways as different from the original
          version; or

       d. Limiting the use for publicity purposes of names of licensors
          or authors of the material; or

       e. Declining to grant rights under trademark law for use of some
          trade names, trademarks, or service marks; or

       f. Requiring indemnification of licensors and authors of that
          material by anyone who conveys the material (or modified
          versions of it) with contractual assumptions of liability to
          the recipient, for any liability that these contractual
          assumptions directly impose on those licensors and authors.

     All other non-permissive additional terms are considered "further
     restrictions" within the meaning of section 10.  If the Program as
     you received it, or any part of it, contains a notice stating that
     it is governed by this License along with a term that is a further
     restriction, you may remove that term.  If a license document
     contains a further restriction but permits relicensing or
     conveying under this License, you may add to a covered work
     material governed by the terms of that license document, provided
     that the further restriction does not survive such relicensing or
     conveying.

     If you add terms to a covered work in accord with this section, you
     must place, in the relevant source files, a statement of the
     additional terms that apply to those files, or a notice indicating
     where to find the applicable terms.

     Additional terms, permissive or non-permissive, may be stated in
     the form of a separately written license, or stated as exceptions;
     the above requirements apply either way.

  8. Termination.

     You may not propagate or modify a covered work except as expressly
     provided under this License.  Any attempt otherwise to propagate or
     modify it is void, and will automatically terminate your rights
     under this License (including any patent licenses granted under
     the third paragraph of section 11).

     However, if you cease all violation of this License, then your
     license from a particular copyright holder is reinstated (a)
     provisionally, unless and until the copyright holder explicitly
     and finally terminates your license, and (b) permanently, if the
     copyright holder fails to notify you of the violation by some
     reasonable means prior to 60 days after the cessation.

     Moreover, your license from a particular copyright holder is
     reinstated permanently if the copyright holder notifies you of the
     violation by some reasonable means, this is the first time you have
     received notice of violation of this License (for any work) from
     that copyright holder, and you cure the violation prior to 30 days
     after your receipt of the notice.

     Termination of your rights under this section does not terminate
     the licenses of parties who have received copies or rights from
     you under this License.  If your rights have been terminated and
     not permanently reinstated, you do not qualify to receive new
     licenses for the same material under section 10.

  9. Acceptance Not Required for Having Copies.

     You are not required to accept this License in order to receive or
     run a copy of the Program.  Ancillary propagation of a covered work
     occurring solely as a consequence of using peer-to-peer
     transmission to receive a copy likewise does not require
     acceptance.  However, nothing other than this License grants you
     permission to propagate or modify any covered work.  These actions
     infringe copyright if you do not accept this License.  Therefore,
     by modifying or propagating a covered work, you indicate your
     acceptance of this License to do so.

 10. Automatic Licensing of Downstream Recipients.

     Each time you convey a covered work, the recipient automatically
     receives a license from the original licensors, to run, modify and
     propagate that work, subject to this License.  You are not
     responsible for enforcing compliance by third parties with this
     License.

     An "entity transaction" is a transaction transferring control of an
     organization, or substantially all assets of one, or subdividing an
     organization, or merging organizations.  If propagation of a
     covered work results from an entity transaction, each party to that
     transaction who receives a copy of the work also receives whatever
     licenses to the work the party's predecessor in interest had or
     could give under the previous paragraph, plus a right to
     possession of the Corresponding Source of the work from the
     predecessor in interest, if the predecessor has it or can get it
     with reasonable efforts.

     You may not impose any further restrictions on the exercise of the
     rights granted or affirmed under this License.  For example, you
     may not impose a license fee, royalty, or other charge for
     exercise of rights granted under this License, and you may not
     initiate litigation (including a cross-claim or counterclaim in a
     lawsuit) alleging that any patent claim is infringed by making,
     using, selling, offering for sale, or importing the Program or any
     portion of it.

 11. Patents.

     A "contributor" is a copyright holder who authorizes use under this
     License of the Program or a work on which the Program is based.
     The work thus licensed is called the contributor's "contributor
     version".

     A contributor's "essential patent claims" are all patent claims
     owned or controlled by the contributor, whether already acquired or
     hereafter acquired, that would be infringed by some manner,
     permitted by this License, of making, using, or selling its
     contributor version, but do not include claims that would be
     infringed only as a consequence of further modification of the
     contributor version.  For purposes of this definition, "control"
     includes the right to grant patent sublicenses in a manner
     consistent with the requirements of this License.

     Each contributor grants you a non-exclusive, worldwide,
     royalty-free patent license under the contributor's essential
     patent claims, to make, use, sell, offer for sale, import and
     otherwise run, modify and propagate the contents of its
     contributor version.

     In the following three paragraphs, a "patent license" is any
     express agreement or commitment, however denominated, not to
     enforce a patent (such as an express permission to practice a
     patent or covenant not to sue for patent infringement).  To
     "grant" such a patent license to a party means to make such an
     agreement or commitment not to enforce a patent against the party.

     If you convey a covered work, knowingly relying on a patent
     license, and the Corresponding Source of the work is not available
     for anyone to copy, free of charge and under the terms of this
     License, through a publicly available network server or other
     readily accessible means, then you must either (1) cause the
     Corresponding Source to be so available, or (2) arrange to deprive
     yourself of the benefit of the patent license for this particular
     work, or (3) arrange, in a manner consistent with the requirements
     of this License, to extend the patent license to downstream
     recipients.  "Knowingly relying" means you have actual knowledge
     that, but for the patent license, your conveying the covered work
     in a country, or your recipient's use of the covered work in a
     country, would infringe one or more identifiable patents in that
     country that you have reason to believe are valid.

     If, pursuant to or in connection with a single transaction or
     arrangement, you convey, or propagate by procuring conveyance of, a
     covered work, and grant a patent license to some of the parties
     receiving the covered work authorizing them to use, propagate,
     modify or convey a specific copy of the covered work, then the
     patent license you grant is automatically extended to all
     recipients of the covered work and works based on it.

     A patent license is "discriminatory" if it does not include within
     the scope of its coverage, prohibits the exercise of, or is
     conditioned on the non-exercise of one or more of the rights that
     are specifically granted under this License.  You may not convey a
     covered work if you are a party to an arrangement with a third
     party that is in the business of distributing software, under
     which you make payment to the third party based on the extent of
     your activity of conveying the work, and under which the third
     party grants, to any of the parties who would receive the covered
     work from you, a discriminatory patent license (a) in connection
     with copies of the covered work conveyed by you (or copies made
     from those copies), or (b) primarily for and in connection with
     specific products or compilations that contain the covered work,
     unless you entered into that arrangement, or that patent license
     was granted, prior to 28 March 2007.

     Nothing in this License shall be construed as excluding or limiting
     any implied license or other defenses to infringement that may
     otherwise be available to you under applicable patent law.

 12. No Surrender of Others' Freedom.

     If conditions are imposed on you (whether by court order,
     agreement or otherwise) that contradict the conditions of this
     License, they do not excuse you from the conditions of this
     License.  If you cannot convey a covered work so as to satisfy
     simultaneously your obligations under this License and any other
     pertinent obligations, then as a consequence you may not convey it
     at all.  For example, if you agree to terms that obligate you to
     collect a royalty for further conveying from those to whom you
     convey the Program, the only way you could satisfy both those
     terms and this License would be to refrain entirely from conveying
     the Program.

 13. Use with the GNU Affero General Public License.

     Notwithstanding any other provision of this License, you have
     permission to link or combine any covered work with a work licensed
     under version 3 of the GNU Affero General Public License into a
     single combined work, and to convey the resulting work.  The terms
     of this License will continue to apply to the part which is the
     covered work, but the special requirements of the GNU Affero
     General Public License, section 13, concerning interaction through
     a network will apply to the combination as such.

 14. Revised Versions of this License.

     The Free Software Foundation may publish revised and/or new
     versions of the GNU General Public License from time to time.
     Such new versions will be similar in spirit to the present
     version, but may differ in detail to address new problems or
     concerns.

     Each version is given a distinguishing version number.  If the
     Program specifies that a certain numbered version of the GNU
     General Public License "or any later version" applies to it, you
     have the option of following the terms and conditions either of
     that numbered version or of any later version published by the
     Free Software Foundation.  If the Program does not specify a
     version number of the GNU General Public License, you may choose
     any version ever published by the Free Software Foundation.

     If the Program specifies that a proxy can decide which future
     versions of the GNU General Public License can be used, that
     proxy's public statement of acceptance of a version permanently
     authorizes you to choose that version for the Program.

     Later license versions may give you additional or different
     permissions.  However, no additional obligations are imposed on any
     author or copyright holder as a result of your choosing to follow a
     later version.

 15. Disclaimer of Warranty.

     THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
     APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE
     COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS"
     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE
     RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.
     SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
     NECESSARY SERVICING, REPAIR OR CORRECTION.

 16. Limitation of Liability.

     IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
     WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES
     AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU
     FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
     CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
     THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
     BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
     PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
     PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
     THE POSSIBILITY OF SUCH DAMAGES.

 17. Interpretation of Sections 15 and 16.

     If the disclaimer of warranty and limitation of liability provided
     above cannot be given local legal effect according to their terms,
     reviewing courts shall apply local law that most closely
     approximates an absolute waiver of all civil liability in
     connection with the Program, unless a warranty or assumption of
     liability accompanies a copy of the Program in return for a fee.


END OF TERMS AND CONDITIONS
===========================

How to Apply These Terms to Your New Programs
=============================================

If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.

   To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.

     ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
     Copyright (C) YEAR NAME OF AUTHOR

     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation, either version 3 of the License, or (at
     your option) any later version.

     This program is distributed in the hope that it will be useful, but
     WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     General Public License for more details.

     You should have received a copy of the GNU General Public License
     along with this program.  If not, see `http://www.gnu.org/licenses/'.

   Also add information on how to contact you by electronic and paper
mail.

   If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

     PROGRAM Copyright (C) YEAR NAME OF AUTHOR
     This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
     This is free software, and you are welcome to redistribute it
     under certain conditions; type `show c' for details.

   The hypothetical commands `show w' and `show c' should show the
appropriate parts of the General Public License.  Of course, your
program's commands might be different; for a GUI interface, you would
use an "about box".

   You should also get your employer (if you work as a programmer) or
school, if any, to sign a "copyright disclaimer" for the program, if
necessary.  For more information on this, and how to apply and follow
the GNU GPL, see `http://www.gnu.org/licenses/'.

   The GNU General Public License does not permit incorporating your
program into proprietary programs.  If your program is a subroutine
library, you may consider it more useful to permit linking proprietary
applications with the library.  If this is what you want to do, use the
GNU Lesser General Public License instead of this License.  But first,
please read `http://www.gnu.org/philosophy/why-not-lgpl.html'.


File: emacs,  Node: GNU Free Documentation License,  Next: Emacs Invocation,  Prev: Copying,  Up: Top

Appendix B GNU Free Documentation License
*****************************************

                     Version 1.3, 3 November 2008

     Copyright (C) 2000, 2001, 2002, 2007, 2008, 2009 Free Software Foundation, Inc.
     `http://fsf.org/'

     Everyone is permitted to copy and distribute verbatim copies
     of this license document, but changing it is not allowed.

  0. PREAMBLE

     The purpose of this License is to make a manual, textbook, or other
     functional and useful document "free" in the sense of freedom: to
     assure everyone the effective freedom to copy and redistribute it,
     with or without modifying it, either commercially or
     noncommercially.  Secondarily, this License preserves for the
     author and publisher a way to get credit for their work, while not
     being considered responsible for modifications made by others.

     This License is a kind of "copyleft", which means that derivative
     works of the document must themselves be free in the same sense.
     It complements the GNU General Public License, which is a copyleft
     license designed for free software.

     We have designed this License in order to use it for manuals for
     free software, because free software needs free documentation: a
     free program should come with manuals providing the same freedoms
     that the software does.  But this License is not limited to
     software manuals; it can be used for any textual work, regardless
     of subject matter or whether it is published as a printed book.
     We recommend this License principally for works whose purpose is
     instruction or reference.

  1. APPLICABILITY AND DEFINITIONS

     This License applies to any manual or other work, in any medium,
     that contains a notice placed by the copyright holder saying it
     can be distributed under the terms of this License.  Such a notice
     grants a world-wide, royalty-free license, unlimited in duration,
     to use that work under the conditions stated herein.  The
     "Document", below, refers to any such manual or work.  Any member
     of the public is a licensee, and is addressed as "you".  You
     accept the license if you copy, modify or distribute the work in a
     way requiring permission under copyright law.

     A "Modified Version" of the Document means any work containing the
     Document or a portion of it, either copied verbatim, or with
     modifications and/or translated into another language.

     A "Secondary Section" is a named appendix or a front-matter section
     of the Document that deals exclusively with the relationship of the
     publishers or authors of the Document to the Document's overall
     subject (or to related matters) and contains nothing that could
     fall directly within that overall subject.  (Thus, if the Document
     is in part a textbook of mathematics, a Secondary Section may not
     explain any mathematics.)  The relationship could be a matter of
     historical connection with the subject or with related matters, or
     of legal, commercial, philosophical, ethical or political position
     regarding them.

     The "Invariant Sections" are certain Secondary Sections whose
     titles are designated, as being those of Invariant Sections, in
     the notice that says that the Document is released under this
     License.  If a section does not fit the above definition of
     Secondary then it is not allowed to be designated as Invariant.
     The Document may contain zero Invariant Sections.  If the Document
     does not identify any Invariant Sections then there are none.

     The "Cover Texts" are certain short passages of text that are
     listed, as Front-Cover Texts or Back-Cover Texts, in the notice
     that says that the Document is released under this License.  A
     Front-Cover Text may be at most 5 words, and a Back-Cover Text may
     be at most 25 words.

     A "Transparent" copy of the Document means a machine-readable copy,
     represented in a format whose specification is available to the
     general public, that is suitable for revising the document
     straightforwardly with generic text editors or (for images
     composed of pixels) generic paint programs or (for drawings) some
     widely available drawing editor, and that is suitable for input to
     text formatters or for automatic translation to a variety of
     formats suitable for input to text formatters.  A copy made in an
     otherwise Transparent file format whose markup, or absence of
     markup, has been arranged to thwart or discourage subsequent
     modification by readers is not Transparent.  An image format is
     not Transparent if used for any substantial amount of text.  A
     copy that is not "Transparent" is called "Opaque".

     Examples of suitable formats for Transparent copies include plain
     ASCII without markup, Texinfo input format, LaTeX input format,
     SGML or XML using a publicly available DTD, and
     standard-conforming simple HTML, PostScript or PDF designed for
     human modification.  Examples of transparent image formats include
     PNG, XCF and JPG.  Opaque formats include proprietary formats that
     can be read and edited only by proprietary word processors, SGML or
     XML for which the DTD and/or processing tools are not generally
     available, and the machine-generated HTML, PostScript or PDF
     produced by some word processors for output purposes only.

     The "Title Page" means, for a printed book, the title page itself,
     plus such following pages as are needed to hold, legibly, the
     material this License requires to appear in the title page.  For
     works in formats which do not have any title page as such, "Title
     Page" means the text near the most prominent appearance of the
     work's title, preceding the beginning of the body of the text.

     The "publisher" means any person or entity that distributes copies
     of the Document to the public.

     A section "Entitled XYZ" means a named subunit of the Document
     whose title either is precisely XYZ or contains XYZ in parentheses
     following text that translates XYZ in another language.  (Here XYZ
     stands for a specific section name mentioned below, such as
     "Acknowledgements", "Dedications", "Endorsements", or "History".)
     To "Preserve the Title" of such a section when you modify the
     Document means that it remains a section "Entitled XYZ" according
     to this definition.

     The Document may include Warranty Disclaimers next to the notice
     which states that this License applies to the Document.  These
     Warranty Disclaimers are considered to be included by reference in
     this License, but only as regards disclaiming warranties: any other
     implication that these Warranty Disclaimers may have is void and
     has no effect on the meaning of this License.

  2. VERBATIM COPYING

     You may copy and distribute the Document in any medium, either
     commercially or noncommercially, provided that this License, the
     copyright notices, and the license notice saying this License
     applies to the Document are reproduced in all copies, and that you
     add no other conditions whatsoever to those of this License.  You
     may not use technical measures to obstruct or control the reading
     or further copying of the copies you make or distribute.  However,
     you may accept compensation in exchange for copies.  If you
     distribute a large enough number of copies you must also follow
     the conditions in section 3.

     You may also lend copies, under the same conditions stated above,
     and you may publicly display copies.

  3. COPYING IN QUANTITY

     If you publish printed copies (or copies in media that commonly
     have printed covers) of the Document, numbering more than 100, and
     the Document's license notice requires Cover Texts, you must
     enclose the copies in covers that carry, clearly and legibly, all
     these Cover Texts: Front-Cover Texts on the front cover, and
     Back-Cover Texts on the back cover.  Both covers must also clearly
     and legibly identify you as the publisher of these copies.  The
     front cover must present the full title with all words of the
     title equally prominent and visible.  You may add other material
     on the covers in addition.  Copying with changes limited to the
     covers, as long as they preserve the title of the Document and
     satisfy these conditions, can be treated as verbatim copying in
     other respects.

     If the required texts for either cover are too voluminous to fit
     legibly, you should put the first ones listed (as many as fit
     reasonably) on the actual cover, and continue the rest onto
     adjacent pages.

     If you publish or distribute Opaque copies of the Document
     numbering more than 100, you must either include a
     machine-readable Transparent copy along with each Opaque copy, or
     state in or with each Opaque copy a computer-network location from
     which the general network-using public has access to download
     using public-standard network protocols a complete Transparent
     copy of the Document, free of added material.  If you use the
     latter option, you must take reasonably prudent steps, when you
     begin distribution of Opaque copies in quantity, to ensure that
     this Transparent copy will remain thus accessible at the stated
     location until at least one year after the last time you
     distribute an Opaque copy (directly or through your agents or
     retailers) of that edition to the public.

     It is requested, but not required, that you contact the authors of
     the Document well before redistributing any large number of
     copies, to give them a chance to provide you with an updated
     version of the Document.

  4. MODIFICATIONS

     You may copy and distribute a Modified Version of the Document
     under the conditions of sections 2 and 3 above, provided that you
     release the Modified Version under precisely this License, with
     the Modified Version filling the role of the Document, thus
     licensing distribution and modification of the Modified Version to
     whoever possesses a copy of it.  In addition, you must do these
     things in the Modified Version:

       A. Use in the Title Page (and on the covers, if any) a title
          distinct from that of the Document, and from those of
          previous versions (which should, if there were any, be listed
          in the History section of the Document).  You may use the
          same title as a previous version if the original publisher of
          that version gives permission.

       B. List on the Title Page, as authors, one or more persons or
          entities responsible for authorship of the modifications in
          the Modified Version, together with at least five of the
          principal authors of the Document (all of its principal
          authors, if it has fewer than five), unless they release you
          from this requirement.

       C. State on the Title page the name of the publisher of the
          Modified Version, as the publisher.

       D. Preserve all the copyright notices of the Document.

       E. Add an appropriate copyright notice for your modifications
          adjacent to the other copyright notices.

       F. Include, immediately after the copyright notices, a license
          notice giving the public permission to use the Modified
          Version under the terms of this License, in the form shown in
          the Addendum below.

       G. Preserve in that license notice the full lists of Invariant
          Sections and required Cover Texts given in the Document's
          license notice.

       H. Include an unaltered copy of this License.

       I. Preserve the section Entitled "History", Preserve its Title,
          and add to it an item stating at least the title, year, new
          authors, and publisher of the Modified Version as given on
          the Title Page.  If there is no section Entitled "History" in
          the Document, create one stating the title, year, authors,
          and publisher of the Document as given on its Title Page,
          then add an item describing the Modified Version as stated in
          the previous sentence.

       J. Preserve the network location, if any, given in the Document
          for public access to a Transparent copy of the Document, and
          likewise the network locations given in the Document for
          previous versions it was based on.  These may be placed in
          the "History" section.  You may omit a network location for a
          work that was published at least four years before the
          Document itself, or if the original publisher of the version
          it refers to gives permission.

       K. For any section Entitled "Acknowledgements" or "Dedications",
          Preserve the Title of the section, and preserve in the
          section all the substance and tone of each of the contributor
          acknowledgements and/or dedications given therein.

       L. Preserve all the Invariant Sections of the Document,
          unaltered in their text and in their titles.  Section numbers
          or the equivalent are not considered part of the section
          titles.

       M. Delete any section Entitled "Endorsements".  Such a section
          may not be included in the Modified Version.

       N. Do not retitle any existing section to be Entitled
          "Endorsements" or to conflict in title with any Invariant
          Section.

       O. Preserve any Warranty Disclaimers.

     If the Modified Version includes new front-matter sections or
     appendices that qualify as Secondary Sections and contain no
     material copied from the Document, you may at your option
     designate some or all of these sections as invariant.  To do this,
     add their titles to the list of Invariant Sections in the Modified
     Version's license notice.  These titles must be distinct from any
     other section titles.

     You may add a section Entitled "Endorsements", provided it contains
     nothing but endorsements of your Modified Version by various
     parties--for example, statements of peer review or that the text
     has been approved by an organization as the authoritative
     definition of a standard.

     You may add a passage of up to five words as a Front-Cover Text,
     and a passage of up to 25 words as a Back-Cover Text, to the end
     of the list of Cover Texts in the Modified Version.  Only one
     passage of Front-Cover Text and one of Back-Cover Text may be
     added by (or through arrangements made by) any one entity.  If the
     Document already includes a cover text for the same cover,
     previously added by you or by arrangement made by the same entity
     you are acting on behalf of, you may not add another; but you may
     replace the old one, on explicit permission from the previous
     publisher that added the old one.

     The author(s) and publisher(s) of the Document do not by this
     License give permission to use their names for publicity for or to
     assert or imply endorsement of any Modified Version.

  5. COMBINING DOCUMENTS

     You may combine the Document with other documents released under
     this License, under the terms defined in section 4 above for
     modified versions, provided that you include in the combination
     all of the Invariant Sections of all of the original documents,
     unmodified, and list them all as Invariant Sections of your
     combined work in its license notice, and that you preserve all
     their Warranty Disclaimers.

     The combined work need only contain one copy of this License, and
     multiple identical Invariant Sections may be replaced with a single
     copy.  If there are multiple Invariant Sections with the same name
     but different contents, make the title of each such section unique
     by adding at the end of it, in parentheses, the name of the
     original author or publisher of that section if known, or else a
     unique number.  Make the same adjustment to the section titles in
     the list of Invariant Sections in the license notice of the
     combined work.

     In the combination, you must combine any sections Entitled
     "History" in the various original documents, forming one section
     Entitled "History"; likewise combine any sections Entitled
     "Acknowledgements", and any sections Entitled "Dedications".  You
     must delete all sections Entitled "Endorsements."

  6. COLLECTIONS OF DOCUMENTS

     You may make a collection consisting of the Document and other
     documents released under this License, and replace the individual
     copies of this License in the various documents with a single copy
     that is included in the collection, provided that you follow the
     rules of this License for verbatim copying of each of the
     documents in all other respects.

     You may extract a single document from such a collection, and
     distribute it individually under this License, provided you insert
     a copy of this License into the extracted document, and follow
     this License in all other respects regarding verbatim copying of
     that document.

  7. AGGREGATION WITH INDEPENDENT WORKS

     A compilation of the Document or its derivatives with other
     separate and independent documents or works, in or on a volume of
     a storage or distribution medium, is called an "aggregate" if the
     copyright resulting from the compilation is not used to limit the
     legal rights of the compilation's users beyond what the individual
     works permit.  When the Document is included in an aggregate, this
     License does not apply to the other works in the aggregate which
     are not themselves derivative works of the Document.

     If the Cover Text requirement of section 3 is applicable to these
     copies of the Document, then if the Document is less than one half
     of the entire aggregate, the Document's Cover Texts may be placed
     on covers that bracket the Document within the aggregate, or the
     electronic equivalent of covers if the Document is in electronic
     form.  Otherwise they must appear on printed covers that bracket
     the whole aggregate.

  8. TRANSLATION

     Translation is considered a kind of modification, so you may
     distribute translations of the Document under the terms of section
     4.  Replacing Invariant Sections with translations requires special
     permission from their copyright holders, but you may include
     translations of some or all Invariant Sections in addition to the
     original versions of these Invariant Sections.  You may include a
     translation of this License, and all the license notices in the
     Document, and any Warranty Disclaimers, provided that you also
     include the original English version of this License and the
     original versions of those notices and disclaimers.  In case of a
     disagreement between the translation and the original version of
     this License or a notice or disclaimer, the original version will
     prevail.

     If a section in the Document is Entitled "Acknowledgements",
     "Dedications", or "History", the requirement (section 4) to
     Preserve its Title (section 1) will typically require changing the
     actual title.

  9. TERMINATION

     You may not copy, modify, sublicense, or distribute the Document
     except as expressly provided under this License.  Any attempt
     otherwise to copy, modify, sublicense, or distribute it is void,
     and will automatically terminate your rights under this License.

     However, if you cease all violation of this License, then your
     license from a particular copyright holder is reinstated (a)
     provisionally, unless and until the copyright holder explicitly
     and finally terminates your license, and (b) permanently, if the
     copyright holder fails to notify you of the violation by some
     reasonable means prior to 60 days after the cessation.

     Moreover, your license from a particular copyright holder is
     reinstated permanently if the copyright holder notifies you of the
     violation by some reasonable means, this is the first time you have
     received notice of violation of this License (for any work) from
     that copyright holder, and you cure the violation prior to 30 days
     after your receipt of the notice.

     Termination of your rights under this section does not terminate
     the licenses of parties who have received copies or rights from
     you under this License.  If your rights have been terminated and
     not permanently reinstated, receipt of a copy of some or all of
     the same material does not give you any rights to use it.

 10. FUTURE REVISIONS OF THIS LICENSE

     The Free Software Foundation may publish new, revised versions of
     the GNU Free Documentation License from time to time.  Such new
     versions will be similar in spirit to the present version, but may
     differ in detail to address new problems or concerns.  See
     `http://www.gnu.org/copyleft/'.

     Each version of the License is given a distinguishing version
     number.  If the Document specifies that a particular numbered
     version of this License "or any later version" applies to it, you
     have the option of following the terms and conditions either of
     that specified version or of any later version that has been
     published (not as a draft) by the Free Software Foundation.  If
     the Document does not specify a version number of this License,
     you may choose any version ever published (not as a draft) by the
     Free Software Foundation.  If the Document specifies that a proxy
     can decide which future versions of this License can be used, that
     proxy's public statement of acceptance of a version permanently
     authorizes you to choose that version for the Document.

 11. RELICENSING

     "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
     World Wide Web server that publishes copyrightable works and also
     provides prominent facilities for anybody to edit those works.  A
     public wiki that anybody can edit is an example of such a server.
     A "Massive Multiauthor Collaboration" (or "MMC") contained in the
     site means any set of copyrightable works thus published on the MMC
     site.

     "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
     license published by Creative Commons Corporation, a not-for-profit
     corporation with a principal place of business in San Francisco,
     California, as well as future copyleft versions of that license
     published by that same organization.

     "Incorporate" means to publish or republish a Document, in whole or
     in part, as part of another Document.

     An MMC is "eligible for relicensing" if it is licensed under this
     License, and if all works that were first published under this
     License somewhere other than this MMC, and subsequently
     incorporated in whole or in part into the MMC, (1) had no cover
     texts or invariant sections, and (2) were thus incorporated prior
     to November 1, 2008.

     The operator of an MMC Site may republish an MMC contained in the
     site under CC-BY-SA on the same site at any time before August 1,
     2009, provided the MMC is eligible for relicensing.


ADDENDUM: How to use this License for your documents
====================================================

To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and license
notices just after the title page:

       Copyright (C)  YEAR  YOUR NAME.
       Permission is granted to copy, distribute and/or modify this document
       under the terms of the GNU Free Documentation License, Version 1.3
       or any later version published by the Free Software Foundation;
       with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
       Texts.  A copy of the license is included in the section entitled ``GNU
       Free Documentation License''.

   If you have Invariant Sections, Front-Cover Texts and Back-Cover
Texts, replace the "with...Texts." line with this:

         with the Invariant Sections being LIST THEIR TITLES, with
         the Front-Cover Texts being LIST, and with the Back-Cover Texts
         being LIST.

   If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.

   If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License, to
permit their use in free software.


File: emacs,  Node: Emacs Invocation,  Next: X Resources,  Prev: GNU Free Documentation License,  Up: Top

Appendix C Command Line Arguments for Emacs Invocation
******************************************************

Emacs supports command line arguments to request various actions when
invoking Emacs.  These are for compatibility with other editors and for
sophisticated activities.  We don't recommend using them for ordinary
editing (*Note Emacs Server::, for a way to access an existing Emacs
job from the command line).

   Arguments starting with `-' are "options", and so is `+LINENUM'.
All other arguments specify files to visit.  Emacs visits the specified
files while it starts up.  The last file specified on the command line
becomes the current buffer; the other files are also visited in other
buffers.  As with most programs, the special argument `--' says that
all subsequent arguments are file names, not options, even if they
start with `-'.

   Emacs command options can specify many things, such as the size and
position of the X window Emacs uses, its colors, and so on.  A few
options support advanced usage, such as running Lisp functions on files
in batch mode.  The sections of this chapter describe the available
options, arranged according to their purpose.

   There are two ways of writing options: the short forms that start
with a single `-', and the long forms that start with `--'.  For
example, `-d' is a short form and `--display' is the corresponding long
form.

   The long forms with `--' are easier to remember, but longer to type.
However, you don't have to spell out the whole option name; any
unambiguous abbreviation is enough.  When a long option takes an
argument, you can use either a space or an equal sign to separate the
option name and the argument.  Thus, you can write either `--display
sugar-bombs:0.0' or `--display=sugar-bombs:0.0'.  We recommend an equal
sign because it makes the relationship clearer, and the tables below
always show an equal sign.

   Most options specify how to initialize Emacs, or set parameters for
the Emacs session.  We call them "initial options".  A few options
specify things to do, such as loading libraries or calling Lisp
functions.  These are called "action options".  These and file names
together are called "action arguments".  The action arguments are
stored as a list of strings in the variable `command-line-args'.
(Actually, when Emacs starts up, `command-line-args' contains all the
arguments passed from the command line; during initialization, the
initial arguments are removed from this list when they are processed,
leaving only the action arguments.)

* Menu:

* Action Arguments::    Arguments to visit files, load libraries,
                          and call functions.
* Initial Options::     Arguments that take effect while starting Emacs.
* Command Example::     Examples of using command line arguments.
* Resume Arguments::    Specifying arguments when you resume a running Emacs.
* Environment::         Environment variables that Emacs uses.
* Display X::           Changing the default display and using remote login.
* Font X::              Choosing a font for text, under X.
* Colors::              Choosing display colors.
* Window Size X::       Start-up window size, under X.
* Borders X::           Internal and external borders, under X.
* Title X::             Specifying the initial frame's title.
* Icons X::             Choosing what sort of icon to use, under X.
* Misc X::              Other display options.


File: emacs,  Node: Action Arguments,  Next: Initial Options,  Up: Emacs Invocation

C.1 Action Arguments
====================

Here is a table of action arguments:

`FILE'
`--file=FILE'
`--find-file=FILE'
`--visit=FILE'
     Visit FILE using `find-file'.  *Note Visiting::.

     When Emacs starts up, it displays the startup buffer in one window,
     and the buffer visiting FILE in another window (*note Windows::).
     If you supply more than one file argument, the displayed file is
     the last one specified on the command line; the other files are
     visited but their buffers are not shown.

     If the startup buffer is disabled (*note Entering Emacs::), then
     FILE is visited in a single window if one file argument was
     supplied; with two file arguments, Emacs displays the files in two
     different windows; with more than two file argument, Emacs displays
     the last file specified in one window, plus a Buffer Menu in a
     different window (*note Several Buffers::).  To inhibit using the
     Buffer Menu for this, change the variable
     `inhibit-startup-buffer-menu' to `t'.

`+LINENUM FILE'
     Visit FILE using `find-file', then go to line number LINENUM in it.

`+LINENUM:COLUMNNUM FILE'
     Visit FILE using `find-file', then go to line number LINENUM and
     put point at column number COLUMNNUM.

`-l FILE'
`--load=FILE'
     Load a Lisp library named FILE with the function `load'.  *Note
     Lisp Libraries::.  If FILE is not an absolute file name, the
     library can be found either in the current directory, or in the
     Emacs library search path as specified with `EMACSLOADPATH' (*note
     General Variables::).

     *Warning:* If previous command-line arguments have visited files,
     the current directory is the directory of the last file visited.

`-L DIR'
`--directory=DIR'
     Add directory DIR to the variable `load-path'.

`-f FUNCTION'
`--funcall=FUNCTION'
     Call Lisp function FUNCTION.  If it is an interactive function (a
     command), it reads the arguments interactively just as if you had
     called the same function with a key sequence.  Otherwise, it calls
     the function with no arguments.

`--eval=EXPRESSION'
`--execute=EXPRESSION'
     Evaluate Lisp expression EXPRESSION.

`--insert=FILE'
     Insert the contents of FILE into the `*scratch*' buffer (*note
     Lisp Interaction::).  This is like what `M-x insert-file' does
     (*note Misc File Ops::).

`--kill'
     Exit from Emacs without asking for confirmation.

`--help'
     Print a usage message listing all available options, then exit
     successfully.

`--version'
     Print Emacs version, then exit successfully.


File: emacs,  Node: Initial Options,  Next: Command Example,  Prev: Action Arguments,  Up: Emacs Invocation

C.2 Initial Options
===================

The initial options specify parameters for the Emacs session.  This
section describes the more general initial options; some other options
specifically related to the X Window System appear in the following
sections.

   Some initial options affect the loading of the initialization file.
The normal actions of Emacs are to first load `site-start.el' if it
exists, then your own initialization file `~/.emacs' if it exists, and
finally `default.el' if it exists.  *Note Init File::.  Certain options
prevent loading of some of these files or substitute other files for
them.

`-t DEVICE'
`--terminal=DEVICE'
     Use DEVICE as the device for terminal input and output.
     `--terminal' implies `--no-window-system'.

`-d DISPLAY'
`--display=DISPLAY'
     Use the X Window System and use the display named DISPLAY to open
     the initial Emacs frame.  *Note Display X::, for more details.

`-nw'
`--no-window-system'
     Don't communicate directly with the window system, disregarding the
     `DISPLAY' environment variable even if it is set.  This means that
     Emacs uses the terminal from which it was launched for all its
     display and input.

`-batch'
`--batch'
     Run Emacs in "batch mode".  Batch mode is used for running
     programs written in Emacs Lisp from shell scripts, makefiles, and
     so on.  To invoke a Lisp program, use the `-batch' option in
     conjunction with one or more of `-l', `-f' or `--eval' (*note
     Action Arguments::).  *Note Command Example::, for an example.

     In batch mode, Emacs does not display the text being edited, and
     the standard terminal interrupt characters such as `C-z' and `C-c'
     have their usual effect.  Emacs functions that normally print a
     message in the echo area will print to either the standard output
     stream (`stdout') or the standard error stream (`stderr') instead.
     (To be precise, functions like `prin1', `princ' and `print' print
     to `stdout', while `message' and `error' print to `stderr'.)
     Functions that normally read keyboard input from the minibuffer
     take their input from the terminal's standard input stream
     (`stdin') instead.

     `--batch' implies `-q' (do not load an initialization file), but
     `site-start.el' is loaded nonetheless.  It also causes Emacs to
     exit after processing all the command options.  In addition, it
     disables auto-saving except in buffers for which it has been
     explicitly requested.

`--script FILE'
     Run Emacs in batch mode, like `--batch', and then read and execute
     the Lisp code in FILE.

     The normal use of this option is in executable script files that
     run Emacs.  They can start with this text on the first line

          #!/usr/bin/emacs --script

     which will invoke Emacs with `--script' and supply the name of the
     script file as FILE.  Emacs Lisp then treats `#!'  as a comment
     delimiter.

`-q'
`--no-init-file'
     Do not load your Emacs initialization file, and do not load the
     file `default.el' either (*note Init File::).  Regardless of this
     switch, `site-start.el' is still loaded.  When Emacs is invoked
     like this, the Customize facility does not allow options to be
     saved (*note Easy Customization::).

`--no-site-file'
     Do not load `site-start.el'.  The options `-q', `-u' and `--batch'
     have no effect on the loading of this file--this option and `-Q'
     are the only options that block it.

`--no-splash'
     Do not display a startup screen.  You can also achieve this effect
     by setting the variable `inhibit-startup-screen' to non-`nil' in
     your initialization file (*note Entering Emacs::).

`-Q'
`--quick'
     Start emacs with minimum customizations, similar to using `-q',
     `--no-site-file', and `--no-splash' together.  This also stops
     Emacs from processing X resources by setting `inhibit-x-resources'
     to `t' (*note Resources::).

`-daemon'
`--daemon'
     Start Emacs as a daemon--after Emacs starts up, it starts the Emacs
     server and disconnects from the terminal without opening any
     frames.  You can then use the `emacsclient' command to connect to
     Emacs for editing.  *Note Emacs Server::, for information about
     using Emacs as a daemon.

`-daemon=SERVER-NAME'
     Start emacs in background as a daemon, and use SERVER-NAME as the
     server name.

`--no-desktop'
     Do not reload any saved desktop.  *Note Saving Emacs Sessions::.

`-u USER'
`--user=USER'
     Load USER's initialization file instead of your own(1).

`--debug-init'
     Enable the Emacs Lisp debugger for errors in the init file.  *Note
     Entering the Debugger on an Error: (elisp)Error Debugging.

   ---------- Footnotes ----------

   (1) This option has no effect on MS-Windows.


File: emacs,  Node: Command Example,  Next: Resume Arguments,  Prev: Initial Options,  Up: Emacs Invocation

C.3 Command Argument Example
============================

Here is an example of using Emacs with arguments and options.  It
assumes you have a Lisp program file called `hack-c.el' which, when
loaded, performs some useful operation on the current buffer, expected
to be a C program.

     emacs --batch foo.c -l hack-c -f save-buffer >& log

This says to visit `foo.c', load `hack-c.el' (which makes changes in
the visited file), save `foo.c' (note that `save-buffer' is the
function that `C-x C-s' is bound to), and then exit back to the shell
(because of `--batch').  `--batch' also guarantees there will be no
problem redirecting output to `log', because Emacs will not assume that
it has a display terminal to work with.


File: emacs,  Node: Resume Arguments,  Next: Environment,  Prev: Command Example,  Up: Emacs Invocation

C.4 Resuming Emacs with Arguments
=================================

You can specify action arguments for Emacs when you resume it after a
suspension.  To prepare for this, put the following code in your
`.emacs' file (*note Hooks::):

     (add-hook 'suspend-hook 'resume-suspend-hook)
     (add-hook 'suspend-resume-hook 'resume-process-args)

   As further preparation, you must execute the shell script
`emacs.csh' (if you use csh as your shell) or `emacs.bash' (if you use
bash as your shell).  These scripts define an alias named `edit', which
will resume Emacs giving it new command line arguments such as files to
visit.  The scripts are found in the `etc' subdirectory of the Emacs
distribution.

   Only action arguments work properly when you resume Emacs.  Initial
arguments are not recognized--it's too late to execute them anyway.

   Note that resuming Emacs (with or without arguments) must be done
from within the shell that is the parent of the Emacs job.  This is why
`edit' is an alias rather than a program or a shell script.  It is not
possible to implement a resumption command that could be run from other
subjobs of the shell; there is no way to define a command that could be
made the value of `EDITOR', for example.  Therefore, this feature does
not take the place of the Emacs Server feature (*note Emacs Server::).

   The aliases use the Emacs Server feature if you appear to have a
server Emacs running.  However, they cannot determine this with complete
accuracy.  They may think that a server is still running when in
actuality you have killed that Emacs, because the file `/tmp/esrv...'
still exists.  If this happens, find that file and delete it.


File: emacs,  Node: Environment,  Next: Display X,  Prev: Resume Arguments,  Up: Emacs Invocation

C.5 Environment Variables
=========================

The "environment" is a feature of the operating system; it consists of
a collection of variables with names and values.  Each variable is
called an "environment variable"; environment variable names are
case-sensitive, and it is conventional to use upper case letters only.
The values are all text strings.

   What makes the environment useful is that subprocesses inherit the
environment automatically from their parent process.  This means you
can set up an environment variable in your login shell, and all the
programs you run (including Emacs) will automatically see it.
Subprocesses of Emacs (such as shells, compilers, and version-control
software) inherit the environment from Emacs, too.

   Inside Emacs, the command `M-x getenv' gets the value of an
environment variable.  `M-x setenv' sets a variable in the Emacs
environment.  (Environment variable substitutions with `$' work in the
value just as in file names; see *note File Names with $::.)  The
variable `initial-environment' stores the initial environment inherited
by Emacs.

   The way to set environment variables outside of Emacs depends on the
operating system, and especially the shell that you are using.  For
example, here's how to set the environment variable `ORGANIZATION' to
`not very much' using Bash:

     export ORGANIZATION="not very much"

and here's how to do it in csh or tcsh:

     setenv ORGANIZATION "not very much"

   When Emacs is using the X Window System, various environment
variables that control X work for Emacs as well.  See the X
documentation for more information.

* Menu:

* General Variables::   Environment variables that all versions of Emacs use.
* Misc Variables::      Certain system-specific variables.
* MS-Windows Registry:: An alternative to the environment on MS-Windows.


File: emacs,  Node: General Variables,  Next: Misc Variables,  Up: Environment

C.5.1 General Variables
-----------------------

Here is an alphabetical list of environment variables that have special
meanings in Emacs.  Most of these variables are also used by some other
programs.  Emacs does not require any of these environment variables to
be set, but it uses their values if they are set.

`CDPATH'
     Used by the `cd' command to search for the directory you specify,
     when you specify a relative directory name.

`EMACSDATA'
     Directory for the architecture-independent files that come with
     Emacs.  This is used to initialize the Lisp variable
     `data-directory'.

`EMACSDOC'
     Directory for the documentation string file, which is used to
     initialize the Lisp variable `doc-directory'.

`EMACSLOADPATH'
     A colon-separated list of directories(1) to search for Emacs Lisp
     files--used to initialize `load-path'.

`EMACSPATH'
     A colon-separated list of directories to search for executable
     files--used to initialize `exec-path'.

`EMAIL'
     Your email address; used to initialize the Lisp variable
     `user-mail-address', which the Emacs mail interface puts into the
     `From' header of outgoing messages (*note Mail Headers::).

`ESHELL'
     Used for shell-mode to override the `SHELL' environment variable.

`HISTFILE'
     The name of the file that shell commands are saved in between
     logins.  This variable defaults to `~/.bash_history' if you use
     Bash, to `~/.sh_history' if you use ksh, and to `~/.history'
     otherwise.

`HOME'
     The location of your files in the directory tree; used for
     expansion of file names starting with a tilde (`~').  On MS-DOS,
     it defaults to the directory from which Emacs was started, with
     `/bin' removed from the end if it was present.  On Windows, the
     default value of `HOME' is the `Application Data' subdirectory of
     the user profile directory (normally, this is `C:/Documents and
     Settings/USERNAME/Application Data', where USERNAME is your user
     name), though for backwards compatibility `C:/' will be used
     instead if a `.emacs' file is found there.

`HOSTNAME'
     The name of the machine that Emacs is running on.

`INCPATH'
     A colon-separated list of directories.  Used by the `complete'
     package to search for files.

`INFOPATH'
     A colon-separated list of directories in which to search for Info
     files.

`LC_ALL'
`LC_COLLATE'
`LC_CTYPE'
`LC_MESSAGES'
`LC_MONETARY'
`LC_NUMERIC'
`LC_TIME'
`LANG'
     The user's preferred locale.  The locale has six categories,
     specified by the environment variables `LC_COLLATE' for sorting,
     `LC_CTYPE' for character encoding, `LC_MESSAGES' for system
     messages, `LC_MONETARY' for monetary formats, `LC_NUMERIC' for
     numbers, and `LC_TIME' for dates and times.  If one of these
     variables is not set, the category defaults to the value of the
     `LANG' environment variable, or to the default `C' locale if
     `LANG' is not set.  But if `LC_ALL' is specified, it overrides the
     settings of all the other locale environment variables.

     On MS-Windows, if `LANG' is not already set in the environment
     when Emacs starts, Emacs sets it based on the system-wide default
     language, which you can set in the `Regional Settings' Control
     Panel on some versions of MS-Windows.

     The value of the `LC_CTYPE' category is matched against entries in
     `locale-language-names', `locale-charset-language-names', and
     `locale-preferred-coding-systems', to select a default language
     environment and coding system.  *Note Language Environments::.

`LOGNAME'
     The user's login name.  See also `USER'.

`MAIL'
     The name of your system mail inbox.

`MH'
     Name of setup file for the mh system.  (The default is
     `~/.mh_profile'.)

`NAME'
     Your real-world name.

`NNTPSERVER'
     The name of the news server.  Used by the mh and Gnus packages.

`ORGANIZATION'
     The name of the organization to which you belong.  Used for
     setting the `Organization:' header in your posts from the Gnus
     package.

`PATH'
     A colon-separated list of directories in which executables reside.
     This is used to initialize the Emacs Lisp variable `exec-path'.

`PWD'
     If set, this should be the default directory when Emacs was
     started.

`REPLYTO'
     If set, this specifies an initial value for the variable
     `mail-default-reply-to'.  *Note Mail Headers::.

`SAVEDIR'
     The name of a directory in which news articles are saved by
     default.  Used by the Gnus package.

`SHELL'
     The name of an interpreter used to parse and execute programs run
     from inside Emacs.

`SMTPSERVER'
     The name of the outgoing mail server.  Used by the SMTP library
     (*note Top: (smtpmail)Top.).  

`TERM'
     The type of the terminal that Emacs is using.  This variable must
     be set unless Emacs is run in batch mode.  On MS-DOS, it defaults
     to `internal', which specifies a built-in terminal emulation that
     handles the machine's own display.  If the value of `TERM'
     indicates that Emacs runs in non-windowed mode from `xterm' or a
     similar terminal emulator, the background mode defaults to
     `light', and Emacs will choose colors that are appropriate for a
     light background.

`TERMCAP'
     The name of the termcap library file describing how to program the
     terminal specified by the `TERM' variable.  This defaults to
     `/etc/termcap'.

`TMPDIR'
     Used by the Emerge package as a prefix for temporary files.

`TZ'
     This specifies the current time zone and possibly also daylight
     saving time information.  On MS-DOS, if `TZ' is not set in the
     environment when Emacs starts, Emacs defines a default value as
     appropriate for the country code returned by DOS.  On MS-Windows,
     Emacs does not use `TZ' at all.

`USER'
     The user's login name.  See also `LOGNAME'.  On MS-DOS, this
     defaults to `root'.

`VERSION_CONTROL'
     Used to initialize the `version-control' variable (*note Backup
     Names::).

   ---------- Footnotes ----------

   (1) Here and below, whenever we say "colon-separated list of
directories," it pertains to Unix and GNU/Linux systems.  On MS-DOS and
MS-Windows, the directories are separated by semi-colons instead, since
DOS/Windows file names might include a colon after a drive letter.


File: emacs,  Node: Misc Variables,  Next: MS-Windows Registry,  Prev: General Variables,  Up: Environment

C.5.2 Miscellaneous Variables
-----------------------------

These variables are used only on particular configurations:

`COMSPEC'
     On MS-DOS and MS-Windows, the name of the command interpreter to
     use when invoking batch files and commands internal to the shell.
     On MS-DOS this is also used to make a default value for the
     `SHELL' environment variable.

`NAME'
     On MS-DOS, this variable defaults to the value of the `USER'
     variable.

`TEMP'
`TMP'
     On MS-DOS and MS-Windows, these specify the name of the directory
     for storing temporary files in.

`EMACSTEST'
     On MS-DOS, this specifies a file to use to log the operation of the
     internal terminal emulator.  This feature is useful for submitting
     bug reports.

`EMACSCOLORS'
     On MS-DOS, this specifies the screen colors.  It is useful to set
     them this way, since otherwise Emacs would display the default
     colors momentarily when it starts up.

     The value of this variable should be the two-character encoding of
     the foreground (the first character) and the background (the second
     character) colors of the default face.  Each character should be
     the hexadecimal code for the desired color on a standard PC
     text-mode display.  For example, to get blue text on a light gray
     background, specify `EMACSCOLORS=17', since 1 is the code of the
     blue color and 7 is the code of the light gray color.

     The PC display usually supports only eight background colors.
     However, Emacs switches the DOS display to a mode where all 16
     colors can be used for the background, so all four bits of the
     background color are actually used.

`PRELOAD_WINSOCK'
     On MS-Windows, if you set this variable, Emacs will load and
     initialize the network library at startup, instead of waiting
     until the first time it is required.

`emacs_dir'
     On MS-Windows, `emacs_dir' is a special environment variable, which
     indicates the full path of the directory in which Emacs is
     installed.  If Emacs is installed in the standard directory
     structure, it calculates this value automatically.  It is not much
     use setting this variable yourself unless your installation is
     non-standard, since unlike other environment variables, it will be
     overridden by Emacs at startup.  When setting other environment
     variables, such as `EMACSLOADPATH', you may find it useful to use
     `emacs_dir' rather than hard-coding an absolute path.  This allows
     multiple versions of Emacs to share the same environment variable
     settings, and it allows you to move the Emacs installation
     directory, without changing any environment or registry settings.


File: emacs,  Node: MS-Windows Registry,  Prev: Misc Variables,  Up: Environment

C.5.3 The MS-Windows System Registry
------------------------------------

Under MS-Windows, the installation program `addpm.exe' adds values for
`emacs_dir', `EMACSLOADPATH', `EMACSDATA', `EMACSPATH', `EMACSDOC',
`SHELL' and `TERM' to the `HKEY_LOCAL_MACHINE' section of the system
registry, under `/Software/GNU/Emacs'.  It does this because there is
no standard place to set environment variables across different
versions of Windows.  Running `addpm.exe' is no longer strictly
necessary in recent versions of Emacs, but if you are upgrading from an
older version, running `addpm.exe' ensures that you do not have older
registry entries from a previous installation, which may not be
compatible with the latest version of Emacs.

   When Emacs starts, as well as checking the environment, it also
checks the System Registry for those variables and for `HOME', `LANG'
and `PRELOAD_WINSOCK'.

   To determine the value of those variables, Emacs goes through the
following procedure.  First, the environment is checked.  If the
variable is not found there, Emacs looks for registry keys by that name
under `/Software/GNU/Emacs'; first in the `HKEY_CURRENT_USER' section
of the registry, and if not found there, in the `HKEY_LOCAL_MACHINE'
section.  Finally, if Emacs still cannot determine the values,
compiled-in defaults are used.

   In addition to the environment variables above, you can also add many
of the settings which on X belong in the `.Xdefaults' file (*note X
Resources::) to the `/Software/GNU/Emacs' registry key.  Settings you
add to the `HKEY_LOCAL_MACHINE' section will affect all users of the
machine.  Settings you add to the `HKEY_CURRENT_USER' section will only
affect you, and will override machine wide settings.


File: emacs,  Node: Display X,  Next: Font X,  Prev: Environment,  Up: Emacs Invocation

C.6 Specifying the Display Name
===============================

The environment variable `DISPLAY' tells all X clients, including
Emacs, where to display their windows.  Its value is set by default in
ordinary circumstances, when you start an X server and run jobs
locally.  Occasionally you may need to specify the display yourself; for
example, if you do a remote login and want to run a client program
remotely, displaying on your local screen.

   With Emacs, the main reason people change the default display is to
let them log into another system, run Emacs on that system, but have the
window displayed at their local terminal.  You might need to log in to
another system because the files you want to edit are there, or because
the Emacs executable file you want to run is there.

   `DISPLAY' has the syntax `HOST:DISPLAY.SCREEN', where HOST is the
host name of the X Window System server machine, DISPLAY is an
arbitrarily-assigned number that distinguishes your server (X terminal)
from other servers on the same machine, and SCREEN is a rarely-used
field that allows an X server to control multiple terminal screens.
The period and the SCREEN field are optional.  If included, SCREEN is
usually zero.

   For example, if your host is named `glasperle' and your server is
the first (or perhaps the only) server listed in the configuration, your
`DISPLAY' is `glasperle:0.0'.

   You can specify the display name explicitly when you run Emacs,
either by changing the `DISPLAY' variable, or with the option `-d
DISPLAY' or `--display=DISPLAY'.  Here is an example:

     emacs --display=glasperle:0 &

   You can inhibit the direct use of the window system and GUI with the
`-nw' option.  It tells Emacs to display using ordinary ASCII on its
controlling terminal.  This is also an initial option.

   Sometimes, security arrangements prevent a program on a remote system
from displaying on your local system.  In this case, trying to run Emacs
produces messages like this:

     Xlib:  connection to "glasperle:0.0" refused by server

You might be able to overcome this problem by using the `xhost' command
on the local system to give permission for access from your remote
machine.


File: emacs,  Node: Font X,  Next: Colors,  Prev: Display X,  Up: Emacs Invocation

C.7 Font Specification Options
==============================

You can use the command line option `-fn FONT' (or `--font', which is
an alias for `-fn') to specify a default font:

`-fn FONT'
`--font=FONT'
     Use FONT as the default font.

   When passing a font specification to Emacs on the command line, you
may need to "quote" it, by enclosing it in quotation marks, if it
contains characters that the shell treats specially (e.g. spaces).  For
example:

     emacs -fn "DejaVu Sans Mono-12"

   *Note Fonts::, for other ways to specify the default font and font
name formats.


File: emacs,  Node: Colors,  Next: Window Size X,  Prev: Font X,  Up: Emacs Invocation

C.8 Window Color Options
========================

On a color display, you can specify which color to use for various
parts of the Emacs display.  To find out what colors are available on
your system, type `M-x list-colors-display', or press `C-Mouse-2' and
select `Display Colors' from the pop-up menu.  (A particular window
system might support many more colors, but the list displayed by
`list-colors-display' shows their portable subset that can be safely
used on any display supported by Emacs.)  If you do not specify colors,
on windowed displays the default for the background is white and the
default for all other colors is black.  On a monochrome display, the
foreground is black, the background is white, and the border is gray if
the display supports that.  On terminals, the background is usually
black and the foreground is white.

   Here is a list of the command-line options for specifying colors:

`-fg COLOR'
`--foreground-color=COLOR'
     Specify the foreground color.  COLOR should be a standard color
     name, or a numeric specification of the color's red, green, and
     blue components as in `#4682B4' or `RGB:46/82/B4'.

`-bg COLOR'
`--background-color=COLOR'
     Specify the background color.

`-bd COLOR'
`--border-color=COLOR'
     Specify the color of the border of the X window.

`-cr COLOR'
`--cursor-color=COLOR'
     Specify the color of the Emacs cursor which indicates where point
     is.

`-ms COLOR'
`--mouse-color=COLOR'
     Specify the color for the mouse cursor when the mouse is in the
     Emacs window.

`-r'
`-rv'
`--reverse-video'
     Reverse video--swap the foreground and background colors.

`--color=MODE'
     For a character terminal only, specify the mode of color support.
     This option is intended for overriding the number of supported
     colors that the character terminal advertises in its `termcap' or
     `terminfo' database.  The parameter MODE can be one of the
     following:
    `never'
    `no'
          Don't use colors even if the terminal's capabilities specify
          color support.

    `default'
    `auto'
          Same as when `--color' is not used at all: Emacs detects at
          startup whether the terminal supports colors, and if it does,
          turns on colored display.

    `always'
    `yes'
    `ansi8'
          Turn on the color support unconditionally, and use color
          commands specified by the ANSI escape sequences for the 8
          standard colors.

    `NUM'
          Use color mode for NUM colors.  If NUM is -1, turn off color
          support (equivalent to `never'); if it is 0, use the default
          color support for this terminal (equivalent to `auto');
          otherwise use an appropriate standard mode for NUM colors.
          Depending on your terminal's capabilities, Emacs might be
          able to turn on a color mode for 8, 16, 88, or 256 as the
          value of NUM.  If there is no mode that supports NUM colors,
          Emacs acts as if NUM were 0, i.e. it uses the terminal's
          default color support mode.
     If MODE is omitted, it defaults to ANSI8.

   For example, to use a coral mouse cursor and a slate blue text
cursor, enter:

     emacs -ms coral -cr 'slate blue' &

   You can reverse the foreground and background colors through the
`-rv' option or with the X resource `reverseVideo'.

   The `-fg', `-bg', and `-rv' options function on text-only terminals
as well as on graphical displays.


File: emacs,  Node: Window Size X,  Next: Borders X,  Prev: Colors,  Up: Emacs Invocation

C.9 Options for Window Size and Position
========================================

Here is a list of the command-line options for specifying size and
position of the initial Emacs frame:

`-g WIDTHxHEIGHT[{+-}XOFFSET{+-}YOFFSET]]'
`--geometry=WIDTHxHEIGHT[{+-}XOFFSET{+-}YOFFSET]]'
     Specify the size WIDTH and HEIGHT (measured in character columns
     and lines), and positions XOFFSET and YOFFSET (measured in
     pixels).  The WIDTH and HEIGHT parameters apply to all frames,
     whereas XOFFSET and YOFFSET only to the initial frame.

`-fs'
`--fullscreen'
     Specify that width and height shall be the size of the screen.
     Normally no window manager decorations are shown.

`-mm'
`--maximized'
     Specify that the Emacs frame shall be maximized.  This normally
     means that the frame has window manager decorations.

`-fh'
`--fullheight'
     Specify that the height shall be the height of the screen.

`-fw'
`--fullwidth'
     Specify that the width shall be the width of the screen.

In the `--geometry' option, `{+-}' means either a plus  sign or a minus
sign.  A plus sign before XOFFSET means it is the distance from the
left side of the screen; a minus sign means it counts from the right
side.  A plus sign before YOFFSET means it is the distance from the top
of the screen, and a minus sign there indicates the distance from the
bottom.  The values XOFFSET and YOFFSET may themselves be positive or
negative, but that doesn't change their meaning, only their direction.

   Emacs uses the same units as `xterm' does to interpret the geometry.
The WIDTH and HEIGHT are measured in characters, so a large font
creates a larger frame than a small font.  (If you specify a
proportional font, Emacs uses its maximum bounds width as the width
unit.)  The XOFFSET and YOFFSET are measured in pixels.

   You do not have to specify all of the fields in the geometry
specification.  If you omit both XOFFSET and YOFFSET, the window
manager decides where to put the Emacs frame, possibly by letting you
place it with the mouse.  For example, `164x55' specifies a window 164
columns wide, enough for two ordinary width windows side by side, and
55 lines tall.

   The default frame width is 80 characters and the default height is
40 lines.  You can omit either the width or the height or both.  If you
start the geometry with an integer, Emacs interprets it as the width.
If you start with an `x' followed by an integer, Emacs interprets it as
the height.  Thus, `81' specifies just the width; `x45' specifies just
the height.

   If you start with `+' or `-', that introduces an offset, which means
both sizes are omitted.  Thus, `-3' specifies the XOFFSET only.  (If
you give just one offset, it is always XOFFSET.)  `+3-3' specifies both
the XOFFSET and the YOFFSET, placing the frame near the bottom left of
the screen.

   You can specify a default for any or all of the fields in your X
resource file (*note Resources::), and then override selected fields
with a `--geometry' option.

   Since the mode line and the echo area occupy the last 2 lines of the
frame, the height of the initial text window is 2 less than the height
specified in your geometry.  In non-X-toolkit versions of Emacs, the
menu bar also takes one line of the specified number.  But in the X
toolkit version, the menu bar is additional and does not count against
the specified height.  The tool bar, if present, is also additional.

   Enabling or disabling the menu bar or tool bar alters the amount of
space available for ordinary text.  Therefore, if Emacs starts up with
a tool bar (which is the default), and handles the geometry
specification assuming there is a tool bar, and then your
initialization file disables the tool bar, you will end up with a frame
geometry different from what you asked for.  To get the intended size
with no tool bar, use an X resource to specify "no tool bar" (*note
Table of Resources::); then Emacs will already know there's no tool bar
when it processes the specified geometry.

   When using one of `--fullscreen', `--maximized', `--fullwidth' or
`--fullheight' there may be some space around the frame anyway.  That
is because Emacs rounds the sizes so they are an even number of
character heights and widths.

   Some window managers have options that can make them ignore both
program-specified and user-specified positions.  If these are set,
Emacs fails to position the window correctly.


File: emacs,  Node: Borders X,  Next: Title X,  Prev: Window Size X,  Up: Emacs Invocation

C.10 Internal and External Borders
==================================

An Emacs frame has an internal border and an external border.  The
internal border is an extra strip of the background color around the
text portion of the frame.  Emacs itself draws the internal border.
The external border is added by the window manager outside the frame;
depending on the window manager you use, it may contain various boxes
you can click on to move or iconify the window.

`-ib WIDTH'
`--internal-border=WIDTH'
     Specify WIDTH as the width of the internal border (between the text
     and the main border), in pixels.

`-bw WIDTH'
`--border-width=WIDTH'
     Specify WIDTH as the width of the main border, in pixels.

   When you specify the size of the frame, that does not count the
borders.  The frame's position is measured from the outside edge of the
external border.

   Use the `-ib N' option to specify an internal border N pixels wide.
The default is 1.  Use `-bw N' to specify the width of the external
border (though the window manager may not pay attention to what you
specify).  The default width of the external border is 2.


File: emacs,  Node: Title X,  Next: Icons X,  Prev: Borders X,  Up: Emacs Invocation

C.11 Frame Titles
=================

An Emacs frame may or may not have a specified title.  The frame title,
if specified, appears in window decorations and icons as the name of
the frame.  If an Emacs frame has no specified title, the default title
has the form `INVOCATION-NAME@MACHINE' (if there is only one frame) or
the selected window's buffer name (if there is more than one frame).

   You can specify a title for the initial Emacs frame with a command
line option:

`-T TITLE'
`--title=TITLE'
     Specify TITLE as the title for the initial Emacs frame.

   The `--name' option (*note Resources::) also specifies the title for
the initial Emacs frame.


File: emacs,  Node: Icons X,  Next: Misc X,  Prev: Title X,  Up: Emacs Invocation

C.12 Icons
==========

`-iconic'
`--iconic'
     Start Emacs in an iconified ("minimized") state.

`-nbi'
`--no-bitmap-icon'
     Do not use a picture of a gnu as the Emacs icon.

   Most window managers allow you to "iconify" (or "minimize") an Emacs
frame, hiding it from sight.  Some window managers replace iconified
windows with tiny "icons", while others remove them entirely from
sight.  The `-iconic' option tells Emacs to begin running in an
iconified state, rather than showing a frame right away.  The text
frame doesn't appear until you deiconify (or "un-minimize") it.

   By default, Emacs uses an icon containing the Emacs logo.  On
desktop environments such as Gnome, this icon is also displayed on the
"taskbar".  The `-nbi' or `--no-bitmap-icon' option tells Emacs to let
the window manager choose what sort of icon to use--usually just a
small rectangle containing the frame's title.


File: emacs,  Node: Misc X,  Prev: Icons X,  Up: Emacs Invocation

C.13 Other Display Options
==========================

`-vb'
`--vertical-scroll-bars'
     Enable vertical scroll bars.

`-lsp PIXELS'
`--line-spacing=PIXELS'
     Specify PIXELS as additional space to put between lines, in pixels.

`-nbc'
`--no-blinking-cursor'
     Disable the blinking cursor on graphical displays.

`-D'
`--basic-display'
     Disable the menu-bar, the tool-bar, the scroll-bars, and tool tips,
     and turn off the blinking cursor.  This can be useful for making a
     test case that simplifies debugging of display problems.

   The `--xrm' option (*note Resources::) specifies additional X
resource values.


File: emacs,  Node: X Resources,  Next: Antinews,  Prev: Emacs Invocation,  Up: Top

Appendix D X Options and Resources
**********************************

You can customize some X-related aspects of Emacs behavior using X
resources, as is usual for programs that use X.  On MS-Windows, you can
customize some of the same aspects using the system registry.  *Note
MS-Windows Registry::.

   When Emacs is built using an "X toolkit", such as Lucid or LessTif,
you need to use X resources to customize the appearance of the widgets,
including the menu-bar, scroll-bar, and dialog boxes.  This is because
the libraries that implement these don't provide for customization
through Emacs.  GTK+ widgets use a separate system of "GTK resources",
which we will also describe.

* Menu:

* Resources::           Using X resources with Emacs (in general).
* Table of Resources::  Table of specific X resources that affect Emacs.
* Face Resources::      X resources for customizing faces.
* Lucid Resources::     X resources for Lucid menus.
* LessTif Resources::   X resources for LessTif and Motif menus.
* GTK resources::       Resources for GTK widgets.


File: emacs,  Node: Resources,  Next: Table of Resources,  Up: X Resources

D.1 X Resources
===============

Programs running under the X Window System organize their user options
under a hierarchy of classes and resources.  You can specify default
values for these options in your "X resource file", usually named
`~/.Xdefaults' or `~/.Xresources'.  Changes in this file do not take
effect immediately, because the X server stores its own list of
resources; to update it, use the command `xrdb'--for instance, `xrdb
~/.Xdefaults'.

   (MS-Windows systems do not support X resource files; on Windows,
Emacs looks for X resources in the Windows Registry, first under the
key `HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs' and then under the key
`HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs'.  The menu and scroll bars are
native widgets on MS-Windows, so they are only customizable via the
system-wide settings in the Display Control Panel.  You can also set
resources using the `-xrm' command line option, as explained below.)

   Each line in the X resource file specifies a value for one option or
for a collection of related options.  Each resource specification
consists of a "program name" and a "resource name".  Case distinctions
are significant in each of these names.  Here is an example:

     emacs.borderWidth: 2

   The program name is the name of the executable file to which the
resource applies.  For Emacs, this is normally `emacs'.  To specify a
definition that applies to all instances of Emacs, regardless of the
name of the Emacs executable, use `Emacs'.

   The resource name is the name of a program setting.  For instance,
Emacs recognizes a `borderWidth' resource that controls the width of
the external border for graphical frames.

   Resources are grouped into named classes.  For instance, the
`BorderWidth' class contains both the `borderWidth' resource (which we
just described), as well as the `internalBorder' resource, which
controls the width of the internal border for graphical frames.
Instead of using a resource name, you can use a class name to specify
the same value for all resources in that class.  Here's an example:

     emacs.BorderWidth: 2

   If you specify a value for a class, it becomes the default for all
resources in that class.  You can specify values for individual
resources as well; these override the class value, for those particular
resources.  The following example specifies 2 as the default width for
all borders, but overrides this value with 4 for the external border:

     emacs.BorderWidth: 2
     emacs.borderWidth: 4

   The order in which the lines appear in the file does not matter.
One way to experiment with the effect of different resource settings is
to use the `editres' program.  See the `editres' man page for more
details.

   Emacs does not process X resources at all if you set the variable
`inhibit-x-resources' to a non-`nil' value, or if you specify the `-Q'
(or `--quick') command-line argument (*note Initial Options::).  (The
`-Q' argument automatically sets `inhibit-x-resources' to `t'.)

   In addition, you can use the following command-line options to
override the X resources file:

`-name NAME'
`--name=NAME'
     This option sets the program name of the initial Emacs frame to
     NAME.  It also sets the title of the initial frame to NAME.  This
     option does not affect subsequent frames.

     If you don't specify this option, the default is to use the Emacs
     executable's name as the program name.

     For consistency, `-name' also specifies the name to use for other
     resource values that do not belong to any particular frame.

     The resources that name Emacs invocations also belong to a class,
     named `Emacs'.  If you write `Emacs' instead of `emacs', the
     resource applies to all frames in all Emacs jobs, regardless of
     frame titles and regardless of the name of the executable file.

`-xrm RESOURCE-VALUES'
`--xrm=RESOURCE-VALUES'
     This option specifies X resource values for the present Emacs job.

     RESOURCE-VALUES should have the same format that you would use
     inside a file of X resources.  To include multiple resource
     specifications in RESOURCE-VALUES, put a newline between them,
     just as you would in a file.  You can also use `#include
     "FILENAME"' to include a file full of resource specifications.
     Resource values specified with `-xrm' take precedence over all
     other resource specifications.


File: emacs,  Node: Table of Resources,  Next: Face Resources,  Prev: Resources,  Up: X Resources

D.2 Table of X Resources for Emacs
==================================

This table lists the resource names that designate options for Emacs,
not counting those for the appearance of the menu bar, each with the
class that it belongs to:

`background' (class `Background')
     Background color name.

`bitmapIcon' (class `BitmapIcon')
     Use a bitmap icon (a picture of a gnu) if `on', let the window
     manager choose an icon if `off'.

`borderColor' (class `BorderColor')
     Color name for the external border.

`borderWidth' (class `BorderWidth')
     Width in pixels of the external border.

`cursorColor' (class `Foreground')
     Color name for text cursor (point).

`cursorBlink' (class `CursorBlink')
     Specifies whether to make the cursor blink. The default is `on'.
     Use `off' or `false' to turn cursor blinking off.

`font' (class `Font')
     Font name for the `default' font.  *Note Fonts::.  You can also
     specify a fontset name (*note Fontsets::).

`fontBackend' (class `FontBackend')
     The backend(s) to use for drawing fonts; if multiple backends are
     specified, they must be comma-delimited and given in order of
     precedence.  On X, for instance, the value `x,xft' tells Emacs to
     draw fonts using the X core font driver, falling back on the Xft
     font driver if that fails.  Normally, you can leave this resource
     unset, in which case Emacs tries using all font backends available
     on your graphical device.

`foreground' (class `Foreground')
     Color name for text.

`geometry' (class `Geometry')
     Window size and position.  Be careful not to specify this resource
     as `emacs*geometry', because that may affect individual menus as
     well as the Emacs frame itself.

     If this resource specifies a position, that position applies only
     to the initial Emacs frame (or, in the case of a resource for a
     specific frame name, only that frame).  However, the size, if
     specified here, applies to all frames.

`fullscreen' (class `Fullscreen')
     The desired fullscreen size.  The value can be one of `fullboth',
     `maximized', `fullwidth' or `fullheight', which correspond to the
     command-line options `-fs', `-mm', `-fw', and `-fh' (*note Window
     Size X::).

     Note that this applies to the initial frame only.

`iconName' (class `Title')
     Name to display in the icon.

`internalBorder' (class `BorderWidth')
     Width in pixels of the internal border.

`lineSpacing' (class `LineSpacing')
     Additional space ("leading") between lines, in pixels.

`menuBar' (class `MenuBar')
     Give frames menu bars if `on'; don't have menu bars if `off'.
     *Note Lucid Resources::, and *note LessTif Resources::, for how to
     control the appearance of the menu bar if you have one.

`minibuffer' (class `Minibuffer')
     If `none', don't make a minibuffer in this frame.  It will use a
     separate minibuffer frame instead.

`paneFont' (class `Font')
     Font name for menu pane titles, in non-toolkit versions of Emacs.

`pointerColor' (class `Foreground')
     Color of the mouse cursor.

`privateColormap' (class `PrivateColormap')
     If `on', use a private color map, in the case where the "default
     visual" of class PseudoColor and Emacs is using it.

`reverseVideo' (class `ReverseVideo')
     Switch foreground and background default colors if `on', use
     colors as specified if `off'.

`screenGamma' (class `ScreenGamma')
     Gamma correction for colors, equivalent to the frame parameter
     `screen-gamma'.

`scrollBarWidth' (class `ScrollBarWidth')
     The scroll bar width in pixels, equivalent to the frame parameter
     `scroll-bar-width'.

`selectionFont' (class `SelectionFont')
     Font name for pop-up menu items, in non-toolkit versions of Emacs.
     (For toolkit versions, see *note Lucid Resources::, also see *note
     LessTif Resources::.)

`selectionTimeout' (class `SelectionTimeout')
     Number of milliseconds to wait for a selection reply.  If the
     selection owner doesn't reply in this time, we give up.  A value
     of 0 means wait as long as necessary.

`synchronous' (class `Synchronous')
     Run Emacs in synchronous mode if `on'.  Synchronous mode is useful
     for debugging X problems.

`title' (class `Title')
     Name to display in the title bar of the initial Emacs frame.

`toolBar' (class `ToolBar')
     Number of lines to reserve for the tool bar.  A zero value
     suppresses the tool bar.  For the Emacs tool bar (i.e. not Gtk+),
     if the value is non-zero and `auto-resize-tool-bars' is non-`nil',
     the tool bar's size will be changed automatically so that all tool
     bar items are visible.    If the value of `auto-resize-tool-bars'
     is `grow-only', the tool bar expands automatically, but does not
     contract automatically.  To contract the tool bar, you must redraw
     the frame by entering `C-l'.  For the Gtk+ tool bar, any non-zero
     value means on and `auto-resize-tool-bars' has no effect.

`useXIM' (class `UseXIM')
     Turn off use of X input methods (XIM) if `false' or `off'.  This
     is only relevant if your Emacs is actually built with XIM support.
     It is potentially useful to turn off XIM for efficiency,
     especially slow X client/server links.

`verticalScrollBars' (class `ScrollBars')
     Give frames scroll bars if `on'; don't have scroll bars if `off'.

`visualClass' (class `VisualClass')
     Specify the "visual" that X should use.  This tells X how to handle
     colors.

     The value should start with one of `TrueColor', `PseudoColor',
     `DirectColor', `StaticColor', `GrayScale', and `StaticGray',
     followed by `-DEPTH', where DEPTH is the number of color planes.
     Most terminals only allow a few "visuals," and the `dpyinfo'
     program outputs information saying which ones.


File: emacs,  Node: Face Resources,  Next: Lucid Resources,  Prev: Table of Resources,  Up: X Resources

D.3 X Resources for Faces
=========================

You can use resources to customize the appearance of particular faces
(*note Faces::):

`FACE.attributeForeground'
     Foreground color for face FACE.

`FACE.attributeBackground'
     Background color for face FACE.

`FACE.attributeUnderline'
     Underline flag for face FACE.  Use `on' or `true' for yes.

`FACE.attributeStrikeThrough'
`FACE.attributeOverline'
`FACE.attributeBox'
`FACE.attributeInverse'
     Likewise, for other boolean font attributes.

`FACE.attributeStipple'
     The name of a pixmap data file to use for the stipple pattern, or
     `false' to not use stipple for the face FACE.

`FACE.attributeBackgroundPixmap'
     The background pixmap for the face FACE.  Should be a name of a
     pixmap file or `false'.

`FACE.attributeFont'
     Font name (full XFD name or valid X abbreviation) for face FACE.
     Instead of this, you can specify the font through separate
     attributes.

   Instead of using `attributeFont' to specify a font name, you can
select a font through these separate attributes:

`FACE.attributeFamily'
     Font family for face FACE.

`FACE.attributeHeight'
     Height of the font to use for face FACE: either an integer
     specifying the height in units of 1/10pt, or a floating point
     number that specifies a scale factor to scale the underlying face's
     default font, or a function to be called with the default height
     which will return a new height.

`FACE.attributeWidth'
`FACE.attributeWeight'
`FACE.attributeSlant'
     Each of these resources corresponds to a like-named font attribute,
     and you write the resource value the same as the symbol you would
     use for the font attribute value.

`FACE.attributeBold'
     Bold flag for face FACE--instead of `attributeWeight'.  Use `on'
     or `true' for yes.

`FACE.attributeItalic'
     Italic flag for face FACE--instead of `attributeSlant'.


File: emacs,  Node: Lucid Resources,  Next: LessTif Resources,  Prev: Face Resources,  Up: X Resources

D.4 Lucid Menu X Resources
==========================

If the Emacs installed at your site was built to use the X toolkit with
the Lucid menu widgets, then the menu bar is a separate widget and has
its own resources.  The resource names contain `pane.menubar'
(following, as always, the name of the Emacs invocation, or `Emacs',
which stands for all Emacs invocations).  Specify them like this:

     Emacs.pane.menubar.RESOURCE:  VALUE

For example, to specify the font `8x16' for the menu-bar items, write
this:

     Emacs.pane.menubar.font:  8x16

Resources for _non-menubar_ toolkit pop-up menus have `menu*' instead
of `pane.menubar'.  For example, to specify the font `8x16' for the
pop-up menu items, write this:

     Emacs.menu*.font:  8x16

For dialog boxes, use `dialog*':

     Emacs.dialog*.font:  8x16

The Lucid menus can display multilingual text in your locale.  For more
information about fontsets see the man page for `XCreateFontSet'.  To
enable multilingual menu text you specify a `fontSet' resource instead
of the font resource.  If both `font' and `fontSet' resources are
specified, the `fontSet' resource is used.

   Here is a list of the specific resources for menu bars and pop-up
menus:

`font'
     Font for menu item text.

`fontSet'
     Fontset for menu item text.

`foreground'
     Color of the foreground.

`background'
     Color of the background.

`buttonForeground'
     In the menu bar, the color of the foreground for a selected item.

`horizontalSpacing'
     Horizontal spacing in pixels between items.  Default is 3.

`verticalSpacing'
     Vertical spacing in pixels between items.  Default is 2.

`arrowSpacing'
     Horizontal spacing between the arrow (which indicates a submenu)
     and the associated text.  Default is 10.

`shadowThickness'
     Thickness of shadow line around the widget.  Default is 1.

     Also determines the thickness of shadow lines around other objects,
     for instance 3D buttons and arrows.  If you have the impression
     that the arrows in the menus do not stand out clearly enough or
     that the difference between "in" and "out" buttons is difficult to
     see, set this to 2.  If you have no problems with visibility, the
     default probably looks better.  The background color may also have
     some effect on the contrast.

`margin'
     The margin of the menu bar, in characters.  Default is 1.


File: emacs,  Node: LessTif Resources,  Next: GTK resources,  Prev: Lucid Resources,  Up: X Resources

D.5 LessTif Menu X Resources
============================

If the Emacs installed at your site was built to use the X toolkit with
the LessTif or Motif widgets, then the menu bar, the dialog boxes, the
pop-up menus, and the file-selection box are separate widgets and have
their own resources.

   The resource names for the menu bar contain `pane.menubar'
(following, as always, the name of the Emacs invocation, or `Emacs',
which stands for all Emacs invocations).  Specify them like this:

     Emacs.pane.menubar.SUBWIDGET.RESOURCE:  VALUE

   Each individual string in the menu bar is a subwidget; the
subwidget's name is the same as the menu item string.  For example, the
word `File' in the menu bar is part of a subwidget named
`emacs.pane.menubar.File'.  Most likely, you want to specify the same
resources for the whole menu bar.  To do this, use `*' instead of a
specific subwidget name.  For example, to specify the font `8x16' for
the menu-bar items, write this:

     Emacs.pane.menubar.*.fontList:  8x16

This also specifies the resource value for submenus.

   Each item in a submenu in the menu bar also has its own name for X
resources; for example, the `File' submenu has an item named `Save
(current buffer)'.  A resource specification for a submenu item looks
like this:

     Emacs.pane.menubar.popup_*.MENU.ITEM.RESOURCE: VALUE

For example, here's how to specify the font for the `Save (current
buffer)' item:

     Emacs.pane.menubar.popup_*.File.Save (current buffer).fontList: 8x16

For an item in a second-level submenu, such as `Complete Word' under
`Spell Checking' under `Tools', the resource fits this template:

     Emacs.pane.menubar.popup_*.popup_*.MENU.RESOURCE: VALUE

For example,

     Emacs.pane.menubar.popup_*.popup_*.Spell Checking.Complete Word: VALUE

(This should be one long line.)

   It's impossible to specify a resource for all the menu-bar items
without also specifying it for the submenus as well.  So if you want the
submenu items to look different from the menu bar itself, you must ask
for that in two steps.  First, specify the resource for all of them;
then, override the value for submenus alone.  Here is an example:

     Emacs.pane.menubar.*.fontList:  8x16
     Emacs.pane.menubar.popup_*.fontList: 8x16

For LessTif pop-up menus, use `menu*' instead of `pane.menubar'.  For
example, to specify the font `8x16' for the pop-up menu items, write
this:

     Emacs.menu*.fontList:  8x16

For LessTif dialog boxes, use `dialog' instead of `menu':

     Emacs.dialog*.fontList: 8x16
     Emacs.dialog*.foreground: hotpink

   To specify resources for the LessTif file-selection box, use `fsb*',
like this:

     Emacs.fsb*.fontList: 8x16

   Here is a list of the specific resources for LessTif menu bars and
pop-up menus:

`armColor'
     The color to show in an armed button.

`fontList'
     The font to use.

`marginBottom'
`marginHeight'
`marginLeft'
`marginRight'
`marginTop'
`marginWidth'
     Amount of space to leave around the item, within the border.

`borderWidth'
     The width of the border around the menu item, on all sides.

`shadowThickness'
     The width of the border shadow.

`bottomShadowColor'
     The color for the border shadow, on the bottom and the right.

`topShadowColor'
     The color for the border shadow, on the top and the left.


File: emacs,  Node: GTK resources,  Prev: LessTif Resources,  Up: X Resources

D.6 GTK resources
=================

If Emacs was built to use the GTK widget set, then the menu bar, tool
bar, scroll bar and the dialogs are customized with the standard GTK
customization file, `~/.gtkrc-2.0', or with the Emacs specific file
`~/.emacs.d/gtkrc'.  We recommend that you use `~/.emacs.d/gtkrc' for
customizations, since `~/.gtkrc-2.0' seems to be ignored when running
GConf with GNOME.  These files apply only to GTK widget features.  To
customize Emacs font, background, faces, etc., use the normal X
resources (*note Resources::).

   Some GTK themes override these mechanisms, which means that using
these mechanisms will not work to customize them.

   In these files you first define a style and say what it means; then
you specify to apply the style to various widget types (*note GTK
widget names::).  Here is an example of how to change the font for
Emacs menus:

     # Define the style `menufont'.
     style "menufont"
     {
       font_name = "helvetica bold 14"  # This is a Pango font name
     }

     # Specify that widget type `*emacs-menuitem*' uses `menufont'.
     widget "*emacs-menuitem*" style "menufont"

   Here is a more elaborate example, showing how to change the parts of
the scroll bar:

     style "scroll"
     {
       fg[NORMAL] = "red"     # The arrow color.
       bg[NORMAL] = "yellow"  # The thumb and background around the arrow.
       bg[ACTIVE] = "blue"    # The trough color.
       bg[PRELIGHT] = "white" # The thumb color when the mouse is over it.
     }

     widget "*verticalScrollBar*" style "scroll"

   There are also parameters that affect GTK as a whole.  For example,
the property `gtk-font-name' sets the default font for GTK.  You must
use Pango font names (*note GTK styles::).  A GTK resources file that
just sets a default font looks like this:

     gtk-font-name = "courier 12"

   The GTK resources file is fully described in the GTK API document.
This can be found in
`PREFIX/share/gtk-doc/html/gtk/gtk-resource-files.html', where `prefix'
is the directory in which the GTK libraries were installed (usually
`/usr' or `/usr/local').  You can also find the document online, at
`http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html'.

* Menu:

* GTK widget names::      How widgets in GTK are named in general.
* GTK Names in Emacs::    GTK widget names in Emacs.
* GTK styles::            What can be customized in a GTK widget.


File: emacs,  Node: GTK widget names,  Next: GTK Names in Emacs,  Up: GTK resources

D.6.1 GTK widget names
----------------------

A GTK widget is specified by its "widget class" and "widget name".  The
widget class is the type of the widget: for example, `GtkMenuBar'.  The
widget name is the name given to a specific widget.  A widget always
has a class, but need not have a name.

   "Absolute names" are sequences of widget names or widget classes,
corresponding to hierarchies of widgets embedded within other widgets.
For example, if a `GtkWindow' named `top' contains a `GtkVBox' named
`box', which in turn contains a `GtkMenuBar' called `menubar', the
absolute class name of the menu-bar widget is
`GtkWindow.GtkVBox.GtkMenuBar', and its absolute widget name is
`top.box.menubar'.

   When assigning a style to a widget, you can use the absolute class
name or the absolute widget name.

   There are two commands to specify changes for widgets:

`widget_class'
     specifies a style for widgets based on the absolute class name.

`widget'
     specifies a style for widgets based on the absolute class name, or
     just the class.

You must specify the class and the style in double-quotes, and put
these commands at the top level in the GTK customization file, like
this:

     style "menufont"
     {
       font_name = "helvetica bold 14"
     }

     widget "top.box.menubar" style "menufont"
     widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "menufont"

   Matching of absolute names uses shell wildcard syntax: `*' matches
zero or more characters and `?' matches one character.  This example
assigns `base_style' to all widgets:

     widget "*" style "base_style"

   Given the absolute class name `GtkWindow.GtkVBox.GtkMenuBar' and the
corresponding absolute widget name `top.box.menubar', all these
examples specify `my_style' for the menu bar:

     widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "my_style"
     widget_class "GtkWindow.*.GtkMenuBar" style "my_style"
     widget_class "*GtkMenuBar" style "my_style"
     widget "top.box.menubar" style "my_style"
     widget "*box*menubar" style "my_style"
     widget "*menubar" style "my_style"
     widget "*menu*" style "my_style"


File: emacs,  Node: GTK Names in Emacs,  Next: GTK styles,  Prev: GTK widget names,  Up: GTK resources

D.6.2 GTK Widget Names in Emacs
-------------------------------

In Emacs, the top level widget for a frame is a `GtkWindow' that
contains a `GtkVBox'.  The `GtkVBox' contains the `GtkMenuBar' and a
`GtkFixed' widget.  The vertical scroll bars, `GtkVScrollbar', are
contained in the `GtkFixed' widget.  The text you write in Emacs is
drawn in the `GtkFixed' widget.

   Dialogs in Emacs are `GtkDialog' widgets.  The file dialog is a
`GtkFileSelection' widget.

To set a style for the menu bar using the absolute class name, use:

     widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "my_style"

For the scroll bar, the absolute class name is:

     widget_class
       "GtkWindow.GtkVBox.GtkFixed.GtkVScrollbar"
          style "my_style"

The names for the emacs widgets, and their classes, are:

`emacs-filedialog'         `GtkFileSelection'
`emacs-dialog'             `GtkDialog'
`Emacs'                    `GtkWindow'
`pane'                     `GtkVHbox'
`emacs'                    `GtkFixed'
`verticalScrollBar'        `GtkVScrollbar'
`emacs-toolbar'            `GtkToolbar'
`menubar'                  `GtkMenuBar'
`emacs-menuitem'           anything in menus

Thus, for Emacs you can write the two examples above as:

     widget "Emacs.pane.menubar" style "my_style"
     widget "Emacs.pane.emacs.verticalScrollBar" style "my_style"

   GTK absolute names are quite strange when it comes to menus and
dialogs.  The names do not start with `Emacs', as they are
free-standing windows and not contained (in the GTK sense) by the Emacs
GtkWindow.  To customize the dialogs and menus, use wildcards like this:

     widget "*emacs-dialog*" style "my_dialog_style"
     widget "*emacs-filedialog* style "my_file_style"
     widget "*emacs-menuitem* style "my_menu_style"

   If you specify a customization in `~/.emacs.d/gtkrc', then it
automatically applies only to Emacs, since other programs don't read
that file.  For example, the drop down menu in the file dialog can not
be customized by any absolute widget name, only by an absolute class
name.  This is because the widgets in the drop down menu do not have
names and the menu is not contained in the Emacs GtkWindow.  To have
all menus in Emacs look the same, use this in `~/.emacs.d/gtkrc':

     widget_class "*Menu*" style "my_menu_style"


File: emacs,  Node: GTK styles,  Prev: GTK Names in Emacs,  Up: GTK resources

D.6.3 GTK styles
----------------

In a GTK style you specify the appearance widgets shall have.  You can
specify foreground and background color, background pixmap and font.
The edit widget (where you edit the text) in Emacs is a GTK widget, but
trying to specify a style for the edit widget will have no effect.
This is so that Emacs compiled for GTK is compatible with Emacs
compiled for other X toolkits.  The settings for foreground, background
and font for the edit widget is taken from the X resources; *note
Resources::.  Here is an example of two style declarations, `default'
and `ruler':

     pixmap_path "/usr/share/pixmaps:/usr/include/X11/pixmaps"

     style "default"
     {
       font_name = "helvetica 12"

       bg[NORMAL] = { 0.83, 0.80, 0.73 }
       bg[SELECTED] = { 0.0, 0.55, 0.55 }
       bg[INSENSITIVE] = { 0.77, 0.77, 0.66 }
       bg[ACTIVE] = { 0.0, 0.55, 0.55 }
       bg[PRELIGHT] = { 0.0, 0.55, 0.55 }

       fg[NORMAL] = "black"
       fg[SELECTED] = { 0.9, 0.9, 0.9 }
       fg[ACTIVE] = "black"
       fg[PRELIGHT] = { 0.9, 0.9, 0.9 }

       base[INSENSITIVE] = "#777766"
       text[INSENSITIVE] = { 0.60, 0.65, 0.57 }

       bg_pixmap[NORMAL] = "background.xpm"
       bg_pixmap[INSENSITIVE] = "background.xpm"
       bg_pixmap[ACTIVE] = "background.xpm"
       bg_pixmap[PRELIGHT] = "<none>"

     }

     style "ruler" = "default"
     {
       font_name = "helvetica 8"
     }

   The style `ruler' inherits from `default'.  This way you can build
on existing styles.  The syntax for fonts and colors is described below.

   As this example shows, it is possible to specify several values for
foreground and background depending on the widget's "state".  The
possible states are:

`NORMAL'
     This is the default state for widgets.

`ACTIVE'
     This is the state for a widget that is ready to do something.  It
     is also for the trough of a scroll bar, i.e.  `bg[ACTIVE] = "red"'
     sets the scroll bar trough to red.  Buttons that have been pressed
     but not released yet ("armed") are in this state.

`PRELIGHT'
     This is the state for a widget that can be manipulated, when the
     mouse pointer is over it--for example when the mouse is over the
     thumb in the scroll bar or over a menu item.  When the mouse is
     over a button that is not pressed, the button is in this state.

`SELECTED'
     This is the state for data that has been selected by the user.  It
     can be selected text or items selected in a list.  This state is
     not used in Emacs.

`INSENSITIVE'
     This is the state for widgets that are visible, but they can not be
     manipulated in the usual way--for example, buttons that can't be
     pressed, and disabled menu items.  To display disabled menu items
     in yellow, use `fg[INSENSITIVE] = "yellow"'.

   Here are the things that can go in a style declaration:

`bg[STATE] = COLOR'
     This specifies the background color for the widget.  Note that
     editable text doesn't use `bg'; it uses `base' instead.

`base[STATE] = COLOR'
     This specifies the background color for editable text.  In Emacs,
     this color is used for the background of the text fields in the
     file dialog.

`bg_pixmap[STATE] = "PIXMAP"'
     This specifies an image background (instead of a background color).
     PIXMAP should be the image file name.  GTK can use a number of
     image file formats, including XPM, XBM, GIF, JPEG and PNG.  If you
     want a widget to use the same image as its parent, use `<parent>'.
     If you don't want any image, use `<none>'.  `<none>' is the way to
     cancel a background image inherited from a parent style.

     You can't specify the file by its absolute file name.  GTK looks
     for the pixmap file in directories specified in `pixmap_path'.
     `pixmap_path' is a colon-separated list of directories within
     double quotes, specified at the top level in a `gtkrc' file (i.e.
     not inside a style definition; see example above):

          pixmap_path "/usr/share/pixmaps:/usr/include/X11/pixmaps"

`fg[STATE] = COLOR'
     This specifies the foreground color for widgets to use.  It is the
     color of text in menus and buttons, and the color for the arrows in
     the scroll bar.  For editable text, use `text'.

`text[STATE] = COLOR'
     This is the color for editable text.  In Emacs, this color is used
     for the text fields in the file dialog.

`font_name = "FONT"'
     This specifies the font for text in the widget.  FONT is a Pango
     font name, for example `Sans Italic 10', `Helvetica Bold 12',
     `Courier 14', `Times 18'.  See below for exact syntax.  The names
     are case insensitive.

   There are three ways to specify a color: by name, in hexadecimal
form, and with an RGB triplet.

A color name is written within double quotes, for example `"red"'.

Hexadecimal form is the same as in X: `#RRRRGGGGBBBB', where all three
color specs must have the same number of hex digits (1, 2, 3 or 4).

An RGB triplet looks like `{ R, G, B }', where R, G and B are either
integers in the range 0-65535 or floats in the range 0.0-1.0.

   Pango font names have the form "FAMILY-LIST STYLE-OPTIONS SIZE."  FAMILY-LIST
is a comma separated list of font families optionally terminated by a
comma.  This way you can specify several families and the first one
found will be used.  FAMILY corresponds to the second part in an X font
name, for example in

     -adobe-times-medium-r-normal--12-120-75-75-p-64-iso10646-1

the family name is `times'.

STYLE-OPTIONS is a whitespace separated list of words where each word
is a style, variant, weight, or stretch.  The default value for all of
these is `normal'.

A `style' corresponds to the fourth part of an X font name.  In X font
names it is the character `r', `i' or `o'; in Pango font names the
corresponding values are `normal', `italic', or `oblique'.

A `variant' is either `normal' or `small-caps'.  Small caps is a font
with the lower case characters replaced by smaller variants of the
capital characters.

Weight describes the "boldness" of a font.  It corresponds to the third
part of an X font name.  It is one of `ultra-light', `light', `normal',
`bold', `ultra-bold', or `heavy'.

Stretch gives the width of the font relative to other designs within a
family.  It corresponds to the fifth part of an X font name.  It is one
of `ultra-condensed', `extra-condensed', `condensed', `semi-condensed',
`normal', `semi-expanded', `expanded', `extra-expanded', or
`ultra-expanded'.

SIZE is a decimal number that describes the font size in points.


File: emacs,  Node: Antinews,  Next: Mac OS / GNUstep,  Prev: X Resources,  Up: Top

Appendix E Emacs 22 Antinews
****************************

For those users who live backwards in time, here is information about
downgrading to Emacs version 22.3.  We hope you will enjoy the greater
simplicity that results from the absence of many Emacs 23.4 features.

   * We have switched to a character representation specially designed
     for Emacs.  Rather than forcing all the widely used scripts into
     artificial alignment, as Unicode does, Emacs treats them all
     equally, giving each one a place in the space of character codes.
     We have eliminated the confusing practice, in Emacs 23, whereby
     one character can belong to multiple character sets.  Now each
     script has its own variant, and they all are different as far as
     Emacs is concerned.  For example, there's a Latin-1 c-cedilla
     character, and there's a Latin-2 c-cedilla; searching a buffer for
     the Latin-1 variant only finds that variant, but not the others.

   * Emacs now uses its own special internal encoding for non-ASCII
     characters, known as `emacs-mule'.  This was imperative to support
     several different variants of the same character, each one
     belonging to its own script: `emacs-mule' marks each character
     with its script, to better discern them from one another.

   * For simplicity, the functions `encode-coding-region' and
     `decode-coding-region' no longer accept an argument saying where
     to store the result of their conversions.  The result always
     replaces the original, so there's no need to look for it elsewhere.

   * Emacs no longer performs font anti-aliasing.  If your fonts look
     ugly, try choosing a larger font and increasing the screen
     resolution.  Admittedly, this becomes difficult as you go further
     back in time, since available screen resolutions will decrease.

   * The Fontconfig font library is no longer supported.  To specify a
     font, you must use an XLFD (X Logical Font Descriptor).  The other
     ways of specifying fonts--so-called "Fontconfig" and "GTK" font
     names--are redundant, so they have been removed.

   * Transient Mark mode is now disabled by default.  Furthermore, some
     commands that operate specifically on the region when it is active
     and Transient Mark mode is enabled (such as `fill-paragraph'
     `ispell-word', and `indent-for-tab-command'), no longer do so.

   * Holding <shift> while typing a motion command no longer creates a
     temporarily active region, since that's inconsistent with how Emacs
     normally handles keybindings.  The variable `shift-select-mode'
     has been deleted.  You can, however, still create temporarily
     active regions by dragging the mouse.

   * The line motion commands, `C-n' and `C-p', now move by logical
     text lines, not screen lines.  Even if a long text line is
     continued over multiple screen lines, `C-n' and `C-p' treat it as a
     single line, because that's ultimately what it is.

   * Visual Line mode, which provides "word wrap" functionality, has
     been removed.  You can still use Long Lines mode to gain an
     approximation of word wrapping, though this has some
     drawbacks--for instance, syntax highlighting often doesn't work
     well on wrapped lines.

   * `C-l' now runs `recenter' instead of `recenter-top-bottom'.  This
     always sets the current line at the center of the window, instead
     of cycling through the center, top, and bottom of the window on
     successive invocations.  This lets you type `C-l C-l C-l C-l' to
     be _absolutely sure_ that you have recentered the line.

   * The way Emacs generates possible minibuffer completions is now much
     simpler to understand.  It matches alternatives to the text before
     point, ignoring the text after point; it also does not attempt to
     perform partial completion if the first completion attempt fails.

   * Typing `M-n' at the start of the minibuffer history list no longer
     attempts to generate guesses of possible minibuffer input.  It
     instead does the straightforward thing, by issuing the message
     `End of history; no default available'.

   * Individual buffers can no longer display faces specially.  The text
     scaling commands `C-x C-+', `C-x C--', and `C-x C-0' have been
     removed, and so has the buffer face menu bound to `S-down-mouse-1'.

   * VC no longer supports fileset-based operations on distributed
     version control systems (DVCSs) such as Arch, Bazaar, Subversion,
     Mercurial, and Git.  For instance, multi-file commits will be
     performed by committing one file at a time.  As you go further
     back in time, we will remove DVCS support entirely, so you should
     migrate your projects to CVS.

   * Rmail now uses a special file format, Babyl format, specifically
     designed for storing and editing mail.  When you visit a file in
     Rmail, or get new mail, Rmail converts it automatically to Babyl
     format.

   * Emacs can no longer display frames on X windows and text terminals
     (ttys) simultaneously.  If you start Emacs as an X application, it
     can only create X frames; if you start Emacs on a tty, it can only
     use that tty.  No more confusion about which type of frame
     `emacsclient' will use in any given Emacs session!

   * Emacs can no longer be started as a daemon.  You can be sure that
     if you don't see Emacs, then it's not running.

   * Emacs has added support for many soon-to-be-non-obsolete platforms,
     including VMS, DECstation, SCO Unix, and systems lacking alloca.
     Support for Sun windows has been added.

   * To keep up with decreasing computer memory capacity and disk
     space, many other functions and files have been eliminated in
     Emacs 22.3.


File: emacs,  Node: Mac OS / GNUstep,  Next: Microsoft Windows,  Prev: Antinews,  Up: Top

Appendix F Emacs and Mac OS / GNUstep
*************************************

This section describes the peculiarities of using Emacs built with the
GNUstep libraries on GNU/Linux or other operating systems, or on Mac OS
X with native window system support.  On Mac OS X, Emacs can be built
either without window system support, with X11, or with the Cocoa
interface; this section only applies to the Cocoa build.  Emacs does
not support earlier versions of Mac OS.

   For various historical and technical reasons, Emacs uses the term
`Nextstep' internally, instead of "Cocoa" or "Mac OS X"; for instance,
most of the commands and variables described in this section begin with
`ns-', which is short for `Nextstep'.  NeXTstep was an application
interface released by NeXT Inc during the 1980s, of which Cocoa is a
direct descendant.  Apart from Cocoa, there is another NeXTstep-style
system: GNUstep, which is free software.  As of this writing, the
GNUstep support is alpha status (*note GNUstep Support::), but we hope
to improve it in the future.

* Menu:

* Mac / GNUstep Basics::        Basic Emacs usage under GNUstep or Mac OS.
* Mac / GNUstep Customization:: Customizations under GNUstep or Mac OS.
* Mac / GNUstep Events::        How window system events are handled.
* GNUstep Support::             Details on status of GNUstep support.


File: emacs,  Node: Mac / GNUstep Basics,  Next: Mac / GNUstep Customization,  Up: Mac OS / GNUstep

F.1 Basic Emacs usage under Mac OS and GNUstep
==============================================

By default, the <alt> and <option> keys are the same as <Meta>.  The
Mac <Cmd> key is the same as <Super>, and Emacs provides a set of
keybindings using this modifier key that mimic other Mac / GNUstep
applications (*note Mac / GNUstep Events::).  You can change these
bindings in the usual way (*note Key Bindings::).

   The variable `ns-right-alternate-modifier' controls the behavior of
the right <alt> and <option> keys.  These keys behave like the
left-hand keys if the value is `left' (the default).  A value of
`control', `meta', `alt', `super', or `hyper' makes them behave like
the corresponding modifier keys; a value of `none' tells Emacs to
ignore them.

   The standard Mac / GNUstep font and color panels are accessible via
Lisp commands.  To use the color panel, drag from it to an Emacs frame
to change the foreground color of the face at that position (if the
<shift> key is held down, it changes the background color instead). To
discard the settings, create a new frame and close the altered one.

   <S-Mouse-1> (i.e., clicking the left mouse button while holding down
the <Shift> key) adjusts the region to the click position, just like
<Mouse-3> (`mouse-save-then-kill'); it does not pop up a menu for
changing the default face, as <S-Mouse-1> normally does (*note
Temporary Face Changes::).  This change makes Emacs behave more like
other Mac / GNUstep applications.

   When you open or save files using the menus, or using the <Cmd-o>
and <Cmd-S> bindings, Emacs uses graphical file dialogs to read file
names.  However, if you use the regular Emacs key sequences, such as
<C-x C-f>, Emacs uses the minibuffer to read file names.

   On GNUstep, in an X-windows environment you need to use <Cmd-c>
instead of one of the <C-w> or <M-w> commands to transfer text to the X
primary selection; otherwise, Emacs will use the "clipboard" selection.
Likewise, <Cmd-y> (instead of <C-y>) yanks from the X primary selection
instead of the kill-ring or clipboard.

F.1.1 Grabbing environment variables
------------------------------------

Many programs which may run under Emacs, like latex or man, depend on
the settings of environment variables.  If Emacs is launched from the
shell, it will automatically inherit these environment variables and
its subprocesses will inherit them from it.  But if Emacs is launched
from the Finder it is not a descendant of any shell, so its environment
variables haven't been set, which often causes the subprocesses it
launches to behave differently than they would when launched from the
shell.

   For the PATH and MANPATH variables, a system-wide method of setting
PATH is recommended on Mac OS X 10.5 and later, using the `/etc/paths'
files and the `/etc/paths.d' directory.


File: emacs,  Node: Mac / GNUstep Customization,  Next: Mac / GNUstep Events,  Prev: Mac / GNUstep Basics,  Up: Mac OS / GNUstep

F.2 Mac / GNUstep Customization
===============================

Emacs can be customized in several ways in addition to the standard
customization buffers and the Options menu.

F.2.1 Font and Color Panels
---------------------------

The Font Panel may be accessed with M-x ns-popup-font-panel.  It will
set the default font in the frame most recently used or clicked on.

   You can bring up a color panel with M-x ns-popup-color-panel. and
drag the color you want over the emacs face you want to change.  Normal
dragging will alter the foreground color.  Shift dragging will alter the
background color.

   Useful in this context is the listing of all faces obtained by <M-x>
`list-faces-display'.

F.2.2 Open files by dragging to an Emacs window
-----------------------------------------------

The default behaviour when a user drags files from another application
into an Emacs frame is to insert the contents of all the dragged files
into the current buffer.  To remap the `ns-drag-file' event to open the
dragged files in the current frame use the following line:

     (define-key global-map [ns-drag-file] 'ns-find-file)


File: emacs,  Node: Mac / GNUstep Events,  Next: GNUstep Support,  Prev: Mac / GNUstep Customization,  Up: Mac OS / GNUstep

F.3 Windowing System Events under Mac OS / GNUstep
==================================================

Nextstep applications receive a number of special events which have no
X equivalent.  These are sent as specially defined "keys", which do not
correspond to any sequence of keystrokes.  Under Emacs, these "key"
events can be bound to functions just like ordinary keystrokes.  Here
is a list of these events.

<ns-open-file>
     This event occurs when another Nextstep application requests that
     Emacs open a file.  A typical reason for this would be a user
     double-clicking a file in the Finder application.  By default,
     Emacs responds to this event by opening a new frame and visiting
     the file in that frame (`ns-find-file').  As an exception, if the
     selected buffer is the `*scratch*' buffer, Emacs visits the file
     in the selected frame.

     You can change how Emacs responds to <ns-open-file> by changing
     the variable `ns-pop-up-frames'.  Its default value, `'fresh', is
     what we have just described.  A value of `t' means to always visit
     the file in a new frame.  A value of `nil' means to always visit
     the file in an existing frame.

<ns-open-temp-file>
     This event occurs when another application requests that Emacs
     open a temporary file.  By default, this is handled by just
     generating a `ns-open-file' event, the results of which are
     described above.

<ns-open-file-line>
     Some applications, such as ProjectBuilder and gdb, request not
     only a particular file, but also a particular line or sequence of
     lines in the file.  Emacs handles this by visiting that file and
     highlighting the requested line (`ns-open-file-select-line').

<ns-drag-file>
     This event occurs when a user drags files from another application
     into an Emacs frame.  The default behavior is to insert the
     contents of all the dragged files into the current buffer
     (`ns-insert-files').  The list of dragged files is stored in the
     variable `ns-input-file'.

<ns-drag-color>
     This event occurs when a user drags a color from the color well (or
     some other source) into an Emacs frame.  The default behavior is to
     alter the foreground color of the area the color was dragged onto
     (`ns-set-foreground-at-mouse').  If this event is issued with a
     <Shift> modifier, Emacs changes the background color instead
     (`ns-set-background-at-mouse').  The name of the dragged color is
     stored in the variable `ns-input-color'.

<ns-change-font>
     This event occurs when the user selects a font in a Nextstep font
     panel (which can be opened with `Cmd-t').  The default behavior is
     to adjust the font of the selected frame
     (`ns-respond-to-changefont').  The name and size of the selected
     font are stored in the variables `ns-input-font' and
     `ns-input-fontsize', respectively.

<ns-power-off>
     This event occurs when the user logs out and Emacs is still
     running, or when `Quit Emacs' is chosen from the application menu.
     The default behavior is to save all file-visiting buffers.

   Emacs also allows users to make use of Nextstep services, via a set
of commands whose names begin with `ns-service-' and end with the name
of the service.  Type `M-x ns-service-<TAB><TAB>' to see a list of
these commands.  These functions either operate on marked text
(replacing it with the result) or take a string argument and return the
result as a string.  You can also use the Lisp function
`ns-perform-service' to pass arbitrary strings to arbitrary services
and receive the results back.  Note that you may need to restart Emacs
to access newly-available services.


File: emacs,  Node: GNUstep Support,  Prev: Mac / GNUstep Events,  Up: Mac OS / GNUstep

F.4 GNUstep Support
===================

Emacs can be built and run under GNUstep, but there are still some
issues to be addressed.  Interested developers should contact
<emacs-devel@gnu.org>.


File: emacs,  Node: Microsoft Windows,  Next: Manifesto,  Prev: Mac OS / GNUstep,  Up: Top

Appendix G Emacs and Microsoft Windows/MS-DOS
*********************************************

This section describes peculiarities of using Emacs on Microsoft
Windows.  Some of these peculiarities are also relevant to Microsoft's
older MS-DOS "operating system" (also known as "MS-DOG").  However,
Emacs features that are relevant _only_ to MS-DOS are described in a
separate section (*note MS-DOS::).

   The behavior of Emacs on MS-Windows is reasonably similar to what is
documented in the rest of the manual, including support for long file
names, multiple frames, scroll bars, mouse menus, and subprocesses.
However, a few special considerations apply, and they are described
here.

* Menu:

* Windows Startup::     How to start Emacs on Windows.
* Text and Binary::     Text files use CRLF to terminate lines.
* Windows Files::       File-name conventions on Windows.
* ls in Lisp::          Emulation of `ls' for Dired.
* Windows HOME::        Where Emacs looks for your `.emacs' and
                          where it starts up.
* Windows Keyboard::    Windows-specific keyboard features.
* Windows Mouse::       Windows-specific mouse features.
* Windows Processes::   Running subprocesses on Windows.
* Windows Printing::    How to specify the printer on MS-Windows.
* Windows Fonts::       Specifying fonts on MS-Windows.
* Windows Misc::        Miscellaneous Windows features.

* MS-DOS::              Using Emacs on MS-DOS (otherwise known as "MS-DOG").


File: emacs,  Node: Windows Startup,  Next: Text and Binary,  Up: Microsoft Windows

G.1 How to Start Emacs on MS-Windows
====================================

There are several ways of starting Emacs on MS-Windows:

  1. From the desktop shortcut icon: either double-click the left mouse
     button on the icon, or click once, then press <RET>.  The desktop
     shortcut should specify as its "Target" (in the "Properties" of
     the shortcut) the full absolute file name of `runemacs.exe', _not_
     of `emacs.exe'.  This is because `runemacs.exe' hides the console
     window that would have been created if the target of the shortcut
     were `emacs.exe' (which is a console program, as far as Windows is
     concerned).  If you use this method, Emacs starts in the directory
     specified by the shortcut.  To control where that is, right-click
     on the shortcut, select "Properties", and in the "Shortcut" tab
     modify the "Start in" field to your liking.

  2. From the Command Prompt window, by typing `emacs <RET>' at the
     prompt.  The Command Prompt window where you did that will not be
     available for invoking other commands until Emacs exits.  In this
     case, Emacs will start in the current directory of the Windows
     shell.

  3. From the Command Prompt window, by typing `runemacs <RET>' at the
     prompt.  The Command Prompt window where you did that will be
     immediately available for invoking other commands.  In this case,
     Emacs will start in the current directory of the Windows shell.

  4. Via `emacsclient.exe' or `emacsclientw.exe', which allow you to
     invoke Emacs from other programs, and to reuse a running Emacs
     process for serving editing jobs required by other programs.
     *Note Emacs Server::.  The difference between `emacsclient.exe'
     and `emacsclientw.exe' is that the former is a console program,
     while the latter is a Windows GUI program.  Both programs wait for
     Emacs to signal that the editing job is finished, before they exit
     and return control to the program that invoked them.  Which one of
     them to use in each case depends on the expectations of the
     program that needs editing services.  If that program is itself a
     console (text-mode) program, you should use `emacsclient.exe', so
     that any of its messages and prompts appear in the same command
     window as those of the invoking program.  By contrast, if the
     invoking program is a GUI program, you will be better off using
     `emacsclientw.exe', because `emacsclient.exe' will pop up a
     command window if it is invoked from a GUI program.  A notable
     situation where you would want `emacsclientw.exe' is when you
     right-click on a file in the Windows Explorer and select "Open
     With" from the pop-up menu.  Use the `--alternate-editor=' or `-a'
     options if Emacs might not be running (or not running as a server)
     when `emacsclient' is invoked--that will always give you an
     editor.  When invoked via `emacsclient', Emacs will start in the
     current directory of the program that invoked `emacsclient'.


File: emacs,  Node: Text and Binary,  Next: Windows Files,  Prev: Windows Startup,  Up: Microsoft Windows

G.2 Text Files and Binary Files
===============================

GNU Emacs uses newline characters to separate text lines.  This is the
convention used on GNU, Unix, and other Posix-compliant systems.

   By contrast, MS-DOS and MS-Windows normally use carriage-return
linefeed, a two-character sequence, to separate text lines.  (Linefeed
is the same character as newline.)  Therefore, convenient editing of
typical files with Emacs requires conversion of these end-of-line (EOL)
sequences.  And that is what Emacs normally does: it converts
carriage-return linefeed into newline when reading files, and converts
newline into carriage-return linefeed when writing files.  The same
mechanism that handles conversion of international character codes does
this conversion also (*note Coding Systems::).

   One consequence of this special format-conversion of most files is
that character positions as reported by Emacs (*note Position Info::) do
not agree with the file size information known to the operating system.

   In addition, if Emacs recognizes from a file's contents that it uses
newline rather than carriage-return linefeed as its line separator, it
does not perform EOL conversion when reading or writing that file.
Thus, you can read and edit files from GNU and Unix systems on MS-DOS
with no special effort, and they will retain their Unix-style
end-of-line convention after you edit them.

   The mode line indicates whether end-of-line translation was used for
the current buffer.  If MS-DOS end-of-line translation is in use for the
buffer, the MS-Windows build of Emacs displays a backslash `\' after
the coding system mnemonic near the beginning of the mode line (*note
Mode Line::).  If no EOL translation was performed, the string `(Unix)'
is displayed instead of the backslash, to alert you that the file's EOL
format is not the usual carriage-return linefeed.

   To visit a file and specify whether it uses DOS-style or Unix-style
end-of-line, specify a coding system (*note Text Coding::).  For
example, `C-x <RET> c unix <RET> C-x C-f foobar.txt' visits the file
`foobar.txt' without converting the EOLs; if some line ends with a
carriage-return linefeed pair, Emacs will display `^M' at the end of
that line.  Similarly, you can direct Emacs to save a buffer in a
specified EOL format with the `C-x <RET> f' command.  For example, to
save a buffer with Unix EOL format, type `C-x <RET> f unix <RET> C-x
C-s'.  If you visit a file with DOS EOL conversion, then save it with
Unix EOL format, that effectively converts the file to Unix EOL style,
like `dos2unix'.

   When you use NFS, Samba, or some other similar method to access file
systems that reside on computers using GNU or Unix systems, Emacs
should not perform end-of-line translation on any files in these file
systems--not even when you create a new file.  To request this,
designate these file systems as "untranslated" file systems by calling
the function `add-untranslated-filesystem'.  It takes one argument: the
file system name, including a drive letter and optionally a directory.
For example,

     (add-untranslated-filesystem "Z:")

designates drive Z as an untranslated file system, and

     (add-untranslated-filesystem "Z:\\foo")

designates directory `\foo' on drive Z as an untranslated file system.

   Most often you would use `add-untranslated-filesystem' in your
`.emacs' file, or in `site-start.el' so that all the users at your site
get the benefit of it.

   To countermand the effect of `add-untranslated-filesystem', use the
function `remove-untranslated-filesystem'.  This function takes one
argument, which should be a string just like the one that was used
previously with `add-untranslated-filesystem'.

   Designating a file system as untranslated does not affect character
set conversion, only end-of-line conversion.  Essentially, it directs
Emacs to create new files with the Unix-style convention of using
newline at the end of a line.  *Note Coding Systems::.

   Some kinds of files should not be converted at all, because their
contents are not really text.  Therefore, Emacs on MS-Windows
distinguishes certain files as "binary files".  (This distinction is
not part of MS-Windows; it is made by Emacs only.)  Binary files
include executable programs, compressed archives, etc.  Emacs uses the
file name to decide whether to treat a file as binary: the variable
`file-name-buffer-file-type-alist' defines the file-name patterns that
indicate binary files.  If a file name matches one of the patterns for
binary files (those whose associations are of the type `(PATTERN . t)',
Emacs reads and writes that file using the `no-conversion' coding
system (*note Coding Systems::) which turns off _all_ coding-system
conversions, not only the EOL conversion.
`file-name-buffer-file-type-alist' also includes file-name patterns for
files which are known to be Windows-style text files with
carriage-return linefeed EOL format, such as `CONFIG.SYS'; Emacs always
writes those files with Windows-style EOLs.

   If a file which belongs to an untranslated file system matches one of
the file-name patterns in `file-name-buffer-file-type-alist', the EOL
conversion is determined by `file-name-buffer-file-type-alist'.


File: emacs,  Node: Windows Files,  Next: ls in Lisp,  Prev: Text and Binary,  Up: Microsoft Windows

G.3 File Names on MS-Windows
============================

MS-Windows and MS-DOS normally use a backslash, `\', to separate name
units within a file name, instead of the slash used on other systems.
Emacs on MS-DOS/MS-Windows permits use of either slash or backslash,
and also knows about drive letters in file names.

   On MS-DOS/MS-Windows, file names are case-insensitive, so Emacs by
default ignores letter-case in file names during completion.

   The variable `w32-get-true-file-attributes' controls whether Emacs
should issue additional system calls to determine more accurately file
attributes in primitives like `file-attributes' and
`directory-files-and-attributes'.  These additional calls are needed to
report correct file ownership, link counts and file types for special
files such as pipes.  Without these system calls, file ownership will
be attributed to the current user, link counts will be always reported
as 1, and special files will be reported as regular files.

   If the value of this variable is `local' (the default), Emacs will
issue these additional system calls only for files on local fixed
drives.  Any other non-`nil' value means do this even for removable and
remote volumes, where this could potentially slow down Dired and other
related features.  The value of `nil' means never issue those system
calls.  Non-`nil' values are more useful on NTFS volumes, which support
hard links and file security, than on FAT, FAT32, and XFAT volumes.


File: emacs,  Node: ls in Lisp,  Next: Windows HOME,  Prev: Windows Files,  Up: Microsoft Windows

G.4 Emulation of `ls' on MS-Windows
===================================

Dired normally uses the external program `ls' (or its close work-alike)
to produce the directory listing displayed in Dired buffers (*note
Dired::).  However, MS-Windows and MS-DOS systems don't come with such
a program, although several ports of GNU `ls' are available.
Therefore, Emacs on those systems _emulates_ `ls' in Lisp, by using the
`ls-lisp.el' package.  While `ls-lisp.el' provides a reasonably full
emulation of `ls', there are some options and features peculiar to that
emulation; they are described in this section.

   The `ls' emulation supports many of the `ls' switches, but it
doesn't support all of them.  Here's the list of the switches it does
support: `-A', `-a', `-B', `-C', `-c', `-i', `-G', `-g', `-R', `-r',
`-S', `-s', `-t', `-U', `-u', and `-X'.  The `-F' switch is partially
supported (it appends the character that classifies the file, but does
not prevent symlink following).

   On MS-Windows and MS-DOS, `ls-lisp.el' is preloaded when Emacs is
built, so the Lisp emulation of `ls' is always used on those platforms.
If you have a ported `ls', setting
`ls-lisp-use-insert-directory-program' to a non-`nil' value will revert
to using an external program named by the variable
`insert-directory-program'.

   By default, `ls-lisp.el' uses a case-sensitive sort order for the
directory listing it produces; this is so the listing looks the same as
on other platforms.  If you wish that the files be sorted in
case-insensitive order, set the variable `ls-lisp-ignore-case' to a
non-`nil' value.

   By default, files and subdirectories are sorted together, to emulate
the behavior of `ls'.  However, native MS-Windows/MS-DOS file managers
list the directories before the files; if you want that behavior,
customize the option `ls-lisp-dirs-first' to a non-`nil' value.

   The variable `ls-lisp-verbosity' controls the file attributes that
`ls-lisp.el' displays.  The value should be a list that contains one or
more of the symbols `links', `uid', and `gid'.  `links' means display
the count of different file names that are associated with (a.k.a.
"links to") the file's data; this is only useful on NTFS volumes.
`uid' means display the numerical identifier of the user who owns the
file.  `gid' means display the numerical identifier of the file owner's
group.  The default value is `(links uid gid)' i.e. all the 3 optional
attributes are displayed.

   The variable `ls-lisp-emulation' controls the flavour of the `ls'
emulation by setting the defaults for the 3 options described above:
`ls-lisp-ignore-case', `ls-lisp-dirs-first', and `ls-lisp-verbosity'.
The value of this option can be one of the following symbols:

`GNU'
`nil'
     Emulate GNU systems; this is the default.  This sets
     `ls-lisp-ignore-case' and `ls-lisp-dirs-first' to `nil', and
     `ls-lisp-verbosity' to `(links uid gid)'.

`UNIX'
     Emulate Unix systems.  Like `GNU', but sets `ls-lisp-verbosity' to
     `(links uid)'.

`MacOS'
     Emulate MacOS.  Sets `ls-lisp-ignore-case' to `t', and
     `ls-lisp-dirs-first' and `ls-lisp-verbosity' to `nil'.

`MS-Windows'
     Emulate MS-Windows.  Sets `ls-lisp-ignore-case' and
     `ls-lisp-dirs-first' to `t', and `ls-lisp-verbosity' to `(links)'
     on Windows NT/2K/XP/2K3 and to `nil' on Windows 9X.  Note that the
     default emulation is _not_ `MS-Windows', even on Windows, since
     many users of Emacs on those platforms prefer the GNU defaults.

Any other value of `ls-lisp-emulation' means the same as `GNU'.  Note
that this option needs to be set _before_ `ls-lisp.el' is loaded, which
means that on MS-Windows and MS-DOS you will have to set the value from
your `.emacs' file and then restart Emacs, since `ls-lisp.el' is
preloaded.

   The variable `ls-lisp-support-shell-wildcards' controls how
file-name patterns are supported: if it is non-`nil' (the default),
they are treated as shell-style wildcards; otherwise they are treated
as Emacs regular expressions.

   The variable `ls-lisp-format-time-list' defines how to format the
date and time of files.  _The value of this variable is ignored_,
unless Emacs cannot determine the current locale.  (However, if the
value of `ls-lisp-use-localized-time-format' is non-`nil', Emacs obeys
`ls-lisp-format-time-list' even if the current locale is available; see
below.)

   The value of `ls-lisp-format-time-list' is a list of 2 strings.  The
first string is used if the file was modified within the current year,
while the second string is used for older files.  In each of these two
strings you can use `%'-sequences to substitute parts of the time.  For
example:
     ("%b %e %H:%M" "%b %e  %Y")

Note that the strings substituted for these `%'-sequences depend on the
current locale.  *Note Time Parsing: (elisp)Time Parsing, for more
about format time specs.

   Normally, Emacs formats the file time stamps in either traditional
or ISO-style time format.  However, if the value of the variable
`ls-lisp-use-localized-time-format' is non-`nil', Emacs formats file
time stamps according to what `ls-lisp-format-time-list' specifies.
The `%'-sequences in `ls-lisp-format-time-list' produce
locale-dependent month and day names, which might cause misalignment of
columns in Dired display.


File: emacs,  Node: Windows HOME,  Next: Windows Keyboard,  Prev: ls in Lisp,  Up: Microsoft Windows

G.5 HOME and Startup Directories on MS-Windows
==============================================

The Windows equivalent of the `HOME' directory is the "user-specific
application data directory".  The actual location depends on the
Windows version; typical values are `C:\Documents and
Settings\USERNAME\Application Data' on Windows 2K/XP/2K3,
`C:\Users\USERNAME\AppData\Roaming' on Windows Vista/7/2K8, and either
`C:\WINDOWS\Application Data' or
`C:\WINDOWS\Profiles\USERNAME\Application Data' on the older Windows
9X/ME systems.  If this directory does not exist or cannot be accessed,
Emacs falls back to `C:\' as the default value of `HOME'.

   You can override this default value of `HOME' by explicitly setting
the environment variable `HOME' to point to any directory on your
system.  `HOME' can be set either from the command shell prompt or from
the `My Computer's `Properties' dialog.  `HOME' can also be set in the
system registry, for details see *note MS-Windows Registry::.

   For compatibility with older versions of Emacs(1), if there is a
file named `.emacs' in `C:\', the root directory of drive `C:', and
`HOME' is set neither in the environment nor in the Registry, Emacs
will treat `C:\' as the default `HOME' location, and will not look in
the application data directory, even if it exists.  Note that only
`.emacs' is looked for in `C:\'; the older name `_emacs' (see below) is
not.  This use of `C:\.emacs' to define `HOME' is deprecated.

   Whatever the final place is, Emacs sets the internal value of the
`HOME' environment variable to point to it, and it will use that
location for other files and directories it normally looks for or
creates in the user's home directory.

   You can always find out where Emacs thinks is your home directory's
location by typing `C-x d ~/ <RET>'.  This should present the list of
files in the home directory, and show its full name on the first line.
Likewise, to visit your init file, type `C-x C-f ~/.emacs <RET>'
(assuming the file's name is `.emacs').

   The home directory is where your init file is stored.  It can have
any name mentioned in *note Init File::.

   Because MS-DOS does not allow file names with leading dots, and
because older Windows systems made it hard to create files with such
names, the Windows port of Emacs supports an alternative name `_emacs'
as a fallback, if such a file exists in the home directory, whereas
`.emacs' does not.

   ---------- Footnotes ----------

   (1) Older versions of Emacs didn't check the application data
directory.


File: emacs,  Node: Windows Keyboard,  Next: Windows Mouse,  Prev: Windows HOME,  Up: Microsoft Windows

G.6 Keyboard Usage on MS-Windows
================================

This section describes the Windows-specific features related to
keyboard input in Emacs.

   Many key combinations (known as "keyboard shortcuts") that have
conventional uses in MS-Windows programs conflict with traditional
Emacs key bindings.  (These Emacs key bindings were established years
before Microsoft was founded.)  Examples of conflicts include `C-c',
`C-x', `C-z', `C-a', and `W-<SPC>'.  You can redefine some of them with
meanings more like the MS-Windows meanings by enabling CUA Mode (*note
CUA Bindings::).

   The <F10> key on Windows activates the menu bar in a way that makes
it possible to use the menus without a mouse.  In this mode, the arrow
keys traverse the menus, <RET> selects a highlighted menu item, and
<ESC> closes the menu.

   By default, the key labeled <Alt> is mapped as the <META> key.  If
you wish it to produce the `Alt' modifier instead, set the variable
`w32-alt-is-meta' to a `nil' value.

   MS-Windows reserves certain key combinations, such as `Alt-<TAB>',
for its own use.  These key combinations are intercepted by the system
before Emacs can see them.  You can use the `w32-register-hot-key'
function to allow a key sequence to be seen by Emacs instead of being
grabbed by Windows.  This functions registers a key sequence as a "hot
key", overriding the special meaning of that key sequence for Windows.
(MS-Windows is told that the key sequence is a hot key only when one of
the Emacs windows has focus, so that the special keys still have their
usual meaning for other Windows applications.)

   The argument to `w32-register-hot-key' must be a single key, with or
without modifiers, in vector form that would be acceptable to
`define-key'.  The meta modifier is interpreted as the <ALT> key if
`w32-alt-is-meta' is `t' (the default), and the hyper modifier is
always interpreted as the Windows key (usually labeled with <start> and
the Windows logo).  If the function succeeds in registering the key
sequence, it returns the hotkey ID, a number; otherwise it returns
`nil'.

   For example, `(w32-register-hot-key [M-tab])' lets you use `M-TAB'
normally in Emacs, for instance, to complete the word or symbol at
point at top level, or to complete the current search string against
previously sought strings during incremental search.

   The function `w32-unregister-hot-key' reverses the effect of
`w32-register-hot-key' for its argument key sequence.

   By default, the <CapsLock> key only affects normal character keys
(it converts lower-case characters to their upper-case variants).
However, if you set the variable `w32-capslock-is-shiftlock' to a
non-`nil' value, the <CapsLock> key will affect non-character keys as
well, as if you pressed the <Shift> key while typing the non-character
key.

   If the variable `w32-enable-caps-lock' is set to a `nil' value, the
<CapsLock> key produces the symbol `capslock' instead of the shifted
version of they keys.  The default value is `t'.

   Similarly, if `w32-enable-num-lock' is `nil', the <NumLock> key will
produce the symbol `kp-numlock'.  The default is `t', which causes
<NumLock> to work as expected: toggle the meaning of the keys on the
numeric keypad.

   The variable `w32-apps-modifier' controls the effect of the <Apps>
key (usually located between the right <Alt> and the right <Ctrl>
keys).  Its value can be one of the symbols `hyper', `super', `meta',
`alt', `control', or `shift' for the respective modifier, or `nil' to
appear as the key `apps'.  The default is `nil'.

   The variable `w32-lwindow-modifier' determines the effect of the
left Windows key (usually labeled with <start> and the Windows logo).
If its value is `nil' (the default), the key will produce the symbol
`lwindow'.  Setting it to one of the symbols `hyper', `super', `meta',
`alt', `control', or `shift' will produce the respective modifier.  A
similar variable `w32-rwindow-modifier' controls the effect of the right
Windows key, and `w32-scroll-lock-modifier' does the same for the
<ScrLock> key.  If these variables are set to `nil', the right Windows
key produces the symbol `rwindow' and <ScrLock> produces the symbol
`scroll'.

   Emacs compiled as a native Windows application normally turns off
the Windows feature that tapping the <ALT> key invokes the Windows
menu.  The reason is that the <ALT> serves as <META> in Emacs.  When
using Emacs, users often press the <META> key temporarily and then
change their minds; if this has the effect of bringing up the Windows
menu, it alters the meaning of subsequent commands.  Many users find
this frustrating.

   You can re-enable Windows' default handling of tapping the <ALT> key
by setting `w32-pass-alt-to-system' to a non-`nil' value.

   The variables `w32-pass-lwindow-to-system' and
`w32-pass-rwindow-to-system' determine whether the respective keys are
passed to Windows or swallowed by Emacs.  If the value is `nil', the
respective key is silently swallowed by Emacs, otherwise it is passed
to Windows.  The default is `t' for both of these variables.  Passing
each of these keys to Windows produces its normal effect: for example,
`<Lwindow>' opens the `Start' menu, etc.(1)

   The variable `w32-recognize-altgr' controls whether the <AltGr> key
(if it exists on your keyboard), or its equivalent, the combination of
the right <Alt> and left <Ctrl> keys pressed together, is recognized as
the <AltGr> key.  The default is `t', which means these keys produce
`AltGr'; setting it to `nil' causes <AltGr> or the equivalent key
combination to be interpreted as the combination of <CTRL> and <META>
modifiers.

   ---------- Footnotes ----------

   (1) Some combinations of the "Windows" keys with other keys are
caught by Windows at low level in a way that Emacs currently cannot
prevent.  For example, `<Lwindow> r' always pops up the Windows `Run'
dialog.  Customizing the value of `w32-phantom-key-code' might help in
some cases, though.


File: emacs,  Node: Windows Mouse,  Next: Windows Processes,  Prev: Windows Keyboard,  Up: Microsoft Windows

G.7 Mouse Usage on MS-Windows
=============================

This section describes the Windows-specific variables related to mouse.

   The variable `w32-mouse-button-tolerance' specifies the time
interval, in milliseconds, for faking middle mouse button press on
2-button mice.  If both mouse buttons are depressed within this time
interval, Emacs generates a middle mouse button click event instead of
a double click on one of the buttons.

   If the variable `w32-pass-extra-mouse-buttons-to-system' is
non-`nil', Emacs passes the fourth and fifth mouse buttons to Windows.

   The variable `w32-swap-mouse-buttons' controls which of the 3 mouse
buttons generates the `mouse-2' events.  When it is `nil' (the
default), the middle button generates `mouse-2' and the right button
generates `mouse-3' events.  If this variable is non-`nil', the roles
of these two buttons are reversed.


File: emacs,  Node: Windows Processes,  Next: Windows Printing,  Prev: Windows Mouse,  Up: Microsoft Windows

G.8 Subprocesses on Windows 9X/ME and Windows NT/2K/XP
======================================================

Emacs compiled as a native Windows application (as opposed to the DOS
version) includes full support for asynchronous subprocesses.  In the
Windows version, synchronous and asynchronous subprocesses work fine on
both Windows 9X/ME and Windows NT/2K/XP as long as you run only 32-bit
Windows applications.  However, when you run a DOS application in a
subprocess, you may encounter problems or be unable to run the
application at all; and if you run two DOS applications at the same
time in two subprocesses, you may have to reboot your system.

   Since the standard command interpreter (and most command line
utilities) on Windows 9X are DOS applications, these problems are
significant when using that system.  But there's nothing we can do
about them; only Microsoft can fix them.

   If you run just one DOS application subprocess, the subprocess should
work as expected as long as it is "well-behaved" and does not perform
direct screen access or other unusual actions.  If you have a CPU
monitor application, your machine will appear to be 100% busy even when
the DOS application is idle, but this is only an artifact of the way CPU
monitors measure processor load.

   You must terminate the DOS application before you start any other DOS
application in a different subprocess.  Emacs is unable to interrupt or
terminate a DOS subprocess.  The only way you can terminate such a
subprocess is by giving it a command that tells its program to exit.

   If you attempt to run two DOS applications at the same time in
separate subprocesses, the second one that is started will be suspended
until the first one finishes, even if either or both of them are
asynchronous.

   If you can go to the first subprocess, and tell it to exit, the
second subprocess should continue normally.  However, if the second
subprocess is synchronous, Emacs itself will be hung until the first
subprocess finishes.  If it will not finish without user input, then
you have no choice but to reboot if you are running on Windows 9X.  If
you are running on Windows NT/2K/XP, you can use a process viewer
application to kill the appropriate instance of NTVDM instead (this
will terminate both DOS subprocesses).

   If you have to reboot Windows 9X in this situation, do not use the
`Shutdown' command on the `Start' menu; that usually hangs the system.
Instead, type `CTL-ALT-<DEL>' and then choose `Shutdown'.  That usually
works, although it may take a few minutes to do its job.

   The variable `w32-quote-process-args' controls how Emacs quotes the
process arguments.  Non-`nil' means quote with the `"' character.  If
the value is a character, use that character to escape any quote
characters that appear; otherwise chose a suitable escape character
based on the type of the program.

   The function `w32-shell-execute' can be useful for writing
customized commands that run MS-Windows applications registered to
handle a certain standard Windows operation for a specific type of
document or file.  This function is a wrapper around the Windows
`ShellExecute' API.  See the MS-Windows API documentation for more
details.


File: emacs,  Node: Windows Printing,  Next: Windows Fonts,  Prev: Windows Processes,  Up: Microsoft Windows

G.9 Printing and MS-Windows
===========================

Printing commands, such as `lpr-buffer' (*note Printing::) and
`ps-print-buffer' (*note PostScript::) work in MS-DOS and MS-Windows by
sending the output to one of the printer ports, if a Posix-style `lpr'
program is unavailable.  The same Emacs variables control printing on
all systems, but in some cases they have different default values on
MS-DOS and MS-Windows.

   Emacs on Windows automatically determines your default printer and
sets the variable `printer-name' to that printer's name.  But in some
rare cases this can fail, or you may wish to use a different printer
from within Emacs.  The rest of this section explains how to tell Emacs
which printer to use.

   If you want to use your local printer, then set the Lisp variable
`lpr-command' to `""' (its default value on Windows) and `printer-name'
to the name of the printer port--for example, `"PRN"', the usual local
printer port or `"LPT2"', or `"COM1"' for a serial printer.  You can
also set `printer-name' to a file name, in which case "printed" output
is actually appended to that file.  If you set `printer-name' to
`"NUL"', printed output is silently discarded (sent to the system null
device).

   You can also use a printer shared by another machine by setting
`printer-name' to the UNC share name for that printer--for example,
`"//joes_pc/hp4si"'.  (It doesn't matter whether you use forward
slashes or backslashes here.)  To find out the names of shared
printers, run the command `net view' from the command prompt to obtain
a list of servers, and `net view SERVER-NAME' to see the names of
printers (and directories) shared by that server.  Alternatively, click
the `Network Neighborhood' icon on your desktop, and look for machines
which share their printers via the network.

   If the printer doesn't appear in the output of `net view', or if
setting `printer-name' to the UNC share name doesn't produce a hardcopy
on that printer, you can use the `net use' command to connect a local
print port such as `"LPT2"' to the networked printer.  For example,
typing `net use LPT2: \\joes_pc\hp4si'(1) causes Windows to "capture"
the `LPT2' port and redirect the printed material to the printer
connected to the machine `joes_pc'.  After this command, setting
`printer-name' to `"LPT2"' should produce the hardcopy on the networked
printer.

   With some varieties of Windows network software, you can instruct
Windows to capture a specific printer port such as `"LPT2"', and
redirect it to a networked printer via the `Control Panel->Printers'
applet instead of `net use'.

   If you set `printer-name' to a file name, it's best to use an
absolute file name.  Emacs changes the working directory according to
the default directory of the current buffer, so if the file name in
`printer-name' is relative, you will end up with several such files,
each one in the directory of the buffer from which the printing was
done.

   If the value of `printer-name' is correct, but printing does not
produce the hardcopy on your printer, it is possible that your printer
does not support printing plain text (some cheap printers omit this
functionality).  In that case, try the PostScript print commands,
described below.

   The commands `print-buffer' and `print-region' call the `pr'
program, or use special switches to the `lpr' program, to produce
headers on each printed page.  MS-DOS and MS-Windows don't normally
have these programs, so by default, the variable `lpr-headers-switches'
is set so that the requests to print page headers are silently ignored.
Thus, `print-buffer' and `print-region' produce the same output as
`lpr-buffer' and `lpr-region', respectively.  If you do have a suitable
`pr' program (for example, from GNU Coreutils), set
`lpr-headers-switches' to `nil'; Emacs will then call `pr' to produce
the page headers, and print the resulting output as specified by
`printer-name'.

   Finally, if you do have an `lpr' work-alike, you can set the
variable `lpr-command' to `"lpr"'.  Then Emacs will use `lpr' for
printing, as on other systems.  (If the name of the program isn't
`lpr', set `lpr-command' to specify where to find it.)  The variable
`lpr-switches' has its standard meaning when `lpr-command' is not `""'.
If the variable `printer-name' has a string value, it is used as the
value for the `-P' option to `lpr', as on Unix.

   A parallel set of variables, `ps-lpr-command', `ps-lpr-switches',
and `ps-printer-name' (*note PostScript Variables::), defines how
PostScript files should be printed.  These variables are used in the
same way as the corresponding variables described above for
non-PostScript printing.  Thus, the value of `ps-printer-name' is used
as the name of the device (or file) to which PostScript output is sent,
just as `printer-name' is used for non-PostScript printing.  (There are
two distinct sets of variables in case you have two printers attached
to two different ports, and only one of them is a PostScript printer.)

   The default value of the variable `ps-lpr-command' is `""', which
causes PostScript output to be sent to the printer port specified by
`ps-printer-name', but `ps-lpr-command' can also be set to the name of
a program which will accept PostScript files.  Thus, if you have a
non-PostScript printer, you can set this variable to the name of a
PostScript interpreter program (such as Ghostscript).  Any switches
that need to be passed to the interpreter program are specified using
`ps-lpr-switches'.  (If the value of `ps-printer-name' is a string, it
will be added to the list of switches as the value for the `-P' option.
This is probably only useful if you are using `lpr', so when using an
interpreter typically you would set `ps-printer-name' to something
other than a string so it is ignored.)

   For example, to use Ghostscript for printing on the system's default
printer, put this in your `.emacs' file:

     (setq ps-printer-name t)
     (setq ps-lpr-command "D:/gs6.01/bin/gswin32c.exe")
     (setq ps-lpr-switches '("-q" "-dNOPAUSE" "-dBATCH"
                             "-sDEVICE=mswinpr2"
                             "-sPAPERSIZE=a4"))

(This assumes that Ghostscript is installed in the `D:/gs6.01'
directory.)

   ---------- Footnotes ----------

   (1) Note that the `net use' command requires the UNC share name to be
typed with the Windows-style backslashes, while the value of
`printer-name' can be set with either forward- or backslashes.


File: emacs,  Node: Windows Fonts,  Next: Windows Misc,  Prev: Windows Printing,  Up: Microsoft Windows

G.10 Specifying Fonts on MS-Windows
===================================

Starting with Emacs 23, fonts are specified by their name, size and
optional properties.  The format for specifying fonts comes from the
fontconfig library used in modern Free desktops:

       [Family[-PointSize]][:Option1=Value1[:Option2=Value2[...]]]

   The old XLFD based format is also supported for backwards
compatibility.

   Emacs 23 supports a number of backends.  Currently, the `gdi' and
`uniscribe' font backends are supported on Windows.  The `gdi' font
backend is available on all versions of Windows, and supports all fonts
that are natively supported by Windows.  The `uniscribe' font backend
is available on Windows 2000 and later, and supports Truetype and
Opentype fonts.  Some languages requiring complex layout can only be
properly supported by the uniscribe backend.  By default, both backends
are enabled if supported, with `uniscribe' taking priority over `gdi'.

Optional properties common to all font backends on MS-Windows are:

`weight'
     Specifies the weight of the font.  Special values `light',
     `medium', `demibold', `bold', and `black' can be specified without
     `weight=' (e.g., `Courier New-12:bold').  Otherwise, the weight
     should be a numeric value between 100 and 900, or one of the named
     weights in `font-weight-table'.  If unspecified, a regular font is
     assumed.

`slant'
     Specifies whether the font is italic.  Special values `roman',
     `italic' and `oblique' can be specified without `slant=' (e.g.,
     `Courier New-12:italic').  Otherwise, the slant should be a
     numeric value, or one of the named slants in `font-slant-table'.
     On Windows, any slant above 150 is treated as italics, and
     anything below as roman.

`family'
     Specifies the font family, but normally this will be specified at
     the start of the font name.

`pixelsize'
     Specifies the font size in pixels.  This can be used instead of
     the point size specified after the family name.

`adstyle'
     Specifies additional style information for the font.  On
     MS-Windows, the values `mono', `sans', `serif', `script' and
     `decorative' are recognized.  These are most useful as a fallback
     with the font family left unspecified.

`registry'
     Specifies the character set registry that the font is expected to
     cover.  Most Truetype and Opentype fonts will be unicode fonts
     that cover several national character sets, but you can narrow
     down the selection of fonts to those that support a particular
     character set by using a specific registry from
     `w32-charset-info-alist' here.

`spacing'
     Specifies how the font is spaced.  The `p' spacing specifies a
     proportional font, and `m' or `c' specify a monospaced font.

`foundry'
     Not used on Windows, but for informational purposes and to prevent
     problems with code that expects it to be set, is set internally to
     `raster' for bitmapped fonts, `outline' for scalable fonts, or
     `unknown' if the type cannot be determined as one of those.

   Options specific to `GDI' fonts:

`script'
     Specifies a unicode subrange the font should support.

     The following scripts are recognized on Windows: `latin', `greek',
     `coptic', `cyrillic', `armenian', `hebrew', `arabic', `syriac',
     `nko', `thaana', `devanagari', `bengali', `gurmukhi', `gujarati',
     `oriya', `tamil', `telugu', `kannada', `malayam', `sinhala',
     `thai', `lao', `tibetan', `myanmar', `georgian', `hangul',
     `ethiopic', `cherokee', `canadian-aboriginal', `ogham', `runic',
     `khmer', `mongolian', `symbol', `braille', `han',
     `ideographic-description', `cjk-misc', `kana', `bopomofo',
     `kanbun', `yi', `byzantine-musical-symbol', `musical-symbol', and
     `mathematical'.

`antialias'
     Specifies the antialiasing method.  The value `none' means no
     antialiasing, `standard' means use standard antialiasing,
     `subpixel' means use subpixel antialiasing (known as Cleartype on
     Windows), and `natural' means use subpixel antialiasing with
     adjusted spacing between letters.  If unspecified, the font will
     use the system default antialiasing.


File: emacs,  Node: Windows Misc,  Next: MS-DOS,  Prev: Windows Fonts,  Up: Microsoft Windows

G.11 Miscellaneous Windows-specific features
============================================

This section describes miscellaneous Windows-specific features.

   The variable `w32-use-visible-system-caret' is a flag that
determines whether to make the system caret visible.  The default when
no screen reader software is in use is `nil', which means Emacs draws
its own cursor to indicate the position of point.  A non-`nil' value
means Emacs will indicate point location by the system caret; this
facilitates use of screen reader software, and is the default when such
software is detected when running Emacs.  When this variable is
non-`nil', other variables affecting the cursor display have no effect.

   The variable `w32-grab-focus-on-raise', if set to a non-`nil' value
causes a frame to grab focus when it is raised.  The default is `t',
which fits well with the Windows default click-to-focus policy.


File: emacs,  Node: MS-DOS,  Prev: Windows Misc,  Up: Microsoft Windows

G.12 Emacs and MS-DOS
=====================

This section briefly describes the peculiarities of using Emacs on the
MS-DOS "operating system" (also known as "MS-DOG").  Information about
peculiarities common to MS-DOS and Microsoft's current operating
systems Windows (also known as "Losedows") is in *note Microsoft
Windows::.

   If you build Emacs for MS-DOS, the binary will also run on Windows
3.X, Windows NT, Windows 9X/ME, Windows 2000/XP, or OS/2 as a DOS
application; all of this chapter applies for all of those systems, if
you use an Emacs that was built for MS-DOS.

   *Note Text and Binary::, for information about Emacs' special
handling of text files under MS-DOS (and Windows).

* Menu:

* Keyboard: MS-DOS Keyboard.   Keyboard conventions on MS-DOS.
* Mouse: MS-DOS Mouse.         Mouse conventions on MS-DOS.
* Display: MS-DOS Display.     Fonts, frames and display size on MS-DOS.
* Files: MS-DOS File Names.    File name conventions on MS-DOS.
* Printing: MS-DOS Printing.   Printing specifics on MS-DOS.
* I18N: MS-DOS and MULE.       Support for internationalization on MS-DOS.
* Processes: MS-DOS Processes. Running subprocesses on MS-DOS.


File: emacs,  Node: MS-DOS Keyboard,  Next: MS-DOS Mouse,  Up: MS-DOS

G.12.1 Keyboard Usage on MS-DOS
-------------------------------

The key that is called <DEL> in Emacs (because that's how it is
designated on most workstations) is known as <BS> (backspace) on a PC.
That is why the PC-specific terminal initialization remaps the <BS> key
to act as <DEL>; the <DELETE> key is remapped to act as `C-d' for the
same reasons.

   Emacs built for MS-DOS recognizes `C-<BREAK>' as a quit character,
just like `C-g'.  This is because Emacs cannot detect that you have
typed `C-g' until it is ready for more input.  As a consequence, you
cannot use `C-g' to stop a running command (*note Quitting::).  By
contrast, `C-<BREAK>' _is_ detected as soon as you type it (as `C-g' is
on other systems), so it can be used to stop a running command and for
emergency escape (*note Emergency Escape::).

   The PC keyboard maps use the left <ALT> key as the <META> key.  You
have two choices for emulating the <SUPER> and <HYPER> keys: choose
either the right <CTRL> key or the right <ALT> key by setting the
variables `dos-hyper-key' and `dos-super-key' to 1 or 2 respectively.
If neither `dos-super-key' nor `dos-hyper-key' is 1, then by default
the right <ALT> key is also mapped to the <META> key.  However, if the
MS-DOS international keyboard support program `KEYB.COM' is installed,
Emacs will _not_ map the right <ALT> to <META>, since it is used for
accessing characters like `~' and `@' on non-US keyboard layouts; in
this case, you may only use the left <ALT> as <META> key.

   The variable `dos-keypad-mode' is a flag variable that controls what
key codes are returned by keys in the numeric keypad.  You can also
define the keypad <ENTER> key to act like `C-j', by putting the
following line into your `_emacs' file:

     ;; Make the <ENTER> key from the numeric keypad act as `C-j'.
     (define-key function-key-map [kp-enter] [?\C-j])


File: emacs,  Node: MS-DOS Mouse,  Next: MS-DOS Display,  Prev: MS-DOS Keyboard,  Up: MS-DOS

G.12.2 Mouse Usage on MS-DOS
----------------------------

Emacs on MS-DOS supports a mouse (on the default terminal only).  The
mouse commands work as documented, including those that use menus and
the menu bar (*note Menu Bar::).   Scroll bars don't work in MS-DOS
Emacs.  PC mice usually have only two buttons; these act as `Mouse-1'
and `Mouse-2', but if you press both of them together, that has the
effect of `Mouse-3'.  If the mouse does have 3 buttons, Emacs detects
that at startup, and all the 3 buttons function normally, as on X.

   Help strings for menu-bar and pop-up menus are displayed in the echo
area when the mouse pointer moves across the menu items.  Highlighting
of mouse-sensitive text (*note Mouse References::) is also supported.

   Some versions of mouse drivers don't report the number of mouse
buttons correctly.  For example, mice with a wheel report that they
have 3 buttons, but only 2 of them are passed to Emacs; the clicks on
the wheel, which serves as the middle button, are not passed.  In these
cases, you can use the `M-x msdos-set-mouse-buttons' command to tell
Emacs how many mouse buttons to expect.  You could make such a setting
permanent by adding this fragment to your `_emacs' init file:

     ;; Treat the mouse like a 2-button mouse.
     (msdos-set-mouse-buttons 2)

   Emacs built for MS-DOS supports clipboard operations when it runs on
Windows.  Commands that put text on the kill ring, or yank text from
the ring, check the Windows clipboard first, just as Emacs does on the
X Window System (*note Mouse Commands::).  Only the primary selection
and the cut buffer are supported by MS-DOS Emacs on Windows; the
secondary selection always appears as empty.

   Due to the way clipboard access is implemented by Windows, the
length of text you can put into the clipboard is limited by the amount
of free DOS memory that is available to Emacs.  Usually, up to 620KB of
text can be put into the clipboard, but this limit depends on the system
configuration and is lower if you run Emacs as a subprocess of another
program.  If the killed text does not fit, Emacs outputs a message
saying so, and does not put the text into the clipboard.

   Null characters also cannot be put into the Windows clipboard.  If
the killed text includes null characters, Emacs does not put such text
into the clipboard, and displays in the echo area a message to that
effect.

   The variable `dos-display-scancodes', when non-`nil', directs Emacs
to display the ASCII value and the keyboard scan code of each
keystroke; this feature serves as a complement to the `view-lossage'
command, for debugging.


File: emacs,  Node: MS-DOS Display,  Next: MS-DOS File Names,  Prev: MS-DOS Mouse,  Up: MS-DOS

G.12.3 Display on MS-DOS
------------------------

Display on MS-DOS cannot use font variants, like bold or italic, but it
does support multiple faces, each of which can specify a foreground and
a background color.  Therefore, you can get the full functionality of
Emacs packages that use fonts (such as `font-lock', Enriched Text mode,
and others) by defining the relevant faces to use different colors.
Use the `list-colors-display' command (*note Frame Parameters::) and
the `list-faces-display' command (*note Faces::) to see what colors and
faces are available and what they look like.

   *Note MS-DOS and MULE::, later in this chapter, for information on
how Emacs displays glyphs and characters that aren't supported by the
native font built into the DOS display.

   When Emacs starts, it changes the cursor shape to a solid box.  This
is for compatibility with other systems, where the box cursor is the
default in Emacs.  This default shape can be changed to a bar by
specifying the `cursor-type' parameter in the variable
`default-frame-alist' (*note Creating Frames::).  The MS-DOS terminal
doesn't support a vertical-bar cursor, so the bar cursor is horizontal,
and the `WIDTH' parameter, if specified by the frame parameters,
actually determines its height.  For this reason, the `bar' and `hbar'
cursor types produce the same effect on MS-DOS.  As an extension, the
bar cursor specification can include the starting scan line of the
cursor as well as its width, like this:

      '(cursor-type bar WIDTH . START)

In addition, if the WIDTH parameter is negative, the cursor bar begins
at the top of the character cell.

   The MS-DOS terminal can only display a single frame at a time.  The
Emacs frame facilities work on MS-DOS much as they do on text-only
terminals (*note Frames::).  When you run Emacs from a DOS window on
MS-Windows, you can make the visible frame smaller than the full
screen, but Emacs still cannot display more than a single frame at a
time.

   The `mode4350' command switches the display to 43 or 50 lines,
depending on your hardware; the `mode25' command switches to the
default 80x25 screen size.

   By default, Emacs only knows how to set screen sizes of 80 columns by
25, 28, 35, 40, 43 or 50 rows.  However, if your video adapter has
special video modes that will switch the display to other sizes, you can
have Emacs support those too.  When you ask Emacs to switch the frame to
N rows by M columns dimensions, it checks if there is a variable called
`screen-dimensions-NxM', and if so, uses its value (which must be an
integer) as the video mode to switch to.  (Emacs switches to that video
mode by calling the BIOS `Set Video Mode' function with the value of
`screen-dimensions-NxM' in the `AL' register.)  For example, suppose
your adapter will switch to 66x80 dimensions when put into video mode
85.  Then you can make Emacs support this screen size by putting the
following into your `_emacs' file:

     (setq screen-dimensions-66x80 85)

   Since Emacs on MS-DOS can only set the frame size to specific
supported dimensions, it cannot honor every possible frame resizing
request.  When an unsupported size is requested, Emacs chooses the next
larger supported size beyond the specified size.  For example, if you
ask for 36x80 frame, you will get 40x80 instead.

   The variables `screen-dimensions-NxM' are used only when they
exactly match the specified size; the search for the next larger
supported size ignores them.  In the above example, even if your VGA
supports 38x80 dimensions and you define a variable
`screen-dimensions-38x80' with a suitable value, you will still get
40x80 screen when you ask for a 36x80 frame.  If you want to get the
38x80 size in this case, you can do it by setting the variable named
`screen-dimensions-36x80' with the same video mode value as
`screen-dimensions-38x80'.

   Changing frame dimensions on MS-DOS has the effect of changing all
the other frames to the new dimensions.


File: emacs,  Node: MS-DOS File Names,  Next: MS-DOS Printing,  Prev: MS-DOS Display,  Up: MS-DOS

G.12.4 File Names on MS-DOS
---------------------------

On MS-DOS, file names are case-insensitive and limited to eight
characters, plus optionally a period and three more characters.  Emacs
knows enough about these limitations to handle file names that were
meant for other operating systems.  For instance, leading dots `.'  in
file names are invalid in MS-DOS, so Emacs transparently converts them
to underscores `_'; thus your default init file (*note Init File::) is
called `_emacs' on MS-DOS.  Excess characters before or after the
period are generally ignored by MS-DOS itself; thus, if you visit the
file `LongFileName.EvenLongerExtension', you will silently get
`longfile.eve', but Emacs will still display the long file name on the
mode line.  Other than that, it's up to you to specify file names which
are valid under MS-DOS; the transparent conversion as described above
only works on file names built into Emacs.

   The above restrictions on the file names on MS-DOS make it almost
impossible to construct the name of a backup file (*note Backup Names::)
without losing some of the original file name characters.  For example,
the name of a backup file for `docs.txt' is `docs.tx~' even if single
backup is used.

   If you run Emacs as a DOS application under Windows 9X, Windows ME,
or Windows 2000/XP, you can turn on support for long file names.  If
you do that, Emacs doesn't truncate file names or convert them to lower
case; instead, it uses the file names that you specify, verbatim.  To
enable long file name support, set the environment variable `LFN' to
`y' before starting Emacs.  Unfortunately, Windows NT doesn't allow DOS
programs to access long file names, so Emacs built for MS-DOS will only
see their short 8+3 aliases.

   MS-DOS has no notion of home directory, so Emacs on MS-DOS pretends
that the directory where it is installed is the value of the `HOME'
environment variable.  That is, if your Emacs binary, `emacs.exe', is
in the directory `c:/utils/emacs/bin', then Emacs acts as if `HOME'
were set to `c:/utils/emacs'.  In particular, that is where Emacs looks
for the init file `_emacs'.  With this in mind, you can use `~' in file
names as an alias for the home directory, as you would on GNU or Unix.
You can also set `HOME' variable in the environment before starting
Emacs; its value will then override the above default behavior.

   Emacs on MS-DOS handles the directory name `/dev' specially, because
of a feature in the emulator libraries of DJGPP that pretends I/O
devices have names in that directory.  We recommend that you avoid
using an actual directory named `/dev' on any disk.


File: emacs,  Node: MS-DOS Printing,  Next: MS-DOS and MULE,  Prev: MS-DOS File Names,  Up: MS-DOS

G.12.5 Printing and MS-DOS
--------------------------

Printing commands, such as `lpr-buffer' (*note Printing::) and
`ps-print-buffer' (*note PostScript::) can work on MS-DOS by sending
the output to one of the printer ports, if a Posix-style `lpr' program
is unavailable.  The same Emacs variables control printing on all
systems, but in some cases they have different default values on MS-DOS.

   *Note Windows Printing::, for details about setting up printing to a
networked printer.

   Some printers expect DOS codepage encoding of non-ASCII text, even
though they are connected to a Windows machine which uses a different
encoding for the same locale.  For example, in the Latin-1 locale, DOS
uses codepage 850 whereas Windows uses codepage 1252.  *Note MS-DOS and
MULE::.  When you print to such printers from Windows, you can use the
`C-x RET c' (`universal-coding-system-argument') command before `M-x
lpr-buffer'; Emacs will then convert the text to the DOS codepage that
you specify.  For example, `C-x RET c cp850-dos RET M-x lpr-region RET'
will print the region while converting it to the codepage 850 encoding.

   For backwards compatibility, the value of `dos-printer'
(`dos-ps-printer'), if it has a value, overrides the value of
`printer-name' (`ps-printer-name'), on MS-DOS.


File: emacs,  Node: MS-DOS and MULE,  Next: MS-DOS Processes,  Prev: MS-DOS Printing,  Up: MS-DOS

G.12.6 International Support on MS-DOS
--------------------------------------

Emacs on MS-DOS supports the same international character sets as it
does on GNU, Unix and other platforms (*note International::),
including coding systems for converting between the different character
sets.  However, due to incompatibilities between MS-DOS/MS-Windows and
other systems, there are several DOS-specific aspects of this support
that you should be aware of.  This section describes these aspects.

   The description below is largely specific to the MS-DOS port of
Emacs, especially where it talks about practical implications for Emacs
users.

`M-x dos-codepage-setup'
     Set up Emacs display and coding systems as appropriate for the
     current DOS codepage.

   MS-DOS is designed to support one character set of 256 characters at
any given time, but gives you a variety of character sets to choose
from.  The alternative character sets are known as "DOS codepages".
Each codepage includes all 128 ASCII characters, but the other 128
characters (codes 128 through 255) vary from one codepage to another.
Each DOS codepage is identified by a 3-digit number, such as 850, 862,
etc.

   In contrast to X, which lets you use several fonts at the same time,
MS-DOS normally doesn't allow use of several codepages in a single
session.  MS-DOS was designed to load a single codepage at system
startup, and require you to reboot in order to change it(1).  Much the
same limitation applies when you run DOS executables on other systems
such as MS-Windows.

   For multibyte operation on MS-DOS, Emacs needs to know which
characters the chosen DOS codepage can display.  So it queries the
system shortly after startup to get the chosen codepage number, and
stores the number in the variable `dos-codepage'.  Some systems return
the default value 437 for the current codepage, even though the actual
codepage is different.  (This typically happens when you use the
codepage built into the display hardware.)  You can specify a different
codepage for Emacs to use by setting the variable `dos-codepage' in
your init file.

   Multibyte Emacs supports only certain DOS codepages: those which can
display Far-Eastern scripts, like the Japanese codepage 932, and those
that encode a single ISO 8859 character set.

   The Far-Eastern codepages can directly display one of the MULE
character sets for these countries, so Emacs simply sets up to use the
appropriate terminal coding system that is supported by the codepage.
The special features described in the rest of this section mostly
pertain to codepages that encode ISO 8859 character sets.

   For the codepages which correspond to one of the ISO character sets,
Emacs knows the character set based on the codepage number.  Emacs
automatically creates a coding system to support reading and writing
files that use the current codepage, and uses this coding system by
default.  The name of this coding system is `cpNNN', where NNN is the
codepage number.(2)

   All the `cpNNN' coding systems use the letter `D' (for "DOS") as
their mode-line mnemonic.  Since both the terminal coding system and
the default coding system for file I/O are set to the proper `cpNNN'
coding system at startup, it is normal for the mode line on MS-DOS to
begin with `-DD\-'.  *Note Mode Line::.  Far-Eastern DOS terminals do
not use the `cpNNN' coding systems, and thus their initial mode line
looks like the Emacs default.

   Since the codepage number also indicates which script you are using,
Emacs automatically runs `set-language-environment' to select the
language environment for that script (*note Language Environments::).

   If a buffer contains a character belonging to some other ISO 8859
character set, not the one that the chosen DOS codepage supports, Emacs
displays it using a sequence of ASCII characters.  For example, if the
current codepage doesn't have a glyph for the letter `o`' (small `o'
with a grave accent), it is displayed as `{`o}', where the braces serve
as a visual indication that this is a single character.  (This may look
awkward for some non-Latin characters, such as those from Greek or
Hebrew alphabets, but it is still readable by a person who knows the
language.)  Even though the character may occupy several columns on the
screen, it is really still just a single character, and all Emacs
commands treat it as one.

   MS-Windows provides its own codepages, which are different from the
DOS codepages for the same locale.  For example, DOS codepage 850
supports the same character set as Windows codepage 1252; DOS codepage
855 supports the same character set as Windows codepage 1251, etc.  The
MS-Windows version of Emacs uses the current codepage for display when
invoked with the `-nw' option.

   ---------- Footnotes ----------

   (1) Normally, one particular codepage is burnt into the display
memory, while other codepages can be installed by modifying system
configuration files, such as `CONFIG.SYS', and rebooting.  While there
is third-party software that allows changing the codepage without
rebooting, we describe here how a stock MS-DOS system behaves.

   (2) The standard Emacs coding systems for ISO 8859 are not quite
right for the purpose, because typically the DOS codepage does not
match the standard ISO character codes.  For example, the letter `c,'
(`c' with cedilla) has code 231 in the standard Latin-1 character set,
but the corresponding DOS codepage 850 uses code 135 for this glyph.


File: emacs,  Node: MS-DOS Processes,  Prev: MS-DOS and MULE,  Up: MS-DOS

G.12.7 Subprocesses on MS-DOS
-----------------------------

Because MS-DOS is a single-process "operating system," asynchronous
subprocesses are not available.  In particular, Shell mode and its
variants do not work.  Most Emacs features that use asynchronous
subprocesses also don't work on MS-DOS, including Shell mode and GUD.
When in doubt, try and see; commands that don't work output an error
message saying that asynchronous processes aren't supported.

   Compilation under Emacs with `M-x compile', searching files with
`M-x grep' and displaying differences between files with `M-x diff' do
work, by running the inferior processes synchronously.  This means you
cannot do any more editing until the inferior process finishes.

   Spell checking also works, by means of special support for
synchronous invocation of the `ispell' program.  This is slower than the
asynchronous invocation on other platforms

   Instead of the Shell mode, which doesn't work on MS-DOS, you can use
the `M-x eshell' command.  This invokes the Eshell package that
implements a Posix-like shell entirely in Emacs Lisp.

   By contrast, Emacs compiled as a native Windows application *does*
support asynchronous subprocesses.  *Note Windows Processes::.

   Printing commands, such as `lpr-buffer' (*note Printing::) and
`ps-print-buffer' (*note PostScript::), work in MS-DOS by sending the
output to one of the printer ports.  *Note MS-DOS Printing::.

   When you run a subprocess synchronously on MS-DOS, make sure the
program terminates and does not try to read keyboard input.  If the
program does not terminate on its own, you will be unable to terminate
it, because MS-DOS provides no general way to terminate a process.
Pressing `C-c' or `C-<BREAK>' might sometimes help in these cases.

   Accessing files on other machines is not supported on MS-DOS.  Other
network-oriented commands such as sending mail, Web browsing, remote
login, etc., don't work either, unless network access is built into
MS-DOS with some network redirector.

   Dired on MS-DOS uses the `ls-lisp' package where other platforms use
the system `ls' command.  Therefore, Dired on MS-DOS supports only some
of the possible options you can mention in the `dired-listing-switches'
variable.  The options that work are `-A', `-a', `-c', `-i', `-r', `-S',
`-s', `-t', and `-u'.

