From af874238d4d05f6584eebb7ceee10ee2ab1bf312 Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Fri, 10 Oct 2014 23:58:30 +0400 Subject: 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. --- emacs/guix-info.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'emacs/guix-info.el') 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) -- cgit 1.4.1