unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Bastien <bzg@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] trunk r115918: package.el: various fixes.
Date: Wed, 08 Jan 2014 16:00:52 +0100	[thread overview]
Message-ID: <87bnzmzfff.fsf@bzg.ath.cx> (raw)
In-Reply-To: <jwviotulfw5.fsf-monnier+emacsdiffs@gnu.org> (Stefan Monnier's message of "Wed, 08 Jan 2014 09:16:39 -0500")

Stefan Monnier <monnier@iro.umontreal.ca> 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



  reply	other threads:[~2014-01-08 15:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1W0rBI-0004nD-NV@vcs.savannah.gnu.org>
2014-01-08 14:16 ` [Emacs-diffs] trunk r115918: package.el: various fixes Stefan Monnier
2014-01-08 15:00   ` Bastien [this message]
2014-01-08 17:05   ` Glenn Morris
2014-01-08 17:40     ` Bastien

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bnzmzfff.fsf@bzg.ath.cx \
    --to=bzg@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).