[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-racket 65447c4 138/191: racket: handling correctly
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-racket 65447c4 138/191: racket: handling correctly submodules in load handler during , enter |
Date: |
Sun, 1 Aug 2021 18:32:16 -0400 (EDT) |
branch: elpa/geiser-racket
commit 65447c49d68b887d937e2d26ed84b29ecc163410
Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
Commit: Jose Antonio Ortega Ruiz <jao@gnu.org>
racket: handling correctly submodules in load handler during ,enter
That is, complying to the submodule loading protocol (cf. racket's own
enter!).
---
geiser/enter.rkt | 39 ++++++++++++++++++++++++---------------
1 file changed, 24 insertions(+), 15 deletions(-)
diff --git a/geiser/enter.rkt b/geiser/enter.rkt
index 6da8c7a..aadf5af 100644
--- a/geiser/enter.rkt
+++ b/geiser/enter.rkt
@@ -84,25 +84,34 @@
(define (notify re? path)
(when re? (fprintf (current-error-port) " [re-loading ~a]\n" path)))
+(define (module-name? name)
+ (and name (not (and (pair? name) (not (car name))))))
+
(define ((enter-load/use-compiled orig re?) path name)
(when (inhibit-eval)
(raise (make-exn:fail "namespace not found" (current-continuation-marks))))
- ;; (printf "Loading ~s: ~s~%" name path)
- (if (and name (not (list? name)))
+ (printf "Loading ~s: ~s~%" name path)
+ (if (module-name? name)
;; Module load:
- (let* ([code (get-module-code
- path "compiled"
- (lambda (e)
- (parameterize ([compile-enforce-module-constants #f])
- (compile e)))
- (lambda (ext loader?) (load-extension ext) #f)
- #:notify (lambda (chosen) (notify re? chosen)))]
- [dir (or (current-load-relative-directory) (current-directory))]
- [path (path->complete-path path dir)]
- [path (normal-case-path (simplify-path path))])
- (define-values (ts real-path) (get-timestamp path))
- (add-paths! (make-mod name path ts code) (resolve-paths path))
- (parameterize ([current-module-declare-source real-path]) (eval code)))
+ (with-handlers ([(lambda (exn)
+ (and (pair? name) (exn:get-module-code? exn)))
+ ;; Load-handler protocol: quiet failure when a
+ ;; submodule is not found
+ (lambda (exn) (void))])
+ (let* ([code (get-module-code
+ path "compiled"
+ (lambda (e)
+ (parameterize ([compile-enforce-module-constants #f])
+ (compile e)))
+ (lambda (ext loader?) (load-extension ext) #f)
+ #:notify (lambda (chosen) (notify re? chosen)))]
+ [dir (or (current-load-relative-directory) (current-directory))]
+ [path (path->complete-path path dir)]
+ [path (normal-case-path (simplify-path path))])
+ (define-values (ts real-path) (get-timestamp path))
+ (add-paths! (make-mod name path ts code) (resolve-paths path))
+ (parameterize ([current-module-declare-source real-path])
+ (eval code))))
;; Not a module:
(begin (notify re? path) (orig path name))))
- [nongnu] elpa/geiser-racket 61bcd9a 009/191: Racket: square cosmetics., (continued)
- [nongnu] elpa/geiser-racket 61bcd9a 009/191: Racket: square cosmetics., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-racket aa2a6be 064/191: Racket: slightly better handling of the signatures cache, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-racket 7df27a3 067/191: Document browser improvements, and Racket using them, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-racket 2494b95 068/191: Document browser improvements, and Racket using them, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-racket ed7347d 093/191: Racket: configurable image cache directory, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-racket 36d2d55 097/191: racket: reading into elisp-land the cache dir as needed, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-racket 1f7a9e2 124/191: Racket: better help commands, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-racket b23d52d 123/191: Racket: better help commands, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-racket a5f8702 132/191: Racket: correct font lock for define/match, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-racket 4e68ebc 140/191: racket: C-u C-c C-z on a submodule enters it, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-racket 65447c4 138/191: racket: handling correctly submodules in load handler during , enter,
Philip Kaludercic <=
- [nongnu] elpa/geiser-racket e1474f1 141/191: Nits, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-racket eafee8d 142/191: racket: new , geiser-load command in REPL, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-racket e311818 154/191: Racket: duplicate version check removed, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-racket c6b4c09 155/191: Racket: fix for evaluations inside typed/racket modules, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-racket 7f89d8f 170/191: Use (car (process-lines ...)) instead of (shell-command ...), Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-racket a0532bc 169/191: Quoting binary on version checks (issue #117), Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-racket 5a7b12c 179/191: Fix typos, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-racket 0cb58c8 183/191: racket server to access via geiser-connect, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-racket 18cb3b3 185/191: README.md, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-racket 1996cca 187/191: Ready for MELPA, Philip Kaludercic, 2021/08/01