From ae299fea39d28fe7faa1e635b8f09d27bba65547 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Mon, 15 May 2000 22:09:35 +0000 Subject: [PATCH] Sync. --- lisp/ChangeLog | 5 +++++ lisp/mail-source.el | 36 ++++++++++++++++++++++++++++-------- texi/ChangeLog | 4 ++++ texi/gnus-ja.texi | 20 +++++++++++--------- texi/gnus.texi | 18 +++++++++++------- 5 files changed, 59 insertions(+), 24 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ba0d052..c356592 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2000-05-15 09:46:47 Shenghuo ZHU + + * mail-source.el (mail-source-fetch-maildir): Insert "From ". + (mail-source-keyword-map): Add "subdirs" for maildir. + 2000-05-14 16:19:28 Shenghuo ZHU * nnmail.el (nnmail-scan-directory-mail-source-once): New variable. diff --git a/lisp/mail-source.el b/lisp/mail-source.el index 022caa6..ff254c5 100644 --- a/lisp/mail-source.el +++ b/lisp/mail-source.el @@ -115,7 +115,8 @@ Common keywords should be listed here.") (:connection) (:authentication password)) (maildir - (:path "~/Maildir/new/") + (:path (or (getenv "MAILDIR") "~/Maildir/")) + (:subdirs ("new" "cur")) (:function)) (imap (:server (getenv "MAILHOST")) @@ -608,13 +609,32 @@ This only works when `display-time' is enabled." "Fetcher for maildir sources." (mail-source-bind (maildir source) (let ((found 0) - (mail-source-string (format "maildir:%s" path))) - (dolist (file (directory-files path t)) - (when (and (not (file-directory-p file)) - (not (if function - (funcall function file mail-source-crash-box) - (rename-file file mail-source-crash-box)))) - (incf found (mail-source-callback callback file)))) + mail-source-string) + (unless (string-match "/$" path) + (setq path (concat path "/"))) + (dolist (subdir subdirs) + (when (file-directory-p (concat path subdir)) + (setq mail-source-string (format "maildir:%s%s" path subdir)) + (dolist (file (directory-files (concat path subdir) t)) + (when (and (not (file-directory-p file)) + (not (if function + (funcall function file mail-source-crash-box) + (let ((coding-system-for-write + mm-text-coding-system) + (coding-system-for-read + mm-text-coding-system)) + (with-temp-file mail-source-crash-box + (insert-file-contents file) + (goto-char (point-min)) + (unless (looking-at "\n*From ") + (insert "From maildir " + (current-time-string) "\n")) + (while (re-search-forward "^From " nil t) + (replace-match ">From ")) + (goto-char (point-max)) + (insert "\n\n")) + (delete-file file))))) + (incf found (mail-source-callback callback file)))))) found))) (eval-and-compile diff --git a/texi/ChangeLog b/texi/ChangeLog index 7229fe8..dd1ea11 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,7 @@ +2000-05-15 10:16:29 Shenghuo ZHU + + * gnus.texi (Mail Source Specifiers): Update maildir. + 2000-05-02 Pavel Janik * gnus.texi (MIME comands): Spelling fix. diff --git a/texi/gnus-ja.texi b/texi/gnus-ja.texi index 83cf8a8..93edfa5 100644 --- a/texi/gnus-ja.texi +++ b/texi/gnus-ja.texi @@ -10671,7 +10671,7 @@ POP $(B%5!<%P!<$+$i%a!<%k$r$l$N%U%!%$%k$,(B $(B@53N$K(B1$(B%a!<%k$H$J$C$F$$$^$9!#(B @@ -10679,26 +10679,28 @@ maildir $(B$+$i%a!<%k$r