From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bastien Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] trunk r115918: package.el: various fixes. Date: Wed, 08 Jan 2014 16:00:52 +0100 Message-ID: <87bnzmzfff.fsf@bzg.ath.cx> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1389193265 18721 80.91.229.3 (8 Jan 2014 15:01:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Jan 2014 15:01:05 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 08 16:01:12 2014 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 1W0ud4-0000UV-29 for ged-emacs-devel@m.gmane.org; Wed, 08 Jan 2014 16:01:10 +0100 Original-Received: from localhost ([::1]:47161 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0ud3-0000v1-PH for ged-emacs-devel@m.gmane.org; Wed, 08 Jan 2014 10:01:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0ucv-0000uh-TN for emacs-devel@gnu.org; Wed, 08 Jan 2014 10:01:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0ucq-000716-Iy for emacs-devel@gnu.org; Wed, 08 Jan 2014 10:01:01 -0500 Original-Received: from mail-wi0-x22e.google.com ([2a00:1450:400c:c05::22e]:64376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0ucq-000710-CS for emacs-devel@gnu.org; Wed, 08 Jan 2014 10:00:56 -0500 Original-Received: by mail-wi0-f174.google.com with SMTP id z2so5638582wiv.1 for ; Wed, 08 Jan 2014 07:00:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; bh=Wy/GDdb2am3m3HQyZU5J4b01Tm4TVtgjk7eRuwxeLD4=; b=vsgTTGDL2GR52hDSp/dre6CbdPFFN/lGCpaV8kWxIs4+mFwgaSC15XQa/NZu4FlIfY 1cT3QfummHMhK60fRy5h+x1O7OJXZHap/8+dvacbOqP7LSs/D0rwyAbgchvSsfqgE6n2 ZJdBS0wHFnIGggK5zIGgiNV1CVrbdEP6MKUmsBhxtpL9DJefp1ccO/tKWzswtUtSFj8d nTgjB3yT2toREDpshDGKFBwfzvx+JtpG3MQP5lGmh+cs6ywC5Z7vhy8dkM9ibHw7Xp+n JKZIMGLnj2a/a4NwF8Zsvn/eVqLjPUzZA1NF+ZfUVf9H9g+MmPwzbhgKXeeboFMQNdiW trFQ== X-Received: by 10.180.93.130 with SMTP id cu2mr22075475wib.38.1389193255264; Wed, 08 Jan 2014 07:00:55 -0800 (PST) Original-Received: from bzg.localdomain (AMontsouris-651-1-141-120.w90-46.abo.wanadoo.fr. [90.46.120.120]) by mx.google.com with ESMTPSA id f7sm48255080wjb.7.2014.01.08.07.00.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jan 2014 07:00:53 -0800 (PST) Original-Received: by bzg.localdomain (Postfix, from userid 1000) id 4338E1C20632; Wed, 8 Jan 2014 16:00:52 +0100 (CET) In-Reply-To: (Stefan Monnier's message of "Wed, 08 Jan 2014 09:16:39 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22e 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:167731 Archived-At: Stefan Monnier writes: >> @@ -881,13 +881,14 @@ >> "Return true if PACKAGE, of MIN-VERSION or newer, is installed. >> MIN-VERSION should be a version list." >> (unless package--initialized (error "package.el is not yet initialized!")) >> + (when (assq package package-alist) >> (or >> (let ((pkg-descs (cdr (assq package package-alist)))) >> (and pkg-descs >> (version-list-<= min-version >> (package-desc-version (car pkg-descs))))) >> ;; Also check built-in packages. >> - (package-built-in-p package min-version))) >> + (package-built-in-p package min-version)))) > > Could you explain in which circumstance you found this necessary? This is not necessary (as in "this does not fix a bug") but since package-installed-p is more like to return nil than t*, then it's quickier to first check (assq package package-alist) instead of checking by the package descriptions. * Assuming most people don't install the majority of packages, of course. > This might point to a problem elsewhere, In general, package.el goes directly at checking descriptions instead of the names, but for checking the mere existence I don't think it's necessary -- at least it's not anymore, now that the structure of package-alist is that of what its docstring describes. -- Bastien