From d4a2f79a611cfef41dce1a035d281c62a0d9d8bf Mon Sep 17 00:00:00 2001 From: Dan Leslie Date: Sat, 5 Dec 2015 08:13:08 -0800 Subject: Minor changes to help with debugging completions --- scheme/chicken/geiser/emacs.scm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/scheme/chicken/geiser/emacs.scm b/scheme/chicken/geiser/emacs.scm index 062e2a7..377c4d3 100644 --- a/scheme/chicken/geiser/emacs.scm +++ b/scheme/chicken/geiser/emacs.scm @@ -223,10 +223,13 @@ (define (memoize tag thunk) (let ((table (memo))) (if (hash-table-exists? table tag) - (hash-table-ref table tag) (begin + (write-to-log '[[Cache Hit]]) + (hash-table-ref table tag)) + (begin + (write-to-log '[[Cache Miss]]) (hash-table-set! table tag (thunk)) - (memoize tag thunk))))) + (hash-table-ref table tag))))) (define debug-log (make-parameter #f)) (define (write-to-log form) @@ -562,10 +565,11 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define (geiser-completions prefix . rest) - (let ((prefix (->string prefix)) - (unfiltered (map remove-internal-name-mangling - (apropos-list prefix #:macros? #t)))) - (filter (cut string-has-prefix? <> prefix) unfiltered))) + (let ((prefix (->string prefix))) + (filter + (cut string-has-prefix? <> prefix) + (map remove-internal-name-mangling + (apropos-list prefix #:macros? #t))))) (define (geiser-module-completions prefix . rest) (let ((prefix (->string prefix))) -- cgit v1.2.3