changeset 34925:6043184119bc

(mail-mode-flyspell-verify): Spell-check in Subject line.
author Gerd Moellmann <gerd@gnu.org>
date Fri, 29 Dec 2000 15:14:51 +0000
parents db558893a42c
children 1a99e436d482
files lisp/textmodes/flyspell.el
diffstat 1 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/flyspell.el	Fri Dec 29 14:24:09 2000 +0000
+++ b/lisp/textmodes/flyspell.el	Fri Dec 29 15:14:51 2000 +0000
@@ -229,12 +229,20 @@
 (put 'message-mode 'flyspell-mode-predicate 'mail-mode-flyspell-verify)
 (defun mail-mode-flyspell-verify ()
   "This function is used for `flyspell-generic-check-word-p' in Mail mode."
-  (save-excursion
-    (not (or (re-search-forward mail-header-separator nil t)
-	     (re-search-backward message-signature-separator nil t)
-	     (progn
-	       (beginning-of-line)
-	       (looking-at "[>}|]\\To:"))))))
+  (let ((in-headers (save-excursion
+		      (re-search-forward mail-header-separator nil t)))
+	(in-signature (save-excursion
+			(re-search-backward message-signature-separator nil t))))
+    (cond (in-headers
+	   (save-excursion
+	     (beginning-of-line)
+	     (looking-at "^Subject:")))
+	  (in-signature
+	   nil)
+	  (t
+	   (save-excursion
+	     (beginning-of-line)
+	     (not (looking-at "[>}|]\\To:")))))))
 
 ;*--- texinfo mode ----------------------------------------------------*/
 (put 'texinfo-mode 'flyspell-mode-predicate 'texinfo-mode-flyspell-verify)