From: Peter Oliver <p.d.oliver@mavit.org.uk>
To: 8594@debbugs.gnu.org
Subject: bug#8594: 23.2; flyspell ignores first line in message-mode
Date: Sat, 30 Apr 2011 16:38:09 +0100 (BST) [thread overview]
Message-ID: <alpine.LFD.2.02.1104301632300.3428@froglet.home.mavit.org.uk> (raw)
[-- Attachment #1: Type: TEXT/PLAIN, Size: 462 bytes --]
When using flyspell-mode with mail-mode or message-mode, the email header is ignored for spellchecking.
However, this incorrectly assumes that any such buffer will always begin with a header. I use message-mode to edit the email body only, and I find that flyspell ignores the whole first paragraph of such a buffer.
Attached is a patch that causes flyspell to only try to skip over the header if the message really does begin with a header.
--
Peter Oliver
[-- Attachment #2: Type: TEXT/PLAIN, Size: 2722 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: bzr@mavit.org.uk-20110430152929-eaj2kamu07rgutgl
# target_branch: nosmart+bzr://bzr.savannah.gnu.org/emacs/trunk/
# testament_sha1: ef8db088392bf8fcaa680a1b3a15c8330d146423
# timestamp: 2011-04-30 16:30:01 +0100
# source_branch: bzr://bzr.savannah.gnu.org/emacs/trunk
# base_revision_id: viniciusjl@ig.com.br-20110430151507-\
# wt20qtszxtt47p8y
#
# Begin patch
=== modified file 'lisp/textmodes/flyspell.el'
--- lisp/textmodes/flyspell.el 2011-04-03 20:59:45 +0000
+++ lisp/textmodes/flyspell.el 2011-04-30 15:29:29 +0000
@@ -316,12 +316,15 @@
"Function used for `flyspell-generic-check-word-predicate' in Mail mode."
(let ((header-end (save-excursion
(goto-char (point-min))
- (re-search-forward
- (concat "^"
- (regexp-quote mail-header-separator)
- "$")
- nil t)
- (point)))
+ (if (not
+ (looking-at "^[A-Z]\\(?:\\(?:-[A-Z]\\)?[a-z]*\\)+:"))
+ 0
+ (re-search-forward
+ (concat "^"
+ (regexp-quote mail-header-separator)
+ "$")
+ nil t)
+ (point))))
(signature-begin
(if (not (boundp 'message-signature-separator))
(point-max)
# Begin bundle
IyBCYXphYXIgcmV2aXNp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3Zey3hnLaEpJH5d2i8YtrF5vUOomb1FsfoGEe8s69HjDnp7wgD3B8FXFR/GqIZattnALkb+q5JW
P36jbLpzlEYUSq9t7E2qqBzCrhfe6SriyGZMtUlaaunS1+aKwb3ZQMUe9K1TZ64mNMP+v8k/Ha5l
A5BKu3a2T5Wr4LbyuDe1PFORuSeD4K4ZHvpzxJJZCs7nrbufspGMWBw7MdgWpq8wbNXVnJuwTUJh
1apW3LR3KTy5LqpKUORgTdbGZ092ArYFJ3aikLQuCFTl9lFTjeuosuXclvpZlOxdReq23qGOCgGK
VMsta4LFSR3LCtdviuvEJ3ayy1LYv/F3JFOFCQ5+9Edg
next reply other threads:[~2011-04-30 15:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-30 15:38 Peter Oliver [this message]
2011-05-02 16:05 ` bug#8594: 23.2; flyspell ignores first line in message-mode Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.2.02.1104301632300.3428@froglet.home.mavit.org.uk \
--to=p.d.oliver@mavit.org.uk \
--cc=8594@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).