Changed codename to Venus-pre2.
[elisp/wanderlust.git] / elmo / elmo-msgdb.el
index 04ac69a..7364c5c 100644 (file)
@@ -768,12 +768,16 @@ header separator."
     seen-list))
 
 (defun elmo-msgdb-get-message-id-from-buffer ()
-  (or (elmo-field-body "message-id")
+  (let ((msgid (elmo-field-body "message-id")))
+    (if msgid
+       (if (string-match "<\\(.+\\)>$" msgid)
+           msgid
+         (concat "<" msgid ">")) ; Invaild message-id.
       ;; no message-id, so put dummy msgid.
       (concat "<" (timezone-make-date-sortable
                   (elmo-field-body "date"))
              (nth 1 (eword-extract-address-components
-                     (or (elmo-field-body "from") "nobody"))) ">")))
+                     (or (elmo-field-body "from") "nobody"))) ">"))))
 
 (defsubst elmo-msgdb-create-overview-from-buffer (number &optional size time)
   "Create overview entity from current buffer.
@@ -951,6 +955,13 @@ Return the updated INDEX."
     elmo-msgdb-location-filename
     dir) alist))
 
+(put 'elmo-msgdb-do-each-entity 'lisp-indent-function '1)
+(def-edebug-spec elmo-msgdb-do-each-entity
+  ((symbolp form &rest form) &rest form))
+(defmacro elmo-msgdb-do-each-entity (spec &rest form)
+  `(dolist (,(car spec) (elmo-msgdb-get-overview ,(car (cdr spec))))
+     ,@form))
+
 (require 'product)
 (product-provide (provide 'elmo-msgdb) (require 'elmo-version))