changeset 110569:5e158658b471

nnir.el (nnir-run-imap): Allow sending IMAP search patterns directly.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Sat, 25 Sep 2010 14:24:54 +0000
parents 04b79dd168dd
children fd5269f6af5a
files lisp/gnus/ChangeLog lisp/gnus/nnir.el
diffstat 2 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Sat Sep 25 14:19:38 2010 +0000
+++ b/lisp/gnus/ChangeLog	Sat Sep 25 14:24:54 2010 +0000
@@ -1,3 +1,8 @@
+2010-09-25  Andrew Cohen  <cohen@andy.bu.edu>  (tiny change)
+
+	* nnir.el (nnir-run-imap): Allow sending IMAP search patterns
+	directly.
+
 2010-09-25  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 	* gnus.el (gnus-local-domain): Put gnus-local-domain back again, since
--- a/lisp/gnus/nnir.el	Sat Sep 25 14:19:38 2010 +0000
+++ b/lisp/gnus/nnir.el	Sat Sep 25 14:24:54 2010 +0000
@@ -345,14 +345,16 @@
 (gnus-declare-backend "nnir" 'mail)
 
 (defvar nnir-imap-search-field "TEXT"
-  "The IMAP search item when doing an nnir search")
+  "The IMAP search item when doing an nnir search. To use raw
+  imap queries by default set this to \"\"")
 
 (defvar nnir-imap-search-arguments
   '(("Whole message" . "TEXT")
     ("Subject" . "SUBJECT")
     ("To" . "TO")
     ("From" . "FROM")
-    (nil . "HEADER \"%s\""))
+    ("Head" . "HEADER \"%s\"")
+    (nil . ""))
   "Mapping from user readable strings to IMAP search items for use in nnir")
 
 (defvar nnir-imap-search-argument-history ()
@@ -981,8 +983,11 @@
 	      (message "Searching %s..." group)
 	      (let ((arts 0)
 		    (result
-		     (nnimap-command "UID SEARCH  %s" 
-				     (nnir-imap-make-query criteria qstring))))
+		     (nnimap-command "UID SEARCH  %s"
+				     (if (string= criteria "")
+					 qstring
+				       (nnir-imap-make-query criteria qstring)
+				       ))))
 		(mapc
 		 (lambda (artnum)
 		   (push (vector group artnum 1) artlist)