Subject: bug#16313: 24.3; package-delete does not update package-alist

From: Bastien <[email-masked]>
Date: Wed, 08 Jan 2014 00:08:09 +0100

Glenn Morris <[email-masked]> writes:

> Bastien Guerry wrote:
>
>> Still, package-delete did not cleanly delete the package from
>> package-alist, only its description.
>
> _Should_ it remove the entire entry? It's not obvious to me, given eg
> the way package-installed-p works.

Tom may confirm or infirm this, but I think it should.
The fact that package-installed-p checks for the description
seems due to the min-version parameter, and indeed, IMO the
function should be first checking for the package name before
its description.

>> I pushed a fix to cleanly remove the package occurrence.
>
> -        (delete pkg-desc (assq name package-alist)))
> +       (delete (delete pkg-desc (assq name package-alist)) package-alist))
>
> That doesn't work for the first item in the list.
> Why not the more obvious
>
> (setq package-alist (delete (assq name package-alist) package-alist))

No reason, the above is better.

Should I fix this or wait for Tom's feedback?

-- 
 Bastien