all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* package--builtin-versions
@ 2015-05-21 22:13 Artur Malabarba
  2015-05-22  1:41 ` package--builtin-versions Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Artur Malabarba @ 2015-05-21 22:13 UTC (permalink / raw)
  To: emacs-devel

I stumbled into this odd little variable the other day, and I was
wondering why it's designed the way it is.

AFAIKT, the `package--builtin-versions' variable is only used by
`package.el', but it's defined in `subr.el', and it's populated in
`loaddefs.el' which is generated by `autoload.el'.
Is this for performance reasons?

I always assumed it was like this because of some complex
interdependency, but I've been grep'ing and I can't find this variable
being used anywhere outside package.el.
I'm wondering if this can be simplified to go entirely in package.el.
Something like:

  (defvar package--builtin-versions
    (eval-when-compile
      (go-thtough-builtin-packages-and-accumulate-autoloads)))

This should still happen at bootstrap time, so it wouldn't affect
Emacs startup. In fact, it might help emacs startup a little bit,
since there would be 76 fewer forms in `loaddefs.el'.

Cheers,



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: package--builtin-versions
  2015-05-21 22:13 package--builtin-versions Artur Malabarba
@ 2015-05-22  1:41 ` Stefan Monnier
  2015-05-23 16:32   ` package--builtin-versions Artur Malabarba
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2015-05-22  1:41 UTC (permalink / raw)
  To: Artur Malabarba; +Cc: emacs-devel

> I stumbled into this odd little variable the other day, and I was
> wondering why it's designed the way it is.

It was the easy way to get this data uptodate and reasonably cheap.

>   (defvar package--builtin-versions
>     (eval-when-compile
>       (go-thtough-builtin-packages-and-accumulate-autoloads)))

Two problems with that:
1- you need to write go-thtough-builtin-packages-and-accumulate-autoloads,
   instead of piggy-backing on autoload.el (which benefits from the
   optimization of only looking at the files that were changed, for
   example).
2- if package.el doesn't change while some builtin package is
   upgraded/added, this var will be out-of-date.

> This should still happen at bootstrap time, so it wouldn't affect
> Emacs startup. In fact, it might help emacs startup a little bit,
> since there would be 76 fewer forms in `loaddefs.el'.

It would be nice to only define package--builtin-versions when we need
it (i.e. when package.el is loaded), but it's not super important:
package--builtin-versions is pretty small and loaddefs.el is preloaded
so its size shouldn't affect Emacs startup.


        Stefan



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: package--builtin-versions
  2015-05-22  1:41 ` package--builtin-versions Stefan Monnier
@ 2015-05-23 16:32   ` Artur Malabarba
  0 siblings, 0 replies; 3+ messages in thread
From: Artur Malabarba @ 2015-05-23 16:32 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

2015-05-22 2:41 GMT+01:00 Stefan Monnier <monnier@iro.umontreal.ca>:
>> I stumbled into this odd little variable the other day, and I was
>> wondering why it's designed the way it is.
>
> It was the easy way to get this data uptodate and reasonably cheap.
>
>>   (defvar package--builtin-versions
>>     (eval-when-compile
>>       (go-thtough-builtin-packages-and-accumulate-autoloads)))
>
> Two problems with that:
> 1- you need to write go-thtough-builtin-packages-and-accumulate-autoloads,
>    instead of piggy-backing on autoload.el (which benefits from the
>    optimization of only looking at the files that were changed, for
>    example).
> 2- if package.el doesn't change while some builtin package is
>    upgraded/added, this var will be out-of-date.
>
>> This should still happen at bootstrap time, so it wouldn't affect
>> Emacs startup. In fact, it might help emacs startup a little bit,
>> since there would be 76 fewer forms in `loaddefs.el'.
>
> It would be nice to only define package--builtin-versions when we need
> it (i.e. when package.el is loaded), but it's not super important:
> package--builtin-versions is pretty small and loaddefs.el is preloaded
> so its size shouldn't affect Emacs startup.
>
>
>         Stefan

Thanks for the explanation, Stefan.
Sounds like moving it into package.el would cause more problems than it solves.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-23 16:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-21 22:13 package--builtin-versions Artur Malabarba
2015-05-22  1:41 ` package--builtin-versions Stefan Monnier
2015-05-23 16:32   ` package--builtin-versions Artur Malabarba

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.