diff options
-rw-r--r-- | elisp/geiser-chicken.el | 10 | ||||
-rw-r--r-- | scheme/chicken/geiser/emacs.scm | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/elisp/geiser-chicken.el b/elisp/geiser-chicken.el index 5b28055..d87ebb7 100644 --- a/elisp/geiser-chicken.el +++ b/elisp/geiser-chicken.el @@ -268,7 +268,15 @@ This function uses `geiser-chicken-init-file' if it exists." (let ((geiser-log-verbose-p t) (geiser-chicken-load-file (expand-file-name "chicken/geiser/emacs.scm" geiser-scheme-dir))) (if geiser-chicken-compile-geiser-p - (geiser-eval--send/wait (format "(use utils)(compile-file \"%s\")(import geiser)" + (geiser-eval--send/wait (format " +;; Sadly, (use import compile-file) must be run at top-level, so we have a stdout binding +(define geiser-stdout (current-output-port)) +(current-output-port (make-output-port (lambda a #f) (lambda a #f))) +(use utils) +(compile-file \"%s\") +(import geiser) +(current-output-port geiser-stdout) +" geiser-chicken-load-file)) (geiser-eval--send/wait (format "(load \"%s\")" geiser-chicken-load-file))))) diff --git a/scheme/chicken/geiser/emacs.scm b/scheme/chicken/geiser/emacs.scm index e4e84c0..cddf8da 100644 --- a/scheme/chicken/geiser/emacs.scm +++ b/scheme/chicken/geiser/emacs.scm @@ -229,7 +229,7 @@ (string-append "^([^#]+#)*" (regexp-escape prefix))) (define (describe-symbol sym #!key (exact? #f)) - (let* ((str (symbol->string sym)) + (let* ((str (->string sym)) (found (apropos-information-list (regexp (make-apropos-regex str)) #:macros? #t))) (delete-duplicates (if exact? @@ -259,11 +259,11 @@ (set! result (cond ((list? result) - (map (lambda (v) (with-output-to-string (lambda () (write v)))) result)) + (map (lambda (v) (with-output-to-string (lambda () (pretty-print v)))) result)) ((eq? result (if #f #t)) (list output)) (else - (list (with-output-to-string (lambda () (write result))))))) + (list (with-output-to-string (lambda () (pretty-print result))))))) (let ((out-form `((result ,@result) @@ -339,7 +339,7 @@ ;; Builds a signature list from an identifier (define (find-signatures toplevel-module sym) - (define str (symbol->string sym)) + (define str (->string sym)) (define (make-module-list sym module-sym) (if (null? module-sym) @@ -375,7 +375,7 @@ (args (if (or (list? rest) (pair? rest)) (cdr rest) '()))) (define (clean-arg arg) - (string->symbol (string-substitute "(.*[^0-9]+)[0-9]+" "\\1" (symbol->string arg)))) + (string->symbol (string-substitute "(.*[^0-9]+)[0-9]+" "\\1" (->string arg)))) (define (collect-args args #!key (reqs? #t) (opts? #f) (keys? #f)) (when (not (null? args)) |