When using my custom version of th-message-switch-ispell-dictionary (see http://lists.gnu.org/archive/html/info-gnus-english/2007-08/msg00062.html):
(defun my-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 "fr.") newsgroups)
(ispell-change-dictionary "francais"))
(t
(ispell-change-dictionary "american")))
;; email
(ispell-change-dictionary "francais")))))
(add-hook 'message-setup-hook 'my-message-switch-ispell-dictionary)
I experience the error:
message-position-on-field: Search failed: "^--text follows this line--$"
when creating a mail or a post (and no "--text follows this line--" is present anymore)...
Any idea about what goes wrong there?