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: Andreas Politz
Subject: Re: Auto-correcting proper nouns with flyspell?
Date: Wed, 16 Sep 2009 11:53:05 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

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))

-ap





reply via email to

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