3 @setfilename gnus-coding
4 @settitle Gnus Coding Style and Maintenance Guide
10 Copyright @copyright{} 2004--2005, 2007--2013 Free Software
14 Permission is granted to copy, distribute and/or modify this document
15 under the terms of the GNU Free Documentation License, Version 1.3 or
16 any later version published by the Free Software Foundation; with no
17 Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
18 and with the Back-Cover Texts as in (a) below. A copy of the license
19 is included in the section entitled ``GNU Free Documentation License''.
21 (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
22 modify this GNU manual.''
28 @title Gnus Coding Style and Maintenance Guide
30 @author by Reiner Steib <Reiner.Steib@@gmx.de>
35 @c Obviously this is only a very rudimentary draft. We put it in the
36 @c repository anyway hoping that it might annoy someone enough to fix
37 @c it. ;-) Fixing only a paragraph also is appreciated.
41 @top Gnus Coding Style and Maintenance Guide
42 This manual describes @dots{}
48 * Gnus Coding Style:: Gnus Coding Style
49 * Gnus Maintenance Guide:: Gnus Maintenance Guide
50 * GNU Free Documentation License:: The license for this documentation.
53 @c @ref{Gnus Reference Guide, ,Gnus Reference Guide, gnus, The Gnus Newsreader}
55 @node Gnus Coding Style
56 @chapter Gnus Coding Style
59 The Gnus distribution contains a lot of libraries that have been written
60 for Gnus and used intensively for Gnus. But many of those libraries are
61 useful on their own. E.g., other Emacs Lisp packages might use the
62 @acronym{MIME} library @xref{Top, ,Top, emacs-mime, The Emacs MIME
65 @subsection General purpose libraries
70 @file{.netrc} parsing functionality.
71 @c As of 2005-10-21...
72 There are no Gnus dependencies in this file.
75 Functions for formatting arbitrary formatting strings.
76 @c As of 2005-10-21...
77 There are no Gnus dependencies in this file.
80 Functions to encode/decode hexadecimal string.
81 @c As of 2007-08-25...
82 There are no Gnus dependencies in these files.
85 @subsection Encryption and security
89 File encryption routines
90 @c As of 2005-10-25...
91 There are no Gnus dependencies in this file.
94 Read passwords from user, possibly using a password cache.
95 @c As of 2005-10-21...
96 There are no Gnus dependencies in this file.
99 TLS/SSL support via wrapper around GnuTLS
100 @c As of 2005-10-21...
101 There are no Gnus dependencies in this file.
104 Glue for the various PGP implementations.
105 @c As of 2005-10-21...
106 There are no Gnus dependencies in these files.
109 SHA1 Secure Hash Algorithm.
110 @c As of 2007-08-25...
111 There are no Gnus dependencies in these files.
114 @subsection Networking
118 Domain Name System dig interface.
119 @c As of 2005-10-21...
120 There are no serious Gnus dependencies in this file. Uses
121 @code{gnus-run-mode-hooks} (a wrapper function).
123 @item dns.el, dns-mode.el
124 Domain Name Service lookups.
125 @c As of 2005-10-21...
126 There are no Gnus dependencies in these files.
129 @subsection Mail and News related RFCs
133 Post Office Protocol (RFC 1460) interface.
134 @c As of 2005-10-21...
135 There are no Gnus dependencies in this file.
138 @acronym{IMAP} library.
139 @c As of 2005-10-21...
140 There are no Gnus dependencies in this file.
143 Functions for parsing RFC822bis headers.
144 @c As of 2005-10-21...
145 There are no Gnus dependencies in this file.
148 HZ (rfc1843) decoding. HZ is a data format for exchanging files of
149 arbitrarily mixed Chinese and @acronym{ASCII} characters.
150 @c As of 2005-10-21...
151 @code{rfc1843-gnus-setup} seem to be useful only for Gnus. Maybe this
152 function should be relocated to remove dependencies on Gnus. Other
153 minor dependencies: @code{gnus-newsgroup-name} could be eliminated by
154 using an optional argument to @code{rfc1843-decode-article-body}.
157 Functions for decoding rfc2045 headers
158 @c As of 2007-08-25...
159 There are no Gnus dependencies in these files.
162 Functions for encoding and decoding rfc2047 messages
163 @c As of 2007-08-25...
164 There are no Gnus dependencies in these files.
166 Only a couple of tests for gnusy symbols.
169 RFC2104 Hashed Message Authentication Codes
170 @c As of 2007-08-25...
171 There are no Gnus dependencies in these files.
174 Functions for decoding rfc2231 headers
175 @c As of 2007-08-25...
176 There are no Gnus dependencies in these files.
179 Interpret RFC2646 "flowed" text.
180 @c As of 2005-10-27...
181 There are no Gnus dependencies in this file.
184 Elisp native uudecode.
185 @c As of 2005-12-06...
186 There are no Gnus dependencies in this file.
187 @c ... but the custom group is gnus-extract.
190 Functions for Cancel-Lock feature
191 @c Cf. draft-ietf-usefor-cancel-lock-01.txt
192 @c Although this draft has expired, Canlock-Lock revived in 2007 when
193 @c major news providers (e.g., news.individual.org) started to use it.
194 @c As of 2007-08-25...
195 There are no Gnus dependencies in these files.
201 All message composition from Gnus (both mail and news) takes place in
202 Message mode buffers. Message mode is intended to be a replacement for
203 Emacs mail mode. There should be no Gnus dependencies in
204 @file{message.el}. Alas it is not anymore. Patches and suggestions to
205 remove the dependencies are welcome.
207 @c message.el requires nnheader which requires gnus-util.
209 @subsection Emacs @acronym{MIME}
211 The files @file{mml*.el} and @file{mm-*.el} provide @acronym{MIME}
212 functionality for Emacs.
214 @acronym{MML} (@acronym{MIME} Meta Language) is supposed to be
215 independent from Gnus. Alas it is not anymore. Patches and suggestions
216 to remove the dependencies are welcome.
218 @subsection Gnus backends
220 The files @file{nn*.el} provide functionality for accessing NNTP
221 (@file{nntp.el}), IMAP (@file{nnimap.el}) and several other Mail back
222 ends (probably @file{nnml.el}, @file{nnfolder.el} and
223 @file{nnmaildir.el} are the most widely used mail back ends).
225 @c mm-uu requires nnheader which requires gnus-util. message.el also
226 @c requires nnheader.
229 @section Compatibility
231 No Gnus and Gnus 5.10.10 and up should work on:
239 Gnus 5.10.8 and below should work on:
247 @node Gnus Maintenance Guide
248 @chapter Gnus Maintenance Guide
250 @section Stable and development versions
252 The development of Gnus normally is done on the Git repository trunk
253 as of April 19, 2010 (formerly it was done in CVS; the repository is
254 at http://git.gnus.org), i.e., there are no separate branches to
255 develop and test new features. Most of the time, the trunk is
256 developed quite actively with more or less daily changes. Only after
257 a new major release, e.g., 5.10.1, there's usually a feature period of
258 several months. After the release of Gnus 5.10.6 the development of
259 new features started again on the trunk while the 5.10 series is
260 continued on the stable branch (v5-10) from which more stable releases
261 will be done when needed (5.10.8, @dots{}). @ref{Gnus Development,
262 ,Gnus Development, gnus, The Gnus Newsreader}
264 Stable releases of Gnus finally become part of Emacs. E.g., Gnus 5.8
265 became a part of Emacs 21 (relabeled to Gnus 5.9). The 5.10 series
266 became part of Emacs 22 as Gnus 5.11.
270 @c Some MIDs related to this follow. Use http://thread.gmane.org/MID
271 @c (and click on the subject) to get the thread on Gmane.
273 @c Some quotes from Miles Bader follow...
275 @c <v9eklyke6b.fsf@marauder.physik.uni-ulm.de>
276 @c <buovfd71nkk.fsf@mctpc71.ucom.lsi.nec.co.jp>
278 In the past, the inclusion of Gnus into Emacs was quite cumbersome. For
279 each change made to Gnus in Emacs repository, it had to be checked that
280 it was applied to the new Gnus version, too. Else, bug fixes done in
281 Emacs repository might have been lost.
283 With the inclusion of Gnus 5.10, Miles Bader has set up an Emacs-Gnus
284 gateway to ensure the bug fixes from Emacs CVS are propagated to Gnus
285 CVS semi-automatically.
287 After Emacs moved to bzr and Gnus moved to git, Katsumi Yamaoka has
288 taken over the chore of keeping Emacs and Gnus in sync. In general,
289 changes made to one repository will usually be replicated in the other
292 Basically the idea is that the gateway will cause all common files in
293 Emacs and Gnus v5-13 to be identical except when there's a very good
294 reason (e.g., the Gnus version string in Emacs says @samp{5.11}, but
295 the v5-13 version string remains @samp{5.13.x}). Furthermore, all
296 changes in these files in either Emacs or the v5-13 branch will be
297 installed into the Gnus git trunk, again except where there's a good
300 @c (typically so far the only exception has been that the changes
301 @c already exist in the trunk in modified form).
302 Because of this, when the next major version of Gnus will be included in
303 Emacs, it should be very easy---just plonk in the files from the Gnus
304 trunk without worrying about lost changes from the Emacs tree.
306 The effect of this is that as hacker, you should generally only have to
307 make changes in one place:
311 If it's a file which is thought of as being outside of Gnus (e.g., the
312 new @file{encrypt.el}), you should probably make the change in the Emacs
313 tree, and it will show up in the Gnus tree a few days later.
315 If you don't have Emacs bzr access (or it's inconvenient), you can
316 change such a file in the v5-10 branch, and it should propagate to Emacs
317 bzr---however, it will get some extra scrutiny (by Miles) to see if the
318 changes are possibly controversial and need discussion on the mailing
319 list. Many changes are obvious bug-fixes however, so often there won't
323 If it's to a Gnus file, and it's important enough that it should be part
324 of Emacs and the v5-10 branch, then you can make the change on the v5-10
325 branch, and it will go into Emacs bzr and the Gnus git trunk (a few days
326 later). The most prominent examples for such changes are bug-fixed
327 including improvements on the documentation.
329 If you know that there will be conflicts (perhaps because the affected
330 source code is different in v5-10 and the Gnus git trunk), then you can
331 install your change in both places, and when I try to sync them, there
332 will be a conflict---however, since in most such cases there would be a
333 conflict @emph{anyway}, it's often easier for me to resolve it simply if
334 I see two @samp{identical} changes, and can just choose the proper one,
335 rather than having to actually fix the code.
338 For general Gnus development changes, of course you just make the
339 change on the Gnus Git trunk and it goes into Emacs a few years
344 Of course in any case, if you just can't wait for me to sync your
345 change, you can commit it in more than one place and probably there will
346 be no problem; usually the changes are textually identical anyway, so
347 can be easily resolved automatically (sometimes I notice silly things in
348 such multiple commits, like whitespace differences, and unify those ;-).
351 @c I do Emacs->Gnus less often (than Gnus->Emacs) because it tends to
352 @c require more manual work.
354 @c By default I sync about once a week. I also try to follow any Gnus
355 @c threads on the mailing lists and make sure any changes being discussed
356 @c are kept more up-to-date (so say 1-2 days delay for "topical" changes).
358 @c <buovfd71nkk.fsf@mctpc71.ucom.lsi.nec.co.jp>
360 @c BTW, just to add even more verbose explanation about the syncing thing:
364 @heading @file{GNUS-NEWS}
366 Starting from No Gnus, the @file{GNUS-NEWS} is created from
367 @file{texi/gnus-news.texi}. Don't edit @file{GNUS-NEWS}. Edit
368 @file{texi/gnus-news.texi}, type @command{make GNUS-NEWS} in the
369 @file{texi} directory and commit @file{GNUS-NEWS} and
370 @file{texi/gnus-news.texi}.
372 @heading Conventions for version information in defcustoms
374 For new customizable variables introduced in Oort Gnus (including the
375 v5-10 branch) use @code{:version "22.1" ;; Oort Gnus} (including the
376 comment) or, e.g., @code{:version "22.2" ;; Gnus 5.10.10} if the feature
377 was added for Emacs 22.2 and Gnus 5.10.10.
379 If the variable is new in No Gnus use @code{:version "23.1" ;; No Gnus}.
381 The same applies for customizable variables when its default value was
384 @node GNU Free Documentation License
385 @appendix GNU Free Documentation License
386 @include doclicense.texi