X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fgnus-namazu.el;h=46cc07198417b7fa023447cfd5882f0589694f57;hb=85be3726901ca453647897e26330fee8aa25d8c0;hp=f6ab885b773d96bcd72a6fb8631a344378844586;hpb=1fabb2b5947ffa87ee67e1fa80854eee3db46e97;p=elisp%2Fgnus.git- diff --git a/lisp/gnus-namazu.el b/lisp/gnus-namazu.el index f6ab885..46cc071 100644 --- a/lisp/gnus-namazu.el +++ b/lisp/gnus-namazu.el @@ -6,8 +6,6 @@ ;; Author: TSUCHIYA Masatoshi ;; 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) @@ -19,9 +17,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -37,26 +35,30 @@ ;;; 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 @@ -235,11 +237,13 @@ This means that the group \"nnimap+server:INBOX.group\" is placed in \"~/Maildir/.group\"." :group 'gnus-namazu :type '(repeat - (cons (regexp :tag "Regexp of group name") + (cons (choice (regexp :tag "Regexp of group name") + (const :tag "Groups served by `gnus-select-method'" t)) (string :tag "Base path of groups"))) :set (lambda (symbol value) (prog1 (set-default symbol value) - (gnus-namazu/make-directory-table)))) + (when (featurep 'gnus-namazu) + (gnus-namazu/make-directory-table t))))) ;;; Internal Variable: (defconst gnus-namazu/group-name-regexp "\\`nnvirtual:namazu-search\\?") @@ -291,7 +295,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." @@ -332,7 +337,9 @@ This means that the group \"nnimap+server:INBOX.group\" is placed in "-a" ; show all matches "-l") ; use list format gnus-namazu-additional-arguments - (list query) + (list (if gnus-namazu-command-prefix + (concat "'" query "'") + query)) gnus-namazu-index-directories))) (apply 'call-process (car commands) nil t nil (cdr commands)))) @@ -363,11 +370,20 @@ This means that the group \"nnimap+server:INBOX.group\" is placed in (gnus-namazu/server-directory method)))) (push (cons dir group) alist))) (dolist (pair gnus-namazu-remote-groups) - (when (string-match (car pair) group) - (setq dir (nnmail-group-pathname - (substring group (match-end 0)) - "/")) - (push (cons (concat (cdr dir) (substring dir 1)) group) + (when (setq dir + (or (and (eq t (car pair)) + (gnus-method-equal method gnus-select-method) + group) + (and (stringp (car pair)) + (string-match (car pair) group) + (substring group (match-end 0))))) + (setq dir (nnmail-group-pathname dir "/")) + (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))