summary refs log tree commit diff
path: root/emacs/guix-read.el
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2016-04-01 00:07:33 +0300
committerAlex Kost <alezost@gmail.com>2016-04-18 10:09:01 +0300
commitb4ea535a9f0382f3575fdeb3b2eb1cc7cfc37cd4 (patch)
tree377f4156c3c6e51dcf9c2cbaa80124f83aafec02 /emacs/guix-read.el
parent9bb46c155b463029f3da84d1b146efa79785a4ac (diff)
downloadguix-b4ea535a9f0382f3575fdeb3b2eb1cc7cfc37cd4.tar.gz
emacs: Add 'guix-packages-by-location' command.
* emacs/guix-main.scm (packages-by-location-file, package-location-files):
New procedures.
(%patterns-makers): Add 'location' search type.
* emacs/guix-messages.el (guix-message-packages-by-location): New procedure.
(guix-messages): Use it.
* emacs/guix-read.el (guix-package-locations)
(guix-read-package-location): New procedures.
* emacs/guix-ui-package.el (guix-packages-by-location): New command.
* doc/emacs.texi (Emacs Commands): Document it.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'emacs/guix-read.el')
-rw-r--r--emacs/guix-read.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/emacs/guix-read.el b/emacs/guix-read.el
index a1a6b86364..5423c9bcfa 100644
--- a/emacs/guix-read.el
+++ b/emacs/guix-read.el
@@ -62,6 +62,12 @@
   "Return a list of names of available licenses."
   (guix-eval-read (guix-make-guile-expression 'license-names)))
 
+(guix-memoized-defun guix-package-locations ()
+  "Return a list of available package locations."
+  (sort (guix-eval-read (guix-make-guile-expression
+                         'package-location-files))
+        #'string<))
+
 
 ;;; Readers
 
@@ -131,6 +137,11 @@
  :single-reader guix-read-license-name
  :single-prompt "License: ")
 
+(guix-define-readers
+ :completions-getter guix-package-locations
+ :single-reader guix-read-package-location
+ :single-prompt "Location: ")
+
 (provide 'guix-read)
 
 ;;; guix-read.el ends here