From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: package.el encoding problem Date: Sat, 25 May 2019 18:03:11 +0300 Message-ID: <837eae4lw0.fsf@gnu.org> References: <87blztw65c.fsf@wavexx.thregr.org> <83k1ef3ugs.fsf@gnu.org> <83ef4m4pet.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="106129"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 25 17:06:01 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hUYFF-000RKN-N7 for ged-emacs-devel@m.gmane.org; Sat, 25 May 2019 17:06:01 +0200 Original-Received: from localhost ([127.0.0.1]:43047 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hUYF9-0002Wl-Hp for ged-emacs-devel@m.gmane.org; Sat, 25 May 2019 11:05:55 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hUYCW-0001FU-TL for emacs-devel@gnu.org; Sat, 25 May 2019 11:03:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:60399) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hUYCW-0001JR-Pn; Sat, 25 May 2019 11:03:12 -0400 Original-Received: from [176.228.60.248] (port=4661 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hUYCW-0007dF-AY; Sat, 25 May 2019 11:03:12 -0400 In-reply-to: (message from Stefan Monnier on Sat, 25 May 2019 10:55:36 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:236981 Archived-At: > From: Stefan Monnier > Cc: emacs-devel@gnu.org > 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.