From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: package.el encoding problem
Date: Sat, 25 May 2019 18:03:11 +0300 [thread overview]
Message-ID: <837eae4lw0.fsf@gnu.org> (raw)
In-Reply-To: <jwv8suuvb4s.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Sat, 25 May 2019 10:55:36 -0400)
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> 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.
next prev parent reply other threads:[~2019-05-25 15:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-23 15:18 package.el encoding problem Yuri D'Elia
2019-05-23 15:27 ` Noam Postavsky
2019-05-23 15:33 ` Yuri D'Elia
2019-05-24 15:45 ` Stefan Monnier
2019-05-24 16:36 ` Stefan Monnier
2019-05-25 6:43 ` Eli Zaretskii
2019-05-25 12:15 ` Stefan Monnier
2019-05-25 13:47 ` Eli Zaretskii
2019-05-25 14:55 ` Stefan Monnier
2019-05-25 15:03 ` Eli Zaretskii [this message]
2019-05-25 15:26 ` Stefan Monnier
2019-05-25 16:03 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=837eae4lw0.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.