[gnus git] branch master updated: m0-5-297-g27103cb =1= nnir.el: Small optimizations. Use 'gnus-group-guess-full-name-from-command-method

Andrew Cohen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  27103cb22cba6e487353c169a0c962b87f8e4f83 (commit)
      from  23471335ba08ac2ddfe332ff6cbc9c1c230edf69 (commit)


- Log -----------------------------------------------------------------
commit 27103cb22cba6e487353c169a0c962b87f8e4f83
Author: Andrew Cohen <[email protected]>
Date:   Wed Apr 10 10:40:39 2013 -0400

    nnir.el: Small optimizations. Use 'gnus-group-guess-full-name-from-command-method

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a10ca20..9f5eeb8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -4,6 +4,11 @@
 	(nnir-request-set-mark): New function.
 	(nnir-request-update-info): Improve marks updating.
 	(nnir-request-scan): Don't duplicate marks updating.
+	(gnus-group-make-nnir-group, nnir-run-imap, nnir-request-create-group):
+	Use 'assq rather than 'assoc. Quote anonymous function.
+	(nnir-request-group, nnir-close-group, gnus-summary-create-nnir-group):
+	Use 'gnus-group-prefixed-p.
+	(gnus-summary-create-nnir-group): Make sure server for method is open.
 
 2013-04-04  Andrew Cohen  <[email protected]>
 
diff --git a/lisp/nnir.el b/lisp/nnir.el
index ef7bc24..882e863 100644
--- a/lisp/nnir.el
+++ b/lisp/nnir.el
@@ -602,7 +602,7 @@ an alist with `nnir-query-spec' and `nnir-group-spec' keys, and
 skips all prompting."
   (interactive "P")
   (let* ((group-spec
-	  (or (cdr (assoc 'nnir-group-spec specs))
+	  (or (cdr (assq 'nnir-group-spec specs))
 	    (if (gnus-server-server-name)
 		(list (list (gnus-server-server-name)))
 	      (nnir-categorize
@@ -612,7 +612,7 @@ skips all prompting."
 		     (cdr (assoc (gnus-group-topic-name) gnus-topic-alist))))
 	       gnus-group-server))))
 	 (query-spec
-	  (or (cdr (assoc 'nnir-query-spec specs))
+	  (or (cdr (assq 'nnir-query-spec specs))
 	    (apply
 	     'append
 	     (list (cons 'query
@@ -659,9 +659,7 @@ skips all prompting."
 
 (deffoo nnir-request-group (group &optional server dont-check info)
   (nnir-possibly-change-group group server)
-  (let ((pgroup (if (gnus-group-prefixed-p group)
-		    group
-		  (gnus-group-prefixed-name  group '(nnir "nnir"))))
+  (let ((pgroup (gnus-group-guess-full-name-from-command-method group))
 	length)
     ;; Check for cached search result or run the query and cache the
     ;; result.
@@ -893,9 +891,7 @@ skips all prompting."
 
 
 (deffoo nnir-close-group (group &optional server)
-  (let ((pgroup (if (gnus-group-prefixed-p group)
-		    group
-		  (gnus-group-prefixed-name  group '(nnir "nnir")))))
+  (let ((pgroup (gnus-group-guess-full-name-from-command-method group)))
     (when (and nnir-artlist (not (gnus-ephemeral-group-p pgroup)))
       (gnus-group-set-parameter  pgroup 'nnir-artlist nnir-artlist))
     (setq nnir-artlist nil)
@@ -972,7 +968,7 @@ details on the language and supported extensions."
        'vconcat
        (catch 'found
          (mapcar
-          (lambda (group)
+          #'(lambda (group)
             (let (artlist)
               (condition-case ()
                   (when (nnimap-change-group
@@ -1870,12 +1866,11 @@ article came from is also searched."
 
 (defun gnus-summary-create-nnir-group ()
   (interactive)
+  (or (nnir-server-opened "") (nnir-open-server "nnir"))
   (let ((name (gnus-read-group "Group name: "))
-	(method "nnir")
-	(pgroup (if (gnus-group-prefixed-p gnus-newsgroup-name)
-		    gnus-newsgroup-name
-		  (gnus-group-prefixed-name
-		   gnus-newsgroup-name '(nnir "nnir")))))
+	(method '(nnir ""))
+	(pgroup
+	 (gnus-group-guess-full-name-from-command-method gnus-newsgroup-name)))
     (with-current-buffer gnus-group-buffer
       (gnus-group-make-group
        name method nil
@@ -1885,20 +1880,20 @@ article came from is also searched."
 (deffoo nnir-request-create-group (group &optional server args)
   (message "Creating nnir group %s" group)
   (let* ((group (gnus-group-prefixed-name  group '(nnir "nnir")))
-         (specs (assoc 'nnir-specs args))
+         (specs (assq 'nnir-specs args))
          (query-spec
-          (or (cdr (assoc 'nnir-query-spec specs))
+          (or (cdr (assq 'nnir-query-spec specs))
               (list (cons 'query
                           (read-string "Query: " nil 'nnir-search-history)))))
          (group-spec
-          (or (cdr (assoc 'nnir-group-spec specs))
+          (or (cdr (assq '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)
     (gnus-group-set-parameter
      group 'nnir-artlist
-     (or (cdr (assoc 'nnir-artlist args))
+     (or (cdr (assq 'nnir-artlist args))
          (nnir-run-query nnir-specs)))
     (nnir-request-update-info group (gnus-get-info group)))
   t)

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