[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Re: package.el changes before the feature freeze
From: |
Stefan Monnier |
Subject: |
Re: [PATCH] Re: package.el changes before the feature freeze |
Date: |
Fri, 05 Oct 2012 21:38:47 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) |
I haven't read the whole patch, but here are some nitpicks.
The general idea looks fine, tho. We'd need a ChangeLog with that,
it should describe the changes that are neither cosmetic nor simple
adjustments to the use of defstruct.
Stefan
> +Slots:
> +
> +`:name'
> +Name of the package, as a symbol.
> +
> +`:version'
> +Version of the package, as a version list.
> +
> +`:summary'
> +Short description of the package, typically taken from the first
> +line of the file.
> +
> +`:reqs'
> +Requirements of the package. A list of (PACKAGE VERSION-LIST)
> +naming the dependent package and the minimum required version.
> +
> +`:kind'
> +The distribution format of the package. Currently, it is either
> +`single' or `tar'.
> +
> +`:archive'
> +The name of the archive (as a string) whence this package came."
> +
> + name
> + version
> + (summary "No description available.")
> + reqs
> + kind
> + archive)
Nitpick: the fields of the struct (which you can call "slots" if you
prefer, of course) don't have a ":" in front of their name.
[ I'd also prefer using fewer lines in the docstring, so the whole
definition can hopefully fit within a tall-but-split frame. ]
> -(defun package-activate-1 (package pkg-vec)
> - (let* ((name (symbol-name package))
> - (version-str (package-version-join (package-desc-vers pkg-vec)))
> +(defun package-activate-1 (pkg-desc)
> + (let* ((name (package-desc-name pkg-desc))
> + (version-str (package-version-join (package-desc-version pkg-desc)))
> (pkg-dir (package--dir name version-str)))
Hmm... `name' in the new code is now a symbol whereas it was a string in
the old code. Is that right?
> - (load (expand-file-name (concat name "-autoloads") pkg-dir) nil t)
> + (load (expand-file-name (concat (symbol-name name) "-autoloads")
> pkg-dir) nil t)
You can use (format "%s-autoloads" name) to make it work equally with
strings and symbols.
> + (apply 'define-package-desc
BTW,please stick to the "package-" prefix.
> + name-string
> + version-string
> + summary
> + requirements
> + _extra-properties)))
Obviously you haven't played with lexical-binding yet, but the "leading
underscore" is used to denote variables/arguments that are not used, so
the above use of _extra-properties indicates that it should be named
`extra-properties' instead.
> - (package-unpack name version))))
> + (package-unpack (symbol-name name) version))))
All those make me wonder: do we need the `name' slot to be symbol?
Why not let it be a string?
> + (make-package-desc :name name
I know it's the default, but I also prefer not to use the "make-" prefix
and use "package-" as the prefix instead.
- [PATCH] Re: package.el changes before the feature freeze, Daniel Hackney, 2012/10/03
- Re: [PATCH] Re: package.el changes before the feature freeze, Chong Yidong, 2012/10/04
- Re: [PATCH] Re: package.el changes before the feature freeze, Daniel Hackney, 2012/10/05
- Re: [PATCH] Re: package.el changes before the feature freeze,
Stefan Monnier <=
- Re: [PATCH] Re: package.el changes before the feature freeze, Chong Yidong, 2012/10/07
- Re: [PATCH] Re: package.el changes before the feature freeze, Daniel Hackney, 2012/10/08
- Re: [PATCH] Re: package.el changes before the feature freeze, Stefan Monnier, 2012/10/08
- Re: [PATCH] Re: package.el changes before the feature freeze, Daniel Hackney, 2012/10/08
- Re: [PATCH] Re: package.el changes before the feature freeze, Stefan Monnier, 2012/10/09
- Re: [PATCH] Re: package.el changes before the feature freeze, Daniel Hackney, 2012/10/09
- Re: [PATCH] Re: package.el changes before the feature freeze, Stefan Monnier, 2012/10/09
- Re: [PATCH] Re: package.el changes before the feature freeze, Daniel Hackney, 2012/10/09
- Re: [PATCH] Re: package.el changes before the feature freeze, Glenn Morris, 2012/10/09
- Re: [PATCH] Re: package.el changes before the feature freeze, Chong Yidong, 2012/10/11