From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "cmr.Pent@gmail.com" Newsgroups: gmane.emacs.help Subject: Re: Spellcheck against multiple dictionaries? Date: Fri, 20 Mar 2009 12:54:10 -0700 (PDT) Organization: http://groups.google.com Message-ID: <26daec6e-4cc2-4c22-b5ff-c19de5906fc4@v15g2000yqn.googlegroups.com> References: <49C09110.9010105@gmx.at> <5f0660120903181236g3714f647ia568e3d02ae4fe56@mail.gmail.com> <957727de-bc65-4e5a-867f-32215d0896f8@b38g2000prf.googlegroups.com> <87eiwtfuvx.fsf@catnip.gol.com> 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 1237581654 29351 80.91.229.12 (20 Mar 2009 20:40:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Mar 2009 20:40:54 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 20 21:42:11 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 1LklXb-0004XE-Se for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Mar 2009 21:42:08 +0100 Original-Received: from localhost ([127.0.0.1]:33478 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LklWF-0005V5-CA for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Mar 2009 16:40:43 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news2.glorb.com!news.glorb.com!postnews.google.com!v15g2000yqn.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 69 Original-NNTP-Posting-Host: 89.179.245.94 Original-X-Trace: posting.google.com 1237578850 11458 127.0.0.1 (20 Mar 2009 19:54:10 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 20 Mar 2009 19:54:10 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v15g2000yqn.googlegroups.com; posting-host=89.179.245.94; posting-account=gGXeuQoAAAAj0VaJ1PQ4rEKCfxef3hne User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; ru; rv:1.9.0.6) Gecko/2009020409 Iceweasel/3.0.6 (Debian-3.0.6-1),gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:167849 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:63142 Archived-At: Hello! I'm the original thread starter. Thanks for your feedback. On 19 =D0=BC=D0=B0=D1=80, 18:34, Lennart Borgman wrote: > On Thu, Mar 19, 2009 at 3:29 PM, Miles Bader wrote: > > Potentially, it seems that you could keep multiple ispell processes > > around, and feed each word to _all_ active processes. > > I think Peter Heslin implemented something like that here: > > =C2=A0http://www.dur.ac.uk/p.j.heslin/Software/Emacs/ > > (Wasn't there a discussion about getting this into Emacs? Or am I just > dreaming?) I've looked though ispell-multi.el, and indeed keeping several ispell processes would be nice for the approach I've tried to describe. But this is ultimately just details of implementation and not the feature I'm looking for. I've created a sketch of the desired functionality. Hope the code speaks better: (defun ispell-word-with-dictionary (dict) "Spellcheck word with given dictionary." (ispell-change-dictionary dict) (ispell-word)) (defun ispell-word-smart () "Spellcheck word with British or, if that failed, with Russian dictionary." (interactive) (condition-case nil (ispell-word-with-dictionary "british") (error (ispell-word-with-dictionary "russian")))) It required me to tweak the code in ispell.el for the feature to actually work: *** /home/pent/emacs/emacs/lisp/textmodes/ispell.el 2009-02-27 21:48:23.000000000 +0300 --- /home/pent/ispell.el 2009-03-20 22:16:25.000000000 +0300 *************** *** 1689,1695 **** (extent-at start) (and (fboundp 'delete-extent) (delete-extent (extent-at start))))) ! ((null poss) (message "Error in ispell process")) (ispell-check-only ; called from ispell minor mode. (if (fboundp 'make-extent) (if (fboundp 'set-extent-property) --- 1689,1695 ---- (extent-at start) (and (fboundp 'delete-extent) (delete-extent (extent-at start))))) ! ((null poss) (error "Error in ispell process")) (ispell-check-only ; called from ispell minor mode. (if (fboundp 'make-extent) (if (fboundp 'set-extent-property) Please note that the code above is just a prototype (i.e. it doesn't restore the original dictionary, the dictionaries are not customisable, ...). Do you think the idea is reasonable? Andrey Paramonov P.S: Perhaps I should post to emacs-devel?