Reiner Steib <[EMAIL PROTECTED]> 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



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

Reply via email to