From 684e4baf247d78d2b565bbb062803d2be949a432 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 26 May 2006 12:17:54 +0000 Subject: [PATCH] find aspell like ispell svn: r3072 --- collects/sirmail/spell.ss | 40 ++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/collects/sirmail/spell.ss b/collects/sirmail/spell.ss index 0f8d69c740..d16975db99 100644 --- a/collects/sirmail/spell.ss +++ b/collects/sirmail/spell.ss @@ -94,19 +94,21 @@ (define (clean-up to-send) ;; Drop characters that ispell or aspell may treat as word - ;; delimiters. We can to keep ' in a word, but double + ;; delimiters. We can to keep ' in a word, but double or leading ;; '' counts as a delimiter, so end by replacing those. - (regexp-replace* #rx"''+" - (list->string - (map (lambda (b) - (if (and ((char->integer b) . <= . 127) - (or (char-alphabetic? b) - (char-numeric? b) - (eq? b #\'))) - b - #\x)) - (string->list to-send))) - "x")) + (regexp-replace* #rx"^'" + (regexp-replace* #rx"''+" + (list->string + (map (lambda (b) + (if (and ((char->integer b) . <= . 127) + (or (char-alphabetic? b) + (char-numeric? b) + (eq? b #\'))) + b + #\x)) + (string->list to-send))) + "x") + "")) (define has-ispell? 'dontknow) (define ispell-prog #f) @@ -119,11 +121,15 @@ "ispell.exe" "ispell") #f) - (ormap (lambda (x) (and (file-exists? x) x)) - '("/sw/bin/ispell" - "/usr/bin/ispell" - "/bin/ispell" - "/usr/local/bin/ispell")) + (ormap (lambda (ispell) + (ormap (lambda (x) + (let ([x (build-path x ispell)]) + (and (file-exists? x) x))) + '("/sw/bin" + "/usr/bin" + "/bin" + "/usr/local/bin"))) + '("ispell" "aspell")) (find-executable-path (if (eq? (system-type) 'windows) "aspell.exe" "aspell")