fix query-aspell so that it returns an empty list when aspell isn't working

original commit: 9f72eb396a62bb72bebcdb1937ae59e0e15195fc
This commit is contained in:
Robby Findler 2012-12-02 14:42:31 -06:00
parent 8e341da412
commit ba24e8fa61

View File

@ -197,19 +197,21 @@
(loop)]))))))))) (loop)])))))))))
(define (query-aspell line [dict #f]) (define (query-aspell line [dict #f])
(unless (aspell-problematic?) (cond
[(aspell-problematic?)
(when dict '()]
(unless (member dict (get-aspell-dicts)) [else
(set! dict #f))) (when dict
(unless (member dict (get-aspell-dicts))
(start-aspell-thread) (set! dict #f)))
(sync
(nack-guard-evt (start-aspell-thread)
(λ (nack-evt) (sync
(define resp (make-channel)) (nack-guard-evt
(channel-put aspell-req-chan (list line dict resp nack-evt)) (λ (nack-evt)
resp))))) (define resp (make-channel))
(channel-put aspell-req-chan (list line dict resp nack-evt))
resp)))]))
(define aspell-dicts #f) (define aspell-dicts #f)
(define (get-aspell-dicts) (define (get-aspell-dicts)