[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-chez 39b7e9357d 09/15: remote connections: wee refa
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/geiser-chez 39b7e9357d 09/15: remote connections: wee refactoring |
Date: |
Tue, 11 Oct 2022 13:58:55 -0400 (EDT) |
branch: elpa/geiser-chez
commit 39b7e9357d0be4ae80268e073c8e077ecd7c1387
Author: jao <jao@gnu.org>
Commit: jao <jao@gnu.org>
remote connections: wee refactoring
---
geiser-chez.el | 67 ++++++++++++++++++++++++++--------------------------------
1 file changed, 30 insertions(+), 37 deletions(-)
diff --git a/geiser-chez.el b/geiser-chez.el
index cb6ad00f03..ccaf356705 100644
--- a/geiser-chez.el
+++ b/geiser-chez.el
@@ -48,8 +48,9 @@
(geiser-custom--defcustom geiser-chez-init-file "~/.chez-geiser"
"Initialization file with user code for the Chez REPL.
-Do mind that this file is local to running process, so remote process will use
-init file at this location in remote host."
+Do mind that this file is local to running process, so remote
+process will use an init file at this location in the remote
+host."
:type 'string
:group 'geiser-chez)
@@ -84,46 +85,38 @@ init file at this location in remote host."
(expand-file-name "src" (file-name-directory load-file-name))
"Directory where the Chez scheme geiser modules are installed.")
+(defun geiser-chez--init-file ()
+ "Possibly remote init file, when it exists, as a list."
+ (let* ((file (and (stringp geiser-chez-init-file)
+ (expand-file-name geiser-chez-init-file)))
+ (file (and file (concat (file-remote-p default-directory) file))))
+ (if (and file (file-exists-p file))
+ (list file)
+ (geiser-log--info "Init file not readable (%s)" file)
+ nil)))
+
+(defun geiser-chez--module-files ()
+ "Possibly remote list of scheme files used by chez."
+ (let ((local-file (expand-file-name "geiser/geiser.ss"
geiser-chez-scheme-dir)))
+ (if (file-remote-p default-directory)
+ (let* ((temporary-file-directory (temporary-file-directory))
+ (temp-dir (make-temp-file "geiser" t))
+ (remote (concat (file-name-as-directory temp-dir) "geiser.ss")))
+ (with-temp-buffer
+ (insert-file-contents local-file)
+ (write-file remote))
+ (list (file-local-name remote)))
+ (list local-file))))
+
(defun geiser-chez--parameters ()
"Return a list with all parameters needed to start Chez Scheme.
+
This function uses `geiser-chez-init-file' if it exists."
- (append
- (when-let ((init-file (and (stringp geiser-chez-init-file)
- (expand-file-name geiser-chez-init-file))))
- (if (file-exists-p
- (concat
- (file-remote-p default-directory)
- init-file))
- (list init-file)
- (geiser-log--warn
- "File %s does not exist, so it's not added to CLI args"
- init-file)))
- (let* ((local-geiser-module-file
- (expand-file-name "geiser/geiser.ss" geiser-chez-scheme-dir))
- (geiser-module-file
- (if (file-remote-p default-directory)
- ;; copy the content to remote file
- (let* ((temporary-file-directory (temporary-file-directory))
- (temp-dir
- (make-temp-file "geiser" t))
- (remote-geiser-module-file
- (concat
- (file-name-as-directory
- temp-dir)
- "geiser.ss")))
- ;; write to file
- (with-temp-buffer
- (insert-file-contents local-geiser-module-file)
- (write-file remote-geiser-module-file))
- (file-local-name
- remote-geiser-module-file))
- ;; else, process and file are local
- local-geiser-module-file)))
- (list geiser-module-file))
- geiser-chez-extra-command-line-parameters))
+ (append (geiser-chez--init-file)
+ (geiser-chez--module-files)
+ geiser-chez-extra-command-line-parameters))
(defconst geiser-chez--prompt-regexp "> ")
-
(defconst geiser-chez--debugger-prompt-regexp "debug> $\\|break> $\\|.+: $")
- [nongnu] elpa/geiser-chez e80f797a5c 10/15: autodoc: fix for arity 0 functions, (continued)
- [nongnu] elpa/geiser-chez e80f797a5c 10/15: autodoc: fix for arity 0 functions, ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez 3bfa85afb9 05/15: following the error reporting protocol now that geiser does too, ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez 7f12bcfe8b 13/15: initial implementation of symbol-location and module-location, ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez 00ab1e6c7a 12/15: 'module' recognised as a keyword in chez, ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez 3996898343 14/15: add-to-load-path, ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez 2d8cd83c64 08/15: wee refactoring, ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez 501fa22da4 06/15: whitespace and spurious rest arg, ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez a70c47c557 07/15: unit test fixes, ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez 21d35aa8d6 02/15: autodoc improvements (signatures from arities, values), ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez 0cd37833ab 03/15: geiser-chez-debug-on-exception-p -> geiser-chez-debug-on-exception, ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez 39b7e9357d 09/15: remote connections: wee refactoring,
ELPA Syncer <=
- [nongnu] elpa/geiser-chez 846f96ba19 11/15: whitespace, ELPA Syncer, 2022/10/11
- [nongnu] elpa/geiser-chez 53b7279550 15/15: load-file: adjust current-directory to loaded file's, ELPA Syncer, 2022/10/11