GNU bug report logs -
#17403
24.4.50; package-alist doc-string error
Previous Next
Reported by: emacs18 <at> gmail.com
Date: Mon, 5 May 2014 03:20:01 UTC
Severity: minor
Tags: notabug
Found in version 24.4.50
Done: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 17403 <at> debbugs.gnu.org (full text, mbox):
Stefan Kangas <stefan <at> marxist.se> writes:
> Richard Kim <emacs18 <at> gmail.com> writes:
>
>> I believe the doc-string for package-alist is incorrect.
>> Each element is (PKG DESCS) rather than (PKG . DESCS), i.e.,
>> each item is (list PKG DESCS) rather than (cons PKG DESCS).
>> To fix this, the patch shown below can be applied.
>
> You are correct. There is indeed a difference between what the
> documentation says and what the code does. According to the code,
> package-alist is *not* an alist, but a list of lists. (This goes back
> to at least 2013 AFAICT.)
>
> Yet it has the suffix "-alist".
The only structural requirement for "alist"ness is to be a list of
conses. As long as none of the lists are empty, a list of lists is (or
can be viewed as) an alist. I don't think there is a bug here, just a
misunderstanding of dot notation.
>> My assertion is confirmed by the following code from package.el:
>>
>> (defun package-process-define-package (exp origin)
>> ...
>> ;; If there's no old package, just add this to `package-alist'.
>> (push (list name new-pkg-desc) package-alist)
Note that this is equivalent to this:
(push (cons name (list new-pkg-desc)) package-alist)
This bug report was last modified 5 years and 309 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.