all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: steckerhalter <emacs@postmomentum.ch>
Cc: 21319@debbugs.gnu.org
Subject: bug#21319: `package-install-file' fails with CRLF (Windows) line endings
Date: Fri, 29 Nov 2019 13:58:15 +0100	[thread overview]
Message-ID: <878snykffc.fsf@marxist.se> (raw)
In-Reply-To: <CADwFkmkbRBJetUkfxZSKNx+Ce-x-efbGeDFL_yr8EiwiYp3sqg@mail.gmail.com> (Stefan Kangas's message of "Tue, 22 Oct 2019 03:04:59 +0200")

Stefan Kangas <stefan@marxist.se> writes:

> steckerhalter <emacs@postmomentum.ch> writes:
>
>> package.el contains this code:
>>
>> (defun package-install-file (file)
>>   "Install a package from a file.
>> The file can either be a tar file or an Emacs Lisp file."
>>   (interactive "fPackage file name: ")
>>   (with-temp-buffer
>>     (insert-file-contents-literally file)
>>     (when (string-match "\\.tar\\'" file) (tar-mode))
>>     (package-install-from-buffer)))
>>
>> Since `insert-file-contents-literally' does not do any conversion
>> `package-buffer-info' fails to parse the info if the file is .el and
>> contains CRLF line endings. It then errors out with:
>>
>> Debugger entered--Lisp error: (error "Package lacks a \"Version\" or
>> \"Package-Version\" header")
>>   signal(error ("Package lacks a \"Version\" or \"Package-Version\" header"))
>>   error("Package lacks a \"Version\" or \"Package-Version\" header")
>>   package-buffer-info()
>>
>> This affects all recent Emacs versions (including trunk).
>
> This was reported 4 years ago, but unfortunately never got a reply at
> the time.
>
> Are you still seeing this on a recent version of Emacs?  If yes, could
> you please provide a minimal example file which fails to install?
>
> Also, why does your file have these line endings in the first place?
> Was this file written in Emacs?  I'm trying to understand if this is
> an important use case or the common scenario for users of MS-Windows,
> since I don't use it myself.

We have gotten no more information within five weeks here.

Does anyone think it's important to support CRLF line endings in
package.el?  I don't use Windows, so I'm not sure that I understand if
this is an important use case or not.  But AFAIK, and this might be
completely wrong, you should be fine as long as you edit the file in
Emacs?

I'll give this a couple of weeks more, and if I don't hear anything
else within that time, I'll just go ahead and assume that what I'm
saying is correct and therefore close this bug report.

Please speak up if any of the above is incorrect and this bug should
remain open.

Best regards,
Stefan Kangas





  parent reply	other threads:[~2019-11-29 12:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-12 13:46 bug#20309: 25.0.50; Coding conversion error during clojure-mode package upgrade Dmitry Gutov
2019-10-22  0:57 ` Stefan Kangas
2019-10-22 13:03   ` Dmitry Gutov
2019-10-22  1:04 ` bug#20309: bug#21319: `package-install-file' fails with CRLF (Windows) line endings Stefan Kangas
2019-10-22 14:50   ` Stefan Kangas
2019-11-29 12:58   ` Stefan Kangas [this message]
2019-11-29 13:29     ` Eli Zaretskii
2022-01-29 17:03       ` Lars Ingebrigtsen
2022-01-29 17:07         ` Eli Zaretskii
2022-01-29 17:09           ` Lars Ingebrigtsen
  -- strict thread matches above, loose matches on Subject: below --
2015-08-22  4:30 steckerhalter

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=878snykffc.fsf@marxist.se \
    --to=stefan@marxist.se \
    --cc=21319@debbugs.gnu.org \
    --cc=emacs@postmomentum.ch \
    /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.