X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=blobdiff_plain;f=contrib%2Fgnus-namazu.el;h=91db91da7645b09ec509f5659492704cda6d3b5c;hp=bd8a94ed984370a1de7c65589e232d2550594eb1;hb=37645a283b23df8169ab52431b0f0baa24a79533;hpb=125d88b46ad2efa065f06d5dac37a245b488985a diff --git a/contrib/gnus-namazu.el b/contrib/gnus-namazu.el index bd8a94ed9..91db91da7 100644 --- a/contrib/gnus-namazu.el +++ b/contrib/gnus-namazu.el @@ -8,7 +8,7 @@ ;; 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) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; This program is distributed in the hope that it will be useful, @@ -17,9 +17,7 @@ ;; 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 this program; if not, see . ;;; Commentary: @@ -103,6 +101,7 @@ (require 'nnheader) (require 'nnmail) (require 'gnus-sum) +(require 'gmm-utils) ;; To suppress byte-compile warning. (eval-when-compile @@ -237,7 +236,8 @@ 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) @@ -336,7 +336,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)))) @@ -362,16 +364,27 @@ This means that the group \"nnimap+server:INBOX.group\" is placed in (when (memq (car (setq method (gnus-find-method-for-group group))) '(nnml nnmh)) (when (file-directory-p - (setq dir (nnmail-group-pathname - (gnus-group-short-name group) - (gnus-namazu/server-directory method)))) + (setq dir (let (file-name-handler-alist) + (nnmail-group-pathname + (gnus-group-short-name group) + (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 pair) (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 (let (file-name-handler-alist) + (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)) @@ -768,9 +781,9 @@ than the period that is set to `gnus-namazu-index-update-interval'" (defun gnus-namazu/update-p (directory &optional force) "Return the DIRECTORY when the index undef the DIRECTORY should be updated." (setq directory (file-name-as-directory (expand-file-name directory))) - (labels ((error-message (format &rest args) - (apply (if force 'error 'message) format args) - nil)) + (gmm-labels ((error-message (format &rest args) + (apply (if force 'error 'message) format args) + nil)) (if gnus-namazu/update-process (error-message "%s" "Can not run two update processes simultaneously") (and (or force @@ -896,5 +909,4 @@ is called." (provide 'gnus-namazu) -;;; arch-tag: a6814a35-593a-4563-8157-a2b762c29ed8 ;; gnus-namazu.el ends here.