Alex Kost <alez...@gmail.com> skribis: > If by “offer to load” you mean to load/require the whole package, this > is not what “package.el” does. (I think you know the following but just > to clarify things): during installing a package, “package.el” generates > "...-autoloads.el" (it usually contains the main interactive commands) > and loads it. And on emacs startup "...-autoloads.el" files for each > package are loaded, so that "M-x ..." for installed packages become > available.
Right. > So for the real “drop-in replacement”, the following should be done > (IMHO): Guix recipes for emacs packages should be modified to > additionally generate "...-autoloads.el" (like it is done by > “package.el”: for example using ‘update-directory-autoloads’ function if > a package has appropriate "autoload cookies"). I think it should be quite easy to extend the emacs-utils module that Mark added with a procedure to generate an autoloads file. I would be nice to have an ‘emacs-build-system’ with an additional phase that does the autoloads generations. However, looking at the packages in emacs.scm, it seems there’s almost no common denominator. So maybe emacs-build-system would gnu-build-system + autoload-generation phase. Thoughts? > And after an Emacs package is installed with “guix.el”, its > "...-autoloads.el" file may be loaded just like it is done by > “package.el”. > > Moreover if each installed emacs package will have "...-autoloads.el", > these files may be loaded on emacs startup simply like this: > > (mapc load > (directory-files "~/.guix-profile/share/emacs/site-lisp" > t "-autoloads.el$")) > > So there would be no need to put “(autoload 'foo "foo-mode" ...)” in > your ".emacs" for all those commands you want to use. Indeed. How does package.el handles that actually? Everything package installed with it is automatically loaded on startup, without having to add a single line to ~/.emacs. Thanks, Ludo’.