summary refs log tree commit diff
path: root/emacs/guix-main.scm
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2014-10-16 21:35:47 +0400
committerAlex Kost <alezost@gmail.com>2014-10-17 10:56:27 +0400
commit189cea2782df67ea048a3982be69c8b1ff9762e9 (patch)
treef353da6c0b24a43cfad0da4635e3deaa7f7b1d71 /emacs/guix-main.scm
parent347e17b47450a0fcc120c29e8b307e87b9182c21 (diff)
downloadguix-189cea2782df67ea048a3982be69c8b1ff9762e9.tar.gz
emacs: Add 'guix-generations-by-time' command.
* emacs/guix-main.scm (find-generations): Add finding generations by time.
* emacs/guix-utils.el (guix-read-date): New procedure.
* emacs/guix-base.el (guix-messages): Add new messages.
* emacs/guix.el (guix-generations-by-time): New command.
* doc/emacs.texi (emacs Commands): Document it.
Diffstat (limited to 'emacs/guix-main.scm')
-rw-r--r--emacs/guix-main.scm11
1 files changed, 10 insertions, 1 deletions
diff --git a/emacs/guix-main.scm b/emacs/guix-main.scm
index 7e26876dfa..b2f63351f0 100644
--- a/emacs/guix-main.scm
+++ b/emacs/guix-main.scm
@@ -669,6 +669,15 @@ If NUMBER is 0 or less, return all generations."
      (last-generations profile (car search-vals)))
     ((all)
      (last-generations profile +inf.0))
+    ((time)
+     (match search-vals
+       ((from to)
+        (matching-generations
+         profile
+         (lambda (gen)
+           (let ((time (time-second (generation-time profile gen))))
+             (< from time to)))))
+       (_ '())))
     (else (search-type-error "generation" search-type))))
 
 (define (generation-sexps profile params search-type search-vals)
@@ -696,7 +705,7 @@ SEARCH-TYPE should be one of the following symbols:
   'installed', 'obsolete', 'generation'.
 
 - If ENTRY-TYPE is 'generation':
-  'id', 'last', 'all'.
+  'id', 'last', 'all', 'time'.
 
 PARAMS is a list of parameters for receiving.  If it is an empty list,
 get information with all available parameters, which are: