Make nnwarchive work with agent.
[gnus] / lisp / gnus-msg.el
index 74a02f2..f49da29 100644 (file)
 (require 'message)
 (require 'gnus-art)
 
-(defcustom gnus-post-method nil
+(defcustom gnus-post-method 'current
   "*Preferred method for posting USENET news.
 
 If this variable is `current', Gnus will use the \"current\" select
 method when posting.  If it is nil (which is the default), Gnus will
-use the native posting method of the server.
+use the native select method when posting.
 
 This method will not be used in mail groups and the like, only in
 \"real\" newsgroups.
@@ -1106,10 +1106,15 @@ this is a reply."
       ;; Go through all styles and look for matches.
       (dolist (style styles)
        (setq match (pop style))
+       (goto-char (point-min))
        (when (cond
               ((stringp match)
                ;; Regexp string match on the group name.
                (string-match match group))
+              ((eq match 'header)
+               (let ((header (message-fetch-field (pop style))))
+                 (and header
+                      (string-match (pop style) header))))
               ((or (symbolp match)
                    (gnus-functionp match))
                (cond
@@ -1182,7 +1187,8 @@ this is a reply."
                      `(lambda ()
                         (save-excursion
                           (let ((message-signature ,(cdr result)))
-                            (message-insert-signature)))))
+                            (when message-signature
+                              (message-insert-signature))))))
                     (t
                      (let ((header
                             (if (symbolp (car result))
@@ -1196,7 +1202,7 @@ this is a reply."
       (when (or name address)
        (add-hook 'message-setup-hook
                  `(lambda ()
-                    (let ((user-full-name ,(or (cdr name) user-full-name))
+                    (let ((user-full-name ,(or (cdr name) (user-full-name)))
                           (user-mail-address
                            ,(or (cdr address) user-mail-address)))
                       (save-excursion