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-base.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'emacs/guix-base.el') diff --git a/emacs/guix-base.el b/emacs/guix-base.el index aafa220f8b..5131eb0f87 100644 --- a/emacs/guix-base.el +++ b/emacs/guix-base.el @@ -816,6 +816,15 @@ Each element from GENERATIONS is a generation number." (guix-make-guile-expression 'delete-generations* guix-current-profile generations)))) +(defun guix-switch-to-generation (generation) + "Switch `guix-current-profile' to GENERATION number." + (when (or (not guix-operation-confirm) + (y-or-n-p (format "Switch current profile to generation %d? " + generation))) + (guix-eval-in-repl + (guix-make-guile-expression + 'switch-to-generation guix-current-profile generation)))) + (provide 'guix-base) ;;; guix-base.el ends here -- cgit v1.2.3