Currently, flyspell.el's mail-mode-flyspell-verify believes that
mail-header-separator is a string that will never appear elsewhere in
the buffer. Actually, the mail-header-separator is a string that must
appear on a line by itself; "" is a valid choice.
The following patch corrects this. It also finds signatures in the
opposite way; that is likely to be slightly faster when you have a
signature in a large mail buffer.
--- /dev/fd/63 2003-01-02 00:18:45.000000000 +0000
+++ flyspell.el 2003-01-02 00:17:36.000000000 +0000
@@ -271,15 +271,21 @@
(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."
- (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
+ (let ((header-end (save-excursion
+ (goto-char (point-min))
+ (re-search-forward (concat "^" mail-header-separator "$")
+ nil t)
+ (point)))
+ (signature-begin (save-excursion
+ (goto-char (point-max))
+ (re-search-backward message-signature-separator
+ nil t)
+ (point))))
+ (cond ((< (point) header-end)
(and (save-excursion (beginning-of-line)
(looking-at "^Subject:"))
(> (point) (match-end 0))))
- (in-signature
+ ((> (point) signature-begin)
nil)
(t
(save-excursion
--
Shields.