[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#12925: 24.1; string-make-unibyte instead of string-as-unibyte
From: |
Stefan Monnier |
Subject: |
bug#12925: 24.1; string-make-unibyte instead of string-as-unibyte |
Date: |
Tue, 01 Jun 2021 10:25:17 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
>> > Why not make both methods do the same: insert the bytes of the
>> > multibyte text into the unibyte buffer?
>> AFAIK it's rather unusual to need to insert a text that's multibyte into
>> a buffer that's unibyte.
> Most possibly, people don't know the text is multibyte.
> Or don't care.
If they don't know or don't care, then the best we can do is signal an
error to try and wake them up: they *should* know and they *should*
care, otherwise it's a bit like inserting in "any buffer you like,
I don't care".
>> And in those cases, the right behavior is not always the same
>> (sometimes it should covert using something like
>> locale-coding-system, sometimes it should preserve the actual
>> byte-sequence used internally, sometimes it should signal an error,
>> ...).
> What I mean is: if we think the current behavior is broken, then what
> I suggest is at least less broken (and sometimes might just be TRT).
I doubt it's less broken: sometimes it will be TRT, other times it will
be worse than what we have.
> At the very least what I suggest is reversible, whereas neither the
> current behavior nor what you suggest is.
My point is that we shouldn't even get into the position of having to
make such arbitrary choices: we should signal an error before we
get there.
Stefan