Thanks, and yes, truly automatic correction would be great. Does anyone out there know how to do it? <div><br><br><div class="gmail_quote">On Thu, Feb 23, 2012 at 7:47 PM, David Reitter <span dir="ltr"><<a href="mailto:david.reitter@gmail.com">david.reitter@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Feb 23, 2012, at 6:55 PM, Peter Salazar wrote:<br>
<br>
> You're right! And so it is. It looks like ispell is configured correctly. And when I mistype a word in Aquamacs, it appears in red and I can right-click and Aquamacs shows me nice suggestions.<br>
><br>
> What I SHOULD have asked is: how do I get Aquamacs to automatically REPLACE mistyped words the way other OSX apps do (and the way abbrevs does)?<br>
><br>
> Example: In TextEdit, if I type wihtout, it gets automatically changed to without.<br>
<br>
</div>I see.<br>
<br>
Aquamacs can't do this as of now, but what you can do is press M-Tab after a word that's been highlighted (flyspell mode has to be on = Check Spelling as you Type).  That'll correct it, and you can cycle through different alternatives.<br>

<br>
That said, it wouldn't be hard to implement some sort of fully automatic correction.<br>
If someone here can do it, I'd be happy to integrate it with Aquamacs.  I don't have time to figure out the details at the moment.<br>
<br>
Flyspell already has the code in place to make this happen.  The following code is a proof-of-concept, although important bits don't work (I find it unusable).<br>
<br>
(defun my-flyspell-auto-correct-word (beg end corrections)<br>
  ;; "corrections" is, at times, incorrect (bug!)<br>
  (let ((alternative (car (ns-spellchecker-get-suggestions (buffer-substring beg end)))))<br>
    (when alternative<br>
      (undo-boundary) ;; this does not work<br>
      (save-excursion<br>
        (delete-region beg end)<br>
        (let ((transient-mark-mode t))<br>
          (funcall flyspell-insert-function alternative)))<br>
      ;; 'remove-highlighting<br>
      ;; M-tab afterwords also fails to work.<br>
      ;; Undo fails to work.<br>
      nil)))<br>
<br>
(add-hook 'flyspell-incorrect-hook 'my-flyspell-auto-correct-word)<br>
<div class="im"><br>
<br>
--<br>
<a href="http://aquamacs.org" target="_blank">http://aquamacs.org</a> -- Aquamacs: Emacs on Mac OS X<br>
<a href="http://aquamacs.org/donate" target="_blank">http://aquamacs.org/donate</a> -- Could we help you? Return the favor and support the Aquamacs Project!<br>
<br>
</div>_____________________________________________________________<br>
MacOSX-Emacs mailing list<br>
<a href="mailto:MacOSX-Emacs@email.esm.psu.edu">MacOSX-Emacs@email.esm.psu.edu</a><br>
<a href="http://email.esm.psu.edu/mailman/listinfo/macosx-emacs" target="_blank">http://email.esm.psu.edu/mailman/listinfo/macosx-emacs</a><br>
List Archives: <a href="http://dir.gmane.org/gmane.emacs.macintosh.osx" target="_blank">http://dir.gmane.org/gmane.emacs.macintosh.osx</a><br>
</blockquote></div><br></div>