[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-chez 53b7279550 15/15: load-file: adjust current-di
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/geiser-chez 53b7279550 15/15: load-file: adjust current-directory to loaded file's |
Date: |
Tue, 11 Oct 2022 13:58:55 -0400 (EDT) |
branch: elpa/geiser-chez
commit 53b7279550a06967f660656363daa87bb261a753
Author: jao <jao@gnu.org>
Commit: jao <jao@gnu.org>
load-file: adjust current-directory to loaded file's
Not totally sure it's always what we want, but makes effective the ("." .
".")
default entry in library-directories.
---
src/geiser/geiser.ss | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/geiser/geiser.ss b/src/geiser/geiser.ss
index c982006f12..654a346364 100644
--- a/src/geiser/geiser.ss
+++ b/src/geiser/geiser.ss
@@ -55,13 +55,17 @@
(define (obj-file-name name) (with-extension name ".so"))
+ (define (file-directory filename)
+ (let ((idx (last-index-of (string->list filename) #\/ 0 -1)))
+ (if (= idx -1) filename (substring filename 0 idx))))
+
(define (geiser:load-file filename)
(let ((output-filename (obj-file-name filename)))
(call-with-result
(lambda ()
- (with-output-to-string
- (lambda () (maybe-compile-file filename output-filename)))
- (parameterize ([compile-imported-libraries #t])
+ (parameterize ([current-directory (file-directory filename)])
+ (with-output-to-string
+ (lambda () (maybe-compile-file filename output-filename)))
(load output-filename))))))
(define (geiser:add-to-load-path path)
- [nongnu] elpa/geiser-chez 7f12bcfe8b 13/15: initial implementation of symbol-location and module-location, (continued)
- [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, 2022/10/11
- [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 <=