Merge remote-tracking branch 'origin/no-gnus'
[gnus] / lisp / gnus-msg.el
index aa4ed4b..3867a58 100644 (file)
@@ -494,22 +494,26 @@ 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
-      (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)
+  (if (not (gnus-alive-p))
+      (message-mail)
+    (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)