bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19092: 25.0.50; [PATCH] ispell-message spell checks marked parts of


From: Matthew Leach
Subject: bug#19092: 25.0.50; [PATCH] ispell-message spell checks marked parts of messages
Date: Tue, 18 Nov 2014 10:55:45 +0000

emacs -Q

C-x m
C-c C-b
some wrong spelllling. <RET>
C-<SPC>
C-p
C-c M-m
M-x ispell-message

you should now be prompted to spell check the word spelllling.  Since
text in the marked parts of messages is usually quoted -- be it text,
code or otherwise -- I propose that we skip spell checking on these
parts of messages.  It can be a real hassle when quoting a large body
of code or text.

Attached is a patch to implement this.  Any comments welcome.

Thanks,
Matt

lisp/ChangeLog:

2014-11-18  Matthew Leach  <matthew@mattleach.net>

        * textmodes/ispell.el (ispell-message): add regexp versions of
        `message-mark-insert-begin' and `message-mark-insert-end' to
        `ispell-skip-region-alist' to skip marked message parts.

etc/ChangeLog:
2014-11-18  Matthew Leach  <matthew@mattleach.net>

        * NEWS: Mention ispell-message now skips marked message parts.

diff --git a/etc/NEWS b/etc/NEWS
index 05210df..bdad732 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -161,6 +161,9 @@ buffers you want to keep separate.
 *** text/html messages that contain inline image parts will be
 transformed into multipart/related messages before sending.
 
+*** Marked parts of messages (created with C-c M-m) are no longer
+spell checked.
+
 ** pcase
 *** New UPatterns `quote' and `app'.
 *** New UPatterns can be defined with `pcase-defmacro'.
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 0fc6b4a..6d537c2 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -4095,10 +4095,18 @@ You can bind this to the key C-c i in GNUS or mail by 
adding to
              (concat "[^,;&+=\n]+ writes:" "\\|"
                      (ispell-non-empty-string vm-included-text-prefix)))
             (t default-prefix)))
+           (message-mark-insert-begin-regexp
+            (concat "^" (regexp-quote message-mark-insert-begin)))
+           (message-mark-insert-end-regexp
+            (concat "^" (regexp-quote message-mark-insert-end)))
           (ispell-skip-region-alist
-           (cons (list (concat "^\\(" cite-regexp "\\)")
-                       (function forward-line))
-                 ispell-skip-region-alist))
+            (append
+             (list
+              (cons message-mark-insert-begin-regexp
+                    message-mark-insert-end-regexp)
+              (list (concat "^\\(" cite-regexp "\\)")
+                    (function forward-line)))
+             ispell-skip-region-alist))
           (old-case-fold-search case-fold-search)
           (dictionary-alist ispell-message-dictionary-alist)
           (ispell-checking-message t))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]