[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/7] emacs: Add code to call guile procedures.
From: |
Alex Kost |
Subject: |
[PATCH 3/7] emacs: Add code to call guile procedures. |
Date: |
Sat, 25 Jul 2015 11:49:53 +0300 |
* emacs/guix-guile.el (guix-guile-make-call-expression): New function.
* emacs/guix-geiser.el (guix-geiser-call, guix-geiser-call-in-repl): New
functions.
---
emacs/guix-geiser.el | 13 +++++++++++++
emacs/guix-guile.el | 7 +++++++
2 files changed, 20 insertions(+)
diff --git a/emacs/guix-geiser.el b/emacs/guix-geiser.el
index 1f0cf72..14f48c9 100644
--- a/emacs/guix-geiser.el
+++ b/emacs/guix-geiser.el
@@ -24,6 +24,7 @@
;;; Code:
(require 'geiser-mode)
+(require 'guix-guile)
(defun guix-geiser-repl ()
"Return the current Geiser REPL."
@@ -62,6 +63,18 @@ Return elisp expression of the first result value of
evaluation."
(geiser--go-to-repl))
(geiser-repl--send str))
+(defun guix-geiser-call (proc &rest args)
+ "Call (PROC ARGS ...) synchronously using the current Geiser REPL.
+PROC and ARGS should be strings."
+ (guix-geiser-eval
+ (apply #'guix-guile-make-call-expression proc args)))
+
+(defun guix-geiser-call-in-repl (proc &rest args)
+ "Call (PROC ARGS ...) in the current Geiser REPL.
+PROC and ARGS should be strings."
+ (guix-geiser-eval-in-repl
+ (apply #'guix-guile-make-call-expression proc args)))
+
(provide 'guix-geiser)
;;; guix-geiser.el ends here
diff --git a/emacs/guix-guile.el b/emacs/guix-guile.el
index 112262e..87af192 100644
--- a/emacs/guix-guile.el
+++ b/emacs/guix-guile.el
@@ -24,6 +24,13 @@
;;; Code:
+(defun guix-guile-make-call-expression (proc &rest args)
+ "Return \"(PROC ARGS ...)\" string.
+PROC and ARGS should be strings."
+ (format "(%s %s)"
+ proc
+ (mapconcat #'identity args " ")))
+
(defun guix-make-guile-expression (fun &rest args)
"Return string containing a guile expression for calling FUN with ARGS."
(format "(%S %s)" fun
--
2.4.3
[PATCH 3/7] emacs: Add code to call guile procedures.,
Alex Kost <=
[PATCH 5/7] ui: Add 'show-derivation-outputs'., Alex Kost, 2015/07/25
[PATCH 6/7] guix build: Add 'build-package'., Alex Kost, 2015/07/25
[PATCH 7/7] emacs: Add 'guix-devel-use-current-module'., Alex Kost, 2015/07/25