diff options
author | Dan Leslie <dan@ironoxide.ca> | 2018-11-11 10:29:54 -0800 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2018-11-12 17:46:57 +0000 |
commit | 149cf613ee81f40f678b08f1c451ad256d843c94 (patch) | |
tree | 5a477696469483c20c11970920e1fa7158a16af3 /scheme/chicken | |
parent | 4ae2527b4bceecac95dc265ca09a6de60a5d526a (diff) | |
download | geiser-guile-149cf613ee81f40f678b08f1c451ad256d843c94.tar.gz geiser-guile-149cf613ee81f40f678b08f1c451ad256d843c94.tar.bz2 |
Removed more unused code, speeding things up.
Diffstat (limited to 'scheme/chicken')
-rw-r--r-- | scheme/chicken/geiser/chicken4.scm (renamed from scheme/chicken/geiser/emacs.scm) | 0 | ||||
-rw-r--r-- | scheme/chicken/geiser/chicken5.scm | 41 |
2 files changed, 5 insertions, 36 deletions
diff --git a/scheme/chicken/geiser/emacs.scm b/scheme/chicken/geiser/chicken4.scm index 908f768..908f768 100644 --- a/scheme/chicken/geiser/emacs.scm +++ b/scheme/chicken/geiser/chicken4.scm diff --git a/scheme/chicken/geiser/chicken5.scm b/scheme/chicken/geiser/chicken5.scm index f5f0c30..4ef110e 100644 --- a/scheme/chicken/geiser/chicken5.scm +++ b/scheme/chicken/geiser/chicken5.scm @@ -111,7 +111,7 @@ (if val (func val) #f)) ;; Wraps output from geiser functions - (define (call-with-result module thunk) + (define (call-with-result thunk) (let* ((result (if #f #f)) (output (if #f #f))) @@ -209,52 +209,21 @@ ;; Geiser core functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; Basically all non-core functions pass through geiser-eval - - (define (form-has-safe-geiser? form) - (any (cut eq? (car form) <>) - '(geiser-no-values geiser-newline geiser-completions - geiser-autodoc geiser-object-signature geiser-symbol-location - geiser-symbol-documentation geiser-module-exports - geiser-module-path geiser-module-location - geiser-module-completions geiser-chicken-use-debug-log))) - - (define (form-has-any-geiser? form) - (string-has-prefix? (->string (car form)) "geiser-")) - - (define (form-defines-any-module? form) - (or - ;; Geiser seems to send buffers as (begin ..buffer contents..) - (and (eq? (car form) 'begin) - (form-defines-any-module? (cadr form))) - (any (cut eq? (car form) <>) - '(module define-library)))) - (define (geiser-eval module form . rest) (when (and module (not (symbol? module))) (error "Module should be a symbol")) ;; All calls start at toplevel - (let* ((is-safe-geiser? (form-has-safe-geiser? form)) - (host-module (and (not is-safe-geiser?) - (not (form-has-any-geiser? form)) - (not (form-defines-any-module? form)) - module)) - (thunk (lambda () (eval form)))) - - (write-to-log `[[REQUEST host-module: ,host-module]]) + (let* ((thunk (lambda () (eval form)))) (write-to-log form) - - (if is-safe-geiser? - (call-with-result #f thunk) - (call-with-result host-module thunk)))) + (call-with-result thunk))) ;; Load a file (define (geiser-load-file file) (let* ((file (if (symbol? file) (symbol->string file) file)) (found-file (geiser-find-file file))) - (call-with-result #f + (call-with-result (lambda () (when found-file (load found-file)))))) @@ -355,7 +324,7 @@ (directory (if (not (equal? #\/ (string-ref directory (- (string-length directory))))) (string-append directory "/") directory))) - (call-with-result #f + (call-with-result (lambda () (when (directory-exists? directory) (geiser-chicken-load-paths (cons directory (geiser-chicken-load-paths)))))))) |