From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Fabrice Niessen" Newsgroups: gmane.emacs.help Subject: Re: Auto-correcting proper nouns with flyspell? Date: Wed, 16 Sep 2009 13:53:58 +0200 Organization: My Googlest Message-ID: <87ocpb5cmh.fsf@mundaneum.com> References: <87ljkhdjgk.fsf@mahal.sjds.teklibre.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1253113031 12479 80.91.229.12 (16 Sep 2009 14:57:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Sep 2009 14:57:11 +0000 (UTC) To: help-gnu-emacs-mXXj517/zsQ@public.gmane.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Wed Sep 16 16:57:04 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MnvwM-0006jp-P4 for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Sep 2009 16:57:03 +0200 Original-Received: from localhost ([127.0.0.1]:50816 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnvwM-0001u8-4E for geh-help-gnu-emacs@m.gmane.org; Wed, 16 Sep 2009 10:57:02 -0400 Original-Path: news.stanford.edu!usenet.stanford.edu!goblin3!goblin.stu.neva.ru!news.mb-net.net!open-news-network.org!feeder.eternal-september.org!eternal-september.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 49 Original-X-Trace: news.eternal-september.org U2FsdGVkX19m2TkFYNfrnlAKOZtioR49lYuEcS1fvyY3A691cXYUZ4+AdVIrzv9DyKww4aoynQoQvq6tHgW04b8jWF44+j+Dej04V8mkk+w/v51j+kzau7R6clPusl2xXsDxCl+EQKc= Original-X-Complaints-To: abuse-VVbKFVtnif8H+i2N2EyTrmui9UKz+5OX@public.gmane.org Original-NNTP-Posting-Date: Wed, 16 Sep 2009 11:53:59 +0000 (UTC) X-Auth-Sender: U2FsdGVkX1+LfgNmaus+7AgmqNOqRzrl X-Archive: encrypt X-Www-site: http://www.MyGooglest.com/fni Cancel-Lock: sha1:78MnqtuGpsnqZ4T8IEUerVNcoQU= sha1:GPx3dW8vKKcmLZiXK6l9ItdemLE= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Original-Xref: news.stanford.edu gnu.emacs.help:173090 X-Mailman-Approved-At: Wed, 16 Sep 2009 10:56:41 -0400 X-BeenThere: help-gnu-emacs-mXXj517/zsQ@public.gmane.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Xref: news.gmane.org gmane.emacs.help:68215 Archived-At: Hi, Andreas Politz wrote: > d@teklibre.org (Dave T=C3=A4ht) writes: > >> Is there a way to make Emacs (flyspell) automatically capitalize proper >> nouns that have no other equivalent, instead of marking them in yellow w= ith >> 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 persona= lly 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 --=20 Fabrice Niessen Search the Web with "My Google Search Tools" on http://www.MyGooglest.com