emacs-devel
[Top][All Lists]
Advanced

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

Relax reading package information for forward compatibility


From: Daniel Hackney
Subject: Relax reading package information for forward compatibility
Date: Thu, 26 Apr 2012 11:27:12 -0400

Right now, `package-tar-file-info' calls `package-read-from-string',
which errors out if it does not read the entire string. I think this
should be relaxed so that future versions of "package.el" can define
alternative package description formats without breaking compatibility
with current "package.el" installations. I don't see what the reason is
for being this strict about file contents, especially since it will
break on any files with local variables defined in the footer of the
file.

I propose changing the definition of `package-read-from-string' to:

    (defun package-read-from-string (str)
      "Read a Lisp expression from STR.
    Signal an error if the entire string was not used."
      (car (read-from-string str)))

Or even a `defsubst'. This will allow for "foo-pkg.el" files such as:

    (define-package "foo" "1.2.3" "Frobnicate the baz")
    (define-package-v2 :name "foo"
      :version "2.0"
      :description "Enhanced frobnication"
      :magic-level 'more
      :evil-bit t)

Without breaking current compatibility. This already exists for
`package--read-archive-file', where it checks the version of the archive
contents to see if it matches its compatibility. Side note: for even
better forward compatibility, the format of "archive-contents" files
could be changed to be an alist like ((VERSION . CONTENTS)...) so
`package--read-archive-file' could find its desired version with an
`assoc', making it easier for future versions to maintain compatibility.

Anyway, making this change will not break any existing installations,
since it merely relaxes restrictions already in place, and it will be
highly advantageous to have this sort of thing in place before a release
of Emacs with "package.el" included, since the package info format is
essentially frozen at that point.

Thanks,

Daniel Hackney

P.S. I'm not subscribed to emacs-devel, so please CC me on replies.

--
Daniel M. Hackney



reply via email to

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