Tassilo Horn <[EMAIL PROTECTED]> writes:

> Tassilo Horn <[EMAIL PROTECTED]> 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
 ... :-;

-- 
_______________________________________________
info-gnus-english mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/info-gnus-english

Reply via email to