Remove nnml-retrieve-groups that is unnecessary and somewhat problematic
[gnus] / lisp / gnus-msg.el
index 469b9d2..bfd3da2 100644 (file)
@@ -1,6 +1,6 @@
 ;;; gnus-msg.el --- mail and post interface for Gnus
 
-;; Copyright (C) 1995-2014 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2015 Free Software Foundation, Inc.
 
 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
 ;;     Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -541,11 +541,15 @@ instead."
                      nil yank-action send-actions return-action))
     (let ((buf (current-buffer))
          ;; Don't use posting styles corresponding to any existing group.
-         (gnus-newsgroup-name "")
+         (group-name gnus-newsgroup-name)
          mail-buf)
-      (gnus-setup-message 'message
-       (message-mail to subject other-headers continue
-                     nil yank-action send-actions return-action))
+      (unwind-protect
+         (progn
+           (setq gnus-newsgroup-name "")
+           (gnus-setup-message 'message
+             (message-mail to subject other-headers continue
+                           nil yank-action send-actions return-action)))
+       (setq gnus-newsgroup-name group-name))
       (when switch-action
        (setq mail-buf (current-buffer))
        (switch-to-buffer buf)
@@ -1726,7 +1730,20 @@ this is a reply."
          (var (or gnus-outgoing-message-group gnus-message-archive-group))
         (gcc-self-val
          (and group (not (gnus-virtual-group-p group))
-              (gnus-group-find-parameter group 'gcc-self)))
+              (gnus-group-find-parameter group 'gcc-self t)))
+        (gcc-self-get (lambda (gcc-self-val group)
+                        (if (stringp gcc-self-val)
+                            (if (string-match " " gcc-self-val)
+                                (concat "\"" gcc-self-val "\"")
+                              gcc-self-val)
+                          ;; In nndoc groups, we use the parent group name
+                          ;; instead of the current group.
+                          (let ((group (or (gnus-group-find-parameter
+                                            gnus-newsgroup-name 'parent-group)
+                                           group)))
+                            (if (string-match " " group)
+                                (concat "\"" group "\"")
+                              group)))))
         result
         (groups
          (cond
@@ -1777,19 +1794,11 @@ this is a reply."
          (if gcc-self-val
              ;; Use the `gcc-self' param value instead.
              (progn
-               (insert
-                (if (stringp gcc-self-val)
-                    (if (string-match " " gcc-self-val)
-                        (concat "\"" gcc-self-val "\"")
-                      gcc-self-val)
-                  ;; In nndoc groups, we use the parent group name
-                  ;; instead of the current group.
-                  (let ((group (or (gnus-group-find-parameter
-                                    gnus-newsgroup-name 'parent-group)
-                                   group)))
-                    (if (string-match " " group)
-                        (concat "\"" group "\"")
-                      group))))
+               (insert (if (listp gcc-self-val)
+                           (mapconcat (lambda (val)
+                                        (funcall gcc-self-get val group))
+                                      gcc-self-val ", ")
+                           (funcall gcc-self-get gcc-self-val group)))
                (if (not (eq gcc-self-val 'none))
                    (insert "\n")
                  (gnus-delete-line)))