Changed codename to Venus-pre2.
[elisp/wanderlust.git] / elmo / elmo-msgdb.el
index 773d000..7364c5c 100644 (file)
@@ -768,20 +768,24 @@ 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"))
+      (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.
 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 +797,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") ","))
@@ -950,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))