Commit d406cffa authored by Andrew Cohen's avatar Andrew Cohen Committed by Katsumi Yamaoka

lisp/gnus/nnir.el: Allow nnir group creation based on an existing query

parent 75a2f981
2013-03-29 Andrew Cohen <>
* nnir.el: Define 'number-sequence for xemacs.
(gnus-summary-create-nnir-group): New function to create an nnir group
from an nnir summary buffer based on the current query.
(nnir-request-create-group): Update to allow nnir group creation based
on the current query.
2013-03-28 Katsumi Yamaoka <>
* nndraft.el (nndraft-request-expire-articles):
......@@ -173,7 +173,15 @@
;; For Emacs <22.2 and XEmacs.
(unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
(unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))
(unless (fboundp 'number-sequence)
(defun number-sequence (from to)
(let (seq (n 0) (next from))
(while (<= next to)
(setq seq (cons next seq)
n (1+ n)
next (+ from n )))
(nreverse seq)))))
(require 'nnoo)
(require 'gnus-group)
......@@ -1840,24 +1848,38 @@ article came from is also searched."
(add-hook 'gnus-summary-article-expire-hook 'nnir-registry-action t t))))
(defun gnus-summary-create-nnir-group ()
(let ((name (gnus-read-group "Group name: "))
(method "nnir")
(pgroup (if (gnus-group-prefixed-p gnus-newsgroup-name)
gnus-newsgroup-name '(nnir "nnir")))))
(with-current-buffer gnus-group-buffer
name method nil
(gnus-group-find-parameter pgroup)))))
(deffoo nnir-request-create-group (group &optional server args)
(message "Creating nnir group %s" group)
(let ((group (gnus-group-prefixed-name group '(nnir "nnir")))
(let* ((group (gnus-group-prefixed-name group '(nnir "nnir")))
(specs (assoc 'nnir-specs args))
(or (cdr (assoc 'nnir-query-spec specs))
(list (cons 'query
(read-string "Query: " nil 'nnir-search-history))))
(group-spec (list (list (read-string "Server: " nil nil)))))
group 'nnir-specs
(list (cons 'nnir-query-spec query-spec)
(cons 'nnir-group-spec group-spec)))
(read-string "Query: " nil 'nnir-search-history)))))
(or (cdr (assoc 'nnir-group-spec specs))
(list (list (read-string "Server: " nil nil)))))
(nnir-specs (list (cons 'nnir-query-spec query-spec)
(cons 'nnir-group-spec group-spec))))
(gnus-group-set-parameter group 'nnir-specs nnir-specs)
group 'nnir-artlist
(setq nnir-artlist
(list (cons 'nnir-query-spec query-spec)
(cons 'nnir-group-spec group-spec)))))
(or (cdr (assoc 'nnir-artlist args))
(nnir-run-query nnir-specs)))
(nnir-request-update-info group (gnus-get-info group)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment