From 7582f8442322a9f0b42d0960652b3ce2d6daf30c Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 9 Feb 2012 23:07:49 +0000 Subject: [PATCH] gnus-msg.el (gnus-msg-mail): Use `message-mail' if Gnus isn't running. --- lisp/gnus/ChangeLog | 3 +++ lisp/gnus/gnus-msg.el | 30 +++++++++++++++++------------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 6ce85227e0b..ce40019487a 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,5 +1,8 @@ 2012-02-09 Lars Ingebrigtsen + * gnus-msg.el (gnus-msg-mail): Use `message-mail' if Gnus isn't + running. + * nnimap.el (nnimap-wait-for-response): Minor fixup of message string. * gnus.el (gnus-server-extend-method): Don't add an -address component diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index cb5460f3ecf..f92dc5e91d0 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -478,22 +478,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) -- 2.39.2