[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-chicken aa12be7f24 2/2: Send Chicken the contents o
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/geiser-chicken aa12be7f24 2/2: Send Chicken the contents of chicken5.scm, rather than (load)ing |
Date: |
Tue, 3 Dec 2024 21:59:50 -0500 (EST) |
branch: elpa/geiser-chicken
commit aa12be7f2412300cf16753fa341bd1dbe20c7ee2
Author: Jared Jennings <jjennings@fastmail.fm>
Commit: jao <jao@gnu.org>
Send Chicken the contents of chicken5.scm, rather than (load)ing
The most obvious way to load the Geiser Chicken initialization code
into csi is to use (load f) where f is the full pathname of the
geiser/chicken5.scm file. But when csi is running remotely because
it's been summoned from a Scheme file opened using tramp, that csi
does not see the same filesystem that Emacs does.
So this change causes the elisp code to obtain the contents of the
geiser/chicken5.scm file, and send that to csi to evaluate. It's
likely much slower, but it works seamlessly with Tramp.
I'm not an accomplished elisp author, so this particular code may not
be the best way to go about this. And I have only covered Chicken 5
here.
---
geiser-chicken.el | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/geiser-chicken.el b/geiser-chicken.el
index ce22067a05..abebfa05a5 100644
--- a/geiser-chicken.el
+++ b/geiser-chicken.el
@@ -334,12 +334,18 @@ This function uses `geiser-chicken-init-file' if it
exists."
(defun geiser-chicken5-load ()
"Load Geiser support code in Chicken 5."
- (let ((source (expand-file-name "geiser/chicken5.scm"
- geiser-chicken-scheme-dir)))
+ (let* ((source (expand-file-name "geiser/chicken5.scm"
+ geiser-chicken-scheme-dir))
+ (contents (with-current-buffer
+ (get-buffer-create " *geiser-chicken5-load*" t)
+ (insert-file-contents-literally source)
+ (prog1
+ (buffer-string)
+ (kill-buffer " *geiser-chicken5-load*")))))
(geiser-eval--send/wait
(format
- "(display '((result . t) (output . f))) (load \"%s\")"
- source))))
+ "(display '((result . t) (output . f))) %s"
+ contents))))
(defun geiser-chicken--startup (_remote)
"Startup function."