gnus-notifications: add actions support
[gnus] / lisp / nnir.el
index 88fd4fe..1d78703 100644 (file)
@@ -1,6 +1,6 @@
 ;;; nnir.el --- search mail with various search engines -*- coding: iso-8859-1 -*-
 
-;; Copyright (C) 1998-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2012 Free Software Foundation, Inc.
 
 ;; Author: Kai Großjohann <grossjohann@ls6.cs.uni-dortmund.de>
 ;; Swish-e and Swish++ backends by:
@@ -288,7 +288,7 @@ is `(valuefunc member)'."
 (eval-when-compile
   (autoload 'nnimap-buffer "nnimap")
   (autoload 'nnimap-command "nnimap")
-  (autoload 'nnimap-possibly-change-group "nnimap")
+  (autoload 'nnimap-change-group "nnimap")
   (autoload 'nnimap-make-thread-query "nnimap")
   (autoload 'gnus-registry-action "gnus-registry"))
 
@@ -298,18 +298,19 @@ is `(valuefunc member)'."
 (defvoo nnir-address nil
   "The address of the nnir server.")
 
-(gnus-declare-backend "nnir" 'mail)
+(gnus-declare-backend "nnir" 'mail 'virtual)
 
 
 ;;; User Customizable Variables:
 
 (defgroup nnir nil
-  "Search groups in Gnus with assorted seach engines."
+  "Search groups in Gnus with assorted search engines."
   :group 'gnus)
 
 (defcustom nnir-ignored-newsgroups ""
   "*A regexp to match newsgroups in the active file that should
   be skipped when searching."
+  :version "24.1"
   :type '(regexp)
   :group 'nnir)
 
@@ -324,6 +325,7 @@ with three items unique to nnir summary buffers:
 %g    Article original short group name (string)
 
 If nil this will use `gnus-summary-line-format'."
+  :version "24.1"
   :type '(string)
   :group 'nnir)
 
@@ -335,6 +337,7 @@ retrieved header format.
 
 If this variable is nil, or if the provided function returns nil for a search
 result, `gnus-retrieve-headers' will be called instead."
+  :version "24.1"
   :type '(function)
   :group 'nnir)
 
@@ -342,6 +345,7 @@ result, `gnus-retrieve-headers' will be called instead."
   "*The default IMAP search key for an nnir search. Must be one of
   the keys in `nnir-imap-search-arguments'. To use raw imap queries
   by default set this to \"Imap\"."
+  :version "24.1"
   :type `(choice ,@(mapcar (lambda (elem) (list 'const (car elem)))
                           nnir-imap-search-arguments))
   :group 'nnir)
@@ -503,6 +507,7 @@ arrive at the correct group name, \"mail.misc\"."
 
 (defcustom nnir-notmuch-program "notmuch"
   "*Name of notmuch search executable."
+  :version "24.1"
   :type '(string)
   :group 'nnir)
 
@@ -513,6 +518,7 @@ Note that this should be a list.  Ie, do NOT use the following:
     (setq nnir-notmuch-additional-switches \"-i -w\") ; wrong
 Instead, use this:
     (setq nnir-notmuch-additional-switches '(\"-i\" \"-w\"))"
+  :version "24.1"
   :type '(repeat (string))
   :group 'nnir)
 
@@ -523,6 +529,7 @@ regular expression.
 
 This variable is very similar to `nnir-namazu-remove-prefix', except
 that it is for notmuch, not Namazu."
+  :version "24.1"
   :type '(regexp)
   :group 'nnir)
 
@@ -573,6 +580,7 @@ Add an entry here when adding a new search engine.")
   '((nnimap . imap)
     (nntp . gmane))
   "*Alist of default search engines keyed by server method."
+  :version "24.1"
   :type `(repeat (cons (choice (const nnimap) (const nttp) (const nnspool)
                               (const nneething) (const nndir) (const nnmbox)
                               (const nnml) (const nnmh) (const nndraft)
@@ -670,7 +678,8 @@ Add an entry here when adding a new search engine.")
          (goto-char (point-min))
          (while (not (eobp))
            (let* ((novitem (funcall parsefunc))
-                  (artno (mail-header-number novitem))
+                  (artno (and novitem
+                              (mail-header-number novitem)))
                   (art (car (rassq artno articleids))))
              (when art
                (mail-header-set-number novitem art)
@@ -845,7 +854,7 @@ details on the language and supported extensions."
          (lambda (group)
            (let (artlist)
              (condition-case ()
-                 (when (nnimap-possibly-change-group
+                 (when (nnimap-change-group
                         (gnus-group-short-name group) server)
                    (with-current-buffer (nnimap-buffer)
                      (message "Searching %s..." group)
@@ -1269,12 +1278,12 @@ Tested with swish-e-2.0.1 on Windows NT 4.0."
           ;; nnir-search failure reason is in this buffer, show it if
           ;; the user wants it.
           (when (> gnus-verbose 6)
-            (display-buffer nnir-tmp-buffer)))) ;; FIXME: Dont clear buffer !
+            (display-buffer nnir-tmp-buffer)))) ;; FIXME: Don't clear buffer !
       (message "Doing hyrex-search query \"%s\"...done" qstring)
       (sit-for 0)
       ;; nnir-search returns:
-      ;;   for nnml/nnfolder: "filename mailid weigth"
-      ;;   for nnimap:        "group mailid weigth"
+      ;;   for nnml/nnfolder: "filename mailid weight"
+      ;;   for nnimap:        "group mailid weight"
       (goto-char (point-min))
       (delete-non-matching-lines "^\\S + [0-9]+ [0-9]+$")
       ;; HyREX doesn't search directly in groups -- so filter out here.