From 23459fa59b3e96baa07da1ae4c78af70c255ac20 Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Fri, 17 Oct 2014 22:21:32 +0400 Subject: emacs: Improve interface for working with multiple profiles. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suggested by David Thompson, Ludovic Courtès and Mathieu Lirzin. * emacs/guix-base.el (guix-profile-prompt): New procedure. (guix-set-current-profile): Use it. (guix-buffer-name-simple, guix-buffer-name-default, guix-buffer-name): New procedures. (guix-buffer-name-function, guix-profile): New variables. (guix-set-vars, guix-get-entries, guix-get-show-entries, guix-set-buffer, guix-history-call, guix-process-package-actions, guix-continue-package-operation-p, guix-delete-generations, guix-switch-to-generation): Add 'profile' argument. * emacs/guix.el (guix-get-show-packages, guix-get-show-generations, guix-search-by-name, guix-search-by-regexp, guix-installed-packages, guix-obsolete-packages, guix-all-available-packages, guix-newest-available-packages, guix-generations, guix-generations-by-time): Likewise. (guix-last-generations): New command. * emacs/guix-info.el: Adjust for using 'profile' argument where needed. * emacs/guix-list.el: Likewise. * doc/emacs.texi (Emacs Commands): Document 'guix-last-generations' and using "C-u" for commands. (Emacs Buffer Names): Document 'guix-buffer-name-function'. --- emacs/guix-list.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'emacs/guix-list.el') diff --git a/emacs/guix-list.el b/emacs/guix-list.el index 4d3c21cbe7..58c03b37a9 100644 --- a/emacs/guix-list.el +++ b/emacs/guix-list.el @@ -441,7 +441,8 @@ This macro defines the following functions: (when (or (<= count guix-list-describe-warning-count) (y-or-n-p (format "Do you really want to describe %d entries? " count))) - (apply #'guix-get-show-entries 'info entry-type 'id ids)))) + (apply #'guix-get-show-entries + guix-profile 'info entry-type 'id ids)))) (defun guix-list-describe (&optional arg) "Describe entries marked with a general mark. @@ -617,7 +618,8 @@ FUN should accept action-type as argument." (let ((actions (delq nil (mapcar fun '(install delete upgrade))))) (if actions - (guix-process-package-actions actions (current-buffer)) + (guix-process-package-actions + guix-profile actions (current-buffer)) (user-error "No operations specified")))) (defun guix-package-list-execute () @@ -751,13 +753,13 @@ VAL is a boolean value." (number (guix-get-key-val entry 'number))) (if current (user-error "This generation is already the current one") - (guix-switch-to-generation number (current-buffer))))) + (guix-switch-to-generation guix-profile number (current-buffer))))) (defun guix-generation-list-show-packages () "List installed packages for the generation at point." (interactive) - (guix-get-show-entries 'list guix-package-list-type 'generation - (guix-list-current-id))) + (guix-get-show-entries guix-profile 'list guix-package-list-type + 'generation (guix-list-current-id))) (defun guix-generation-list-mark-delete (&optional arg) "Mark the current generation for deletion and move to the next line. @@ -773,7 +775,7 @@ With ARG, mark all generations for deletion." (let ((marked (guix-list-get-marked-id-list 'delete))) (or marked (user-error "No generations marked for deletion")) - (guix-delete-generations marked (current-buffer)))) + (guix-delete-generations guix-profile marked (current-buffer)))) (provide 'guix-list) -- cgit v1.2.3