summaryrefslogtreecommitdiff
path: root/emacs/guix-info.el
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2014-10-10 23:58:30 +0400
committerAlex Kost <alezost@gmail.com>2014-10-13 14:59:35 +0400
commitaf874238d4d05f6584eebb7ceee10ee2ab1bf312 (patch)
tree04b57bb0766ac8e800b382c02099ba4681f981cc /emacs/guix-info.el
parentc2379b3c1fe169b56d7d960fa31b1d191a779b1b (diff)
downloadpatches-af874238d4d05f6584eebb7ceee10ee2ab1bf312.tar
patches-af874238d4d05f6584eebb7ceee10ee2ab1bf312.tar.gz
emacs: Add support for switching generations.
* emacs/guix-base.el (guix-switch-to-generation): New procedure. * emacs/guix-info.el (guix-generation-info-insert-current): Insert button for switching to generation. * emacs/guix-list.el (guix-generation-list-switch): New procedure. * doc/emacs.texi (emacs List buffer, emacs Info buffer): Document switching generations.
Diffstat (limited to 'emacs/guix-info.el')
-rw-r--r--emacs/guix-info.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/emacs/guix-info.el b/emacs/guix-info.el
index fc1b585414..7a600907b1 100644
--- a/emacs/guix-info.el
+++ b/emacs/guix-info.el
@@ -647,7 +647,14 @@ ENTRY is an alist with package info."
"Insert boolean value VAL showing whether this generation is current."
(if val
(guix-info-insert-val-default "Yes" 'guix-generation-info-current)
- (guix-info-insert-val-default "No" 'guix-generation-info-not-current)))
+ (guix-info-insert-val-default "No" 'guix-generation-info-not-current)
+ (guix-info-insert-indent)
+ (guix-info-insert-action-button
+ "Switch"
+ (lambda (btn)
+ (guix-switch-to-generation (button-get btn 'number)))
+ "Switch to this generation (make it the current one)"
+ 'number (guix-get-key-val entry 'number))))
(provide 'guix-info)