aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2020-07-24 23:19:44 -0400
committerKyle Meyer <kyle@kyleam.com>2020-07-24 23:19:44 -0400
commitbe559f614547e6aee363262829fc3f28dd1b04b2 (patch)
tree1b0e6c49364381e6c5ae87736a686560b1ae73ea
parented0351ba8fe3774b008b5675d6e9332bfe171e13 (diff)
downloadpiem-be559f614547e6aee363262829fc3f28dd1b04b2.tar.gz
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.
-rw-r--r--piem-gnus.el6
1 files 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