diff options
author | Dan Leslie <dan@ironoxide.ca> | 2015-05-17 17:14:53 -0700 |
---|---|---|
committer | Dan Leslie <dan@ironoxide.ca> | 2015-05-17 17:14:53 -0700 |
commit | 7b049cf784bfc06bd90c3ad8b15e2a0304fb55db (patch) | |
tree | 7c44be4ed9a9764cc26d97afbeabb1fff782e14a /scheme | |
parent | 62ba8d319880e824dd17bfccb480483aa577109c (diff) | |
download | geiser-guile-7b049cf784bfc06bd90c3ad8b15e2a0304fb55db.tar.gz geiser-guile-7b049cf784bfc06bd90c3ad8b15e2a0304fb55db.tar.bz2 |
Various improvements
- Can now optionally compile Geiser components for enormous speed
improvements; enabled by default
- Apropos was returning many duplicates, which was causing slowdowns;
duplicates are now filtered
- Now check for #<unspecified> results and return something
- Fixed a typo in a comment
- Fixed a typo in calling string-length
Diffstat (limited to 'scheme')
-rw-r--r-- | scheme/chicken/geiser/emacs.scm | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/scheme/chicken/geiser/emacs.scm b/scheme/chicken/geiser/emacs.scm index 05c5101..e4e84c0 100644 --- a/scheme/chicken/geiser/emacs.scm +++ b/scheme/chicken/geiser/emacs.scm @@ -231,11 +231,12 @@ (define (describe-symbol sym #!key (exact? #f)) (let* ((str (symbol->string sym)) (found (apropos-information-list (regexp (make-apropos-regex str)) #:macros? #t))) - (if exact? - (filter (lambda (v) - (equal? str (string-substitute ".*#([^#]+)" "\\1" (symbol->string (car v))))) - found) - found))) + (delete-duplicates + (if exact? + (filter (lambda (v) + (equal? str (string-substitute ".*#([^#]+)" "\\1" (symbol->string (car v))))) + found) + found)))) ;; Wraps output from geiser functions (define (call-with-result module thunk) @@ -255,9 +256,14 @@ (switch-module original-module) - (set! result (if (list? result) - (map (lambda (v) (with-output-to-string (lambda () (write v)))) result) - (list (with-output-to-string (lambda () (write result)))))) + (set! result + (cond + ((list? result) + (map (lambda (v) (with-output-to-string (lambda () (write v)))) result)) + ((eq? result (if #f #t)) + (list output)) + (else + (list (with-output-to-string (lambda () (write result))))))) (let ((out-form `((result ,@result) @@ -415,7 +421,7 @@ (map fmt (find sym))) - ;; Builds the documentation from Chicken Doc for a specific ymbol + ;; Builds the documentation from Chicken Doc for a specific symbol (define (make-doc symbol #!optional (filter-for-type #f)) (with-output-to-string (lambda () @@ -590,7 +596,7 @@ (let* ((directory (if (symbol? directory) (symbol->string directory) directory)) - (directory (if (not (equal? #\/ (string-ref directory (- (string-length directory 1))))) + (directory (if (not (equal? #\/ (string-ref directory (- (string-length directory))))) (string-append directory "/") directory))) (call-with-result #f |