From be559f614547e6aee363262829fc3f28dd1b04b2 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Fri, 24 Jul 2020 23:19:44 -0400 Subject: gnus: Enable functions in gnus-summary-mode It makes sense for all of these functions to support gnus-summary-mode because point is often in the summary buffer when reading a thread. I punted on doing so initially because something probably should be done to ensure that the gnus-article-* variables that these functions rely on are up to date with the current line in the summary buffer. I'm still not sure of the best way to do that (assuming it really is an issue), but I think for common usage patterns the values won't be stale (e.g., browsing with gnus-summary-next-page and gnus-summary-next-unread-article), so simply relying on the current values may be good enough. --- piem-gnus.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/piem-gnus.el b/piem-gnus.el index c9a8bb6..fcfb08e 100644 --- a/piem-gnus.el +++ b/piem-gnus.el @@ -38,13 +38,13 @@ (defun piem-gnus-get-inbox () "Return inbox name from a Gnus article" - (when (derived-mode-p 'gnus-article-mode) + (when (derived-mode-p 'gnus-article-mode 'gnus-summary-mode) (with-current-buffer gnus-original-article-buffer (piem-inbox-by-header-match)))) (defun piem-gnus-get-mid () "Return the message ID of a Gnus article." - (when (derived-mode-p 'gnus-article-mode) + (when (derived-mode-p 'gnus-article-mode 'gnus-summary-mode) (with-current-buffer gnus-original-article-buffer (when-let ((mid (message-field-value "Message-ID"))) (if (string-match (rx string-start (zero-or-more space) "<" @@ -62,7 +62,7 @@ If the buffer has any MIME parts that look like a patch, use those parts' contents (in order) as the mbox. Otherwise, use the message itself if it looks like a patch." - (when (derived-mode-p 'gnus-article-mode) + (when (derived-mode-p 'gnus-article-mode 'gnus-summary-mode) (cond (gnus-article-mime-handles (let ((patches -- cgit v1.2.3