Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Group dependent ispell dictionary

2 views
Skip to first unread message

Jeppe N. Madsen

unread,
Aug 7, 2001, 2:47:04 PM8/7/01
to
Hi,

I'm using ispell & flyspell to spell check all my text buffers. Since
I regularly post to national groups I would like to automatically set
the language to e.g. dansk when posting to a *.dk group.
So in my .gnus I have

(add-hook 'gnus-select-group-hook
(lambda ()
(cond
((string-match "^\\(dk\\.\\|worldonline\\.dk\\)"
gnus-newsgroup-name)
(ispell-change-dictionary "dansk"))
(t
(ispell-change-dictionary "english")))))

But this doesn't seem to work with flyspell. When flyspell loads, it
changes the dictionary back to american:

Fetching headers for worldonline.dk.admin...
Fetching headers for worldonline.dk.admin...done
Loading ispell...
Loading ispell...done
(Next local Ispell command will use dansk dictionary)
Loading gnus-score...
Loading gnus-score...done
Generating summary...
Generating summary...done
Loading flyspell...
Loading flyspell...done
(Next local Ispell command will use american dictionary)
(Next local Ispell command will use american dictionary)
Starting new Ispell process...
Welcome to flyspell. Use M-tab or Mouse-2 to correct words.

Any hints as to how to fix this?

rgds
Jeppe

Frank Schmitt

unread,
Aug 7, 2001, 5:04:27 PM8/7/01
to
"Jeppe N. Madsen" <jep...@worldonline.dk> writes:

>I'm using ispell & flyspell to spell check all my text buffers. Since
>I regularly post to national groups I would like to automatically set
>the language to e.g. dansk when posting to a *.dk group.
>So in my .gnus I have
>
>(add-hook 'gnus-select-group-hook
> (lambda ()
> (cond
> ((string-match "^\\(dk\\.\\|worldonline\\.dk\\)"
> gnus-newsgroup-name)
> (ispell-change-dictionary "dansk"))
> (t
> (ispell-change-dictionary "english")))))

I don't really know why your version doesn't work (perhaps because of
the t? how about
"(not ((string-match"^\\(dk\\...
instead?

But this works for me:

(add-hook 'message-mode-hook 'amanda-message-language)
(defun amanda-message-language ()
(cond ((not (stringp gnus-newsgroup-name)))
((string-match "^\\(de\\|ger\\|at\\|hamster\.de\\|infko\\|opera\.deutsch\\|rz\\|internal\\)\\." gnus-newsgroup-name)
(ispell-change-dictionary "deutsch"))))

--
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them
In the Land of Mordor where the Shadows lie.
19. Dezember 2001

Ferenc Wagner

unread,
Aug 8, 2001, 7:04:49 AM8/8/01
to
On 07 Aug 2001 23:04:27 +0200
Frank Schmitt <Azz...@rz-online.de> wrote:

> But this works for me:
>
> (add-hook 'message-mode-hook 'amanda-message-language)
> (defun amanda-message-language ()
> (cond ((not (stringp gnus-newsgroup-name)))
> ((string-match "^\\(de\\|ger\\|at\\|hamster\.de\\|infko\\|opera\.deutsch\\|rz\\|internal\\)\\." gnus-newsgroup-name)
> (ispell-change-dictionary "deutsch"))))

It's also possible to customize ispell-message-dictionary-alist.

Feri.

Kai Großjohann

unread,
Aug 8, 2001, 12:34:28 PM8/8/01
to
"Jeppe N. Madsen" <jep...@worldonline.dk> writes:

> (add-hook 'gnus-select-group-hook

You want to do it in the message buffer, not in the summary buffer.

kai
--
~/.signature: No such file or directory

Jeppe N. Madsen

unread,
Aug 8, 2001, 3:00:13 PM8/8/01
to
Kai.Gro...@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

> "Jeppe N. Madsen" <jep...@worldonline.dk> writes:
>
> > (add-hook 'gnus-select-group-hook
>
> You want to do it in the message buffer, not in the summary buffer.
>
> kai

Yes, figured that out. Some one might consider updating the Gnus manual
since what I used was pretty much cut'n paste from section 5.4.

It turns out that using gnus-message-setup-hook solved my problem with
flyspell. Since it's called after text-mode-hook (where I enable
flyspell), ispell-change-dictionary has the desired effect.

This was in contrast to me previous attempt were
ispell-change-dictionary was called when entering the group and
flyspell was activated when writing a message. And it seems as if
flyspell always defaults to use the american dictionary.

rgds
Jeppe

0 new messages