[gnus git] branch master updated: n0-17-117-g6d22581 =1= Allow nnir as a gnus-refer-article-method. (gnus-refer-article-methods): Default (nnir) entry to use current server. (nnir-request-article): Allow use of Message-ID with nnimap.

Andrew Cohen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  6d225814ad9bb5ebd7047a4c3b2117ba6a4f5894 (commit)
      from  05dc2751e246bc05d1d5f9728e71b6f05ae5150f (commit)


- Log -----------------------------------------------------------------
commit 6d225814ad9bb5ebd7047a4c3b2117ba6a4f5894
Author: Andrew Cohen <[email protected]>
Date:   Thu Jun 30 12:54:47 2011 -0400

    Allow nnir as a gnus-refer-article-method.
    (gnus-refer-article-methods): Default (nnir) entry to use current
    server.
    (nnir-request-article): Allow use of Message-ID with nnimap.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e401621..1a5c3d2 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
+2011-06-30  Andrew Cohen  <[email protected]>
+
+	* nnir.el (nnir-request-article): Allow requesting articles by
+	Message-ID with nnimap.
+
+	* gnus-sum.el (gnus-refer-article-methods): Allow (nnir) entry to use
+	current server.
+
 2011-06-30  Teodor Zlatanov  <[email protected]>
 
 	* auth-source.el: Autoload EPA/EPG functions.
diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el
index 4c059e9..798ae96 100644
--- a/lisp/gnus-sum.el
+++ b/lisp/gnus-sum.el
@@ -9050,7 +9050,12 @@ variable."
       (dolist (method gnus-refer-article-method)
 	(push (if (eq 'current method)
 		  gnus-current-select-method
-		method)
+		(if (eq 'nnir (car method))
+		    (list
+		     'nnir
+		     (or (cadr method)
+			 (gnus-method-to-server gnus-current-select-method)))
+		  method))
 	      out))
       (nreverse out)))
    ;; One single select method.
diff --git a/lisp/nnir.el b/lisp/nnir.el
index eaaac3f..f1a97dc 100644
--- a/lisp/nnir.el
+++ b/lisp/nnir.el
@@ -657,12 +657,29 @@ Add an entry here when adding a new search engine.")
       'nov)))
 
 (deffoo nnir-request-article (article &optional group server to-buffer)
-  (if (stringp article)
+  (if (and (stringp article)
+	   (not (eq 'nnimap (car (gnus-server-to-method server)))))
       (nnheader-report
        'nnir
-       "nnir-retrieve-headers doesn't grok message ids: %s"
-       article)
+       "nnir-retrieve-headers only groks message ids for nnimap servers: %s"
+       server)
     (save-excursion
+      (let ((article article)
+	    query)
+	(when (stringp article)
+	  (setq gnus-override-method (gnus-server-to-method server))
+	  (setq query
+		(list
+		 (cons 'query (format "HEADER Message-ID %s" article))
+		 (cons 'unique-id article)
+		 (cons 'criteria "")))
+	  (unless (and (equal query nnir-current-query)
+		       (equal server nnir-current-server))
+	    (setq nnir-artlist (nnir-run-imap query server))
+	    (setq nnir-current-query query)
+	    (setq nnir-current-server server))
+	  (setq article 1))
+	(unless (zerop (length nnir-artlist))
       (let ((artfullgroup (nnir-article-group article))
 	    (artno (nnir-article-number article)))
 	(message "Requesting article %d from group %s"
@@ -672,7 +689,7 @@ Add an entry here when adding a new search engine.")
 	      (let ((gnus-article-decode-hook nil))
 		(gnus-request-article-this-buffer artno artfullgroup)))
 	  (gnus-request-article artno artfullgroup))
-	(cons artfullgroup artno)))))
+	    (cons artfullgroup artno)))))))
 
 (deffoo nnir-request-move-article (article group server accept-form
 					   &optional last internal-move-group)

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog   |    8 ++++++++
 lisp/gnus-sum.el |    7 ++++++-
 lisp/nnir.el     |   43 ++++++++++++++++++++++++++++++-------------
 3 files changed, 44 insertions(+), 14 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.