# HG changeset patch # User Katsumi Yamaoka # Date 1288655258 0 # Node ID 1431aee91437ab9a807089b04572e0fc43869465 # Parent 1d510dd4f3361770e5cff107d7f8df1d52bd5344 nnir.el: Fix various bugs. diff -r 1d510dd4f336 -r 1431aee91437 lisp/gnus/ChangeLog --- 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 + + * 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 * gnus-cite.el (gnus-article-foldable-buffer): Protect against diff -r 1d510dd4f336 -r 1431aee91437 lisp/gnus/nnir.el --- 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.