Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523

Merge from emacs--gnus--5.10, gnus--rel--5.10

Patches applied:

 * miles@gnu.org--gnu-2004/emacs--gnus--5.10--base-0
   tag of miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-464

 * miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-1
   Import from CVS branch gnus-5_10-branch

 * miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-2
   Merge from lorentey@elte.hu--2004/emacs--multi-tty--0, emacs--cvs-trunk--0

 * miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-3
   Merge from gnus--rel--5.10

 * miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-4
   Merge from gnus--rel--5.10

 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-18
   Update from CVS

 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-19
   Remove autoconf-generated files from archive

 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-20
   Update from CVS
  • Loading branch information...
commit 33af8947de497b0d14ba9a5db26c4f5dae2f0e48 1 parent d9cea51
@snogglethorpe snogglethorpe authored
Showing with 43,233 additions and 18,558 deletions.
  1. +6 −0 ChangeLog
  2. +2 −2 Makefile.in
  3. +12 −0 etc/ChangeLog
  4. +545 −0 etc/GNUS-NEWS
  5. +9 −0 etc/NEWS
  6. +10 −0 lisp/ChangeLog
  7. +7 −2 lisp/calendar/time-date.el
  8. +243 −11,111 lisp/gnus/ChangeLog
  9. +18,924 −0 lisp/gnus/ChangeLog.2
  10. +193 −0 lisp/gnus/TODO
  11. +7 −0 lisp/gnus/bar.xbm
  12. +54 −0 lisp/gnus/bar.xpm
  13. +47 −21 lisp/gnus/binhex.el
  14. BIN  lisp/gnus/blink.pbm
  15. +20 −0 lisp/gnus/blink.xpm
  16. +20 −0 lisp/gnus/braindamaged.xpm
  17. +251 −0 lisp/gnus/canlock.el
  18. +32 −72 lisp/gnus/catchup.xpm
  19. +58 −0 lisp/gnus/compface.el
  20. +20 −0 lisp/gnus/cry.xpm
  21. +30 −63 lisp/gnus/cu-exit.xpm
  22. +20 −0 lisp/gnus/dead.xpm
  23. +31 −71 lisp/gnus/describe-group.xpm
  24. +472 −0 lisp/gnus/deuglify.el
  25. +189 −0 lisp/gnus/dig.el
  26. +359 −0 lisp/gnus/dns.el
  27. +4 −6 lisp/gnus/earcon.el
  28. +20 −0 lisp/gnus/evil.xpm
  29. +32 −75 lisp/gnus/exit-gnus.xpm
  30. +29 −44 lisp/gnus/exit-summ.xpm
  31. +126 −9 lisp/gnus/flow-fill.el
  32. +30 −53 lisp/gnus/followup.xpm
  33. +20 −0 lisp/gnus/forced.xpm
  34. +20 −0 lisp/gnus/frown.xpm
  35. +30 −52 lisp/gnus/fuwo.xpm
  36. +30 −67 lisp/gnus/get-news.xpm
  37. +30 −63 lisp/gnus/gnntg.xpm
  38. +2,757 −712 lisp/gnus/gnus-agent.el
  39. +3,203 −974 lisp/gnus/gnus-art.el
  40. +12 −10 lisp/gnus/gnus-async.el
  41. +7 −7 lisp/gnus/gnus-audio.el
  42. +29 −24 lisp/gnus/gnus-bcklg.el
  43. +103 −53 lisp/gnus/gnus-cache.el
  44. +166 −92 lisp/gnus/gnus-cite.el
  45. +357 −117 lisp/gnus/gnus-cus.el
  46. +196 −0 lisp/gnus/gnus-delay.el
  47. +29 −27 lisp/gnus/gnus-demon.el
  48. +461 −0 lisp/gnus/gnus-diary.el
  49. +207 −0 lisp/gnus/gnus-dired.el
  50. +82 −25 lisp/gnus/gnus-draft.el
  51. +5 −5 lisp/gnus/gnus-dup.el
  52. +5 −3 lisp/gnus/gnus-eform.el
  53. +72 −100 lisp/gnus/gnus-ems.el
  54. +252 −0 lisp/gnus/gnus-fun.el
  55. +14 −14 lisp/gnus/gnus-gl.el
  56. +995 −541 lisp/gnus/gnus-group.el
  57. +180 −49 lisp/gnus/gnus-int.el
  58. +31 −29 lisp/gnus/gnus-kill.el
  59. +21 −21 lisp/gnus/gnus-logic.el
  60. +3 −0  lisp/gnus/gnus-mh.el
  61. +36 −17 lisp/gnus/gnus-ml.el
  62. +21 −22 lisp/gnus/gnus-mlspl.el
  63. +938 −320 lisp/gnus/gnus-msg.el
  64. +0 −75 lisp/gnus/gnus-mule.el
  65. +6 −2 lisp/gnus/gnus-nocem.el
  66. +283 −0 lisp/gnus/gnus-picon.el
  67. +2 −3 {etc → lisp/gnus}/gnus-pointer.xbm
  68. +2 −1  {etc → lisp/gnus}/gnus-pointer.xpm
  69. +208 −6 lisp/gnus/gnus-range.el
  70. +703 −0 lisp/gnus/gnus-registry.el
  71. +111 −86 lisp/gnus/gnus-salt.el
  72. +177 −77 lisp/gnus/gnus-score.el
  73. +5 −4 lisp/gnus/gnus-setup.el
  74. +240 −0 lisp/gnus/gnus-sieve.el
  75. +30 −21 lisp/gnus/gnus-soup.el
  76. +279 −78 lisp/gnus/gnus-spec.el
  77. +272 −97 lisp/gnus/gnus-srvr.el
  78. +540 −216 lisp/gnus/gnus-start.el
  79. +3,464 −1,700 lisp/gnus/gnus-sum.el
  80. +236 −91 lisp/gnus/gnus-topic.el
  81. +2 −2 lisp/gnus/gnus-undo.el
  82. +711 −207 lisp/gnus/gnus-util.el
  83. +118 −139 lisp/gnus/gnus-uu.el
  84. +1 −1  lisp/gnus/gnus-vm.el
  85. +48 −21 lisp/gnus/gnus-win.el
  86. +1,468 −328 lisp/gnus/gnus.el
  87. +622 −0 lisp/gnus/gnus.xbm
  88. +2 −1  {etc → lisp/gnus}/gnus.xpm
  89. +21 −0 lisp/gnus/grin.xpm
  90. +74 −0 lisp/gnus/hex-util.el
  91. +550 −0 lisp/gnus/html2text.el
  92. +52 −25 lisp/gnus/ietf-drums.el
  93. +465 −267 lisp/gnus/imap.el
  94. +32 −0 lisp/gnus/important.xpm
  95. +20 −0 lisp/gnus/indifferent.xpm
  96. +29 −49 lisp/gnus/kill-group.xpm
  97. +9 −4 lisp/gnus/mail-parse.el
  98. +1 −1  lisp/gnus/mail-prsvr.el
  99. +31 −50 lisp/gnus/mail-reply.xpm
  100. +213 −80 lisp/gnus/mail-source.el
  101. +92 −53 lisp/gnus/mailcap.el
Sorry, we could not display the entire diff because it was too big.
View
6 ChangeLog
@@ -6,6 +6,12 @@
* config.bat: Update URLs in the comments.
+2004-08-02 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * Makefile.in (install-arch-indep): Added pgg and sieve.
+
+ * info/.cvsignore: Added pgg and sieve.
+
2004-07-05 Andreas Schwab <schwab@suse.de>
* Makefile.in (install-arch-indep): Remove .arch-inventory files.
View
4 Makefile.in
@@ -475,7 +475,7 @@ install-arch-indep: mkdir info
chmod a+r ${infodir}/dir); \
fi; \
cd ${srcdir}/info ; \
- for f in ada-mode* autotype* calc* ccmode* cl* dired-x* ebrowse* ediff* efaq* eintr* elisp* emacs* emacs-xtra* eshell* eudc* flymake* forms* gnus* idlwave* info* message* mh-e* pcl-cvs* reftex* sc* ses* speedbar* tramp* vip* widget* woman* smtpmail*; do \
+ for f in ada-mode* autotype* calc* ccmode* cl* dired-x* ebrowse* ediff* efaq* eintr* elisp* emacs* emacs-mime* emacs-xtra* eshell* eudc* flymake* forms* gnus* idlwave* info* message* mh-e* pcl-cvs* pgg* reftex* sc* ses* sieve* speedbar* tramp* vip* widget* woman* smtpmail*; do \
(cd $${thisdir}; \
${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f; \
chmod a+r ${infodir}/$$f); \
@@ -485,7 +485,7 @@ install-arch-indep: mkdir info
thisdir=`/bin/pwd`; \
if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \
then \
- for f in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq elisp eintr emacs emacs-mime emacs-xtra eshell eudc flymake forms gnus idlwave info message mh-e pcl-cvs reftex sc ses speedbar tramp vip viper widget woman smtpmail; do \
+ for f in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq elisp eintr emacs emacs-mime emacs-xtra eshell eudc flymake forms gnus idlwave info message mh-e pcl-cvs pgg reftex sc ses sieve speedbar tramp vip viper widget woman smtpmail; do \
(cd $${thisdir}; \
${INSTALL_INFO} --info-dir=${infodir} ${infodir}/$$f); \
done; \
View
12 etc/ChangeLog
@@ -46,6 +46,18 @@
* NEWS: Document all new tutorials.
+2004-08-05 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * GNUS-NEWS: Import from the v5_10 branch of the Gnus repository.
+
+ * NEWS (Gnus package): Gnus includes Sieve and PGG. Gnus changes
+ are described in GNUS-NEWS.
+
+2004-08-02 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * gnus.xpm, gnus-pointer.xbm, gnus-pointer.xpm: Import from the
+ v5_10 branch of the Gnus repository.
+
2004-07-14 Luc Teirlinck <teirllm@auburn.edu>
* MORE.STUFF: Tramp is now distributed with Emacs.
View
545 etc/GNUS-NEWS
@@ -0,0 +1,545 @@
+GNUS NEWS -- history of user-visible changes.
+Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+See the end for copying conditions.
+
+Please send Gnus bug reports to bugs@gnus.org.
+For older news, see Gnus info node "New Features".
+
+
+* Changes in Oort Gnus
+
+** `F' (`gnus-article-followup-with-original') and `R'
+(`gnus-article-reply-with-original') only yank the text in the region if the
+region is active.
+
+** `gnus-group-read-ephemeral-group' can be called interactively, using `G M'.
+
+** In draft groups, `e' is now bound to `gnus-draft-edit-message'.
+Use `B w' for `gnus-summary-edit-article' instead.
+
+** The revised Gnus FAQ is included in the manual.
+See the info node "Frequently Asked Questions".
+
+** Upgrading from previous (stable) version if you have used Oort.
+
+If you have tried Oort (the unstable Gnus branch leading to this
+release) but went back to a stable version, be careful when upgrading
+to this version. In particular, you will probably want to remove all
+.marks (nnml) and .mrk (nnfolder) files, so that flags are read from
+your ~/.newsrc.eld instead of from the .marks/.mrk file where this
+release store flags. See a later entry for more information about
+marks. Note that downgrading isn't safe in general.
+
+** Article Buttons
+
+More buttons for URLs, mail addresses, Message-IDs, Info links, man pages and
+Emacs or Gnus related references, see the info node "Article Buttons". The
+variables `gnus-button-*-level' can be used to control the appearance of all
+article buttons, see the info node "Article Button Levels".
+
+** Dired integration
+
+`gnus-dired-minor-mode' installs key bindings in dired buffers to send a file
+as an attachment (`C-c C-m C-a'), open a file using the approriate mailcap
+entry (`C-c C-m C-l'), and print a file using the mailcap entry (`C-c C-m
+C-p'). See the info node "Other modes".
+
+
+** Gnus can display RSS newsfeeds as a newsgroup. To get started do `B
+nnrss RET RET' in the Group buffer.
+
+** Single-part yenc encoded attachments can be decoded.
+
+** Picons
+The picons code has been reimplemented to work in Emacs 21 -- some of
+the previous options have been removed or renamed.
+
+Picons are small "personal icons" representing users, domain and
+newsgroups, which can be displayed in the Article buffer. To enable
+picons, install the picons database from
+
+ http://www.cs.indiana.edu/picons/ftp/index.html
+
+and point `gnus-picon-databases' to that location.
+
+** If the new option `gnus-treat-body-boundary' is `head', a boundary
+line is drawn at the end of the headers.
+
+** Retrieval of charters and control messages
+There are new commands for fetching newsgroup charters (`H c') and
+control messages (`H C').
+
+** Delayed articles
+You can delay the sending of a message with `C-c C-j' in the Message
+buffer. The messages are delivered at specified time. This is useful
+for sending yourself reminders. Setup with (gnus-delay-initialize).
+
+** If `auto-compression-mode' is enabled, attachments are automatically
+decompressed when activated.
+
+** If the new option `nnml-use-compressed-files' is non-nil,
+the nnml back end allows compressed message files.
+
+** Signed article headers (X-PGP-Sig) can be verified with `W p'.
+
+** The Summary Buffer uses an arrow in the fringe to indicate the
+current article in Emacs 21 running on a graphical display. Customize
+`gnus-summary-display-arrow' to disable it.
+
+** Warn about email replies to news
+Do you often find yourself replying to news by email by mistake? Then
+the new option `gnus-confirm-mail-reply-to-news' is just the thing for
+you.
+
+** If the new option `gnus-summary-display-while-building' is non-nil,
+the summary buffer is shown and updated as it's being built.
+
+** The new `recent' mark "." indicates newly arrived messages (as
+opposed to old but unread messages).
+
+** The new option `gnus-gcc-mark-as-read' automatically marks
+Gcc articles as read.
+
+** The nndoc back end now supports mailman digests and exim bounces.
+
+** Gnus supports RFC 2369 mailing list headers, and adds a number of
+related commands in mailing list groups.
+
+** The Date header can be displayed in a format that can be read aloud
+in English, see `gnus-treat-date-english'.
+
+** The envelope sender address can be customized when using Sendmail, see
+`message-sendmail-envelope-from'.
+
+** diffs are automatically highlighted in groups matching
+`mm-uu-diff-groups-regexp'
+
+** TLS wrapper shipped with Gnus
+
+TLS/SSL is now supported in IMAP and NNTP via tls.el and GNUTLS. The
+old TLS/SSL support via (external third party) ssl.el and OpenSSL
+still works.
+
+** New make.bat for compiling and installing Gnus under MS Windows
+
+Use make.bat if you want to install Gnus under MS Windows, the first
+argument to the batch-program should be the directory where xemacs.exe
+respectively emacs.exe is located, iff you want to install Gnus after
+compiling it, give make.bat /copy as the second parameter.
+
+`make.bat' has been rewritten from scratch, it now features automatic
+recognition of XEmacs and GNU Emacs, generates gnus-load.el, checks if
+errors occur while compilation and generation of info files and reports
+them at the end of the build process. It now uses makeinfo if it is
+available and falls back to infohack.el otherwise. `make.bat' should now
+install all files which are necessary to run Gnus and be generally a
+complete replacement for the "configure; make; make install" cycle used
+under Unix systems.
+
+The new make.bat makes make-x.bat superfluous, so it has been removed.
+
+** Support for non-ASCII domain names
+
+Message supports non-ASCII domain names in From:, To: and Cc: and will
+query you whether to perform encoding when you try to send a message.
+The variable `message-use-idna' controls this. Gnus will also decode
+non-ASCII domain names in From:, To: and Cc: when you view a message.
+The variable `gnus-use-idna' controls this.
+
+** Better handling of Microsoft citation styles
+
+Gnus now tries to recognize the mangled header block that some Microsoft
+mailers use to indicate that the rest of the message is a citation, even
+though it is not quoted in any way. The variable
+`gnus-cite-unsightly-citation-regexp' matches the start of these
+citations.
+
+** gnus-article-skip-boring
+
+If you set `gnus-article-skip-boring' to t, then Gnus will not scroll
+down to show you a page that contains only boring text, which by
+default means cited text and signature. You can customize what is
+skippable using `gnus-article-boring-faces'.
+
+This feature is especially useful if you read many articles that
+consist of a little new content at the top with a long, untrimmed
+message cited below.
+
+** The format spec %C for positioning point has changed to %*.
+
+** The new variable `gnus-parameters' can be used to set group parameters.
+
+Earlier this was done only via `G p' (or `G c'), which stored the
+parameters in ~/.newsrc.eld, but via this variable you can enjoy the
+powers of customize, and simplified backups since you set the variable
+in ~/.emacs instead of ~/.newsrc.eld. The variable maps regular
+expressions matching group names to group parameters, a'la:
+
+ (setq gnus-parameters
+ '(("mail\\..*"
+ (gnus-show-threads nil)
+ (gnus-use-scoring nil))
+ ("^nnimap:\\(foo.bar\\)$"
+ (to-group . "\\1"))))
+
+** Smileys (":-)", ";-)" etc) are now iconized for Emacs too.
+
+Customize `gnus-treat-display-smileys' to disable it.
+
+** Gnus no longer generates the Sender: header automatically.
+
+Earlier it was generated iff the user configurable email address was
+different from the Gnus guessed default user address. As the guessing
+algorithm is rarely correct these days, and (more controversially) the
+only use of the Sender: header was to check if you are entitled to
+cancel/supersede news (which is now solved by Cancel Locks instead,
+see another entry), generation of the header has been disabled by
+default. See the variables `message-required-headers',
+`message-required-news-headers', and `message-required-mail-headers'.
+
+** Features from third party message-utils.el added to message.el.
+
+Message now asks if you wish to remove "(was: <old subject>)" from
+subject lines (see `message-subject-trailing-was-query'). C-c M-m and
+C-c M-f inserts markers indicating included text. C-c C-f a adds a
+X-No-Archive: header. C-c C-f x inserts appropriate headers and a
+note in the body for cross-postings and followups (see the variables
+`message-cross-post-*').
+
+** References and X-Draft-Headers are no longer generated when you
+start composing messages and `message-generate-headers-first' is nil.
+
+** Improved anti-spam features.
+
+Gnus is now able to take out spam from your mail and news streams
+using a wide variety of programs and filter rules. Among the supported
+methods are RBL blocklists, bogofilter and white/blacklists. Hooks
+for easy use of external packages such as SpamAssassin and Hashcash
+are also new.
+
+** Easy inclusion of X-Faces headers.
+
+** In the summary buffer, the new command / N inserts new messages and
+/ o inserts old messages.
+
+** Gnus decodes morse encoded messages if you press W m.
+
+** Unread count correct in nnimap groups.
+
+The estimated number of unread articles in the group buffer should now
+be correct for nnimap groups. This is achieved by calling
+`nnimap-fixup-unread-after-getting-new-news' from the
+`gnus-setup-news-hook' (called on startup) and
+`gnus-after-getting-new-news-hook' (called after getting new mail).
+If you have modified those variables from the default, you may want to
+add n-f-u-a-g-n-n again. If you were happy with the estimate and want
+to save some (minimal) time when getting new mail, remove the
+function.
+
+** Group Carbon Copy (GCC) quoting
+
+To support groups that contains SPC and other weird characters, groups
+are quoted before they are placed in the Gcc: header. This means
+variables such as `gnus-message-archive-group' should no longer
+contain quote characters to make groups containing SPC work. Also, if
+you are using the string "nnml:foo, nnml:bar" (indicating Gcc into two
+groups) you must change it to return the list ("nnml:foo" "nnml:bar"),
+otherwise the Gcc: line will be quoted incorrectly. Note that
+returning the string "nnml:foo, nnml:bar" was incorrect earlier, it
+just didn't generate any problems since it was inserted directly.
+
+** ~/News/overview/ not used.
+
+As a result of the following change, the ~/News/overview/ directory is
+not used any more. You can safely delete the entire hierarchy.
+
+** gnus-agent
+
+The Gnus Agent has seen a major update. It is now enabled by default,
+and all nntp and nnimap servers from `gnus-select-method' and
+`gnus-secondary-select-method' are agentized by default. Earlier only
+the server in `gnus-select-method' was agentized by the default, and the
+agent was disabled by default. When the agent is enabled, headers are
+now also retrieved from the Agent cache instead of the backends when
+possible. Earlier this only happened in the unplugged state. You can
+enroll or remove servers with `J a' and `J r' in the server buffer.
+Gnus will not download articles into the Agent cache, unless you
+instruct it to do so, though, by using `J u' or `J s' from the Group
+buffer. You revert to the old behaviour of having the Agent disabled
+by customizing `gnus-agent'. Note that putting `(gnus-agentize)' in
+~/.gnus is not needed any more.
+
+** gnus-summary-line-format
+
+The default value changed to "%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n".
+Moreover `gnus-extra-headers', `nnmail-extra-headers' and
+`gnus-ignored-from-addresses' changed their default so that the users
+name will be replaced by the recipient's name or the group name
+posting to for NNTP groups.
+
+** deuglify.el (gnus-article-outlook-deuglify-article)
+
+A new file from Raymond Scholz <rscholz@zonix.de> for deuglifying
+broken Outlook (Express) articles.
+
+** (require 'gnus-load)
+
+If you use a stand-alone Gnus distribution, you'd better add
+"(require 'gnus-load)" to your ~/.emacs after adding the Gnus
+lisp directory into load-path.
+
+File gnus-load.el contains autoload commands, functions and variables,
+some of which may not be included in distributions of Emacsen.
+
+** gnus-slave-unplugged
+
+A new command which starts gnus offline in slave mode.
+
+** message-insinuate-rmail
+
+Adding (message-insinuate-rmail) in .emacs and customizing
+`mail-user-agent' to `gnus-user-agent' convinces Rmail to compose,
+reply and forward messages in Message mode, where you can enjoy the
+power of MML.
+
+** message-minibuffer-local-map
+
+The line below enables BBDB in resending a message:
+
+(define-key message-minibuffer-local-map [?\t] 'bbdb-complete-name)
+
+** Externalizing and deleting of attachments.
+
+If `gnus-gcc-externalize-attachments' (or
+`message-fcc-externalize-attachments') is non-nil, attach local files
+as external parts.
+
+The command `gnus-mime-save-part-and-strip' (bound to `C-o' on MIME
+buttons) saves a part and replaces the part with an external one.
+`gnus-mime-delete-part' (bound to `d' on MIME buttons) removes a part.
+It works only on back ends that support editing.
+
+** gnus-default-charset
+
+The default value now guesses on the basis of your environment instead
+of using Latin-1. Also the ".*" item in gnus-group-charset-alist is
+removed.
+
+** gnus-posting-styles
+
+Add a new format of match like
+
+ ((header "to" "larsi.*org")
+ (Organization "Somewhere, Inc."))
+
+The old format like the lines below is obsolete, but still accepted.
+
+ (header "to" "larsi.*org"
+ (Organization "Somewhere, Inc."))
+
+** message-ignored-news-headers and message-ignored-mail-headers
+
+X-Draft-From and X-Gnus-Agent-Meta-Information have been added into
+these two variables. If you customized those, perhaps you need add
+those two headers too.
+
+** Gnus reads the NOV and articles in the Agent if plugged.
+
+If one reads an article while plugged, and the article already exists
+in the Agent, it won't get downloaded once more. Customize
+`gnus-agent-cache' to revert to the old behavior.
+
+** Gnus supports the "format=flowed" (RFC 2646) parameter.
+
+On composing messages, it is enabled by `use-hard-newlines'. Decoding
+format=flowed was present but not documented in earlier versions.
+
+** Gnus supports the generation of RFC 2298 Disposition Notification requests.
+
+This is invoked with the C-c M-n key binding from message mode.
+
+** Gnus supports Maildir groups.
+
+Gnus includes a new backend nnmaildir.el.
+
+** Printing capabilities are enhanced.
+
+Gnus supports Muttprint natively with O P from the Summary and Article
+buffers. Also, each individual MIME part can be printed using p on
+the MIME button.
+
+** Message supports the Importance: (RFC 2156) header.
+
+In the message buffer, `C-c C-f C-i' or `C-c C-u' cycles through the
+valid values.
+
+** Gnus supports Cancel Locks in News.
+
+This means a header "Cancel-Lock" is inserted in news posting. It is
+used to determine if you wrote a article or not (for cancelling and
+superseding). Gnus generates a random password string the first time
+you post a message, and saves it using the Custom system. While the
+variable is called `canlock-password', it is not security sensitive
+data. Publishing your canlock string on the web will not allow anyone
+to be able to anything she could not already do. The behaviour can be
+changed by customizing `message-insert-canlock'.
+
+** Gnus supports server-side mail filtering using Sieve.
+
+Sieve rules can be added as Group Parameters for groups, and the
+complete Sieve script is generated using `D g' from the Group buffer,
+and then uploaded to the server using `C-c C-l' in the generated Sieve
+buffer. Search the online Gnus manual for "sieve", and see the new
+Sieve manual, for more information.
+
+** Extended format specs.
+
+Format spec "%&user-date;" is added into
+`gnus-summary-line-format-alist'. Also, user defined extended format
+specs are supported. The extended format specs look like "%u&foo;",
+which invokes function `gnus-user-format-function-foo'. Because "&" is
+used as the escape character, old user defined format "%u&" is no
+longer supported.
+
+** `/ *' (gnus-summary-limit-include-cached) is rewritten.
+
+It was aliased to `Y c' (gnus-summary-insert-cached-articles). The new
+function filters out other articles.
+
+** Some limiting commands accept a C-u prefix to negate the match.
+
+If C-u is used on subject, author or extra headers, i.e., `/ s', `/
+a', and `/ x' (gnus-summary-limit-to-{subject,author,extra})
+respectively, the result will be to display all articles that do not
+match the expression.
+
+** Group names are treated as UTF-8 by default.
+
+This is supposedly what USEFOR wanted to migrate to. See
+`gnus-group-name-charset-group-alist' and
+`gnus-group-name-charset-method-alist' for customization.
+
+** The nnml and nnfolder backends store marks for each group.
+
+This makes it possible to take backup of nnml/nnfolder servers/groups
+separately of ~/.newsrc.eld, while preserving marks. It also makes it
+possible to share articles and marks between users (without sharing
+the ~/.newsrc.eld file) within e.g. a department. It works by storing
+the marks stored in ~/.newsrc.eld in a per-group file ".marks" (for
+nnml) and "groupname.mrk" (for nnfolder, named "groupname"). If the
+nnml/nnfolder is moved to another machine, Gnus will automatically use
+the .marks or .mrk file instead of the information in ~/.newsrc.eld.
+The new server variables `nnml-marks-is-evil' and
+`nnfolder-marks-is-evil' can be used to disable this feature.
+
+** The menu bar item (in Group and Summary buffer) named "Misc" has
+been renamed to "Gnus".
+
+** The menu bar item (in Message mode) named "MML" has been renamed to
+"Attachments". Note that this menu also contains security related
+stuff, like signing and encryption.
+
+** gnus-group-charset-alist and gnus-group-ignored-charsets-alist.
+
+The regexps in these variables are compared with full group names
+instead of real group names in 5.8. Users who customize these
+variables should change those regexps accordingly. For example:
+
+ ("^han\\>" euc-kr) -> ("\\(^\\|:\\)han\\>" euc-kr)
+
+** Gnus supports PGP (RFC 1991/2440), PGP/MIME (RFC 2015/3156) and
+S/MIME (RFC 2630-2633).
+
+It needs an external S/MIME and OpenPGP implementation, but no
+additional lisp libraries. This add several menu items to the
+Attachments menu, and C-c RET key bindings, when composing messages.
+This also obsoletes `gnus-article-hide-pgp-hook'.
+
+** Gnus inlines external parts (message/external).
+
+** MML (Mime compose) prefix changed from `M-m' to `C-c C-m'.
+
+This change was made to avoid conflict with the standard binding of
+`back-to-indentation', which is also useful in message mode.
+
+** The default for message-forward-show-mml changed to symbol best.
+
+The behaviour for the `best' value is to show MML (i.e., convert MIME
+to MML) when appropriate. MML will not be used when forwarding signed
+or encrypted messages, as the conversion invalidate the digital
+signature.
+
+** Bug fixes.
+
+
+* Changes in Pterodactyl Gnus (5.8/5.9)
+
+The Gnus NEWS entries are short, but they reflect sweeping changes in
+four areas: Article display treatment, MIME treatment,
+internationalization and mail-fetching.
+
+** The mail-fetching functions have changed. See the manual for the
+many details. In particular, all procmail fetching variables are gone.
+
+If you used procmail like in
+
+(setq nnmail-use-procmail t)
+(setq nnmail-spool-file 'procmail)
+(setq nnmail-procmail-directory "~/mail/incoming/")
+(setq nnmail-procmail-suffix "\\.in")
+
+this now has changed to
+
+(setq mail-sources
+ '((directory :path "~/mail/incoming/"
+ :suffix ".in")))
+
+More information is available in the info doc at Select Methods ->
+Getting Mail -> Mail Sources
+
+** Gnus is now a MIME-capable reader. This affects many parts of
+Gnus, and adds a slew of new commands. See the manual for details.
+
+** Gnus has also been multilingualized. This also affects too
+many parts of Gnus to summarize here, and adds many new variables.
+
+** gnus-auto-select-first can now be a function to be
+called to position point.
+
+** The user can now decide which extra headers should be included in
+summary buffers and NOV files.
+
+** `gnus-article-display-hook' has been removed. Instead, a number
+of variables starting with `gnus-treat-' have been added.
+
+** The Gnus posting styles have been redone again and now works in a
+subtly different manner.
+
+** New web-based backends have been added: nnslashdot, nnwarchive
+and nnultimate. nnweb has been revamped, again, to keep up with
+ever-changing layouts.
+
+** Gnus can now read IMAP mail via nnimap.
+
+
+* For older news, see Gnus info node "New Features".
+
+----------------------------------------------------------------------
+Copyright information:
+
+Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+ Permission is granted to anyone to make or distribute verbatim copies
+ of this document as received, in any medium, provided that the
+ copyright notice and this permission notice are preserved,
+ thus giving the recipient permission to redistribute in turn.
+
+ Permission is granted to distribute modified versions
+ of this document, or of portions of it,
+ under the above conditions, provided also that they
+ carry prominent notices stating who last changed them.
+
+Local variables:
+mode: outline
+paragraph-separate: "[ ]*$"
+end:
View
9 etc/NEWS
@@ -264,6 +264,15 @@ This is like `strokes-global-set-stroke', but it allows you to bind
the stroke directly to a string to insert. This is convenient for
using strokes as an input method.
+** Gnus package
+
+*** Gnus now includes Sieve and PGG
+Sieve is a library for managing Sieve scripts. PGG is a library to handle
+PGP/MIME.
+
+*** There are many news features, bug fixes and improvements.
+See the file GNUS-NEWS or the node "Oort Gnus" in the Gnus manual for details.
+
+++
** Desktop package
View
10 lisp/ChangeLog
@@ -773,6 +773,16 @@
* ps-print.el (ps-begin-file): Improve the DSC compliance of the
generated PostScript.
+2004-08-17 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * net/tls.el (tls-process-connection-type): Fix docstring. (Sync
+ with Gnus v5_10 branch.)
+
+2004-08-16 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * calendar/time-date.el (time-to-number-of-days): New function.
+ Imported from from Gnus.
+
2004-07-22 Kim F. Storm <storm@cua.dk>
* progmodes/make-mode.el: Fix comments.
View
9 lisp/calendar/time-date.el
@@ -1,5 +1,5 @@
;;; time-date.el --- date and time handling functions
-;; Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 1999, 2000, 2004 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Masanobu Umeda <umerin@mse.kyutech.ac.jp>
@@ -38,7 +38,7 @@
(parse-time-string
;; `parse-time-string' isn't sufficiently general or
;; robust. It fails to grok some of the formats that
- ;; timzeone does (e.g. dodgy post-2000 stuff from some
+ ;; timezone does (e.g. dodgy post-2000 stuff from some
;; Elms) and either fails or returns bogus values. Lars
;; reverted this change, but that loses non-trivially
;; often for me. -- fx
@@ -177,6 +177,11 @@ The Gregorian date Sunday, December 31, 1bce is imaginary."
(- (/ (1- year) 100)) ; - century years
(/ (1- year) 400)))) ; + Gregorian leap years
+(defun time-to-number-of-days (time)
+ "Return the number of days represented by TIME.
+The number of days will be returned as a floating point number."
+ (/ (+ (* 1.0 65536 (car time)) (cadr time)) (* 60 60 24)))
+
;;;###autoload
(defun safe-date-to-time (date)
"Parse a string that represents a date-time and return a time value.
View
11,354 lisp/gnus/ChangeLog
243 additions, 11,111 deletions not shown
View
18,924 lisp/gnus/ChangeLog.2
18,924 additions, 0 deletions not shown
View
193 lisp/gnus/TODO
@@ -0,0 +1,193 @@
+2004-08-22 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * Disclaimer: This is *temporary* file to keep track of the changes
+ in the trunk, that have or have not made it into the Gnus branch.
+
+
+
+2004--08-22 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * Add `:version "21.4"' to all new defcustoms. Grep ChangeLog and
+ ChangeLog.1 for "new variable". Also check if the `:version
+ "21.1"' and `:version "21.3"' entries are correct.
+
+
+
+2002-10-02 Karl Berry <karl@gnu.org>
+
+ * In directory ./man:
+
+ * emacs-mime.texi, gnus-faq.texi, gnus.texi, message.texi,
+ pgg.texi, sieve.texi: Per rms, update all manuals to use @copying
+ instead of @ifinfo. Also use @ifnottex instead of @ifinfo around
+ the top node, where needed for the sake of the HTML output.
+ (The Gnus manual is not fixed since it's not clear to me how it
+ works; and the Tramp manual already uses @copying, although in an
+ unusual way. All others were changed.)
+
+==> Done. Not yet in Gnus repository.
+
+
+
+2004-06-29 Kim F. Storm <storm@cua.dk>
+
+ * nntp.el (nntp-authinfo-file): Add :group 'nntp.
+
+ * nnimap.el (nnimap-authinfo-file, nnimap-prune-cache):
+ Add :group 'nnimap.
+
+==> applied, here and in Gnus repository.
+
+2004-05-18 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * mm-view.el (mm-insert-inline): Make it work in read-only buffer.
+
+ * gnus-win.el (gnus-all-windows-visible-p): Don't consider
+ non-visible windows.
+
+2004-05-07 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * rfc2047.el (rfc2047-encode-message-header): Don't encode non-address
+ headers as address headers (which breaks if subject has a single ").
+
+==> already in Gnus
+
+2004-05-06 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * nnimap.el (nnimap-demule): Avoid string-as-multibyte.
+
+==> applied, here and in Gnus repository.
+
+2004-04-21 Richard M. Stallman <rms@gnu.org>
+
+ * mailcap.el (mailcap-mime-data): Mark as risky.
+
+==> applied, here and in Gnus repository.
+
+2004-03-27 Juanma Barranquero <lektu@terra.es>
+
+ * gnus-srvr.el (gnus-server-prepare): Remove spurious call to `cdr'.
+
+==> already in Gnus
+
+2004-03-22 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * gnus-art.el: Use inhibit-read-only instead of buffer-read-only.
+ (gnus-narrow-to-page): Don't assume point-min == 1.
+ (gnus-article-edit-mode): Derive from message-mode.
+ (gnus-button-alist): Add buttons to (info "(emacs)Keymaps").
+
+ * gnus-score.el (gnus-score-find-bnews): Simplify and don't assume
+ point-min == 1.
+
+ * imap.el (imap-parse-address-list, imap-parse-body-ext):
+ Disable incorrect use of `assert'.
+
+==> applied / modified
+
+2004-03-05 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * message.el (message-mode): Fix last change.
+
+==> applied
+
+2004-03-04 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * message.el (message-mode): Set comment-start-skip.
+
+==> applied
+
+2004-02-08 Andreas Schwab <schwab@suse.de>
+
+ * nnlistserv.el (nnlistserv-kk-wash-article): Fix paren nesting.
+
+ * gnus-score.el (gnus-summary-increase-score): Fix format string.
+
+==> applied; here and in Gnus v5-10. Already fixed in No Gnus.
+
+2003-06-25 Sam Steingold <sds@gnu.org>
+
+ * gnus-group.el (gnus-group-suspend): Avoid some consing.
+
+==> hunk FAILED / not very important / skip
+
+2003-06-11 Sam Steingold <sds@gnu.org>
+
+ * pop3.el (pop3-leave-mail-on-server): New user variable.
+ (pop3-movemail): Delete mail only when it is nil.
+
+==> applied / Was not documented in the Gnus manual, added it.
+
+2003-05-10 Juanma Barranquero <lektu@terra.es>
+
+ * message.el (message-buffer-naming-style): Fix typo.
+
+==> variable has been removed.
+
+2003-05-07 Dave Love <fx@gnu.org>
+
+ [Partial sync with Gnus.]
+
+ * rfc2047.el (rfc2047-header-encoding-alist): Add Followup-To.
+ (rfc2047-encode-message-header): Fold when encoding not necessary.
+ (rfc2047-encode-region): Skip \n as whitespace.
+ (rfc2047-fold-region): Fix whitespace regexps. Don't break just
+ after the header name.
+ (rfc2047-unfold-region): Fix regexp and whitespace-skipping.
+
+2003-05-06 Jesper Harder <harder@ifa.au.dk>
+
+ * gnus-cus.el (gnus-group-customize, gnus-score-parameters):
+ Don't quote nil and t in docstrings.
+
+ * gnus-score.el (gnus-score-lower-thread): Likewise.
+
+ * gnus-art.el (gnus-article-mime-match-handle-function): Likewise.
+
+==> already in Gnus
+
+2003-02-28 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * nnfolder.el (nnfolder-request-accept-article): Don't use
+ mail-header-unfold-field.
+
+ * imap.el (imap-ssl-open): Don't depend on ssl.el.
+ * nntp.el (nntp-open-ssl-stream): Don't depend on ssl.el.
+
+2003-02-18 Juanma Barranquero <lektu@terra.es>
+
+ * ietf-drums.el (ietf-drums-remove-whitespace): Fix character constant.
+
+2003-02-14 Juanma Barranquero <lektu@terra.es>
+
+ * mm-uu.el (mm-uu-dissect): Fix use of character constant.
+
+==> already done. [2003-02-14 ShengHuo ZHU synced stuff to Gnus]
+
+2003-02-11 Stefan Monnier <monnier@cs.yale.edu>
+
+ * nntp.el (nntp-accept-process-output): Don't use point-max to get
+ the buffer's size.
+
+==> already done. [2003-02-14 ShengHuo ZHU synced stuff to Gnus]
+
+2003-01-31 Joe Buehler <jhpb@draco.hekimian.com>
+
+ * nnheader.el: Added cygwin to system-type comparisons.
+
+==> already done.
+
+
+
+2004-08-22 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * It seems that the last few changes and all older changes have
+ already been applied in Gnus repository, e.g. by ShengHuo ZHU
+ <zsh@cs.rochester.edu>.
+
+# Local Variables:
+# coding: iso-2022-7bit
+# mode: change-log
+# End:
+
+# arch-tag: e6e5d695-4d00-46b1-a49d-508a2418a483
View
7 lisp/gnus/bar.xbm
@@ -0,0 +1,7 @@
+#define noname_width 6
+#define noname_height 48
+static char noname_bits[] = {
+ 0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,
+ 0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,
+ 0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,
+ 0x0c,0x0c,0x0c};
View
54 lisp/gnus/bar.xpm
@@ -0,0 +1,54 @@
+/* XPM */
+static char * picon-bar_xpm[] = {
+"6 48 2 1",
+" c white s background",
+". c black",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. "};
View
68 lisp/gnus/binhex.el
@@ -1,8 +1,7 @@
;;; binhex.el --- elisp native binhex decode
-;; Copyright (c) 1998 Free Software Foundation, Inc.
+;; Copyright (c) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
-;; Create Date: Oct 1, 1998
;; Keywords: binhex news
;; This file is part of GNU Emacs.
@@ -26,20 +25,33 @@
;;; Code:
+(autoload 'executable-find "executable")
+
(eval-when-compile (require 'cl))
-(defalias 'binhex-char-int
- (if (fboundp 'char-int)
- 'char-int
- 'identity))
+(eval-and-compile
+ (defalias 'binhex-char-int
+ (if (fboundp 'char-int)
+ 'char-int
+ 'identity)))
-(defvar binhex-decoder-program "hexbin"
- "*Non-nil value should be a string that names a uu decoder.
+(defcustom binhex-decoder-program "hexbin"
+ "*Non-nil value should be a string that names a binhex decoder.
The program should expect to read binhex data on its standard
-input and write the converted data to its standard output.")
+input and write the converted data to its standard output."
+ :type 'string
+ :group 'gnus-extract)
+
+(defcustom binhex-decoder-switches '("-d")
+ "*List of command line flags passed to the command `binhex-decoder-program'."
+ :group 'gnus-extract
+ :type '(repeat string))
-(defvar binhex-decoder-switches '("-d")
- "*List of command line flags passed to the command `binhex-decoder-program'.")
+(defcustom binhex-use-external
+ (executable-find binhex-decoder-program)
+ "*Use external binhex program."
+ :group 'gnus-extract
+ :type 'boolean)
(defconst binhex-alphabet-decoding-alist
'(( ?\! . 0) ( ?\" . 1) ( ?\# . 2) ( ?\$ . 3) ( ?\% . 4) ( ?\& . 5)
@@ -69,13 +81,16 @@ input and write the converted data to its standard output.")
((boundp 'temporary-file-directory) temporary-file-directory)
("/tmp/")))
-(if (featurep 'xemacs)
- (defalias 'binhex-insert-char 'insert-char)
- (defun binhex-insert-char (char &optional count ignored buffer)
- (if (or (null buffer) (eq buffer (current-buffer)))
- (insert-char char count)
- (with-current-buffer buffer
- (insert-char char count)))))
+(eval-and-compile
+ (defalias 'binhex-insert-char
+ (if (featurep 'xemacs)
+ 'insert-char
+ (lambda (char &optional count ignored buffer)
+ "Insert COUNT copies of CHARACTER into BUFFER."
+ (if (or (null buffer) (eq buffer (current-buffer)))
+ (insert-char char count)
+ (with-current-buffer buffer
+ (insert-char char count)))))))
(defvar binhex-crc-table
[0 4129 8258 12387 16516 20645 24774 28903
@@ -184,8 +199,9 @@ input and write the converted data to its standard output.")
(t
(binhex-insert-char (setq binhex-last-char char) 1 ignored buffer))))
-(defun binhex-decode-region (start end &optional header-only)
- "Binhex decode region between START and END.
+;;;###autoload
+(defun binhex-decode-region-internal (start end &optional header-only)
+ "Binhex decode region between START and END without using an external program.
If HEADER-ONLY is non-nil only decode header and return filename."
(interactive "r")
(let ((work-buffer nil)
@@ -258,12 +274,14 @@ If HEADER-ONLY is non-nil only decode header and return filename."
(and work-buffer (kill-buffer work-buffer)))
(if header (aref header 1))))
+;;;###autoload
(defun binhex-decode-region-external (start end)
"Binhex decode region between START and END using external decoder."
(interactive "r")
(let ((cbuf (current-buffer)) firstline work-buffer status
(file-name (expand-file-name
- (concat (binhex-decode-region start end t) ".data")
+ (concat (binhex-decode-region-internal start end t)
+ ".data")
binhex-temporary-file-directory)))
(save-excursion
(goto-char start)
@@ -296,6 +314,14 @@ If HEADER-ONLY is non-nil only decode header and return filename."
(ignore-errors
(if file-name (delete-file file-name))))))
+;;;###autoload
+(defun binhex-decode-region (start end)
+ "Binhex decode region between START and END."
+ (interactive "r")
+ (if binhex-use-external
+ (binhex-decode-region-external start end)
+ (binhex-decode-region-internal start end)))
+
(provide 'binhex)
;;; arch-tag: 8476badd-1e76-4f1d-a640-f9a38c72eed8
View
BIN  lisp/gnus/blink.pbm
Binary file not shown
View
20 lisp/gnus/blink.xpm
@@ -0,0 +1,20 @@
+/* XPM */
+static char * blink_xpm[] = {
+"13 14 3 1",
+" c None",
+". c #000000",
+"+ c #FFDD00",
+" ....... ",
+" ..+++++.. ",
+" .+++++++++. ",
+".+++++++++++.",
+".+++++++..++.",
+".+++++++..++.",
+".++...++++++.",
+".+++++++++++.",
+".++++++++.++.",
+".++.+++++.++.",
+".+++.....+++.",
+" .+++++++++. ",
+" ..+++++.. ",
+" ....... "};
View
20 lisp/gnus/braindamaged.xpm
@@ -0,0 +1,20 @@
+/* XPM */
+static char * mad_xpm[] = {
+"13 14 3 1",
+" c None",
+". c #000000",
+"+ c #FFDD00",
+" ....... ",
+" ..+++++.. ",
+" .+++++++++. ",
+".++...++++++.",
+".++.+.+...++.",
+".++...+.+.++.",
+".++++++...++.",
+".+.+++++++.+.",
+".+.+++++++.+.",
+".++.+++++.++.",
+".+++.....+++.",
+" .+++++++++. ",
+" ..+++++.. ",
+" ....... "};
View
251 lisp/gnus/canlock.el
@@ -0,0 +1,251 @@
+;;; canlock.el --- functions for Cancel-Lock feature
+
+;; Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004
+;; Free Software Foundation, Inc.
+
+;; Author: Katsumi Yamaoka <yamaoka@jpl.org>
+;; Keywords: news, cancel-lock, hmac, sha1, rfc2104
+
+;; 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 2, 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; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; Canlock is a library for generating and verifying Cancel-Lock and/or
+;; Cancel-Key header in news articles. This is used to protect articles
+;; from rogue cancel, supersede or replace attacks. The method is based
+;; on draft-ietf-usefor-cancel-lock-01.txt which was released on November
+;; 3rd 1998. For instance, you can add Cancel-Lock (and possibly Cancel-
+;; Key) header in a news article by using a hook which will be evaluated
+;; just before sending an article as follows:
+;;
+;; (add-hook '*e**a*e-header-hook 'canlock-insert-header t)
+;;
+;; Verifying Cancel-Lock is mainly a function of news servers, however,
+;; you can verify your own article using the command `canlock-verify' in
+;; the (raw) article buffer. You will be prompted for the password for
+;; each time if the option `canlock-password' or `canlock-password-for-
+;; verify' is nil. Note that setting these options is a bit unsafe.
+
+;;; Code:
+
+(eval-when-compile
+ (require 'cl))
+
+(require 'sha1)
+
+(defvar mail-header-separator)
+
+(defgroup canlock nil
+ "The Cancel-Lock feature."
+ :group 'applications)
+
+(defcustom canlock-password nil
+ "Password to use when signing a Cancel-Lock or a Cancel-Key header."
+ :type '(radio (const :format "Not specified " nil)
+ (string :tag "Password" :size 0))
+ :group 'canlock)
+
+(defcustom canlock-password-for-verify canlock-password
+ "Password to use when verifying a Cancel-Lock or a Cancel-Key header."
+ :type '(radio (const :format "Not specified " nil)
+ (string :tag "Password" :size 0))
+ :group 'canlock)
+
+(defcustom canlock-force-insert-header nil
+ "If non-nil, insert a Cancel-Lock or a Cancel-Key header even if the
+buffer does not look like a news message."
+ :type 'boolean
+ :group 'canlock)
+
+(eval-when-compile
+ (defmacro canlock-string-as-unibyte (string)
+ "Return a unibyte string with the same individual bytes as STRING."
+ (if (fboundp 'string-as-unibyte)
+ (list 'string-as-unibyte string)
+ string)))
+
+(defun canlock-sha1 (message)
+ "Make a SHA-1 digest of MESSAGE as a unibyte string of length 20 bytes."
+ (let (sha1-maximum-internal-length)
+ (sha1 message nil nil 'binary)))
+
+(defun canlock-make-cancel-key (message-id password)
+ "Make a Cancel-Key header."
+ (when (> (length password) 20)
+ (setq password (canlock-sha1 password)))
+ (setq password (concat password (make-string (- 64 (length password)) 0)))
+ (let ((ipad (mapconcat (lambda (byte)
+ (char-to-string (logxor 54 byte)))
+ password ""))
+ (opad (mapconcat (lambda (byte)
+ (char-to-string (logxor 92 byte)))
+ password "")))
+ (base64-encode-string
+ (canlock-sha1
+ (concat opad
+ (canlock-sha1
+ (concat ipad (canlock-string-as-unibyte message-id))))))))
+
+(defun canlock-narrow-to-header ()
+ "Narrow the buffer to the head of the message."
+ (let (case-fold-search)
+ (narrow-to-region
+ (goto-char (point-min))
+ (goto-char (if (re-search-forward
+ (format "^$\\|^%s$"
+ (regexp-quote mail-header-separator))
+ nil t)
+ (match-beginning 0)
+ (point-max))))))
+
+(defun canlock-delete-headers ()
+ "Delete Cancel-Key or Cancel-Lock headers in the narrowed buffer."
+ (let ((case-fold-search t))
+ (goto-char (point-min))
+ (while (re-search-forward "^Cancel-\\(Key\\|Lock\\):" nil t)
+ (delete-region (match-beginning 0)
+ (if (re-search-forward "^[^\t ]" nil t)
+ (goto-char (match-beginning 0))
+ (point-max))))))
+
+(defun canlock-fetch-fields (&optional key)
+ "Return a list of the values of Cancel-Lock header.
+If KEY is non-nil, look for a Cancel-Key header instead. The buffer
+is expected to be narrowed to just the headers of the message."
+ (let ((field (mail-fetch-field (if key "Cancel-Key" "Cancel-Lock")))
+ fields rest
+ (case-fold-search t))
+ (when field
+ (setq fields (split-string field "[\t\n\r ,]+"))
+ (while fields
+ (when (string-match "^sha1:" (setq field (pop fields)))
+ (push (substring field 5) rest)))
+ (nreverse rest))))
+
+(defun canlock-fetch-id-for-key ()
+ "Return a Message-ID in Cancel, Supersedes or Replaces header.
+The buffer is expected to be narrowed to just the headers of the
+message."
+ (or (let ((cancel (mail-fetch-field "Control")))
+ (and cancel
+ (string-match "^cancel[\t ]+\\(<[^\t\n @<>]+@[^\t\n @<>]+>\\)"
+ cancel)
+ (match-string 1 cancel)))
+ (mail-fetch-field "Supersedes")
+ (mail-fetch-field "Replaces")))
+
+;;;###autoload
+(defun canlock-insert-header (&optional id-for-key id-for-lock password)
+ "Insert a Cancel-Key and/or a Cancel-Lock header if possible."
+ (let (news control key-for-key key-for-lock)
+ (save-excursion
+ (save-restriction
+ (canlock-narrow-to-header)
+ (when (setq news (or canlock-force-insert-header
+ (mail-fetch-field "Newsgroups")))
+ (unless id-for-key
+ (setq id-for-key (canlock-fetch-id-for-key)))
+ (if (and (setq control (mail-fetch-field "Control"))
+ (string-match "^cancel[\t ]+<[^\t\n @<>]+@[^\t\n @<>]+>"
+ control))
+ (setq id-for-lock nil)
+ (unless id-for-lock
+ (setq id-for-lock (mail-fetch-field "Message-ID"))))
+ (canlock-delete-headers)
+ (goto-char (point-max))))
+ (when news
+ (if (not (or id-for-key id-for-lock))
+ (message "There are no Message-ID(s)")
+ (unless password
+ (setq password (or canlock-password
+ (read-passwd
+ "Password for Canlock: "))))
+ (if (or (not (stringp password)) (zerop (length password)))
+ (message "Password for Canlock is bad")
+ (setq key-for-key (when id-for-key
+ (canlock-make-cancel-key
+ id-for-key password))
+ key-for-lock (when id-for-lock
+ (canlock-make-cancel-key
+ id-for-lock password)))
+ (if (not (or key-for-key key-for-lock))
+ (message "Couldn't insert Canlock header")
+ (when key-for-key
+ (insert "Cancel-Key: sha1:" key-for-key "\n"))
+ (when key-for-lock
+ (insert "Cancel-Lock: sha1:"
+ (base64-encode-string (canlock-sha1 key-for-lock))
+ "\n")))))))))
+
+;;;###autoload
+(defun canlock-verify (&optional buffer)
+ "Verify Cancel-Lock or Cancel-Key in BUFFER.
+If BUFFER is nil, the current buffer is assumed. Signal an error if
+it fails."
+ (interactive)
+ (let (keys locks errmsg id-for-key id-for-lock password
+ key-for-key key-for-lock match)
+ (save-excursion
+ (when buffer
+ (set-buffer buffer))
+ (save-restriction
+ (widen)
+ (canlock-narrow-to-header)
+ (setq keys (canlock-fetch-fields 'key)
+ locks (canlock-fetch-fields))
+ (if (not (or keys locks))
+ (setq errmsg
+ "There are neither Cancel-Lock nor Cancel-Key headers")
+ (setq id-for-key (canlock-fetch-id-for-key)
+ id-for-lock (mail-fetch-field "Message-ID"))
+ (or id-for-key id-for-lock
+ (setq errmsg "There are no Message-ID(s)")))))
+ (if errmsg
+ (error "%s" errmsg)
+ (setq password (or canlock-password-for-verify
+ (read-passwd "Password for Canlock: ")))
+ (if (or (not (stringp password)) (zerop (length password)))
+ (error "Password for Canlock is bad")
+ (when keys
+ (when id-for-key
+ (setq key-for-key (canlock-make-cancel-key id-for-key password))
+ (while (and keys (not match))
+ (setq match (string-equal key-for-key (pop keys)))))
+ (setq keys (if match "good" "bad")))
+ (setq match nil)
+ (when locks
+ (when id-for-lock
+ (setq key-for-lock
+ (base64-encode-string
+ (canlock-sha1 (canlock-make-cancel-key id-for-lock
+ password))))
+ (when (and locks (not match))
+ (setq match (string-equal key-for-lock (pop locks)))))
+ (setq locks (if match "good" "bad")))
+ (prog1
+ (when (member "bad" (list keys locks))
+ "bad")
+ (cond ((and keys locks)
+ (message "Cancel-Key is %s, Cancel-Lock is %s" keys locks))
+ (locks
+ (message "Cancel-Lock is %s" locks))
+ (keys
+ (message "Cancel-Key is %s" keys))))))))
+
+(provide 'canlock)
+
+;;; arch-tag: 033c4f09-b9f1-459d-bd0d-254430283f78
+;;; canlock.el ends here
View
104 lisp/gnus/catchup.xpm
@@ -1,73 +1,33 @@
/* XPM */
-static char *magick[] = {
-/* columns rows colors chars-per-pixel */
-"24 24 43 1",
-" c Gray0",
-". c #099909990999",
-"X c Gray6",
-"o c #133313331333",
-"O c Gray9",
-"+ c Gray11",
-"@ c Gray12",
-"# c #23f323f323f3",
-"$ c Gray15",
-"% c #2ff12ff12ff1",
-"& c #3fff3fff3fff",
-"* c Gray25",
-"= c #4ccc4ccc4ccc",
-"- c #519151915191",
-"; c #53ed53ed53ed",
-": c #565b565b565b",
-"> c Gray35",
-", c #5b1a5b1a5b1a",
-"< c #5fe95fe95fe9",
-"1 c #626262626262",
-"2 c Gray40",
-"3 c #67e767e767e7",
-"4 c Gray42",
-"5 c #6fff6fff6fff",
-"6 c Gray45",
-"7 c Gray46",
-"8 c #77e977e977e9",
-"9 c #7bdb7bdb7bdb",
-"0 c #7ccc7ccc7ccc",
-"q c Gray50",
-"w c #866586658665",
-"e c Gray56",
-"r c Gray60",
-"t c #9bcb9bcb9bcb",
-"y c #9fff9fff9fff",
-"u c #a7c7a7c7a7c7",
-"i c #af0eaf0eaf0e",
-"p c Gray70",
-"a c Gray75",
-"s c Gray81",
-"d c #dfffdfffdfff",
-"f c #efffefffefff",
-"g c Gray100",
-/* pixels */
-"aaaaaaaaaaaaaaaaaaaaaaaa",
-"aaaaaaaaaaaaaaaaaaaaaaaa",
-"aaaaaaaaaaaaaaaaaaaaaaaa",
-"aaaaaa7$$*uaaaaaaaaareep",
-"aaaaaa$rr6<aaaaaaaae;==>",
-"aaaaaa7<r6<aaaaaaaa<6rr$",
-"9&&&&&&>6;aaaareeeee#rw*",
-"&aqqagga@<<<7e7qqqqqq=:u",
-"33e4qgggsaa%1Oa&&&ggge<a",
-"17a9ygf7%%%%#=$aa%ggga<a",
-"7aa&gga<aaaae$>ae7ggya<a",
-"aa;sgg;uaaaapepa<agg&a<a",
-"au;&&&%aaaaaaaae<aaa;a6.",
-"a<aggg%aaaaaaaa3qqq&e<:o",
-"r7<5gg%aaaaaaaaXyggqeaue",
-"6gs$6fa=re6666=s@egy3rrr",
-"ga>r=aa=r6 <qqdd3=yg&rrr",
-"&>er=aa=r6 aggg=wr&g&rrr",
-"rrrrr$a<:6 @$$$rri=d5qrr",
-"rrrrr<===6$wrrrrrr6&qo6r",
-"rrrrrrrrrewrrrrrrr6 oq",
-"rrrrrrrrrrrrrrrrrrrrrrrr",
-"rrrrrrrrrrrrrrrrrrrrrrrr",
-"rrrrrrrrrrrrrrrrrrrrrrrr"
-};
+static char * catchup_xpm[] = {
+"24 24 6 1",
+" c None",
+". c #FFFFFFFFFFFF",
+"X c #E1E1E0E0E0E0",
+"o c #A5A5A5A59595",
+"O c #999999999999",
+"+ c #000000000000",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" . ",
+" . .X ",
+" ... .oX . ",
+" ..oooX.oXo .X ",
+" .oooXXXX..oXXoXX ",
+" .oXXXX.XoX.oXooX ",
+" X...X.X.XX.XoXX ",
+" Xo..X.XXX.XXXX ",
+" . Xo.oXX..XXXXXX ",
+"OOOOXoXXXXXo.XXXXX++OOOO",
+"OOOOOX..X.XXXXXXXX++OOOO",
+"OOOOOX..XXXXXXXXX++OOOOO",
+"OOOOOOXXXXXXXXX+++OOOOOO",
+"OOOOOOOOOXXXX++++OOOOOOO",
+"OOOOOOOOO+++++OOOOOOOOOO",
+"OOOOOOOOOO+OOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOOOOOO"};
View
58 lisp/gnus/compface.el
@@ -0,0 +1,58 @@
+;;; compface.el --- functions for converting X-Face headers
+;; Copyright (C) 2002 Free Software Foundation, Inc.
+
+;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
+;; Keywords: news
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;;; Code:
+
+;;;###
+(defun uncompface (face)
+ "Convert FACE to pbm.
+Requires the external programs `uncompface', and `icontopbm'. On a
+GNU/Linux system these might be in packages with names like `compface'
+or `faces-xface' and `netpbm' or `libgr-progs', for instance."
+ (with-temp-buffer
+ (insert face)
+ (and (eq 0 (apply 'call-process-region (point-min) (point-max)
+ "uncompface"
+ 'delete '(t nil) nil))
+ (progn
+ (goto-char (point-min))
+ (insert "/* Width=48, Height=48 */\n")
+ ;; I just can't get "icontopbm" to work correctly on its
+ ;; own in XEmacs. And Emacs doesn't understand un-raw pbm
+ ;; files.
+ (if (not (featurep 'xemacs))
+ (eq 0 (call-process-region (point-min) (point-max)
+ "icontopbm"
+ 'delete '(t nil)))
+ (shell-command-on-region (point-min) (point-max)
+ "icontopbm | pnmnoraw"
+ (current-buffer) t)
+ t))
+ (buffer-string))))
+
+(provide 'compface)
+
+;;; arch-tag: f9c78e84-98c0-4142-9682-8ba4cf4c3441
+;;; compface.el ends here
View
20 lisp/gnus/cry.xpm
@@ -0,0 +1,20 @@
+/* XPM */
+static char * cry_xpm[] = {
+"13 14 3 1",
+" c None",
+". c #000000",
+"+ c #FFDD00",
+" ....... ",
+" ..+++++.. ",
+" .+++++++++. ",
+".+++++++++++.",
+".++..+++..++.",
+".++++++++.++.",
+".+++++++.+.+.",
+".+++++++.+.+.",
+".++++++++..+.",
+".+++.....+++.",
+".++.+++++.++.",
+" .+++++++++. ",
+" ..+++++.. ",
+" ....... "};
View
93 lisp/gnus/cu-exit.xpm
@@ -1,64 +1,31 @@
/* XPM */
-static char *magick[] = {
-/* columns rows colors chars-per-pixel */
-"24 24 34 1",
-" c Gray0",
-". c #0bfb0bfb0bfb",
-"X c Gray6",
-"o c Gray9",
-"O c Gray11",
-"+ c Gray12",
-"@ c #23f323f323f3",
-"# c Gray15",
-"$ c #2ff52ff52ff5",
-"% c #3fff3fff3fff",
-"& c Gray25",
-"* c Gray28",
-"= c #4ccc4ccc4ccc",
-"- c #53e853e853e8",
-"; c #5b1a5b1a5b1a",
-": c #5fef5fef5fef",
-"> c #67e767e767e7",
-", c Gray42",
-"< c #6ff76ff76ff7",
-"1 c #77dc77dc77dc",
-"2 c Gray50",
-"3 c #866586658665",
-"4 c #88a888a888a8",
-"5 c Gray56",
-"6 c Gray60",
-"7 c #9bcb9bcb9bcb",
-"8 c #9fff9fff9fff",
-"9 c #a7d7a7d7a7d7",
-"0 c Gray70",
-"q c #b635b635b635",
-"w c Gray75",
-"e c Gray78",
-"r c #dfffdfffdfff",
-"t c Gray100",
-/* pixels */
-"wwwwwwwwwwwwwwwwwwwwwwww",
-"wwwwwwwwwwwwwwwwwwwwwwww",
-"wwwwwwwwwwwwwwwwwwwwwwww",
-"wwwwwwwwwwwwwwwwwwwwwwww",
-"wwwwwwwwwwwwwwwwwwwwwwww",
-"wwwwwwwwwww-$$$-wwwwwwww",
-"wwwwwww9-$w$ttt$wwwwwwww",
-"wwwwww:<ro:1ttto::wwwwww",
-"wwww1$wrt5 wttt$w$$1wwww",
-"wwww1.ttt5 5ww$ttt.1wwww",
-"wwwww$8tt+222% 222$wwwww",
-"wwwww$%tt%ttt2 ww$6wwwww",
-"wwwww$52t%ttt2wtt%wwwwww",
-"wwwww1 %r%ttt2w22>wwwwww",
-"wwwwww,::X%%%+$w:5wwwwww",
-"qqqqqq4*5%t%t255;qqqqqqq",
-"6666663#*+2+2%**=6666666",
-"6666666=0$w$0*0&36666666",
-"6666666=,$9@5*,#66666666",
-"6666666= +% 2% #66666666",
-"6666666= %e@<2 #66666666",
-"6666666:# +666666666",
-"666666666=====3666666666",
-"666666666666666666666666"
-};
+static char * cu_exit_xpm[] = {
+"24 24 4 1",
+" c None",
+". c #000000000000",
+"X c #FFFFFFFFFFFF",
+"o c #999999999999",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ..... ",
+" .. .XXX. ",
+" ..X..XXXX... ",
+" .XXXX.XXXX.X... ",
+" ..XXXX.XXX.XXX.. ",
+" .XXX.......... ",
+" .XXX.XXX.XXX.. ",
+" .XX.XXX.XXX. ",
+" .XX.XXX.XX.. ",
+" ............ ",
+" .X.X.X.X.. ",
+"ooooooo..........ooooooo",
+"ooooooo.X.X.X.X.oooooooo",
+"ooooooo.........oooooooo",
+"ooooooo..X...X..oooooooo",
+"ooooooo...X.X...oooooooo",
+"ooooooo........ooooooooo",
+"ooooooooo.....oooooooooo",
+"oooooooooooooooooooooooo"};
View
20 lisp/gnus/dead.xpm
@@ -0,0 +1,20 @@
+/* XPM */
+static char * dead_xpm[] = {
+"13 14 3 1",
+" c None",
+". c #000000",
+"+ c #FFDD00",
+" ....... ",
+" ..+++++.. ",
+" .+++++++++. ",
+".+++++++++++.",
+".++.+.+.+.++.",
+".+++.+++.+++.",
+".++.+.+.+.++.",
+".+++++++++++.",
+".+++++++++++.",
+".+.+++++++.+.",
+".++.......++.",
+" .+++++++++. ",
+" ..+++++.. ",
+" ....... "};
View
102 lisp/gnus/describe-group.xpm
@@ -1,72 +1,32 @@
/* XPM */
-static char *magick[] = {
-/* columns rows colors chars-per-pixel */
-"24 24 42 1",
-" c Gray0",
-". c #099909990999",
-"X c #0bfb0bfb0bfb",
-"o c #133313331333",
-"O c Gray9",
-"+ c Gray11",
-"@ c #23f323f323f3",
-"# c Gray15",
-"$ c #2d8d2d8d2d8d",
-"% c #399939993999",
-"& c #433243324332",
-"* c #4ccc4ccc4ccc",
-"= c #519151915191",
-"- c #53e353e353e3",
-"; c #565656565656",
-": c Gray36",
-"> c #5fdf5fdf5fdf",
-", c Gray42",
-"< c #6fff6fff6fff",
-"1 c Gray45",
-"2 c #77f777f777f7",
-"3 c #7ccc7ccc7ccc",
-"4 c Gray50",
-"5 c #865a865a865a",
-"6 c Gray58",
-"7 c Gray60",
-"8 c #9bfb9bfb9bfb",
-"9 c Gray62",
-"0 c #9fff9fff9fff",
-"q c #a0c0a0c0a0c0",
-"w c Gray64",
-"e c Gray65",
-"r c Gray70",
-"t c #b635b635b635",
-"y c Gray73",
-"u c Gray75",
-"i c #d332d332d332",
-"p c Gray85",
-"a c #e665e665e665",
-"s c #eccbeccbeccb",
-"d c #f998f998f998",
-"f c Gray100",
-/* pixels */
-"&77&77&77&77&77&77&77&77",
-"777777777777777777777777",
-"77777777777777777iaaa777",
-"&77&77&77&77&77<ff<fffp0",
-"77777777777777uffffffffp",
-"7777777777777udfffffffff",
-"&77&77&77&77<ff<ff<ff<ff",
-"777777777777ffffffffffff",
-"777777777777ffffffffffff",
-"&77&77&77&77<ff<ff<ff<ff",
-"777777777777ffffffffffff",
-"777777777777ffffffffffff",
-"&77&77&77&77:ff<ff<ff<ff",
-"777777777777rfffffffffff",
-"77777&##37770pffffffffff",
-"&77%-6ty-#77&7i<ff<ff<fs",
-"777*5w7wy*17777pffffffae",
-"777$13&7w+*77770rsfffre7",
-"&73X:@3*1 *7&77&77&77&77",
-"71o2;o***o17777777777777",
-"3o,**X%*X377777777777777",
-"XO, +##3&77&77&77&77&77",
-":;o #50w7777777777777777",
-"@oX+57707777777777777777"
-};
+static char * describe_group_xpm[] = {
+"24 24 5 1",
+". c None",
+" c #000000000000",
+"o c #FFFFF5F5ACAC",
+"+ c #E1E1E0E0E0E0",
+"@ c #C7C7C6C6C6C6",
+"........................",
+"........................",
+".................oooo...",
+" .. .. .. .. .. oo oo o.",
+"..............oooooooooo",
+".............ooooooooooo",
+" .. .. .. .. oo oo oo oo",
+"............oooooooooooo",
+"............oooooooooooo",
+" .. .. .. .. oo oo oo oo",
+"............oooooooooooo",
+"............oooooooooooo",
+" .. .. .. .. oo oo oo oo",
+"............oooooooooooo",
+"..... ...oooooooooooo",
+" .. ++ .. .o oo oo oo",
+"... @@@+ ....ooooooooo",
+"... @ ....oooooooo.",
+" . . .. .. .. ..",
+". ..............",
+" ................",
+" .. .. .. .. .. ..",
+" ..................",
+" ...................."};
View
472 lisp/gnus/deuglify.el
@@ -0,0 +1,472 @@
+;;; deuglify.el --- deuglify broken Outlook (Express) articles
+
+;; Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2002 Raymond Scholz
+
+;; Author: Raymond Scholz <rscholz@zonix.de>
+;; Thomas Steffen (unwrapping algorithm,
+;; based on an idea of Stefan Monnier)
+;; Keywords: mail, news
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; This file enables Gnus to repair broken citations produced by
+;; common user agents like MS Outlook (Express). It may repair
+;; articles of other user agents too.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;
+;; Outlook sometimes wraps cited lines before sending a message as
+;; seen in this example:
+;;
+;; Example #1
+;; ----------
+;;
+;; John Doe wrote:
+;;
+;; > This sentence no verb. This sentence no verb. This sentence
+;; no
+;; > verb. This sentence no verb. This sentence no verb. This
+;; > sentence no verb.
+;;
+;; The function `gnus-article-outlook-unwrap-lines' tries to recognize those
+;; erroneously wrapped lines and will unwrap them. I.e. putting the
+;; wrapped parts ("no" in this example) back where they belong (at the
+;; end of the cited line above).
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Note that some people not only use broken user agents but also
+;; practice a bad citation style by omitting blank lines between the
+;; cited text and their own text.
+;:
+;; Example #2
+;; ----------
+;;
+;; John Doe wrote:
+;;
+;; > This sentence no verb. This sentence no verb. This sentence no
+;; You forgot in all your sentences.
+;; > verb. This sentence no verb. This sentence no verb. This
+;; > sentence no verb.
+;;
+;; Unwrapping "You forgot in all your sentences." would be illegal as
+;; this part wasn't intended to be cited text.
+;; `gnus-article-outlook-unwrap-lines' will only unwrap lines if the resulting
+;; citation line will be of a certain maximum length. You can control
+;; this by adjusting `gnus-outlook-deuglify-unwrap-max'. Also
+;; unwrapping will only be done if the line above the (possibly)
+;; wrapped line has a minimum length of `gnus-outlook-deuglify-unwrap-min'.
+;;
+;; Furthermore no unwrapping will be undertaken if the last character
+;; is one of the chars specified in
+;; `gnus-outlook-deuglify-unwrap-stop-chars'. Setting this to ".?!"
+;; inhibits unwrapping if the cited line ends with a full stop,
+;; question mark or exclamation mark. Note that this variable
+;; defaults to `nil', triggering a few false positives but generally
+;; giving you better results.
+;;
+;; Unwrapping works on every level of citation. Thus you will be able
+;; repair broken citations of broken user agents citing broken
+;; citations of broken user agents citing broken citations...
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Citations are commonly introduced with an attribution line
+;; indicating who wrote the cited text. Outlook adds superfluous
+;; information that can be found in the header of the message to this
+;; line and often wraps it.
+;;
+;; If that weren't enough, lots of people write their own text above
+;; the cited text and cite the complete original article below.
+;;
+;; Example #3
+;; ----------
+;;
+;; Hey, John. There's no in all your sentences!
+;;
+;; John Doe <john.doe@some.domain> wrote in message
+;; news:a87usw8$dklsssa$2@some.news.server...
+;; > This sentence no verb. This sentence no verb. This sentence
+;; no
+;; > verb. This sentence no verb. This sentence no verb. This
+;; > sentence no verb.
+;; >
+;; > Bye, John
+;;
+;; Repairing the attribution line will be done by function
+;; `gnus-article-outlook-repair-attribution which calls other function that
+;; try to recognize and repair broken attribution lines. See variable
+;; `gnus-outlook-deuglify-attrib-cut-regexp' for stuff that should be
+;; cut off from the beginning of an attribution line and variable
+;; `gnus-outlook-deuglify-attrib-verb-regexp' for the verbs that are
+;; required to be found in an attribution line. These function return
+;; the point where the repaired attribution line starts.
+;;
+;; Rearranging the article so that the cited text appears above the
+;; new text will be done by function
+;; `gnus-article-outlook-rearrange-citation'. This function calls
+;; `gnus-article-outlook-repair-attribution to find and repair an attribution
+;; line.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Well, and that's what the message will look like after applying
+;; deuglification:
+;;
+;; Example #3 (deuglified)
+;; -----------------------
+;;
+;; John Doe <john.doe@some.domain> wrote:
+;;
+;; > This sentence no verb. This sentence no verb. This sentence no
+;; > verb. This sentence no verb. This sentence no verb. This
+;; > sentence no verb.
+;; >
+;; > Bye, John
+;;
+;; Hey, John. There's no in all your sentences!
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Usage
+;; -----
+;;
+;; Press `W k' in the Summary Buffer.
+;;
+;; Non recommended usage :-)
+;; ---------------------
+;;
+;; To automatically invoke deuglification on every article you read,
+;; put something like that in your .gnus:
+;;
+;; (add-hook 'gnus-article-decode-hook 'gnus-article-outlook-unwrap-lines)
+;;
+;; or _one_ of the following lines:
+;;
+;; ;; repair broken attribution lines
+;; (add-hook 'gnus-article-decode-hook 'gnus-article-outlook-repair-attribution)
+;;
+;; ;; repair broken attribution lines and citations
+;; (add-hook 'gnus-article-decode-hook 'gnus-article-outlook-rearrange-citation)
+;;
+;; Note that there always may be some false positives, so I suggest
+;; using the manual invocation. After deuglification you may want to
+;; refill the whole article using `W w'.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Limitations
+;; -----------
+;;
+;; As I said before there may (or will) be a few false positives on
+;; unwrapping cited lines with `gnus-article-outlook-unwrap-lines'.
+;;
+;; `gnus-article-outlook-repair-attribution will only fix the first
+;; attribution line found in the article. Furthermore it fixed to
+;; certain kinds of attributions. And there may be horribly many
+;; false positives, vanishing lines and so on -- so don't trust your
+;; eyes. Again I recommend manual invocation.
+;;
+;; `gnus-article-outlook-rearrange-citation' carries all the limitations of
+;; `gnus-article-outlook-repair-attribution.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; See ChangeLog for other changes.
+;;
+;; Revision 1.5 2002/01/27 14:39:17 rscholz
+;; * New variable `gnus-outlook-deuglify-no-wrap-chars' to inhibit
+;; unwrapping if one these chars is first in the possibly wrapped line.
+;; * Improved rearranging of the article.
+;; * New function `gnus-outlook-repair-attribution-block' for repairing
+;; those big "Original Message (following some headers)" attributions.
+;;
+;; Revision 1.4 2002/01/03 14:05:00 rscholz
+;; Renamed `gnus-outlook-deuglify-article' to
+;; `gnus-article-outlook-deuglify-article'.
+;; Made it easier to deuglify the article while being in Gnus' Article
+;; Edit Mode. (suggested by Phil Nitschke)
+;;
+;;
+;; Revision 1.3 2002/01/02 23:35:54 rscholz
+;; Fix a bug that caused succeeding long attribution lines to be
+;; unwrapped. Minor doc fixes and regular expression tuning.
+;;
+;; Revision 1.2 2001/12/30 20:14:34 rscholz
+;; Clean up source.
+;;
+;; Revision 1.1 2001/12/30 20:13:32 rscholz
+;; Initial revision
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;;; Code:
+
+(require 'gnus-art)
+(require 'gnus-sum)
+
+(defconst gnus-outlook-deuglify-version "1.5 Gnus version"
+ "Version of gnus-outlook-deuglify.")
+
+;;; User Customizable Variables:
+
+(defgroup gnus-outlook-deuglify nil
+ "Deuglify articles generated by broken user agents like MS Outlook (Express).")
+
+;;;###autoload
+(defcustom gnus-outlook-deuglify-unwrap-min 45
+ "Minimum length of the cited line above the (possibly) wrapped line."
+ :type 'integer
+ :group 'gnus-outlook-deuglify)
+
+;;;###autoload
+(defcustom gnus-outlook-deuglify-unwrap-max 95
+ "Maximum length of the cited line after unwrapping."
+ :type 'integer
+ :group 'gnus-outlook-deuglify)
+
+(defcustom gnus-outlook-deuglify-cite-marks ">|#%"
+ "Characters that indicate cited lines."
+ :type 'string
+ :group 'gnus-outlook-deuglify)
+
+(defcustom gnus-outlook-deuglify-unwrap-stop-chars nil ;; ".?!" or nil
+ "Characters that inhibit unwrapping if they are the last one on the cited line above the possible wrapped line."
+ :type '(radio (const :format "None " nil)
+ (string :size 0 :value ".?!"))
+ :group 'gnus-outlook-deuglify)
+
+(defcustom gnus-outlook-deuglify-no-wrap-chars "`"
+ "Characters that inhibit unwrapping if they are the first one in the possibly wrapped line."
+ :type 'string
+ :group 'gnus-outlook-deuglify)
+
+(defcustom gnus-outlook-deuglify-attrib-cut-regexp
+ "\\(On \\|Am \\)?\\(Mon\\|Tue\\|Wed\\|Thu\\|Fri\\|Sat\\|Sun\\),[^,]+, "
+ "Regular expression matching the beginning of an attribution line that should be cut off."
+ :type 'string
+ :group 'gnus-outlook-deuglify)
+
+(defcustom gnus-outlook-deuglify-attrib-verb-regexp
+ "wrote\\|writes\\|says\\|schrieb\\|schreibt\\|meinte\\|skrev\\|a écrit\\|schreef\\|escribió"
+ "Regular expression matching the verb used in an attribution line."
+ :type 'string
+ :group 'gnus-outlook-deuglify)
+
+(defcustom gnus-outlook-deuglify-attrib-end-regexp
+ ": *\\|\\.\\.\\."
+ "Regular expression matching the end of an attribution line."
+ :type 'string
+ :group 'gnus-outlook-deuglify)
+
+;;;###autoload
+(defcustom gnus-outlook-display-hook nil
+ "A hook called after an deuglified article has been prepared.
+It is run after `gnus-article-prepare-hook'."
+ :type 'hook
+ :group 'gnus-outlook-deuglify)
+
+;; Functions
+
+(defun gnus-outlook-display-article-buffer ()
+ "Redisplay current buffer or article buffer."
+ (with-current-buffer (or gnus-article-buffer (current-buffer))
+ ;; "Emulate" `gnus-article-prepare-display' without calling
+ ;; it. Calling `gnus-article-prepare-display' on an already
+ ;; prepared article removes all MIME parts. I'm unsure whether
+ ;; this is a bug or not.
+ (gnus-article-highlight t)
+ (gnus-treat-article nil)
+ (gnus-run-hooks 'gnus-article-prepare-hook
+ 'gnus-outlook-display-hook)))
+
+;;;###autoload
+(defun gnus-article-outlook-unwrap-lines (&optional nodisplay)
+ "Unwrap lines that appear to be wrapped citation lines.
+You can control what lines will be unwrapped by frobbing
+`gnus-outlook-deuglify-unwrap-min' and `gnus-outlook-deuglify-unwrap-max',
+indicating the minimum and maximum length of an unwrapped citation line. If
+NODISPLAY is non-nil, don't redisplay the article buffer."
+ (interactive "P")
+ (save-excursion
+ (let ((case-fold-search nil)
+ (inhibit-read-only t)
+ (cite-marks gnus-outlook-deuglify-cite-marks)
+ (no-wrap gnus-outlook-deuglify-no-wrap-chars)
+ (stop-chars gnus-outlook-deuglify-unwrap-stop-chars))
+ (gnus-with-article-buffer
+ (article-goto-body)
+ (while (re-search-forward
+ (concat
+ "^\\([ \t" cite-marks "]*\\)"
+ "\\([" cite-marks "].*[^\n " stop-chars "]\\)[ \t]?\n"
+ "\\1\\([^\n " cite-marks no-wrap "]+.*\\)$")
+ nil t)
+ (let ((len12 (- (match-end 2) (match-beginning 1)))
+ (len3 (- (match-end 3) (match-beginning 3))))
+ (if (and (> len12 gnus-outlook-deuglify-unwrap-min)
+ (< (+ len12 len3) gnus-outlook-deuglify-unwrap-max))
+ (progn
+ (replace-match "\\1\\2 \\3")
+ (goto-char (match-beginning 0)))))))))
+ (unless nodisplay (gnus-outlook-display-article-buffer)))
+
+(defun gnus-outlook-rearrange-article (attr-start)
+ "Put the text from ATTR-START to the end of buffer at the top of the article buffer."
+ (save-excursion
+ (let ((inhibit-read-only t)
+ (cite-marks gnus-outlook-deuglify-cite-marks))
+ (gnus-with-article-buffer
+ (article-goto-body)
+ ;; article does not start with attribution
+ (unless (= (point) attr-start)
+ (gnus-kill-all-overlays)
+ (let ((cur (point))
+ ;; before signature or end of buffer
+ (to (if (gnus-article-search-signature)
+ (point)
+ (point-max))))
+ ;; handle the case where the full quote is below the
+ ;; signature
+ (if (< to attr-start)
+ (setq to (point-max)))
+ (transpose-regions cur attr-start attr-start to)))))))
+
+;; John Doe <john.doe@some.domain> wrote in message
+;; news:a87usw8$dklsssa$2@some.news.server...
+
+(defun gnus-outlook-repair-attribution-outlook ()
+ "Repair a broken attribution line (Outlook)."
+ (save-excursion
+ (let ((case-fold-search nil)
+ (inhibit-read-only t)
+ (cite-marks gnus-outlook-deuglify-cite-marks))
+ (gnus-with-article-buffer
+ (article-goto-body)
+ (if (re-search-forward
+ (concat "^\\([^" cite-marks "].+\\)"
+ "\\(" gnus-outlook-deuglify-attrib-verb-regexp "\\)"
+ "\\(.*\n?[^\n" cite-marks "].*\\)?"
+ "\\(" gnus-outlook-deuglify-attrib-end-regexp "\\)$")
+ nil t)
+ (progn
+ (gnus-kill-all-overlays)
+ (replace-match "\\1\\2\\4")
+ (match-beginning 0)))))))
+
+
+;; ----- Original Message -----
+;; From: "John Doe" <john.doe@some.domain>
+;; To: "Doe Foundation" <info@doefnd.org>
+;; Sent: Monday, November 19, 2001 12:13 PM
+;; Subject: More Doenuts
+
+(defun gnus-outlook-repair-attribution-block ()
+ "Repair a big broken attribution block."
+ (save-excursion
+ (let ((case-fold-search nil)
+ (inhibit-read-only t)
+ (cite-marks gnus-outlook-deuglify-cite-marks))
+ (gnus-with-article-buffer
+ (article-goto-body)
+ (if (re-search-forward
+ (concat "^[" cite-marks " \t]*--* ?[^-]+ [^-]+ ?--*\\s *\n"
+ "[^\n:]+:[ \t]*\\([^\n]+\\)\n"
+ "\\([^\n:]+:[ \t]*[^\n]+\n\\)+")
+ nil t)
+ (progn
+ (gnus-kill-all-overlays)
+ (replace-match "\\1 wrote:\n")
+ (match-beginning 0)))))))
+
+;; On Wed, 16 Jan 2002 23:23:30 +0100, John Doe <john.doe@some.domain> wrote:
+
+(defun gnus-outlook-repair-attribution-other ()
+ "Repair a broken attribution line (other user agents than Outlook)."
+ (save-excursion
+ (let ((case-fold-search nil)
+ (inhibit-read-only t)
+ (cite-marks gnus-outlook-deuglify-cite-marks))
+ (gnus-with-article-buffer
+ (article-goto-body)
+ (if (re-search-forward
+ (concat "^\\("gnus-outlook-deuglify-attrib-cut-regexp"\\)?"
+ "\\([^" cite-marks "].+\\)\n\\([^\n" cite-marks "].*\\)?"
+ "\\(" gnus-outlook-deuglify-attrib-verb-regexp "\\).*"
+ "\\(" gnus-outlook-deuglify-attrib-end-regexp "\\)$")
+ nil t)
+ (progn
+ (gnus-kill-all-overlays)
+ (replace-match "\\4 \\5\\6\\7")
+ (match-beginning 0)))))))
+
+;;;###autoload
+(defun gnus-article-outlook-repair-attribution (&optional nodisplay)
+ "Repair a broken attribution line.
+If NODISPLAY is non-nil, don't redisplay the article buffer."
+ (interactive "P")
+ (let ((attrib-start
+ (or
+ (gnus-outlook-repair-attribution-other)
+ (gnus-outlook-repair-attribution-block)
+ (gnus-outlook-repair-attribution-outlook))))
+ (unless nodisplay (gnus-outlook-display-article-buffer))
+ attrib-start))
+
+(defun gnus-article-outlook-rearrange-citation (&optional nodisplay)
+ "Repair broken citations.
+If NODISPLAY is non-nil, don't redisplay the article buffer."
+ (interactive "P")
+ (let ((attrib-start (gnus-article-outlook-repair-attribution 'nodisplay)))
+ ;; rearrange citations if an attribution line has been recognized
+ (if attrib-start
+ (gnus-outlook-rearrange-article attrib-start)))
+ (unless nodisplay (gnus-outlook-display-article-buffer)))
+
+;;;###autoload
+(defun gnus-outlook-deuglify-article (&optional nodisplay)
+ "Full deuglify of broken Outlook (Express) articles.
+Treat dumbquotes, unwrap lines, repair attribution and rearrange citation. If
+NODISPLAY is non-nil, don't redisplay the article buffer."
+ (interactive "P")
+ ;; apply treatment of dumb quotes
+ (gnus-article-treat-dumbquotes)
+ ;; repair wrapped cited lines
+ (gnus-article-outlook-unwrap-lines 'nodisplay)
+ ;; repair attribution line and rearrange citation.
+ (gnus-article-outlook-rearrange-citation 'nodisplay)
+ (unless nodisplay (gnus-outlook-display-article-buffer)))
+
+;;;###autoload
+(defun gnus-article-outlook-deuglify-article ()
+ "Deuglify broken Outlook (Express) articles and redisplay."
+ (interactive)
+ (gnus-outlook-deuglify-article nil))
+
+(provide 'deuglify)
+
+;; Local Variables:
+;; coding: iso-8859-1
+;; End:
+
+;;; arch-tag: 5f895cc9-51a9-487c-b42e-28844d79eb73
+;;; deuglify.el ends here
View
189 lisp/gnus/dig.el
@@ -0,0 +1,189 @@
+;;; dig.el --- Domain Name System dig interface
+;; Copyright (c) 2000, 2001, 2003 Free Software Foundation, Inc.
+
+;; Author: Simon Josefsson <simon@josefsson.org>
+;; Keywords: DNS BIND dig
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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 2, or (at your
+;; option) any later version.
+
+;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; This provide an interface for "dig".
+;;
+;; For interactive use, try M-x dig and type a hostname. Use `q' to quit
+;; dig buffer.
+;;
+;; For use in elisp programs, call `dig-invoke' and use
+;; `dig-extract-rr' to extract resource records.
+
+;;; Release history:
+
+;; 2000-10-28 posted on gnu.emacs.sources
+
+;;; Code:
+
+(eval-when-compile (require 'cl))
+
+(defgroup dig nil
+ "Dig configuration.")
+
+(defcustom dig-program "dig"
+ "Name of dig (domain information groper) binary."
+ :type 'file
+ :group 'dig)
+
+(defcustom dig-dns-server nil
+ "DNS server to query.
+If nil, use system defaults."
+ :type '(choice (const :tag "System defaults")
+ string)
+ :group 'dig)
+
+(defcustom dig-font-lock-keywords
+ '(("^;; [A-Z]+ SECTION:" 0 font-lock-keyword-face)
+ ("^;;.*" 0 font-lock-comment-face)
+ ("^; <<>>.*" 0 font-lock-type-face)
+ ("^;.*" 0 font-lock-function-name-face))
+ "Default expressions to highlight in dig mode."
+ :type 'sexp
+ :group 'dig)
+
+(defun dig-invoke (domain &optional
+ query-type query-class query-option
+ dig-option server)
+ "Call dig with given arguments and return buffer containing output.
+DOMAIN is a string with a DNS domain. QUERY-TYPE is an optional string
+with a DNS type. QUERY-CLASS is an optional string with a DNS class.
+QUERY-OPTION is an optional string with dig \"query options\".
+DIG-OPTIONS is an optional string with parameters for the dig program.
+SERVER is an optional string with a domain name server to query.
+
+Dig is an external program found in the BIND name server distribution,
+and is a commonly available debugging tool."
+ (let (buf cmdline)
+ (setq buf (generate-new-buffer "*dig output*"))
+ (if dig-option (push dig-option cmdline))
+ (if query-option (push query-option cmdline))
+ (if query-class (push query-class cmdline))
+ (if query-type (push query-type cmdline))
+ (push domain cmdline)
+ (if server (push (concat "@" server) cmdline)
+ (if dig-dns-server (push (concat "@" dig-dns-server) cmdline)))
+ (apply 'call-process dig-program nil buf nil cmdline)
+ buf))
+
+(defun dig-extract-rr (domain &optional type class)
+ "Extract resource records for DOMAIN, TYPE and CLASS from buffer.
+Buffer should contain output generated by `dig-invoke'."
+ (save-excursion
+ (goto-char (point-min))
+ (if (re-search-forward
+ (concat domain "\\.?[\t ]+[0-9wWdDhHmMsS]+[\t ]+"
+ (upcase (or class "IN")) "[\t ]+" (upcase (or type "A")))
+ nil t)
+ (let (b e)
+ (end-of-line)
+ (setq e (point))
+ (beginning-of-line)
+ (setq b (point))
+ (when (search-forward " (" e t)
+ (search-forward " )"))
+ (end-of-line)
+ (setq e (point))
+ (buffer-substring b e))
+ (and (re-search-forward (concat domain "\\.?[\t ]+[0-9wWdDhHmMsS]+[\t ]+"
+ (upcase (or class "IN"))
+ "[\t ]+CNAME[\t ]+\\(.*\\)$") nil t)
+ (dig-extract-rr (match-string 1) type class)))))
+
+(defun dig-rr-get-pkix-cert (rr)
+ (let (b e str)
+ (string-match "[^\t ]+[\t ]+[0-9wWdDhHmMsS]+[\t ]+IN[\t ]+CERT[\t ]+\\(1\\|PKIX\\)[\t ]+[0-9]+[\t ]+[0-9]+[\t ]+(?" rr)
+ (setq b (match-end 0))
+ (string-match ")" rr)
+ (setq e (match-beginning 0))
+ (setq str (substring rr b e))
+ (while (string-match "[\t \n\r]" str)
+ (setq str (replace-match "" nil nil str)))
+ str))
+
+;; XEmacs does it like this. For Emacs, we have to set the
+;; `font-lock-defaults' buffer-local variable.
+(put 'dig-mode 'font-lock-defaults '(dig-font-lock-keywords t))
+
+(put 'dig-mode 'mode-class 'special)
+
+(defvar dig-mode-map nil)
+(unless dig-mode-map
+ (setq dig-mode-map (make-sparse-keymap))
+ (suppress-keymap dig-mode-map)
+
+ (define-key dig-mode-map "q" 'dig-exit))
+
+(defun dig-mode ()
+ "Major mode for displaying dig output."
+ (interactive)
+ (kill-all-local-variables)
+ (setq mode-name "dig")
+ (setq major-mode 'dig-mode)
+ (use-local-map dig-mode-map)
+ (buffer-disable-undo)
+ (unless (featurep 'xemacs)
+ (set (make-local-variable 'font-lock-defaults)
+ '(dig-font-lock-keywords t)))
+ (when (featurep 'font-lock)
+ (font-lock-set-defaults)))
+
+(defun dig-exit ()
+ "Quit dig output buffer."
+ (interactive)
+ (kill-buffer (current-buffer)))
+
+(defun dig (domain &optional
+ query-type query-class query-option dig-option server)
+ "Query addresses of a DOMAIN using dig, by calling `dig-invoke'.
+Optional arguments are passed to `dig-invoke'."
+ (interactive "sHost: ")
+ (switch-to-buffer
+ (dig-invoke domain query-type query-class query-option dig-option server))
+ (goto-char (point-min))
+ (and (search-forward ";; ANSWER SECTION:" nil t)
+ (forward-line))
+ (dig-mode)
+ (setq buffer-read-only t)
+ (set-buffer-modified-p nil))
+
+;; named for consistency with query-dns in dns.el
+(defun query-dig (domain &optional
+ query-type query-class query-option dig-option server)
+ "Query addresses of a DOMAIN using dig.
+It works by calling `dig-invoke' and `dig-extract-rr'. Optional
+arguments are passed to `dig-invoke' and `dig-extract-rr'. Returns
+nil for domain/class/type queries that results in no data."
+(let ((buffer (dig-invoke domain query-type query-class
+ query-option dig-option server)))
+ (when buffer
+ (switch-to-buffer buffer)
+ (let ((digger (dig-extract-rr domain query-type query-class)))
+ (kill-buffer buffer)
+ digger))))
+
+(provide 'dig)
+
+;;; arch-tag: 1d61726e-9400-4013-9ae7-4035e0c7f7d6
+;;; dig.el ends here
View
359 lisp/gnus/dns.el
@@ -0,0 +1,359 @@
+;;; dns.el --- Domain Name Service lookups
+;; Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+
+;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
+;; Keywords: network
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;;; Code:
+
+(eval-when-compile (require 'cl))
+
+(require 'mm-util)
+
+(defvar dns-timeout 5
+ "How many seconds to wait when doing DNS queries.")
+
+(defvar dns-servers nil
+ "Which DNS servers to query.
+If nil, /etc/resolv.conf will be consulted.")
+
+;;; Internal code:
+
+(defvar dns-query-types
+ '((A 1)
+ (NS 2)
+ (MD 3)
+ (MF 4)
+ (CNAME 5)
+ (SOA 6)
+ (MB 7)
+ (MG 8)
+ (MR 9)
+ (NULL 10)
+ (WKS 11)
+ (PRT 12)
+ (HINFO 13)
+ (MINFO 14)
+ (MX 15)
+ (TXT 16)
+ (AXFR 252)
+ (MAILB 253)
+ (MAILA 254)
+ (* 255))
+ "Names of query types and their values.")
+
+(defvar dns-classes
+ '((IN 1)
+ (CS 2)
+ (CH 3)
+ (HS 4))
+ "Classes of queries.")
+
+(defun dns-write-bytes (value &optional length)
+ (let (bytes)
+ (dotimes (i (or length 1))
+ (push (% value 256) bytes)
+ (setq value (/ value 256)))
+ (dolist (byte bytes)
+ (insert byte))))
+
+(defun dns-read-bytes (length)
+ (let ((value 0))
+ (dotimes (i length)
+ (setq value (logior (* value 256) (following-char)))
+ (forward-char 1))
+ value))
+
+(defun dns-get (type spec)
+ (cadr (assq type spec)))
+
+(defun dns-inverse-get (value spec)
+ (let ((found nil))
+ (while (and (not found)
+ spec)
+ (if (eq value (cadr (car spec)))
+ (setq found (caar spec))
+ (pop spec)))
+ found))
+
+(defun dns-write-name (name)
+ (dolist (part (split-string name "\\."))
+ (dns-write-bytes (length part))
+ (insert part))
+ (dns-write-bytes 0))
+
+(defun dns-read-string-name (string buffer)
+ (mm-with-unibyte-buffer
+ (insert string)
+ (goto-char (point-min))
+ (dns-read-name buffer)))
+
+(defun dns-read-name (&optional buffer)
+ (let ((ended nil)
+ (name nil)
+ length)
+ (while (not ended)
+ (setq length (dns-read-bytes 1))
+ (if (= 192 (logand length (lsh 3 6)))
+ (let ((offset (+ (* (logand 63 length) 256)
+ (dns-read-bytes 1))))
+ (save-excursion
+ (when buffer
+ (set-buffer buffer))
+ (goto-char (1+ offset))
+ (setq ended (dns-read-name buffer))))
+ (if (zerop length)
+ (setq ended t)
+ (push (buffer-substring (point)
+ (progn (forward-char length) (point)))
+ name))))
+ (if (stringp ended)
+ (if (null name)
+ ended
+ (concat (mapconcat 'identity (nreverse name) ".") "." ended))