guix-devel
[Top][All Lists]
Advanced

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

Re: guix.el vs. Emacs packages


From: Alex Kost
Subject: Re: guix.el vs. Emacs packages
Date: Thu, 28 Aug 2014 18:12:31 +0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Ludovic Courtès (2014-08-28 15:51 +0400) wrote:

> Alex Kost <address@hidden> skribis:
>
> [...]
>
>> 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?

You are right, I think.  No thoughts actually until I cope with your
notes on scheme code for “guix.el”.

>> 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.

After a user's "~/.emacs" (or "~/.emacs.d/init.el") is loaded, Emacs
calls ‘package-initialize’ function (if ‘package-enable-at-startup’ is
non-nil), which does the job: it cycles through all subdirs (for the
newest packages, as there may be several versions installed) from
‘package-user-dir’ and ‘package-directory-list’ vars and loads all
autoloads from those subdirs.

So "guix-init.el" may provide analogous function:

Attachment: binoShuTraaS7.bin
Description: application/emacs-lisp

Thus with “(require 'guix-init)” in ".emacs" a user will get all needed
autoloads (and it will work even faster than “package.el” as
"guix-init.el" will be tiny while “package.el” is rather big).

--
Alex

reply via email to

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