all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Hackney <dan@haxney.org>
To: emacs-devel@gnu.org
Subject: Relax reading package information for forward compatibility
Date: Thu, 26 Apr 2012 11:27:12 -0400	[thread overview]
Message-ID: <CAMqXDZvSDsehjcXLcWdKdG6qV2OFJO4JXK27Q5cvNERyWBmBgg@mail.gmail.com> (raw)

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	other threads:[~2012-04-26 15:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-26 15:27 Daniel Hackney [this message]
2012-04-26 17:07 ` Relax reading package information for forward compatibility Chong Yidong
2012-04-28  1:44   ` Daniel Hackney

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=CAMqXDZvSDsehjcXLcWdKdG6qV2OFJO4JXK27Q5cvNERyWBmBgg@mail.gmail.com \
    --to=dan@haxney.org \
    --cc=emacs-devel@gnu.org \
    /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.