From: hmurata Date: Thu, 24 Feb 2005 15:08:11 +0000 (+0000) Subject: * elmo.el (elmo-message-fetch-string): Disable multibyte. X-Git-Tag: wl-2_14-root~26 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=7e29ea319c966d9149c7f6ac8699f86530639bf5;p=elisp%2Fwanderlust.git * elmo.el (elmo-message-fetch-string): Disable multibyte. * elmo-util.el (elmo-multibypte-buffer-name): New constant. (elmo-with-enable-multibyte): New macro. * modb-entity.el (elmo-msgdb-get-decoded-cache): Use it. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index f257dea..5a3728d 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,12 @@ +2005-02-24 Hiroya Murata + + * elmo.el (elmo-message-fetch-string): Disable multibyte. + + * elmo-util.el (elmo-multibypte-buffer-name): New constant. + (elmo-with-enable-multibyte): New macro. + + * modb-entity.el (elmo-msgdb-get-decoded-cache): Use it. + 2005-02-23 Hiroya Murata * elmo-filter.el (elmo-filter-add-flag-count): Removed unused diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index 3a5e66d..2f65c3f 100644 --- a/elmo/elmo-util.el +++ b/elmo/elmo-util.el @@ -88,6 +88,17 @@ (def-edebug-spec elmo-bind-directory (form &rest form)) +(defconst elmo-multibypte-buffer-name " *elmo-multibyte-buffer*") + +(defmacro elmo-with-enable-multibyte (&rest body) + "Evaluate BODY with `enable-multibyte-character' as non-nil." + `(let ((default-enable-multibyte-characters t)) + (with-current-buffer (get-buffer-create elmo-multibypte-buffer-name) + ,@body))) + +(put 'elmo-with-enable-multibyte 'lisp-indent-function 0) +(def-edebug-spec elmo-with-enable-multibyte t) + (defun elmo-object-load (filename &optional mime-charset no-err) "Load OBJECT from the file specified by FILENAME. File content is decoded with MIME-CHARSET." diff --git a/elmo/elmo.el b/elmo/elmo.el index df61b7f..f077837 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -1425,6 +1425,7 @@ If Optional LOCAL is non-nil, don't update server flag." unread section) (with-temp-buffer + (set-buffer-multibyte nil) (when (elmo-message-fetch folder number strategy unread section) (buffer-string)))) diff --git a/elmo/modb-entity.el b/elmo/modb-entity.el index b5fede0..4b9c4da 100644 --- a/elmo/modb-entity.el +++ b/elmo/modb-entity.el @@ -179,14 +179,13 @@ Header region is supposed to be narrowed.") (elmo-make-hash 2048)))) decoded) (or (elmo-get-hash-val string hashtb) - (progn - (elmo-set-hash-val - string - (setq decoded - (decode-mime-charset-string string elmo-mime-charset)) - hashtb) - decoded))) - (decode-mime-charset-string string elmo-mime-charset))) + (prog1 + (setq decoded + (elmo-with-enable-multibyte + (decode-mime-charset-string string elmo-mime-charset))) + (elmo-set-hash-val string decoded hashtb)))) + (elmo-with-enable-multibyte + (decode-mime-charset-string string elmo-mime-charset)))) (defsubst modb-legacy-make-message-entity (args) "Make an message entity."