From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Re: package.el changes before the feature freeze Date: Fri, 05 Oct 2012 21:38:47 -0400 Message-ID: References: <87ipau51jh.fsf@gnu.org> <87626qk5xo.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1349487535 4641 80.91.229.3 (6 Oct 2012 01:38:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Oct 2012 01:38:55 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org To: Daniel Hackney Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 06 03:39:01 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TKJM3-0005Hd-19 for ged-emacs-devel@m.gmane.org; Sat, 06 Oct 2012 03:38:59 +0200 Original-Received: from localhost ([::1]:53183 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKJLx-0006p1-8U for ged-emacs-devel@m.gmane.org; Fri, 05 Oct 2012 21:38:53 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKJLv-0006o4-Mj for emacs-devel@gnu.org; Fri, 05 Oct 2012 21:38:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TKJLu-0005wg-IW for emacs-devel@gnu.org; Fri, 05 Oct 2012 21:38:51 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:19981) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKJLs-0005wN-Vw; Fri, 05 Oct 2012 21:38:49 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAG6Zu09FxLQG/2dsb2JhbABEtBGBCIIWAQVWIxALDiYSFBgNJIghugmQRAOjM4FYgwU X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="200779974" Original-Received: from 69-196-180-6.dsl.teksavvy.com (HELO pastel.home) ([69.196.180.6]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 05 Oct 2012 21:38:47 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 1DF5C594CB; Fri, 5 Oct 2012 21:38:47 -0400 (EDT) In-Reply-To: (Daniel Hackney's message of "Fri, 5 Oct 2012 19:13:31 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:154111 Archived-At: 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.