changeset 111314:1431aee91437

nnir.el: Fix various bugs.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Mon, 01 Nov 2010 23:47:38 +0000
parents 1d510dd4f336
children bad40b05a0df
files lisp/gnus/ChangeLog lisp/gnus/nnir.el
diffstat 2 files changed, 25 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Mon Nov 01 23:11:37 2010 +0000
+++ b/lisp/gnus/ChangeLog	Mon Nov 01 23:47:38 2010 +0000
@@ -1,3 +1,10 @@
+2010-11-01  Andrew Cohen  <cohen@andy.bu.edu>
+
+	* nnir.el (nnir-run-gmane): inhibit demon. return nil if no messages.
+	(nnir-read-parms): don't modify query.
+	(nnir-run-query): add ability to search topic on current line.
+	(nnir-get-active): clean up.
+
 2010-11-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 	* gnus-cite.el (gnus-article-foldable-buffer): Protect against
--- a/lisp/gnus/nnir.el	Mon Nov 01 23:11:37 2010 +0000
+++ b/lisp/gnus/nnir.el	Mon Nov 01 23:47:38 2010 +0000
@@ -1407,6 +1407,7 @@
 		  (format "author:%s" (cdr (assq 'author query))) ""))
 	     (search (format "%s %s %s"
 			     qstring groupspec authorspec))
+	     (gnus-inhibit-demon t)
 	     artlist)
 	(require 'mm-url)
 	(with-current-buffer nntp-server-buffer
@@ -1441,14 +1442,15 @@
 		     (function (lambda (x y)
 				 (> (nnir-artitem-rsv x)
 				    (nnir-artitem-rsv y)))))))
-    (message "Can't search non-gmane nntp groups")))
+    (message "Can't search non-gmane nntp groups")
+    nil))
 
 ;;; Util Code:
 
 (defun nnir-read-parms (query nnir-search-engine)
   "Reads additional search parameters according to `nnir-engines'."
   (let ((parmspec (caddr (assoc nnir-search-engine nnir-engines))))
-    (nconc query
+    (append query
 	   (mapcar 'nnir-read-parm parmspec))))
 
 (defun nnir-read-parm (parmspec)
@@ -1472,7 +1474,11 @@
 		    (with-current-buffer gnus-server-buffer
 		      (list (list (gnus-server-server-name))))
 		  (nnir-sort-groups-by-server
-		   (or gnus-group-marked (list (gnus-group-group-name)))))))
+		   (or gnus-group-marked
+		       (if (gnus-group-group-name)
+			   (list (gnus-group-group-name))
+			 (cdr (assoc (gnus-group-topic-name)
+				     gnus-topic-alist))))))))
     (apply 'vconcat
            (mapcar (lambda (x)
                      (let* ((server (car x))
@@ -1582,32 +1588,15 @@
 	(goto-char (point-min))
 	(unless (string= gnus-ignored-newsgroups "")
 	  (delete-matching-lines gnus-ignored-newsgroups))
-	;; We treat NNTP as a special case to avoid problems with
-	;; garbage group names like `"foo' that appear in some badly
-	;; managed active files. -jh.
-	(if (eq (car method) 'nntp)
-	    (while (not (eobp))
-	      (ignore-errors
-		(push (cons
-		       (mm-string-as-unibyte
-			(buffer-substring
-			 (point)
-			 (progn
-			   (skip-chars-forward "^ \t")
-			   (point))))
-		       (let ((last (read cur)))
-			 (cons (read cur) last)))
-		      groups))
-	      (forward-line))
-	  (while (not (eobp))
-	    (ignore-errors
-	      (push (mm-string-as-unibyte
-		     (let ((p (point)))
-		       (skip-chars-forward "^ \t\\\\")
-		       (setq name (buffer-substring (+ p 1) (- (point) 1)))
-		       (gnus-group-full-name name method)))
-		    groups))
-	    (forward-line)))))
+	(while (not (eobp))
+	  (ignore-errors
+	    (push (mm-string-as-unibyte
+		   (let ((p (point)))
+		     (skip-chars-forward "^ \t\\\\")
+		     (setq name (buffer-substring (+ p 1) (- (point) 1)))
+		     (gnus-group-full-name name method)))
+		  groups))
+	  (forward-line))))
     groups))
 
 ;; The end.