From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/9498 Path: news.gmane.org!not-for-mail From: Hadron Newsgroups: gmane.emacs.gnus.user Subject: Re: Changing ispell dictionary Date: Sat, 11 Aug 2007 12:31:28 +0200 Organization: http://en.wikipedia.org/wiki/Quark Message-ID: <1oabsyuzun.fsf@news.ubuntu.home> References: <87mywzqw73.fsf@gmx.de> <87r6mbb25g.fsf@baldur.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1186832425 8113 80.91.229.12 (11 Aug 2007 11:40:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 11 Aug 2007 11:40:25 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Sat Aug 11 13:40:22 2007 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IJpKP-0004Ls-5Y for gegu-info-gnus-english@m.gmane.org; Sat, 11 Aug 2007 13:40:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IJpKO-0005dP-L9 for gegu-info-gnus-english@m.gmane.org; Sat, 11 Aug 2007 07:40:20 -0400 Original-Path: shelby.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.gnus Original-Lines: 48 Original-X-Trace: individual.net F//0juw9s+vFMupbCSY8bAPHTR6GOp9Q6vvNpx8dwYNDD293rY X-Orig-Path: news.individual.net!news Cancel-Lock: sha1:Dk5kUjyUQZvg1S6AsX/Xc1ChSUc= sha1:0Yd3mjWCbq8OmKgTQQGkqQfOptg= X-Face: 2h#||Cd#d%F*NCm59[_6/{1a@jy%; |j>{D~4^gKg(^i%7j0IK?+,/GmW&:CD5fEKb_! Face: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.0 (gnu/linux) Original-Xref: shelby.stanford.edu gnu.emacs.gnus:79686 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:9498 Archived-At: Tassilo Horn writes: > Tassilo Horn writes: > > Hi again, > >> I didn't test it, but I wouldn't be too surprised if it works. ;-) > > Well, I thought it could be useful for me, too, so I tried it. It > didn't work. Below is a working version. > >> For mail recipients you could probably use a field in the bbdb which >> indicates the receivers language, or simply guess by the top-level >> domain of the email address. > > That's what I do now. > > (defun th-switch-ispell-dictionary () > (save-excursion > (goto-char (point-min)) > (re-search-forward (rx bol (group (or "To:" "Newsgroups:")))) > (if (string= (match-string 1) "Newsgroups:") > (let ((newsgroups (buffer-substring-no-properties > (line-beginning-position) (line-end-position)))) > (cond ((string-match (rx " de.") newsgroups) > (ispell-change-dictionary "german")) > (t > (ispell-change-dictionary "english")))) > (let ((to (buffer-substring-no-properties > (line-beginning-position) (line-end-position)))) > (cond ((string-match (rx ".de" (not (any word))) to) > (ispell-change-dictionary "german")) > (t > (ispell-change-dictionary "english"))))))) > > (add-hook 'message-setup-hook 'th-switch-ispell-dictionary) > > Bye, > Tassilo I would be very interested in this code using the bbdb idea instead (top level domains are not indicative of persons real or favorite language in this global world) - look for existence of a bbdb alias called "language" and if it exists then switch to it with ispell-change-dictionary ... :-; --