aboutsummaryrefslogtreecommitdiff
path: root/emacs/guix-base.el
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2014-10-05 12:31:23 +0400
committerAlex Kost <alezost@gmail.com>2014-10-06 00:02:46 +0400
commitcb6a5c71d875fff6f1c3b2bd1e43c31cc7cfe1ac (patch)
tree8413cb2e9398785ea4e886ac087bc8bb80ca1c03 /emacs/guix-base.el
parentd3d337d2d8f7152cb9ff3724f1cf240ce5ea5be2 (diff)
downloadpatches-cb6a5c71d875fff6f1c3b2bd1e43c31cc7cfe1ac.tar
patches-cb6a5c71d875fff6f1c3b2bd1e43c31cc7cfe1ac.tar.gz
emacs: Add support for deleting generations.
* doc/emacs.texi (emacs List buffer): Mention new key bindings. * emacs/guix-base.el (guix-delete-generations): New procedure. * emacs/guix-info.el (guix-generation-info-insert-number): Use it. * emacs/guix-list.el (guix-generation-list-mark-delete, guix-generation-list-execute): New procedures. * emacs/guix-main.scm (delete-generations*): New procedure.
Diffstat (limited to 'emacs/guix-base.el')
-rw-r--r--emacs/guix-base.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/emacs/guix-base.el b/emacs/guix-base.el
index 8da7835b79..d31fb79a0a 100644
--- a/emacs/guix-base.el
+++ b/emacs/guix-base.el
@@ -801,6 +801,20 @@ Return non-nil, if the operation should be continued; nil otherwise."
guix-operation-option-separator)))
(force-mode-line-update))
+(defun guix-delete-generations (&rest generations)
+ "Delete GENERATIONS.
+Each element from GENERATIONS is a generation number."
+ (when (or (not guix-operation-confirm)
+ (y-or-n-p
+ (let ((count (length generations)))
+ (if (> count 1)
+ (format "Delete %d generations? " count)
+ (format "Delete generation number %d? "
+ (car generations))))))
+ (guix-eval-in-repl
+ (guix-make-guile-expression
+ 'delete-generations* guix-current-profile generations))))
+
(provide 'guix-base)
;;; guix-base.el ends here