From: Tassilo Horn <tassilo@member.fsf.org>
To: info-gnus-english@gnu.org
Subject: Re: Changing ispell dictionary
Date: Fri, 10 Aug 2007 21:49:47 +0200 [thread overview]
Message-ID: <87r6mbb25g.fsf@baldur.tsdh.de> (raw)
In-Reply-To: <87mywzqw73.fsf@gmx.de>
Sven Joachim <svenjoac@gmx.de> writes:
Hi Sven,
> Does somebody have a bright idea how to automatically change the local
> dictionary in the message buffer (assuming that a newsgroup or mail
> recipient is known; of course it cannot be guessed if I just type C-x
> m outside of Gnus)? There are various *message-*hook variables and I
> don't know which to choose.
At least for newsgroups you could do something like this:
--8<---------------cut here---------------start------------->8---
(defun th-switch-ispell-dictionary ()
(save-excursion
(message-goto-newsgroups)
(let ((newsgroups (buffer-substring-no-properties
(line-beginning-position) (line-end-position))))
(cond ((string-match (rx " de.") newsgroups)
(ispell-change-dictionary "german"))
((string-match (rx " fr.") newsgroups)
(ispell-change-dictionary "french"))
(t
(ispell-change-dictionary "english"))))))
--8<---------------cut here---------------end--------------->8---
I didn't test it, but I wouldn't be too surprised if it works. ;-)
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.
Bye,
Tassilo
next prev parent reply other threads:[~2007-08-10 19:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-10 14:51 Sven Joachim
2007-08-10 19:49 ` Tassilo Horn [this message]
2007-08-10 20:20 ` Tassilo Horn
2007-08-10 20:30 ` Reiner Steib
2007-08-10 21:09 ` Tassilo Horn
[not found] ` <mailman.4635.1186780214.32220.info-gnus-english@gnu.org>
2007-08-11 18:10 ` Sven Joachim
2007-08-11 18:59 ` Tassilo Horn
[not found] ` <mailman.4633.1186777273.32220.info-gnus-english@gnu.org>
2007-08-11 10:31 ` Hadron
2007-10-19 22:37 ` sven.bretfeld
2007-11-03 23:16 ` leandro noferini
2007-11-04 19:35 ` Sven Bretfeld
2007-11-05 16:17 ` leandro noferini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r6mbb25g.fsf@baldur.tsdh.de \
--to=tassilo@member.fsf.org \
--cc=info-gnus-english@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).