unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Ioannis Kappas <ioannis.kappas@gmail.com>
Cc: 48137@debbugs.gnu.org
Subject: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings
Date: Mon, 03 May 2021 14:23:53 -0400	[thread overview]
Message-ID: <jwvlf8vsn3w.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CAMRHuGC0mr7jgUozQBMP8uR6RyG-ZC9-49ry2meca96upd-SNQ@mail.gmail.com> (Ioannis Kappas's message of "Mon, 3 May 2021 18:47:34 +0100")

Ioannis Kappas [2021-05-03 18:47:34] wrote:
> On Sat, May 1, 2021 at 2:51 PM Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> > I don't think this is TRT, because insert-file-contents also decodes
>> > the character encoding, not just the EOL encoding.
>>
>> I think for `.el` files it's actually correct to decode the character
>> encoding here (it's maybe not necessary, but I think it's at least
>> as correct as what we do now, since `package-install-from-buffer`
>> expects a "normal" buffer, hence for `.el` buffers it expects one where
>> characters have been decoded).
> Thanks Stefan. Does this also apply to the only other use of
> `insert-file-contents-literally' in 'package,?

I don't think so, no.

> In particular `package--with-response-buffer-1' is referenced by
> `package-check-signature'

This definitely needs to deal with bytes only, we don't want any
encoding/decoding to risk changing the byte contents.

> and `package--download-one-archive'.

I think the same is true here.

> (I am personally more in favor of supporting DOS files, because it
> makes the caller's life easier on MS-Windows and brings them on par
> with Unix, though Eli's concern has to be addressed first)

My own opinion is that .el files are files that belong to Emacs and they
should use Emacs's "native" file format, whatever that is.  I think the
"most native" would be `utf-8-emacs-unix` so I'd be OK with deprecating
all other encodings, but I don't think that's going to happen ;-)

My comment on that subject was instead focused on files distributed via
ELPA (and hence wouldn't really apply to `package-install-file`): we
could document that those files should use utf-8 and unix EOLs.
At the same time, I haven't seen a clear technical benefit to imposing
such a constraint, so it's probably not worth the trouble.
[ There can be a real technical advantage to imposing
  `utf-8-emacs-unix` for .el files since it can save us the trip
  through `load-with-code-conversion` which slows down `load`ing
  non-byte-compiled files, but that doesn't matter much for ELPA files
  since those are usually byte-compiled anyway.  ]


        Stefan






  reply	other threads:[~2021-05-03 18:23 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-01 11:38 bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings Ioannis Kappas
2021-05-01 11:48 ` Ioannis Kappas
2021-05-01 12:15   ` Eli Zaretskii
2021-05-01 13:51     ` Stefan Monnier
2021-05-03 17:47       ` Ioannis Kappas
2021-05-03 18:23         ` Stefan Monnier [this message]
2021-05-03 18:33           ` Eli Zaretskii
2021-05-03 18:49             ` Ioannis Kappas
2021-05-03 18:52               ` Eli Zaretskii
2021-05-03 20:12                 ` Stefan Monnier
2021-05-04 11:39                   ` Eli Zaretskii
2021-05-03 19:41             ` Stefan Monnier
2021-05-04 11:34               ` Eli Zaretskii
2021-05-04 15:57                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-04 16:14                   ` Eli Zaretskii
2021-05-04 16:27                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-04 16:51                       ` Eli Zaretskii
2021-05-05  7:03                         ` Ioannis Kappas
2021-05-05 12:01                           ` Eli Zaretskii
     [not found]                             ` <CAMRHuGAi9+q-MKRGPxLqxdP_7SSF4Nqj+JuSsZigviAQs_d7Rw@mail.gmail.com>
2021-05-06  6:55                               ` Ioannis Kappas
2021-05-06  8:12                                 ` Eli Zaretskii
2021-05-06 13:27                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-06 15:26                                   ` Eli Zaretskii
2021-05-11  6:52                                     ` Ioannis Kappas
2021-05-11 12:55                                       ` Eli Zaretskii
2021-05-15 13:52                                         ` Ioannis Kappas
2021-05-16  9:09                                           ` Ioannis Kappas
2021-05-29  8:20                                             ` Eli Zaretskii
2021-05-29 13:59                                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-29 14:09                                                 ` Eli Zaretskii
2021-06-06  9:11                                                   ` Ioannis Kappas
2021-07-20 13:54                                                     ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvlf8vsn3w.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=48137@debbugs.gnu.org \
    --cc=ioannis.kappas@gmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).