[Top][All Lists]

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

Re: package.el encoding problem

From: Eli Zaretskii
Subject: Re: package.el encoding problem
Date: Sat, 25 May 2019 18:03:11 +0300

> From: Stefan Monnier <address@hidden>
> Cc: address@hidden
> Date: Sat, 25 May 2019 10:55:36 -0400
> >> We used to put it into a multibyte buffer, which then causes the save
> >> the be all confused because the bytes 128-255 it contains aren't part of
> >> any coding-system.
> >
> > I don't see how that matters.  Raw bytes should be converted back to
> > their original unibyte form when saving, no matter what coding-system
> > is used.
> The bytes were saved correctly.  But before that happened, the user was
> prompted to choose a coding-system.

Is that the only problem?  IOW, if we prevent the prompt, will
package.el work correctly in this scenario?

You previously said that in the past we attempted to bind
coding-system-for-write, which in general is the easiest way of
preventing the prompt.  Didn't it work?

> >> It is definitely *possible* to use multibyte buffers even in cases where
> >> we only manipulate bytes, but it is undesirable.
> > I'm probably missing something, because I don't see would that be
> > undesirable.
> It doesn't do anything else than introduce problems (e.g. having to
> decide how to encode chars even though there are no chars to decode)
> and inefficiencies.
> I'm rather curious what you think would be the benefits from using
> a multibyte buffer here.

One obvious benefit is that you won't need to set the buffer to be
unibyte.  People tend to regard this as some kind of black magic,
which creates myths, like the (wrong) idea that unibyte text cannot be
processed correctly in a multibyte buffer.  I'd rather we avoided
substantiating such myths.  Also, we should in theory be able to
eliminate unibyte buffers, at least in Lisp application code.

reply via email to

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