[gnus git] branch master updated: n0-17-199-g72b03f9 =1= (gnus-group-make-nnir-group): Allow optional query argument.

Andrew Cohen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  72b03f92bf33dbb38241e7c6092fb3d561601675 (commit)
      from  0c027a2deb252dee4f84717ff1632540b5e2d854 (commit)


- Log -----------------------------------------------------------------
commit 72b03f92bf33dbb38241e7c6092fb3d561601675
Author: Andrew Cohen <[email protected]>
Date:   Wed Jul 20 10:34:12 2011 -0400

    (gnus-group-make-nnir-group): Allow optional query argument.
    
    (gnus-group-make-nnir-group,nnir-request-group,nnir-run-query): Use
    	 	`nnir-address' to handle server info rather than
    	 	passing an arg.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 33bb490..6d11b1b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,11 @@
 2011-07-20  Andrew Cohen  <[email protected]>
 
+	* nnir.el (gnus-group-make-nnir-group): Allow optional search query
+	argument.
+
+	(gnus-group-make-nnir-group,nnir-request-group,nnir-run-query): Use
+	`nnir-address' to handle server info rather than passing an arg.
+
 	* nnimap.el (nnimap-make-thread-query): New utility function to format
 	an imap thread search query.
 	(nnimap-request-thread): Use it.
diff --git a/lisp/nnir.el b/lisp/nnir.el
index 3f140ef..9840ddd 100644
--- a/lisp/nnir.el
+++ b/lisp/nnir.el
@@ -296,6 +296,9 @@ is `(valuefunc member)'."
 (nnoo-declare nnir)
 (nnoo-define-basics nnir)
 
+(defvoo nnir-address nil
+  "The address of the nnir server.")
+
 (gnus-declare-backend "nnir" 'mail)
 
 
@@ -582,17 +585,16 @@ Add an entry here when adding a new search engine.")
 
 ;; Gnus glue.
 
-(defun gnus-group-make-nnir-group (nnir-extra-parms)
+(defun gnus-group-make-nnir-group (nnir-extra-parms &optional parms)
   "Create an nnir group.  Asks for query."
   (interactive "P")
   (setq nnir-current-query nil
 	nnir-current-server nil
 	nnir-current-group-marked nil
 	nnir-artlist nil)
-  (let* ((query (read-string "Query: " nil 'nnir-search-history))
-	 (parms (list (cons 'query query)))
-	 (srv (if (gnus-server-server-name)
-		  "all"	"")))
+  (let* ((query (unless parms (read-string "Query: " nil 'nnir-search-history)))
+	 (parms (or parms (list (cons 'query query))))
+	 (srv (or (cdr (assq 'server parms)) (gnus-server-server-name) "nnir")))
     (add-to-list 'parms (cons 'unique-id (message-unique-id)) t)
     (gnus-group-read-ephemeral-group
      (concat "nnir:" (prin1-to-string parms)) (list 'nnir srv) t
@@ -617,7 +619,7 @@ Add an entry here when adding a new search engine.")
                (equal server nnir-current-server)))
       nnir-artlist
     ;; Cache miss.
-    (setq nnir-artlist (nnir-run-query group server)))
+    (setq nnir-artlist (nnir-run-query group)))
   (with-current-buffer nntp-server-buffer
     (setq nnir-current-query group)
     (when server (setq nnir-current-server server))
@@ -1594,14 +1596,13 @@ actually)."
 
 (autoload 'gnus-group-topic-name "gnus-topic")
 
-(defun nnir-run-query (query nserver)
+(defun nnir-run-query (query)
   "Invoke appropriate search engine function (see `nnir-engines').
   If some groups were process-marked, run the query for each of the groups
   and concat the results."
   (let ((q (car (read-from-string query)))
-        (groups (if (string= "all-ephemeral" nserver)
-		    (with-current-buffer gnus-server-buffer
-		      (list (list (gnus-server-server-name))))
+        (groups (if (not (string= "nnir" nnir-address))
+		    (list (list nnir-address))
 		  (nnir-categorize
 		   (or gnus-group-marked
 		       (if (gnus-group-group-name)

-----------------------------------------------------------------------
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 |    6 ++++++
 lisp/nnir.el   |   23 ++++++++++++-----------
 2 files changed, 18 insertions(+), 11 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.