\input texinfo@setfilename gnus-coding@settitle Gnus Coding Style and Maintainance Guide@syncodeindex fn cp@syncodeindex vr cp@syncodeindex pg cp@copyingCopyright @copyright{} 2004, 2005, 2007, 2008, 2009 Free SoftwareFoundation, Inc.@quotationPermission is granted to copy, distribute and/or modify this documentunder the terms of the GNU Free Documentation License, Version 1.3 orany later version published by the Free Software Foundation; with noInvariant Sections, with the Front-Cover texts being ``A GNUManual'', and with the Back-Cover Texts as in (a) below. A copy of thelicense is included in the section entitled ``GNU Free DocumentationLicense'' in the Gnus manual.(a) The FSF's Back-Cover Text is: ``You have the freedom to copy andmodify this GNU manual. Buying copies from the FSF supports it indeveloping GNU and promoting software freedom.''This document is part of a collection distributed under the GNU FreeDocumentation License. If you want to distribute this documentseparately from the collection, you can do so by adding a copy of thelicense to the document, as described in section 6 of the license.@end quotation@end copying@titlepage@title Gnus Coding Style and Maintainance Guide@author by Reiner Steib <Reiner.Steib@@gmx.de>@insertcopying@end titlepage@c Obviously this is only a very rudimentary draft. We put it in CVS@c anyway hoping that it might annoy someone enough to fix it. ;-)@c Fixing only a paragraph also is appreciated.@ifnottex@node Top@top Gnus Coding Style and Maintainance GuideThis manual describes @dots{}@insertcopying @end ifnottex@menu* Gnus Coding Style:: Gnus Coding Style* Gnus Maintainance Guide:: Gnus Maintainance Guide@end menu@c @ref{Gnus Reference Guide, ,Gnus Reference Guide, gnus, The Gnus Newsreader}@node Gnus Coding Style@chapter Gnus Coding Style@section DependenciesThe Gnus distribution contains a lot of libraries that have been writtenfor Gnus and used intensively for Gnus. But many of those libraries areuseful on their own. E.g. other Emacs Lisp packages might use the@acronym{MIME} library @xref{Top, ,Top, emacs-mime, The Emacs MIMEManual}.@subsection General purpose libraries@table @file@item netrc.el@file{.netrc} parsing functionality.@c As of 2005-10-21...There are no Gnus dependencies in this file.@item format-spec.elFunctions for formatting arbitrary formatting strings.@c As of 2005-10-21...There are no Gnus dependencies in this file.@item hex-util.elFunctions to encode/decode hexadecimal string.@c As of 2007-08-25...There are no Gnus dependencies in these files.@end table@subsection Encryption and security@table @file@item encrypt.elFile encryption routines@c As of 2005-10-25...There are no Gnus dependencies in this file.@item password.elRead passwords from user, possibly using a password cache.@c As of 2005-10-21...There are no Gnus dependencies in this file.@item tls.elTLS/SSL support via wrapper around GnuTLS@c As of 2005-10-21...There are no Gnus dependencies in this file.@item pgg*.elGlue for the various PGP implementations.@c As of 2005-10-21...There are no Gnus dependencies in these files.@item sha1.elSHA1 Secure Hash Algorithm.@c As of 2007-08-25...There are no Gnus dependencies in these files.@end table@subsection Networking@table @file@item dig.elDomain Name System dig interface.@c As of 2005-10-21...There are no serious Gnus dependencies in this file. Uses@code{gnus-run-mode-hooks} (a wrapper function).@item dns.el, dns-mode.elDomain Name Service lookups.@c As of 2005-10-21...There are no Gnus dependencies in these files.@end table@subsection Mail and News related RFCs@table @file@item pop3.elPost Office Protocol (RFC 1460) interface.@c As of 2005-10-21...There are no Gnus dependencies in this file.@item imap.el@acronym{IMAP} library.@c As of 2005-10-21...There are no Gnus dependencies in this file.@item ietf-drums.elFunctions for parsing RFC822bis headers.@c As of 2005-10-21...There are no Gnus dependencies in this file.@item rfc1843.elHZ (rfc1843) decoding. HZ is a data format for exchanging files ofarbitrarily mixed Chinese and @acronym{ASCII} characters.@c As of 2005-10-21...@code{rfc1843-gnus-setup} seem to be useful only for Gnus. Maybe thisfunction should be relocated to remove dependencies on Gnus. Otherminor dependencies: @code{gnus-newsgroup-name} could be eliminated byusing an optional argument to @code{rfc1843-decode-article-body}.@item rfc2045.elFunctions for decoding rfc2045 headers@c As of 2007-08-25...There are no Gnus dependencies in these files.@item rfc2047.elFunctions for encoding and decoding rfc2047 messages@c As of 2007-08-25...There are no Gnus dependencies in these files.@cOnly a couple of tests for gnusy symbols.@item rfc2104.elRFC2104 Hashed Message Authentication Codes@c As of 2007-08-25...There are no Gnus dependencies in these files.@item rfc2231.elFunctions for decoding rfc2231 headers@c As of 2007-08-25...There are no Gnus dependencies in these files.@item flow-fill.elInterpret RFC2646 "flowed" text.@c As of 2005-10-27...There are no Gnus dependencies in this file.@item uudecode.elElisp native uudecode.@c As of 2005-12-06...There are no Gnus dependencies in this file.@c ... but the custom group is gnus-extract.@item canlock.elFunctions for Cancel-Lock feature@c Cf. draft-ietf-usefor-cancel-lock-01.txt@c Although this draft has expired, Canlock-Lock revived in 2007 when@c major news providers (e.g. news.individual.org) started to use it.@c As of 2007-08-25...There are no Gnus dependencies in these files.@end table@subsection messageAll message composition from Gnus (both mail and news) takes place inMessage mode buffers. Message mode is intended to be a replacement forEmacs mail mode. There should be no Gnus dependencies in@file{message.el}. Alas it is not anymore. Patches and suggestions toremove the dependencies are welcome.@c message.el requires nnheader which requires gnus-util.@subsection Emacs @acronym{MIME}The files @file{mml*.el} and @file{mm-*.el} provide @acronym{MIME}functionality for Emacs.@acronym{MML} (@acronym{MIME} Meta Language) is supposed to beindependent from Gnus. Alas it is not anymore. Patches and suggestionsto remove the dependencies are welcome.@subsection Gnus backendsThe files @file{nn*.el} provide functionality for accessing NNTP(@file{nntp.el}), IMAP (@file{nnimap.el}) and several other Mail backends (probably @file{nnml.el}, @file{nnfolder.el} and@file{nnmaildir.el} are the most widely used mail back ends).@c mm-uu requires nnheader which requires gnus-util. message.el also@c requires nnheader.@section CompatibilityNo Gnus and Gnus 5.10.10 and up should work on:@itemize @bullet@itemEmacs 21.1 and up.@itemXEmacs 21.4 and up.@end itemizeGnus 5.10.8 and below should work on:@itemize @bullet@itemEmacs 20.7 and up.@itemXEmacs 21.1 and up.@end itemize@node Gnus Maintainance Guide@chapter Gnus Maintainance Guide@section Stable and development versionsThe development of Gnus normally is done on the CVS trunk, i.e. thereare no separate branches to develop and test new features. Most of thetime, the trunk is developed quite actively with more or less dailychanges. Only after a new major release, e.g. 5.10.1, there's usually afeature period of several months. After the release of Gnus 5.10.6 thedevelopment of new features started again on the trunk while the 5.10series is continued on the stable branch (v5-10) from which more stablereleases will be done when needed (5.10.8, @dots{}).@ref{Gnus Development, ,Gnus Development, gnus, The Gnus Newsreader}Stable releases of Gnus finally become part of Emacs. E.g. Gnus 5.8became a part of Emacs 21 (relabeled to Gnus 5.9). The 5.10 series became part of Emacs 22 as Gnus 5.11.@section Syncing@c Some MIDs related to this follow. Use http://thread.gmane.org/MID@c (and click on the subject) to get the thread on Gmane.@c Some quotes from Miles Bader follow...@c <v9eklyke6b.fsf@marauder.physik.uni-ulm.de>@c <buovfd71nkk.fsf@mctpc71.ucom.lsi.nec.co.jp>In the past, the inclusion of Gnus into Emacs was quite cumbersome. Foreach change made to Gnus in Emacs repository, it had to be checked thatit was applied to the new Gnus version, too. Else, bug fixes done inEmacs repository might have been lost.With the inclusion of Gnus 5.10, Miles Bader has set up an Emacs-Gnusgateway to ensure the bug fixes from Emacs CVS are propagated to GnusCVS semi-automatically. These bug fixes are installed on the stablebranch and on the trunk. Basically the idea is that the gateway willcause all common files in Emacs and Gnus v5-10 to be identical exceptwhen there's a very good reason (e.g., the Gnus version string in Emacssays @samp{5.11}, but the v5-10 version string remains @samp{5.10.x}).Furthermore, all changes in these files in either Emacs or the v5-10branch will be installed into the Gnus CVS trunk, again except wherethere's a good reason.@c (typically so far the only exception has been that the changes@c already exist in the trunk in modified form).Because of this, when the next major version of Gnus will be included inEmacs, it should be very easy -- just plonk in the files from the Gnustrunk without worrying about lost changes from the Emacs tree.The effect of this is that as hacker, you should generally only have tomake changes in one place:@itemize@itemIf it's a file which is thought of as being outside of Gnus (e.g., thenew @file{encrypt.el}), you should probably make the change in the Emacstree, and it will show up in the Gnus tree a few days later.If you don't have Emacs CVS access (or it's inconvenient), you canchange such a file in the v5-10 branch, and it should propagate to EmacsCVS -- however, it will get some extra scrutiny (by Miles) to see if thechanges are possibly controversial and need discussion on the mailinglist. Many changes are obvious bug-fixes however, so often there won'tbe any problem.@itemIf it's to a Gnus file, and it's important enough that it should be partof Emacs and the v5-10 branch, then you can make the change on the v5-10branch, and it will go into Emacs CVS and the Gnus CVS trunk (a few dayslater). The most prominent examples for such changes are bug-fixedincluding improvements on the documentation.If you know that there will be conflicts (perhaps because the affectedsource code is different in v5-10 and the Gnus CVS trunk), then you caninstall your change in both places, and when I try to sync them, therewill be a conflict -- however, since in most such cases there would be aconflict @emph{anyway}, it's often easier for me to resolve it simply ifI see two @samp{identical} changes, and can just choose the proper one,rather than having to actually fix the code.@itemFor general Gnus development changes, of course you just make thechange on the Gnus CVS trunk and it goes into Emacs a few yearslater... :-)@end itemizeOf course in any case, if you just can't wait for me to sync yourchange, you can commit it in more than one place and probably there willbe no problem; usually the changes are textually identical anyway, socan be easily resolved automatically (sometimes I notice silly things insuch multiple commits, like whitespace differences, and unify those ;-).@c I do Emacs->Gnus less often (than Gnus->Emacs) because it tends to@c require more manual work.@c By default I sync about once a week. I also try to follow any Gnus@c threads on the mailing lists and make sure any changes being discussed@c are kept more up-to-date (so say 1-2 days delay for "topical" changes).@c <buovfd71nkk.fsf@mctpc71.ucom.lsi.nec.co.jp>@c BTW, just to add even more verbose explanation about the syncing thing:@section Miscellanea@heading @file{GNUS-NEWS}Starting from No Gnus, the @file{GNUS-NEWS} is created from@file{texi/gnus-news.texi}. Don't edit @file{GNUS-NEWS}. Edit@file{texi/gnus-news.texi}, type @command{make GNUS-NEWS} in the@file{texi} directory and commit @file{GNUS-NEWS} and@file{texi/gnus-news.texi}.@heading Conventions for version information in defcustomsFor new customizable variables introduced in Oort Gnus (including thev5-10 branch) use @code{:version "22.1" ;; Oort Gnus} (including thecomment) or e.g. @code{:version "22.2" ;; Gnus 5.10.10} if the featurewas added for Emacs 22.2 and Gnus 5.10.10.@cIf the variable is new in No Gnus use @code{:version "23.1" ;; No Gnus}.The same applies for customizable variables when its default value waschanged.@c Local Variables:@c mode: texinfo@c coding: iso-8859-1@c End:@ignore arch-tag: ab15234c-2c8a-4cbd-8111-1811bcc6f931@end ignore