Merge remote branch 'origin/no-gnus'
[gnus] / lisp / gnus-msg.el
index aa4ed4b..9411f46 100644 (file)
@@ -494,22 +494,28 @@ Thank you for your help in stamping out bugs.
 
 ;;;###autoload
 (defun gnus-msg-mail (&optional to subject other-headers continue
-                     switch-action yank-action send-actions return-action)
+                               switch-action yank-action send-actions
+                               return-action)
   "Start editing a mail message to be sent.
 Like `message-mail', but with Gnus paraphernalia, particularly the
-Gcc: header for archiving purposes."
+Gcc: header for archiving purposes.
+If Gnus isn't running, a plain `message-mail' setup is used
+instead."
   (interactive)
-  (let ((buf (current-buffer))
-       mail-buf)
-    (gnus-setup-message 'message
+  (if (not (gnus-alive-p))
       (message-mail to subject other-headers continue
-                   nil yank-action send-actions return-action))
-    (when switch-action
-      (setq mail-buf (current-buffer))
-      (switch-to-buffer buf)
-      (apply switch-action mail-buf nil)))
-  ;; COMPOSEFUNC should return t if succeed.  Undocumented ???
-  t)
+                    nil yank-action send-actions return-action)
+    (let ((buf (current-buffer))
+         mail-buf)
+      (gnus-setup-message 'message
+       (message-mail to subject other-headers continue
+                     nil yank-action send-actions return-action))
+      (when switch-action
+       (setq mail-buf (current-buffer))
+       (switch-to-buffer buf)
+       (apply switch-action mail-buf nil))
+      ;; COMPOSEFUNC should return t if succeed.  Undocumented ???
+      t)))
 
 ;;;###autoload
 (defun gnus-button-mailto (address)
@@ -652,7 +658,7 @@ a news."
             (if (= 1 (prefix-numeric-value arg))
                 (gnus-group-completing-read "Newsgroup" nil
                                             (gnus-read-active-file-p))
-              (gnus-group-group-name))
+              (or (gnus-group-group-name) ""))
           ""))
        ;; make sure last viewed article doesn't affect posting styles:
        (gnus-article-copy))
@@ -1295,7 +1301,7 @@ For the \"inline\" alternatives, also see the variable
     (message-remove-header "gcc")
     (when gcc
       (goto-char (point-max))
-      (cond ((eq gnus-gcc-self-resent-messages  'none))
+      (cond ((eq gnus-gcc-self-resent-messages 'none))
            ((eq gnus-gcc-self-resent-messages t)
             (insert "Gcc: \"" gnus-newsgroup-name "\"\n"))
            ((stringp gnus-gcc-self-resent-messages)
@@ -1332,8 +1338,9 @@ For the \"inline\" alternatives, also see the variable
         current-prefix-arg))
   (let ((message-header-setup-hook (copy-sequence message-header-setup-hook))
        (message-sent-hook (copy-sequence message-sent-hook)))
+    ;; `gnus-summary-resend-message-insert-gcc' must run last.
     (add-hook 'message-header-setup-hook
-             'gnus-summary-resend-message-insert-gcc)
+             'gnus-summary-resend-message-insert-gcc t)
     (add-hook 'message-sent-hook (if gnus-agent
                                     'gnus-agent-possibly-do-gcc
                                   'gnus-inews-do-gcc))