Sync.
authoryamaoka <yamaoka>
Mon, 15 May 2000 22:09:35 +0000 (22:09 +0000)
committeryamaoka <yamaoka>
Mon, 15 May 2000 22:09:35 +0000 (22:09 +0000)
lisp/ChangeLog
lisp/mail-source.el
texi/ChangeLog
texi/gnus-ja.texi
texi/gnus.texi

index ba0d052..c356592 100644 (file)
@@ -1,3 +1,8 @@
+2000-05-15 09:46:47  Shenghuo ZHU  <zsh@cs.rochester.edu>
+
+       * 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  <zsh@cs.rochester.edu>
 
        * nnmail.el (nnmail-scan-directory-mail-source-once): New variable.
index 022caa6..ff254c5 100644 (file)
@@ -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
index 7229fe8..dd1ea11 100644 (file)
@@ -1,3 +1,7 @@
+2000-05-15 10:16:29  Shenghuo ZHU  <zsh@cs.rochester.edu>
+
+       * gnus.texi (Mail Source Specifiers): Update maildir.
+
 2000-05-02  Pavel Janik  <Pavel.Janik@inet.cz>
 
        * gnus.texi (MIME comands): Spelling fix.
index 83cf8a8..93edfa5 100644 (file)
@@ -10671,7 +10671,7 @@ POP \e$(B%5!<%P!<$+$i%a!<%k$r<hF@$9$k$?$a$K;H$&4X?t$G$9!#$=$N4X?t$O0l$D$N%Q%i\e(B
 @end lisp
 
 @item maildir
-maildir \e$(B$+$i%a!<%k$r<hF@$7$^$9!#$3$l$O8=:_\e(B qmail \e$(B$H\e(B postfix \e$(B$G$N$_$G%5%]!<\e(B
+Maildir \e$(B$+$i%a!<%k$r<hF@$7$^$9!#$3$l$O8=:_\e(B qmail \e$(B$H\e(B postfix \e$(B$G$N$_$G%5%]!<\e(B
 \e$(B%H$5$l$F$$$k\e(B mailbox \e$(B7A<0$G!"FCJL$N%G%#%l%/%H%j!<$N$=$l$>$l$N%U%!%$%k$,\e(B
 \e$(B@53N$K\e(B1\e$(B%a!<%k$H$J$C$F$$$^$9!#\e(B
 
@@ -10679,26 +10679,28 @@ maildir \e$(B$+$i%a!<%k$r<hF@$7$^$9!#$3$l$O8=:_\e(B qmail \e$(B$H\e(B postfix \e$(B$G
 
 @table @code
 @item :path
-\e$(B%a!<%k$,J]B8$5$l$k%G%#%l%/%H%j!<$N%Q%9$G$9!#=i4|CM$O\e(B
-@samp{~/Maildir/new} \e$(B$G$9!#\e(B
+\e$(B%a!<%k$,J]B8$5$l$k%G%#%l%/%H%j!<$N%Q%9$G$9!#=i4|CM$O4D6-JQ?t\e(B
+@code{MAILDIR} \e$(B$+$i<hF@$7$?CM$+!"$^$?$O\e(B @samp{~/Maildir/} \e$(B$G$9!#\e(B
+@item :subdirs
+Maildir \e$(B$N%5%V%G%#%l%/%H%j$G$9!#=i4|CM$O\e(B @samp{("new" "cur")} \e$(B$G$9!#\e(B
 
-Gnus \e$(B$G<hF@$9$kA0$K!"$H$-$I$-\e(B pop3 \e$(B%G!<%b%s$G%a!<%k$rC5$9$J$i!"0J2<$N:G\e(B
-\e$(B=i$NNc$N$h$&$K!"\e(Bmaildir \e$(B$NCf$N\e(B @code{cur} \e$(B%G%#%l%/%H%j!<$+$i$b%a!<%k$r<h\e(B
-\e$(BF@$9$kI,MW$,$"$j$^$9!#\e(B
+@c Gnus \e$(B$G<hF@$9$kA0$K!"$H$-$I$-\e(B pop3 \e$(B%G!<%b%s$G%a!<%k$rC5$9$J$i!"0J2<$N:G\e(B
+@c \e$(B=i$NNc$N$h$&$K!"\e(Bmaildir \e$(B$NCf$N\e(B @code{cur} \e$(B%G%#%l%/%H%j!<$+$i$b%a!<%k$r<h\e(B
+@c \e$(BF@$9$kI,MW$,$"$j$^$9!#\e(B
 
 \e$(B%j%b!<%H%^%7%s$+$i%a!<%k$r<h$j4s$;$k$3$H$b=PMh$^$9!#\e(B
 (\e$(B$H$$$&$N$b!"\e(Bmaildir \e$(B$O%m%C%/$NLdBj$r5$$K$;$:$K:Q$`$+$i!#\e(B)
 
 @end table
 
-maildir \e$(B%a!<%k%=!<%9$NNc$r$U$?$D\e(B:
+Maildir \e$(B%a!<%k%=!<%9$NNc$r$U$?$D\e(B:
 
 @lisp
-(maildir :path "/home/user-name/Maildir/cur")
+(maildir :path "/home/user-name/Maildir/" :subdirs ("cur" "new"))
 @end lisp
 
 @lisp
-(maildir :path "/user@@remotehost.org:~/Maildir/new")
+(maildir :path "/user@@remotehost.org:~/Maildir/" :subdirs ("new"))
 @end lisp
 
 @item imap
index 3c1d4f5..77cdb37 100644 (file)
@@ -11096,12 +11096,16 @@ Keywords:
 @table @code
 @item :path
 The path of the directory where the mails are stored.  The default is
-@samp{~/Maildir/new}.
+taken from the @code{MAILDIR} environment variable or
+@samp{~/Maildir/}.
+@item :subdirs
+The subdirectories of the Maildir.  The default is
+@samp{("new" "cur")}.
 
-If you sometimes look at your mail through a pop3 daemon before fetching
-them with Gnus, you may also have to fetch your mails from the
-@code{cur} directory inside the maildir, like in the first example
-below.
+@c If you sometimes look at your mail through a pop3 daemon before fetching
+@c them with Gnus, you may also have to fetch your mails from the
+@c @code{cur} directory inside the maildir, like in the first example
+@c below.
 
 You can also get mails from remote hosts (because maildirs don't suffer
 from locking problems).
@@ -11111,11 +11115,11 @@ from locking problems).
 Two example maildir mail sources:
 
 @lisp
-(maildir :path "/home/user-name/Maildir/cur")
+(maildir :path "/home/user-name/Maildir/" :subdirs ("cur" "new"))
 @end lisp
 
 @lisp
-(maildir :path "/user@@remotehost.org:~/Maildir/new")
+(maildir :path "/user@@remotehost.org:~/Maildir/" :subdirs ("new"))
 @end lisp
 
 @item imap