unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* guix.el vs. Emacs packages
@ 2014-08-27  9:12 Ludovic Courtès
  2014-08-28 11:21 ` Alex Kost
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2014-08-27  9:12 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

Hi!

It would be really cool if, once a package with a share/emacs/site-lisp
sub-directory has been installed, guix.el would offer to load it, just
like package.el does.  (That would pretty much make guix.el a drop-in
replacement, I think.)

TIA.  :-)

Ludo’.

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

* Re: guix.el vs. Emacs packages
  2014-08-27  9:12 guix.el vs. Emacs packages Ludovic Courtès
@ 2014-08-28 11:21 ` Alex Kost
  2014-08-28 11:51   ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Kost @ 2014-08-28 11:21 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1408 bytes --]

Hello,

Ludovic Courtès (2014-08-27 13:12 +0400) wrote:

> Hi!
>
> It would be really cool if, once a package with a share/emacs/site-lisp
> sub-directory has been installed, guix.el would offer to load it, just
> like package.el does.  (That would pretty much make guix.el a drop-in
> replacement, I think.)

Good idea!

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.

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

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:


[-- Attachment #2: Type: application/emacs-lisp, Size: 121 bytes --]

[-- Attachment #3: Type: text/plain, Size: 143 bytes --]


So there would be no need to put “(autoload 'foo "foo-mode" ...)” in
your ".emacs" for all those commands you want to use.

--
Alex

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

* Re: guix.el vs. Emacs packages
  2014-08-28 11:21 ` Alex Kost
@ 2014-08-28 11:51   ` Ludovic Courtès
  2014-08-28 14:12     ` Alex Kost
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2014-08-28 11:51 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

Alex Kost <alezost@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’.

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

* Re: guix.el vs. Emacs packages
  2014-08-28 11:51   ` Ludovic Courtès
@ 2014-08-28 14:12     ` Alex Kost
  2014-08-28 19:56       ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Kost @ 2014-08-28 14:12 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 2244 bytes --]

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

> Alex Kost <alezost@gmail.com> 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 #2: Type: application/emacs-lisp, Size: 537 bytes --]

[-- Attachment #3: Type: text/plain, Size: 225 bytes --]


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

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

* Re: guix.el vs. Emacs packages
  2014-08-28 14:12     ` Alex Kost
@ 2014-08-28 19:56       ` Ludovic Courtès
  0 siblings, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2014-08-28 19:56 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

Alex Kost <alezost@gmail.com> skribis:

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

OK, thanks for the explanation.

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

[...]

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

Indeed.

When we’re there, maybe we can patch our Emacs package, and eventually
submit the change upstream.

Ludo’.

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

end of thread, other threads:[~2014-08-28 19:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-27  9:12 guix.el vs. Emacs packages Ludovic Courtès
2014-08-28 11:21 ` Alex Kost
2014-08-28 11:51   ` Ludovic Courtès
2014-08-28 14:12     ` Alex Kost
2014-08-28 19:56       ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).