* wl-summary.el (wl-summary-mark-as-read): Set msgdb mark only when
authorteranisi <teranisi>
Sun, 19 May 2002 03:37:13 +0000 (03:37 +0000)
committerteranisi <teranisi>
Sun, 19 May 2002 03:37:13 +0000 (03:37 +0000)
it is differed.

* elmo-util.el (elmo-disk-usage): Return 0 if invalid file attribute.

* elmo-msgdb.el (elmo-msgdb-create-overview-from-buffer): Avoid
changing default value of default-mime-charset.
(elmo-msgdb-create-overview-from-buffer): Remove TAB character.

* elmo-imap4.el (elmo-folder-open): Fixed NO response check.

* elmo-dop.el (elmo-dop-queue-merge-method-list): New variable.
(elmo-dop-queue-merge): Use elmo-dop-queue-merge-method-list
instead of elmo-dop-queue-method-name-alist to check merging queue.
(elmo-folder-delete-messages-dop): Delete from queue if negative
message number.
(elmo-folder-append-buffer-dop-delayed): Treat as success if queue
file is already removed.

elmo/ChangeLog
elmo/elmo-dop.el
elmo/elmo-imap4.el
elmo/elmo-msgdb.el
elmo/elmo-util.el
wl/ChangeLog
wl/wl-summary.el

index e2618f7..801b77d 100644 (file)
@@ -1,3 +1,21 @@
+2002-05-19  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * elmo-util.el (elmo-disk-usage): Return 0 if invalid file attribute.
+
+       * elmo-msgdb.el (elmo-msgdb-create-overview-from-buffer): Avoid
+       changing default value of default-mime-charset.
+       (elmo-msgdb-create-overview-from-buffer): Remove TAB character.
+
+       * elmo-imap4.el (elmo-folder-open): Fixed NO response check.
+
+       * elmo-dop.el (elmo-dop-queue-merge-method-list): New variable.
+       (elmo-dop-queue-merge): Use elmo-dop-queue-merge-method-list
+       instead of elmo-dop-queue-method-name-alist to check merging queue.
+       (elmo-folder-delete-messages-dop): Delete from queue if negative
+       message number.
+       (elmo-folder-append-buffer-dop-delayed): Treat as success if queue
+       file is already removed.
+
 2002-05-10  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * elmo-vars.el: Bind colon keywords for old Emacsen.
index ab3180a..5dcdf15 100644 (file)
@@ -62,6 +62,12 @@ Automatically loaded/saved.")
                                    method arguments)))
     (setq elmo-dop-queue (nconc elmo-dop-queue (list queue)))))
 
+(defvar elmo-dop-queue-merge-method-list
+  '(elmo-folder-mark-as-read
+    elmo-folder-unmark-read
+    elmo-folder-mark-as-important
+    elmo-folder-unmark-important))
+
 (defvar elmo-dop-queue-method-name-alist
   '((elmo-folder-append-buffer-dop-delayed . "Append")
     (elmo-folder-delete-messages-dop-delayed . "Delete")
@@ -149,21 +155,23 @@ even an operation concerns the unplugged folder."
        new-queue match-queue que)
     (while (setq que (car queue))
       (if (and
-          (assq (elmo-dop-queue-method que)
-                elmo-dop-queue-method-name-alist)
+          (memq (elmo-dop-queue-method que)
+                elmo-dop-queue-merge-method-list)
           (setq match-queue
-                (car (delete nil
-                             (mapcar '(lambda (nqueue)
-                                        (if (and
-                                             (string= (elmo-dop-queue-fname que)
-                                                      (elmo-dop-queue-fname nqueue))
-                                             (string= (elmo-dop-queue-method que)
-                                                      (elmo-dop-queue-method nqueue)))
-                                            nqueue))
-                                     new-queue)))))
-           (setcar (elmo-dop-queue-arguments match-queue)
-                   (append (car (elmo-dop-queue-arguments match-queue))
-                           (car (elmo-dop-queue-arguments que))))
+                (car (delete 
+                      nil
+                      (mapcar
+                       (lambda (nqueue)
+                         (if (and
+                              (string= (elmo-dop-queue-fname que)
+                                       (elmo-dop-queue-fname nqueue))
+                              (string= (elmo-dop-queue-method que)
+                                       (elmo-dop-queue-method nqueue)))
+                             nqueue))
+                       new-queue)))))
+         (setcar (elmo-dop-queue-arguments match-queue)
+                 (append (car (elmo-dop-queue-arguments match-queue))
+                         (car (elmo-dop-queue-arguments que))))
        (setq new-queue (nconc new-queue (list que))))
       (setq queue (cdr queue)) )
     (setq elmo-dop-queue new-queue)))
@@ -224,14 +232,22 @@ FOLDER is the folder structure."
         number)))
 
 (defsubst elmo-folder-delete-messages-dop (folder numbers)
-  (elmo-dop-queue-append folder 'elmo-folder-delete-messages-dop-delayed
-                        (list
-                         (mapcar
-                          (lambda (number)
-                            (cons number (elmo-message-field
-                                          folder number 'message-id)))
-                          numbers)))
-  t)
+  (let ((spool-folder (elmo-dop-spool-folder folder))
+       queue)
+    (dolist (number numbers)
+      (if (< number 0)
+         (elmo-folder-delete-messages spool-folder
+                                      (list (abs number))) ; delete from queue
+       (setq queue (cons number queue))))
+    (when queue
+      (elmo-dop-queue-append folder 'elmo-folder-delete-messages-dop-delayed
+                            (list
+                             (mapcar
+                              (lambda (number)
+                                (cons number (elmo-message-field
+                                              folder number 'message-id)))
+                              queue))))
+    t))
 
 (defsubst elmo-message-encache-dop (folder number &optional read)
   (elmo-dop-queue-append folder 'elmo-message-encache (list number read)))
@@ -270,22 +286,25 @@ FOLDER is the folder structure."
 ;;; Delayed operation (executed at online status).
 (defun elmo-folder-append-buffer-dop-delayed (folder unread number set-number)
   (let ((spool-folder (elmo-dop-spool-folder folder))
-       failure saved)
+       failure saved dequeued)
     (with-temp-buffer
-      (elmo-message-fetch spool-folder number
-                         (elmo-make-fetch-strategy 'entire)
-                         nil (current-buffer) 'unread)
-      (condition-case nil
-         (setq failure (not
-                        (elmo-folder-append-buffer folder unread set-number)))
-       (error (setq failure t)))
+      (if (elmo-message-fetch spool-folder number
+                             (elmo-make-fetch-strategy 'entire)
+                             nil (current-buffer) 'unread)
+         (condition-case nil
+             (setq failure (not
+                            (elmo-folder-append-buffer
+                             folder unread set-number)))
+           (error (setq failure t)))
+       (setq dequeued t)) ; Already deletef from queue.
       (when failure
        ;; Append failed...
        (setq saved (elmo-folder-append-buffer
                     (elmo-make-folder elmo-lost+found-folder)
                     unread set-number)))
-      (if (or (not failure)
-             saved)
+      (if (and (not dequeued)    ; if dequeued, no need to delete.
+              (or (not failure) ; succeed
+                  saved))       ; in lost+found
          (elmo-folder-delete-messages spool-folder (list number)))
       t)))
 
index 8c8221f..6ca9d5a 100644 (file)
@@ -2399,14 +2399,14 @@ If optional argument REMOVE is non-nil, remove FLAG."
              (elmo-folder-set-msgdb-internal
               folder msgdb))
          (quit
-          (if response
+          (if (elmo-imap4-response-ok-p response)
               (elmo-imap4-session-set-current-mailbox-internal
                session mailbox)
             (and session
                  (elmo-imap4-session-set-current-mailbox-internal
                   session nil))))
          (error
-          (if response
+          (if (elmo-imap4-response-ok-p response)
               (elmo-imap4-session-set-current-mailbox-internal
                session mailbox)
             (and session
index 773d000..1f34464 100644 (file)
@@ -780,8 +780,8 @@ header separator."
 Header region is supposed to be narrowed."
   (save-excursion
     (let ((extras elmo-msgdb-extra-fields)
+         (default-mime-charset default-mime-charset)
          message-id references from subject to cc date
-         default-mime-charset
          extra field-body charset)
       (elmo-set-buffer-multibyte default-enable-multibyte-characters)
       (setq message-id (elmo-msgdb-get-message-id-from-buffer))
@@ -793,13 +793,14 @@ Header region is supposed to be narrowed."
                 (elmo-field-body "in-reply-to"))
                (elmo-msgdb-get-last-message-id
                 (elmo-field-body "references"))))
-      (setq from (elmo-mime-string (elmo-delete-char
-                                   ?\"
-                                   (or
-                                    (elmo-field-body "from")
-                                    elmo-no-from)))
-           subject (elmo-mime-string (or (elmo-field-body "subject")
-                                         elmo-no-subject)))
+      (setq from (elmo-replace-in-string
+                 (elmo-mime-string (or (elmo-field-body "from")
+                                       elmo-no-from))
+                 "\t" " ")
+           subject (elmo-replace-in-string
+                    (elmo-mime-string (or (elmo-field-body "subject")
+                                          elmo-no-subject))
+                    "\t" " "))
       (setq date (or (elmo-field-body "date") time))
       (setq to   (mapconcat 'identity (elmo-multiple-field-body "to") ","))
       (setq cc   (mapconcat 'identity (elmo-multiple-field-body "cc") ","))
index 6ecf46e..7a3b015 100644 (file)
@@ -683,7 +683,8 @@ Return value is a cons cell of (STRUCTURE . REST)"
                (setq result (+ result (or (elmo-disk-usage (car files)) 0)))
                (setq files (cdr files)))
              result)
-         (float (nth 7 file-attr))))))
+         (float (nth 7 file-attr)))
+      0)))
 
 (defun elmo-get-last-accessed-time (path &optional dir)
   "Return the last accessed time of PATH."
index 76ac4a8..e27d747 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-19  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * wl-summary.el (wl-summary-mark-as-read): Set msgdb mark only when
+       it is differed.
+
 2002-05-18  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
 
        * wl-summary.el (wl-summary-line-list-info): Rewrite.
index 1d5431e..8bae5b8 100644 (file)
@@ -3935,7 +3935,8 @@ If ARG, exit virtual folder."
              (delete-backward-char 1)
              (insert (or new-mark " "))))
          ;; set msgdb mark.
-         (elmo-msgdb-set-mark msgdb number new-mark)
+         (unless (string= mark new-mark)
+           (elmo-msgdb-set-mark msgdb number new-mark))
          (wl-summary-set-mark-modified))
        (if (and visible wl-summary-highlight)
            (wl-highlight-summary-current-line nil nil t)))