From aa5b48ff62cfe04cd016fbd5e546c962b457e7c0 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Thu, 24 Jun 2004 06:49:01 +0000 Subject: [PATCH] Synch to No Gnus 200406240648. --- lisp/ChangeLog | 8 +++++--- lisp/mm-util.el | 8 ++++++++ lisp/rfc2047.el | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 627bad4..f9e7927 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,8 +1,10 @@ 2004-06-24 Katsumi Yamaoka - * rfc2047.el (rfc2047-encode-region): Move point to the end of the - region after encoding. - Suggested by IRIE Tetsuya . + * mm-util.el (mm-with-multibyte-buffer): New macro. + + * rfc2047.el (rfc2047-encode-string): Use it. + (rfc2047-encode-region): Move point to the end of the region after + encoding. Suggested by IRIE Tetsuya . 2004-06-23 Katsumi Yamaoka diff --git a/lisp/mm-util.el b/lisp/mm-util.el index a09de2b..6bcc05f 100644 --- a/lisp/mm-util.el +++ b/lisp/mm-util.el @@ -612,6 +612,14 @@ Use unibyte mode for this." (put 'mm-with-unibyte-buffer 'lisp-indent-function 0) (put 'mm-with-unibyte-buffer 'edebug-form-spec '(body)) +(defmacro mm-with-multibyte-buffer (&rest forms) + "Create a temporary buffer, and evaluate FORMS there like `progn'. +Use multibyte mode for this." + `(let ((default-enable-multibyte-characters t)) + (with-temp-buffer ,@forms))) +(put 'mm-with-multibyte-buffer 'lisp-indent-function 0) +(put 'mm-with-multibyte-buffer 'edebug-form-spec '(body)) + (defmacro mm-with-unibyte-current-buffer (&rest forms) "Evaluate FORMS with current buffer temporarily made unibyte. Also bind `default-enable-multibyte-characters' to nil. diff --git a/lisp/rfc2047.el b/lisp/rfc2047.el index a6c071d..3b76718 100644 --- a/lisp/rfc2047.el +++ b/lisp/rfc2047.el @@ -438,7 +438,7 @@ Dynamically bind `rfc2047-encoding-type' to change that." "Encode words in STRING. By default, the string is treated as containing addresses (see `rfc2047-encoding-type')." - (with-temp-buffer + (mm-with-multibyte-buffer (insert string) (rfc2047-encode-region (point-min) (point-max)) (buffer-string))) -- 1.7.10.4