guix-devel
[Top][All Lists]
Advanced

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

[PATCH] emacs: Add support for deleting generations.


From: Alex Kost
Subject: [PATCH] emacs: Add support for deleting generations.
Date: Sun, 05 Oct 2014 12:54:05 +0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Ludovic Courtès (2014-10-05 00:23 +0400) wrote:

> Hi!
>
> Alex Kost <address@hidden> skribis:
>
>> What about the attached patch?  Some comments and questions:
>>
>> - I added 'store' argument to the exported procedures, however it is
>>   used only in one particular case: when we need to create an empty
>>   profile (i.e. to call ‘link-to-empty-profile’).  Is there a way to
>>   avoid using 'store' argument there or is it fine to leave it like
>>   this?
>
> For now it’s fine to leave it like this, with the ‘store’ argument.
> Eventually it should be changed to use the monadic style, though.

I read the info manual about gexps and monads.  However I don't really
understand how to use monadic style here, sorry.

>> - I actually need only ‘delete-generations’ procedure for Emacs UI, but
>>   I think other procedures are also worth to be exported or not?
>
> Yes, sure.

Thanks.

>> - Perhaps there is a better place for those functions than
>>   (guix scripts package)?
>
> Yes, (guix profiles) would be a better place IMO.

OK.

>> - (Not related to this patch, but still …)  Currently with “roll-back”,
>>   we can only switch to the previous generation.  What about adding a
>>   possibility to switch to any generation?  So that we could use
>>   something like this:
>>
>>     guix package --switch-generation=7
>>
>>   Also such functionality can be added to Emacs UI: for example pressing
>>   "C" on a generation in *Guix Generation List* will make this
>>   generation the current one.
>>
>>   So ‘roll-back’ procedure may become a special case of the
>>   ‘switch-generation’ one.  WDYT?
>
> I think it’s a good idea!  (I think it was suggested in earlier
> discussions, but never implemented.)

Great, I think I can make it, but without monads :-(

>> From c50d1674d3be699198afb649a2a9932ca44c89bc Mon Sep 17 00:00:00 2001
>> From: Alex Kost <address@hidden>
>> Date: Sat, 4 Oct 2014 20:45:35 +0400
>> Subject: [PATCH] guix package: Export generation procedures.
>>
>> * guix/scripts/package.scm: Export 'roll-back', 'delete-generation',
>>   'delete-generations'.
>>   (link-to-empty-profile, roll-back): Add 'store' argument.
>>   (delete-generations): New procedure.
>>   (guix-package): Adjust accordingly.
>>   [delete-generation]: Move to the top level.  Add 'store' and 'profile'
>>   arguments.
>>   [display-and-delete]: Move to 'delete-generation'.
>
> OK to commit.
>
> To sum up, I would imagine two followups to this:
>
>   1. Move these procedures to (guix profiles).
>   2. Convert them to monadic style.
>
> WDYT?

I like the idea of using monads there, but as I said I'm too week (I
mean "month" (I mean "weak")) for writing that.

Also those followups would make my commit totally redundant, no?
Wouldn't it be better to make a commit for adding the monadic functions
to (guix profiles) directly?

However if you still allow me to push this commit, I think I can also
push the attached one with the changes for Emacs UI now (if it looks OK
for you).

Attachment: 0001-emacs-Add-support-for-deleting-generations.patch
Description: Text Data


reply via email to

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