help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Auto-correcting proper nouns with flyspell?


From: Fabrice Niessen
Subject: Re: Auto-correcting proper nouns with flyspell?
Date: Wed, 16 Sep 2009 13:53:58 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Hi,

Andreas Politz wrote:
> d@teklibre.org (Dave Täht) writes:
>
>> Is there a way to make Emacs (flyspell) automatically capitalize proper
>> nouns that have no other equivalent, instead of marking them in yellow with
>> an underscore?
>
> Since there is `flyspell-incorrect-hook', you can do all kinds of things.
>
> (defun flyspell-correct-case (beg end info)
>   (when (and (consp info)
>              (equal (downcase (car info))
>                     (downcase (caaddr info))))
>     (save-excursion
>       (delete-region beg end)
>       (insert (caaddr info)))))
>
> (add-hook 'flyspell-incorrect-hook 'flyspell-correct-case))

While the idea is good, I personally find this dangerous, as "Emacs" then
changes things for you, without you knowing which ones in particular (how to
find where it has been auto-corrected?). I know I can expect such a behavior
from MS Word, with its wizzard and its auto-correction rules, but I personally
hate that behavior from Emacs.

For example, "Next meeting on 5th of October" becomes "Next meeting on 5Th of
October" with such hook. Not nice for that particular case.

On the other hand, one thing that I want from Emacs + ispell, and that MS
doesn't offer (IMHO): the possibility to leave buffers unscanned for errors
when just opening files for reading. As soon as we change something in them,
then, yes, ispell is launched over the whole buffer. I have this behavior
already working for years, but I still have troubles with ispell and some
modes (like Org). Have to spend some time identifiying the root cause.

If you're interested, take a look at
http://www.mygooglest.com/fni/dot-emacs.html.

Best regards,
  Fabrice

-- 
Fabrice Niessen
Search the Web with "My Google Search Tools" on http://www.MyGooglest.com


reply via email to

[Prev in Thread] Current Thread [Next in Thread]