From d37ded9e93c999c63bd33f6933b9dc0a2392eaf4 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 5 Apr 2008 20:15:57 +0000 Subject: [PATCH] (mm-with-unibyte-buffer, mm-with-multibyte-buffer): Prefer mm-(en|dis)able-multibyte to default-enable-multibyte-characters. --- lisp/gnus/ChangeLog | 3 +++ lisp/gnus/mm-util.el | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 028a015a279..029e0351f61 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,5 +1,8 @@ 2008-04-05 Stefan Monnier + * mm-util.el (mm-with-unibyte-buffer, mm-with-multibyte-buffer): + Prefer mm-(en|dis)able-multibyte to default-enable-multibyte-characters. + * nnheader.el (nnheader-init-server-buffer): Change buffer's multibyteness after rather than before erasing it. diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el index 510a8c95558..7a944bbc1d8 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el @@ -1053,16 +1053,18 @@ charset, and a longer list means no appropriate charset." (defmacro mm-with-unibyte-buffer (&rest forms) "Create a temporary buffer, and evaluate FORMS there like `progn'. Use unibyte mode for this." - `(let (default-enable-multibyte-characters) - (with-temp-buffer ,@forms))) + `(with-temp-buffer + (mm-disable-multibyte) + ,@forms)) (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))) + `(with-temp-buffer + (mm-enable-multibyte) + ,@forms)) (put 'mm-with-multibyte-buffer 'lisp-indent-function 0) (put 'mm-with-multibyte-buffer 'edebug-form-spec '(body)) -- 2.39.5