+2005-09-11  Jari Aalto  <jari.aalto@cante.net>
+
+       * html2text.el: (html2text-replace-list): Add new entities.
+
 2005-09-11  Romain Francoise  <romain@orebokech.com>
 
+       * message.el (message-alternative-emails): Improve docstring.
+       (message-setup-1): Call `message-use-alternative-email-as-from'
+       after `message-setup-hook' to give it precedence over posting
+       styles, etc.
+       (message-use-alternative-email-as-from): Add docstring.  Remove
+       the original From header if present.
+
+       * nnml.el (nnml-compressed-files-size-threshold): New variable.
+       (nnml-save-mail): Use it.
+
        * gnus-uu.el (gnus-uu-mark-series): Return number of marked
-       articles.  New argument `silent'.
+       articles.  Add new argument `silent'.
        (gnus-uu-mark-all): Report the total number of marked articles.
 
 2005-09-10  Romain Francoise  <romain@orebokech.com>
        * gnus-uu.el (gnus-message-process-mark): Use gnus-message.
        (gnus-uu-mark-series): Likewise.
 
+2005-09-10  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * spam-report.el (spam-report-gmane): Fix generation of spam
+       report URL.
+
 2005-09-10  Simon Josefsson  <jas@extundo.com>
 
        * gnus-agent.el (gnus-agent-synchronize-flags): Make the default
 
 
        * spam.el: more compilation fixes for BBDB
 
-       * spam-stat.el added code from Alex Schroeder <alex@gnu.org>
+       * spam-stat.el: added code from Alex Schroeder <alex@gnu.org>
        (spam-stat-reduce-size): Interactive.
        (spam-stat-reset): New function.
        (spam-stat-save): Interactive.
 
 2001-12-05  Katsumi Yamaoka  <yamaoka@jpl.org>
 
-       * mm-view.wl (mm-inline-text): Decode a charset-encoded rich text.
+       * mm-view.el (mm-inline-text): Decode a charset-encoded rich text.
 
 2001-12-04 08:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
 
 (defvar html2text-format-single-element-list '(("hr" . html2text-clean-hr)))
 
 (defvar html2text-replace-list
-  '((" " . " ") (">" . ">") ("<" . "<") (""" . "\"")
-    ("&" . "&") ("'" . "'"))
+  '(("´" . "`")
+    ("&" . "&")
+    ("'" . "'")
+    ("¦" . "|")
+    ("¢" . "c")
+    ("ˆ" . "^")
+    ("©" . "(C)")
+    ("¤" . "(#)")
+    ("°" . "degree")
+    ("÷" . "/")
+    ("€" . "e")
+    ("½" . "1/2")
+    (">" . ">")
+    ("¿" . "?")
+    ("«" . "<<")
+    ("&ldquo" . "\"")
+    ("‹" . "(")
+    ("‘" . "`")
+    ("<" . "<")
+    ("—" . "--")
+    (" " . " ")
+    ("–" . "-")
+    ("‰" . "%%")
+    ("±" . "+-")
+    ("£" . "£")
+    (""" . "\"")
+    ("»" . ">>")
+    ("&rdquo" . "\"")
+    ("®" . "(R)")
+    ("›" . ")")
+    ("’" . "'")
+    ("§" . "§")
+    ("¹" . "^1")
+    ("²" . "^2")
+    ("³" . "^3")
+    ("˜" . "~"))
   "The map of entity to text.
 
 This is an alist were each element is a dotted pair consisting of an
 
                 (integer 1000000)))
 
 (defcustom message-alternative-emails nil
-  "A regexp to match the alternative email addresses.
-The first matched address (not primary one) is used in the From field."
+  "*Regexp matching alternative email addresses.
+The first address in the To, Cc or From headers of the original
+article matching this variable is used as the From field of
+outgoing messages.
+
+This variable has precedence over posting styles and anything that runs
+off `message-setup-hook'."
   :group 'message-headers
   :link '(custom-manual "(message)Message Headers")
   :type '(choice (const :tag "Always use primary" nil)
     (when message-default-mail-headers
       (insert message-default-mail-headers)
       (or (bolp) (insert ?\n)))
-    (save-restriction
-      (message-narrow-to-headers)
-      (if (and replybuffer
-              message-alternative-emails)
-         (message-use-alternative-email-as-from)))
     (when message-generate-headers-first
       (message-generate-headers
        (message-headers-to-generate
     ;; Generate hashcash headers for recipients already known
     (mail-add-payment-async))
   (run-hooks 'message-setup-hook)
+  ;; Do this last to give it precedence over posting styles, etc.
+  (when (message-mail-p)
+    (save-restriction
+      (message-narrow-to-headers)
+      (if message-alternative-emails
+         (message-use-alternative-email-as-from))))
   (message-position-point)
   (undo-boundary))
 
       (read-string prompt initial-contents))))
 
 (defun message-use-alternative-email-as-from ()
+  "Set From field of the outgoing message to the first matching
+address in `message-alternative-emails', looking at To, Cc and
+From headers in the original article."
   (require 'mail-utils)
   (let* ((fields '("To" "Cc" "From"))
         (emails
                emails nil))
       (pop emails))
     (unless (or (not email) (equal email user-mail-address))
+      (message-remove-header "From")
       (goto-char (point-max))
       (insert "From: " (let ((user-mail-address email)) (message-make-from))
              "\n"))))
 
 (defvoo nnml-use-compressed-files nil
   "If non-nil, allow using compressed message files.")
 
+(defvoo nnml-compressed-files-size-threshold 1000
+  "Default size threshold for compressed message files.
+Message files with bodies larger than that many characters will
+be automatically compressed if `nnml-use-compressed-files' is
+non-nil.")
+
 \f
 
 (defconst nnml-version "nnml 1.0"
     (setq chars (nnmail-insert-lines))
     (setq extension
          (and nnml-use-compressed-files
-              (> chars 1000)
+             (> chars nnml-compressed-files-size-threshold)
               ".gz"))
     (nnmail-insert-xref group-art)
     (run-hooks 'nnmail-prepare-save-mail-hook)
 
                         (match-string 1 field)))
            (setq report (match-string 2 field))
            (when (string-equal "permalink.gmane.org" host)
-             (setq host "spam.gmane.org"))
+             (setq host "spam.gmane.org")
+             (setq report (gnus-replace-in-string
+                           report "/\\([0-9]+\\)$" ":\\1")))
            (setq url (format "http://%s%s" host report))
            (if (not (and host report url))
                (gnus-message
 
+2005-09-11  Romain Francoise  <romain@orebokech.com>
+
+       * message.texi (Message Headers): Explain what
+       `message-alternative-emails' does in more detail.
+
+       * gnus.texi (Mail Spool): Mention that `nnml-use-compressed-files'
+       requires `auto-compression-mode' to be enabled.  Add new nnml
+       variable `nnml-compressed-files-size-threshold'.
+
 2005-09-07  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * gnus.texi (Sorting the Summary Buffer): Added
 
 
 @item nnml-use-compressed-files
 @vindex nnml-use-compressed-files
-\e$BHs\e(B-@code{nil} \e$B$@$C$?$i\e(B @code{nnml} \e$B$O05=L$5$l$?%a%C%;!<%8%U%!%$%k$r;H$&\e(B
-\e$B$3$H$r9MN8$KF~$l$^$9!#\e(B
+\e$BHs\e(B-@code{nil} \e$B$@$C$?$i\e(B @code{nnml} \e$B$O%a%C%;!<%8%U%!%$%k$r05=L$7$^$9!#$?\e(B
+\e$B$@$7\e(B @code{auto-compression-mode} \e$B$,M-8z$K$J$C$F$$$J$1$l$P$J$j$^$;\e(B
+\e$B$s\e(B (@pxref{Compressed Files, ,Compressed Files, emacs, The Emacs
+Manual})\e$B!#\e(B
+
+@item nnml-compressed-files-size-threshold
+@vindex nnml-compressed-files-size-threshold
+\e$B%a%C%;!<%8%U%!%$%k$r05=L$9$k$+$I$&$+$rH=CG$9$k$?$a$N!"%5%$%:$NogCM$G$9!#\e(B
+@code{nnml-use-compressed-files} \e$B$,Hs\e(B-@code{nil} \e$B$K@_Dj$5$l$F$$$F!"K\J8\e(B
+\e$B$NJ8;z?t$,$3$NJQ?t$NCM$h$jBg$-$+$C$?$i!"%a%C%;!<%8%U%!%$%k$O05=L$5$l$^$9!#\e(B
 @end table
 
 @findex nnml-generate-nov-databases
 
 @item nnml-use-compressed-files
 @vindex nnml-use-compressed-files
 If non-@code{nil}, @code{nnml} will allow using compressed message
-files.
+files.  This variable requires @code{auto-compression-mode} to be
+enabled (@pxref{Compressed Files, ,Compressed Files, emacs, The Emacs
+Manual})
+
+@item nnml-compressed-files-size-threshold
+@vindex nnml-compressed-files-size-threshold
+Default size threshold for compressed message files.  Message files with
+bodies larger than that many characters will be automatically compressed
+if @code{nnml-use-compressed-files} is non-nil.
 
 @end table
 
 
 
 @item message-alternative-emails
 @vindex message-alternative-emails
-\e$BBe$o$j$N%a!<%k%"%I%l%9$K9gCW$9$k@55,I=8=$G$9!#:G=i$K%^%C%A$7$?\e(B (\e$BBh0l5A$G\e(B
-\e$B$O$J$$\e(B) \e$B%"%I%l%9$,\e(B @code{From} \e$B%U%#!<%k%I$G;H$o$l$^$9!#\e(B
-(\e$BLuCm\e(B: To \e$B$+\e(B Cc \e$B$K$"$k%"%I%l%9$G!":G=i$K$3$N@55,I=8=$K9gCW$7!"\e(B
-\e$B$+$D\e(B @code{user-mail-address} \e$B$H$O0c$&$b$N$,!"\e(B@code{From} \e$B%U%#!<%k%I$N%a!<\e(B
-\e$B%k%"%I%l%9$H$7$F;H$o$l$^$9!#\e(B)
+\e$BBe$o$j$N%a!<%k%"%I%l%9$K9gCW$9$k@55,I=8=$G$9!#85$N5-;v$N\e(B To\e$B!"\e(BCc \e$B$^$?$O\e(B
+From \e$B%X%C%@!<$K$"$k:G=i$N%"%I%l%9$G!"$3$NJQ?t$K9gCW$9$k$b$N$,!"=P$F9T$/\e(B
+\e$B%a%C%;!<%8$N\e(B From \e$BMs$H$7$F!"%G%#%U%)%k%H$N\e(B From \e$B$NCM$rCV$-49$($F;HMQ$5$l\e(B
+\e$B$^$9!#\e(B
+
+\e$BNc$($P!"$"$J$?$,\e(B john@@home.net \e$B$*$h$S\e(B john.doe@@work.com \e$B$H$$$&BhFs$NEE\e(B
+\e$B;R%a!<%k%"%I%l%9$r;}$C$F$$$F!"$=$l$i$K08$F$FAw$i$l$F$-$?%a%C%;!<%8$KJV?.\e(B
+\e$B$9$k$H$-$K!"$=$l$i$r\e(B From \e$BMs$G;H$$$?$1$l$P!"$3$NJQ?t$r<!$N$h$&$K@_Dj$9$k\e(B
+\e$B$3$H$,$G$-$^$9\e(B:
+
+@lisp
+(setq message-alternative-emails
+      (regexp-opt '("john@@home.net" "john.doe@@work.com")))
+@end lisp
+
+\e$B$3$NJQ?t$O!"Ej9FMM<0\e(B (posting styles) \e$B$d\e(B @code{message-setup-hook} \e$B$G<B\e(B
+\e$B9T$9$k$$$+$J$k$b$N$h$j$bM%@h$7$^$9!#\e(B
 
 @item message-allow-no-recipients
 @vindex message-allow-no-recipients
 
 
 @item message-alternative-emails
 @vindex message-alternative-emails
-A regexp to match the alternative email addresses.  The first matched
-address (not primary one) is used in the @code{From} field.
+Regexp matching alternative email addresses.  The first address in the
+To, Cc or From headers of the original article matching this variable is
+used as the From field of outgoing messages, replacing the default From
+value.
+
+For example, if you have two secondary email addresses john@@home.net
+and john.doe@@work.com and want to use them in the From field when
+composing a reply to a message addressed to one of them, you could set
+this variable like this:
+
+@lisp
+(setq message-alternative-emails
+      (regexp-opt '("john@@home.net" "john.doe@@work.com")))
+@end lisp
+
+This variable has precedence over posting styles and anything that runs
+off @code{message-setup-hook}.
 
 @item message-allow-no-recipients
 @vindex message-allow-no-recipients