summaryrefslogtreecommitdiff
path: root/emacs/guix-read.el
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2016-01-19 20:27:58 +0300
committerAlex Kost <alezost@gmail.com>2016-01-25 22:11:47 +0300
commit71310ccc56f24c7975ddc3bb9893083e138be808 (patch)
tree04a42ce70f4b6e6a55ab240d84c65ee5106d0098 /emacs/guix-read.el
parent0a2a2b3387199c374c23912c0acfdf4156a0a84f (diff)
emacs: Add 'guix-browse-license-url' command.
* emacs/guix-main.scm (%licenses): New variable. (licenses, license-names, lookup-license, lookup-license-uri): New procedures. * emacs/guix-read.el (guix-license-names, guix-read-license-name): New procedures. * emacs/guix-license.el: New file. (guix-lookup-license-url): New procedure. (guix-browse-license-url): New command. * emacs.am (ELFILES): Add new file.
Diffstat (limited to 'emacs/guix-read.el')
-rw-r--r--emacs/guix-read.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/emacs/guix-read.el b/emacs/guix-read.el
index 3bc7b16587..a1a6b86364 100644
--- a/emacs/guix-read.el
+++ b/emacs/guix-read.el
@@ -1,6 +1,6 @@
;;; guix-read.el --- Minibuffer readers
-;; Copyright © 2015 Alex Kost <alezost@gmail.com>
+;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com>
;; This file is part of GNU Guix.
@@ -58,6 +58,10 @@
'package-names-lists)))
#'string<))
+(guix-memoized-defun guix-license-names ()
+ "Return a list of names of available licenses."
+ (guix-eval-read (guix-make-guile-expression 'license-names)))
+
;;; Readers
@@ -122,6 +126,11 @@
:multiple-prompt "Package,s: "
:multiple-separator " ")
+(guix-define-readers
+ :completions-getter guix-license-names
+ :single-reader guix-read-license-name
+ :single-prompt "License: ")
+
(provide 'guix-read)
;;; guix-read.el ends here