Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Hadron <hadronquark@googlemail.com>
To: info-gnus-english@gnu.org
Subject: Re: Changing ispell dictionary
Date: Sat, 11 Aug 2007 12:31:28 +0200	[thread overview]
Message-ID: <1oabsyuzun.fsf@news.ubuntu.home> (raw)
In-Reply-To: <mailman.4633.1186777273.32220.info-gnus-english@gnu.org>

Tassilo Horn <tassilo@member.fsf.org> writes:

> Tassilo Horn <tassilo@member.fsf.org> 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
 ... :-;

-- 

  parent reply	other threads:[~2007-08-11 10:31 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
     [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 [this message]
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=1oabsyuzun.fsf@news.ubuntu.home \
    --to=hadronquark@googlemail.com \
    --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).