[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mm-with-unibyte-current-buffer

From: Katsumi Yamaoka
Subject: Re: mm-with-unibyte-current-buffer
Date: Tue, 11 May 2010 10:29:30 +0900
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

>>>>> Eli Zaretskii wrote:
>> From: Stefan Monnier <address@hidden>
>> Date: Mon, 10 May 2010 13:51:27 -0400
>> Cc: Katsumi Yamaoka <address@hidden>, address@hidden, address@hidden
>>> Binding the value of enable-multibyte-characters may be a no-no, but
>>> _testing_ its value is still possible.  So I see no reason to
>>> set-buffer-multibyte unconditionally, because you may already be in a
>>> unibyte buffer.
>> But calling set-buffer-multibyte with the current value is harmless (it
>> checks a returns right away if there's nothing to do; this check might
>> even be faster than doing it in Elisp).

> That's true, but the unconditional call `(set-buffer-multibyte t)' at
> the end of the macro is _not_ harmless, if the buffer was originally a
> unibyte one.

The macro runs `(set-buffer-multibyte nil)' first regardless of
the multibyteness of a buffer whatever data are there, and runs
`(set-buffer-multibyte t)' finally.  I don't recall what kind of
data were there, but in the early days of the Emacs 23 development
I saw data were made broken.  Did you mean such a trouble will
never happen with the released Emacs versions?

(Note: Gnus supports Emacs 21~24, XEmacs 21.4&21.5, and SXEmacs.)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]