-2002-02-04  ShengHuo ZHU  <zsh@cs.rochester.edu>
+2002-02-05  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * message.el (message-gen-unsubscribed-mft): New function.
+       From Sriram Karra <karra@cs.utah.edu>.
+
+       * gnus.el (gnus-article-unpropagated-mark-lists): Backslash the
+       open parenthesis.
+
+       * mm-view.el (mm-w3-prepare-buffer): Bind url-gateway-unplugged.
+       (mm-inline-text-html-render-with-w3): Ditto.
+       * gnus-art.el (gnus-article-wash-html-with-w3): Ditto.
+       Suggested by Dave Love  <d.love@dl.ac.uk>.
+
+       * mm-url.el (mm-url-load-url): Require w3-vars for old versions.
 
        * nntp.el (nntp-send-command-and-decode): Check PROCESS.
+       * nntp.el (nntp-send-command): Ditto.
+       * nntp.el (nntp-send-command-nodelete): Ditto.
+
+2002-02-04  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * mm-url.el (mm-url-load-url): New function.
        (mm-url-insert-file-contents): Use it.
 
   (mm-setup-w3)
   (let ((w3-strict-width (window-width))
        (url-standalone-mode t)
+       (url-gateway-unplugged t)
        (w3-honor-stylesheets nil)
        (w3-delay-image-loads t))
     (condition-case var
 
   "Marks that shouldn't be propagated to backends.
 Typical marks are those that make no sense in a standalone backend,
 such as a mark that says whether an article is stored in the cache
-(which doesn't make sense in a standalone backend).")
+\(which doesn't make sense in a standalone backend).")
 
 (defvar gnus-headers-retrieved-by nil)
 (defvar gnus-article-reply nil)
 
   (define-key message-mode-map "\C-c\C-f\C-k" 'message-goto-keywords)
   (define-key message-mode-map "\C-c\C-f\C-u" 'message-goto-summary)
   (define-key message-mode-map "\C-c\C-f\C-i" 'message-insert-or-toggle-importance)
+  (define-key message-mode-map "\C-c\C-f\C-a" 'message-gen-unsubscribed-mft)
   (define-key message-mode-map "\C-c\C-b" 'message-goto-body)
   (define-key message-mode-map "\C-c\C-i" 'message-goto-signature)
   (define-key message-mode-map "\C-c\C-fc" 'message-goto-mail-copies-to)
     (goto-char (point-max))
     nil))
 
+(defun message-gen-unsubscribed-mft (&optional include-cc)
+  "Insert a reasonable MFT header in a post to an unsubscribed list.
+When making original posts to a mailing list you are not subscribed to,
+you have to type in a MFT header by hand.  The contents, usually, are
+the addresses of the list and your own address.  This function inserts
+such a header automatically.  It fetches the contents of the To: header
+in the current mail buffer, and appends the current user-mail-address.
+
+If the optional argument `include-cc' is non-nil, the addresses in the
+Cc: header are also put into the MFT."
+
+  (interactive)
+  (message-remove-header "Mail-Followup-To")
+  (let* ((cc (and include-cc (message-fetch-field "Cc")))
+        (tos (if cc
+                 (concat (message-fetch-field "To") "," cc)
+               (message-fetch-field "To"))))
+    (message-goto-mail-followup-to)
+    (insert (concat tos ", " user-mail-address))))
+
 \f
 
 (defun message-insert-to (&optional force)
 
 
 (defun mm-url-load-url ()
   "Load `url-insert-file-contents'."
-  (condition-case ()
-      (require 'url-handlers)
-    (error nil))
-  (require 'url))
+  (unless (condition-case ()
+             (require 'url-handlers)
+           (error nil))
+    ;; w3-4.0pre0.46 or earlier version.
+    (require 'w3-vars)
+    (require 'url)))
 
 (defun mm-url-insert-file-contents (url)
   (if mm-url-use-external
 
   (let ((text (mm-get-part handle))
        (b (point))
        (url-standalone-mode t)
+       (url-gateway-unplugged t)
        (w3-honor-stylesheets nil)
        (w3-delay-image-loads t)
        (url-current-object
            (let ((w3-strict-width width)
                  ;; Don't let w3 set the global version of
                  ;; this variable.
-                 (fill-column fill-column)
-                 (w3-honor-stylesheets nil)
-                 (w3-delay-image-loads t)
-                 (url-standalone-mode t))
+                 (fill-column fill-column))
              (condition-case var
                  (w3-region (point-min) (point-max))
                (error
 (defun mm-w3-prepare-buffer ()
   (require 'w3)
   (let ((url-standalone-mode t)
+       (url-gateway-unplugged t)
        (w3-honor-stylesheets nil)
        (w3-delay-image-loads t))
     (w3-prepare-buffer)))
 
       (set-buffer nntp-server-buffer)
       (erase-buffer)))
   (let* ((command (mapconcat 'identity strings " "))
-        (buffer (process-buffer (nntp-find-connection nntp-server-buffer)))
-        (pos (with-current-buffer buffer (point))))
-    (prog1
-       (nntp-retrieve-data command
-                           nntp-address nntp-port-number nntp-server-buffer
-                           wait-for nnheader-callback-function)
-      ;; If nothing to wait for, still remove possibly echo'ed commands
-      (unless wait-for
-       (nntp-accept-response)
-       (save-excursion
-         (set-buffer buffer)
-         (goto-char pos)
-         (if (looking-at (regexp-quote command))
-             (delete-region pos (progn
-                                  (forward-line 1)
-                                  (gnus-point-at-bol)))))))))
+        (process (nntp-find-connection nntp-server-buffer))
+        (buffer (and process (process-buffer process)))
+        (pos (and buffer (with-current-buffer buffer (point)))))
+    (if process
+       (prog1
+           (nntp-retrieve-data command
+                               nntp-address nntp-port-number
+                               nntp-server-buffer
+                               wait-for nnheader-callback-function)
+         ;; If nothing to wait for, still remove possibly echo'ed commands
+         (unless wait-for
+           (nntp-accept-response)
+           (save-excursion
+             (set-buffer buffer)
+             (goto-char pos)
+             (if (looking-at (regexp-quote command))
+                 (delete-region pos (progn (forward-line 1)
+                                           (gnus-point-at-bol))))
+             )))
+      (nnheader-report 'nntp "Couldn't open connection to %s."
+                      nntp-address))))
 
 (defun nntp-send-command-nodelete (wait-for &rest strings)
   "Send STRINGS to server and wait until WAIT-FOR returns."
   (let* ((command (mapconcat 'identity strings " "))
-        (buffer (process-buffer (nntp-find-connection nntp-server-buffer)))
-        (pos (with-current-buffer buffer (point))))
-    (prog1
-       (nntp-retrieve-data command
-                           nntp-address nntp-port-number nntp-server-buffer
-                           wait-for nnheader-callback-function)
-      ;; If nothing to wait for, still remove possibly echo'ed commands
-      (unless wait-for
-       (nntp-accept-response)
-       (save-excursion
-         (set-buffer buffer)
-         (goto-char pos)
-         (if (looking-at (regexp-quote command))
-             (delete-region pos (progn
-                                  (forward-line 1)
-                                  (gnus-point-at-bol)))))))))
+        (process (nntp-find-connection nntp-server-buffer))
+        (buffer (and process (process-buffer process)))
+        (pos (and buffer (with-current-buffer buffer (point)))))
+    (if process
+       (prog1
+           (nntp-retrieve-data command
+                               nntp-address nntp-port-number
+                               nntp-server-buffer
+                               wait-for nnheader-callback-function)
+         ;; If nothing to wait for, still remove possibly echo'ed commands
+         (unless wait-for
+           (nntp-accept-response)
+           (save-excursion
+             (set-buffer buffer)
+             (goto-char pos)
+             (if (looking-at (regexp-quote command))
+                 (delete-region pos (progn (forward-line 1)
+                                           (gnus-point-at-bol))))
+             )))
+      (nnheader-report 'nntp "Couldn't open connection to %s."
+                      nntp-address))))
 
 (defun nntp-send-command-and-decode (wait-for &rest strings)
   "Send STRINGS to server and wait until WAIT-FOR returns."
 
+2002-02-05  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * message.texi (Mailing Lists): Addition.
+       * gnus.texi (Group Parameters): Addition.
+       From Sriram Karra <karra@cs.utah.edu>.
+
 2002-02-03  Karl Kleinpaste  <karl@charcoal.com>
 
        * gnus.texi (Summary Score Commands): Added detail on "extra"
 
 
 @code{gnus-parameter-to-list-alist} \e$B$b;2>H$7$F2<$5$$!#\e(B
 
+@anchor{subscribed}
 @item subscribed
 @cindex subscribed
 \e$B$b$7$3$N%Q%i%a!<%?$,\e(B @code{t} \e$B$K@_Dj$5$l$F$$$k$H!"\e(Bgnus \e$B$O$"$J$?$,$3$N%0\e(B
 
 
 See also @code{gnus-parameter-to-list-alist}.
 
+@anchor{subscribed}
 @item subscribed
 @cindex subscribed
 If this parameter is set to @code{t}, Gnus will consider the
 
 \e$B$G$-$^$9!#0J2<$NJQ?t$,<j$4$m$G$7$g$&!#\e(B
 
 @table @code
+@vindex message-subscribed-addresses
 @item message-subscribed-addresses
 \e$B$3$l$O9XFI$7$F$$$k%a!<%j%s%0%j%9%H$N%"%I%l%9$N%j%9%H$G$J$1$l$P$J$j$^$;$s!#\e(B
 \e$B%G%#%U%)%k%HCM$O\e(B @code{nil} \e$B$G$9!#Nc\e(B:
       '("ding@@gnus.org" "bing@@noose.org"))
 @end lisp
 
+@vindex message-subscribed-regexps
 @item message-subscribed-regexps
 \e$B$3$l$O9XFI$7$F$$$k%a!<%j%s%0%j%9%H$N%"%I%l%9$r<($9@55,I=8=$N%j%9%H$G$J$1\e(B
 \e$B$l$P$J$j$^$;$s!#%G%#%U%)%k%HCM$O\e(B @code{nil} \e$B$G$9!#>e5-$HF1$87k2L$r@.$7?k\e(B
 
 @lisp
 (setq message-subscribed-regexps
-      '("[bd]ing@@\\(gnus\\|noose\\)\\.org"))
+      '("\\(ding@@gnus\\)\\|\\(bing@@noose\\)\\.org")
 @end lisp
 
+@vindex message-subscribed-address-functions
 @item message-subscribed-address-functions
 \e$B$3$l$O\e(B MFT \e$B%X%C%@!<$NCM$r7h$a$k$?$a$K\e(B (\e$B0lEY$K0l2s\e(B!!) \e$B8F$P$l$k4X?t$N%j%9\e(B
 \e$B%H$G$"$k$3$H$,$G$-$^$9!#$=$l$i$N4X?t$K$O0z?t$,L5$$$3$H$rCi9p$7$F$*$-$^$9!#\e(B
 \e$B%G%#%U%)%k%HCM$O\e(B @code{nil} \e$B$G$9!#\e(B
 
+gnus \e$B$K$O$3$NJQ?t$N9%E,$J8uJd$G$"$k$H$3$m$N!"$"$i$+$8$aDj5A$5$l$F$$$k4X\e(B
+\e$B?t$,$"$j$^$9!#4X?t\e(B @code{gnus-find-subscribed-addresses} \e$B$O!"\e(B
+@code{subscribed} (@pxref{(gnus)subscribed}) \e$B%0%k!<%W%Q%i%a!<%?$,\e(B
+\e$BHs\e(B-nil \e$B$K@_Dj$5$l$F$$$k%0%k!<%W$KBP1~$9$k%"%I%l%9$N%j%9%H$rJV$7$^$9!#$3\e(B
+\e$B$s$J$U$&$K$7$^$7$g$&!#\e(B
+
+@lisp
+(setq message-subscribed-address-functions
+      '(gnus-find-subscribed-addresses))
+@end lisp
+
 @item message-subscribed-address-file
 \e$B$"$J$?$O$b$7$+$7$?$i?l68$J?M\e(B (\e$B86E5\e(B: one organised human freak) \e$B$G!"9XFI\e(B
 \e$B$7$F$$$k$9$Y$F$N%a!<%j%s%0%j%9%H$N%"%I%l%9$N%j%9%H$rJL%U%!%$%k$G;}$C$F$$\e(B
 \e$B$&!<$`!#$=$&$9$k$H$"$J$?$O!V9XFI$7$F$$$J$$%a!<%j%s%0%j%9%H$K%a!<%k$rAw?.\e(B
 \e$B$9$k$H$-$O$I$&$J$k$N\e(B?\e$B!W$H?R$M$^$9$M!#$(!<$H!"?F@Z$J\e(B Gnus \e$B%?%o!<$N?M$?$A\e(B
 \e$B$,!"$3$NL\E*$G;H$($k$9$Y$F$N4{CN$N%a!<%j%s%0%j%9%H$N%"%I%l%9$N%G!<%?%Y!<\e(B
-\e$B%9$N:n@.$K$$$=$7$s$G$$$^$9!#$=$l$^$G$O!"\e(B@kbd{C-c C-f m} \e$B$r;H$C$F<jF0\e(B
+\e$B%9$N:n@.$K$$$=$7$s$G$$$^$9!#$=$l$^$G$O!"\e(B@kbd{C-c C-f C-m} \e$B$r;H$C$F<jF0\e(B
 \e$B$G\e(B MFT \e$B%X%C%@!<$rA^F~$9$k$J$I$7$F2<$5$$\e(B!!
 
 @c @node Honoring an MFT post
 @subsection MFT \e$BEj9F$NB:=E\e(B
 
+@vindex message-use-mail-followup-to
 \e$B%a!<%j%s%0%j%9%H$KEj9F$5$l$?5-;v$K%U%)%m!<%"%C%W$9$k$H$-!"$=$N5-;v\e(B
 \e$B$,\e(B MFT \e$B%X%C%@!<$r;}$C$F$$$?$i!"\e(Bgnus \e$B$NF0:n$OJQ\e(B
 \e$B?t\e(B @code{message-use-mail-followup-to} \e$B$NCM$K$h$C$F7h$^$j$^$9!#$3$NCM$O\e(B
 
 
 @table @code
 
+@vindex message-subscribed-addresses
 @item message-subscribed-addresses
 This should be a list of addresses the user is subscribed to.  Its
 default value is @code{nil}.   Example: 
       '("ding@@gnus.org" "bing@@noose.org"))
 @end lisp
 
+@vindex message-subscribed-regexps
 @item message-subscribed-regexps
 This should be a list of regexps denoting the addresses of mailing
 lists subscribed to.  Default value is @code{nil}.  Example: If you
 want to achieve the same result as above:
 @lisp
 (setq message-subscribed-regexps
-      '("[bd]ing@@\\(gnus\\|noose\\)\\.org"))
+      '("\\(ding@@gnus\\)\\|\\(bing@@noose\\)\\.org")
 @end lisp
 
+@vindex message-subscribed-address-functions
 @item message-subscribed-address-functions
 This can be a list of functions to be called (one at a time!!) to
 determine the value of MFT headers.  It is advisable that these
 functions not take any arguments.  Default value is @code{nil}.
 
+There is a pre-defined function in Gnus that is a good candidate for
+this variable.  @code{gnus-find-subscribed-addresses} is a function
+that returns a list of addresses corresponding to the groups that have
+the @code{subscribed} (@pxref{(gnus)subscribed})
+group parameter set to a non-nil value.  This is how you would do it.
+
+@lisp
+(setq message-subscribed-address-functions
+      '(gnus-find-subscribed-addresses))
+@end lisp
+
 @item message-subscribed-address-file
 You might be one organised human freak and have a list of addresses of
 all subscribed mailing lists in a separate file!  Then you can just
 subscribed to?''  Well, the kind folks at Gnus Towers are working on a
 database of all known mailing list addresses that can be used for this
 purpose.  Till then, you could, like, insert a MFT header manually,
-with the help of @kbd{C-c C-f m} !!
+with the help of @kbd{C-c C-f C-m} !!
 
 @c @node Honoring an MFT post
 @subsection Honoring an MFT post
 
+@vindex message-use-mail-followup-to
 When you followup to a post on a mailing list, and the post has a MFT
 header, Gnus' action will depend on the value of the variable
 @code{message-use-mail-followup-to}.  This variable can be one of: