summary refs log tree commit diff
path: root/emacs/guix-messages.el
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2016-01-04 22:59:04 +0300
committerAlex Kost <alezost@gmail.com>2016-01-16 13:02:21 +0300
commit54c3c284d7f319d6db7c665c612fdbeefe81ae5f (patch)
treeda969d795667472a21ea87af0ea36cb86e11935c /emacs/guix-messages.el
parent2df17bd0eeed1e29e64cf21ecec61413af19ba65 (diff)
downloadguix-54c3c284d7f319d6db7c665c612fdbeefe81ae5f.tar.gz
emacs: Replace 'generation-diff' search with 'profile-diff'.
* emacs/guix-main.scm (generation-package-specifications): Rename to...
  (profile-package-specifications): ... this.  Take a single 'profile'
  argument.
  (generation-difference): Rename to...
  (profile-difference): ... this.  Take profiles as arguments.
  (package/output-sexps): Adjust accordingly.
* emacs/guix-ui-generation.el (guix-generation-list-profiles-to-compare):
  New procedure.
  (guix-generation-list-show-added-packages)
  (guix-generation-list-show-removed-packages): Use it.
* emacs/guix-messages.el (guix-messages): Replace 'generation-diff' with
  'profile-diff'.
  (guix-message-outputs-by-diff): Adjust accordingly.
Diffstat (limited to 'emacs/guix-messages.el')
-rw-r--r--emacs/guix-messages.el21
1 files changed, 10 insertions, 11 deletions
diff --git a/emacs/guix-messages.el b/emacs/guix-messages.el
index eb2a76e216..234d3d11da 100644
--- a/emacs/guix-messages.el
+++ b/emacs/guix-messages.el
@@ -98,7 +98,7 @@
          val profile)
       (many "%d package outputs installed in generation %d of profile '%s'."
             count val profile))
-     (generation-diff
+     (profile-diff
       guix-message-outputs-by-diff))
 
     (generation
@@ -183,19 +183,18 @@ Try \"M-x guix-search-by-name\"."
                      "matching time period '%s' - '%s'.")
              str-beg profile time-beg time-end)))
 
-(defun guix-message-outputs-by-diff (profile entries generations)
-  "Display a message for outputs searched by GENERATIONS difference."
+(defun guix-message-outputs-by-diff (_ entries profiles)
+  "Display a message for outputs searched by PROFILES difference."
   (let* ((count (length entries))
          (str-beg (guix-message-string-entries count 'output))
-         (gen1 (car  generations))
-         (gen2 (cadr generations)))
+         (profile1 (car  profiles))
+         (profile2 (cadr profiles)))
     (cl-multiple-value-bind (new old str-action)
-        (if (> gen1 gen2)
-            (list gen1 gen2 "added to")
-          (list gen2 gen1 "removed from"))
-      (message (concat "%s %s generation %d comparing with "
-                       "generation %d of profile '%s'.")
-               str-beg str-action new old profile))))
+        (if (string-lessp profile2 profile1)
+            (list profile1 profile2 "added to")
+          (list profile2 profile1 "removed from"))
+      (message "%s %s profile '%s' comparing with profile '%s'."
+               str-beg str-action new old))))
 
 (defun guix-result-message (profile entries entry-type
                             search-type search-vals)