alezost pushed a commit to branch wip-emacs-popup-ui
in repository guix.
commit 5dc39583e1b049813f93952396a84838f7cfc975
Author: Alex Kost <[email protected]>
Date: Wed Aug 12 14:36:41 2015 +0300
emacs: Add 'guix-lint-checker-names'.
* emacs/guix-main.scm: Use (guix scripts lint) module.
(lint-checker-names): New procedure.
* emacs/guix-base.el (guix-lint-checker-names): New variable and function.
---
emacs/guix-base.el | 13 +++++++++++++
emacs/guix-main.scm | 10 ++++++++++
2 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/emacs/guix-base.el b/emacs/guix-base.el
index fe89584..2fab6d4 100644
--- a/emacs/guix-base.el
+++ b/emacs/guix-base.el
@@ -181,6 +181,19 @@ If PATH is relative, it is considered to be relative to
(message "Couldn't find package location."))))
+;;; Receivable lists of packages, lint checkers, etc.
+
+(defvar guix-lint-checker-names nil
+ "List of names of available lint checkers.")
+
+(defun guix-lint-checker-names ()
+ "Return a list of names of available lint checkers."
+ (or guix-lint-checker-names
+ (setq guix-lint-checker-names
+ (guix-eval-read
+ (guix-make-guile-expression 'lint-checker-names)))))
+
+
;;; Buffers and auto updating.
(defcustom guix-update-after-operation 'current
diff --git a/emacs/guix-main.scm b/emacs/guix-main.scm
index e0dc683..65fa9e1 100644
--- a/emacs/guix-main.scm
+++ b/emacs/guix-main.scm
@@ -57,6 +57,7 @@
(guix licenses)
(guix utils)
(guix ui)
+ (guix scripts lint)
(guix scripts package)
(guix scripts pull)
(gnu packages))
@@ -927,3 +928,12 @@ GENERATIONS is a list of generation numbers."
(build-derivations store derivations))
(format #t "The source store path: ~a~%"
(package-source-derivation->store-path derivation))))))
+
+
+;;; Lists of packages, lint checkers, etc.
+
+(define (lint-checker-names)
+ "Return a list of names of available lint checkers."
+ (map (lambda (checker)
+ (symbol->string (lint-checker-name checker)))
+ %checkers))