aboutsummaryrefslogtreecommitdiff
path: root/emacs/guix-list.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-list.el
parent0546393164d30c6722ddbf17fc05c424a57e71a4 (diff)
downloadguix-c2379b3c1fe169b56d7d960fa31b1d191a779b1b.tar
guix-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-list.el')
-rw-r--r--emacs/guix-list.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/emacs/guix-list.el b/emacs/guix-list.el
index 9cc381b4be..f9d106b421 100644
--- a/emacs/guix-list.el
+++ b/emacs/guix-list.el
@@ -65,6 +65,7 @@ entries, he will be prompted for confirmation."
(number 5
,(lambda (a b) (guix-list-sort-numerically 0 a b))
:right-align t)
+ (current 10 t)
(time 20 t)
(path 30 t)))
"Columns displayed in list buffers.
@@ -93,8 +94,9 @@ this list have a priority.")
(synopsis . guix-list-get-one-line)
(description . guix-list-get-one-line))
(generation
- (time . guix-list-get-time)
- (path . guix-list-get-file-path)))
+ (current . guix-generation-list-get-current)
+ (time . guix-list-get-time)
+ (path . guix-list-get-file-path)))
"Methods for inserting parameter values in columns.
Each element of the list has a form:
@@ -735,6 +737,11 @@ Also see `guix-package-info-type'."
(define-key map (kbd "i") 'guix-list-describe)
(define-key map (kbd "d") 'guix-generation-list-mark-delete))
+(defun guix-generation-list-get-current (val &optional _)
+ "Return string from VAL showing whether this generation is current.
+VAL is a boolean value."
+ (if val "(current)" ""))
+
(defun guix-generation-list-show-packages ()
"List installed packages for the generation at point."
(interactive)