summary refs log tree commit diff
path: root/emacs/guix-info.el
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2014-10-10 23:50:15 +0400
committerAlex Kost <alezost@gmail.com>2014-10-13 14:59:35 +0400
commitc2379b3c1fe169b56d7d960fa31b1d191a779b1b (patch)
treeed20b1173aafbf971e062b550d30ea8a01932cde /emacs/guix-info.el
parent0546393164d30c6722ddbf17fc05c424a57e71a4 (diff)
downloadguix-c2379b3c1fe169b56d7d960fa31b1d191a779b1b.tar.gz
emacs: Add 'current' generation parameter.
* emacs/guix-main.scm (generation-param-alist): Add 'current' parameter.
* emacs/guix-base.el (guix-param-titles): Add title for 'current' parameter.
* emacs/guix-info.el: Display 'current' parameter.
  (guix-generation-info-current, guix-generation-info-not-current): New faces.
  (guix-generation-info-insert-current): New procedure.
* emacs/guix-list.el: Display 'current' column.
  (guix-generation-list-get-current): New procedure.
Diffstat (limited to 'emacs/guix-info.el')
-rw-r--r--emacs/guix-info.el19
1 files changed, 18 insertions, 1 deletions
diff --git a/emacs/guix-info.el b/emacs/guix-info.el
index d5226b1286..fc1b585414 100644
--- a/emacs/guix-info.el
+++ b/emacs/guix-info.el
@@ -136,6 +136,7 @@ number of characters, it will be split into several lines.")
      (location          guix-package-info-insert-location))
     (generation
      (number            guix-generation-info-insert-number)
+     (current           guix-generation-info-insert-current)
      (path              guix-info-insert-file-path)
      (time              guix-info-insert-time)))
   "Methods for inserting parameter values.
@@ -161,7 +162,7 @@ argument.")
     (output name version output synopsis path dependencies location home-url
             license inputs native-inputs propagated-inputs description)
     (installed path dependencies)
-    (generation number prev-number time path))
+    (generation number prev-number current time path))
   "List of displayed entry parameters.
 Each element of the list should have a form:
 
@@ -613,6 +614,16 @@ ENTRY is an alist with package info."
   "Face used for a number of a generation."
   :group 'guix-generation-info)
 
+(defface guix-generation-info-current
+  '((t :inherit guix-package-info-installed-outputs))
+  "Face used if a generation is the current one."
+  :group 'guix-generation-info)
+
+(defface guix-generation-info-not-current
+  '((t nil))
+  "Face used if a generation is not the current one."
+  :group 'guix-generation-info)
+
 (defun guix-generation-info-insert-number (number &optional _)
   "Insert generation NUMBER and action buttons."
   (guix-info-insert-val-default number 'guix-generation-info-number)
@@ -632,6 +643,12 @@ ENTRY is an alist with package info."
    "Delete this generation"
    'number number))
 
+(defun guix-generation-info-insert-current (val entry)
+  "Insert boolean value VAL showing whether this generation is current."
+  (if val
+      (guix-info-insert-val-default "Yes" 'guix-generation-info-current)
+    (guix-info-insert-val-default "No" 'guix-generation-info-not-current)))
+
 (provide 'guix-info)
 
 ;;; guix-info.el ends here