Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Mark Triggs <mst@dishevelled.net>
To: info-gnus-english@gnu.org
Subject: Re: A small patch for nnir.el
Date: Sat, 20 Mar 2010 09:09:29 +1100	[thread overview]
Message-ID: <87d3z0klpi.fsf@dishevelled.net> (raw)
In-Reply-To: <87mxy45cw0.fsf@lifelogs.com>

[-- Attachment #1: Type: text/plain, Size: 955 bytes --]

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>


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nnir.patch --]
[-- Type: text/x-patch, Size: 2545 bytes --]

--- /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)

[-- Attachment #3: Type: text/plain, Size: 161 bytes --]

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
http://lists.gnu.org/mailman/listinfo/info-gnus-english

  reply	other threads:[~2010-03-19 22:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-18  3:04 Mark Triggs
2010-03-19 19:29 ` Ted Zlatanov
2010-03-19 22:09   ` Mark Triggs [this message]
2010-03-20 15:05     ` Ted Zlatanov
2010-03-20 21:01       ` Mark Triggs
2010-03-22 12:56         ` Ted Zlatanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d3z0klpi.fsf@dishevelled.net \
    --to=mst@dishevelled.net \
    --cc=info-gnus-english@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).