summary refs log tree commit diff
path: root/emacs/guix-messages.el
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/guix-messages.el')
-rw-r--r--emacs/guix-messages.el18
1 files changed, 17 insertions, 1 deletions
diff --git a/emacs/guix-messages.el b/emacs/guix-messages.el
index 7a0b493ac7..bd985a0670 100644
--- a/emacs/guix-messages.el
+++ b/emacs/guix-messages.el
@@ -99,7 +99,9 @@
       (1 "A single package output installed in generation %d of profile '%s'."
          val profile)
       (many "%d package outputs installed in generation %d of profile '%s'."
-            count val profile)))
+            count val profile))
+     (generation-diff
+      guix-message-outputs-by-diff))
 
     (generation
      (id
@@ -167,6 +169,20 @@
                      "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."
+  (let* ((count (length entries))
+         (str-beg (guix-message-string-entries count 'output))
+         (gen1 (car  generations))
+         (gen2 (cadr generations)))
+    (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))))
+
 (defun guix-result-message (profile entries entry-type
                             search-type search-vals)
   "Display an appropriate message after displaying ENTRIES."