summaryrefslogtreecommitdiff
path: root/emacs/guix-main.scm
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2016-04-01 23:53:20 +0300
committerAlex Kost <alezost@gmail.com>2016-04-18 10:09:02 +0300
commitb4b9975d4abf8ee7d4f3762e5e6aea656cbeb61f (patch)
tree6db3717381dab362ef2ffa1acf01eaf9cd448a65 /emacs/guix-main.scm
parentb5e3cbbb248f3f5096c9d83d9db586db08d52b04 (diff)
emacs: Add interface for package locations.
* emacs/guix-main.scm (%package-location-param-alist): New variable. (package-location->sexp, package-location-entries): New procedures. * emacs/guix-ui-location.el: New file. * emacs.am (ELFILES): Add it. * doc/emacs.texi (Emacs Package Locations): Document 'guix-locations'. * NEWS: Mention it.
Diffstat (limited to 'emacs/guix-main.scm')
-rw-r--r--emacs/guix-main.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/emacs/guix-main.scm b/emacs/guix-main.scm
index 4780cced96..5358f3bfa4 100644
--- a/emacs/guix-main.scm
+++ b/emacs/guix-main.scm
@@ -1127,3 +1127,15 @@ Return #t if the shell command was executed successfully."
(lambda ()
"Return the list of file names of all package locations."
(force files)))))
+
+(define %package-location-param-alist
+ `((id . ,identity)
+ (location . ,identity)
+ (number-of-packages . ,(lambda (location)
+ (length (packages-by-location-file location))))))
+
+(define package-location->sexp
+ (object-transformer %package-location-param-alist))
+
+(define (package-location-entries)
+ (map package-location->sexp (package-location-files)))