Synch up with main trunk.
authorteranisi <teranisi>
Wed, 26 Dec 2001 04:14:32 +0000 (04:14 +0000)
committerteranisi <teranisi>
Wed, 26 Dec 2001 04:14:32 +0000 (04:14 +0000)
21 files changed:
ChangeLog
Makefile
NEWS
NEWS.ja
README.ja
WL-MK
doc/wl-ja.texi
doc/wl.texi
elmo/ChangeLog
elmo/elmo-archive.el
elmo/elmo-imap4.el
elmo/elmo-msgdb.el
elmo/elmo-multi.el
elmo/elmo-nmz.el
elmo/elmo-nntp.el
elmo/elmo-pop3.el
elmo/elmo-shimbun.el
elmo/elmo-util.el
elmo/elmo.el
wl/ChangeLog
wl/wl-draft.el

index dd581cf..488dbf3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-12-26  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * NEWS, NEWS.ja: Added description about
+       `elmo-enable-disconnected-operation'.
+
+       * WL-MK (update-version): New function.
+
+       * Makefile (update-version): Added.
+
 2001-12-18  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * samples/ja/dot.wl,samples/en/dot.wl (my-wl-summary-subject-func-ml):
index 57c1aef..68e7a7a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -36,6 +36,9 @@ check:
 test:
        $(EMACS) $(FLAGS) -l WL-MK -f test-wl $(LISPDIR) $(PIXMAPDIR)
 
+update-version:
+       $(EMACS) $(FLAGS) -l WL-MK -f update-version $(LISPDIR) $(PIXMAPDIR)
+
 install-elc:
        $(EMACS) $(FLAGS) -l WL-MK -f install-wl-package $(LISPDIR) $(PIXMAPDIR)
 
diff --git a/NEWS b/NEWS
index f8b1f96..d5328ec 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -77,6 +77,10 @@ Wanderlust NEWS -- User-visible changes in Wanderlust.
    elmo-cache-directory (e.g. for whom put symbolic link for ~/.elmo/cache
    on NFS environment).
 
+** Default value of elmo-enable-disconnected-operation is now `t'.
+   When the relevant messages are cached, you can do some operations
+   even in the off-line state.
+
 * Version 2.6.1 is basically a bug fix version of 2.6.0.
 
 ** Fixed a problem that Emacs 21 causes `Recursive load...' error.
diff --git a/NEWS.ja b/NEWS.ja
index 306920b..a1e8493 100644 (file)
--- a/NEWS.ja
+++ b/NEWS.ja
@@ -78,6 +78,10 @@ Wanderlust NEWS (\e$BF|K\8lHG\e(B) -- User-visible changes in Wanderlust.
    \e$BJ}$O!"\e(Belmo-cache-directory \e$B$r@_Dj$9$k$3$H$K$h$C$F%-%c%C%7%e$@$1\e(B
    \e$B$rA4$/JL$N%G%#%l%/%H%j$K$G$-$^$9!#\e(B
 
+** elmo-enable-disconnected-operation \e$B$N%G%U%)%k%HCM$,\e(B t \e$B$K$J$j$^$7$?!#\e(B
+   \e$B%*%U%i%$%s>uBV$G$b%a%C%;!<%8$,%-%c%C%7%e$5$l$F$$$l$P!"$"$kDxEY$N\e(B
+   \e$B%a%C%;!<%8A`:n$,2DG=$G$9!#\e(B
+
 * 2.6.1 \e$B$O\e(B 2.6.0 \e$B$N=$@5HG$G$9!#\e(B
 
 ** Emacs 21 \e$B$G\e(B Recursive load... \e$B$H=P$kIT6q9g$,=$@5$5$l$^$7$?!#\e(B
index 04fdede..eed39d2 100644 (file)
--- a/README.ja
+++ b/README.ja
@@ -36,7 +36,7 @@ Install:
 
 Web Page:
 
- Wanderlust \e$B$N\e(B Official Web \e$B%Z!<%8$N\e(B URL \e$B$O0J2<$NDL$j$G$9!#\e(B
+ Wanderlust \e$B8x<0\e(B Web \e$B%Z!<%8$N\e(B URL \e$B$O0J2<$NDL$j$G$9!#\e(B
 
  http://www.gohome.org/wl/
 
@@ -70,7 +70,7 @@ CVS:
 
     % cvs -d :pserver:anonymous@cvs.m17n.org:/cvs/root checkout wanderlust
 
-  \e$B0BDjHG$N;^$+$i\e(B Wanderlust \e$B<h$j=P$9>l9g$O!"0J2<$N$h$&$K$7$F$/$@$5$$!#\e(B
+  \e$B0BDjHG$N;^$+$i\e(B Wanderlust \e$B$r<h$j=P$9>l9g$O!"0J2<$NMM$K$7$F$/$@$5$$!#\e(B
 
     % cvs -d :pserver:anonymous@cvs.m17n.org:/cvs/root checkout -r wl-2_8 wanderlust
 
@@ -78,14 +78,14 @@ CVS:
 
        http://cvs.m17n.org/cgi-bin/viewcvs/wanderlust/
 
-  CVS \e$B$N\e(B commit log \e$B$r%a!<%k$G<u$1<h$j$?$$$H$-$O!"0J2<$N%"%I%l%9$K6u$N\e(B
+  CVS \e$B$N\e(B commit log \e$B$r%a!<%k$G<u$1<h$j$?$$J}$O!"<!$N%"%I%l%9$K6u$N\e(B
   \e$B%a!<%k$rAw$C$F$/$@$5$$!#\e(B
 
        cvs-info-help@cvs.m17n.org
 
 Development:
 
-  CVS \e$B$K4p$E$$$?3+H/$K;22C$7$?$$$H$-$O!"\e(B
+  CVS \e$B$K4p$E$$$?3+H/$K;22C$7$?$$J}$O!"\e(B
 
        cvs@cvs.m17n.org
 
diff --git a/WL-MK b/WL-MK
index c4f181c..008697e 100644 (file)
--- a/WL-MK
+++ b/WL-MK
   (config-wl-pixmap-dir)
   (princ "\n"))
 
+(defun update-version ()
+  "Update version number of documents."
+  (config-wl-package)
+  (load-file "elmo/elmo-version.el")
+  (let ((version (mapconcat
+                 'number-to-string
+                 (product-version (product-find 'elmo-version))
+                 ".")))
+    (princ (concat "Update version number to " version "\n"))
+    ;; generate version.tex
+    (with-temp-buffer
+      (insert "\\def\\versionnumber{" version "}\n")
+      (write-region (point-min) (point-max) (expand-file-name
+                                            "version.tex" "doc")))
+    ;; generate version.texi
+    (with-temp-buffer
+      (insert "@set VERSION " version "\n")
+      (write-region (point-min) (point-max) (expand-file-name
+                                            "version.texi" "doc")))))
+
 (defun test-wl ()
   "Run test suite for developer."
   (config-wl-package)
index d18897d..b6b0360 100644 (file)
@@ -2565,9 +2565,9 @@ News \e$B%U%)%k%@$G$O\e(B article \e$BHV9f!"\e(BIMAP \e$B%U%)%k%@$G$O\e(B UID\e$B!"\e(BM
 @item $
 @kbd{$} \e$B%-!<$r2!$9$H!"\e(B@samp{$} \e$B%^!<%/$,IU$-$^$9!#$3$N%^!<%/$O\e(B Emacs \e$B$r=*N;\e(B
 \e$B$7$F$bJ]B8$5$l$k$?$a!"$"$H$GJV;v$r=q$-$?$$>l9g$J$I!"3P$($F$*$-$?$$=EMW$J\e(B
-\e$B%a%C%;!<%8$KIU$1$F$*$/$HJXMx$G$9!#\e(B@samp{$} \e$B$NIU$$$?%a%C%;!<%8$O!"%K%e!<\e(B
-\e$B%95-;v$d%5!<%P>e$N\e(B IMAP \e$B%U%)%k%@$N%a%C%;!<%8$,\e(B expire \e$B$5$l$k$J$I$7$F>C$(\e(B
-\e$B$?>l9g$b;D$j$^$9!#\e(B
+\e$B%a%C%;!<%8$KIU$1$F$*$/$HJXMx$G$9!#\e(B@samp{$} \e$B$NIU$$$?%a%C%;!<%8$O!"\e(B
+(\e$B<B:]$N%a%C%;!<%8$,>C$5$l$?$H$7$F$b\e(B) @samp{'mark} \e$B%U%)%k%@$G1\Mw$G$-$^$9!#\e(B
+
 @item \e$B$J$7\e(B
 \e$B4{FI%a%C%;!<%8$K$O%^!<%/$,B8:_$7$^$;$s!#\e(B
 @end table
index a8ea5a2..f10259d 100644 (file)
@@ -2568,8 +2568,8 @@ It is important message.  You can put @samp{$} mark by typing @kbd{$}
 key (if already exists, the mark is deleted).  It is convenient to put
 this mark on the messages to remember (If you want to remember to write
 a reply for the message, for example) because this mark remains after
-you exited Emacs.  Messages with the @samp{$} mark remains in the folder
-even the message itself is deleted in the actual folder.
+you exited Emacs.  Messages with the @samp{$} mark can be reviewed in the
+@{'mark} folder even the message itself is deleted in the actual folder.
 
 @item None
 If the message is read and cached (or local message),there are no
index 7556b39..f4b32e8 100644 (file)
@@ -1,3 +1,48 @@
+2001-12-26  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * elmo.el (elmo-folder-synchronize): Delete important messages too.
+
+       * elmo-util.el (elmo-buffer-field-primitive-condition-match): Fixed
+       `since'; Fix timezone.
+
+       * elmo-msgdb.el (elmo-msgdb-search-internal-primitive): Ditto.
+
+       * elmo-nntp.el (elmo-nntp-search-primitive): Likewise.
+
+2001-12-25  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * elmo.el (elmo-message-fetch-with-cache-process): Rewrite.
+
+2001-12-23  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * elmo.el (elmo-generic-folder-append-messages): Make
+       fetch-strategy with `use-cache' as 'maybe. Check return value of
+       `elmo-message-fetch'.
+       (elmo-message-fetch): Return return value of
+       `elmo-message-fetch-with-cache-process'.
+       (elmo-message-fetch-with-cache-process): Return non-nil if
+       fetching was succeed. Load cache when fetching was failed and
+       fetch-strategy-use-cache is 'maybe.
+
+       * elmo-util.el (elmo-file-cache-load): New function.
+
+       * elmo-multi.el (elmo-message-use-cache-p): Remove duplicated
+       defun.
+
+       * elmo-archive.el (elmo-archive-message-fetch-internal): Return
+       non-nil if fetching was succeed.
+
+       * elmo-imap4.el (elmo-imap4-message-fetch): Likewise.
+
+       * elmo-nmz.el (elmo-map-message-fetch): Likewise.
+
+       * elmo-nntp.el (elmo-nntp-read-body): Likewise.
+       (elmo-message-fetch-with-cache-process): Likwise.
+
+       * elmo-pop3.el (elmo-pop3-read-body): Likewise.
+
+       * elmo-shimbun.el (elmo-map-message-fetch): Likewise.
+
 2001-12-23  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * elmo.el (elmo-folder-delete): Delete msgdb path.
index f55cfe4..fe7a2b8 100644 (file)
@@ -551,11 +551,12 @@ TYPE specifies the archiver's symbol."
         (method (elmo-archive-get-method type 'cat))
         (args (list arc (elmo-concat-path
                          prefix (int-to-string number)))))
-    (when (file-exists-p arc)
-      (and
-       (as-binary-process
-       (elmo-archive-call-method method args t))
-       (elmo-delete-cr-buffer)))))
+    (and (file-exists-p arc)
+        (as-binary-process
+         (elmo-archive-call-method method args t))
+        (progn
+          (elmo-delete-cr-buffer)
+          t))))
 
 (luna-define-method elmo-message-fetch-internal ((folder elmo-archive-folder)
                                                 number strategy
index 8d14bf7..2e7e1bd 100644 (file)
@@ -2530,7 +2530,8 @@ If optional argument REMOVE is non-nil, remove FLAG."
                         response 'fetch)))
        (with-current-buffer outbuf
          (erase-buffer)
-         (insert response)))))
+         (insert response)
+         t))))
 
 (luna-define-method elmo-message-fetch-plugged ((folder elmo-imap4-folder)
                                                number strategy
index 0ca535d..a1068dc 100644 (file)
@@ -309,12 +309,18 @@ header separator."
                    (elmo-msgdb-overview-entity-get-cc entity))))
      ((or (string= key "since")
          (string= key "before"))
-      (let ((res (string< (timezone-make-date-sortable
-                          (elmo-msgdb-overview-entity-get-date entity))
-                         (elmo-date-make-sortable-string
-                          (elmo-date-get-datevec
-                           (elmo-filter-value condition))))))
-       (setq result (if (string= key "before") res (not res)))))
+      (let ((field-date (elmo-date-make-sortable-string
+                        (timezone-fix-time
+                         (elmo-msgdb-overview-entity-get-date entity)
+                         (current-time-zone) nil)))
+           (specified-date
+            (elmo-date-make-sortable-string
+             (elmo-date-get-datevec
+              (elmo-filter-value condition)))))
+       (setq result (if (string= key "since")
+                        (or (string= specified-date field-date)
+                            (string< specified-date field-date))
+                      (string< field-date specified-date)))))
      ((member key elmo-msgdb-extra-fields)
       (let ((extval (elmo-msgdb-overview-entity-get-extra-field entity key)))
        (if (stringp extval)
index 546dd60..800cf34 100644 (file)
       (setq children (cdr children)))
     match))
 
-(luna-define-method elmo-message-use-cache-p ((folder elmo-multi-folder)
-                                            number)
-  (elmo-message-use-cache-p
-   (nth (- (/ number (elmo-multi-folder-divide-number-internal folder)) 1)
-       (elmo-multi-folder-children-internal folder))
-   (% number (elmo-multi-folder-divide-number-internal folder))))
-
 (luna-define-method elmo-message-folder ((folder elmo-multi-folder)
                                         number)
   (nth (- (/ number (elmo-multi-folder-divide-number-internal folder)) 1)
 (luna-define-method elmo-message-file-name ((folder elmo-multi-folder) number)
   (let ((pair (elmo-multi-real-folder-number folder number)))
     (elmo-message-file-name (car pair) (cdr pair))))
-  
+
 (luna-define-method elmo-folder-plugged-p ((folder elmo-multi-folder))
   (let ((flds (elmo-multi-folder-children-internal folder)))
     (catch 'plugged
index cda62cb..5fb36b9 100644 (file)
@@ -189,29 +189,30 @@ If the value is a list, all elements are used as index paths for namazu."
                                            location strategy
                                            &optional section unseen)
   (when (file-exists-p location)
-    (insert-file-contents-as-binary location)
-    (unless (or (std11-field-body "To")
-               (std11-field-body "Cc")
-               (std11-field-body "Subject"))
-      (let (charset guess uid)
-       (erase-buffer)
-       (set-buffer-multibyte t)
-       (insert-file-contents location)
-       (setq charset (detect-mime-charset-region (point-min)
-                                                 (point-max)))
-       (goto-char (point-min))
-       (setq guess (mime-find-file-type location))
-       (setq uid (nth 2 (file-attributes location)))
-       (insert "From: " (concat (user-full-name uid)
-                                " <"(user-login-name uid) "@"
-                                (system-name) ">") "\n")
-       (insert "Subject: " location "\n")
-       (insert "Content-Type: "
-               (concat (nth 0 guess) "/" (nth 1 guess))
-               "; charset=" (upcase (symbol-name charset))
-               "\nMIME-Version: 1.0\n\n")
-       (encode-mime-charset-region (point-min) (point-max) charset)
-       (set-buffer-multibyte nil)))))
+    (prog1
+       (insert-file-contents-as-binary location)
+      (unless (or (std11-field-body "To")
+                 (std11-field-body "Cc")
+                 (std11-field-body "Subject"))
+       (let (charset guess uid)
+         (erase-buffer)
+         (set-buffer-multibyte t)
+         (insert-file-contents location)
+         (setq charset (detect-mime-charset-region (point-min)
+                                                   (point-max)))
+         (goto-char (point-min))
+         (setq guess (mime-find-file-type location))
+         (setq uid (nth 2 (file-attributes location)))
+         (insert "From: " (concat (user-full-name uid)
+                                  " <"(user-login-name uid) "@"
+                                  (system-name) ">") "\n")
+         (insert "Subject: " location "\n")
+         (insert "Content-Type: "
+                 (concat (nth 0 guess) "/" (nth 1 guess))
+                 "; charset=" (upcase (symbol-name charset))
+                 "\nMIME-Version: 1.0\n\n")
+         (encode-mime-charset-region (point-min) (point-max) charset)
+         (set-buffer-multibyte nil))))))
 
 (luna-define-method elmo-map-folder-list-message-locations
   ((folder elmo-nmz-folder))
index 4bbf723..33a4991 100644 (file)
@@ -389,7 +389,8 @@ Don't cache if nil.")
       (with-current-buffer outbuf
        (erase-buffer)
        (insert-buffer-substring (elmo-network-session-buffer session)
-                                start (- end 3))))))
+                                start (- end 3))))
+    t))
 
 (defun elmo-nntp-select-group (session group &optional force)
   (let (response)
@@ -963,12 +964,14 @@ Don't cache if nil.")
       (with-current-buffer (elmo-network-session-buffer session)
        (std11-field-body "Newsgroups")))))
 
-(luna-define-method elmo-message-fetch-with-cache-process :after
+(luna-define-method elmo-message-fetch-with-cache-process :around
   ((folder elmo-nntp-folder) number strategy &optional section unread)
-  (elmo-nntp-setup-crosspost-buffer folder number)
-  (unless unread
-    (elmo-nntp-folder-update-crosspost-message-alist
-     folder (list number))))
+  (when (luna-call-next-method)
+    (elmo-nntp-setup-crosspost-buffer folder number)
+    (unless unread
+      (elmo-nntp-folder-update-crosspost-message-alist
+       folder (list number)))
+    t))
 
 (luna-define-method elmo-message-fetch-plugged ((folder elmo-nntp-folder)
                                                number strategy
@@ -1124,27 +1127,27 @@ Returns a list of cons cells like (NUMBER . VALUE)"
        numbers))
      ((or (string= "since" search-key)
          (string= "before" search-key))
-      (let* ((key-date (elmo-date-get-datevec (elmo-filter-value condition)))
-            (key-datestr (elmo-date-make-sortable-string key-date))
+      (let* ((specified-date (elmo-date-make-sortable-string
+                             (elmo-date-get-datevec (elmo-filter-value
+                                                     condition))))
             (since (string= "since" search-key))
-            result)
+            field-date  result)
        (if (eq (elmo-filter-type condition) 'unmatch)
            (setq since (not since)))
        (setq result
              (delq nil
                    (mapcar
                     (lambda (pair)
+                      (setq field-date
+                            (elmo-date-make-sortable-string
+                             (timezone-fix-time
+                              (cdr pair)
+                              (current-time-zone) nil)))
                       (if (if since
-                              (string< key-datestr
-                                       (elmo-date-make-sortable-string
-                                        (timezone-fix-time
-                                         (cdr pair)
-                                         (current-time-zone) nil)))
-                            (not (string< key-datestr
-                                          (elmo-date-make-sortable-string
-                                           (timezone-fix-time
-                                            (cdr pair)
-                                            (current-time-zone) nil)))))
+                              (or (string= specified-date field-date)
+                                  (string< specified-date field-date))
+                            (string< field-date
+                                     specified-date))
                           (car pair)))
                     (elmo-nntp-retrieve-field spec "date" from-msgs))))
        (if from-msgs
index 94caee7..c1e63bd 100644 (file)
@@ -825,7 +825,8 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"")
       (setq end (point))
       (with-current-buffer outbuf
        (erase-buffer)
-       (insert-buffer-substring (process-buffer process) start (- end 3))))))
+       (insert-buffer-substring (process-buffer process) start (- end 3)))
+      t)))
 
 (luna-define-method elmo-folder-open-internal ((folder elmo-pop3-folder))
   (if (and (not elmo-inhibit-number-mapping)
@@ -872,7 +873,7 @@ Debug information is inserted in the buffer \"*POP3 DEBUG*\"")
              (when (null (setq response (elmo-pop3-read-response
                                          process t)))
                (error "Fetching message failed"))
-             (setq response (elmo-pop3-read-body process outbuf)))
+             (setq response  (elmo-pop3-read-body process outbuf)))
          (setq elmo-pop3-total-size nil))
        (unless elmo-inhibit-display-retrieval-progress
          (elmo-display-progress
index 06eab4b..c11e5e6 100644 (file)
@@ -431,7 +431,8 @@ update overview when message is fetched."
        (when (setq shimbun-id
                    (elmo-shimbun-header-extra-field header "x-shimbun-id"))
          (goto-char (point-min))
-         (insert (format "X-Shimbun-Id: %s\n" shimbun-id))))
+         (insert (format "X-Shimbun-Id: %s\n" shimbun-id)))
+       t)
     (error "Unplugged")))
 
 (luna-define-method elmo-message-encache :around ((folder
index b6dc41d..d84d544 100644 (file)
@@ -816,22 +816,30 @@ Return value is a cons cell of (STRUCTURE . REST)"
                         (length (memq number number-list)))
                      (string-to-int (elmo-filter-value condition)))))
      ((string= (elmo-filter-key condition) "since")
-      (let ((date (elmo-date-get-datevec (elmo-filter-value condition))))
+      (let* ((date (elmo-date-get-datevec (elmo-filter-value condition)))
+            (field-date (elmo-date-make-sortable-string
+                         (timezone-fix-time
+                          (std11-field-body "date")
+                          (current-time-zone) nil)))
+            (specified-date (timezone-make-sortable-date
+                             (aref date 0)
+                             (aref date 1)
+                             (aref date 2)
+                             (timezone-make-time-string
+                              (aref date 3)
+                              (aref date 4)
+                              (aref date 5)))))
        (setq result
-             (string<
-              (timezone-make-sortable-date (aref date 0)
-                                           (aref date 1)
-                                           (aref date 2)
-                                           (timezone-make-time-string
-                                            (aref date 3)
-                                            (aref date 4)
-                                            (aref date 5)))
-              (timezone-make-date-sortable (std11-field-body "date"))))))
+             (or (string= field-date specified-date)
+                 (string< specified-date field-date)))))
      ((string= (elmo-filter-key condition) "before")
       (let ((date (elmo-date-get-datevec (elmo-filter-value condition))))
        (setq result
              (string<
-              (timezone-make-date-sortable (std11-field-body "date"))
+              (timezone-make-date-sortable
+               (timezone-fix-time
+                (std11-field-body "date")
+                (current-time-zone) nil))
               (timezone-make-sortable-date (aref date 0)
                                            (aref date 1)
                                            (aref date 2)
@@ -1610,6 +1618,24 @@ Return t if cache is saved successfully."
     ;; ignore error
     (error)))
 
+(defun elmo-file-cache-load (cache-path section)
+  "Load cache on PATH into the current buffer.
+Return t if cache is loaded successfully."
+  (condition-case nil
+      (let (cache-file)
+       (when (and cache-path
+                  (if (elmo-cache-path-section-p cache-path)
+                      section
+                    (null section))
+                  (setq cache-file (elmo-file-cache-expand-path
+                                    cache-path
+                                    section))
+                  (file-exists-p cache-file))
+         (insert-file-contents-as-binary cache-file)
+         t))
+    ;; igore error
+    (error)))
+
 (defun elmo-cache-path-section-p (path)
   "Return non-nil when PATH is `section' cache path."
   (file-directory-p path))
index ceb29d8..642834e 100644 (file)
@@ -889,29 +889,35 @@ Return a cons cell of (NUMBER-CROSSPOSTS . NEW-MARK-ALIST).")
       (while numbers
        (setq failure nil)
        (condition-case nil
-           (progn
-             (elmo-message-fetch
-              src-folder (car numbers)
-              (if (and (not (elmo-folder-plugged-p src-folder))
-                       elmo-enable-disconnected-operation
-                       (setq cache (elmo-file-cache-get
-                                    (elmo-message-field
-                                     src-folder (car numbers)
-                                     'message-id)))
-                       (eq (elmo-file-cache-status cache) 'entire))
-                  (elmo-make-fetch-strategy
-                   'entire t nil (elmo-file-cache-path cache))
-                (elmo-make-fetch-strategy 'entire t))
-              nil (current-buffer)
-              'unread)
-             (unless (eq (buffer-size) 0)
-               (setq failure (not
-                              (elmo-folder-append-buffer
-                               folder
-                               (setq unseen (member (elmo-message-mark
-                                                     src-folder (car numbers))
-                                                    unread-marks))
-                               (if same-number (car numbers)))))))
+           (setq cache (elmo-file-cache-get
+                        (elmo-message-field src-folder
+                                            (car numbers)
+                                            'message-id))
+                 failure
+                 (not
+                  (and
+                   (elmo-message-fetch
+                    src-folder (car numbers)
+                    (if (elmo-folder-plugged-p src-folder)
+                        (elmo-make-fetch-strategy
+                         'entire 'maybe nil
+                         (and cache (elmo-file-cache-path cache)))
+                      (or (and elmo-enable-disconnected-operation
+                               cache
+                               (eq (elmo-file-cache-status cache) 'entire)
+                               (elmo-make-fetch-strategy
+                                'entire t nil
+                                (elmo-file-cache-path cache)))
+                          (error "Unplugged")))
+                    nil (current-buffer)
+                    'unread)
+                   (> (buffer-size) 0)
+                   (elmo-folder-append-buffer
+                    folder
+                    (setq unseen (member (elmo-message-mark
+                                          src-folder (car numbers))
+                                         unread-marks))
+                    (if same-number (car numbers))))))
          (error (setq failure t)))
        ;; FETCH & APPEND finished
        (unless failure
@@ -1158,8 +1164,7 @@ FIELD is a symbol of the field."
       (with-current-buffer outbuf
        (erase-buffer)
        (elmo-message-fetch-with-cache-process folder number
-                                              strategy section unread)
-       t)
+                                              strategy section unread))
     (with-temp-buffer
       (elmo-message-fetch-with-cache-process folder number
                                             strategy section unread)
@@ -1169,24 +1174,37 @@ FIELD is a symbol of the field."
                                                           number strategy
                                                           &optional
                                                           section unread)
-  (let (cache-path cache-file)
-    (if (and (elmo-fetch-strategy-use-cache strategy)
-            (setq cache-path (elmo-fetch-strategy-cache-path strategy))
-            (setq cache-file (elmo-file-cache-expand-path
-                              cache-path
-                              section))
-            (file-exists-p cache-file)
-            (or (not (elmo-cache-path-section-p cache-file))
-                (not (eq (elmo-fetch-strategy-entireness strategy) 'entire))))
-       (insert-file-contents-as-binary cache-file)
-      (elmo-message-fetch-internal folder number strategy section unread)
-      (elmo-delete-cr-buffer)
-      (when (and (> (buffer-size) 0)
-                (elmo-fetch-strategy-save-cache strategy)
-                (elmo-fetch-strategy-cache-path strategy))
-       (elmo-file-cache-save
-        (elmo-fetch-strategy-cache-path strategy)
-        section)))))
+  (let ((cache-path (elmo-fetch-strategy-cache-path strategy))
+       (method-priorities
+        (cond ((eq (elmo-fetch-strategy-use-cache strategy) 'meybe)
+               '(entity cache))
+              ((elmo-fetch-strategy-use-cache strategy)
+               '(cache entity))
+              (t
+               '(entity))))
+       result err)
+    (while (and method-priorities
+               (null result))
+      (setq result
+           (case (car method-priorities)
+             (cache
+              (elmo-file-cache-load cache-path section))
+             (entity
+              (when (and (condition-case error
+                             (elmo-message-fetch-internal folder number
+                                                          strategy
+                                                          section
+                                                          unread)
+                           (error (setq err error) nil))
+                         (> (buffer-size) 0))
+                (elmo-delete-cr-buffer)
+                (when (and (elmo-fetch-strategy-save-cache strategy)
+                           cache-path)
+                  (elmo-file-cache-save cache-path section))
+                t)))
+           method-priorities (cdr method-priorities)))
+    (or result
+       (and err (signal (car err) (cdr err))))))
 
 (luna-define-method elmo-folder-clear ((folder elmo-folder)
                                       &optional keep-killed)
@@ -1260,16 +1278,7 @@ If update process is interrupted, return nil."
                              (length new-list)))
                     (setq diff-2 (elmo-list-diff (car diff) new-list)))
            (elmo-msgdb-append-to-killed-list folder (car diff-2)))
-         ;; Don't delete important marked messages.
-         (setq delete-list
-               (if (eq (elmo-folder-type-internal folder) 'mark)
-                   (cadr diff)
-                 (elmo-delete-if
-                  (lambda (x)
-                    (and (setq mark (cadr (assq x mark-alist)))
-                         (string= mark important-mark)))
-                  ;; delete message list
-                  (cadr diff))))
+         (setq delete-list (cadr diff))
          (if (or (equal diff '(nil nil))
                  (equal diff '(nil))
                  (and (eq (length (car diff)) 0)
index d0d79fc..06007ef 100644 (file)
@@ -1,3 +1,12 @@
+2001-12-24  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * wl-draft.el (wl-draft-hide): Removed `interactive'.
+       (Pointed out by YAMASHITA Junji <ysjj@unixuser.org>)
+
+2001-12-23  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * Version number is increased to 2.9.2.
+
 2001-12-21  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * wl-draft.el (wl-draft-elide-region): New user command.
index 7477196..ac95b99 100644 (file)
@@ -665,7 +665,6 @@ Reply to author if WITH-ARG is non-nil."
 
 (defun wl-draft-hide (editing-buffer)
   "Hide the editing draft buffer if possible."
-  (interactive)
   (when (and editing-buffer
             (buffer-live-p editing-buffer))
     (set-buffer editing-buffer)