2004-06-24 Katsumi Yamaoka <yamaoka@jpl.org>
- * rfc2047.el (rfc2047-encode-region): Move point to the end of the
- region after encoding.
- Suggested by IRIE Tetsuya <irie@t.email.ne.jp>.
+ * 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 <irie@t.email.ne.jp>.
2004-06-23 Katsumi Yamaoka <yamaoka@jpl.org>
(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.
"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)))