From 69b14ac458e923dcbe9cf740ab868633c055b405 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Fri, 31 Jan 2014 15:59:06 -0800 Subject: [PATCH] * gnus-sum.el (gnus-summary-open-group-with-article): New command. --- lisp/ChangeLog | 4 ++++ lisp/gnus-sum.el | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0a6a95be1..d5532051a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2014-01-31 Dave Abrahams + + * gnus-sum.el (gnus-summary-open-group-with-article): New command. + 2014-01-31 Magnus Henoch * dns.el (dns-servers-up-to-date-p): New function to see whether the diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index d6c801fdd..9079e25d7 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -9085,6 +9085,41 @@ non-numeric or nil fetch the number specified by the (gnus-summary-limit-include-thread id))) (gnus-summary-show-thread)) +(defun gnus-summary-open-group-with-article (message-id) + "Open a group containing the article with the given MESSAGE-ID." + (interactive "sMessage-ID: ") + (require 'nndoc) + (with-temp-buffer + ;; Prepare a dummy article + (erase-buffer) + (insert "From nobody Tue Sep 13 22:05:34 2011\n\n") + + ;; Prepare pretty modelines for summary and article buffers + (let ((gnus-summary-mode-line-format "Found %G") + (gnus-article-mode-line-format + ;; Group names just get in the way here, especially the + ;; abbreviated ones + (if (string-match "%[gG]" gnus-article-mode-line-format) + (concat (substring gnus-article-mode-line-format + 0 (match-beginning 0)) + (substring gnus-article-mode-line-format (match-end 0))) + gnus-article-mode-line-format))) + + ;; Build an ephemeral group containing the dummy article (hidden) + (gnus-group-read-ephemeral-group + message-id + `(nndoc ,message-id + (nndoc-address ,(current-buffer)) + (nndoc-article-type mbox)) + :activate + (cons (current-buffer) gnus-current-window-configuration) + (not :request-only) + '(-1) ; :select-articles + (not :parameters) + 0)) ; :number + ;; Fetch the desired article + (gnus-summary-refer-article message-id))) + (defun gnus-summary-refer-article (message-id) "Fetch an article specified by MESSAGE-ID." (interactive "sMessage-ID: ") -- 2.34.1