info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A small patch for nnir.el


From: Mark Triggs
Subject: Re: A small patch for nnir.el
Date: Tue, 04 May 2010 15:47:20 -0000
User-agent: Gnus v5.13

Ted Zlatanov <tzz@lifelogs.com> writes:

> On Thu, 18 Mar 2010 14:04:26 +1100 Mark Triggs <mst@dishevelled.net> wrote: 
>
> MT> I'm writing here because I'm a bit unsure who I should offer my (tiny)
> MT> nnir.el patch to.  The ding list seems to have fallen to the spammers,
> MT> and Kai Großjohann said that, although my patch looked sensible, he's no
> MT> longer the primary maintainer of nnir.el.
>
> Send it to the ding list or post here.  I'll take a look.
>
> You need to have signed papers if your patch is non-trivial.


Thanks Ted.  I've attached my patch, which must be at least close to
trivial--it looks bigger than it really is because wrapping the old code
in an "unless" has changed the indentation.

I've signed FSF copyright papers before, but never for Gnus (I think my
last one was against ERC).  I'm happy to sign and submit whatever wants
signing and submitting, though.

Many thanks,

Mark

-- 
Mark Triggs
<mst@dishevelled.net>

--- /home/mst/media/mark/src/cvs/emacs/lisp/gnus/nnir.el        2010-03-12 
08:45:24.000000000 +1100
+++ nnir.el     2010-03-12 11:34:07.000000000 +1100
@@ -358,6 +358,14 @@
 (defvar nnir-imap-search-argument-history ()
   "The history for querying search options in nnir")
 
+(defvar nnir-get-article-nov-function nil
+  "If non-nil, a function that will be passed each search result.  This
+should return a message's headers in NOV format.
+
+If this variable is nil, or if the provided function returns nil for a search
+result, `gnus-retrieve-headers' will be called instead.")
+
+
 ;;; Developer Extension Variable:
 
 (defvar nnir-engines
@@ -779,25 +787,29 @@
        (nnir-possibly-change-server server)
         (let ((gnus-override-method
               (gnus-server-to-method server)))
-         (case (setq foo (gnus-retrieve-headers (list artno) artfullgroup nil))
-           (nov
-            (goto-char (point-min))
-            (setq novitem (nnheader-parse-nov))
-            (unless novitem
-              (pop-to-buffer nntp-server-buffer)
-              (error
-               "nnheader-parse-nov returned nil for article %s in group %s"
-               artno artfullgroup)))
-           (headers
-            (goto-char (point-min))
-            (setq novitem (nnheader-parse-head))
-            (unless novitem
-              (pop-to-buffer nntp-server-buffer)
-              (error
-               "nnheader-parse-head returned nil for article %s in group %s"
-               artno artfullgroup)))
-           (t (error "Unknown header type %s while requesting article %s of 
group %s"
-                     foo artno artfullgroup))))
+          (setq novitem (and nnir-get-article-nov-function
+                             (funcall nnir-get-article-nov-function
+                                      artitem)))
+          (unless novitem
+           (case (setq foo (gnus-retrieve-headers (list artno) artfullgroup 
nil))
+             (nov
+              (goto-char (point-min))
+              (setq novitem (nnheader-parse-nov))
+              (unless novitem
+                (pop-to-buffer nntp-server-buffer)
+                (error
+                 "nnheader-parse-nov returned nil for article %s in group %s"
+                 artno artfullgroup)))
+             (headers
+              (goto-char (point-min))
+              (setq novitem (nnheader-parse-head))
+              (unless novitem
+                (pop-to-buffer nntp-server-buffer)
+                (error
+                 "nnheader-parse-head returned nil for article %s in group %s"
+                 artno artfullgroup)))
+             (t (error "Unknown header type %s while requesting article %s of 
group %s"
+                       foo artno artfullgroup)))))
        ;; replace article number in original group with article number
         ;; in nnir group
         (mail-header-set-number novitem art)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]