summary refs log tree commit diff
path: root/emacs/guix-info.el
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2014-10-17 22:21:32 +0400
committerAlex Kost <alezost@gmail.com>2014-10-18 10:24:13 +0400
commit23459fa59b3e96baa07da1ae4c78af70c255ac20 (patch)
tree9251bba1b7781a68ff2e6c69253781923cbd08ae /emacs/guix-info.el
parent7c3c0374de446af387c8478f77083fd0e357253c (diff)
downloadguix-23459fa59b3e96baa07da1ae4c78af70c255ac20.tar.gz
emacs: Improve interface for working with multiple profiles.
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'.
Diffstat (limited to 'emacs/guix-info.el')
-rw-r--r--emacs/guix-info.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/emacs/guix-info.el b/emacs/guix-info.el
index dcd2ce2932..551d79a293 100644
--- a/emacs/guix-info.el
+++ b/emacs/guix-info.el
@@ -334,8 +334,8 @@ VAL is a list, call the function on each element of this list."
   'face 'guix-package-info-name-button
   'help-echo "Describe this package"
   'action (lambda (btn)
-            (guix-get-show-entries 'info guix-package-info-type 'name
-                                   (button-label btn))))
+            (guix-get-show-entries guix-profile 'info guix-package-info-type
+                                   'name (button-label btn))))
 
 (defun guix-info-insert-action-button (label action &optional message
                                              &rest properties)
@@ -558,6 +558,7 @@ ENTRY is an alist with package info."
      type-str
      (lambda (btn)
        (guix-process-package-actions
+        guix-profile
         `((,(button-get btn 'action-type) (,(button-get btn 'id)
                                            ,(button-get btn 'output))))
         (current-buffer)))
@@ -631,15 +632,15 @@ ENTRY is an alist with package info."
   (guix-info-insert-action-button
    "Packages"
    (lambda (btn)
-     (guix-get-show-entries 'list guix-package-list-type 'generation
-                            (button-get btn 'number)))
+     (guix-get-show-entries guix-profile 'list guix-package-list-type
+                            'generation (button-get btn 'number)))
    "Show installed packages for this generation"
    'number number)
   (guix-info-insert-indent)
   (guix-info-insert-action-button
    "Delete"
    (lambda (btn)
-     (guix-delete-generations (list (button-get btn 'number))
+     (guix-delete-generations guix-profile (list (button-get btn 'number))
                               (current-buffer)))
    "Delete this generation"
    'number number))
@@ -653,7 +654,7 @@ ENTRY is an alist with package info."
     (guix-info-insert-action-button
      "Switch"
      (lambda (btn)
-       (guix-switch-to-generation (button-get btn 'number)
+       (guix-switch-to-generation guix-profile (button-get btn 'number)
                                   (current-buffer)))
      "Switch to this generation (make it the current one)"
      'number (guix-get-key-val entry 'number))))