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 | |
parent | 4ae2527b4bceecac95dc265ca09a6de60a5d526a (diff) | |
download | geiser-guile-149cf613ee81f40f678b08f1c451ad256d843c94.tar.gz geiser-guile-149cf613ee81f40f678b08f1c451ad256d843c94.tar.bz2 |
Removed more unused code, speeding things up.
-rw-r--r-- | elisp/geiser-chicken.el | 4 | ||||
-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 |
3 files changed, 7 insertions, 38 deletions
diff --git a/elisp/geiser-chicken.el b/elisp/geiser-chicken.el index 078db57..35b139f 100644 --- a/elisp/geiser-chicken.el +++ b/elisp/geiser-chicken.el @@ -270,9 +270,9 @@ This function uses `geiser-chicken-init-file' if it exists." (defun geiser-chicken4--compile-or-load (force-load) (let ((target - (expand-file-name "chicken/geiser/emacs.so" geiser-scheme-dir)) + (expand-file-name "chicken/geiser/chicken4.so" geiser-scheme-dir)) (source - (expand-file-name "chicken/geiser/emacs.scm" geiser-scheme-dir)) + (expand-file-name "chicken/geiser/chicken4.scm" geiser-scheme-dir)) (force-load (or force-load (eq system-type 'windows-nt))) (suppression-prefix "(define geiser-stdout (current-output-port))(current-output-port (make-output-port (lambda a #f) (lambda a #f)))") 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)))))))) |