emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ELPA and built-in packages


From: Stefan Monnier
Subject: Re: ELPA and built-in packages
Date: Mon, 01 Nov 2021 08:11:13 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Phil Sainty [2021-11-01 20:44:52] wrote:

> On 2021-11-01 07:55, Stefan Monnier wrote:
>> Reality will sometimes disagree, because it depends if `package.el`
>> is truly informed about the built-in package.
>
> What is it about the built-in package that "informs" package.el?

The info is stored in `package--builtin-versions` which is populated
from the autoloads information in `lisp/loaddefs.el`, which is
generated by `lisp/emacs-lisp/autoload.el`:

                      (when autoload-builtin-package-versions
                        (let ((version (lm-header "version"))
                              package)
                          (and version
                               (setq version (ignore-errors (version-to-list 
version)))
                               (setq package (or (lm-header "package")
                                                 (file-name-sans-extension
                                                  (file-name-nondirectory 
file))))
                               (setq output-start (autoload--setup-output
                                                   otherbuf outbuf absfile
                                                   load-name outfile))
                               (let ((standard-output (marker-buffer 
output-start))
                                     (print-quoted t))
                                 (princ `(push (purecopy
                                                ',(cons (intern package) 
version))
                                               package--builtin-versions))
                                 (princ "\n")))))

> I just did a test with so-long.el and got slightly odd results.
>
> 1. I ran Emacs 27.2 (which includes so-long 1.0) with a fresh profile.
> 2. I then installed v1.1 from
>    https://elpa.gnu.org/packages/so-long-1.1.tar.lz
> 3. I then quit and ran Emacs 28 (which includes so-long 1.1.2).
> 4. M-x package-refresh-contents
> 5. M-x package-list-packages
> 6. M-x occur RET so-long
>
> Result:
>
> 3 matches for "so-long" in buffer: *Packages*
>     310:  so-long         1.1.2         available         gnu
>     388:  so-long         1.1           installed
>     444:  so-long         1.0           built-in
>
> The actual so-long functionality is good (the built-in version 1.1.2 is
> used in practice, as desired), but that listing is definitely confused.

Quite odd, indeed.  Any chance your `loaddefs.el` was stale?
Try `(cd lisp; make autoloads); make` to rebuild your Emacs after having
explicitly refreshed your autoloads.

You can also try `grep package--builtin-versions **/*.el | grep long` ?


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]