* wl-summary.el (wl-summary-buffer-attach): Connect to signal
[elisp/wanderlust.git] / elmo / modb-standard.el
index 7e15c40..46e4b61 100644 (file)
@@ -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
@@ -196,7 +196,6 @@ When non-nil, redundunt message-id string are not saved."
 (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
@@ -222,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)
@@ -249,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)
@@ -326,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)
@@ -349,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)
@@ -474,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))
@@ -520,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