-;;; gnus-namazu.el --- Search mail with Namazu. -*- coding: iso-2022-7bit; -*-
+;;; gnus-namazu.el --- Search mail with Namazu -*- coding: iso-2022-7bit; -*-
;; Copyright (C) 2000,2001,2002 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
;;; Quick Start:
;; If this module has already been installed, only 3 steps are
-;; required to search articles.
+;; required to search articles with this module.
;;
;; (1) Install Namazu.
;; (2) Start Gnus and type M-x gnus-namazu-create-index RET to make
;; 3 days; this period is set to `gnus-namazu-index-update-interval'.
;;
;; Indices will be updated when `gnus-namazu-search' is called. If
-;; you want to update indices whenever Gnus is started, you can put
-;; the following expression to your ~/.gnus or your ~/.emacs.
+;; you want to update indices everywhen Gnus is started, you can put
+;; the following expression to your ~/.gnus.
;;
;; (add-hook 'gnus-startup-hook 'gnus-namazu-update-all-indices)
;;
-;; In order to control mknmz closely, disable this feature and run
-;; mknmz by yourself. In this case, set nil to the above option.
+;; In order to control mknmz closely, disable the automatic updating
+;; feature and run mknmz by yourself. In this case, set nil to the
+;; above option.
;;
;; (setq gnus-namazu-index-update-interval nil)
;;
(defun gnus-namazu/update-p (directory &optional force)
"Return the DIRECTORY when the index undef the DIRECTORY should be updated."
- (setq directory (expand-file-name directory))
- (if gnus-namazu/update-process
- (when force
- (error "%s" "Can not run two update processes simultaneously"))
- (and (or force
- (gnus-namazu/index-old-p directory))
- (let ((status-file (gnus-namazu/status-file-name directory)))
- (or (file-exists-p status-file)
- (when force
- (error "Can not find status file: %s" status-file))))
- (let ((lock-file (gnus-namazu/lock-file-name directory)))
- (or (not (file-exists-p lock-file))
- (when force
- (error "Found lock file: %s" lock-file))))
- directory)))
-
-;;;###autoload
-(defun gnus-namazu-update-all-indices (&optional directories force)
- "Update all indices which is set to `gnus-namazu-index-directories'."
- (interactive (list nil t))
- (when (setq directories
- (delq nil (mapcar
- (lambda (d) (gnus-namazu/update-p d force))
- (or directories gnus-namazu-index-directories))))
- (gnus-namazu-update-index (car directories) force)
- (setq gnus-namazu/update-directories (cdr directories))))
+ (setq directory (file-name-as-directory (expand-file-name directory)))
+ (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
+ (gnus-namazu/index-old-p directory))
+ (let ((status-file (gnus-namazu/status-file-name directory)))
+ (or (file-exists-p status-file)
+ (error-message "Can not find status file: %s" status-file)))
+ (let ((lock-file (gnus-namazu/lock-file-name directory)))
+ (or (not (file-exists-p lock-file))
+ (error-message "Found lock file: %s" lock-file)))
+ directory))))
;;;###autoload
(defun gnus-namazu-update-index (directory &optional force)
(mapcar 'list gnus-namazu-index-directories) nil t)
(gnus-namazu/default-index-directory))
t))
- (setq directory (file-name-as-directory (expand-file-name directory)))
- (when (gnus-namazu/update-p directory force)
+ (when (setq directory (gnus-namazu/update-p directory force))
(with-current-buffer (get-buffer-create (concat " *mknmz*" directory))
(erase-buffer)
(unless (file-directory-p directory)
(error "Can not start %s"
gnus-namazu-make-index-command)))))))
+;;;###autoload
+(defun gnus-namazu-update-all-indices (&optional directories force)
+ "Update all indices which is set to `gnus-namazu-index-directories'."
+ (interactive (list nil t))
+ (when (setq directories
+ (delq nil (mapcar
+ (lambda (d) (gnus-namazu/update-p d force))
+ (or directories gnus-namazu-index-directories))))
+ (setq gnus-namazu/update-directories (cdr directories))
+ (gnus-namazu-update-index (car directories))))
+
(defun gnus-namazu/update-sentinel (process event)
(let ((buffer (process-buffer process)))
(when (buffer-name buffer)
@uref{http://namazu.org/}
@end example
-\e$B<!$K!"$"$J$?$NHkB"$N%a!<%k$H1JB35-;v$N;3$N:w0z$r:n$j$^$9!#$=$N$?$a$K$O!"\e(B
-\e$B0J2<$N\e(B2\e$B$D$N%3%^%s%I$r<B9T$9$kI,MW$,$"$k$G$7$g$&!#\e(B
-
-@example
- % mkdir ~/News/namazu
- % mknmz -a -h -O ~/News/namazu ~/Mail ~/News/cache
-@end example
-
-\e$B$3$N%3%^%s%I$O!"\e(B(1) @file{~/News/namazu/} \e$B$H$$$&%G%#%l%/%H%j$r:n@.$9$k!"\e(B
-(2) \e$B$=$N%G%#%l%/%H%j$K\e(B @file{~/Mail/} \e$B0J2<$KJ]B8$5$l$F$$$k%a!<%k$H\e(B
-@file{~/News/cache/} \e$B0J2<$KJ]B8$5$l$F$$$k1JB35-;v$N:w0z$r:n@.$9$k!"$H\e(B
-\e$B$$$&0UL#$G$9!#\e(B
-
-\e$B$5$"!"$3$l$G=`Hw$,$G$-$^$7$?!#\e(B
+@findex gnus-namazu-create-index
+\e$B<!$K!"$"$J$?$NHkB"$N%a!<%k$H1JB35-;v$N;3$N:w0z$r:n$k$?$a$K!"\e(B
+@kbd{M-x gnus-namazu-create-index} \e$B$H$7$F$/$@$5$$!#$5$"!"$3$l$G=`Hw$,\e(B
+\e$B$G$-$?$O$:$G$9!#\e(B
@kindex C-c C-n (\e$B%0%k!<%W\e(B)
@kindex C-c C-n (\e$B35N,\e(B)
\e$B$N9T$K0\F0$7$F!"<!$N$h$&$K8!:w$9$k$3$H$,$G$-$^$9!#\e(B
@example
- @kbd{M-1 C-c C-n namazu RET}
+ @kbd{1 C-c C-n namazu RET}
@end example
\e$B$^$?!"35N,%P%C%U%!$+$i!"$$$-$J$j8!:w$9$k$3$H$b$G$-$^$9!#$3$N>l9g!"8!:w\e(B
@kbd{C-c C-n +from:"Your E-Mail Address" RET}
@end example
-\e$B:G8e$K!"\e(BNamazu \e$B$r$h$/J,$+$C$F$$$k?M$K$O!"ITMW$JCm0U$r0l$D!#\e(BNamazu \e$B$O!"\e(B
-\e$B;vA0$K:n@.$5$l$?:w0z$rMQ$$$F8!:w$r9T$$!":w0z$K$N$C$F$$$J$$%U%!%$%k$K$O\e(B
-\e$BL\$b$/$l$^$;$s!#$@$+$i!"Dj4|E*$K\e(B @code{mknmz} \e$B$r8F$S=P$7$F!"?7$?$J%a!<\e(B
-\e$B%k$N:w0z$rDI2C$7$J$$$H!"?7$7$$%a!<%k$O$$$D$^$G$?$C$F$b8!:w$5$l$J$$$3$H\e(B
-\e$B$K$J$j$^$9$+$i!"$"$7$+$i$:!#\e(B
+@vindex gnus-namazu-index-update-interval
+Namazu \e$B$O!";vA0$K=`Hw$5$l$?:w0z$rMQ$$$F8!:w$r9T$&$h$&$K@_7W$5$l$?8!:w\e(B
+\e$B%(%s%8%s$J$N$G!":w0z$KEPO?$5$l$F$$$J$$%U%!%$%k$O40A4$KL5;k$5$l$^$9!#$D\e(B
+\e$B$^$j!"Dj4|E*$K\e(B @code{mknmz} \e$B$r8F$S=P$7$F!"?7$?$J%a!<%k$N:w0z$rDI2C$7$J\e(B
+\e$B$$$H!"?7$7$$%a!<%k$O$$$D$^$G$?$C$F$b8!:wBP>]$K$J$i$J$$$3$H$K$J$j$^$9!#\e(B
+@file{gnus-namazu.el} \e$B$O!"\e(B@code{gnus-namazu-index-update-interval} \e$B$K\e(B
+\e$B;XDj$5$l$?4|4VKh$K<+F0E*$K:w0z$r99?7$9$k5!G=$rDs6!$7$F$$$^$9!#%G%U%)%k\e(B
+\e$B%H$N@_Dj$G$O!"\e(B3\e$BF|$*$-$K:w0z$r99?7$9$k$h$&$K$J$C$F$$$^$9$,!"$b$C$HIQHK\e(B
+\e$B$K\e(B(\e$BNc$($P\e(B1\e$BF|$*$-\e(B)\e$B$K99?7$9$k$h$&$K$7$?$$$J$i$P!"0J2<$N@_Dj$r\e(B
+@file{~/.gnus} \e$B$KDI2C$7$F$/$@$5$$!#\e(B
+
+@example
+(setq gnus-namazu-index-update-interval 86400)
+@end example
+
+\e$B5U$K!":w0z$N99?7$r<+F0E*$K9T$$$?$/$J$$$J$i$P!"0J2<$N;XDj$r\e(B
+@file{~/.gnus} \e$B$KDI2C$7$F$/$@$5$$!#\e(B
+
+@example
+(setq gnus-namazu-index-update-interval nil)
+@end example
+
+@findex{gnus-namazu-update-all-indices}
+\e$B$3$N>l9g!":w0z$r<jF0$G99?7$9$k$?$a$K\e(B @kbd{M-x
+gnus-namazu-update-all-indices} \e$B$H$9$kI,MW$,$"$k$+$b$7$l$^$;$s!#\e(B
@node Gnus Unplugged
@section Gnus \e$B$N@Z$jN%$7\e(B