diff --git a/etc/NEWS b/etc/NEWS index 05210df..2823f91 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -161,6 +161,11 @@ 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. To revert to the original behaviour set +`ispell-message-check-marked-regions' to t. + ** 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..36eb3d9 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -400,6 +400,16 @@ Always stores Fcc copy of message when nil." :type '(choice integer (const :tag "off" nil)) :group 'ispell) +(defcustom ispell-message-check-marked-regions nil + "When nil ispell-message will skip makred regions that are +enclosed with `message-mark-insert-begin' and +`message-mark-insert-end'. + +When non-nil, ispell-message will check the spelling inside these +regions." + :type '(choice (const :tag "Check spelling" t) + (const :tag "Don't check spellng" nil)) + :group 'ispell) (defcustom ispell-grep-command ;; MS-Windows/MS-DOS have `egrep' as a Unix shell script, so they @@ -4095,10 +4105,17 @@ 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)) + `(,@(unless ispell-message-check-marked-regions + (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))