X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=elmo%2Fmodb-standard.el;h=46e4b6179157d155be6439e192e1277df84f985d;hb=6444631eeac4bef1933e27202080f62ac536aada;hp=53d7b2fc9ffe46359fcf0c0c550cf95b3d113b72;hpb=65f449524687f7f37c579ae142aab0f067400a05;p=elisp%2Fwanderlust.git diff --git a/elmo/modb-standard.el b/elmo/modb-standard.el index 53d7b2f..46e4b61 100644 --- a/elmo/modb-standard.el +++ b/elmo/modb-standard.el @@ -40,7 +40,7 @@ number) :group 'elmo) -(defcustom modb-standard-economize-entity-size nil +(defcustom modb-standard-economize-entity-size t "*Economize message entity size. When non-nil, redundunt message-id string are not saved." :type 'boolean @@ -189,13 +189,13 @@ When non-nil, redundunt message-id string are not saved." ((null ret) ;; Garbage entity. (elmo-clear-hash-val (modb-standard-key number) - (modb-standard-entity-map-internal msgdb))) + (modb-standard-entity-map-internal msgdb)) + nil) ; return nil. (t (error "Internal error: invalid msgdb status"))))) (defun modb-standard-load-entity (modb path &optional section) (let ((table (or (modb-standard-entity-map-internal modb) (elmo-make-hash (elmo-msgdb-length modb)))) - (inhibit-quit t) number msgid) (dolist (entity (elmo-object-load (expand-file-name @@ -221,7 +221,8 @@ When non-nil, redundunt message-id string are not saved." (= section (/ number modb-standard-divide-number))) (setq entity (elmo-msgdb-message-entity modb number))) (when modb-standard-economize-entity-size - (when (stringp (car entity)) (setcar entity t))) + (when (stringp (car entity)) + (setq entity (cons t (cdr entity))))) (setq entities (cons entity entities)))) (if entities (elmo-object-save filename entities) @@ -248,7 +249,8 @@ When non-nil, redundunt message-id string are not saved." t))) (luna-define-method elmo-msgdb-save ((msgdb modb-standard)) - (let ((path (elmo-msgdb-location msgdb))) + (let ((path (elmo-msgdb-location msgdb)) + (inhibit-quit t)) (when (elmo-msgdb-message-modified-p msgdb) (modb-standard-save-msgid msgdb path) (modb-standard-save-entity msgdb path) @@ -325,7 +327,7 @@ When non-nil, redundunt message-id string are not saved." new-flags diff) (unless (memq flag cur-flags) (setq new-flags (cons flag cur-flags)) - (setq diff (elmo-list-diff new-flags cur-flags)) + (setq diff (elmo-list-diff-nonsortable new-flags cur-flags)) (modb-standard-countup-flags msgdb (car diff)) (modb-standard-countup-flags msgdb (cadr diff) -1) (elmo-set-hash-val (modb-standard-key number) @@ -348,10 +350,11 @@ When non-nil, redundunt message-id string are not saved." (modb-standard-flag-map msgdb))) (t (let ((cur-flags (modb-standard-message-flags msgdb number)) + (inhibit-quit t) new-flags diff) (when (memq flag cur-flags) (setq new-flags (delq flag (copy-sequence cur-flags))) - (setq diff (elmo-list-diff new-flags cur-flags)) + (setq diff (elmo-list-diff-nonsortable new-flags cur-flags)) (modb-standard-countup-flags msgdb (car diff)) (modb-standard-countup-flags msgdb (cadr diff) -1) (elmo-set-hash-val (modb-standard-key number) @@ -473,6 +476,15 @@ When non-nil, redundunt message-id string are not saved." (modb-standard-set-flag-modified msgdb number)) duplicate)))) +(luna-define-method elmo-msgdb-update-entity ((msgdb modb-standard) + entity values) + (let ((handler (elmo-message-entity-handler entity))) + (when (elmo-msgdb-message-entity-update-fields handler entity values) + (modb-standard-set-message-modified + msgdb + (elmo-msgdb-message-entity-number handler entity)) + t))) + (luna-define-method elmo-msgdb-delete-messages ((msgdb modb-standard) numbers) (let ((number-list (modb-standard-number-list-internal msgdb)) @@ -519,7 +531,8 @@ When non-nil, redundunt message-id string are not saved." (defun modb-standard-message-entity (msgdb key load) (let ((ret (elmo-get-hash-val key - (modb-standard-entity-map-internal msgdb)))) + (modb-standard-entity-map-internal msgdb))) + (inhibit-quit t)) (if (eq 'autoload (car-safe ret)) (when (and load modb-standard-divide-number) (modb-standard-load-entity