From b04fbc59e95a2ccdef460dd0fb10bdd8080f61e2 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Sun, 11 Jan 2026 13:30:22 +0100 Subject: [PATCH] gnus-msg-mail: Attempt to start Gnus if not yet alive * lisp/gnus/gnus-msg.el (gnus-msg-mail): Attempt to start Gnus if not yet alive. In case of failure, fall back to plain message mode. (Bug#80173) --- lisp/gnus/gnus-msg.el | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index e35f87288e9..99f1735dfec 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -467,11 +467,17 @@ Gcc: header for archiving purposes. If Gnus isn't running, a plain `message-mail' setup is used instead." (interactive) - (if (not (gnus-alive-p)) - (progn - (message "Gnus not running; using plain Message mode") - (message-mail to subject other-headers continue - switch-action yank-action send-actions return-action)) + (if (and (not (gnus-alive-p)) + (condition-case err + (progn + (message "Gnus not running. Starting Gnus...") + (save-window-excursion (gnus)) + nil) + (error + (message "Gnus failed with %s. Using plain Message mode" + (error-message-string err))))) + (message-mail to subject other-headers continue + switch-action yank-action send-actions return-action) (let ((buf (current-buffer)) ;; Don't use posting styles corresponding to any existing group. ;; (group-name gnus-newsgroup-name)