From: teranisi Date: Sun, 19 May 2002 03:37:13 +0000 (+0000) Subject: * wl-summary.el (wl-summary-mark-as-read): Set msgdb mark only when X-Git-Tag: elmo-mark-root~112 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=5eab7554a5557dd814c53f50f8bed0401018878c;p=elisp%2Fwanderlust.git * wl-summary.el (wl-summary-mark-as-read): Set msgdb mark only when 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. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index e2618f7..801b77d 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,21 @@ +2002-05-19 Yuuichi Teranishi + + * 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 * elmo-vars.el: Bind colon keywords for old Emacsen. diff --git a/elmo/elmo-dop.el b/elmo/elmo-dop.el index ab3180a..5dcdf15 100644 --- a/elmo/elmo-dop.el +++ b/elmo/elmo-dop.el @@ -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))) diff --git a/elmo/elmo-imap4.el b/elmo/elmo-imap4.el index 8c8221f..6ca9d5a 100644 --- a/elmo/elmo-imap4.el +++ b/elmo/elmo-imap4.el @@ -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 diff --git a/elmo/elmo-msgdb.el b/elmo/elmo-msgdb.el index 773d000..1f34464 100644 --- a/elmo/elmo-msgdb.el +++ b/elmo/elmo-msgdb.el @@ -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") ",")) diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index 6ecf46e..7a3b015 100644 --- a/elmo/elmo-util.el +++ b/elmo/elmo-util.el @@ -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." diff --git a/wl/ChangeLog b/wl/ChangeLog index 76ac4a8..e27d747 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,8 @@ +2002-05-19 Yuuichi Teranishi + + * wl-summary.el (wl-summary-mark-as-read): Set msgdb mark only when + it is differed. + 2002-05-18 Hiroya Murata * wl-summary.el (wl-summary-line-list-info): Rewrite. diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 1d5431e..8bae5b8 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -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)))