From: Tassilo Horn <tassilo@member.fsf.org>
To: info-gnus-english@gnu.org
Subject: Re: Changing ispell dictionary
Date: Fri, 10 Aug 2007 23:09:53 +0200 [thread overview]
Message-ID: <871web9jvi.fsf@baldur.tsdh.de> (raw)
In-Reply-To: <v9ir7n5e01.fsf@marauder.physik.uni-ulm.de>
Reiner Steib <reinersteib+gmane@imap.cc> writes:
Hi Reiner,
>> (message-goto-newsgroups)
>> (let ((newsgroups (buffer-substring-no-properties
>> (line-beginning-position) (line-end-position))))
>
> `message-fetch-field'
Oh, much easier. Thanks for that pointer. Now that's what I use:
--8<---------------cut here---------------start------------->8---
(defun th-message-switch-ispell-dictionary ()
(save-excursion
(message-narrow-to-headers-or-head)
(let ((newsgroups (message-fetch-field "Newsgroups"))
(to (message-fetch-field "To")))
(message "newsgroup or to = %s." (or newsgroups to))
(if newsgroups
(cond ((string-match (rx bol (or "de." "infko.")) newsgroups)
(ispell-change-dictionary "german"))
(t
(ispell-change-dictionary "english")))
(cond ((string-match (rx ".de" (or (not (any word)) eol)) to)
(ispell-change-dictionary "german"))
(t
(ispell-change-dictionary "english")))))))
(add-hook 'message-setup-hook 'th-message-switch-ispell-dictionary)
--8<---------------cut here---------------end--------------->8---
Bye,
Tassilo
next prev parent reply other threads:[~2007-08-10 21:09 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
2007-08-10 20:20 ` Tassilo Horn
2007-08-10 20:30 ` Reiner Steib
2007-08-10 21:09 ` Tassilo Horn [this message]
[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=871web9jvi.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).