gnus-coding.texi 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. \input texinfo
  2. @setfilename gnus-coding.info
  3. @settitle Gnus Coding Style and Maintenance Guide
  4. @include docstyle.texi
  5. @syncodeindex fn cp
  6. @syncodeindex vr cp
  7. @syncodeindex pg cp
  8. @copying
  9. Copyright @copyright{} 2004--2005, 2007--2017 Free Software
  10. Foundation, Inc.
  11. @quotation
  12. Permission is granted to copy, distribute and/or modify this document
  13. under the terms of the GNU Free Documentation License, Version 1.3 or
  14. any later version published by the Free Software Foundation; with no
  15. Invariant Sections, with the Front-Cover Texts being ``A GNU Manual'',
  16. and with the Back-Cover Texts as in (a) below. A copy of the license
  17. is included in the section entitled ``GNU Free Documentation License''.
  18. (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
  19. modify this GNU manual.''
  20. @end quotation
  21. @end copying
  22. @titlepage
  23. @title Gnus Coding Style and Maintenance Guide
  24. @author by Reiner Steib <Reiner.Steib@@gmx.de>
  25. @insertcopying
  26. @end titlepage
  27. @c Obviously this is only a very rudimentary draft. We put it in the
  28. @c repository anyway hoping that it might annoy someone enough to fix
  29. @c it. ;-) Fixing only a paragraph also is appreciated.
  30. @ifnottex
  31. @node Top
  32. @top Gnus Coding Style and Maintenance Guide
  33. This manual describes @dots{}
  34. @insertcopying
  35. @end ifnottex
  36. @menu
  37. * Gnus Coding Style:: Gnus Coding Style
  38. * Gnus Maintenance Guide:: Gnus Maintenance Guide
  39. * GNU Free Documentation License:: The license for this documentation.
  40. @end menu
  41. @c @ref{Gnus Reference Guide, ,Gnus Reference Guide, gnus, The Gnus Newsreader}
  42. @node Gnus Coding Style
  43. @chapter Gnus Coding Style
  44. @section Dependencies
  45. The Gnus distribution contains a lot of libraries that have been written
  46. for Gnus and used intensively for Gnus. But many of those libraries are
  47. useful on their own. E.g., other Emacs Lisp packages might use the
  48. @acronym{MIME} library @xref{Top, ,Top, emacs-mime, The Emacs MIME
  49. Manual}.
  50. @subsection General purpose libraries
  51. @table @file
  52. @item netrc.el
  53. @file{.netrc} parsing functionality.
  54. @c As of 2005-10-21...
  55. There are no Gnus dependencies in this file.
  56. @item format-spec.el
  57. Functions for formatting arbitrary formatting strings.
  58. @c As of 2005-10-21...
  59. There are no Gnus dependencies in this file.
  60. @item hex-util.el
  61. Functions to encode/decode hexadecimal string.
  62. @c As of 2007-08-25...
  63. There are no Gnus dependencies in these files.
  64. @end table
  65. @subsection Encryption and security
  66. @table @file
  67. @item encrypt.el
  68. File encryption routines
  69. @c As of 2005-10-25...
  70. There are no Gnus dependencies in this file.
  71. @item password.el
  72. Read passwords from user, possibly using a password cache.
  73. @c As of 2005-10-21...
  74. There are no Gnus dependencies in this file.
  75. @item tls.el
  76. TLS/SSL support via wrapper around GnuTLS
  77. @c As of 2005-10-21...
  78. There are no Gnus dependencies in this file.
  79. @item pgg*.el
  80. Glue for the various PGP implementations.
  81. @c As of 2005-10-21...
  82. There are no Gnus dependencies in these files.
  83. @item sha1.el
  84. SHA1 Secure Hash Algorithm.
  85. @c As of 2007-08-25...
  86. There are no Gnus dependencies in these files.
  87. @end table
  88. @subsection Networking
  89. @table @file
  90. @item dig.el
  91. Domain Name System dig interface.
  92. @c As of 2005-10-21...
  93. There are no serious Gnus dependencies in this file. Uses
  94. @code{gnus-run-mode-hooks} (a wrapper function).
  95. @item dns.el, dns-mode.el
  96. Domain Name Service lookups.
  97. @c As of 2005-10-21...
  98. There are no Gnus dependencies in these files.
  99. @end table
  100. @subsection Mail and News related RFCs
  101. @table @file
  102. @item pop3.el
  103. Post Office Protocol (RFC 1460) interface.
  104. @c As of 2005-10-21...
  105. There are no Gnus dependencies in this file.
  106. @item imap.el
  107. @acronym{IMAP} library.
  108. @c As of 2005-10-21...
  109. There are no Gnus dependencies in this file.
  110. @item ietf-drums.el
  111. Functions for parsing RFC822bis headers.
  112. @c As of 2005-10-21...
  113. There are no Gnus dependencies in this file.
  114. @item rfc1843.el
  115. HZ (rfc1843) decoding. HZ is a data format for exchanging files of
  116. arbitrarily mixed Chinese and @acronym{ASCII} characters.
  117. @c As of 2005-10-21...
  118. @code{rfc1843-gnus-setup} seem to be useful only for Gnus. Maybe this
  119. function should be relocated to remove dependencies on Gnus. Other
  120. minor dependencies: @code{gnus-newsgroup-name} could be eliminated by
  121. using an optional argument to @code{rfc1843-decode-article-body}.
  122. @item rfc2045.el
  123. Functions for decoding rfc2045 headers
  124. @c As of 2007-08-25...
  125. There are no Gnus dependencies in these files.
  126. @item rfc2047.el
  127. Functions for encoding and decoding rfc2047 messages
  128. @c As of 2007-08-25...
  129. There are no Gnus dependencies in these files.
  130. @c
  131. Only a couple of tests for gnusy symbols.
  132. @item rfc2104.el
  133. RFC2104 Hashed Message Authentication Codes
  134. @c As of 2007-08-25...
  135. There are no Gnus dependencies in these files.
  136. @item rfc2231.el
  137. Functions for decoding rfc2231 headers
  138. @c As of 2007-08-25...
  139. There are no Gnus dependencies in these files.
  140. @item flow-fill.el
  141. Interpret RFC2646 "flowed" text.
  142. @c As of 2005-10-27...
  143. There are no Gnus dependencies in this file.
  144. @item uudecode.el
  145. Elisp native uudecode.
  146. @c As of 2005-12-06...
  147. There are no Gnus dependencies in this file.
  148. @c ... but the custom group is gnus-extract.
  149. @item canlock.el
  150. Functions for Cancel-Lock feature
  151. @c Cf. draft-ietf-usefor-cancel-lock-01.txt
  152. @c Although this draft has expired, Canlock-Lock revived in 2007 when
  153. @c major news providers (e.g., news.individual.org) started to use it.
  154. @c As of 2007-08-25...
  155. There are no Gnus dependencies in these files.
  156. @end table
  157. @subsection message
  158. All message composition from Gnus (both mail and news) takes place in
  159. Message mode buffers. Message mode is intended to be a replacement for
  160. Emacs mail mode. There should be no Gnus dependencies in
  161. @file{message.el}. Alas it is not anymore. Patches and suggestions to
  162. remove the dependencies are welcome.
  163. @c message.el requires nnheader which requires gnus-util.
  164. @subsection Emacs @acronym{MIME}
  165. The files @file{mml*.el} and @file{mm-*.el} provide @acronym{MIME}
  166. functionality for Emacs.
  167. @acronym{MML} (@acronym{MIME} Meta Language) is supposed to be
  168. independent from Gnus. Alas it is not anymore. Patches and suggestions
  169. to remove the dependencies are welcome.
  170. @subsection Gnus backends
  171. The files @file{nn*.el} provide functionality for accessing NNTP
  172. (@file{nntp.el}), IMAP (@file{nnimap.el}) and several other Mail back
  173. ends (probably @file{nnml.el}, @file{nnfolder.el} and
  174. @file{nnmaildir.el} are the most widely used mail back ends).
  175. @c mm-uu requires nnheader which requires gnus-util. message.el also
  176. @c requires nnheader.
  177. @section Compatibility
  178. No Gnus and Gnus 5.10.10 and up should work on:
  179. @itemize @bullet
  180. @item
  181. Emacs 21.1 and up.
  182. @item
  183. XEmacs 21.4 and up.
  184. @end itemize
  185. Gnus 5.10.8 and below should work on:
  186. @itemize @bullet
  187. @item
  188. Emacs 20.7 and up.
  189. @item
  190. XEmacs 21.1 and up.
  191. @end itemize
  192. @node Gnus Maintenance Guide
  193. @chapter Gnus Maintenance Guide
  194. @section Stable and development versions
  195. The development of Gnus normally is done on the Git repository trunk
  196. as of April 19, 2010 (formerly it was done in CVS; the repository is
  197. at http://git.gnus.org), i.e., there are no separate branches to
  198. develop and test new features. Most of the time, the trunk is
  199. developed quite actively with more or less daily changes. Only after
  200. a new major release, e.g., 5.10.1, there's usually a feature period of
  201. several months. After the release of Gnus 5.10.6 the development of
  202. new features started again on the trunk while the 5.10 series is
  203. continued on the stable branch (v5-10) from which more stable releases
  204. will be done when needed (5.10.8, @dots{}). @ref{Gnus Development,
  205. ,Gnus Development, gnus, The Gnus Newsreader}
  206. Stable releases of Gnus finally become part of Emacs. E.g., Gnus 5.8
  207. became a part of Emacs 21 (relabeled to Gnus 5.9). The 5.10 series
  208. became part of Emacs 22 as Gnus 5.11.
  209. @section Syncing
  210. @c Some MIDs related to this follow. Use http://thread.gmane.org/MID
  211. @c (and click on the subject) to get the thread on Gmane.
  212. @c Some quotes from Miles Bader follow...
  213. @c <v9eklyke6b.fsf@marauder.physik.uni-ulm.de>
  214. @c <buovfd71nkk.fsf@mctpc71.ucom.lsi.nec.co.jp>
  215. In the past, the inclusion of Gnus into Emacs was quite cumbersome. For
  216. each change made to Gnus in Emacs repository, it had to be checked that
  217. it was applied to the new Gnus version, too. Else, bug fixes done in
  218. Emacs repository might have been lost.
  219. With the inclusion of Gnus 5.10, Miles Bader has set up an Emacs-Gnus
  220. gateway to ensure the bug fixes from Emacs CVS are propagated to Gnus
  221. CVS semi-automatically.
  222. After Emacs moved to bzr and Gnus moved to git, Katsumi Yamaoka has
  223. taken over the chore of keeping Emacs and Gnus in sync. In general,
  224. changes made to one repository will usually be replicated in the other
  225. within a few days.
  226. Basically the idea is that the gateway will cause all common files in
  227. Emacs and Gnus v5-13 to be identical except when there's a very good
  228. reason (e.g., the Gnus version string in Emacs says @samp{5.11}, but
  229. the v5-13 version string remains @samp{5.13.x}). Furthermore, all
  230. changes in these files in either Emacs or the v5-13 branch will be
  231. installed into the Gnus git trunk, again except where there's a good
  232. reason.
  233. @c (typically so far the only exception has been that the changes
  234. @c already exist in the trunk in modified form).
  235. Because of this, when the next major version of Gnus will be included in
  236. Emacs, it should be very easy---just plonk in the files from the Gnus
  237. trunk without worrying about lost changes from the Emacs tree.
  238. The effect of this is that as hacker, you should generally only have to
  239. make changes in one place:
  240. @itemize
  241. @item
  242. If it's a file which is thought of as being outside of Gnus (e.g., the
  243. new @file{encrypt.el}), you should probably make the change in the Emacs
  244. tree, and it will show up in the Gnus tree a few days later.
  245. If you don't have Emacs repository access (or it's inconvenient), you
  246. can change such a file in the v5-10 branch, and it should propagate to
  247. the Emacs repository---however, it will get some extra scrutiny (by
  248. Miles) to see if the changes are possibly controversial and need
  249. discussion on the mailing list. Many changes are obvious bug-fixes
  250. however, so often there won't be any problem.
  251. @item
  252. If it's to a Gnus file, and it's important enough that it should be part
  253. of Emacs and the v5-10 branch, then you can make the change on the v5-10
  254. branch, and it will go into Emacs and the Gnus git trunk (a few days
  255. later). The most prominent examples for such changes are bug-fixed
  256. including improvements on the documentation.
  257. If you know that there will be conflicts (perhaps because the affected
  258. source code is different in v5-10 and the Gnus git trunk), then you can
  259. install your change in both places, and when I try to sync them, there
  260. will be a conflict---however, since in most such cases there would be a
  261. conflict @emph{anyway}, it's often easier for me to resolve it simply if
  262. I see two @samp{identical} changes, and can just choose the proper one,
  263. rather than having to actually fix the code.
  264. @item
  265. For general Gnus development changes, of course you just make the
  266. change on the Gnus Git trunk and it goes into Emacs a few years
  267. later... :-)
  268. @end itemize
  269. Of course in any case, if you just can't wait for me to sync your
  270. change, you can commit it in more than one place and probably there will
  271. be no problem; usually the changes are textually identical anyway, so
  272. can be easily resolved automatically (sometimes I notice silly things in
  273. such multiple commits, like whitespace differences, and unify those ;-).
  274. @c I do Emacs->Gnus less often (than Gnus->Emacs) because it tends to
  275. @c require more manual work.
  276. @c By default I sync about once a week. I also try to follow any Gnus
  277. @c threads on the mailing lists and make sure any changes being discussed
  278. @c are kept more up-to-date (so say 1-2 days delay for "topical" changes).
  279. @c <buovfd71nkk.fsf@mctpc71.ucom.lsi.nec.co.jp>
  280. @c BTW, just to add even more verbose explanation about the syncing thing:
  281. @section Miscellanea
  282. @heading @file{GNUS-NEWS}
  283. The @file{etc/GNUS-NEWS} is created from
  284. @file{doc/misc/gnus-news.texi}. Don't edit @file{etc/GNUS-NEWS}.
  285. Edit @file{doc/misc/gnus-news.texi}, type @command{make
  286. update-gnus-news} in the @file{lisp} directory and commit
  287. @file{etc/GNUS-NEWS} and @file{doc/misc/gnus-news.texi}.
  288. @heading Conventions for version information in defcustoms
  289. For new customizable variables introduced in Oort Gnus (including the
  290. v5-10 branch) use @code{:version "22.1" ;; Oort Gnus} (including the
  291. comment) or, e.g., @code{:version "22.2" ;; Gnus 5.10.10} if the feature
  292. was added for Emacs 22.2 and Gnus 5.10.10.
  293. @c
  294. If the variable is new in No Gnus use @code{:version "23.1" ;; No Gnus}.
  295. The same applies for customizable variables when its default value was
  296. changed.
  297. @node GNU Free Documentation License
  298. @appendix GNU Free Documentation License
  299. @include doclicense.texi
  300. @c Local Variables:
  301. @c mode: texinfo
  302. @c coding: utf-8
  303. @c End: