summary refs log tree commit diff
path: root/emacs/guix-base.el
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2015-08-13 10:51:31 +0300
committerAlex Kost <alezost@gmail.com>2015-08-30 18:26:02 +0300
commit5e53b0c5a9e1c693d46bdaf24e6b5ce498410da6 (patch)
treea0ba0ee53b904458cf223e6dee7597dfef89ec47 /emacs/guix-base.el
parentcaa6732e967ef4e397533d1cff9ba5626b2b4131 (diff)
downloadguix-5e53b0c5a9e1c693d46bdaf24e6b5ce498410da6.tar.gz
emacs: Add code to run guix command in REPL.
* emacs/guix-base.el (guix-run-command-in-repl, guix-command-output,
  guix-help-string): New functions.
* emacs/guix-main.scm (guix-command, guix-command-output, help-string):
  New procedures.
Diffstat (limited to 'emacs/guix-base.el')
-rw-r--r--emacs/guix-base.el21
1 files changed, 21 insertions, 0 deletions
diff --git a/emacs/guix-base.el b/emacs/guix-base.el
index 4c7782dd53..d1593e285d 100644
--- a/emacs/guix-base.el
+++ b/emacs/guix-base.el
@@ -1085,6 +1085,27 @@ FILE.  With a prefix argument, also prompt for PROFILE."
      operation-buffer)))
 
 
+;;; Executing guix commands
+
+(defun guix-run-command-in-repl (args)
+  "Execute 'guix ARGS ...' command in Guix REPL."
+  (guix-eval-in-repl
+   (apply #'guix-make-guile-expression
+          'guix-command args)))
+
+(defun guix-command-output (args)
+  "Return string with 'guix ARGS ...' output."
+  (guix-eval-read
+   (apply #'guix-make-guile-expression
+          'guix-command-output args)))
+
+(defun guix-help-string (&optional commands)
+  "Return string with 'guix COMMANDS ... --help' output."
+  (guix-eval-read
+   (apply #'guix-make-guile-expression
+          'help-string commands)))
+
+
 ;;; Pull
 
 (defcustom guix-update-after-pull t