pax_global_header00006660000000000000000000000064125324153610014514gustar00rootroot0000000000000052 comment=31e6eb88620f3da19cee7dbade49cca14a3dd8ab post-mode-2.6/000077500000000000000000000000001253241536100132725ustar00rootroot00000000000000post-mode-2.6/AUTHORS000066400000000000000000000002451253241536100143430ustar00rootroot00000000000000Eric Kidd Dave Pearson Rob Reid Roland Rosenfeld Eric Dorland post-mode-2.6/COPYING000066400000000000000000001045131253241536100143310ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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. Copyright (C) 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 . 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: Copyright (C) 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 . 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 . post-mode-2.6/NEWS000066400000000000000000000002111253241536100137630ustar00rootroot00000000000000# Version 2.6 * Clarified license, GPLv3. * Remove old style backquotes and use of insert-string. * Better support for flyspell support. post-mode-2.6/README.md000066400000000000000000000012231253241536100145470ustar00rootroot00000000000000post-mode ========= This is a major mode for use with [mutt](http://www.mutt.org/), slrn, or most email and newsreaders that allow you to use an external editor. Installation ------------ Add the following line to the .emacs(.el) file in your home directory: (load "/your/local/path/to/this/file/post") Note that you can omit the ".el" from the file name when calling load. If you want to make it available to all your users, type `\C-h v load-path RET`, pick an appropriate directory for `post.el`, and modify your sitewide `default.el` to `(require 'post)`. You may find the latest version of this mode at http://github.com/zedinosaur/post-mode/ post-mode-2.6/post.el000066400000000000000000001504561253241536100146140ustar00rootroot00000000000000;; post.el --- Use (X?)Emacs(client) as an external editor for mail and news. ;;; Authors: Eric Kidd , ;;; Dave Pearson , ;;; Rob Reid , ;;; Roland Rosenfeld ;;; Copyright 1999, 2002, 2004, 2008, 2014 Eric Kidd, Dave Pearson, Rob Reid, ;;; and Roland Rosenfeld. ;;; 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 . ;;; Maintainers: Eric Dorland and ;;; Rob Reid ;;; Keywords: mail ;;; Commentary: ;; This is a major mode for use with mutt (http://www.mutt.org/), slrn, or most ;; email and newsreaders that allow you to use an external editor. ;; ;; Installation: ;; ;; Add the following line to the .emacs(.el) file in your home directory: ;; ;; (load "/your/local/path/to/this/file/post") ;; ;; Note that you can omit the ".el" from the file name when calling load. ;; ;; If you want to make it available to all your users, type \C-h v ;; load-path RET, pick an appropriate directory for post.el, and modify ;; your sitewide default.el to (require 'post). ;; ;; You may find the latest version of this mode at ;; http://sourceforge.net/projects/post-mode/ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; BUGS: ;; ;; Rob: I predict that some buffers (*Original*<2>, *Composing*<2>?) ;; will be left behind if you edit more than one message at a time. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Thanks ;;; ;;; Dave Pearson: Code, feature ideas, Mutt experience. Many thanks! ;;; Louis Theran: Encouragement to make Mutt mode work like Emacs MUAs. ;;; Ronald: Enlightening gripes about what Emacs should do, but doesn't. ;;; Robert Napier: Bug reports about font-lock mode, fancy wrapping. ;;; Kevin Rodgers: Answered RR's question on gnu.emacs.help on ;;; overwriting server-process-filter's annoying message at startup. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Revision History ;;; ;;; Revision 2.51 2014/04/26 21:01:30 rreid ;;; Adopted Stefan-W. Hahn's suggestion to replace next-line with forward-line ;;; to work around a bug with some emacs versions, and updated my email address. ;;; ;;; Revision 2.402 2008/02/24 23:31:19 rreid ;;; Emacs 22 finally fixed (how-many) to return an int instead of a string, ;;; i.e. 13 instead of '13 occurrences'. A few people noticed that the change ;;; broke my workaround, but Erik Mugele submitted the winning patch that works ;;; for all emacs versions (I hope). ;;; ;;; This, and the below, are real entries, with real version numbers. Some of ;;; the above are fake commits to get the version number back in sync. ;;; ;;; Revision 2.401 2004/07/23 16:27:29 rreid ;;; Fixed post-delete-quoted-signatures to not remove sneaky things like quoted ;;; double dash arrows. Thanks go to Felix Klee for a clear bug report. ;;; ;;; Revision 2.4 2002/04/22 22:04:29 reid ;;; Tweaked post-emoticon-pattern yet again. Made cl mandatory for all ;;; versions of emacs. (Thanks to Eric Dorland and Mike Schiraldi for bug ;;; reports.) Fixed post-unquote-region. (Thanks to Mike Schiraldi for the ;;; bug report.) ;;; ;;; Revision 2.3 2002/04/21 20:13:55 reid ;;; Improved post-emoticon-pattern. ;;; ;;; Revision 2.2 2002/04/20 04:12:54 reid ;;; Improved post-emoticon-pattern. ;;; ;;; Revision 2.1 2002/04/20 03:17:48 reid ;;; - A major (but not total) synchronization with Dave Pearson's post-mode. ;;; header-set-followup-to and header-set-organization should work now. ;;; - Syntax highlighting now works for quoted email addresses and URLs. ;;; - *bold* words are now highlighted. ;;; - Emoticons can now be highlighted, and the default regexp, ;;; post-emoticon-pattern, might be too enthusiastic for your taste. In case ;;; you're curious, I verified that gnus' smiley-ems.el works with post, but I ;;; decided that it wasn't ideal. ;;; - post-url-text-pattern changed to post-url-pattern and made more enthusiastic. ;;; ;;; revision 1.95 2002/04/10 00:06:26 reid ;;; Fixed the regexp in post-kill-signature to not delete everything between ;;; mutt's standard forwarding lines. post-kill-signature is called indirectly ;;; by many functions. ;;; ;;; Revision 1.9 2002/04/04 22:24:31 reid ;;; Applied a patch (not quite verbatim) from The Anarcat ;;; to make the entity separating siglets in ;;; `post-variable-signature-source' a regexp, `post-signature-sep-regexp'. The ;;; default works either either the old post file format or strfiled (fortune) ;;; files. ;;;; ;;; Changed default `post-random-signature-command' to `fortune ;;; ~/.mutt/sigs.fortune'. ;;; ;;; `post-random-signature-command' should now NOT supply a fixed sig portion! ;;; ;;; (post-el-random-signature) supplied by The Anarcat to do random sig ;;; selection purely within Emacs Lisp. ;;; ;;; Revision 1.8 2002/02/06 22:24:31 eric ;;; clean up ;;; ;;; Revision 1.7.2 2002/02/06 22:17:01 eric ;;; tweak regexps, make font-lock-comment-face be post-signature-text-face ;;; ;;; Revision 1.7.1 2002/02/06 21:58:58 eric ;;; tweak regexp, change some types to regexp ;;; ;;; Revision 1.7.0 2002/02/06 21:36:56 eric ;;; hilight signatures, urls and emails ;;; ;;; Revision 1.6.3.10 1999/10/11 00:29:41 roland ;;; Corrected color quoting again: Now allows ">" in the middle of ;;; a line which is quoted twice. ;;; ;;; Revision 1.6.3.9 1999/10/08 10:43:18 roland ;;; Add third level of quoting faces. ;;; Allow super-cite name prefixes before quote signs. ;;; ;;; Revision 1.6.3.8 1999/10/08 08:39:00 roland ;;; post-font-lock-keywords now detects lines with only "> "in it ;;; correctly (merged following line into it before). ;;; ;;; Revision 1.6.3.7 1999/10/04 10:07:48 roland ;;; Add post-quote-region and post-unquote-region commands to quote and ;;; unquote a region (one level). ;;; ;;; Revision 1.6.3.6 1999/09/03 23:13:55 reid ;;; Valeriy E. Ushakov pointed out that (GNU) Emacs <20 has ;;; fewer (optional) arguments to (read-string) than what I was using to ;;; inherit the input method. I didn't find a way off the top of my head ;;; to redefine (read-string) without causing an infinite loop, so I have ;;; substituted a macro (string-read prompt) which does the right thing, ;;; so please use it instead of read-string. ;;; ;;; Revision 1.6.3.5 1999/08/29 19:58:49 reid ;;; Changed default post-mail-message to handle hostnames with digits. ;;; Thanks to Brian D. Winters . ;;; ;;; Revision 1.6.3.4 1999/03/20 03:02:05 reid ;;; Made post compatible with emacs as far back as 19.28.1, probably ;;; farther. ;;; ;;; Revision 1.6.3.3 1999/03/16 03:14:07 reid ;;; Cleaned up post-select-signature-select-sig-from-file code. ;;; ;;; Revision 1.6.3.2 1999/03/16 03:05:12 reid ;;; Fixed alist updating. ;;; ;;; Revision 1.6.3.1 1999/03/13 02:23:48 reid ;;; Added defface to the list of things that get defined if customize ;;; hasn't already done it. Thanks to Melissa Binde for the bug report. ;;; ;;; Modified post-body-says-attach to use a regexp, ;;; post-attachment-regexp, so that something like "\(attach\|anbringen\)" ;;; can be used by bilingual people like Roland. ;;; ;;; Revision 1.6.2.1 1999/03/12 10:16:11 roland ;;; Added missing () to post-insert-to-auto-mode-alist-on-load. ;;; ;;; Revision 1.6.2 1999/03/11 15:51 Dave Pearson ;;; header-position-on-value fixed to return (point), and ;;; defcustom macro provided for Emacs 19 users. ;;; ;;; Revision 1.6.1.2 1999/03/06 11:24:43 roland ;;; Added post-insert-to-auto-mode-alist-on-load. ;;; ;;; Revision 1.6.1.1 1999/03/06 11:02:27 roland ;;; Customized renaming of buffer. ;;; Removed different handling for mail, news, news-reply. ;;; Fixed problems with easy-menu under XEmacs. ;;; ;;; Revision 1.6.0 1999/03/04 18:04 Rob Reid ;;; Returned post-signature-pattern to using "--" instead of "-- " ;;; because some senders have broken MTAs (as Eric reminded me) and ;;; some users don't use procmail to compensate. This time all of the ;;; functions dealing with signatures have been smartened up to avoid ;;; false matches. Unfortunately that means they don't use ;;; post-signature-pattern in its raw form. ;;; ;;; Added post-backup-original so that Dave's post-copy-original can ;;; be used. ;;; ;;; Kevin Rodgers explained how to put this in .emacs to fix the ;;; server-process-filter's annoying message problem: ;;; ;;; Revision 1.1 1999/03/04 18:02:30 reid ;;; Initial revision ;;; ;;; %%%%%%%%%%%% Put in .emacs %%%%%%%%%%% ;;; ;;; ;;; Email ;;; (server-start) ;;; (load "/home/reid/.mutt/post") ;;; (defadvice server-process-filter (after post-mode-message first activate) ;;; "If the buffer is in post mode, overwrite the server-edit ;;; message with a post-save-current-buffer-and-exit message." ;;; (if (eq major-mode 'post-mode) ;;; (message ;;; (substitute-command-keys "Type \\[describe-mode] for help composing; \\[post-save-current-buffer-and-exit] when done.")))) ;;; ; This is also needed to see the magic message. Set to a higher ;;; ; number if you have a faster computer or read slower than me. ;;; '(font-lock-verbose 1000) ;;; ; (setq server-temp-file-regexp "mutt-") ;;; (add-hook 'server-switch-hook ;;; (function (lambda() ;;; (cond ((string-match "Post" mode-name) ;;; (post-goto-body)))))) ;;; ;;; %%%%%%%%% We now return to our regular commentary %%%%%%%%% ;;; ;;; Eric Kidd asked that the name of Headers mode be changed so that ;;; it doesn't conflict with mutt-mode's Headers, so I changed it to ;;; just Header (no s). ;;; ;;; Revision 1.5? 1999/02/27 17:30 Rob Reid ;;; I had a go at combining Dave Pearson's post mode with Eric Kidd's ;;; Mutt mode. Since Dave Pearson's post mode explicitly handles news as ;;; well as email, and this should be useful for more than just mutt, ;;; I'm calling it post mode. I also added functions for picking ;;; random signatures, selecting a signature from a file, and ;;; intelligently (IMHO) prompting the user for an attachment when ;;; necessary. Changed mutt-save-buffer-and-exit to work better with ;;; emacsclient, and some of the key bindings. post-signature-pattern ;;; now defaults to use "-- " instead of "--", and I have far less ;;; trouble this way (I use procmail to clean up braindead "--"s.). I ;;; don't know why Eric warned against trailing whitespace. ;;; ;;; Revision 1.4 1998/04/11 00:05:46 emk ;;; Fixed font-lock bug. Also made mutt-mode a little more careful about ;;; saving various bits of Emacs state when moving around the buffer. ;;; ;;; Revision 1.3 1998/03/25 00:37:36 emk ;;; Added support for menus and font-lock mode, plus a few bug fixes. ;;; ;;; Revision 1.2 1998/03/24 13:19:46 emk ;;; Major overhaul--more commands, a minor mode for header editing, and other ;;; desirable features. Attaching files seems to be broken, though. ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Required Packages (require 'cl) (require 'derived) (require 'easymenu) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Customization Support ;;; ;;; Set up our customizable features. You can edit these (and lots of other ;;; fun stuff) by typing M-x customize RET. The Post preferences can be ;;; found under the [Applications] [Mail] category. ;; Make post mode a bit more compatible with older (i.e. <20) versions of emacs. ;;; Code: (eval-and-compile ;; Dumb down read-string if necessary. ;; The number of optional arguments for read-string seems to increase ;; sharply with (emacs-version). Since old versions of emacs are a large ;; source of bug reports it might be worth writing (or looking for) ;; (bug-report barlennan@gmail.com) which emails me the result of ;; (emacs-version) along with a user supplied description of the problem. ;; GNU Emacs 19.28.1 only has INITIAL-STRING as an optional argument. ;; 19.34.1 has (read-string PROMPT &optional INITIAL-INPUT HISTORY). 20.2.1 ;; has (read-string PROMPT &optional INITIAL-INPUT HISTORY DEFAULT-VALUE ;; INHERIT-INPUT-METHOD). ;; Since I haven't found a way of redefining read-string without causing an ;; infinite loop, please use (string-read prompt). (if (< (string-to-number (substring (emacs-version) (string-match "[0-9]+\.[0-9]" (emacs-version) 5))) 20) (defmacro string-read (prompt) `(read-string ,prompt)) (defmacro string-read (prompt) `(read-string ,prompt nil nil nil t))) ;; XEmacs gnuserv uses slightly different functions than the GNU Emacs ;; server, and some people are still wasting time and CPU cycles by starting ;; up a new emacs each time. (fset 'post-finish (cond ((fboundp 'server-edit) 'server-edit) ((fboundp 'gnuserv-kill-buffer-function) 'gnuserv-kill-buffer-function) (t 'save-buffers-kill-emacs))) ;; (cond ((fboundp 'server-edit) ;; (fset 'post-finish 'server-edit)) ;; ((fboundp 'gnuserv-kill-buffer-function) ;; (fset 'post-finish 'gnuserv-kill-buffer-function)) ;; (t ;; (fset 'post-finish 'save-buffers-kill-emacs))) ;; If customize isn't available just use defvar instead. (unless (fboundp 'defgroup) (defmacro defgroup (&rest rest) nil) (defmacro defcustom (symbol init docstring &rest rest) ; The "extra" braces and whitespace are for emacs < 19.29. `(defvar ,symbol ,init ,docstring)) (defmacro defface (&rest args) nil)) (unless (fboundp 'buffer-substring-no-properties) (fset 'buffer-substring-no-properties 'buffer-substring))) (defgroup post nil "Composing e-mail messages with Post. Emacs can run as an external editor for Mutt, the spiffy Unix mail reader du jour, or slrn, the spiffy Unix news reader du jour. You can get Mutt from http://www.mutt.org/." :group 'mail) (defcustom post-uses-fill-mode t "*Specifies whether Post should automatically wrap lines. Set this to t to enable line wrapping, and nil to disable line wrapping. Note that if a paragraph gets messed up (the line wrapper is very primitive), you can type \\[fill-paragraph] to rewrap the paragraph." :type 'boolean :group 'post) (defcustom post-mail-message "\\(mutt\\(ng\\)?-[a-zA-Z0-9-.]+-[0-9]+-[0-9]+\\(-[a-fA-F0-9]+\\)?\\|mutt\\(ng\\)?[a-zA-Z0-9._-]\\{6\\}\\)\\'" "*Regular expression which matches your mailer's temporary files." :type 'regexp :group 'post) (defcustom post-news-posting "\\.\\(followup\\|letter\\|article\\)$" "*Regular expression which matches your news reader's composition files." :type 'regexp :group 'post) (defcustom post-backup-original nil "*Controls whether a pristine backup of the original is kept for reference." :type 'boolean :group 'post) (defcustom post-signature-pattern "\\(--\\| \\)" "*Pattern signifying the beginning of signatures. It should not contain trailing whitespace unless you know what you're doing." :type 'regexp :group 'post) (defcustom post-signature-sep-regexp "^\\(%\\|^L\\|--\\)?\n" "*Regular expression delimiting signatures in the signature file. This allows the use of classic fortune files as signature files. This should normally contain a newline." :type 'regexp :group 'post) (defcustom post-signature-source-is-file t "*Toggles the signature source type between file and directory." :type 'boolean :group 'post) (defcustom post-variable-signature-source "~/.mutt/sigs.fortune" "*Location of the variable part of your signature. Post uses this to locate signatures. It can be either a directory with one item per file or a file with items separated by blank lines." :type 'string :group 'post) (defcustom post-fixed-signature-source "~/.fixedsig" "*File with the fixed part of your signature." :type 'string :group 'post) (defcustom post-signature-directory "~/.sigs/" "*The directory that contains your collection of signature files." :type 'string :group 'post) (defcustom post-signature-wildcard "sig*" "*Wildcard for finding signature files in your signature directory." :type 'string :group 'post) (defcustom post-random-signature-command "fortune ~/.mutt/sigs.fortune" "*Command to run to get a random signature. Examples are available at http://astro.utoronto.ca/~reid/mutt/" :type 'string :group 'post) (defcustom post-kill-quoted-sig t "Specifies whether `post-mode' should automatically kill quoted signatures." :type 'boolean :group 'post) (defcustom post-jump-header t "Specifies wheather `post-mode' should jump to the body." :type 'boolean :group 'post) (defcustom post-force-pwd-to-home t "Specifies whether `post-mode' should cd to your home directory." :type 'boolean :group 'post) (defcustom post-email-address (concat (user-login-name) "@" mail-host-address) "*Your email address." :type 'string :group 'post) (defcustom post-should-prompt-for-attachment 'Smart "*Controls whether an attachment will be prompted for before saving the message and exiting. 'Smart' will prompt only if the body contains post-attachment-regexp." :type '(choice (const Never) (const Smart) (const Always)) :group 'post) (defcustom post-attachment-regexp "^[ \t\f]*[^>].*attach" "*This is what post looks for in the body if post-should-prompt-for-attachment is 'Smart'." :type 'regexp :group 'post) (defcustom post-news-poster-regexp "^On .*<.*>.*wrote:$" "Regular expression used to locate the attribution line of a news posting." :type 'regexp :group 'post) (defcustom post-rename-buffer t "Specify whether `post-mode' should rename the buffer to *Composing*." :type 'boolean :group 'post) (defcustom post-insert-to-auto-mode-alist-on-load t "Automatically insert `post-mode' with `post-mail-message' to `auto-mode-alist'." :type 'boolean :group 'post) (defcustom post-mode-hook nil "List of hooks to be executed on entry to `post-mode'." :group 'post) (defcustom post-quote-start "> " "Pattern which is added (or removed) at the beginning of the line by comment-region" :type 'string :group 'post) (defcustom post-email-address-pattern "[A-Za-z0-9_][-A-Za-z0-9._]*@[-A-Za-z0-9._]*[A-Za-z0-9]" "Pattern to detect email addresses." :type 'regexp :group 'post) (defcustom post-url-pattern '("\\<\\(\\(https?\\|news\\|mailto\\|ftp\\|gopher\\):\\|\\(www\\|ftp\\)\\.\\)[-~A-Za-z0-9._/%$+?#:;&=]+[A-Za-z0-9/#&=]" "") "Pattern to detect URL addresses." :type '(repeat regexp) :group 'post) (defcustom post-bold-pattern '("\\*\\w+\\*") "*List of regular expressions that define bold text." :type '(repeat regexp) :group 'post) (defcustom post-underline-pattern '("_\\w+_") "*List of regular expressions that define underlined text." :type '(repeat regexp) :group 'post) (defcustom post-emoticon-pattern '("[0O(<{}]?[;:8B|][.,]?[-+^*o0O][{<>/\|]?[][)>(<|/\P][)>]?" "[(<]?[][)>(<|/\][}<>|]?[-+^*oO0][,.]?[:8][0O>]?" "[;:][][P)\/(]" "\\s [][)(P\/][:;]" "<[Gg]>" "<[BbSs][Gg]>") "*List of regular expressions that define a emoticon." :type '(repeat regexp) :group 'post) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Customizable Faces ;;; If you find a more attractive color scheme for dark backgrounds, please ;;; email it to reid@astro.utoronto. (defgroup post-faces nil "Typefaces used for composing messages with Post." :group 'post :group 'faces) (defface post-header-keyword-face '((((class color) (background light)) (:foreground "Navy" :bold t)) (((class color) (background dark)) (:foreground "LightBlue" :bold t)) (t (:bold t))) "Face used for displaying keywords (e.g. \"From:\") in header." :group 'post-faces) (defface post-header-value-face '((((class color) (background light)) (:foreground "MidnightBlue")) (((class color) (background dark)) (:foreground "LightSteelBlue"))) "Face used for displaying the values of header." :group 'post-faces) (defface post-quoted-text-face '((((class color) (background light)) (:foreground "Sienna" :italic t)) (((class color) (background dark)) (:foreground "Wheat" :italic t)) (t (:bold t :italic t))) "Face used for displaying text which has been quoted (e.g. \">foo\")." :group 'post-faces) (defface post-double-quoted-text-face '((((class color) (background light)) (:foreground "Firebrick" :italic t)) (((class color) (background dark)) (:foreground "Tan" :italic t)) (t (:italic t))) "Face used for text which has been quoted twice (e.g. \">>foo\")." :group 'post-faces) (defface post-multiply-quoted-text-face '((((class color) (background light)) (:foreground "goldenrod" :italic t)) (((class color) (background dark)) (:foreground "tan3" :italic t)) (t (:italic t))) "Face used for text which has been quoted more than twice (e.g. \">>>foo\")." :group 'post-faces) (defface post-signature-text-face '((((class color) (background light)) (:foreground "red3")) (((class color) (background dark)) (:foreground "red1")) (t (:bold t))) "Face used for text that is part of a signature" :group 'post-faces) (defface post-email-address-text-face '((((class color) (background light)) (:foreground "green3")) (((class color) (background dark)) (:foreground "green1")) (t (:italic t))) "Face used for email addresses" :group 'post-faces) (defface post-url-face '((((class color) (background light)) (:foreground "green3" :bold t)) (((class color) (background dark)) (:foreground "green1" :bold t)) (t (:italic t))) "Face used for URL addresses" :group 'post-faces) (defface post-emoticon-face '((((class color) (background light)) (:foreground "black" :background "yellow" :bold t)) (((class color) (background dark)) (:foreground "black" :background "yellow" :bold t)) (t (:bold t))) "Face used for text matched by post-emoticon-pattern." :group 'post-faces) (defface post-bold-face '((((class color) (background light)) (:bold t)) (((class color) (background dark)) (:bold t)) (t (:bold t))) "Face used for text matching post-bold-pattern." :group 'post-faces) (defface post-underline-face '((((class color) (background light)) (:underline t)) (((class color) (background dark)) (:underline t)) (t (:underline t))) "Face used for text matching post-underline-pattern." :group 'post-faces) ; Note: some faces are added later! (defvar post-quoted-text-pattern "^[ \t\f]*\\(>[ \t\f]*\\)\\([-a-zA-Z]*>[ \t\f]*\\)\\([-a-zA-Z]*>.*\\)$" "Regexp for recognizing quoted text") (defvar post-font-lock-keywords `(("^\\([A-Z][-A-Za-z0-9.]+:\\)\\(.*\\)$" (1 'post-header-keyword-face) (2 'post-header-value-face)) (,post-quoted-text-pattern (1 'post-quoted-text-face) (2 'post-double-quoted-text-face) (3 'post-multiply-quoted-text-face)) ("^[ \t\f]*\\(>[ \t\f]*\\)\\([-a-zA-Z]*>.*\\)$" (1 'post-quoted-text-face) (2 'post-double-quoted-text-face)) ("^[ \t\f]*\\(>[ \t\f]*[^ \t\f\n>].*\\)$" (1 'post-quoted-text-face)) ("^[ \t\f]*\\(>[ \t\f]*\\)$" (1 'post-quoted-text-face)) (,post-email-address-pattern (0 'post-email-address-text-face))) "Highlighting rules for message mode.") ;;; Declare global mode variables. (defconst post-font-lock-syntactic-keywords `((,(concat "^" post-signature-pattern "[ \t\f]*$") 0 '(11)))) (defun post-font-lock-syntactic-face-function (state) "Function for font locking syntactic faces. Argument STATE ." post-signature-text-face) (defvar post-buf nil "Name of the composing buffer.") (defvar post-select-signature-mode-map nil "Local keymap for the select-signature buffer.") (defvar post-select-signature-last-buffer nil "Pointer to the calling buffer.") (defvar post-select-signature-last-point nil "Where we were in the calling buffer.") (defvar post-has-attachment nil "Whether the message has an attachment.") (defvar post-ispell-skip-alist `(("^[A-Z][-A-Za-z0-9]+:") ("^\\(To|Cc|Bcc|From|Reply-To\\): .*$") (,post-url-pattern) (,post-email-address-pattern) (,post-quoted-text-pattern)) "What ispell should skip in buffer") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Interactive Commands (defun post-save-current-buffer-and-exit () "Save the current buffer and exit Emacs." (interactive) ;; Should the user be prompted for an attachment? (cond (post-has-attachment) ((equal post-should-prompt-for-attachment 'Never)) ((or (equal post-should-prompt-for-attachment 'Always) (post-body-says-attach-p)) (post-prompt-for-attachment))) (basic-save-buffer) (if post-backup-original (kill-buffer "*Original*")) (post-finish) ;; Added by Rob Reid 10/13/1998 to prevent accumulating *Composing* buffers ;; when using (emacs|gnu)client. Helped by Eric Marsden's Eliza example in ;; http://www.ssc.com/lg/issue29/marsden.html ; (kill-buffer post-buf) ) (defun post-goto-body () "Go to the beginning of the message body." (interactive) (goto-char (point-min)) ;; If the message has header, slide downward. (and header-mode (save-match-data (re-search-forward "^$" nil t)) (forward-line))) (defun post-goto-signature () "Go to the beginning of the message signature." (interactive) (goto-char (point-max)) (and (save-match-data (re-search-backward (concat "^" post-signature-pattern "[ \t\f]*$") nil t)))) (defun post-delete-quoted-signatures () "Delete quoted signatures from buffer." (interactive) (goto-char (point-min)) (flush-lines (concat "^\\([ \t\f]*>[ \t\f>]*\\)" post-signature-pattern "[ \t\f]*\\(\n\\1.*\\)+"))) (defun post-kill-signature () "Kill the signature from the buffer. Returns the point value for where the signature was or, if there isn't a signature, the point value of the end of the buffer" (interactive) (save-excursion (goto-char (point-min)) ; The .=*+|#@!~$%&()_- is to compensate for people who put ASCII art on the ; same line as the sigdashes, and the $ at the end prevents this from deleting ; everything between mutt's standard forwarding lines. (cond ((search-forward-regexp (concat "^" post-signature-pattern "[ \t\f.=*+|#@!~$%&()_-]*$") nil t) (beginning-of-line) (kill-region (point) (point-max))) (t (goto-char (point-max)))) (point))) (defun post-delete-old-citations () "Delete citations more than one level deep from buffer." (interactive) (goto-char (point-min)) (flush-lines "^[ \t\f]*>[ \t\f]*>[ \t\f>]*")) ;;; Functions for messing with the body (defun post-make-region-bold (start end) "Apply mutt's nroff style bold to a region of text. Argument START start of region. Argument END end of region." (interactive "r") (while (< start end) (goto-char start) (insert (buffer-substring-no-properties start (1+ start))) (insert (char-to-string 8)) (setq start (+ start 3)) (setq end (+ end 2)))) (defun post-make-region-underlined (start end) "Apply mutt's nroff style underline to a region of text. Argument START start of region. Argument END end of region." (interactive "r") (while (< start end) (goto-char start) (insert "_" (char-to-string 8)) (setq start (+ start 3)) (setq end (+ end 2)))) (defun post-quote-region (beg end) "Quote a region using the `post-quote-start' variable. Argument BEG Beginning of region to be quoted. Argument END End of region to be quoted." (interactive "r") (comment-region beg end)) (defun post-unquote-region (beg end) "Un-quote a region one level using the `post-quote-start' variable. Argument BEG Beginning of region to be quoted. Argument END End of region to be quoted." (interactive "r") (uncomment-region beg end)) ; From Dave Pearson, July 15, 2000 (defun* split-quoted-paragraph (&optional (quote-string "> ")) "Split a quoted paragraph at point, keeping the quote." (interactive) (if (save-excursion (beginning-of-line) (looking-at (regexp-quote quote-string))) (progn (let ((spaces (- (point) (save-excursion (beginning-of-line) (point)) (length quote-string)))) (save-excursion (insert (format "\n\n%s%s" quote-string (make-string spaces ? )))))) (error "Can't see a quoted paragraph here"))) (defun post-random-signature () "Randomize the signature. Set it to whatever `post-random-signature-command' spits out followed by the content of `post-fixed-signature-source', if available, or a nasty reminder if it is not." (interactive) (save-excursion (goto-char (post-kill-signature)) (insert "-- \n") (shell-command post-random-signature-command t) (goto-char (point-max)) (if (file-readable-p post-fixed-signature-source) (insert-file-contents post-fixed-signature-source) (insert "I really need a `post-fixed-signature-source'!\n")))) (defun post-el-random-signature () "Choose a random signature from `post-variable-signature-source'. the signatures in `post-variable-signature-source' must be separated by `post-signature-sep-regexp'." (interactive) (let ((sig nil)) (save-excursion (set-buffer (generate-new-buffer "*Post-Select-Signature*")) (insert-file post-variable-signature-source) (beginning-of-buffer) ;; we have 2 lists of marks since seperators are of arbitrary lenght (let ((marks-st (list (point-min))) (marks-end (list)) (count 0)) ;nth counts from zero and random is [0,N) (while (search-forward-regexp post-signature-sep-regexp nil "a") (setq marks-st (cons (match-end 0) marks-st) marks-end (cons (match-beginning 0) marks-end) count (1+ count))) (setq marks-end (cons (point-max) marks-end)) (let ((r (random (1+ count)))) (setq sig (buffer-substring-no-properties (nth r marks-st) (nth r marks-end)))) (kill-buffer (current-buffer))) (goto-char (post-kill-signature)) (insert "-- \n" sig) (if (file-readable-p post-fixed-signature-source) (insert-file-contents post-fixed-signature-source) (insert "I really need a `post-fixed-signature-source'!\n"))))) (defun post-select-signature-from-file () "*Interactively select a signature from `post-variable-signature-source'." (interactive) (setq post-select-signature-last-buffer (current-buffer)) (setq post-select-signature-last-point (point)) (pop-to-buffer "*Post-Select-Signature*") (insert-file post-variable-signature-source) (use-local-map post-select-signature-mode-map)) (defun post-select-signature-select-sig-from-file () "*Chooses the signature the cursor is in from `post-variable-signature-source'." (interactive) ;; These 2 lines select whatever siglet the cursor is sitting in, ;; making it nifty to C-s "word" then C-m (or whatever this is ;; bound to). (let ((sig-start (point)) (sig-end (point))) (cond ((setq sig-start (search-backward-regexp post-signature-sep-regexp nil "a")) (forward-line 1) (setq sig-start (point)))) (if (search-forward-regexp post-signature-sep-regexp nil "a") (setq sig-end (match-beginning 0)) (setq sig-end (point-max))) (let ((sig (buffer-substring-no-properties sig-start sig-end))) (switch-to-buffer post-select-signature-last-buffer) (goto-char (post-kill-signature)) (insert "-- \n" sig)) (if (file-readable-p post-fixed-signature-source) (insert-file-contents post-fixed-signature-source)) (post-select-signature-quit))) (defun post-select-signature-from-dir () "Select a new signature for an email/post in the current buffer." (interactive) (setq post-select-signature-last-buffer (current-buffer)) (setq post-select-signature-last-point (point)) (pop-to-buffer "*Post-Select-Signature*") (list-directory (concat post-signature-directory post-signature-wildcard) t) (pop-to-buffer "*Directory*") (forward-line) (copy-to-buffer "*Post-Select-Signature*" (point) (point-max)) (kill-buffer "*Directory*") (pop-to-buffer "*Post-Select-Signature*") (use-local-map post-select-signature-mode-map) (toggle-read-only t)) (defun post-select-signature-select-sig-from-dir () "Set the signature in the calling buffer to the one under the cursor." (interactive) (let ((sig-start nil) (sig-to-load nil)) (end-of-line) (search-backward " ") (forward-char) (setq sig-start (point)) (end-of-line) (setq sig-to-load (buffer-substring-no-properties sig-start (point))) (switch-to-buffer post-select-signature-last-buffer) (goto-char (post-kill-signature)) (insert "-- \n") (insert-file (concat post-signature-directory sig-to-load)) (message "Signature set to %s%s" post-signature-directory sig-to-load) (post-select-signature-quit))) (defun post-select-signature-quit () "Kill the *Post-Select-Signature* frame." (interactive) (kill-buffer "*Post-Select-Signature*") (switch-to-buffer post-select-signature-last-buffer) (goto-char post-select-signature-last-point) (delete-other-windows)) (defun post-attach-file () "Prompt for an attachment." (interactive) (let ((file (read-file-name "Attach file: " nil nil t nil)) (description (string-read "Description: "))) (header-attach-file file description))) ;;; Non-interactive functions (defun post-prompt-for-attachment () "Prompt for an attachment." (if (y-or-n-p "Do you want to attach anything? ") (post-attach-file))) (defun post-references-p () "Is there a References header in this buffer?" (save-excursion (goto-char (point-min)) (looking-at "^References: "))) (defun post-body-says-attach-p () "Check if attach appears in the body." (post-goto-body) ;; Aargh it's annoying that how-many returns a string, ;; "13 occurences" instead of a number, 13. ;; As of Emacs 22 how-many returns an integer number. Consideration ;; must be taken for both newer and older versions. (let ((total-attach (how-many post-attachment-regexp))) (if (string= (type-of total-attach) 'string) (setq total-attach (string-to-number (how-many post-attachment-regexp)))) ;; And this mess is just to catch the unlikely false alarm of ;; "attach" being in the signature, but not in the body. (if (> total-attach 0) (progn (post-goto-signature) (if (string= (type-of (how-many post-attachment-regexp)) 'string) (> total-attach (string-to-number (how-many post-attachment-regexp))) (> total-attach (how-many post-attachment-regexp))))))) (defun post-ask-for-address-with-default (header) "Prompt for an email address, showing default. Argument HEADER the header type." (let ((default (if (= (length (post-get-header-value header)) 0) post-email-address (post-get-header-value header)))) (read-string (concat header ": ") default))) ; From davep@davep.org. RR hasn't tested it. (defun post-get-header-value (header) "Get the value of a specific mail HEADER." (save-excursion (let ((value "") (start-of-value nil)) (setf (point) (point-min)) (when (post-find-header-line header) (setq start-of-value (point)) (end-of-line) (setq value (buffer-substring-no-properties start-of-value (point)))) value))) ;;; From davep@davep.org. RR hasn't tested it. (defun post-find-header-line (header) "Find a HEADER line in the header." (let ((old-point (point)) (end-of-header nil) (found-point nil)) (setf (point) (point-min)) (search-forward-regexp "^$" nil t) (setq end-of-header (point)) (setf (point) (point-min)) (cond ((search-forward-regexp (concat "^" header ": ") nil t) (cond ((< (point) end-of-header) (setq found-point (point))) (t (setf (point) old-point)))) (t (setf (point) old-point))) found-point)) ;;; Function to make a backup buffer for viewing the original. (defun post-copy-original () "Make a copy of the `post-mode' buffer before any editing by the user. This way they can refer back to this buffer during a compose session." (copy-to-buffer (get-buffer-create "*Original*") (point-min) (point-max))) ;;; Mostly stolen from flyspell.el, mail-mode-flyspell-verify (put 'post-mode 'flyspell-mode-predicate 'post-mode-flyspell-verify) (defun post-mode-flyspell-verify () "This function is used for `flyspell-generic-check-word-p' in Post mode." (let ((in-headers (and (save-excursion (goto-char (point-min)) (re-search-forward "^$" nil t)) (< (point) (match-end 0)))) (in-signature (save-excursion (re-search-backward (concat "^" post-signature-pattern "[ \t\f]*$") nil t)))) (cond (in-headers (and (save-excursion (beginning-of-line) (looking-at "^Subject:")) (> (point) (match-end 0)))) (in-signature nil) (t (save-excursion (beginning-of-line) (not (looking-at (concat "[ \t\f]*" post-quote-start)))))))) (defun post-quote-newline () ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; The Heart of Darkness ;;; ;;; The old post mode (i.e. Dave Pearson's) derived from mail-mode. I ;;; prefer deriving from text mode like mutt mode did. - RR (define-derived-mode post-mode text-mode "Post" "Major mode for composing email or news with an external agent. To customize it, type \\[customize] and select [Applications] [Mail] [Post]. When you finish editing this message, type \\[post-save-current-buffer-and-exit] to save and exit Emacs. \\{post-mode-map}" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Neat things to do right off the bat. (auto-fill-mode (if post-uses-fill-mode 1 0)) (if post-backup-original (post-copy-original)) ;; Make Emacs smarter about wrapping citations and paragraphs. ;; We probably can't handle Supercited messages, though. (make-local-variable 'paragraph-start) (make-local-variable 'paragraph-separate) (setq paragraph-start (concat "\\([ \t\n\f]+[^ \t\n\f>]\\|[ \t\f>]*$\\|.+:$\\|" post-signature-pattern " *$\\)") paragraph-separate (concat "[ \t\f>]*$\\|.+:$\\|" post-signature-pattern " *$")) ;; XEmacs needs easy-menu-add, Emacs does not care (easy-menu-add post-mode-menu) ;; If headers were passed, activate the necessary commands. (when (looking-at "^[-A-Za-z0-9]+:") (header-mode 1)) ;; Our temporary file lives in /tmp. Yuck! Compensate appropriately. (make-local-variable 'backup-inhibited) (setq backup-inhibited t) ;; Skip certain patterns for ispell ;(set (make-local-variable 'ispell-skip-region-alist) ; (append ispell-skip-region-alist post-ispell-skip-alist)) (if (boundp 'font-lock-defaults) (make-local-variable 'font-lock-defaults)) (flet ((add-syntax-highlight (face regexps) (set face face) (nconc post-font-lock-keywords (loop for regexp in regexps collect (list regexp (list 0 face 't)))))) ; collect (list regexp `(,0 ',face)))))) (add-syntax-highlight 'post-emoticon-face post-emoticon-pattern) (add-syntax-highlight 'post-bold-face post-bold-pattern) (add-syntax-highlight 'post-underline-face post-underline-pattern) (add-syntax-highlight 'post-url-face post-url-pattern)) (setq font-lock-defaults '(post-font-lock-keywords nil nil nil nil (font-lock-syntactic-keywords . post-font-lock-syntactic-keywords) (font-lock-comment-face ; . 'post-signature-text-face))) . post-signature-text-face))) ;; Force pwd to home directory if so required. (cond (post-force-pwd-to-home (cd "~"))) ;; Kill quoted sig if so required. (cond (post-kill-quoted-sig (post-delete-quoted-signatures) (not-modified))) ;; Remap signature selection functions according to whether the ;; signatures are stored in a file or directory. (if post-signature-source-is-file (progn (defalias 'post-select-signature 'post-select-signature-from-file) (defalias 'post-select-signature-select-sig 'post-select-signature-select-sig-from-file)) (progn (defalias 'post-select-signature 'post-select-signature-from-dir) (defalias 'post-select-signature-select-sig 'post-select-signature-select-sig-from-dir))) ;; Define mutt/slrn specific key bindings. (define-key (current-local-map) "\C-c\C-b" 'post-make-region-bold) (define-key (current-local-map) "\C-c\C-u" 'post-make-region-underlined) (define-key (current-local-map) "\C-c\C-q" 'post-quote-region) (define-key (current-local-map) "\C-c\C-d\C-q" 'post-unquote-region) (define-key (current-local-map) "\C-c\C-a" 'post-attach-file) (define-key (current-local-map) "\C-c\C-p" 'post-set-return-receipt-to) ;; Give the buffer a handy name. (if post-rename-buffer (setq post-buf (rename-buffer "*Composing*" t))) ;; If this is a news posting, check the length of the References field. (if (post-references-p) (header-check-references)) ;; Define the quote signs as comments to make comment-region usable. (make-local-variable 'comment-start) (setq comment-start post-quote-start) ;; Run any hooks. (run-hooks 'post-mode-hook) ;; Jump past header if so required. (cond (post-jump-header (post-goto-body))) (unless (fboundp 'server-process-filter) (message (substitute-command-keys "Type \\[describe-mode] for help composing; \\[post-save-current-buffer-and-exit] when done.")))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Post Header Mode (defvar header-mode nil) (defun header-mode (&optional arg) "Commands for editing the header of an e-mail or news message. \\{header-mode-map} Optional argument ARG ." (interactive "P") (make-local-variable 'header-mode) (setq header-mode (if (null arg) (not header-mode) (> (prefix-numeric-value arg) 0))) (setq post-has-attachment nil) ;; XEmacs needs easy-menu-add, Emacs does not care (easy-menu-add header-mode-menu) (force-mode-line-update)) (defvar header-mode-map (make-sparse-keymap) "Keymap used for editing RFC822 header.") (defun header-position-on-value () "Go to the start of the value part of a header." (beginning-of-line) (skip-chars-forward "-A-Za-z0-9:") ;; XXX - Should make sure we stay on line. (forward-char) (point)) (defun header-goto-field (field) "Go to FIELD of a header." (let ((case-fold-search t)) (goto-char (point-min)) (save-match-data (when (re-search-forward (concat "^\\($\\|" field ": \\)")) (if (looking-at "^$") (progn (insert field ": \n") (forward-char -1)) (header-position-on-value)))))) (defmacro define-header-goto (name header) "Define functions called NAME to go to HEADER." `(defun ,name () ,(concat "Position the cursor on the " header ": header.") (interactive) (header-goto-field ,header))) (define-header-goto header-goto-to "To") (define-header-goto header-goto-cc "Cc") (define-header-goto header-goto-fcc "Fcc") (define-header-goto header-goto-summary "Summary") (define-header-goto header-goto-keywords "Keywords") (define-header-goto header-goto-subject "Subject") (define-header-goto header-goto-bcc "Bcc") (define-header-goto header-goto-reply-to "Reply-To") (define-header-goto header-goto-from "From") (define-header-goto header-goto-organization "Organization") (defun header-attach-file (file description) "Attach a FILE to the current message (works with Mutt). Argument DESCRIPTION MIME description." (interactive "fAttach file: \nsDescription: ") (when (> (length file) 0) (save-excursion (save-match-data (save-restriction (widen) (goto-char (point-min)) (search-forward-regexp "^$") (insert (concat "Attach: " (replace-regexp-in-string " " "\\\\ " (file-truename file)) " " description "\n")) (message (concat "Attached '" file "'.")) (setq post-has-attachment t)))))) (or (assq 'header-mode minor-mode-alist) (setq minor-mode-alist (cons '(header-mode " Header") minor-mode-alist))) (or (assq 'header-mode minor-mode-map-alist) (setq minor-mode-map-alist (cons (cons 'header-mode header-mode-map) minor-mode-map-alist))) (defun header-set-return-receipt-to (address) "Insert a Return-Receipt-To header into an email. Argument ADDRESS email address return receipts should be sent to." (interactive (list (post-ask-for-address-with-default "Return-Receipt-To"))) (save-excursion (header-set-value "Return-Receipt-To" address))) (defun post-news-posting-p () "Does the buffer look like a news posting?" (save-excursion (setf (point) (point-min)) (looking-at "^Newsgroups: "))) (defun header-set-followup-to (to) "Set the Followup-To: header. Argument TO Where followups should go." (interactive (list (header-ask-for-value "Followup-To" (header-ask-for-value "Newsgroups")))) (cond ((post-news-posting-p) (save-excursion (header-set-value "Followup-To" to))) (t (error "Followup-To is for Usenet. Maybe you want Reply-To or Mail-Followup-To")))) (defun header-set-organization (org) "Set the Organization: header. Argument ORG Should be SMERSH." (interactive (list (header-ask-for-value "Organization"))) (save-excursion (header-set-value "Organization" org))) (defun header-check-references () "Place the cursor at the start of the References: if they are too long." (interactive) (cond ((> (header-references-length) 500) ; 500 to be on the safe side. (beep) ; Catch my attention. (goto-char (point-min)) (search-forward-regexp "^References: " nil t)))) (defun header-references-length (&optional show) "Get (and optionally display) the length of the references header. Optional argument SHOW Whether or not to display the length." (interactive) (let* ((header "References") (refs (header-get-value header)) (len (+ (length header) (length refs) 2))) (if (or (interactive-p) show) (message "References header is %d characters in length." len)) len)) (defun header-delete-reference () "Delete the first reference in the references header." (interactive) (save-excursion (let ((ref-location (header-goto-field "References"))) (cond (ref-location (let ((ref-start (goto-char ref-location))) (cond ((search-forward ">" nil t) (forward-char 1) (delete-region ref-start (point)) (header-references-length t))))))))) ;; Noninteractive functions. (defun header-ask-for-value (header &optional default) "Ask for a HEADER value, defaulting to the current value if one is present. Optional argument DEFAULT ." (let ((new-value (post-get-header-value header))) (and (= (length new-value) 0) default (setq new-value default)) (read-string (concat header ": ") new-value))) (defun header-get-value (header) "Get the value of a specific mail HEADER." (save-excursion (let ((value "") (start-of-value nil)) (goto-char (point-min)) (cond ((post-find-header-line header) (setq start-of-value (point)) (end-of-line) (setq value (buffer-substring-no-properties start-of-value (point))))) value))) (defun header-set-value (header value) "Set VALUE of a HEADER (replacing any existing value)." (let ((kill-ring kill-ring)) (setf (point) (point-min)) (cond ((post-find-header-line header) (beginning-of-line) (kill-line) (insert header ": " value)) (t (header-append-value header value)))) (message "%s set to %s" header value)) (defun header-append-value (header value) "Add a HEADER and set it's VALUE (if header exists, will add multiple headers)." (goto-char (point-min)) (search-forward-regexp "^$" nil t) (insert header ": " value "\n")) ;;; Setup the mode map for the select-signature buffer. (if post-select-signature-mode-map nil (setq post-select-signature-mode-map (make-sparse-keymap)) (define-key post-select-signature-mode-map "\C-m" 'post-select-signature-select-sig) (define-key post-select-signature-mode-map " " 'post-select-signature-select-sig) (define-key post-select-signature-mode-map "q" 'post-select-signature-quit) (define-key post-select-signature-mode-map "\C-g" 'post-select-signature-quit)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Key Bindings (define-key post-mode-map "\C-c\C-c" 'post-save-current-buffer-and-exit) (define-key post-mode-map "\C-c\C-d\C-s" 'post-delete-quoted-signatures) (define-key post-mode-map "\C-c\C-d\C-c" 'post-delete-old-citations) (define-key post-mode-map "\C-c\C-t" 'post-goto-body) (define-key post-mode-map "\C-c\C-e" 'post-goto-signature) (define-key post-mode-map "\C-c\C-r" 'post-random-signature) (define-key post-mode-map "\C-c\C-b" 'post-make-region-bold) (define-key post-mode-map "\C-c\C-u" 'post-make-region-underlined) (define-key post-mode-map "\C-c\C-q" 'post-quote-region) (define-key post-mode-map "\C-c\C-d\C-q" 'post-unquote-region) (define-key post-mode-map "\C-c\C-s" 'post-select-signature) (define-key header-mode-map "\C-c\C-f\C-t" 'header-goto-to) (define-key header-mode-map "\C-c\C-f\C-c" 'header-goto-cc) (define-key header-mode-map "\C-c\C-f\C-w" 'header-goto-fcc) (define-key header-mode-map "\C-c\C-f\C-u" 'header-goto-summary) (define-key header-mode-map "\C-c\C-f\C-k" 'header-goto-keywords) (define-key header-mode-map "\C-c\C-f\C-s" 'header-goto-subject) (define-key header-mode-map "\C-c\C-f\C-b" 'header-goto-bcc) (define-key header-mode-map "\C-c\C-f\C-r" 'header-goto-reply-to) (define-key header-mode-map "\C-c\C-f\C-f" 'header-goto-from) (define-key header-mode-map "\C-c\C-f\C-o" 'header-goto-organization) (define-key header-mode-map "\C-c\C-ff" 'header-set-followup-to) (define-key header-mode-map "\C-c\C-a" 'header-attach-file) (define-key header-mode-map "\C-c\C-fd" 'header-delete-reference) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Menus (easy-menu-define post-mode-menu post-mode-map "Post Message Composition Commands." '("Post" ["Delete quoted signatures" post-delete-quoted-signatures t] ["Delete doubly quoted text" post-delete-old-citations t] "----" ["Go to body of message" post-goto-body t] ["Go to signature of message" post-goto-signature t] ["Get new random signature" post-random-signature t] ["Select new signature" post-select-signature t] "----" ["Embolden region" post-make-region-bold t] ["Underline region" post-make-region-underlined t] "----" ["Quote region" post-quote-region t] ["Unquote region" post-unquote-region t] "----" ["Save message and return from Post" post-save-current-buffer-and-exit t])) (easy-menu-define header-mode-menu header-mode-map "Header Editing Commands." '("Header" ["Attach File..." header-attach-file t] "----" ["Edit From Header" header-goto-from t] ["Edit Subject Header" header-goto-subject t] ["Edit To Header" header-goto-to t] ["Edit Cc Header" header-goto-cc t] ["Edit Bcc Header" header-goto-bcc t] ["Edit Fcc Header" header-goto-fcc t] ["Edit Reply-To Header" header-goto-reply-to t] ["Edit Summary Header" header-goto-summary t] ["Edit Keywords Header" header-goto-keywords t] ["Edit Organization Header" header-goto-organization t])) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Finish Installing Post Mode (when post-insert-to-auto-mode-alist-on-load (unless (assq post-mail-message auto-mode-alist) (setq auto-mode-alist (cons (cons post-mail-message 'post-mode) auto-mode-alist))) (unless (assq post-news-posting auto-mode-alist) (setq auto-mode-alist (cons (cons post-news-posting 'post-mode) auto-mode-alist)))) (provide 'post) ;;; post.el ends here