2002-05-09 Yuuichi Teranishi <teranisi@gohome.org>
+ * elmo-util.el (elmo-mime-string): Eliminate needless binding;
+ Use eword-decode-and-unfold-unstructured-field-body.
+
+ * elmo-msgdb.el (elmo-msgdb-make-entity): New function.
+ (elmo-msgdb-create-overview-from-buffer): Use document charset if
+ exists to decode raw subject string.
+ (toplevel): Require 'mime.
+
* elmo-version.el (elmo-version): Up to 2.9.12.
2002-05-02 Yuuichi Teranishi <teranisi@gohome.org>
(require 'elmo-util)
(require 'emu)
(require 'std11)
+(require 'mime)
;;; MSGDB interface.
(defun elmo-load-msgdb (path)
(message "Sorting...done")
(list overview (nth 1 msgdb)(nth 2 msgdb))))
+(defun elmo-msgdb-make-entity (&rest args)
+ "Make an msgdb entity."
+ (cons (plist-get args :message-id)
+ (vector (plist-get args :number)
+ (plist-get args :references)
+ (plist-get args :from)
+ (plist-get args :subject)
+ (plist-get args :date)
+ (plist-get args :to)
+ (plist-get args :cc)
+ (plist-get args :size)
+ (plist-get args :extra))))
+
;;;
(defsubst elmo-msgdb-append-element (list element)
(if list
(save-excursion
(let ((extras elmo-msgdb-extra-fields)
message-id references from subject to cc date
- extra field-body)
+ 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))
+ (setq message-id (elmo-msgdb-get-message-id-from-buffer)
+ charset (intern-soft (cdr (assoc "charset"
+ (mime-read-Content-Type)))))
+ (if charset (setq default-mime-charset charset))
(setq references
(or (elmo-msgdb-get-last-message-id
(elmo-field-body "in-reply-to"))
?\"
(or
(elmo-field-body "from")
- elmo-no-from))))
- (setq subject (elmo-mime-string (or (elmo-field-body "subject")
+ elmo-no-from)))
+ subject (elmo-mime-string (or (elmo-field-body "subject")
elmo-no-subject)))
(setq date (or (elmo-field-body "date") time))
(setq to (mapconcat 'identity (elmo-multiple-field-body "to") ","))
(defsubst elmo-mime-string (string)
"Normalize MIME encoded STRING."
- (and string
- (let (str)
- (elmo-set-work-buf
- (elmo-set-buffer-multibyte default-enable-multibyte-characters)
- (setq str (eword-decode-string
- (decode-mime-charset-string string elmo-mime-charset)))
- (setq str (encode-mime-charset-string str elmo-mime-charset))
- (elmo-set-buffer-multibyte nil)
- str))))
+ (and string
+ (elmo-set-work-buf
+ (elmo-set-buffer-multibyte default-enable-multibyte-characters)
+ (setq string
+ (encode-mime-charset-string
+ (eword-decode-and-unfold-unstructured-field-body
+ string)
+ elmo-mime-charset))
+ (elmo-set-buffer-multibyte nil)
+ string)))
(defsubst elmo-collect-field (beg end downcase-field-name)
(save-excursion