From b4b9975d4abf8ee7d4f3762e5e6aea656cbeb61f Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Fri, 1 Apr 2016 23:53:20 +0300 Subject: 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. --- emacs/guix-main.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'emacs/guix-main.scm') 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))) -- cgit v1.2.3