Synch to No Gnus 200502120211.
[elisp/gnus.git-] / lisp / gnus-namazu.el
index 7542cac..081ba22 100644 (file)
@@ -6,8 +6,6 @@
 ;; Author: TSUCHIYA Masatoshi <tsuchiya@namazu.org>
 ;; Keywords: mail searching namazu
 
-;; This file is a part of Semi-Gnus.
-
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
 ;; the Free Software Foundation; either version 2, or (at your option)
 
 ;;; Quick Start:
 
-;; If this module has already been installed, only 3 steps are
+;; If this module has already been installed, only four steps are
 ;; required to search articles with this module.
 ;;
 ;;   (1) Install Namazu.
-;;   (2) Start Gnus and type M-x gnus-namazu-create-index RET to make
+;;
+;;   (2) Put this expression into your ~/.gnus.
+;;
+;;          (gnus-namazu-insinuate)
+;;
+;;   (3) Start Gnus and type M-x gnus-namazu-create-index RET to make
 ;;       index of articles.
-;;   (3) In group buffer or in summary buffer, type C-c C-n query RET.
+;;
+;;   (4) In group buffer or in summary buffer, type C-c C-n query RET.
 
 
 ;;; Install:
 
 ;; Before installing this module, you must install Namazu.
 ;;
-;; This file is a part of T-gnus but is not *YET* a part of Gnus.
-;; When you would like to use this module in Gnus (not T-gnus), put
-;; this file into the lisp/ directory in the Gnus source tree and run
-;; `make install'.  And then, put the following expression into your
+;; When you would like to byte-compile this module in Gnus, put this
+;; file into the lisp/ directory in the Gnus source tree and run `make
+;; install'.  And then, put the following expression into your
 ;; ~/.gnus.
 ;;
-;;      (require 'gnus-namazu)
 ;;      (gnus-namazu-insinuate)
 ;;
 ;; In order to make index of articles with Namazu before using this
@@ -225,7 +227,7 @@ options make any sense in this context."
 
 (defcustom gnus-namazu-remote-groups nil
   "*Alist of regular expressions matching remote groups and their base paths.
-If you use an IMAP server and have a apecial index, set this option as
+If you use an IMAP server and have a special index, set this option as
 follows:
 
     (setq gnus-namazu-remote-groups
@@ -239,7 +241,8 @@ This means that the group \"nnimap+server:INBOX.group\" is placed in
                (string :tag "Base path of groups")))
   :set (lambda (symbol value)
         (prog1 (set-default symbol value)
-          (gnus-namazu/make-directory-table t))))
+          (when (featurep 'gnus-namazu)
+            (gnus-namazu/make-directory-table t)))))
 
 ;;; Internal Variable:
 (defconst gnus-namazu/group-name-regexp "\\`nnvirtual:namazu-search\\?")
@@ -291,7 +294,8 @@ This means that the group \"nnimap+server:INBOX.group\" is placed in
           (push (cons gnus-namazu/group-name-regexp
                       gnus-namazu-coding-system)
                 gnus-group-name-charset-group-alist))))
-  (gnus-namazu-update-all-indices))
+  (unless gnus-namazu-command-prefix
+    (gnus-namazu-update-all-indices)))
 
 (defun gnus-namazu/server-directory (server)
   "Return the top directory of the server SERVER."
@@ -367,7 +371,12 @@ This means that the group \"nnimap+server:INBOX.group\" is placed in
               (setq dir (nnmail-group-pathname
                          (substring group (match-end 0))
                          "/"))
-              (push (cons (concat (cdr pair) (substring dir 1)) group)
+              (push (cons (concat (cdr pair)
+                                  ;; nnmail-group-pathname() on some
+                                  ;; systems returns pathnames which
+                                  ;; have drive letters at their top.
+                                  (substring dir (1+ (string-match "/" dir))))
+                          group)
                     alist)))))
        gnus-newsrc-hashtb)
       (dolist (pair (nconc agent cache alist))