From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.help Subject: Re: Spellcheck against multiple dictionaries? Date: Thu, 19 Mar 2009 09:17:05 +0100 Message-ID: <49C1FF81.2090304@gmx.at> References: <49C09110.9010105@gmx.at> <5f0660120903181236g3714f647ia568e3d02ae4fe56@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1237450753 12192 80.91.229.12 (19 Mar 2009 08:19:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Mar 2009 08:19:13 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: =?UTF-8?B?0JDQvdC00YDQtdC5INCf0LDRgNCw0LzQvtC90L7Qsg==?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 19 09:20:30 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 1LkDUC-0001yH-TG for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Mar 2009 09:20:22 +0100 Original-Received: from localhost ([127.0.0.1]:58922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LkDSq-0001ST-AL for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Mar 2009 04:18:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LkDSR-0001SC-NI for help-gnu-emacs@gnu.org; Thu, 19 Mar 2009 04:18:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LkDSL-0001OM-PQ for help-gnu-emacs@gnu.org; Thu, 19 Mar 2009 04:18:31 -0400 Original-Received: from [199.232.76.173] (port=39229 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LkDSL-0001OF-HU for help-gnu-emacs@gnu.org; Thu, 19 Mar 2009 04:18:25 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]:50503) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1LkDSL-0003IK-36 for help-gnu-emacs@gnu.org; Thu, 19 Mar 2009 04:18:25 -0400 Original-Received: (qmail invoked by alias); 19 Mar 2009 08:18:21 -0000 Original-Received: from 62-47-35-241.adsl.highway.telekom.at (EHLO [62.47.35.241]) [62.47.35.241] by mail.gmx.net (mp012) with SMTP; 19 Mar 2009 09:18:21 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18hJIgR0I8hrNH040iYtSO0jhCkJJStCe1hkAe2zb JtSVgKHb7uscQr User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) In-Reply-To: <5f0660120903181236g3714f647ia568e3d02ae4fe56@mail.gmail.com> X-Y-GMX-Trusted: 0 X-FuHaFi: 0.62 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.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@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:63075 Archived-At: > I've downloaded speck.el file, but I'm not sure how do I use it. > > I've created a test file containing mixed correct and incorrect words, > in Russian and English: > > Test =D1=82=D0=B5=D1=81=D1=82 correct =D0=BE=D1=87=D0=B5=D0=BF=D1=8F=D1= =82=D0=BA=D0=B0 incorect =D0=B2=D0=B5=D1=80=D0=BD=D0=BE > > Then I've done M-x speck-mode. Emacs said that Speck-mode has been > activated and is using ru_RU dictionary, but nothing has changed in > the test buffer. From your description I was expecting that the > incorrect words would be highlighted somehow. Am I missing something? I don't have a Russian spell-checking engine installed so I can't comment your example directly. Suppose I have a file with the line Test Test correct Duckfehler incorect richtig Doing M-x speck-mode here starts an Aspell process checking with my default language which is English, flagging the last three words as incorrect. I can now set the region around the word "Duckfehler" and type C-2 C-? to set the speck language text property of that word to German, which will still flag the word as incorrect but now with the appropriate German suggestions how to correct it. > I think that the ispell-ish behavior would indeed be nice. I've looked > through the ispell code, and it looks like Emacs raises some kind of > exception if the ispell process returns "invalid" status. Do you think > it is possible to fallback to another dictionary on such an event? With my Aspell engine I can write (and bind) a trivial command like (defun ispell-check-word (arg) (interactive "p") (if (=3D arg 2) (ispell-change-dictionary "de_DE") (ispell-change-dictionary "en_US")) (ispell-word)) here and probably get what you want. Note, however, that each time you change the language with this command, Emacs kills an old and spawns a new process of the Aspell engine. Changing `ispell-word' as you say seems hardly possible because in general there's no way to distinguish a word written incorrectly in language A from a word written correctly in language B. For the special English/Russian case you could probably investigate the character properties at `point' and spark the appropriate word-checking process. martin