guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] emacs: Add completions for '--type' option of 'refresh' popu


From: Alex Kost
Subject: Re: [PATCH] emacs: Add completions for '--type' option of 'refresh' popup.
Date: Sat, 31 Oct 2015 23:29:20 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Ludovic Courtès (2015-10-29 23:14 +0300) wrote:

> Alex Kost <address@hidden> skribis:
>
>> This is for completions in "M-x guix r =t".
>>
>> In 'emacs/guix-main.scm' I used:
>>
>>   (map (@ (guix upstream) upstream-updater-name)
>>        (@ (guix scripts refresh) %updaters)))
>>
>> instead of adding these modules to the top-level (use-modules ...) to
>> avoid loading them on start.
>
> That doesn’t avoid anything actually.

Ouch :-(

> You could use #:autoload, but only for ‘%updaters’ because
> ‘upstream-updater-name’ is a macro so it needs to be available at
> expansion time.

I looked at (info "(guile) Using Guile Modules") and it has the following:

          An autoload is a good way to put off loading a big module
          until it’s really needed, for instance for faster startup or
          if it will only be needed in certain circumstances.

          address@hidden can do a similar thing (see Using Guile Modules), but
          in that case an address@hidden form must be written every time a 
binding
          from the module is used.

To me it sounds like address@hidden does the same thing as ‘#:autoload’, no?
Also #:autoload should be used inside (define-module ...), but
‘guix-main.scm’ does not define a module.

>> From f2bd4c152ddd48a6c1cc13adfff0a616d1732bd3 Mon Sep 17 00:00:00 2001
>> From: Alex Kost <address@hidden>
>> Date: Wed, 28 Oct 2015 21:11:36 +0300
>> Subject: [PATCH] emacs: Add completions for '--type' option of 'refresh'
>>  popup.
>>
>> * guix/scripts/refresh.scm: Export '%updaters'.
>> * emacs/guix-main.scm (refresh-updater-names): New procedure.
>> * emacs/guix-base.el (guix-refresh-updater-names): New function.
>> * emacs/guix-read.el (guix-read-refresh-updater-names,
>>   guix-read-refresh-updater-names-string): New functions.
>> * emacs/guix-command.el (guix-command-improve-refresh-argument): Use
>>   'guix-read-refresh-updater-names-string'.
>
> OK with guix-main.scm using appropriate #:autoload and #:use-module.

Not sure if I understand it correctly after all, but I think I should
either leave address@hidden or add (guix upstream) and (guix scripts refresh) to
(use-modules ...), right?

-- 
Alex



reply via email to

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