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

This is edition 3.0 of the GNU Emacs Lisp Reference Manual,
corresponding to Emacs version 23.4.

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

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

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

INFO-DIR-SECTION GNU Emacs Lisp
START-INFO-DIR-ENTRY
* Elisp: (elisp).       The Emacs Lisp Reference Manual.
END-INFO-DIR-ENTRY


File: elisp,  Node: GPL,  Next: Tips,  Prev: GNU Free Documentation License,  Up: Top

Appendix C 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: elisp,  Node: Tips,  Next: GNU Emacs Internals,  Prev: GPL,  Up: Top

Appendix D Tips and Conventions
*******************************

This chapter describes no additional features of Emacs Lisp.  Instead
it gives advice on making effective use of the features described in the
previous chapters, and describes conventions Emacs Lisp programmers
should follow.

   You can automatically check some of the conventions described below
by running the command `M-x checkdoc RET' when visiting a Lisp file.
It cannot check all of the conventions, and not all the warnings it
gives necessarily correspond to problems, but it is worth examining them
all.

* Menu:

* Coding Conventions::        Conventions for clean and robust programs.
* Key Binding Conventions::   Which keys should be bound by which programs.
* Programming Tips::          Making Emacs code fit smoothly in Emacs.
* Compilation Tips::          Making compiled code run fast.
* Warning Tips::              Turning off compiler warnings.
* Documentation Tips::        Writing readable documentation strings.
* Comment Tips::              Conventions for writing comments.
* Library Headers::           Standard headers for library packages.


File: elisp,  Node: Coding Conventions,  Next: Key Binding Conventions,  Up: Tips

D.1 Emacs Lisp Coding Conventions
=================================

Here are conventions that you should follow when writing Emacs Lisp
code intended for widespread use:

   * Simply loading a package should not change Emacs's editing
     behavior.  Include a command or commands to enable and disable the
     feature, or to invoke it.

     This convention is mandatory for any file that includes custom
     definitions.  If fixing such a file to follow this convention
     requires an incompatible change, go ahead and make the
     incompatible change; don't postpone it.

   * You should choose a short word to distinguish your program from
     other Lisp programs.  The names of all global variables,
     constants, and functions in your program should begin with that
     chosen prefix.  Separate the prefix from the rest of the name with
     a hyphen, `-'.  This practice helps avoid name conflicts, since
     all global variables in Emacs Lisp share the same name space, and
     all functions share another name space(1)

     Occasionally, for a command name intended for users to use, it is
     more convenient if some words come before the package's name
     prefix.  And constructs that define functions, variables, etc.,
     work better if they start with `defun' or `defvar', so put the
     name prefix later on in the name.

     This recommendation applies even to names for traditional Lisp
     primitives that are not primitives in Emacs Lisp--such as
     `copy-list'.  Believe it or not, there is more than one plausible
     way to define `copy-list'.  Play it safe; append your name prefix
     to produce a name like `foo-copy-list' or `mylib-copy-list'
     instead.

     If you write a function that you think ought to be added to Emacs
     under a certain name, such as `twiddle-files', don't call it by
     that name in your program.  Call it `mylib-twiddle-files' in your
     program, and send mail to `bug-gnu-emacs@gnu.org' suggesting we add
     it to Emacs.  If and when we do, we can change the name easily
     enough.

     If one prefix is insufficient, your package can use two or three
     alternative common prefixes, so long as they make sense.

   * Put a call to `provide' at the end of each separate Lisp file.
     *Note Named Features::.

   * If a file requires certain other Lisp programs to be loaded
     beforehand, then the comments at the beginning of the file should
     say so.  Also, use `require' to make sure they are loaded.  *Note
     Named Features::.

   * If a file FOO uses a macro defined in another file BAR, but does
     not use any functions or variables defined in BAR, then FOO should
     contain the following expression:

          (eval-when-compile (require 'BAR))

     This tells Emacs to load BAR just before byte-compiling FOO, so
     that the macro definition is available during compilation.  Using
     `eval-when-compile' avoids loading BAR when the compiled version
     of FOO is _used_.  It should be called before the first use of the
     macro in the file.  *Note Compiling Macros::.

   * Please don't require the `cl' package of Common Lisp extensions at
     run time.  Use of this package is optional, and it is not part of
     the standard Emacs namespace.  If your package loads `cl' at run
     time, that could cause name clashes for users who don't use that
     package.

     However, there is no problem with using the `cl' package at
     compile time, with `(eval-when-compile (require 'cl))'.  That's
     sufficient for using the macros in the `cl' package, because the
     compiler expands them before generating the byte-code.

   * When defining a major mode, please follow the major mode
     conventions.  *Note Major Mode Conventions::.

   * When defining a minor mode, please follow the minor mode
     conventions.  *Note Minor Mode Conventions::.

   * If the purpose of a function is to tell you whether a certain
     condition is true or false, give the function a name that ends in
     `p' (which stands for "predicate").  If the name is one word, add
     just `p'; if the name is multiple words, add `-p'.  Examples are
     `framep' and `frame-live-p'.

   * If the purpose of a variable is to store a single function, give
     it a name that ends in `-function'.  If the purpose of a variable
     is to store a list of functions (i.e., the variable is a hook),
     please follow the naming conventions for hooks.  *Note Hooks::.

   * If loading the file adds functions to hooks, define a function
     `FEATURE-unload-hook', where FEATURE is the name of the feature
     the package provides, and make it undo any such changes.  Using
     `unload-feature' to unload the file will run this function.  *Note
     Unloading::.

   * It is a bad idea to define aliases for the Emacs primitives.
     Normally you should use the standard names instead.  The case
     where an alias may be useful is where it facilitates backwards
     compatibility or portability.

   * If a package needs to define an alias or a new function for
     compatibility with some other version of Emacs, name it with the
     package prefix, not with the raw name with which it occurs in the
     other version.  Here is an example from Gnus, which provides many
     examples of such compatibility issues.

          (defalias 'gnus-point-at-bol
            (if (fboundp 'point-at-bol)
                'point-at-bol
              'line-beginning-position))

   * Redefining or advising an Emacs primitive is a bad idea.  It may do
     the right thing for a particular program, but there is no telling
     what other programs might break as a result.

   * It is likewise a bad idea for one Lisp package to advise a
     function in another Lisp package (*note Advising Functions::).

   * Avoid using `eval-after-load' in libraries and packages (*note
     Hooks for Loading::).  This feature is meant for personal
     customizations; using it in a Lisp program is unclean, because it
     modifies the behavior of another Lisp file in a way that's not
     visible in that file.  This is an obstacle for debugging, much
     like advising a function in the other package.

   * If a file does replace any of the standard functions or library
     programs of Emacs, prominent comments at the beginning of the file
     should say which functions are replaced, and how the behavior of
     the replacements differs from that of the originals.

   * Constructs that define a function or variable should be macros,
     not functions, and their names should start with `def'.

   * A macro that defines a function or variable should have a name that
     starts with `define-'.  The macro should receive the name to be
     defined as the first argument.  That will help various tools find
     the definition automatically.  Avoid constructing the names in the
     macro itself, since that would confuse these tools.

   * Please keep the names of your Emacs Lisp source files to 13
     characters or less.  This way, if the files are compiled, the
     compiled files' names will be 14 characters or less, which is
     short enough to fit on all kinds of Unix systems.

   * In some other systems there is a convention of choosing variable
     names that begin and end with `*'.  We don't use that convention
     in Emacs Lisp, so please don't use it in your programs.  (Emacs
     uses such names only for special-purpose buffers.)  The users will
     find Emacs more coherent if all libraries use the same conventions.

   * If your program contains non-ASCII characters in string or
     character constants, you should make sure Emacs always decodes
     these characters the same way, regardless of the user's settings.
     The easiest way to do this is to use the coding system
     `utf-8-emacs' (*note Coding System Basics::), and specify that
     coding in the `-*-' line or the local variables list.  *Note Local
     Variables in Files: (emacs)File variables.

          ;; XXX.el  -*- coding: utf-8-emacs; -*-

   * Indent each function with `C-M-q' (`indent-sexp') using the
     default indentation parameters.

   * Don't make a habit of putting close-parentheses on lines by
     themselves; Lisp programmers find this disconcerting.

   * Please put a copyright notice and copying permission notice on the
     file if you distribute copies.  Use a notice like this one:

          ;; Copyright (C) YEAR NAME

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

     If you have signed papers to assign the copyright to the
     Foundation, then use `Free Software Foundation, Inc.' as NAME.
     Otherwise, use your name.  *Note Library Headers::.

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

   (1) The benefits of a Common Lisp-style package system are
considered not to outweigh the costs.


File: elisp,  Node: Key Binding Conventions,  Next: Programming Tips,  Prev: Coding Conventions,  Up: Tips

D.2 Key Binding Conventions
===========================

   * Many special major modes, like Dired, Info, Compilation, and Occur,
     are designed to handle read-only text that contains "hyper-links".
     Such a major mode should redefine `mouse-2' and <RET> to follow
     the links.  It should also set up a `follow-link' condition, so
     that the link obeys `mouse-1-click-follows-link'.  *Note Clickable
     Text::.  *Note Buttons::, for an easy method of implementing such
     clickable links.

   * Don't define `C-c LETTER' as a key in Lisp programs.  Sequences
     consisting of `C-c' and a letter (either upper or lower case) are
     reserved for users; they are the *only* sequences reserved for
     users, so do not block them.

     Changing all the Emacs major modes to respect this convention was a
     lot of work; abandoning this convention would make that work go to
     waste, and inconvenience users.  Please comply with it.

   * Function keys <F5> through <F9> without modifier keys are also
     reserved for users to define.

   * Sequences consisting of `C-c' followed by a control character or a
     digit are reserved for major modes.

   * Sequences consisting of `C-c' followed by `{', `}', `<', `>', `:'
     or `;' are also reserved for major modes.

   * Sequences consisting of `C-c' followed by any other punctuation
     character are allocated for minor modes.  Using them in a major
     mode is not absolutely prohibited, but if you do that, the major
     mode binding may be shadowed from time to time by minor modes.

   * Don't bind `C-h' following any prefix character (including `C-c').
     If you don't bind `C-h', it is automatically available as a help
     character for listing the subcommands of the prefix character.

   * Don't bind a key sequence ending in <ESC> except following another
     <ESC>.  (That is, it is OK to bind a sequence ending in `<ESC>
     <ESC>'.)

     The reason for this rule is that a non-prefix binding for <ESC> in
     any context prevents recognition of escape sequences as function
     keys in that context.

   * Anything which acts like a temporary mode or state which the user
     can enter and leave should define `<ESC> <ESC>' or `<ESC> <ESC>
     <ESC>' as a way to escape.

     For a state which accepts ordinary Emacs commands, or more
     generally any kind of state in which <ESC> followed by a function
     key or arrow key is potentially meaningful, then you must not
     define `<ESC> <ESC>', since that would preclude recognizing an
     escape sequence after <ESC>.  In these states, you should define
     `<ESC> <ESC> <ESC>' as the way to escape.  Otherwise, define
     `<ESC> <ESC>' instead.


File: elisp,  Node: Programming Tips,  Next: Compilation Tips,  Prev: Key Binding Conventions,  Up: Tips

D.3 Emacs Programming Tips
==========================

Following these conventions will make your program fit better into
Emacs when it runs.

   * Don't use `next-line' or `previous-line' in programs; nearly
     always, `forward-line' is more convenient as well as more
     predictable and robust.  *Note Text Lines::.

   * Don't call functions that set the mark, unless setting the mark is
     one of the intended features of your program.  The mark is a
     user-level feature, so it is incorrect to change the mark except
     to supply a value for the user's benefit.  *Note The Mark::.

     In particular, don't use any of these functions:

        * `beginning-of-buffer', `end-of-buffer'

        * `replace-string', `replace-regexp'

        * `insert-file', `insert-buffer'

     If you just want to move point, or replace a certain string, or
     insert a file or buffer's contents, without any of the other
     features intended for interactive users, you can replace these
     functions with one or two lines of simple Lisp code.

   * Use lists rather than vectors, except when there is a particular
     reason to use a vector.  Lisp has more facilities for manipulating
     lists than for vectors, and working with lists is usually more
     convenient.

     Vectors are advantageous for tables that are substantial in size
     and are accessed in random order (not searched front to back),
     provided there is no need to insert or delete elements (only lists
     allow that).

   * The recommended way to show a message in the echo area is with the
     `message' function, not `princ'.  *Note The Echo Area::.

   * When you encounter an error condition, call the function `error'
     (or `signal').  The function `error' does not return.  *Note
     Signaling Errors::.

     Don't use `message', `throw', `sleep-for', or `beep' to report
     errors.

   * An error message should start with a capital letter but should not
     end with a period.

   * A question asked in the minibuffer with `y-or-n-p' or
     `yes-or-no-p' should start with a capital letter and end with `? '.

   * When you mention a default value in a minibuffer prompt, put it
     and the word `default' inside parentheses.  It should look like
     this:

          Enter the answer (default 42):

   * In `interactive', if you use a Lisp expression to produce a list
     of arguments, don't try to provide the "correct" default values for
     region or position arguments.  Instead, provide `nil' for those
     arguments if they were not specified, and have the function body
     compute the default value when the argument is `nil'.  For
     instance, write this:

          (defun foo (pos)
            (interactive
             (list (if SPECIFIED SPECIFIED-POS)))
            (unless pos (setq pos DEFAULT-POS))
            ...)

     rather than this:

          (defun foo (pos)
            (interactive
             (list (if SPECIFIED SPECIFIED-POS
                       DEFAULT-POS)))
            ...)

     This is so that repetition of the command will recompute these
     defaults based on the current circumstances.

     You do not need to take such precautions when you use interactive
     specs `d', `m' and `r', because they make special arrangements to
     recompute the argument values on repetition of the command.

   * Many commands that take a long time to execute display a message
     that says something like `Operating...' when they start, and
     change it to `Operating...done' when they finish.  Please keep the
     style of these messages uniform: _no_ space around the ellipsis,
     and _no_ period after `done'.  *Note Progress::, for an easy way
     to generate such messages.

   * Try to avoid using recursive edits.  Instead, do what the Rmail `e'
     command does: use a new local keymap that contains one command
     defined to switch back to the old local keymap.  Or do what the
     `edit-options' command does: switch to another buffer and let the
     user switch back at will.  *Note Recursive Editing::.


File: elisp,  Node: Compilation Tips,  Next: Warning Tips,  Prev: Programming Tips,  Up: Tips

D.4 Tips for Making Compiled Code Fast
======================================

Here are ways of improving the execution speed of byte-compiled Lisp
programs.

   * Profile your program with the `elp' library.  See the file
     `elp.el' for instructions.

   * Check the speed of individual Emacs Lisp forms using the
     `benchmark' library.  See the functions `benchmark-run' and
     `benchmark-run-compiled' in `benchmark.el'.

   * Use iteration rather than recursion whenever possible.  Function
     calls are slow in Emacs Lisp even when a compiled function is
     calling another compiled function.

   * Using the primitive list-searching functions `memq', `member',
     `assq', or `assoc' is even faster than explicit iteration.  It can
     be worth rearranging a data structure so that one of these
     primitive search functions can be used.

   * Certain built-in functions are handled specially in byte-compiled
     code, avoiding the need for an ordinary function call.  It is a
     good idea to use these functions rather than alternatives.  To see
     whether a function is handled specially by the compiler, examine
     its `byte-compile' property.  If the property is non-`nil', then
     the function is handled specially.

     For example, the following input will show you that `aref' is
     compiled specially (*note Array Functions::):

          (get 'aref 'byte-compile)
               => byte-compile-two-args

   * If calling a small function accounts for a substantial part of your
     program's running time, make the function inline.  This eliminates
     the function call overhead.  Since making a function inline reduces
     the flexibility of changing the program, don't do it unless it
     gives a noticeable speedup in something slow enough that users
     care about the speed.  *Note Inline Functions::.


File: elisp,  Node: Warning Tips,  Next: Documentation Tips,  Prev: Compilation Tips,  Up: Tips

D.5 Tips for Avoiding Compiler Warnings
=======================================

   * Try to avoid compiler warnings about undefined free variables, by
     adding dummy `defvar' definitions for these variables, like this:

          (defvar foo)

     Such a definition has no effect except to tell the compiler not to
     warn about uses of the variable `foo' in this file.

   * If you use many functions and variables from a certain file, you
     can add a `require' for that package to avoid compilation warnings
     for them.  For instance,

          (eval-when-compile
            (require 'foo))

   * If you bind a variable in one function, and use it or set it in
     another function, the compiler warns about the latter function
     unless the variable has a definition.  But adding a definition
     would be unclean if the variable has a short name, since Lisp
     packages should not define short variable names.  The right thing
     to do is to rename this variable to start with the name prefix
     used for the other functions and variables in your package.

   * The last resort for avoiding a warning, when you want to do
     something that usually is a mistake but it's not a mistake in this
     one case, is to put a call to `with-no-warnings' around it.


File: elisp,  Node: Documentation Tips,  Next: Comment Tips,  Prev: Warning Tips,  Up: Tips

D.6 Tips for Documentation Strings
==================================

Here are some tips and conventions for the writing of documentation
strings.  You can check many of these conventions by running the command
`M-x checkdoc-minor-mode'.

   * Every command, function, or variable intended for users to know
     about should have a documentation string.

   * An internal variable or subroutine of a Lisp program might as well
     have a documentation string.  In earlier Emacs versions, you could
     save space by using a comment instead of a documentation string,
     but that is no longer the case--documentation strings now take up
     very little space in a running Emacs.

   * Format the documentation string so that it fits in an Emacs window
     on an 80-column screen.  It is a good idea for most lines to be no
     wider than 60 characters.  The first line should not be wider than
     67 characters or it will look bad in the output of `apropos'.

     You can fill the text if that looks good.  However, rather than
     blindly filling the entire documentation string, you can often
     make it much more readable by choosing certain line breaks with
     care.  Use blank lines between topics if the documentation string
     is long.

   * The first line of the documentation string should consist of one
     or two complete sentences that stand on their own as a summary.
     `M-x apropos' displays just the first line, and if that line's
     contents don't stand on their own, the result looks bad.  In
     particular, start the first line with a capital letter and end
     with a period.

     For a function, the first line should briefly answer the question,
     "What does this function do?"  For a variable, the first line
     should briefly answer the question, "What does this value mean?"

     Don't limit the documentation string to one line; use as many
     lines as you need to explain the details of how to use the
     function or variable.  Please use complete sentences for the rest
     of the text too.

   * When the user tries to use a disabled command, Emacs displays just
     the first paragraph of its documentation string--everything
     through the first blank line.  If you wish, you can choose which
     information to include before the first blank line so as to make
     this display useful.

   * The first line should mention all the important arguments of the
     function, and should mention them in the order that they are
     written in a function call.  If the function has many arguments,
     then it is not feasible to mention them all in the first line; in
     that case, the first line should mention the first few arguments,
     including the most important arguments.

   * When a function's documentation string mentions the value of an
     argument of the function, use the argument name in capital letters
     as if it were a name for that value.  Thus, the documentation
     string of the function `eval' refers to its second argument as
     `FORM', because the actual argument name is `form':

          Evaluate FORM and return its value.

     Also write metasyntactic variables in capital letters, such as
     when you show the decomposition of a list or vector into subunits,
     some of which may vary.  `KEY' and `VALUE' in the following example
     illustrate this practice:

          The argument TABLE should be an alist whose elements
          have the form (KEY . VALUE).  Here, KEY is ...

   * Never change the case of a Lisp symbol when you mention it in a doc
     string.  If the symbol's name is `foo', write "foo," not "Foo"
     (which is a different symbol).

     This might appear to contradict the policy of writing function
     argument values, but there is no real contradiction; the argument
     _value_ is not the same thing as the _symbol_ which the function
     uses to hold the value.

     If this puts a lower-case letter at the beginning of a sentence
     and that annoys you, rewrite the sentence so that the symbol is
     not at the start of it.

   * Do not start or end a documentation string with whitespace.

   * *Do not* indent subsequent lines of a documentation string so that
     the text is lined up in the source code with the text of the first
     line.  This looks nice in the source code, but looks bizarre when
     users view the documentation.  Remember that the indentation
     before the starting double-quote is not part of the string!

   * When a documentation string refers to a Lisp symbol, write it as it
     would be printed (which usually means in lower case), with
     single-quotes around it.  For example: `lambda'.  There are two
     exceptions: write t and nil without single-quotes.  (In this
     manual, we use a different convention, with single-quotes for all
     symbols.)

     Help mode automatically creates a hyperlink when a documentation
     string uses a symbol name inside single quotes, if the symbol has
     either a function or a variable definition.  You do not need to do
     anything special to make use of this feature.  However, when a
     symbol has both a function definition and a variable definition,
     and you want to refer to just one of them, you can specify which
     one by writing one of the words `variable', `option', `function',
     or `command', immediately before the symbol name.  (Case makes no
     difference in recognizing these indicator words.)  For example, if
     you write

          This function sets the variable `buffer-file-name'.

     then the hyperlink will refer only to the variable documentation of
     `buffer-file-name', and not to its function documentation.

     If a symbol has a function definition and/or a variable
     definition, but those are irrelevant to the use of the symbol that
     you are documenting, you can write the words `symbol' or `program'
     before the symbol name to prevent making any hyperlink.  For
     example,

          If the argument KIND-OF-RESULT is the symbol `list',
          this function returns a list of all the objects
          that satisfy the criterion.

     does not make a hyperlink to the documentation, irrelevant here,
     of the function `list'.

     Normally, no hyperlink is made for a variable without variable
     documentation.  You can force a hyperlink for such variables by
     preceding them with one of the words `variable' or `option'.

     Hyperlinks for faces are only made if the face name is preceded or
     followed by the word `face'.  In that case, only the face
     documentation will be shown, even if the symbol is also defined as
     a variable or as a function.

     To make a hyperlink to Info documentation, write the name of the
     Info node (or anchor) in single quotes, preceded by `info node',
     `Info node', `info anchor' or `Info anchor'.  The Info file name
     defaults to `emacs'.  For example,

          See Info node `Font Lock' and Info node `(elisp)Font Lock Basics'.

     Finally, to create a hyperlink to URLs, write the URL in single
     quotes, preceded by `URL'. For example,

          The home page for the GNU project has more information (see URL
          `http://www.gnu.org/').

   * Don't write key sequences directly in documentation strings.
     Instead, use the `\\[...]' construct to stand for them.  For
     example, instead of writing `C-f', write the construct
     `\\[forward-char]'.  When Emacs displays the documentation string,
     it substitutes whatever key is currently bound to `forward-char'.
     (This is normally `C-f', but it may be some other character if the
     user has moved key bindings.)  *Note Keys in Documentation::.

   * In documentation strings for a major mode, you will want to refer
     to the key bindings of that mode's local map, rather than global
     ones.  Therefore, use the construct `\\<...>' once in the
     documentation string to specify which key map to use.  Do this
     before the first use of `\\[...]'.  The text inside the `\\<...>'
     should be the name of the variable containing the local keymap for
     the major mode.

     It is not practical to use `\\[...]' very many times, because
     display of the documentation string will become slow.  So use this
     to describe the most important commands in your major mode, and
     then use `\\{...}' to display the rest of the mode's keymap.

   * For consistency, phrase the verb in the first sentence of a
     function's documentation string as an imperative--for instance,
     use "Return the cons of A and B." in preference to "Returns the
     cons of A and B."  Usually it looks good to do likewise for the
     rest of the first paragraph.  Subsequent paragraphs usually look
     better if each sentence is indicative and has a proper subject.

   * The documentation string for a function that is a yes-or-no
     predicate should start with words such as "Return t if," to
     indicate explicitly what constitutes "truth."  The word "return"
     avoids starting the sentence with lower-case "t," which could be
     somewhat distracting.

   * If a line in a documentation string begins with an
     open-parenthesis, write a backslash before the open-parenthesis,
     like this:

          The argument FOO can be either a number
          \(a buffer position) or a string (a file name).

     This prevents the open-parenthesis from being treated as the start
     of a defun (*note Defuns: (emacs)Defuns.).

   * Write documentation strings in the active voice, not the passive,
     and in the present tense, not the future.  For instance, use
     "Return a list containing A and B." instead of "A list containing
     A and B will be returned."

   * Avoid using the word "cause" (or its equivalents) unnecessarily.
     Instead of, "Cause Emacs to display text in boldface," write just
     "Display text in boldface."

   * Avoid using "iff" (a mathematics term meaning "if and only if"),
     since many people are unfamiliar with it and mistake it for a
     typo.  In most cases, the meaning is clear with just "if".
     Otherwise, try to find an alternate phrasing that conveys the
     meaning.

   * When a command is meaningful only in a certain mode or situation,
     do mention that in the documentation string.  For example, the
     documentation of `dired-find-file' is:

          In Dired, visit the file or directory named on this line.

   * When you define a variable that users ought to set interactively,
     you normally should use `defcustom'.  However, if for some reason
     you use `defvar' instead, start the doc string with a `*'.  *Note
     Defining Variables::.

   * The documentation string for a variable that is a yes-or-no flag
     should start with words such as "Non-nil means," to make it clear
     that all non-`nil' values are equivalent and indicate explicitly
     what `nil' and non-`nil' mean.


File: elisp,  Node: Comment Tips,  Next: Library Headers,  Prev: Documentation Tips,  Up: Tips

D.7 Tips on Writing Comments
============================

We recommend these conventions for where to put comments and how to
indent them:

`;'
     Comments that start with a single semicolon, `;', should all be
     aligned to the same column on the right of the source code.  Such
     comments usually explain how the code on the same line does its
     job.  In Lisp mode and related modes, the `M-;'
     (`indent-for-comment') command automatically inserts such a `;' in
     the right place, or aligns such a comment if it is already present.

     This and following examples are taken from the Emacs sources.

          (setq base-version-list                 ; there was a base
                (assoc (substring fn 0 start-vn)  ; version to which
                       file-version-assoc-list))  ; this looks like
                                                  ; a subversion

`;;'
     Comments that start with two semicolons, `;;', should be aligned to
     the same level of indentation as the code.  Such comments usually
     describe the purpose of the following lines or the state of the
     program at that point.  For example:

          (prog1 (setq auto-fill-function
                       ...
                       ...
            ;; update mode line
            (force-mode-line-update)))

     We also normally use two semicolons for comments outside functions.

          ;; This Lisp code is run in Emacs
          ;; when it is to operate as a server
          ;; for other processes.

     Every function that has no documentation string (presumably one
     that is used only internally within the package it belongs to),
     should instead have a two-semicolon comment right before the
     function, explaining what the function does and how to call it
     properly.  Explain precisely what each argument means and how the
     function interprets its possible values.

`;;;'
     Comments that start with three semicolons, `;;;', should start at
     the left margin.  These are used, occasionally, for comments within
     functions that should start at the margin.  We also use them
     sometimes for comments that are between functions--whether to use
     two or three semicolons depends on whether the comment should be
     considered a "heading" by Outline minor mode.  By default,
     comments starting with at least three semicolons (followed by a
     single space and a non-whitespace character) are considered
     headings, comments starting with two or less are not.

     Another use for triple-semicolon comments is for commenting out
     lines within a function.  We use three semicolons for this
     precisely so that they remain at the left margin.  By default,
     Outline minor mode does not consider a comment to be a heading
     (even if it starts with at least three semicolons) if the
     semicolons are followed by at least two spaces.  Thus, if you add
     an introductory comment to the commented out code, make sure to
     indent it by at least two spaces after the three semicolons.

          (defun foo (a)
          ;;;  This is no longer necessary.
          ;;;  (force-mode-line-update)
            (message "Finished with %s" a))

     When commenting out entire functions, use two semicolons.

`;;;;'
     Comments that start with four semicolons, `;;;;', should be aligned
     to the left margin and are used for headings of major sections of a
     program.  For example:

          ;;;; The kill ring

The indentation commands of the Lisp modes in Emacs, such as `M-;'
(`indent-for-comment') and <TAB> (`lisp-indent-line'), automatically
indent comments according to these conventions, depending on the number
of semicolons.  *Note Manipulating Comments: (emacs)Comments.


File: elisp,  Node: Library Headers,  Prev: Comment Tips,  Up: Tips

D.8 Conventional Headers for Emacs Libraries
============================================

Emacs has conventions for using special comments in Lisp libraries to
divide them into sections and give information such as who wrote them.
This section explains these conventions.

   We'll start with an example, a package that is included in the Emacs
distribution.

   Parts of this example reflect its status as part of Emacs; for
example, the copyright notice lists the Free Software Foundation as the
copyright holder, and the copying permission says the file is part of
Emacs.  When you write a package and post it, the copyright holder would
be you (unless your employer claims to own it instead), and you should
get the suggested copying permission from the end of the GNU General
Public License itself.  Don't say your file is part of Emacs if we
haven't installed it in Emacs yet!

   With that warning out of the way, on to the example:

     ;;; lisp-mnt.el --- minor mode for Emacs Lisp maintainers

     ;; Copyright (C) 1992 Free Software Foundation, Inc.

     ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
     ;; Maintainer: Eric S. Raymond <esr@snark.thyrsus.com>
     ;; Created: 14 Jul 1992
     ;; Version: 1.2
     ;; Keywords: docs

     ;; This file is part of GNU Emacs.
     ...
     ;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.

   The very first line should have this format:

     ;;; FILENAME --- DESCRIPTION

The description should be complete in one line.  If the file needs a
`-*-' specification, put it after DESCRIPTION.

   After the copyright notice come several "header comment" lines, each
beginning with `;; HEADER-NAME:'.  Here is a table of the conventional
possibilities for HEADER-NAME:

`Author'
     This line states the name and net address of at least the principal
     author of the library.

     If there are multiple authors, you can list them on continuation
     lines led by `;;' and a tab character, like this:

          ;; Author: Ashwin Ram <Ram-Ashwin@cs.yale.edu>
          ;;      Dave Sill <de5@ornl.gov>
          ;;      Dave Brennan <brennan@hal.com>
          ;;      Eric Raymond <esr@snark.thyrsus.com>

`Maintainer'
     This line should contain a single name/address as in the Author
     line, or an address only, or the string `FSF'.  If there is no
     maintainer line, the person(s) in the Author field are presumed to
     be the maintainers.  The example above is mildly bogus because the
     maintainer line is redundant.

     The idea behind the `Author' and `Maintainer' lines is to make
     possible a Lisp function to "send mail to the maintainer" without
     having to mine the name out by hand.

     Be sure to surround the network address with `<...>' if you
     include the person's full name as well as the network address.

`Created'
     This optional line gives the original creation date of the file.
     For historical interest only.

`Version'
     If you wish to record version numbers for the individual Lisp
     program, put them in this line.

`Adapted-By'
     In this header line, place the name of the person who adapted the
     library for installation (to make it fit the style conventions, for
     example).

`Keywords'
     This line lists keywords for the `finder-by-keyword' help command.
     Please use that command to see a list of the meaningful keywords.

     This field is important; it's how people will find your package
     when they're looking for things by topic area.  To separate the
     keywords, you can use spaces, commas, or both.

   Just about every Lisp library ought to have the `Author' and
`Keywords' header comment lines.  Use the others if they are
appropriate.  You can also put in header lines with other header
names--they have no standard meanings, so they can't do any harm.

   We use additional stylized comments to subdivide the contents of the
library file.  These should be separated by blank lines from anything
else.  Here is a table of them:

`;;; Commentary:'
     This begins introductory comments that explain how the library
     works.  It should come right after the copying permissions,
     terminated by a `Change Log', `History' or `Code' comment line.
     This text is used by the Finder package, so it should make sense
     in that context.

`;;; Documentation:'
     This was used in some files in place of `;;; Commentary:', but it
     is deprecated.

`;;; Change Log:'
     This begins change log information stored in the library file (if
     you store the change history there).  For Lisp files distributed
     with Emacs, the change history is kept in the file `ChangeLog' and
     not in the source file at all; these files generally do not have a
     `;;; Change Log:' line.  `History' is an alternative to `Change
     Log'.

`;;; Code:'
     This begins the actual code of the program.

`;;; FILENAME ends here'
     This is the "footer line"; it appears at the very end of the file.
     Its purpose is to enable people to detect truncated versions of
     the file from the lack of a footer line.


File: elisp,  Node: GNU Emacs Internals,  Next: Standard Errors,  Prev: Tips,  Up: Top

Appendix E GNU Emacs Internals
******************************

This chapter describes how the runnable Emacs executable is dumped with
the preloaded Lisp libraries in it, how storage is allocated, and some
internal aspects of GNU Emacs that may be of interest to C programmers.

* Menu:

* Building Emacs::      How the dumped Emacs is made.
* Pure Storage::        A kludge to make preloaded Lisp functions sharable.
* Garbage Collection::  Reclaiming space for Lisp objects no longer used.
* Memory Usage::        Info about total size of Lisp objects made so far.
* Writing Emacs Primitives::   Writing C code for Emacs.
* Object Internals::    Data formats of buffers, windows, processes.


File: elisp,  Node: Building Emacs,  Next: Pure Storage,  Up: GNU Emacs Internals

E.1 Building Emacs
==================

This section explains the steps involved in building the Emacs
executable.  You don't have to know this material to build and install
Emacs, since the makefiles do all these things automatically.  This
information is pertinent to Emacs maintenance.

   Compilation of the C source files in the `src' directory produces an
executable file called `temacs', also called a "bare impure Emacs".  It
contains the Emacs Lisp interpreter and I/O routines, but not the
editing commands.

   The command `temacs -l loadup' uses `temacs' to create the real
runnable Emacs executable.  These arguments direct `temacs' to evaluate
the Lisp files specified in the file `loadup.el'.  These files set up
the normal Emacs editing environment, resulting in an Emacs that is
still impure but no longer bare.

   It takes a substantial time to load the standard Lisp files.
Luckily, you don't have to do this each time you run Emacs; `temacs' can
dump out an executable program called `emacs' that has these files
preloaded.  `emacs' starts more quickly because it does not need to
load the files.  This is the Emacs executable that is normally
installed.

   To create `emacs', use the command `temacs -batch -l loadup dump'.
The purpose of `-batch' here is to prevent `temacs' from trying to
initialize any of its data on the terminal; this ensures that the
tables of terminal information are empty in the dumped Emacs.  The
argument `dump' tells `loadup.el' to dump a new executable named
`emacs'.  The variable `preloaded-file-list' stores a list of the Lisp
files that were dumped with the `emacs' executable.

   Some operating systems don't support dumping.  On those systems, you
must start Emacs with the `temacs -l loadup' command each time you use
it.  This takes a substantial time, but since you need to start Emacs
once a day at most--or once a week if you never log out--the extra time
is not too severe a problem.

   You can specify additional files to preload by writing a library
named `site-load.el' that loads them.  You may need to add a definition

     #define SITELOAD_PURESIZE_EXTRA N

to make N added bytes of pure space to hold the additional files.  (Try
adding increments of 20000 until it is big enough.)  However, the
advantage of preloading additional files decreases as machines get
faster.  On modern machines, it is usually not advisable.

   After `loadup.el' reads `site-load.el', it finds the documentation
strings for primitive and preloaded functions (and variables) in the
file `etc/DOC' where they are stored, by calling `Snarf-documentation'
(*note Accessing Documentation: Definition of Snarf-documentation.).

   You can specify other Lisp expressions to execute just before dumping
by putting them in a library named `site-init.el'.  This file is
executed after the documentation strings are found.

   If you want to preload function or variable definitions, there are
three ways you can do this and make their documentation strings
accessible when you subsequently run Emacs:

   * Arrange to scan these files when producing the `etc/DOC' file, and
     load them with `site-load.el'.

   * Load the files with `site-init.el', then copy the files into the
     installation directory for Lisp files when you install Emacs.

   * Specify a non-`nil' value for `byte-compile-dynamic-docstrings' as
     a local variable in each of these files, and load them with either
     `site-load.el' or `site-init.el'.  (This method has the drawback
     that the documentation strings take up space in Emacs all the
     time.)

   It is not advisable to put anything in `site-load.el' or
`site-init.el' that would alter any of the features that users expect
in an ordinary unmodified Emacs.  If you feel you must override normal
features for your site, do it with `default.el', so that users can
override your changes if they wish.  *Note Startup Summary::.

   In a package that can be preloaded, it is sometimes useful to
specify a computation to be done when Emacs subsequently starts up.
For this, use `eval-at-startup':

 -- Macro: eval-at-startup body...
     This evaluates the BODY forms, either immediately if running in an
     Emacs that has already started up, or later when Emacs does start
     up.  Since the value of the BODY forms is not necessarily
     available when the `eval-at-startup' form is run, that form always
     returns `nil'.

 -- Function: dump-emacs to-file from-file
     This function dumps the current state of Emacs into an executable
     file TO-FILE.  It takes symbols from FROM-FILE (this is normally
     the executable file `temacs').

     If you want to use this function in an Emacs that was already
     dumped, you must run Emacs with `-batch'.


File: elisp,  Node: Pure Storage,  Next: Garbage Collection,  Prev: Building Emacs,  Up: GNU Emacs Internals

E.2 Pure Storage
================

Emacs Lisp uses two kinds of storage for user-created Lisp objects:
"normal storage" and "pure storage".  Normal storage is where all the
new data created during an Emacs session are kept; see the following
section for information on normal storage.  Pure storage is used for
certain data in the preloaded standard Lisp files--data that should
never change during actual use of Emacs.

   Pure storage is allocated only while `temacs' is loading the
standard preloaded Lisp libraries.  In the file `emacs', it is marked
as read-only (on operating systems that permit this), so that the
memory space can be shared by all the Emacs jobs running on the machine
at once.  Pure storage is not expandable; a fixed amount is allocated
when Emacs is compiled, and if that is not sufficient for the preloaded
libraries, `temacs' allocates dynamic memory for the part that didn't
fit.  If that happens, you should increase the compilation parameter
`PURESIZE' in the file `src/puresize.h' and rebuild Emacs, even though
the resulting image will work: garbage collection is disabled in this
situation, causing a memory leak.  Such an overflow normally won't
happen unless you try to preload additional libraries or add features
to the standard ones.  Emacs will display a warning about the overflow
when it starts.

 -- Function: purecopy object
     This function makes a copy in pure storage of OBJECT, and returns
     it.  It copies a string by simply making a new string with the same
     characters, but without text properties, in pure storage.  It
     recursively copies the contents of vectors and cons cells.  It does
     not make copies of other objects such as symbols, but just returns
     them unchanged.  It signals an error if asked to copy markers.

     This function is a no-op except while Emacs is being built and
     dumped; it is usually called only in the file
     `emacs/lisp/loaddefs.el', but a few packages call it just in case
     you decide to preload them.

 -- Variable: pure-bytes-used
     The value of this variable is the number of bytes of pure storage
     allocated so far.  Typically, in a dumped Emacs, this number is
     very close to the total amount of pure storage available--if it
     were not, we would preallocate less.

 -- Variable: purify-flag
     This variable determines whether `defun' should make a copy of the
     function definition in pure storage.  If it is non-`nil', then the
     function definition is copied into pure storage.

     This flag is `t' while loading all of the basic functions for
     building Emacs initially (allowing those functions to be sharable
     and non-collectible).  Dumping Emacs as an executable always writes
     `nil' in this variable, regardless of the value it actually has
     before and after dumping.

     You should not change this flag in a running Emacs.


File: elisp,  Node: Garbage Collection,  Next: Memory Usage,  Prev: Pure Storage,  Up: GNU Emacs Internals

E.3 Garbage Collection
======================

When a program creates a list or the user defines a new function (such
as by loading a library), that data is placed in normal storage.  If
normal storage runs low, then Emacs asks the operating system to
allocate more memory in blocks of 1k bytes.  Each block is used for one
type of Lisp object, so symbols, cons cells, markers, etc., are
segregated in distinct blocks in memory.  (Vectors, long strings,
buffers and certain other editing types, which are fairly large, are
allocated in individual blocks, one per object, while small strings are
packed into blocks of 8k bytes.)

   It is quite common to use some storage for a while, then release it
by (for example) killing a buffer or deleting the last pointer to an
object.  Emacs provides a "garbage collector" to reclaim this abandoned
storage.  (This name is traditional, but "garbage recycler" might be a
more intuitive metaphor for this facility.)

   The garbage collector operates by finding and marking all Lisp
objects that are still accessible to Lisp programs.  To begin with, it
assumes all the symbols, their values and associated function
definitions, and any data presently on the stack, are accessible.  Any
objects that can be reached indirectly through other accessible objects
are also accessible.

   When marking is finished, all objects still unmarked are garbage.  No
matter what the Lisp program or the user does, it is impossible to refer
to them, since there is no longer a way to reach them.  Their space
might as well be reused, since no one will miss them.  The second
("sweep") phase of the garbage collector arranges to reuse them.

   The sweep phase puts unused cons cells onto a "free list" for future
allocation; likewise for symbols and markers.  It compacts the
accessible strings so they occupy fewer 8k blocks; then it frees the
other 8k blocks.  Vectors, buffers, windows, and other large objects are
individually allocated and freed using `malloc' and `free'.

     Common Lisp note: Unlike other Lisps, GNU Emacs Lisp does not call
     the garbage collector when the free list is empty.  Instead, it
     simply requests the operating system to allocate more storage, and
     processing continues until `gc-cons-threshold' bytes have been
     used.

     This means that you can make sure that the garbage collector will
     not run during a certain portion of a Lisp program by calling the
     garbage collector explicitly just before it (provided that portion
     of the program does not use so much space as to force a second
     garbage collection).

 -- Command: garbage-collect
     This command runs a garbage collection, and returns information on
     the amount of space in use.  (Garbage collection can also occur
     spontaneously if you use more than `gc-cons-threshold' bytes of
     Lisp data since the previous garbage collection.)

     `garbage-collect' returns a list containing the following
     information:

          ((USED-CONSES . FREE-CONSES)
           (USED-SYMS . FREE-SYMS)
           (USED-MISCS . FREE-MISCS)
           USED-STRING-CHARS
           USED-VECTOR-SLOTS
           (USED-FLOATS . FREE-FLOATS)
           (USED-INTERVALS . FREE-INTERVALS)
           (USED-STRINGS . FREE-STRINGS))

     Here is an example:

          (garbage-collect)
               => ((106886 . 13184) (9769 . 0)
                          (7731 . 4651) 347543 121628
                          (31 . 94) (1273 . 168)
                          (25474 . 3569))

     Here is a table explaining each element:

    USED-CONSES
          The number of cons cells in use.

    FREE-CONSES
          The number of cons cells for which space has been obtained
          from the operating system, but that are not currently being
          used.

    USED-SYMS
          The number of symbols in use.

    FREE-SYMS
          The number of symbols for which space has been obtained from
          the operating system, but that are not currently being used.

    USED-MISCS
          The number of miscellaneous objects in use.  These include
          markers and overlays, plus certain objects not visible to
          users.

    FREE-MISCS
          The number of miscellaneous objects for which space has been
          obtained from the operating system, but that are not
          currently being used.

    USED-STRING-CHARS
          The total size of all strings, in characters.

    USED-VECTOR-SLOTS
          The total number of elements of existing vectors.

    USED-FLOATS
          The number of floats in use.

    FREE-FLOATS
          The number of floats for which space has been obtained from
          the operating system, but that are not currently being used.

    USED-INTERVALS
          The number of intervals in use.  Intervals are an internal
          data structure used for representing text properties.

    FREE-INTERVALS
          The number of intervals for which space has been obtained
          from the operating system, but that are not currently being
          used.

    USED-STRINGS
          The number of strings in use.

    FREE-STRINGS
          The number of string headers for which the space was obtained
          from the operating system, but which are currently not in
          use.  (A string object consists of a header and the storage
          for the string text itself; the latter is only allocated when
          the string is created.)

     If there was overflow in pure space (see the previous section),
     `garbage-collect' returns `nil', because a real garbage collection
     can not be done in this situation.

 -- User Option: garbage-collection-messages
     If this variable is non-`nil', Emacs displays a message at the
     beginning and end of garbage collection.  The default value is
     `nil', meaning there are no such messages.

 -- Variable: post-gc-hook
     This is a normal hook that is run at the end of garbage collection.
     Garbage collection is inhibited while the hook functions run, so be
     careful writing them.

 -- User Option: gc-cons-threshold
     The value of this variable is the number of bytes of storage that
     must be allocated for Lisp objects after one garbage collection in
     order to trigger another garbage collection.  A cons cell counts
     as eight bytes, a string as one byte per character plus a few
     bytes of overhead, and so on; space allocated to the contents of
     buffers does not count.  Note that the subsequent garbage
     collection does not happen immediately when the threshold is
     exhausted, but only the next time the Lisp evaluator is called.

     The initial threshold value is 400,000.  If you specify a larger
     value, garbage collection will happen less often.  This reduces the
     amount of time spent garbage collecting, but increases total
     memory use.  You may want to do this when running a program that
     creates lots of Lisp data.

     You can make collections more frequent by specifying a smaller
     value, down to 10,000.  A value less than 10,000 will remain in
     effect only until the subsequent garbage collection, at which time
     `garbage-collect' will set the threshold back to 10,000.

 -- User Option: gc-cons-percentage
     The value of this variable specifies the amount of consing before a
     garbage collection occurs, as a fraction of the current heap size.
     This criterion and `gc-cons-threshold' apply in parallel, and
     garbage collection occurs only when both criteria are satisfied.

     As the heap size increases, the time to perform a garbage
     collection increases.  Thus, it can be desirable to do them less
     frequently in proportion.

   The value returned by `garbage-collect' describes the amount of
memory used by Lisp data, broken down by data type.  By contrast, the
function `memory-limit' provides information on the total amount of
memory Emacs is currently using.

 -- Function: memory-limit
     This function returns the address of the last byte Emacs has
     allocated, divided by 1024.  We divide the value by 1024 to make
     sure it fits in a Lisp integer.

     You can use this to get a general idea of how your actions affect
     the memory usage.

 -- Variable: memory-full
     This variable is `t' if Emacs is close to out of memory for Lisp
     objects, and `nil' otherwise.

 -- Function: memory-use-counts
     This returns a list of numbers that count the number of objects
     created in this Emacs session.  Each of these counters increments
     for a certain kind of object.  See the documentation string for
     details.

 -- Variable: gcs-done
     This variable contains the total number of garbage collections
     done so far in this Emacs session.

 -- Variable: gc-elapsed
     This variable contains the total number of seconds of elapsed time
     during garbage collection so far in this Emacs session, as a
     floating point number.


File: elisp,  Node: Memory Usage,  Next: Writing Emacs Primitives,  Prev: Garbage Collection,  Up: GNU Emacs Internals

E.4 Memory Usage
================

These functions and variables give information about the total amount
of memory allocation that Emacs has done, broken down by data type.
Note the difference between these and the values returned by
`(garbage-collect)'; those count objects that currently exist, but
these count the number or size of all allocations, including those for
objects that have since been freed.

 -- Variable: cons-cells-consed
     The total number of cons cells that have been allocated so far in
     this Emacs session.

 -- Variable: floats-consed
     The total number of floats that have been allocated so far in this
     Emacs session.

 -- Variable: vector-cells-consed
     The total number of vector cells that have been allocated so far
     in this Emacs session.

 -- Variable: symbols-consed
     The total number of symbols that have been allocated so far in
     this Emacs session.

 -- Variable: string-chars-consed
     The total number of string characters that have been allocated so
     far in this Emacs session.

 -- Variable: misc-objects-consed
     The total number of miscellaneous objects that have been allocated
     so far in this Emacs session.  These include markers and overlays,
     plus certain objects not visible to users.

 -- Variable: intervals-consed
     The total number of intervals that have been allocated so far in
     this Emacs session.

 -- Variable: strings-consed
     The total number of strings that have been allocated so far in this
     Emacs session.


File: elisp,  Node: Writing Emacs Primitives,  Next: Object Internals,  Prev: Memory Usage,  Up: GNU Emacs Internals

E.5 Writing Emacs Primitives
============================

Lisp primitives are Lisp functions implemented in C.  The details of
interfacing the C function so that Lisp can call it are handled by a few
C macros.  The only way to really understand how to write new C code is
to read the source, but we can explain some things here.

   An example of a special form is the definition of `or', from
`eval.c'.  (An ordinary function would have the same general
appearance.)

     DEFUN ("or", For, Sor, 0, UNEVALLED, 0,
       doc: /* Eval args until one of them yields non-nil, then return that
     value. The remaining args are not evalled at all.
     If all args return nil, return nil.
     usage: (or CONDITIONS ...)  */)
       (args)
          Lisp_Object args;
     {
       register Lisp_Object val = Qnil;
       struct gcpro gcpro1;

       GCPRO1 (args);

       while (CONSP (args))
         {
           val = Feval (XCAR (args));
           if (!NILP (val))
             break;
           args = XCDR (args);
         }

       UNGCPRO;
       return val;
     }

   Let's start with a precise explanation of the arguments to the
`DEFUN' macro.  Here is a template for them:

     DEFUN (LNAME, FNAME, SNAME, MIN, MAX, INTERACTIVE, DOC)

LNAME
     This is the name of the Lisp symbol to define as the function
     name; in the example above, it is `or'.

FNAME
     This is the C function name for this function.  This is the name
     that is used in C code for calling the function.  The name is, by
     convention, `F' prepended to the Lisp name, with all dashes (`-')
     in the Lisp name changed to underscores.  Thus, to call this
     function from C code, call `For'.  Remember that the arguments must
     be of type `Lisp_Object'; various macros and functions for creating
     values of type `Lisp_Object' are declared in the file `lisp.h'.

SNAME
     This is a C variable name to use for a structure that holds the
     data for the subr object that represents the function in Lisp.
     This structure conveys the Lisp symbol name to the initialization
     routine that will create the symbol and store the subr object as
     its definition.  By convention, this name is always FNAME with `F'
     replaced with `S'.

MIN
     This is the minimum number of arguments that the function
     requires.  The function `or' allows a minimum of zero arguments.

MAX
     This is the maximum number of arguments that the function accepts,
     if there is a fixed maximum.  Alternatively, it can be `UNEVALLED',
     indicating a special form that receives unevaluated arguments, or
     `MANY', indicating an unlimited number of evaluated arguments (the
     equivalent of `&rest').  Both `UNEVALLED' and `MANY' are macros.
     If MAX is a number, it may not be less than MIN and it may not be
     greater than eight.

INTERACTIVE
     This is an interactive specification, a string such as might be
     used as the argument of `interactive' in a Lisp function.  In the
     case of `or', it is 0 (a null pointer), indicating that `or'
     cannot be called interactively.  A value of `""' indicates a
     function that should receive no arguments when called
     interactively.  If the value begins with a `(', the string is
     evaluated as a Lisp form.

DOC
     This is the documentation string.  It uses C comment syntax rather
     than C string syntax because comment syntax requires nothing
     special to include multiple lines.  The `doc:' identifies the
     comment that follows as the documentation string.  The `/*' and
     `*/' delimiters that begin and end the comment are not part of the
     documentation string.

     If the last line of the documentation string begins with the
     keyword `usage:', the rest of the line is treated as the argument
     list for documentation purposes.  This way, you can use different
     argument names in the documentation string from the ones used in
     the C code.  `usage:' is required if the function has an unlimited
     number of arguments.

     All the usual rules for documentation strings in Lisp code (*note
     Documentation Tips::) apply to C code documentation strings too.

   After the call to the `DEFUN' macro, you must write the argument
name list that every C function must have, followed by ordinary C
declarations for the arguments.  For a function with a fixed maximum
number of arguments, declare a C argument for each Lisp argument, and
give them all type `Lisp_Object'.  When a Lisp function has no upper
limit on the number of arguments, its implementation in C actually
receives exactly two arguments: the first is the number of Lisp
arguments, and the second is the address of a block containing their
values.  They have types `int' and `Lisp_Object *'.

   Within the function `For' itself, note the use of the macros
`GCPRO1' and `UNGCPRO'.  `GCPRO1' is used to "protect" a variable from
garbage collection--to inform the garbage collector that it must look
in that variable and regard its contents as an accessible object.  GC
protection is necessary whenever you call `Feval' or anything that can
directly or indirectly call `Feval'.  At such a time, any Lisp object
that this function may refer to again must be protected somehow.

   It suffices to ensure that at least one pointer to each object is
GC-protected; that way, the object cannot be recycled, so all pointers
to it remain valid.  Thus, a particular local variable can do without
protection if it is certain that the object it points to will be
preserved by some other pointer (such as another local variable which
has a `GCPRO')(1).  Otherwise, the local variable needs a `GCPRO'.

   The macro `GCPRO1' protects just one local variable.  If you want to
protect two variables, use `GCPRO2' instead; repeating `GCPRO1' will
not work.  Macros `GCPRO3', `GCPRO4', `GCPRO5', and `GCPRO6' also
exist.  All these macros implicitly use local variables such as
`gcpro1'; you must declare these explicitly, with type `struct gcpro'.
Thus, if you use `GCPRO2', you must declare `gcpro1' and `gcpro2'.
Alas, we can't explain all the tricky details here.

   `UNGCPRO' cancels the protection of the variables that are protected
in the current function.  It is necessary to do this explicitly.

   Built-in functions that take a variable number of arguments actually
accept two arguments at the C level: the number of Lisp arguments, and
a `Lisp_Object *' pointer to a C vector containing those Lisp
arguments.  This C vector may be part of a Lisp vector, but it need not
be.  The responsibility for using `GCPRO' to protect the Lisp arguments
from GC if necessary rests with the caller in this case, since the
caller allocated or found the storage for them.

   You must not use C initializers for static or global variables unless
the variables are never written once Emacs is dumped.  These variables
with initializers are allocated in an area of memory that becomes
read-only (on certain operating systems) as a result of dumping Emacs.
*Note Pure Storage::.

   Do not use static variables within functions--place all static
variables at top level in the file.  This is necessary because Emacs on
some operating systems defines the keyword `static' as a null macro.
(This definition is used because those systems put all variables
declared static in a place that becomes read-only after dumping, whether
they have initializers or not.)

   Defining the C function is not enough to make a Lisp primitive
available; you must also create the Lisp symbol for the primitive and
store a suitable subr object in its function cell.  The code looks like
this:

     defsubr (&SUBR-STRUCTURE-NAME);

Here SUBR-STRUCTURE-NAME is the name you used as the third argument to
`DEFUN'.

   If you add a new primitive to a file that already has Lisp primitives
defined in it, find the function (near the end of the file) named
`syms_of_SOMETHING', and add the call to `defsubr' there.  If the file
doesn't have this function, or if you create a new file, add to it a
`syms_of_FILENAME' (e.g., `syms_of_myfile').  Then find the spot in
`emacs.c' where all of these functions are called, and add a call to
`syms_of_FILENAME' there.

   The function `syms_of_FILENAME' is also the place to define any C
variables that are to be visible as Lisp variables.  `DEFVAR_LISP'
makes a C variable of type `Lisp_Object' visible in Lisp.  `DEFVAR_INT'
makes a C variable of type `int' visible in Lisp with a value that is
always an integer.  `DEFVAR_BOOL' makes a C variable of type `int'
visible in Lisp with a value that is either `t' or `nil'.  Note that
variables defined with `DEFVAR_BOOL' are automatically added to the list
`byte-boolean-vars' used by the byte compiler.

   If you define a file-scope C variable of type `Lisp_Object', you
must protect it from garbage-collection by calling `staticpro' in
`syms_of_FILENAME', like this:

     staticpro (&VARIABLE);

   Here is another example function, with more complicated arguments.
This comes from the code in `window.c', and it demonstrates the use of
macros and functions to manipulate Lisp objects.

     DEFUN ("coordinates-in-window-p", Fcoordinates_in_window_p,
       Scoordinates_in_window_p, 2, 2,
       "xSpecify coordinate pair: \nXExpression which evals to window: ",
       "Return non-nil if COORDINATES is in WINDOW.\n\
     COORDINATES is a cons of the form (X . Y), X and Y being distances\n\
     ...
     If they are on the border between WINDOW and its right sibling,\n\
        `vertical-line' is returned.")
       (coordinates, window)
          register Lisp_Object coordinates, window;
     {
       int x, y;

       CHECK_LIVE_WINDOW (window, 0);
       CHECK_CONS (coordinates, 1);
       x = XINT (Fcar (coordinates));
       y = XINT (Fcdr (coordinates));

       switch (coordinates_in_window (XWINDOW (window), &x, &y))
         {
         case 0:                     /* NOT in window at all. */
           return Qnil;

         case 1:                     /* In text part of window. */
           return Fcons (make_number (x), make_number (y));

         case 2:                     /* In mode line of window. */
           return Qmode_line;

         case 3:                     /* On right border of window.  */
           return Qvertical_line;

         default:
           abort ();
         }
     }

   Note that C code cannot call functions by name unless they are
defined in C.  The way to call a function written in Lisp is to use
`Ffuncall', which embodies the Lisp function `funcall'.  Since the Lisp
function `funcall' accepts an unlimited number of arguments, in C it
takes two: the number of Lisp-level arguments, and a one-dimensional
array containing their values.  The first Lisp-level argument is the
Lisp function to call, and the rest are the arguments to pass to it.
Since `Ffuncall' can call the evaluator, you must protect pointers from
garbage collection around the call to `Ffuncall'.

   The C functions `call0', `call1', `call2', and so on, provide handy
ways to call a Lisp function conveniently with a fixed number of
arguments.  They work by calling `Ffuncall'.

   `eval.c' is a very good file to look through for examples; `lisp.h'
contains the definitions for some important macros and functions.

   If you define a function which is side-effect free, update the code
in `byte-opt.el' which binds `side-effect-free-fns' and
`side-effect-and-error-free-fns' so that the compiler optimizer knows
about it.

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

   (1) Formerly, strings were a special exception; in older Emacs
versions, every local variable that might point to a string needed a
`GCPRO'.


File: elisp,  Node: Object Internals,  Prev: Writing Emacs Primitives,  Up: GNU Emacs Internals

E.6 Object Internals
====================

GNU Emacs Lisp manipulates many different types of data.  The actual
data are stored in a heap and the only access that programs have to it
is through pointers.  Each pointer is 32 bits wide on 32-bit machines,
and 64 bits wide on 64-bit machines; three of these bits are used for
the tag that identifies the object's type, and the remainder are used
to address the object.

   Because Lisp objects are represented as tagged pointers, it is always
possible to determine the Lisp data type of any object.  The C data type
`Lisp_Object' can hold any Lisp object of any data type.  Ordinary
variables have type `Lisp_Object', which means they can hold any type
of Lisp value; you can determine the actual data type only at run time.
The same is true for function arguments; if you want a function to
accept only a certain type of argument, you must check the type
explicitly using a suitable predicate (*note Type Predicates::).  

* Menu:

* Buffer Internals::    Components of a buffer structure.
* Window Internals::    Components of a window structure.
* Process Internals::   Components of a process structure.


File: elisp,  Node: Buffer Internals,  Next: Window Internals,  Up: Object Internals

E.6.1 Buffer Internals
----------------------

Two structures are used to represent buffers in C.  The `buffer_text'
structure contains fields describing the text of a buffer; the `buffer'
structure holds other fields.  In the case of indirect buffers, two or
more `buffer' structures reference the same `buffer_text' structure.

   Here are some of the fields in `struct buffer_text':

`beg'
     The address of the buffer contents.

`gpt'
`gpt_byte'
     The character and byte positions of the buffer gap.  *Note Buffer
     Gap::.

`z'
`z_byte'
     The character and byte positions of the end of the buffer text.

`gap_size'
     The size of buffer's gap.  *Note Buffer Gap::.

`modiff'
`save_modiff'
`chars_modiff'
`overlay_modiff'
     These fields count the number of buffer-modification events
     performed in this buffer.  `modiff' is incremented after each
     buffer-modification event, and is never otherwise changed;
     `save_modiff' contains the value of `modiff' the last time the
     buffer was visited or saved; `chars_modiff' counts only
     modifications to the characters in the buffer, ignoring all other
     kinds of changes; and `overlay_modiff' counts only modifications
     to the overlays.

`beg_unchanged'
`end_unchanged'
     The number of characters at the start and end of the text that are
     known to be unchanged since the last complete redisplay.

`unchanged_modified'
`overlay_unchanged_modified'
     The values of `modiff' and `overlay_modiff', respectively, after
     the last compelete redisplay.  If their current values match
     `modiff' or `overlay_modiff', that means `beg_unchanged' and
     `end_unchanged' contain no useful information.

`markers'
     The markers that refer to this buffer.  This is actually a single
     marker, and successive elements in its marker `chain' are the other
     markers referring to this buffer text.

`intervals'
     The interval tree which records the text properties of this buffer.

   Some of the fields of `struct buffer' are:

`next'
     Points to the next buffer, in the chain of all buffers (including
     killed buffers).  This chain is used only for garbage collection,
     in order to collect killed buffers properly.  Note that vectors,
     and most kinds of objects allocated as vectors, are all on one
     chain, but buffers are on a separate chain of their own.

`own_text'
     A `struct buffer_text' structure that ordinarily holds the buffer
     contents.  In indirect buffers, this field is not used.

`text'
     A pointer to the `buffer_text' structure for this buffer.  In an
     ordinary buffer, this is the `own_text' field above.  In an
     indirect buffer, this is the `own_text' field of the base buffer.

`pt'
`pt_byte'
     The character and byte positions of point in a buffer.

`begv'
`begv_byte'
     The character and byte positions of the beginning of the accessible
     range of text in the buffer.

`zv'
`zv_byte'
     The character and byte positions of the end of the accessible
     range of text in the buffer.

`base_buffer'
     In an indirect buffer, this points to the base buffer.  In an
     ordinary buffer, it is null.

`local_flags'
     This field contains flags indicating that certain variables are
     local in this buffer.  Such variables are declared in the C code
     using `DEFVAR_PER_BUFFER', and their buffer-local bindings are
     stored in fields in the buffer structure itself.  (Some of these
     fields are described in this table.)

`modtime'
     The modification time of the visited file.  It is set when the
     file is written or read.  Before writing the buffer into a file,
     this field is compared to the modification time of the file to see
     if the file has changed on disk.  *Note Buffer Modification::.

`auto_save_modified'
     The time when the buffer was last auto-saved.

`last_window_start'
     The `window-start' position in the buffer as of the last time the
     buffer was displayed in a window.

`clip_changed'
     This flag indicates that narrowing has changed in the buffer.
     *Note Narrowing::.

`prevent_redisplay_optimizations_p'
     This flag indicates that redisplay optimizations should not be
     used to display this buffer.

`overlay_center'
     This field holds the current overlay center position.  *Note
     Managing Overlays::.

`overlays_before'
`overlays_after'
     These fields hold, respectively, a list of overlays that end at or
     before the current overlay center, and a list of overlays that end
     after the current overlay center.  *Note Managing Overlays::.
     `overlays_before' is sorted in order of decreasing end position,
     and `overlays_after' is sorted in order of increasing beginning
     position.

`name'
     A Lisp string that names the buffer.  It is guaranteed to be
     unique.  *Note Buffer Names::.

`save_length'
     The length of the file this buffer is visiting, when last read or
     saved.  This and other fields concerned with saving are not kept in
     the `buffer_text' structure because indirect buffers are never
     saved.

`directory'
     The directory for expanding relative file names.  This is the
     value of the buffer-local variable `default-directory' (*note File
     Name Expansion::).

`filename'
     The name of the file visited in this buffer, or `nil'.  This is
     the value of the buffer-local variable `buffer-file-name' (*note
     Buffer File Name::).

`undo_list'
`backed_up'
`auto_save_file_name'
`read_only'
`file_format'
`file_truename'
`invisibility_spec'
`display_count'
`display_time'
     These fields store the values of Lisp variables that are
     automatically buffer-local (*note Buffer-Local Variables::), whose
     corresponding variable names have the additional prefix `buffer-'
     and have underscores replaced with dashes.  For instance,
     `undo_list' stores the value of `buffer-undo-list'.  *Note
     Standard Buffer-Local Variables::.

`mark'
     The mark for the buffer.  The mark is a marker, hence it is also
     included on the list `markers'.  *Note The Mark::.

`local_var_alist'
     The association list describing the buffer-local variable bindings
     of this buffer, not including the built-in buffer-local bindings
     that have special slots in the buffer object.  (Those slots are
     omitted from this table.)  *Note Buffer-Local Variables::.

`major_mode'
     Symbol naming the major mode of this buffer, e.g., `lisp-mode'.

`mode_name'
     Pretty name of the major mode, e.g., `"Lisp"'.

`keymap'
`abbrev_table'
`syntax_table'
`category_table'
`display_table'
     These fields store the buffer's local keymap (*note Keymaps::),
     abbrev table (*note Abbrev Tables::), syntax table (*note Syntax
     Tables::), category table (*note Categories::), and display table
     (*note Display Tables::).

`downcase_table'
`upcase_table'
`case_canon_table'
     These fields store the conversion tables for converting text to
     lower case, upper case, and for canonicalizing text for case-fold
     search.  *Note Case Tables::.

`minor_modes'
     An alist of the minor modes of this buffer.

`pt_marker'
`begv_marker'
`zv_marker'
     These fields are only used in an indirect buffer, or in a buffer
     that is the base of an indirect buffer.  Each holds a marker that
     records `pt', `begv', and `zv' respectively, for this buffer when
     the buffer is not current.

`mode_line_format'
`header_line_format'
`case_fold_search'
`tab_width'
`fill_column'
`left_margin'
`auto_fill_function'
`truncate_lines'
`word_wrap'
`ctl_arrow'
`selective_display'
`selective_display_ellipses'
`overwrite_mode'
`abbrev_mode'
`display_table'
`mark_active'
`enable_multibyte_characters'
`buffer_file_coding_system'
`auto_save_file_format'
`cache_long_line_scans'
`point_before_scroll'
`left_fringe_width'
`right_fringe_width'
`fringes_outside_margins'
`scroll_bar_width'
`indicate_empty_lines'
`indicate_buffer_boundaries'
`fringe_indicator_alist'
`fringe_cursor_alist'
`scroll_up_aggressively'
`scroll_down_aggressively'
`cursor_type'
`cursor_in_non_selected_windows'
     These fields store the values of Lisp variables that are
     automatically buffer-local (*note Buffer-Local Variables::), whose
     corresponding variable names have underscores replaced with
     dashes.  For instance, `mode_line_format' stores the value of
     `mode-line-format'.  *Note Standard Buffer-Local Variables::.

`last_selected_window'
     This is the last window that was selected with this buffer in it,
     or `nil' if that window no longer displays this buffer.


File: elisp,  Node: Window Internals,  Next: Process Internals,  Prev: Buffer Internals,  Up: Object Internals

E.6.2 Window Internals
----------------------

Windows have the following accessible fields:

`frame'
     The frame that this window is on.

`mini_p'
     Non-`nil' if this window is a minibuffer window.

`parent'
     Internally, Emacs arranges windows in a tree; each group of
     siblings has a parent window whose area includes all the siblings.
     This field points to a window's parent.

     Parent windows do not display buffers, and play little role in
     display except to shape their child windows.  Emacs Lisp programs
     usually have no access to the parent windows; they operate on the
     windows at the leaves of the tree, which actually display buffers.

`hchild'
`vchild'
     These fields contain the window's leftmost child and its topmost
     child respectively.  `hchild' is used if the window is subdivided
     horizontally by child windows, and `vchild' if it is subdivided
     vertically.

`next'
`prev'
     The next sibling and previous sibling of this window.  `next' is
     `nil' if the window is the rightmost or bottommost in its group;
     `prev' is `nil' if it is the leftmost or topmost in its group.

`left_col'
     The left-hand edge of the window, measured in columns, relative to
     the leftmost column in the frame (column 0).

`top_line'
     The top edge of the window, measured in lines, relative to the
     topmost line in the frame (line 0).

`total_cols'
`total_lines'
     The width and height of the window, measured in columns and lines
     respectively.  The width includes the scroll bar and fringes,
     and/or the separator line on the right of the window (if any).

`buffer'
     The buffer that the window is displaying.

`start'
     A marker pointing to the position in the buffer that is the first
     character displayed in the window.

`pointm'
     This is the value of point in the current buffer when this window
     is selected; when it is not selected, it retains its previous
     value.

`force_start'
     If this flag is non-`nil', it says that the window has been
     scrolled explicitly by the Lisp program.  This affects what the
     next redisplay does if point is off the screen: instead of
     scrolling the window to show the text around point, it moves point
     to a location that is on the screen.

`frozen_window_start_p'
     This field is set temporarily to 1 to indicate to redisplay that
     `start' of this window should not be changed, even if point gets
     invisible.

`start_at_line_beg'
     Non-`nil' means current value of `start' was the beginning of a
     line when it was chosen.

`use_time'
     This is the last time that the window was selected.  The function
     `get-lru-window' uses this field.

`sequence_number'
     A unique number assigned to this window when it was created.

`last_modified'
     The `modiff' field of the window's buffer, as of the last time a
     redisplay completed in this window.

`last_overlay_modified'
     The `overlay_modiff' field of the window's buffer, as of the last
     time a redisplay completed in this window.

`last_point'
     The buffer's value of point, as of the last time a redisplay
     completed in this window.

`last_had_star'
     A non-`nil' value means the window's buffer was "modified" when the
     window was last updated.

`vertical_scroll_bar'
     This window's vertical scroll bar.

`left_margin_width'
`right_margin_width'
     The widths of the left and right margins in this window.  A value
     of `nil' means to use the buffer's value of `left-margin-width' or
     `right-margin-width'.

`window_end_pos'
     This is computed as `z' minus the buffer position of the last glyph
     in the current matrix of the window.  The value is only valid if
     `window_end_valid' is not `nil'.

`window_end_bytepos'
     The byte position corresponding to `window_end_pos'.

`window_end_vpos'
     The window-relative vertical position of the line containing
     `window_end_pos'.

`window_end_valid'
     This field is set to a non-`nil' value if `window_end_pos' is truly
     valid.  This is `nil' if nontrivial redisplay is preempted since
     in that case the display that `window_end_pos' was computed for
     did not get onto the screen.

`cursor'
     A structure describing where the cursor is in this window.

`last_cursor'
     The value of `cursor' as of the last redisplay that finished.

`phys_cursor'
     A structure describing where the cursor of this window physically
     is.

`phys_cursor_type'
     The type of cursor that was last displayed on this window.

`phys_cursor_on_p'
     This field is non-zero if the cursor is physically on.

`cursor_off_p'
     Non-zero means the cursor in this window is logically on.

`last_cursor_off_p'
     This field contains the value of `cursor_off_p' as of the time of
     the last redisplay.

`must_be_updated_p'
     This is set to 1 during redisplay when this window must be updated.

`hscroll'
     This is the number of columns that the display in the window is
     scrolled horizontally to the left.  Normally, this is 0.

`vscroll'
     Vertical scroll amount, in pixels.  Normally, this is 0.

`dedicated'
     Non-`nil' if this window is dedicated to its buffer.

`display_table'
     The window's display table, or `nil' if none is specified for it.

`update_mode_line'
     Non-`nil' means this window's mode line needs to be updated.

`base_line_number'
     The line number of a certain position in the buffer, or `nil'.
     This is used for displaying the line number of point in the mode
     line.

`base_line_pos'
     The position in the buffer for which the line number is known, or
     `nil' meaning none is known.

`region_showing'
     If the region (or part of it) is highlighted in this window, this
     field holds the mark position that made one end of that region.
     Otherwise, this field is `nil'.

`column_number_displayed'
     The column number currently displayed in this window's mode line,
     or `nil' if column numbers are not being displayed.

`current_matrix'
     A glyph matrix describing the current display of this window.

`desired_matrix'
     A glyph matrix describing the desired display of this window.


File: elisp,  Node: Process Internals,  Prev: Window Internals,  Up: Object Internals

E.6.3 Process Internals
-----------------------

The fields of a process are:

`name'
     A string, the name of the process.

`command'
     A list containing the command arguments that were used to start
     this process.  For a network or serial process, it is `nil' if the
     process is running or `t' if the process is stopped.

`filter'
     A function used to accept output from the process instead of a
     buffer, or `nil'.

`sentinel'
     A function called whenever the process receives a signal, or `nil'.

`buffer'
     The associated buffer of the process.

`pid'
     An integer, the operating system's process ID.

`childp'
     A flag, non-`nil' if this is really a child process.  It is `nil'
     for a network or serial connection.

`mark'
     A marker indicating the position of the end of the last output
     from this process inserted into the buffer.  This is often but not
     always the end of the buffer.

`kill_without_query'
     If this is non-zero, killing Emacs while this process is still
     running does not ask for confirmation about killing the process.

`raw_status_low'
`raw_status_high'
     These two fields record 16 bits each of the process status
     returned by the `wait' system call.

`status'
     The process status, as `process-status' should return it.

`tick'
`update_tick'
     If these two fields are not equal, a change in the status of the
     process needs to be reported, either by running the sentinel or by
     inserting a message in the process buffer.

`pty_flag'
     Non-`nil' if communication with the subprocess uses a PTY; `nil'
     if it uses a pipe.

`infd'
     The file descriptor for input from the process.

`outfd'
     The file descriptor for output to the process.

`subtty'
     The file descriptor for the terminal that the subprocess is using.
     (On some systems, there is no need to record this, so the value is
     `nil'.)

`tty_name'
     The name of the terminal that the subprocess is using, or `nil' if
     it is using pipes.

`decode_coding_system'
     Coding-system for decoding the input from this process.

`decoding_buf'
     A working buffer for decoding.

`decoding_carryover'
     Size of carryover in decoding.

`encode_coding_system'
     Coding-system for encoding the output to this process.

`encoding_buf'
     A working buffer for encoding.

`encoding_carryover'
     Size of carryover in encoding.

`inherit_coding_system_flag'
     Flag to set `coding-system' of the process buffer from the coding
     system used to decode process output.

`type'
     Symbol indicating the type of process: `real', `network', `serial'



File: elisp,  Node: Standard Errors,  Next: Standard Buffer-Local Variables,  Prev: GNU Emacs Internals,  Up: Top

Appendix F Standard Errors
**************************

Here is the complete list of the error symbols in standard Emacs,
grouped by concept.  The list includes each symbol's message (on the
`error-message' property of the symbol) and a cross reference to a
description of how the error can occur.

   Each error symbol has an `error-conditions' property that is a list
of symbols.  Normally this list includes the error symbol itself and
the symbol `error'.  Occasionally it includes additional symbols, which
are intermediate classifications, narrower than `error' but broader
than a single error symbol.  For example, all the errors in accessing
files have the condition `file-error'.  If we do not say here that a
certain error symbol has additional error conditions, that means it has
none.

   As a special exception, the error symbol `quit' does not have the
condition `error', because quitting is not considered an error.

   *Note Errors::, for an explanation of how errors are generated and
handled.

`SYMBOL'
     STRING; REFERENCE.

`error'
     `"error"'
     *Note Errors::.

`quit'
     `"Quit"'
     *Note Quitting::.

`args-out-of-range'
     `"Args out of range"'
     This happens when trying to access an element beyond the range of a
     sequence or buffer.
     *Note Sequences Arrays Vectors::, *Note Text::.

`arith-error'
     `"Arithmetic error"'
     *Note Arithmetic Operations::.

`beginning-of-buffer'
     `"Beginning of buffer"'
     *Note Character Motion::.

`buffer-read-only'
     `"Buffer is read-only"'
     *Note Read Only Buffers::.

`coding-system-error'
     `"Invalid coding system"'
     *Note Lisp and Coding Systems::.

`cyclic-function-indirection'
     `"Symbol's chain of function indirections contains a loop"'
     *Note Function Indirection::.

`cyclic-variable-indirection'
     `"Symbol's chain of variable indirections contains a loop"'
     *Note Variable Aliases::.

`end-of-buffer'
     `"End of buffer"'
     *Note Character Motion::.

`end-of-file'
     `"End of file during parsing"'
     Note that this is not a subcategory of `file-error', because it
     pertains to the Lisp reader, not to file I/O.
     *Note Input Functions::.

`file-already-exists'
     This is a subcategory of `file-error'.
     *Note Writing to Files::.

`file-date-error'
     This is a subcategory of `file-error'.  It occurs when `copy-file'
     tries and fails to set the last-modification time of the output
     file.
     *Note Changing Files::.

`file-error'
     We do not list the error-strings of this error and its
     subcategories, because the error message is normally constructed
     from the data items alone when the error condition `file-error' is
     present.  Thus, the error-strings are not very relevant.  However,
     these error symbols do have `error-message' properties, and if no
     data is provided, the `error-message' property _is_ used.
     *Note Files::.

`file-locked'
     This is a subcategory of `file-error'.
     *Note File Locks::.

`file-supersession'
     This is a subcategory of `file-error'.
     *Note Modification Time::.

`ftp-error'
     This is a subcategory of `file-error', which results from problems
     in accessing a remote file using ftp.
     *Note Remote Files: (emacs)Remote Files.

`invalid-function'
     `"Invalid function"'
     *Note Function Indirection::.

`invalid-read-syntax'
     `"Invalid read syntax"'
     *Note Printed Representation::.

`invalid-regexp'
     `"Invalid regexp"'
     *Note Regular Expressions::.

`mark-inactive'
     `"The mark is not active now"'
     *Note The Mark::.

`no-catch'
     `"No catch for tag"'
     *Note Catch and Throw::.

`scan-error'
     `"Scan error"'
     This happens when certain syntax-parsing functions find invalid
     syntax or mismatched parentheses.
     *Note List Motion::, and *note Parsing Expressions::.

`search-failed'
     `"Search failed"'
     *Note Searching and Matching::.

`setting-constant'
     `"Attempt to set a constant symbol"'
     The values of the symbols `nil' and `t', and any symbols that
     start with `:', may not be changed.
     *Note Variables that Never Change: Constant Variables.

`text-read-only'
     `"Text is read-only"'
     This is a subcategory of `buffer-read-only'.
     *Note Special Properties::.

`undefined-color'
     `"Undefined color"'
     *Note Color Names::.

`void-function'
     `"Symbol's function definition is void"'
     *Note Function Cells::.

`void-variable'
     `"Symbol's value as variable is void"'
     *Note Accessing Variables::.

`wrong-number-of-arguments'
     `"Wrong number of arguments"'
     *Note Classifying Lists::.

`wrong-type-argument'
     `"Wrong type argument"'
     *Note Type Predicates::.

   These kinds of error, which are classified as special cases of
`arith-error', can occur on certain systems for invalid use of
mathematical functions.

`domain-error'
     `"Arithmetic domain error"'
     *Note Math Functions::.

`overflow-error'
     `"Arithmetic overflow error"'
     This is a subcategory of `domain-error'.
     *Note Math Functions::.

`range-error'
     `"Arithmetic range error"'
     *Note Math Functions::.

`singularity-error'
     `"Arithmetic singularity error"'
     This is a subcategory of `domain-error'.
     *Note Math Functions::.

`underflow-error'
     `"Arithmetic underflow error"'
     This is a subcategory of `domain-error'.
     *Note Math Functions::.


File: elisp,  Node: Standard Buffer-Local Variables,  Next: Standard Keymaps,  Prev: Standard Errors,  Up: Top

Appendix G Buffer-Local Variables
*********************************

The table below lists the general-purpose Emacs variables that
automatically become buffer-local in each buffer.  Most become
buffer-local only when set; a few of them are always local in every
buffer.  Many Lisp packages define such variables for their internal
use, but we don't try to list them all here.

   Every buffer-specific minor mode defines a buffer-local variable
named `MODENAME-mode'.  *Note Minor Mode Conventions::.  Minor mode
variables will not be listed here.

`auto-fill-function'
     *Note Auto Filling::.

`buffer-auto-save-file-format'
     *Note Format Conversion::.

`buffer-auto-save-file-name'
     *Note Auto-Saving::.

`buffer-backed-up'
     *Note Making Backups::.

`buffer-display-count'
     *Note Buffers and Windows::.

`buffer-display-table'
     *Note Active Display Table::.

`buffer-display-time'
     *Note Buffers and Windows::.

`buffer-file-coding-system'
     *Note Encoding and I/O::.

`buffer-file-format'
     *Note Format Conversion::.

`buffer-file-name'
     *Note Buffer File Name::.

`buffer-file-number'
     *Note Buffer File Name::.

`buffer-file-truename'
     *Note Buffer File Name::.

`buffer-file-type'
     *Note MS-DOS File Types::.

`buffer-invisibility-spec'
     *Note Invisible Text::.

`buffer-offer-save'
     *Note Killing Buffers::.

`buffer-save-without-query'
     *Note Killing Buffers::.

`buffer-read-only'
     *Note Read Only Buffers::.

`buffer-saved-size'
     *Note Auto-Saving::.

`buffer-undo-list'
     *Note Undo::.

`cache-long-line-scans'
     *Note Truncation::.

`case-fold-search'
     *Note Searching and Case::.

`comment-column'
     *Note Comments: (emacs)Comments.

`ctl-arrow'
     *Note Usual Display::.

`cursor-in-non-selected-windows'
     *Note Basic Windows::.

`cursor-type'
     *Note Cursor Parameters::.

`default-directory'
     *Note File Name Expansion::.

`defun-prompt-regexp'
     *Note List Motion::.

`desktop-save-buffer'
     *Note Desktop Save Mode::.

`enable-multibyte-characters'
     *note Text Representations::.

`fill-column'
     *Note Margins::.

`fill-prefix'
     *Note Margins::.

`font-lock-defaults'
     *Note Font Lock Basics::.

`fringe-cursor-alist'
     *Note Fringe Cursors::.

`fringe-indicator-alist'
     *Note Fringe Indicators::.

`fringes-outside-margins'
     *Note Fringes::.

`goal-column'
     *Note Moving Point: (emacs)Moving Point.

`header-line-format'
     *Note Header Lines::.

`indicate-buffer-boundaries'
     *Note Usual Display::.

`indicate-empty-lines'
     *Note Usual Display::.

`left-fringe-width'
     *Note Fringe Size/Pos::.

`left-margin'
     *Note Margins::.

`left-margin-width'
     *Note Display Margins::.

`line-spacing'
     *Note Line Height::.

`local-abbrev-table'
     *Note Standard Abbrev Tables::.

`major-mode'
     *Note Mode Help::.

`mark-active'
     *Note The Mark::.

`mark-ring'
     *Note The Mark::.

`mode-line-buffer-identification'
     *Note Mode Line Variables::.

`mode-line-format'
     *Note Mode Line Data::.

`mode-line-modified'
     *Note Mode Line Variables::.

`mode-line-process'
     *Note Mode Line Variables::.

`mode-name'
     *Note Mode Line Variables::.

`point-before-scroll'
     Used for communication between mouse commands and scroll-bar
     commands.

`right-fringe-width'
     *Note Fringe Size/Pos::.

`right-margin-width'
     *Note Display Margins::.

`save-buffer-coding-system'
     *Note Encoding and I/O::.

`scroll-bar-width'
     *Note Scroll Bars::.

`scroll-down-aggressively'
`scroll-up-aggressively'
     *Note Textual Scrolling::.

`selective-display'
`selective-display-ellipses'
     *Note Selective Display::.

`tab-width'
     *Note Usual Display::.

`truncate-lines'
     *Note Truncation::.

`vertical-scroll-bar'
     *Note Scroll Bars::.

`window-size-fixed'
     *Note Resizing Windows::.

`write-contents-functions'
     *Note Saving Buffers::.


File: elisp,  Node: Standard Keymaps,  Next: Standard Hooks,  Prev: Standard Buffer-Local Variables,  Up: Top

Appendix H Standard Keymaps
***************************

The following symbols are used as the names for various keymaps.  Some
of these exist when Emacs is first started, others are loaded only when
their respective mode is used.  This is not an exhaustive list.

   Several keymaps are used in the minibuffer.  *Note Completion
Commands::.

   Almost all of these maps are used as local maps.  Indeed, of the
modes that presently exist, only Vip mode and Terminal mode ever change
the global keymap.

`apropos-mode-map'
     A sparse keymap for `apropos' buffers.

`Buffer-menu-mode-map'
     A full keymap used by Buffer Menu mode.

`c-mode-map'
     A sparse keymap used by C mode.

`command-history-map'
     A full keymap used by Command History mode.

`ctl-x-4-map'
     A sparse keymap for subcommands of the prefix `C-x 4'.

`ctl-x-5-map'
     A sparse keymap for subcommands of the prefix `C-x 5'.

`ctl-x-map'
     A full keymap for `C-x' commands.

`custom-mode-map'
     A full keymap for Custom mode.

`debugger-mode-map'
     A full keymap used by Debugger mode.

`dired-mode-map'
     A full keymap for `dired-mode' buffers.

`edit-abbrevs-map'
     A sparse keymap used in `edit-abbrevs'.

`edit-tab-stops-map'
     A sparse keymap used in `edit-tab-stops'.

`electric-buffer-menu-mode-map'
     A full keymap used by Electric Buffer Menu mode.

`electric-history-map'
     A full keymap used by Electric Command History mode.

`emacs-lisp-mode-map'
     A sparse keymap used by Emacs Lisp mode.

`esc-map'
     A full keymap for `ESC' (or `Meta') commands.

`facemenu-menu'
     The sparse keymap that displays the Text Properties menu.

`facemenu-background-menu'
     The sparse keymap that displays the Background Color submenu of
     the Text Properties menu.

`facemenu-face-menu'
     The sparse keymap that displays the Face submenu of the Text
     Properties menu.

`facemenu-foreground-menu'
     The sparse keymap that displays the Foreground Color submenu of
     the Text Properties menu.

`facemenu-indentation-menu'
     The sparse keymap that displays the Indentation submenu of the Text
     Properties menu.

`facemenu-justification-menu'
     The sparse keymap that displays the Justification submenu of the
     Text Properties menu.

`facemenu-special-menu'
     The sparse keymap that displays the Special Props submenu of the
     Text Properties menu.

`local-function-key-map'
     The keymap for translating key sequences to preferred alternatives.
     If there are none, then it contains an empty sparse keymap.  *Note
     Translation Keymaps::.

`fundamental-mode-map'
     The sparse keymap for Fundamental mode.
     It is empty and should not be changed.

`global-map'
     The full keymap containing default global key bindings.
     Modes should not modify the Global map.

`grep-mode-map'
     The keymap for `grep-mode' buffers.

`help-map'
     The sparse keymap for the keys that follow the help character
     `C-h'.

`help-mode-map'
     The sparse keymap for Help mode.

`Helper-help-map'
     A full keymap used by the help utility package.
     It has the same keymap in its value cell and in its function cell.

`Info-edit-map'
     A sparse keymap used by the `e' command of Info.

`Info-mode-map'
     A sparse keymap containing Info commands.

`input-decode-map'
     The keymap for translating keypad and function keys.
     If there are none, then it contains an empty sparse keymap.  *Note
     Translation Keymaps::.

`isearch-mode-map'
     A keymap that defines the characters you can type within
     incremental search.

`key-translation-map'
     A keymap for translating keys.  This one overrides ordinary key
     bindings, unlike `local-function-key-map'.  *Note Translation
     Keymaps::.

`kmacro-map'
     A sparse keymap for keys that follows the `C-x C-k' prefix search.

`lisp-interaction-mode-map'
     A sparse keymap used by Lisp Interaction mode.

`lisp-mode-map'
     A sparse keymap used by Lisp mode.

`menu-bar-edit-menu'
     The keymap which displays the Edit menu in the menu bar.

`menu-bar-file-menu'
     The keymap which displays the File menu in the menu bar.

`menu-bar-help-menu'
     The keymap which displays the Help menu in the menu bar.

`menu-bar-mule-menu'
     The keymap which displays the Mule menu in the menu bar.

`menu-bar-search-menu'
     The keymap which displays the Search menu in the menu bar.

`menu-bar-tools-menu'
     The keymap which displays the Tools menu in the menu bar.

`mode-specific-map'
     The keymap for characters following `C-c'.  Note, this is in the
     global map.  This map is not actually mode specific: its name was
     chosen to be informative for the user in `C-h b'
     (`display-bindings'), where it describes the main use of the `C-c'
     prefix key.

`multi-query-replace-map'
     A sparse keymap that extends `query-replace-map' for multi-buffer
     replacements.  *Note query-replace-map: Search and Replace.

`occur-mode-map'
     A sparse keymap used by Occur mode.

`query-replace-map'
     A sparse keymap used for responses in `query-replace' and related
     commands; also for `y-or-n-p' and `map-y-or-n-p'.  The functions
     that use this map do not support prefix keys; they look up one
     event at a time.

`search-map'
     A sparse keymap that provides global bindings for search-related
     commands.

`text-mode-map'
     A sparse keymap used by Text mode.

`tool-bar-map'
     The keymap defining the contents of the tool bar.

`view-mode-map'
     A full keymap used by View mode.


File: elisp,  Node: Standard Hooks,  Next: Index,  Prev: Standard Keymaps,  Up: Top

Appendix I Standard Hooks
*************************

The following is a list of hook variables that let you provide
functions to be called from within Emacs on suitable occasions.

   Most of these variables have names ending with `-hook'.  They are
"normal hooks", run by means of `run-hooks'.  The value of such a hook
is a list of functions; the functions are called with no arguments and
their values are completely ignored.  The recommended way to put a new
function on such a hook is to call `add-hook'.  *Note Hooks::, for more
information about using hooks.

   Every major mode defines a mode hook named `MODENAME-mode-hook'.
The major mode command runs this normal hook with `run-mode-hooks' as
the very last thing it does.  *Note Mode Hooks::.  Most minor modes
have mode hooks too.  Mode hooks are omitted in the list below.

   The variables whose names end in `-hooks' or `-functions' are
usually "abnormal hooks"; their values are lists of functions, but
these functions are called in a special way (they are passed arguments,
or their values are used). The variables whose names end in `-function'
have single functions as their values.

   A special feature allows you to specify expressions to evaluate if
and when a file is loaded (*note Hooks for Loading::).  That feature is
not exactly a hook, but does a similar job.

`abbrev-expand-functions'
     *Note Abbrev Expansion::.

`activate-mark-hook'
     *Note The Mark::.

`after-change-functions'
     *Note Change Hooks::.

`after-change-major-mode-hook'
     *Note Mode Hooks::.

`after-init-hook'
     *Note Init File::.

`after-insert-file-functions'
     *Note Format Conversion::.

`after-make-frame-functions'
     *Note Creating Frames::.

`after-revert-hook'
     *Note Reverting::.

`after-save-hook'
     *Note Saving Buffers::.

`auto-fill-function'
     *Note Auto Filling::.

`auto-save-hook'
     *Note Auto-Saving::.

`before-change-functions'
     *Note Change Hooks::.

`before-hack-local-variables-hook'
     *Note File Local Variables::.

`before-init-hook'
     *Note Init File::.

`before-make-frame-hook'
     *Note Creating Frames::.

`before-revert-hook'
     *Note Reverting::.

`before-save-hook'
     *Note Saving Buffers::.

`blink-paren-function'
     *Note Blinking::.

`buffer-access-fontify-functions'
     *Note Lazy Properties::.

`calendar-initial-window-hook'
     *Note Calendar Customizing: (emacs)Calendar Customizing.

`calendar-load-hook'
     *Note Calendar Customizing: (emacs)Calendar Customizing.

`calendar-today-invisible-hook'
     *Note Calendar Customizing: (emacs)Calendar Customizing.

`calendar-today-visible-hook'
     *Note Calendar Customizing: (emacs)Calendar Customizing.

`change-major-mode-hook'
     *Note Creating Buffer-Local::.

`command-line-functions'
     *Note Command-Line Arguments::.

`comment-indent-function'
     *Note Options Controlling Comments: (emacs)Options for Comments.

`compilation-finish-functions'
     Functions to call when a compilation process finishes.

`custom-define-hook'
     Hook called after defining each customize option.

`deactivate-mark-hook'
     *Note The Mark::.

`delete-frame-functions'
     Functions to call when Emacs deletes a frame.  *Note Deleting
     Frames::.

`delete-terminal-functions'
     Functions to call when Emacs deletes a terminal.  *Note Multiple
     Terminals::.

`desktop-after-read-hook'
     Normal hook run after a successful `desktop-read'.  May be used to
     show a buffer list.  *Note Saving Emacs Sessions: (emacs)Saving
     Emacs Sessions.

`desktop-no-desktop-file-hook'
     Normal hook run when `desktop-read' can't find a desktop file.
     May be used to show a dired buffer.  *Note Saving Emacs Sessions:
     (emacs)Saving Emacs Sessions.

`desktop-save-hook'
     Normal hook run before the desktop is saved in a desktop file.
     This is useful for truncating history lists, for example.  *Note
     Saving Emacs Sessions: (emacs)Saving Emacs Sessions.

`diary-hook'
     List of functions called after the display of the diary.  Can be
     used for appointment notification.

`diary-list-entries-hook'
     *Note Fancy Diary Display: (emacs)Fancy Diary Display.

`diary-mark-entries-hook'
     *Note Fancy Diary Display: (emacs)Fancy Diary Display.

`diary-nongregorian-listing-hook'
     *Note Non-Gregorian Diary: (emacs)Non-Gregorian Diary.

`diary-nongregorian-marking-hook'
     *Note Non-Gregorian Diary: (emacs)Non-Gregorian Diary.

`diary-print-entries-hook'
     *Note Diary Display: (emacs)Diary Display.

`disabled-command-function'
     *Note Disabling Commands::.

`echo-area-clear-hook'
     *Note Echo Area Customization::.

`emacs-startup-hook'
     *Note Init File::.

`find-file-hook'
     *Note Visiting Functions::.

`find-file-not-found-functions'
     *Note Visiting Functions::.

`first-change-hook'
     *Note Change Hooks::.

`font-lock-beginning-of-syntax-function'
     *Note Syntactic Font Lock::.

`font-lock-fontify-buffer-function'
     *Note Other Font Lock Variables::.

`font-lock-fontify-region-function'
     *Note Other Font Lock Variables::.

`font-lock-mark-block-function'
     *Note Other Font Lock Variables::.

`font-lock-syntactic-face-function'
     *Note Syntactic Font Lock::.

`font-lock-unfontify-buffer-function'
     *Note Other Font Lock Variables::.

`hack-local-variables-hook'
     *Note File Local Variables::.

`font-lock-unfontify-region-function'
     *Note Other Font Lock Variables::.

`kbd-macro-termination-hook'
     *Note Keyboard Macros::.

`kill-buffer-hook'
     *Note Killing Buffers::.

`kill-buffer-query-functions'
     *Note Killing Buffers::.

`kill-emacs-hook'
     *Note Killing Emacs::.

`kill-emacs-query-functions'
     *Note Killing Emacs::.

`lisp-indent-function'

`mail-setup-hook'
     *Note Mail Mode Miscellany: (emacs)Mail Mode Misc.

`menu-bar-update-hook'
     *Note Menu Bar::.

`minibuffer-setup-hook'
     *Note Minibuffer Misc::.

`minibuffer-exit-hook'
     *Note Minibuffer Misc::.

`mouse-position-function'
     *Note Mouse Position::.

`occur-hook'

`post-command-hook'
     *Note Command Overview::.

`pre-command-hook'
     *Note Command Overview::.

`resume-tty-functions'
     *Note Suspending Emacs::.

`scheme-indent-function'

`suspend-hook'
     *Note Suspending Emacs::.

`suspend-resume-hook'
     *Note Suspending Emacs::.

`suspend-tty-functions'
     *Note Suspending Emacs::.

`temp-buffer-setup-hook'
     *Note Temporary Displays::.

`temp-buffer-show-function'
     *Note Temporary Displays::.

`temp-buffer-show-hook'
     *Note Temporary Displays::.

`term-setup-hook'
     *Note Terminal-Specific::.

`window-configuration-change-hook'
     *Note Window Hooks::.

`window-scroll-functions'
     *Note Window Hooks::.

`window-setup-hook'
     *Note Window Systems::.

`window-size-change-functions'
     *Note Window Hooks::.

`write-contents-functions'
     *Note Saving Buffers::.

`write-file-functions'
     *Note Saving Buffers::.

`write-region-annotate-functions'
     *Note Format Conversion::.

