Properly set ispell language when sending mails

This commit is contained in:
Tom Willemse 2014-08-26 11:23:39 +02:00
parent f719e35fbf
commit b5ea7e05ea
2 changed files with 3 additions and 10 deletions

View file

@ -425,9 +425,9 @@
(defun oni:switch-ispell-dictionary ()
(save-excursion
(message-narrow-to-headers-or-head)
(let ((from (message-fetch-field "From")))
(ispell-change-dictionary
(if (string-match (rx "@aethon.nl>" eol) from) "nl" "en")))))
(when (string-match (rx (and "@" (or "aethon" "picturefix") ".nl>") eol)
(message-fetch-field "From"))
(ispell-change-dictionary "nl"))))
(add-hook 'message-setup-hook 'oni:switch-ispell-dictionary)
#+END_SRC

View file

@ -76,13 +76,6 @@
(address "thomas@aethon.nl")
(signature-file "~/documents/work/aethon/signature_20131209.txt")
(eval (setq message-sendmail-extra-arguments '("-a" "aethon"))))))
(add-hook 'gnus-select-group-hook
(lambda ()
(cond
((string-match (rx (or "aethon" "picturefix"))
(gnus-group-real-name gnus-newsgroup-name))
(ispell-change-dictionary "nl"))
(t (ispell-change-dictionary "en")))))
(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
(setq message-kill-buffer-on-exit t)