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

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

   Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 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.2 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 are free to copy and modify
     this GNU Manual. Buying copies from GNU Press supports the FSF 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: 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.2, November 2002

     Copyright (C) 2000,2001,2002  Free Software Foundation, Inc.
     51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

     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.

     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 for under this License.  Any other
     attempt to copy, modify, sublicense or distribute the Document is
     void, and will automatically terminate your rights under this
     License.  However, parties who have received copies, or rights,
     from you under this License will not have their licenses
     terminated so long as such parties remain in full compliance.

 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.


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.2
     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
******************************************************

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

   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 name on your command line
becomes the current buffer; the other files are also visited in other
buffers.  If there are two files, they are both displayed; otherwise
the last file is displayed along with a buffer list that shows what
other buffers there are.  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: for example, load libraries, call functions, or
terminate Emacs.  These are called "action options".  These and file
names together are called "action arguments".  Emacs processes all the
action arguments in the order they are written.  The `.emacs' file can
access the values of the action arguments as the elements of a list in
the variable `command-line-args'.

* 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 the action arguments and options:

`FILE'
`--file=FILE'
`--find-file=FILE'
`--visit=FILE'
     Visit FILE using `find-file'.  *Note Visiting::.  If you visit
     several files at startup in this way, Emacs also displays a Buffer
     Menu buffer to show you what files it has visited.  You can
     inhibit that by setting `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 current buffer.  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 init files.  The normal
actions of Emacs are to first load `site-start.el' if it exists, then
your own init 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.  You should also use the `-l', `-f' or `--eval' option, to
     invoke a Lisp program to do batch processing.

     In batch mode, Emacs does not display the text being edited, and
     the standard terminal interrupt characters such as `C-z' and `C-c'
     continue to have their normal effect.  The functions `prin1',
     `princ' and `print' output to `stdout' instead of the echo area,
     while `message' and error messages output to `stderr'.  Functions
     that would normally read from the minibuffer take their input from
     `stdin' instead.

     `--batch' implies `-q' (do not load an init 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 init file `~/.emacs', or `default.el'
     either.  Regardless of this switch, `site-start.el' is still
     loaded.  When invoked like this, Emacs does not allow saving
     options changed with the `M-x customize' command and its variants.
     *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.

`-Q'
`--quick'
     Start emacs with minimum customizations.  This is like using `-q'
     and `--no-site-file', but also disables the startup screen.

`--no-splash'
     Do not display a splash screen on startup.  You can also achieve
     this effect by setting the variable `inhibit-splash-screen' to
     non-`nil' in you personal init file (but _not_ in
     `site-start.el').  (This variable was called
     `inhibit-startup-message' in previous Emacs versions.)

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

`-u USER'
`--user=USER'
     Load USER's Emacs init file `~USER/.emacs' 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.

`--unibyte'
`--no-multibyte'
     Do almost everything with single-byte buffers and strings.  All
     buffers and strings are unibyte unless you (or a Lisp program)
     explicitly ask for a multibyte buffer or string.  (Note that Emacs
     always loads Lisp files in multibyte mode, even if `--unibyte' is
     specified; see *note Enabling Multibyte::.)  Setting the
     environment variable `EMACS_UNIBYTE' has the same effect (*note
     General Variables::).

`--multibyte'
`--no-unibyte'
     Inhibit the effect of `EMACS_UNIBYTE', so that Emacs uses
     multibyte characters by default, as usual.

   ---------- 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 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 specific environment variables that
have special meanings in Emacs, giving the name of each variable and
its meaning.  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.

`EMACS_UNIBYTE'
     Defining this environment variable with a nonempty value directs
     Emacs to do almost everything with single-byte buffers and
     strings.  It is equivalent to using the `--unibyte' command-line
     option on each invocation.  *Note Initial Options::.

`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, `DOC-EMACSVERSION'.
     This 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 Numbered
     Backups::).

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

`WINDOW_GFX'
     Used when initializing the Sun windows system.

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

   The syntax of the `DISPLAY' environment variable is
`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
==============================

By default, Emacs displays text in a twelve point Courier font (when
using X).  You can specify a different font on your command line
through the option `-fn NAME' (or `--font', which is an alias for
`-fn').

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

   Under X, each font has a long name which consists of fourteen words
or numbers, separated by dashes.  Some fonts also have shorter
nicknames.  For instance, `9x15' is such a nickname.  This font makes
each character nine pixels wide and fifteen pixels high.  You can use
either kind of name.  Case is insignificant in both kinds.  You can use
wildcard patterns for the font name; then Emacs lets X choose one of
the fonts that match the pattern.  The wildcard character `*' matches
any sequence of characters (including none) and `?' matches any single
character.  However, matching is implementation-dependent, and can be
inaccurate when wildcards match dashes in a long name.  For reliable
results, supply all 14 dashes and use wildcards only within a field.
Here is an example, which happens to specify the font whose nickname is
`6x13':

     emacs -fn \
       "-misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1" &

You can also specify the font in your `.Xdefaults' file:

     emacs.font: -misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso8859-1

   Note that if you use a wildcard pattern on the command line, you
need to enclose it in single or double quotes, to prevent the shell
from accidentally expanding it into a list of file names.  On the other
hand, you should not quote the name in the `.Xdefaults' file.

   The default font used by Emacs (under X) is:

     -adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1

   A long font name has the following form:

     -MAKER-FAMILY-WEIGHT-SLANT-WIDTHTYPE-STYLE...
     ...-PIXELS-HEIGHT-HORIZ-VERT-SPACING-WIDTH-REGISTRY-ENCODING

MAKER
     This is the name of the font manufacturer.

FAMILY
     This is the name of the font family--for example, `courier'.

WEIGHT
     This is normally `bold', `medium' or `light'.  Other words may
     appear here in some font names.

SLANT
     This is `r' (roman), `i' (italic), `o' (oblique), `ri' (reverse
     italic), or `ot' (other).

WIDTHTYPE
     This is normally `condensed', `extended', `semicondensed' or
     `normal'.  Other words may appear here in some font names.

STYLE
     This is an optional additional style name.  Usually it is
     empty--most long font names have two hyphens in a row at this
     point.

PIXELS
     This is the font height, in pixels.

HEIGHT
     This is the font height on the screen, measured in tenths of a
     printer's point--approximately 1/720 of an inch.  In other words,
     it is the point size of the font, times ten.  For a given vertical
     resolution, HEIGHT and PIXELS are proportional; therefore, it is
     common to specify just one of them and use `*' for the other.

HORIZ
     This is the horizontal resolution, in pixels per inch, of the
     screen for which the font is intended.

VERT
     This is the vertical resolution, in pixels per inch, of the screen
     for which the font is intended.  Normally the resolution of the
     fonts on your system is the right value for your screen;
     therefore, you normally specify `*' for this and HORIZ.

SPACING
     This is `m' (monospace), `p' (proportional) or `c' (character
     cell).

WIDTH
     This is the average character width, in pixels, multiplied by ten.

REGISTRY
ENCODING
     These together make up the X font character set that the font
     depicts.  (X font character sets are not the same as Emacs
     charsets, but they are solutions for the same problem.)  You can
     use the `xfontsel' program to check which choices you have.
     However, normally you should use `iso8859' for REGISTRY and `1'
     for ENCODING.

   You will probably want to use a fixed-width default font--that is, a
font in which all characters have the same width.  Any font with `m' or
`c' in the SPACING field of the long name is a fixed-width font.
Here's how to use the `xlsfonts' program to list all the fixed-width
fonts available on your system:

     xlsfonts -fn '*x*' | egrep "^[0-9]+x[0-9]+"
     xlsfonts -fn '*-*-*-*-*-*-*-*-*-*-*-m*'
     xlsfonts -fn '*-*-*-*-*-*-*-*-*-*-*-c*'

To see what a particular font looks like, use the `xfd' command.  For
example:

     xfd -fn 6x13

displays the entire font `6x13'.

   While running Emacs, you can set the font of the current frame
(*note Frame Parameters::) or for a specific kind of text (*note
Faces::).


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.

`-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 width for Emacs 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
`.Xdefaults' file, 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 `~/.emacs'
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', `--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 (sawfish is one).  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
==========

Most window managers allow you to "iconify" a frame, removing it from
sight, and leaving a small, distinctive "icon" window in its place.
Clicking on the icon window makes the frame itself appear again.  If
you have many clients running at once, you can avoid cluttering up the
screen by iconifying most of the clients.

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

`-iconic'
`--iconic'
     Start Emacs in iconified state.

   By default Emacs uses an icon window containing a picture of the GNU
gnu.  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.

   The `-iconic' option tells Emacs to begin running as an icon, rather
than showing a frame right away.  In this situation, the icon is the
only indication that Emacs has started; the text frame doesn't appear
until you deiconify it.


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

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

`-hb'
`--horizontal-scroll-bars'
     Enable horizontal scroll bars.  Since horizontal scroll bars are
     not yet implemented, this actually does nothing.

`-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::.  Likewise, Emacs on MacOS Carbon emulates X
resources using the Preferences system.  *Note Mac Environment
Variables::.

   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 resources file, usually named
`~/.Xdefaults' or `~/.Xresources'.  If changes in `~/.Xdefaults' do not
take effect, it is because your X server stores its own list of
resources; to update them, use the shell command `xrdb'--for instance,
`xrdb ~/.Xdefaults'.

   Each line in the file specifies a value for one option or for a
collection of related options, for one program or for several programs
(optionally even for all programs).

   MS-Windows systems do not support `~/.Xdefaults' files, so instead
Emacs compiled for Windows 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 (see
below.)

   Programs define named resources with particular meanings.  They also
define how to group resources into named classes.  For instance, in
Emacs, the `internalBorder' resource controls the width of the internal
border, and the `borderWidth' resource controls the width of the
external border.  Both of these resources are part of the `BorderWidth'
class.  Case distinctions are significant in these names.

   Every resource definition is associated with a specific program
name--the name of the executable file that you ran.  For Emacs, that is
normally `emacs'.  To specify a definition for all instances of Emacs,
regardless of their names, use `Emacs'.

   In `~/.Xdefaults', you can specify a value for a single resource on
one line, like this:

     emacs.borderWidth: 2

Or 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.  Thus, this 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.
Also, command-line options always override the X resources file.

   Here is a list of X command-line options and their corresponding
resource names.

`-name NAME'
`--name=NAME'
     Use NAME as the resource name (and the title) for the initial
     Emacs frame.  This option does not affect subsequent frames, but
     Lisp programs can specify frame names when they create frames.

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

`-xrm RESOURCE-VALUES'
`--xrm=RESOURCE-VALUES'
     Specify X resource values for this Emacs job (see below).

   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; its
name is `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.  Here is an example:

     Emacs.BorderWidth: 2
     Emacs.borderWidth: 4

   You can specify a string of additional resource values for Emacs to
use with the command line option `-xrm RESOURCES'.  The text RESOURCES
should have the same format that you would use inside a file of X
resources.  To include multiple resource specifications in RESOURCES,
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.

   One way to experiment with the effect of different resource settings
is to use the `editres' program.  Select `Get Tree' from the `Commands'
menu, then click on an Emacs frame.  This will display a tree showing
the structure of X toolkit widgets used in an Emacs frame.  Select one
of them, such as `menubar', then select `Show Resource Box' from the
`Commands' menu.  This displays a list of all the meaningful X
resources for that widget, and allows you to edit them.  Changes take
effect when you click on the `Apply' button.  (See the `editres' man
page for more details.)


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 (or fontset name, *note Fontsets::) for `default' font.

`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',
     `fullwidth' or `fullheight', which correspond to the command-line
     options `-fs', `-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.  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'.

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

   Thus, to specify `-*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,*' for
both the popup and menu bar menus, write this:

     Emacs*menu*fontSet:  -*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,*

The `*menu*' as a wildcard matches `pane.menubar' and `menu...'.

   Experience shows that on some systems you may need to add `shell.'
before the `pane.menubar' or `menu*'.  On some other systems, you must
not add `shell.'.  The generic wildcard approach should work on both
kinds of systems.

   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,  Prev: X Resources,  Up: Top

Appendix E Emacs 21 Antinews
****************************

For those users who live backwards in time, here is information about
downgrading to Emacs version 21.4.  We hope you will enjoy the greater
simplicity that results from the absence of many Emacs 22.3 features.

   * The buffer position and line number are now displayed at the end of
     the mode line, where they can be more easily seen.

   * The mode line of the selected window is no longer displayed with a
     special face.  All mode lines are created equal.  Meanwhile, you
     can use the variable `mode-line-inverse-video' to control whether
     mode lines are highlighted at all--`nil' means don't highlight
     them.

   * Clicking on a link with the left mouse button (`mouse-1') will
     always set point at the position clicked, instead of following the
     link.  If you want to follow the link, use the middle mouse button
     (`mouse-2').

   * Emacs is tired of X droppings.  If you drop a file or a piece of
     text onto an Emacs window, nothing will happen.

   * On an xterm, even if you enable Xterm Mouse mode, Emacs provides a
     more convincing simulation of a text terminal by not responding to
     mouse clicks on the mode line, header line, or display margin.

   * For simplicity, windows always have fringes.  We wouldn't want to
     in-fringe anyone's windows.  Likewise, horizontal scrolling always
     works in the same automatic way.

   * The horizontal-bar cursor shape has been removed.

   * If command line arguments are given, Emacs will not display a
     splash screen, so that you can immediately get on with your
     editing.  The command-line option `--no-splash' is therefore
     obsolete, and has been removed.

   * These command line options have also been removed: `--color',
     `--fullwidth', `--fullheight', `--fullscreen',
     `--no-blinking-cursor', `--no-desktop', and `-Q'.

   * The `--geometry' option applies only to the initial frame, and the
     `-f' option will not read arguments for interactive functions.

   * We have standardized on one location for the user init file: the
     file named `.emacs' in your home directory.  Emacs will not look
     for the init file in `~/.emacs.d/init.el'.  Similarly, don't try
     putting `.emacs_SHELL' as `init_SHELL.sh' in `~/.emacs.d'; Emacs
     won't find it.

   * Emacs will not read `~/.abbrev_defs' automatically.  If you want
     to load abbrev definitions from a file, you must always do so
     explicitly.

   * When you are logged in as root, all files now give you writable
     buffers, reflecting the fact that you can write any files.

   * The maximum size of buffers and integer variables has been halved.
     On 32-bit machines, the maximum buffer size is now 128 megabytes.

   * An unquoted `$' in a file name is now an error, if the following
     name is not recognized as an environment variable.  Thus, the file
     name `foo$bar' would probably be an error.  Meanwhile, the
     `setenv' command does not expand `$' at all.

   * If a single command accumulates too much undo information, Emacs
     never discards it.  If Emacs runs out of memory as a result, it
     will handle this by crashing.

   * Many commands have been removed from the menus or rearranged.

   * The `C-h' (help) subcommands have been rearranged--especially
     those that display specific files.  Type `C-h C-h' to see a list
     of these commands; that will show you what is different.

   * The `C-h v' and `C-h f' commands no longer show a hyperlink to the
     C source code, even if it is available.  If you want to find the
     source code, grep for it.

   * The apropos commands will not accept a list of words to match, in
     order to encourage you to be more specific.  Also, the user option
     `apropos-sort-by-scores' has been removed.

   * The minibuffer prompt is now displayed using the default face.
     The colon is enough to show you what part is the prompt.

   * Minibuffer completion commands always complete the entire
     minibuffer contents, just as if you had typed them at the end of
     the minibuffer, no matter where point is actually located.

   * The command `backward-kill-sexp' is now bound to `C-M-delete' and
     `C-M-backspace'.  Be careful when using these key sequences!  It
     may shut down your X server, or reboot your operating system.

   * Commands to set the mark at a place away from point, including
     `M-@', `M-h', etc., don't do anything special when you repeat
     them.  In most cases, typing these commands multiple times is
     equivalent to typing them once.  `M-h' ignores numeric arguments.

   * The user option `set-mark-command-repeat-pop' has been removed.

   * `C-<SPC> C-<SPC>' has no special meaning-it just sets the mark
     twice.  Neither does `C-u C-x C-x', which simply exchanges point
     and mark like `C-x C-x'.

   * The function `sentence-end' has been eliminated in favor of a more
     straightforward approach: directly setting the variable
     `sentence-end'.  For example, to end each sentence with a single
     space, use

          (setq sentence-end "[.?!][]\"')}]*\\($\\|[ \t]\\)[ \t\n]*")

   * The variable `fill-nobreak-predicate' is no longer customizable,
     and it can only hold a single function.

   * Nobreak spaces and hyphens are displayed just like normal
     characters, and the user option `nobreak-char-display' has been
     removed.

   * `C-w' in an incremental search always grabs an entire word into
     the search string.  More precisely, it grabs text through the next
     end of a word.

   * Yanking now preserves all text properties that were in the killed
     text.  The variable `yank-excluded-properties' has been removed.

   * Occur mode, Info mode, and Comint-derived modes now control
     fontification in their own way, and `M-x font-lock-mode' has
     nothing to do with it.  To control fontification in Info mode, use
     the variable `Info-fontify'.

   * `M-x shell' is now completely standard in regard to scrolling
     behavior.  It no longer has the option of scrolling the input line
     to the bottom of the window the way a text terminal running a
     shell does.

   * The Grep package has been merged with Compilation mode.  Many
     grep-specific commands and user options have thus been eliminated.
     Also, `M-x grep' never tries the GNU grep `-H' option, and instead
     silently appends `/dev/null' to the command line.

   * In Dired's `!' command, `*' and `?' now cause substitution of the
     file names wherever they appear--not only when they are surrounded
     by whitespace.

   * When a file is managed with version control, the command `C-x C-q'
     (whose general meaning is to make a buffer read-only or writable)
     now does so by checking the file in or out.  Checking the file out
     makes the buffer writable; checking it in makes the buffer
     read-only.

     You can still use `C-x v v' to do these operations if you wish;
     its meaning is unchanged.  If you want to control the buffer's
     read-only flag without performing any version control operation,
     use `M-x toggle-read-only'.

   * SGML mode does not handle XML syntax, and does not have indentation
     support.

   * Many Info mode commands have been removed.  Incremental search in
     Info searches only the current node.

   * Many `etags' features for customizing parsing using regexps have
     been removed.

   * The Emacs server now runs a small C program called `emacsserver',
     rather than trying to handle everything in Emacs Lisp.  Now there
     can only be one Emacs server running at a time.  The `server-mode'
     command and `server-name' user option have been eliminated.

   * The `emacsclient' program no longer accepts the `--eval',
     `--display' and `--server-file' command line options, and can only
     establish local connections using Unix domain sockets.

   * The command `quail-show-key', for showing how to input a
     character, has been removed.

   * The default value of `keyboard-coding-system' is always `nil',
     regardless of your locale settings.  If you want some other value,
     set it yourself.

   * Unicode support and unification between Latin-N character sets
     have been removed.  Cutting and pasting X selections does not
     support "extended segments", so there are certain coding systems
     it cannot handle.

   * The input methods for Emacs are included in a separate distribution
     called "Leim."  To use this, you must extract the Leim tar file on
     top of the Emacs distribution, into the same directory, before you
     build Emacs.

   * The following input methods have been eliminated: belarusian,
     bulgarian-bds, bulgarian-phonetic, chinese-sisheng, croatian,
     dutch, georgian, latin-alt-postfix, latin-postfix, latin-prefix,
     latvian-keyboard, lithuanian-numeric, lithuanian-keyboard,
     malayalam-inscript, rfc1345, russian-computer, sgml, slovenian,
     tamil-inscript ucs, ukrainian-computer, vietnamese-telex, and
     welsh.

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

   * The `code-pages' library, which contained various 8-bit coding
     systems, has been removed.

   * The Kmacro package has been replaced with a simple and elegant
     keyboard macro system.  Use `C-x (' to start a new keyboard macro,
     `C-x )' to end the macro, and `C-x e' to execute the last macro.
     Use `M-x name-last-kbd-macro' to name the most recently defined
     macro.

   * Emacs no longer displays your breakpoints in the source buffer, so
     you have to remember where you left them.  It can be difficult to
     inspect the state of your debugged program from the command line,
     so Emacs tries to demonstrate this in the GUD buffer.

   * The Calc, CUA, Ibuffer, Ido, Password, Printing, Reveal,
     Ruler-mode, SES, Table, Tramp, and URL packages have been removed.
     The Benchmark, Cfengine, Conf, Dns, Flymake, Python, Thumbs, and
     Wdired modes have also been removed.

   * The Emacs Lisp Reference Manual and the Introduction to
     Programming in Emacs Lisp are now distributed separately, not in
     the Emacs distribution.

   * On MS Windows, there is no longer any support for tooltips, images,
     sound, different mouse pointer shapes, or pointing devices with
     more than 3 buttons.  If you want these features, consider
     switching to another operating system.  But even if you don't want
     these features, you should still switch--for freedom's sake.

   * Emacs will not use Unicode for clipboard operations on MS Windows.

   * To keep up with decreasing computer memory capacity and disk
     space, many other functions and files have been eliminated in
     Emacs 21.4.


File: emacs,  Node: Mac OS,  Next: Microsoft Windows,  Prev: Antinews,  Up: Top

Appendix F Emacs and Mac OS
***************************

This section briefly describes the peculiarities of using Emacs under
Mac OS with native window system support.  For Mac OS X, Emacs can be
built either without window system support, with X11, or with Carbon
API.  This section only applies to the Carbon build.  For Mac OS
Classic, Emacs can be built with or without Carbon API, and this
section applies to either of them because they run on the native window
system.

   Emacs built on Mac OS X supports most of its major features except
display support of PostScript images.  The following features of Emacs
are not supported on Mac OS Classic: unexec (`dump-emacs'),
asynchronous subprocesses (`start-process'), and networking
(`open-network-stream').  As a result, packages such as Gnus, GUD, and
Comint do not work.  Synchronous subprocesses (`call-process') are
supported on non-Carbon build, but specially-crafted external programs
are needed.  Since external programs to handle commands such as
`print-buffer' and `diff' are not available on Mac OS Classic, they are
not supported.  Non-Carbon build on Mac OS Classic does not support some
features such as file dialogs, drag-and-drop, and Unicode menus.

* Menu:

* Input: Mac Input.                Keyboard and mouse input on Mac.
* Intl: Mac International.         International character sets on Mac.
* Env: Mac Environment Variables.  Setting environment variables for Emacs.
* Directories: Mac Directories.    Volumes and directories on Mac.
* Font: Mac Font Specs.            Specifying fonts on Mac.
* Functions: Mac Functions.        Mac-specific Lisp functions.


File: emacs,  Node: Mac Input,  Next: Mac International,  Up: Mac OS

F.1 Keyboard and Mouse Input on Mac
===================================

On Mac, Emacs can use <control>, <command>, <option>, and laptop
<function> keys as any of Emacs modifier keys except <SHIFT> (i.e.,
<ALT>, <CTRL>, <HYPER>, <META>, and <SUPER>).  The assignment is
controlled by the variables `mac-control-modifier',
`mac-command-modifier', `mac-option-modifier', and
`mac-function-modifier'.  The value for each of these variables can be
one of the following symbols: `alt', `control', `hyper', `meta',
`super', and `nil' (no particular assignment).  By default, the
<control> key works as <CTRL>, and the <command> key as <META>.

   For the <option> key, if `mac-option-modifier' is set to `nil',
which is the default, the key works as the normal <option> key, i.e.,
dead-key processing will work.  This is useful for entering non-ASCII
Latin characters directly from the Mac keyboard, for example.

   Emacs recognizes the setting in the Keyboard control panel (Mac OS
Classic) or the International system preference pane (Mac OS X) and
supports international and alternative keyboard layouts (e.g., Dvorak).
Selecting one of the layouts from the keyboard layout pull-down menu
will affect how the keys typed on the keyboard are interpreted.

   Mac OS intercepts and handles certain key combinations (e.g.,
<command>-<SPC> for switching input languages).  These will not be
passed to Emacs.  One can disable this interception by setting
`mac-pass-command-to-system' or `mac-pass-control-to-system' to `nil'.

   Especially for one-button mice, the multiple button feature can be
emulated by setting `mac-emulate-three-button-mouse' to `t' or
`reverse'.  If set to `t' (`reverse', respectively), pressing the mouse
button with the <option> key is recognized as the second (third)
button, and that with the <command> key is recognized as the third
(second) button.

   For multi-button mice, the wheel button and the secondary button are
recognized as the second and the third button, respectively.  If
`mac-wheel-button-is-mouse-2' is set to `nil', their roles are
exchanged.


File: emacs,  Node: Mac International,  Next: Mac Environment Variables,  Prev: Mac Input,  Up: Mac OS

F.2 International Character Set Support on Mac
==============================================

Mac uses non-standard encodings for the upper 128 single-byte
characters.  They also deviate from the ISO 2022 standard by using
character codes in the range 128-159.  The coding systems `mac-roman',
`mac-centraleurroman', and `mac-cyrillic' are used to represent these
Mac encodings.

   You can use input methods provided either by LEIM (*note Input
Methods::) or Mac OS to enter international characters.  To use the
former, see the International Character Set Support section of the
manual (*note International::).

   Emacs on Mac OS automatically changes the value of
`keyboard-coding-system' according to the current keyboard layout.  So
users don't need to set it manually, and even if set, it will be
changed when the keyboard layout change is detected next time.

   The Mac clipboard and the Emacs kill ring (*note Killing::) are
synchronized by default: you can yank a piece of text and paste it into
another Mac application, or cut or copy one in another Mac application
and yank it into a Emacs buffer.  This feature can be disabled by
setting `x-select-enable-clipboard' to `nil'.  One can still do copy
and paste with another application from the Edit menu.

   On Mac, the role of the coding system for selection that is set by
`set-selection-coding-system' (*note Communication Coding::) is
two-fold.  First, it is used as a preferred coding system for the
traditional text flavor that does not specify any particular encodings
and is mainly used by applications on Mac OS Classic.  Second, it
specifies the intermediate encoding for the UTF-16 text flavor that is
mainly used by applications on Mac OS X.

   When pasting UTF-16 text data from the clipboard, it is first
converted to the encoding specified by the selection coding system
using the converter in the Mac OS system, and then decoded into the
Emacs internal encoding using the converter in Emacs.  If the first
conversion failed, then the UTF-16 data is directly converted to Emacs
internal encoding using the converter in Emacs.  Copying UTF-16 text to
the clipboard goes through the inverse path.  The reason for this
two-pass decoding is to avoid subtle differences in Unicode mappings
between the Mac OS system and Emacs such as various kinds of hyphens,
and to minimize users' customization.  For example, users that mainly
use Latin characters would prefer Greek characters to be decoded into
the `mule-unicode-0100-24ff' charset, but Japanese users would prefer
them to be decoded into the `japanese-jisx0208' charset.  Since the
coding system for selection is automatically set according to the
system locale setting, users usually don't have to set it manually.

   The default language environment (*note Language Environments::) is
set according to the locale setting at the startup time.  On Mac OS,
the locale setting is consulted in the following order:

  1. Environment variables `LC_ALL', `LC_CTYPE' and `LANG' as in other
     systems.

  2. Preference `AppleLocale' that is set by default on Mac OS X 10.3
     and later.

  3. Preference `AppleLanguages' that is set by default on Mac OS X
     10.1 and later.

  4. Variable `mac-system-locale' that is derived from the system
     language and region codes.  This variable is available on all
     supported Mac OS versions including Mac OS Classic.

   The default values of almost all variables about coding systems are
also set according to the language environment.  So usually you don't
have to customize these variables manually.


File: emacs,  Node: Mac Environment Variables,  Next: Mac Directories,  Prev: Mac International,  Up: Mac OS

F.3 Environment Variables and Command Line Arguments.
=====================================================

On Mac OS X, when Emacs is run in a terminal, it inherits the values of
environment variables from the shell from which it is invoked.
However, when it is run from the Finder as a GUI application, it only
inherits environment variable values defined in the file
`~/.MacOSX/environment.plist' that affects all the applications invoked
from the Finder or the `open' command.

   Command line arguments are specified like

     /Applications/Emacs.app/Contents/MacOS/Emacs -g 80x25 &

if Emacs is installed at `/Applications/Emacs.app'.  If Emacs is
invoked like this, then it also inherits the values of environment
variables from the shell from which it is invoked.

   On Mac OS Classic, environment variables and command line arguments
for Emacs can be set by modifying the `STR#' resources 128 and 129,
respectively.  A common environment variable that one may want to set
is `HOME'.

   The way to set an environment variable is by adding a string of the
form

     ENV_VAR=VALUE

to resource `STR#' number 128 using `ResEdit'. To set up the program to
use unibyte characters exclusively, for example, add the string

     EMACS_UNIBYTE=1

   Although Emacs on Mac does not support X resources (*note X
Resources::) directly, one can use the Preferences system in place of X
resources.  For example, adding the line

     Emacs.cursorType: bar

to `~/.Xresources' in X11 corresponds to the execution of

     defaults write org.gnu.Emacs Emacs.cursorType bar

on Mac OS X.  One can use boolean or numeric values as well as string
values as follows:

     defaults write org.gnu.Emacs Emacs.toolBar -bool false
     defaults write org.gnu.Emacs Emacs.lineSpacing -int 3

Try `M-x man RET defaults RET' for the usage of the `defaults' command.
Alternatively, if you have Developer Tools installed on Mac OS X, you
can use Property List Editor to edit the file
`~/Library/Preferences/org.gnu.Emacs.plist'.


File: emacs,  Node: Mac Directories,  Next: Mac Font Specs,  Prev: Mac Environment Variables,  Up: Mac OS

F.4 Volumes and Directories on Mac
==================================

This node applies to Mac OS Classic only.

   The directory structure in Mac OS Classic is seen by Emacs as

     /VOLUMENAME/FILENAME

   So when Emacs requests a file name, doing file name completion on
`/' will display all volumes on the system.  You can use `..' to go up
a directory level.

   On Mac OS Classic, to access files and folders on the desktop, look
in the folder `Desktop Folder' in your boot volume (this folder is
usually invisible in the Mac `Finder').

   On Mac OS Classic, Emacs creates the Mac folder
`:Preferences:Emacs:' in the `System Folder' and uses it as the
temporary directory.  Emacs maps the directory name `/tmp/' to that.
Therefore it is best to avoid naming a volume `tmp'.  If everything
works correctly, the program should leave no files in it when it exits.
You should be able to set the environment variable `TMPDIR' to use
another directory but this folder will still be created.


File: emacs,  Node: Mac Font Specs,  Next: Mac Functions,  Prev: Mac Directories,  Up: Mac OS

F.5 Specifying Fonts on Mac
===========================

It is rare that you need to specify a font name in Emacs; usually you
specify face attributes instead.  For example, you can use 14pt Courier
by customizing the default face attributes for all frames:

     (set-face-attribute 'default nil
                         :family "courier" :height 140)

Alternatively, an interactive one is also available (*note Face
Customization::).

   But when you do need to specify a font name in Emacs on Mac, use a
standard X font name:

     -MAKER-FAMILY-WEIGHT-SLANT-WIDTHTYPE-STYLE...
     ...-PIXELS-HEIGHT-HORIZ-VERT-SPACING-WIDTH-CHARSET

*Note Font X::.  Wildcards are supported as they are on X.

   Emacs on Mac OS Classic uses QuickDraw Text routines for drawing
texts by default.  Emacs on Mac OS X uses ATSUI (Apple Type Services
for Unicode Imaging) as well as QuickDraw Text, and most of the
characters other than Chinese, Japanese, and Korean ones are drawn using
the former by default.

   ATSUI-compatible fonts have maker name `apple' and charset
`iso10646-1'.  For example, 12-point Monaco can be specified by the
name:

     -apple-monaco-medium-r-normal--12-*-*-*-*-*-iso10646-1

   Note that these names must be specified using a format containing all
14 `-'s (not by `-apple-monaco-medium-r-normal--12-*-iso10646-1', for
instance), because every ATSUI-compatible font is a scalable one.

   QuickDraw Text fonts have maker name `apple' and various charset
names other than `iso10646-1'.  Native Apple fonts in Mac Roman
encoding has charset `mac-roman'.  You can specify a `mac-roman' font
for ASCII characters like

     (add-to-list
      'default-frame-alist
      '(font . "-apple-monaco-medium-r-normal--13-*-*-*-*-*-mac-roman"))

but that does not extend to ISO-8859-1: specifying a `mac-roman' font
for Latin-1 characters introduces wrong glyphs.

   Native Apple Traditional Chinese, Simplified Chinese, Japanese,
Korean, Central European, Cyrillic, Symbol, and Dingbats fonts have the
charsets `big5-0', `gb2312.1980-0', `jisx0208.1983-sjis' and
`jisx0201.1976-0', `ksc5601.1989-0', `mac-centraleurroman',
`mac-cyrillic', `mac-symbol', and `mac-dingbats', respectively.

   The use of `create-fontset-from-fontset-spec' (*note Defining
Fontsets::) for defining fontsets often results in wrong ones especially
when using only OS-bundled QuickDraw Text fonts.  The recommended way to
use them is to create a fontset using
`create-fontset-from-mac-roman-font':

     (create-fontset-from-mac-roman-font
      "-apple-courier-medium-r-normal--13-*-*-*-*-*-mac-roman"
      nil "foo")

and then optionally specifying Chinese, Japanese, or Korean font
families using `set-fontset-font':

     (set-fontset-font "fontset-foo"
     		  'chinese-gb2312 '("song" . "gb2312.1980-0"))

   Single-byte fonts converted from GNU fonts in BDF format, which are
not in the Mac Roman encoding, have foundry, family, and character sets
encoded in the names of their font suitcases.  E.g., the font suitcase
`ETL-Fixed-ISO8859-1' contains fonts which can be referred to by the
name `-ETL-fixed-*-iso8859-1'.

   Mac OS X 10.2 or later can use two types of text renderings: Quartz
2D (aka Core Graphics) and QuickDraw.  By default, Emacs uses the
former on such versions.  It can be changed by setting
`mac-allow-anti-aliasing' to `t' (Quartz 2D) or `nil' (QuickDraw).
Both ATSUI and QuickDraw Text drawings are affected by the value of
this variable.

   Appearance of text in small sizes will also be affected by the "Turn
off text smoothing for font sizes N and smaller" setting in the General
pane (Mac OS X 10.1 or 10.2) or in the Appearance pane (10.3 or later)
of the System Preferences.  This threshold can alternatively be set
just for Emacs (i.e., not as the system-wide setting) using the
`defaults' command:

     defaults write org.gnu.Emacs AppleAntiAliasingThreshold N


File: emacs,  Node: Mac Functions,  Prev: Mac Font Specs,  Up: Mac OS

F.6 Mac-Specific Lisp Functions
===============================

The function `do-applescript' takes a string argument, executes it as
an AppleScript command, and returns the result as a string.

   The function `mac-file-name-to-posix' takes a Mac file name and
returns the GNU or Unix equivalent.  The function
`posix-file-name-to-mac' performs the opposite conversion.  They are
useful for constructing AppleScript commands to be passed to
`do-applescript'.

   The functions `mac-set-file-creator', `mac-get-file-creator',
`mac-set-file-type', and `mac-get-file-type' can be used to set and get
creator and file codes.

   The function `mac-get-preference' returns the preferences value
converted to a Lisp object for a specified key and application.


File: emacs,  Node: Microsoft Windows,  Next: Manifesto,  Prev: Mac OS,  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:

* 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'.
* 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 Misc::        Miscellaneous Windows features.

* MS-DOS::              Using Emacs on MS-DOS (otherwise known as "MS-DOG").


File: emacs,  Node: Text and Binary,  Next: Windows Files,  Up: Microsoft Windows

G.1 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.2 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.

   If the variable `w32-get-true-file-attributes' is `local' (the
default), Emacs tries to determine the accurate link counts and file
types for files on local fixed drives.  Any other non-`nil' value means
do this even on remote and removable volumes, where it could slow down
Dired and other similar features; `nil' means never do this.  Setting
this option to non-`nil' is only useful on NTFS volumes.


File: emacs,  Node: ls in Lisp,  Next: Windows HOME,  Prev: Windows Files,  Up: Microsoft Windows

G.3 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.4 HOME Directory on MS-Windows
================================

The Windows equivalent of the `HOME' directory is the "user-specific
application data directory".  The actual location depends on your
Windows version and system configuration; typical values are
`C:\Documents and Settings\USERNAME\Application Data' on Windows 2K/XP
and later, and either `C:\WINDOWS\Application Data' or
`C:\WINDOWS\Profiles\USERNAME\Application Data' on the older Windows
9X/ME systems.

   The home directory is where your init file `.emacs' is stored.  When
Emacs starts, it first checks whether the environment variable `HOME'
is set.  If it is, it looks for the init file in the directory pointed
by `HOME'.  If `HOME' is not defined, Emacs checks for an existing
`.emacs' file in `C:\', the root directory of drive `C:'(1).  If
there's no such file in `C:\', Emacs next uses the Windows system calls
to find out the exact location of your application data directory.  If
that fails as well, Emacs falls back to `C:\'.

   Whatever the final place is, Emacs sets the value of the `HOME'
environment variable to point to it, and it will use that location for
other files and directories it normally 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>'.

   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) The check in `C:\' is in preference to the application data
directory for compatibility with older versions of Emacs, which didn't
check the application data directory.


File: emacs,  Node: Windows Keyboard,  Next: Windows Mouse,  Prev: Windows HOME,  Up: Microsoft Windows

G.5 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.

   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.6 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.7 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 Misc,  Prev: Windows Processes,  Up: Microsoft Windows

G.8 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 Misc,  Next: MS-DOS,  Prev: Windows Printing,  Up: Microsoft Windows

G.9 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 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.
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.

   The variable `w32-list-proportional-fonts' controls whether
proportional fonts are included in the font selection dialog.  If its
value is non-`nil', these fonts will be included.  The default is `nil'.


File: emacs,  Node: MS-DOS,  Prev: Windows Misc,  Up: Microsoft Windows

G.10 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.10.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.10.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.10.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.10.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.10.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.
You may need to create the `cpNNN' coding system with `M-x
codepage-setup'.

   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.10.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.  For other operating systems, see the `code-pages.el' package,
which implements support for MS-DOS- and MS-Windows-specific encodings
for all platforms other than MS-DOS.

`M-x dos-codepage-setup'
     Set up Emacs display and coding systems as appropriate for the
     current DOS codepage.

`M-x codepage-setup'
     Create a coding system for a certain 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.

   If you invoke Emacs on MS-DOS with the `--unibyte' option (*note
Initial Options::), Emacs does not perform any conversion of non-ASCII
characters.  Instead, it reads and writes any non-ASCII characters
verbatim, and sends their 8-bit codes to the display verbatim.  Thus,
unibyte Emacs on MS-DOS supports the current codepage, whatever it may
be, but cannot even represent any other characters.

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

   Not all characters in DOS codepages correspond to ISO 8859
characters--some are used for other purposes, such as box-drawing
characters and other graphics.  Emacs maps these characters to two
special character sets called `eight-bit-control' and
`eight-bit-graphic', and displays them as their IBM glyphs.  However,
you should be aware that other systems might display these characters
differently, so you should avoid them in text that might be copied to a
different operating system, or even to another DOS machine that uses a
different codepage.

   Emacs supports many other characters sets aside from ISO 8859, but it
cannot display them on MS-DOS.  So if one of these multibyte characters
appears in a buffer, Emacs on MS-DOS displays them as specified by the
`dos-unsupported-character-glyph' variable; by default, this glyph is
an empty triangle.  Use the `C-u C-x =' command to display the actual
code and character set of such characters.  *Note Position Info::.

   By default, Emacs defines a coding system to support the current
codepage.  To define a coding system for some other codepage (e.g., to
visit a file written on a DOS machine in another country), use the `M-x
codepage-setup' command.  It prompts for the 3-digit code of the
codepage, with completion, then creates the coding system for the
specified codepage.  You can then use the new coding system to read and
write files, but you must specify it explicitly for the file command
when you want to use it (*note Text Coding::).

   These coding systems are also useful for visiting a file encoded
using a DOS codepage, using Emacs running on some other operating
system.

   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.  Support for codepages in the Windows
port of Emacs is part of the `code-pages.el' package.

   ---------- 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.10.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'.


File: emacs,  Node: Manifesto,  Prev: Microsoft Windows,  Up: Top

The GNU Manifesto
*****************

     The GNU Manifesto which appears below was written by Richard
     Stallman at the beginning of the GNU project, to ask for
     participation and support.  For the first few years, it was
     updated in minor ways to account for developments, but now it
     seems best to leave it unchanged as most people have seen it.

     Since that time, we have learned about certain common
     misunderstandings that different wording could help avoid.
     Footnotes added in 1993 help clarify these points.

     For up-to-date information about available GNU software, please see
     our web site, `http://www.gnu.org'.  For software tasks and other
     ways to contribute, see `http://www.gnu.org/help'.

What's GNU?  Gnu's Not Unix!
============================

GNU, which stands for Gnu's Not Unix, is the name for the complete
Unix-compatible software system which I am writing so that I can give it
away free to everyone who can use it.(1) Several other volunteers are
helping me.  Contributions of time, money, programs and equipment are
greatly needed.

   So far we have an Emacs text editor with Lisp for writing editor
commands, a source level debugger, a yacc-compatible parser generator,
a linker, and around 35 utilities.  A shell (command interpreter) is
nearly completed.  A new portable optimizing C compiler has compiled
itself and may be released this year.  An initial kernel exists but
many more features are needed to emulate Unix.  When the kernel and
compiler are finished, it will be possible to distribute a GNU system
suitable for program development.  We will use TeX as our text
formatter, but an nroff is being worked on.  We will use the free,
portable X window system as well.  After this we will add a portable
Common Lisp, an Empire game, a spreadsheet, and hundreds of other
things, plus on-line documentation.  We hope to supply, eventually,
everything useful that normally comes with a Unix system, and more.

   GNU will be able to run Unix programs, but will not be identical to
Unix.  We will make all improvements that are convenient, based on our
experience with other operating systems.  In particular, we plan to
have longer file names, file version numbers, a crashproof file system,
file name completion perhaps, terminal-independent display support, and
perhaps eventually a Lisp-based window system through which several
Lisp programs and ordinary Unix programs can share a screen.  Both C
and Lisp will be available as system programming languages.  We will
try to support UUCP, MIT Chaosnet, and Internet protocols for
communication.

   GNU is aimed initially at machines in the 68000/16000 class with
virtual memory, because they are the easiest machines to make it run
on.  The extra effort to make it run on smaller machines will be left
to someone who wants to use it on them.

   To avoid horrible confusion, please pronounce the `G' in the word
`GNU' when it is the name of this project.

Why I Must Write GNU
====================

I consider that the golden rule requires that if I like a program I must
share it with other people who like it.  Software sellers want to divide
the users and conquer them, making each user agree not to share with
others.  I refuse to break solidarity with other users in this way.  I
cannot in good conscience sign a nondisclosure agreement or a software
license agreement.  For years I worked within the Artificial
Intelligence Lab to resist such tendencies and other inhospitalities,
but eventually they had gone too far: I could not remain in an
institution where such things are done for me against my will.

   So that I can continue to use computers without dishonor, I have
decided to put together a sufficient body of free software so that I
will be able to get along without any software that is not free.  I
have resigned from the AI lab to deny MIT any legal excuse to prevent
me from giving GNU away.

Why GNU Will Be Compatible with Unix
====================================

Unix is not my ideal system, but it is not too bad.  The essential
features of Unix seem to be good ones, and I think I can fill in what
Unix lacks without spoiling them.  And a system compatible with Unix
would be convenient for many other people to adopt.

How GNU Will Be Available
=========================

GNU is not in the public domain.  Everyone will be permitted to modify
and redistribute GNU, but no distributor will be allowed to restrict its
further redistribution.  That is to say, proprietary modifications will
not be allowed.  I want to make sure that all versions of GNU remain
free.

Why Many Other Programmers Want to Help
=======================================

I have found many other programmers who are excited about GNU and want
to help.

   Many programmers are unhappy about the commercialization of system
software.  It may enable them to make more money, but it requires them
to feel in conflict with other programmers in general rather than feel
as comrades.  The fundamental act of friendship among programmers is the
sharing of programs; marketing arrangements now typically used
essentially forbid programmers to treat others as friends.  The
purchaser of software must choose between friendship and obeying the
law.  Naturally, many decide that friendship is more important.  But
those who believe in law often do not feel at ease with either choice.
They become cynical and think that programming is just a way of making
money.

   By working on and using GNU rather than proprietary programs, we can
be hospitable to everyone and obey the law.  In addition, GNU serves as
an example to inspire and a banner to rally others to join us in
sharing.  This can give us a feeling of harmony which is impossible if
we use software that is not free.  For about half the programmers I
talk to, this is an important happiness that money cannot replace.

How You Can Contribute
======================

I am asking computer manufacturers for donations of machines and money.
I'm asking individuals for donations of programs and work.

   One consequence you can expect if you donate machines is that GNU
will run on them at an early date.  The machines should be complete,
ready to use systems, approved for use in a residential area, and not
in need of sophisticated cooling or power.

   I have found very many programmers eager to contribute part-time
work for GNU.  For most projects, such part-time distributed work would
be very hard to coordinate; the independently-written parts would not
work together.  But for the particular task of replacing Unix, this
problem is absent.  A complete Unix system contains hundreds of utility
programs, each of which is documented separately.  Most interface
specifications are fixed by Unix compatibility.  If each contributor
can write a compatible replacement for a single Unix utility, and make
it work properly in place of the original on a Unix system, then these
utilities will work right when put together.  Even allowing for Murphy
to create a few unexpected problems, assembling these components will
be a feasible task.  (The kernel will require closer communication and
will be worked on by a small, tight group.)

   If I get donations of money, I may be able to hire a few people full
or part time.  The salary won't be high by programmers' standards, but
I'm looking for people for whom building community spirit is as
important as making money.  I view this as a way of enabling dedicated
people to devote their full energies to working on GNU by sparing them
the need to make a living in another way.

Why All Computer Users Will Benefit
===================================

Once GNU is written, everyone will be able to obtain good system
software free, just like air.(2)

   This means much more than just saving everyone the price of a Unix
license.  It means that much wasteful duplication of system programming
effort will be avoided.  This effort can go instead into advancing the
state of the art.

   Complete system sources will be available to everyone.  As a result,
a user who needs changes in the system will always be free to make them
himself, or hire any available programmer or company to make them for
him.  Users will no longer be at the mercy of one programmer or company
which owns the sources and is in sole position to make changes.

   Schools will be able to provide a much more educational environment
by encouraging all students to study and improve the system code.
Harvard's computer lab used to have the policy that no program could be
installed on the system if its sources were not on public display, and
upheld it by actually refusing to install certain programs.  I was very
much inspired by this.

   Finally, the overhead of considering who owns the system software
and what one is or is not entitled to do with it will be lifted.

   Arrangements to make people pay for using a program, including
licensing of copies, always incur a tremendous cost to society through
the cumbersome mechanisms necessary to figure out how much (that is,
which programs) a person must pay for.  And only a police state can
force everyone to obey them.  Consider a space station where air must
be manufactured at great cost: charging each breather per liter of air
may be fair, but wearing the metered gas mask all day and all night is
intolerable even if everyone can afford to pay the air bill.  And the
TV cameras everywhere to see if you ever take the mask off are
outrageous.  It's better to support the air plant with a head tax and
chuck the masks.

   Copying all or parts of a program is as natural to a programmer as
breathing, and as productive.  It ought to be as free.

Some Easily Rebutted Objections to GNU's Goals
==============================================

     "Nobody will use it if it is free, because that means they can't
     rely on any support."

     "You have to charge for the program to pay for providing the
     support."

   If people would rather pay for GNU plus service than get GNU free
without service, a company to provide just service to people who have
obtained GNU free ought to be profitable.(3)

   We must distinguish between support in the form of real programming
work and mere handholding.  The former is something one cannot rely on
from a software vendor.  If your problem is not shared by enough
people, the vendor will tell you to get lost.

   If your business needs to be able to rely on support, the only way
is to have all the necessary sources and tools.  Then you can hire any
available person to fix your problem; you are not at the mercy of any
individual.  With Unix, the price of sources puts this out of
consideration for most businesses.  With GNU this will be easy.  It is
still possible for there to be no available competent person, but this
problem cannot be blamed on distribution arrangements.  GNU does not
eliminate all the world's problems, only some of them.

   Meanwhile, the users who know nothing about computers need
handholding: doing things for them which they could easily do
themselves but don't know how.

   Such services could be provided by companies that sell just
hand-holding and repair service.  If it is true that users would rather
spend money and get a product with service, they will also be willing
to buy the service having got the product free.  The service companies
will compete in quality and price; users will not be tied to any
particular one.  Meanwhile, those of us who don't need the service
should be able to use the program without paying for the service.

     "You cannot reach many people without advertising, and you must
     charge for the program to support that."

     "It's no use advertising a program people can get free."

   There are various forms of free or very cheap publicity that can be
used to inform numbers of computer users about something like GNU.  But
it may be true that one can reach more microcomputer users with
advertising.  If this is really so, a business which advertises the
service of copying and mailing GNU for a fee ought to be successful
enough to pay for its advertising and more.  This way, only the users
who benefit from the advertising pay for it.

   On the other hand, if many people get GNU from their friends, and
such companies don't succeed, this will show that advertising was not
really necessary to spread GNU.  Why is it that free market advocates
don't want to let the free market decide this?(4)

     "My company needs a proprietary operating system to get a
     competitive edge."

   GNU will remove operating system software from the realm of
competition.  You will not be able to get an edge in this area, but
neither will your competitors be able to get an edge over you.  You and
they will compete in other areas, while benefiting mutually in this
one.  If your business is selling an operating system, you will not
like GNU, but that's tough on you.  If your business is something else,
GNU can save you from being pushed into the expensive business of
selling operating systems.

   I would like to see GNU development supported by gifts from many
manufacturers and users, reducing the cost to each.(5)

     "Don't programmers deserve a reward for their creativity?"

   If anything deserves a reward, it is social contribution.
Creativity can be a social contribution, but only in so far as society
is free to use the results.  If programmers deserve to be rewarded for
creating innovative programs, by the same token they deserve to be
punished if they restrict the use of these programs.

     "Shouldn't a programmer be able to ask for a reward for his
     creativity?"

   There is nothing wrong with wanting pay for work, or seeking to
maximize one's income, as long as one does not use means that are
destructive.  But the means customary in the field of software today
are based on destruction.

   Extracting money from users of a program by restricting their use of
it is destructive because the restrictions reduce the amount and the
ways that the program can be used.  This reduces the amount of wealth
that humanity derives from the program.  When there is a deliberate
choice to restrict, the harmful consequences are deliberate destruction.

   The reason a good citizen does not use such destructive means to
become wealthier is that, if everyone did so, we would all become
poorer from the mutual destructiveness.  This is Kantian ethics; or,
the Golden Rule.  Since I do not like the consequences that result if
everyone hoards information, I am required to consider it wrong for one
to do so.  Specifically, the desire to be rewarded for one's creativity
does not justify depriving the world in general of all or part of that
creativity.

     "Won't programmers starve?"

   I could answer that nobody is forced to be a programmer.  Most of us
cannot manage to get any money for standing on the street and making
faces.  But we are not, as a result, condemned to spend our lives
standing on the street making faces, and starving.  We do something
else.

   But that is the wrong answer because it accepts the questioner's
implicit assumption: that without ownership of software, programmers
cannot possibly be paid a cent.  Supposedly it is all or nothing.

   The real reason programmers will not starve is that it will still be
possible for them to get paid for programming; just not paid as much as
now.

   Restricting copying is not the only basis for business in software.
It is the most common basis because it brings in the most money.  If it
were prohibited, or rejected by the customer, software business would
move to other bases of organization which are now used less often.
There are always numerous ways to organize any kind of business.

   Probably programming will not be as lucrative on the new basis as it
is now.  But that is not an argument against the change.  It is not
considered an injustice that sales clerks make the salaries that they
now do.  If programmers made the same, that would not be an injustice
either.  (In practice they would still make considerably more than
that.)

     "Don't people have a right to control how their creativity is
     used?"

   "Control over the use of one's ideas" really constitutes control over
other people's lives; and it is usually used to make their lives more
difficult.

   People who have studied the issue of intellectual property rights(6)
carefully (such as lawyers) say that there is no intrinsic right to
intellectual property.  The kinds of supposed intellectual property
rights that the government recognizes were created by specific acts of
legislation for specific purposes.

   For example, the patent system was established to encourage
inventors to disclose the details of their inventions.  Its purpose was
to help society rather than to help inventors.  At the time, the life
span of 17 years for a patent was short compared with the rate of
advance of the state of the art.  Since patents are an issue only among
manufacturers, for whom the cost and effort of a license agreement are
small compared with setting up production, the patents often do not do
much harm.  They do not obstruct most individuals who use patented
products.

   The idea of copyright did not exist in ancient times, when authors
frequently copied other authors at length in works of non-fiction.  This
practice was useful, and is the only way many authors' works have
survived even in part.  The copyright system was created expressly for
the purpose of encouraging authorship.  In the domain for which it was
invented--books, which could be copied economically only on a printing
press--it did little harm, and did not obstruct most of the individuals
who read the books.

   All intellectual property rights are just licenses granted by society
because it was thought, rightly or wrongly, that society as a whole
would benefit by granting them.  But in any particular situation, we
have to ask: are we really better off granting such license?  What kind
of act are we licensing a person to do?

   The case of programs today is very different from that of books a
hundred years ago.  The fact that the easiest way to copy a program is
from one neighbor to another, the fact that a program has both source
code and object code which are distinct, and the fact that a program is
used rather than read and enjoyed, combine to create a situation in
which a person who enforces a copyright is harming society as a whole
both materially and spiritually; in which a person should not do so
regardless of whether the law enables him to.

     "Competition makes things get done better."

   The paradigm of competition is a race: by rewarding the winner, we
encourage everyone to run faster.  When capitalism really works this
way, it does a good job; but its defenders are wrong in assuming it
always works this way.  If the runners forget why the reward is offered
and become intent on winning, no matter how, they may find other
strategies--such as, attacking other runners.  If the runners get into
a fist fight, they will all finish late.

   Proprietary and secret software is the moral equivalent of runners
in a fist fight.  Sad to say, the only referee we've got does not seem
to object to fights; he just regulates them ("For every ten yards you
run, you can fire one shot").  He really ought to break them up, and
penalize runners for even trying to fight.

     "Won't everyone stop programming without a monetary incentive?"

   Actually, many people will program with absolutely no monetary
incentive.  Programming has an irresistible fascination for some
people, usually the people who are best at it.  There is no shortage of
professional musicians who keep at it even though they have no hope of
making a living that way.

   But really this question, though commonly asked, is not appropriate
to the situation.  Pay for programmers will not disappear, only become
less.  So the right question is, will anyone program with a reduced
monetary incentive?  My experience shows that they will.

   For more than ten years, many of the world's best programmers worked
at the Artificial Intelligence Lab for far less money than they could
have had anywhere else.  They got many kinds of non-monetary rewards:
fame and appreciation, for example.  And creativity is also fun, a
reward in itself.

   Then most of them left when offered a chance to do the same
interesting work for a lot of money.

   What the facts show is that people will program for reasons other
than riches; but if given a chance to make a lot of money as well, they
will come to expect and demand it.  Low-paying organizations do poorly
in competition with high-paying ones, but they do not have to do badly
if the high-paying ones are banned.

     "We need the programmers desperately.  If they demand that we stop
     helping our neighbors, we have to obey."

   You're never so desperate that you have to obey this sort of demand.
Remember: millions for defense, but not a cent for tribute!

     "Programmers need to make a living somehow."

   In the short run, this is true.  However, there are plenty of ways
that programmers could make a living without selling the right to use a
program.  This way is customary now because it brings programmers and
businessmen the most money, not because it is the only way to make a
living.  It is easy to find other ways if you want to find them.  Here
are a number of examples.

   A manufacturer introducing a new computer will pay for the porting of
operating systems onto the new hardware.

   The sale of teaching, hand-holding and maintenance services could
also employ programmers.

   People with new ideas could distribute programs as freeware(7),
asking for donations from satisfied users, or selling hand-holding
services.  I have met people who are already working this way
successfully.

   Users with related needs can form users' groups, and pay dues.  A
group would contract with programming companies to write programs that
the group's members would like to use.

   All sorts of development can be funded with a Software Tax:

     Suppose everyone who buys a computer has to pay x percent of the
     price as a software tax.  The government gives this to an agency
     like the NSF to spend on software development.

     But if the computer buyer makes a donation to software development
     himself, he can take a credit against the tax.  He can donate to
     the project of his own choosing--often, chosen because he hopes to
     use the results when it is done.  He can take a credit for any
     amount of donation up to the total tax he had to pay.

     The total tax rate could be decided by a vote of the payers of the
     tax, weighted according to the amount they will be taxed on.

     The consequences:

        * The computer-using community supports software development.

        * This community decides what level of support is needed.

        * Users who care which projects their share is spent on can
          choose this for themselves.

   In the long run, making programs free is a step toward the
post-scarcity world, where nobody will have to work very hard just to
make a living.  People will be free to devote themselves to activities
that are fun, such as programming, after spending the necessary ten
hours a week on required tasks such as legislation, family counseling,
robot repair and asteroid prospecting.  There will be no need to be
able to make a living from programming.

   We have already greatly reduced the amount of work that the whole
society must do for its actual productivity, but only a little of this
has translated itself into leisure for workers because much
nonproductive activity is required to accompany productive activity.
The main causes of this are bureaucracy and isometric struggles against
competition.  Free software will greatly reduce these drains in the
area of software production.  We must do this, in order for technical
gains in productivity to translate into less work for us.

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

   (1) The wording here was careless.  The intention was that nobody
would have to pay for _permission_ to use the GNU system.  But the
words don't make this clear, and people often interpret them as saying
that copies of GNU should always be distributed at little or no charge.
That was never the intent; later on, the manifesto mentions the
possibility of companies providing the service of distribution for a
profit.  Subsequently I have learned to distinguish carefully between
"free" in the sense of freedom and "free" in the sense of price.  Free
software is software that users have the freedom to distribute and
change.  Some users may obtain copies at no charge, while others pay to
obtain copies--and if the funds help support improving the software, so
much the better.  The important thing is that everyone who has a copy
has the freedom to cooperate with others in using it.

   (2) This is another place I failed to distinguish carefully between
the two different meanings of "free."  The statement as it stands is
not false--you can get copies of GNU software at no charge, from your
friends or over the net.  But it does suggest the wrong idea.

   (3) Several such companies now exist.

   (4) The Free Software Foundation raises most of its funds from a
distribution service, although it is a charity rather than a company.
If _no one_ chooses to obtain copies by ordering from the FSF, it will
be unable to do its work.  But this does not mean that proprietary
restrictions are justified to force every user to pay.  If a small
fraction of all the users order copies from the FSF, that is sufficient
to keep the FSF afloat.  So we ask users to choose to support us in
this way.  Have you done your part?

   (5) A group of computer companies recently pooled funds to support
maintenance of the GNU C Compiler.

   (6) In the 80s I had not yet realized how confusing it was to speak
of "the issue" of "intellectual property."  That term is obviously
biased; more subtle is the fact that it lumps together various
disparate laws which raise very different issues.  Nowadays I urge
people to reject the term "intellectual property" entirely, lest it
lead others to suppose that those laws form one coherent issue.  The
way to be clear is to discuss patents, copyrights, and trademarks
separately.  See `http://www.gnu.org/philosophy/not-ipr.xhtml' for more
explanation of how this term spreads confusion and bias.

   (7) Subsequently we have discovered the need to distinguish between
"free software" and "freeware".  The term "freeware" means software you
are free to redistribute, but usually you are not free to study and
change the source code, so most of it is not free software.  See
`http://www.gnu.org/philosophy/words-to-avoid.html' for more
explanation.

