From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matthew Leach Newsgroups: gmane.emacs.bugs Subject: bug#19092: 25.0.50; [PATCH] ispell-message spell checks marked parts of messages Date: Tue, 18 Nov 2014 19:53:51 +0000 Message-ID: <8761ecjne8.fsf@loki.home> References: <87oas4bwwe.fsf@loki.home> <83r3x0a4id.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1416340464 23309 80.91.229.3 (18 Nov 2014 19:54:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Nov 2014 19:54:24 +0000 (UTC) Cc: 19092@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 18 20:54:17 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Xqoqv-0004El-5S for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Nov 2014 20:54:17 +0100 Original-Received: from localhost ([::1]:55083 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xqoqu-0004Tl-R9 for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Nov 2014 14:54:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47175) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xqoql-0004Mx-NY for bug-gnu-emacs@gnu.org; Tue, 18 Nov 2014 14:54:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xqoqg-0000qK-BJ for bug-gnu-emacs@gnu.org; Tue, 18 Nov 2014 14:54:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xqoqg-0000qE-8B for bug-gnu-emacs@gnu.org; Tue, 18 Nov 2014 14:54:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Xqoqf-00061p-L7 for bug-gnu-emacs@gnu.org; Tue, 18 Nov 2014 14:54:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Matthew Leach Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Nov 2014 19:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19092 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 19092-submit@debbugs.gnu.org id=B19092.141634043723163 (code B ref 19092); Tue, 18 Nov 2014 19:54:01 +0000 Original-Received: (at 19092) by debbugs.gnu.org; 18 Nov 2014 19:53:57 +0000 Original-Received: from localhost ([127.0.0.1]:37551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xqoqa-00061U-6b for submit@debbugs.gnu.org; Tue, 18 Nov 2014 14:53:56 -0500 Original-Received: from mx0.mattleach.net ([176.58.118.143]:60125) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XqoqY-00061L-3g for 19092@debbugs.gnu.org; Tue, 18 Nov 2014 14:53:55 -0500 Original-Received: by mx0.mattleach.net (Postfix, from userid 99) id 2758361ACC; Tue, 18 Nov 2014 19:53:53 +0000 (GMT) Original-Received: from loki.home.mattleach.net (host86-157-143-67.range86-157.btcentralplus.com [86.157.143.67]) by mx0.mattleach.net (Postfix) with ESMTPSA id 7663E61ABC; Tue, 18 Nov 2014 19:53:51 +0000 (GMT) In-Reply-To: <83r3x0a4id.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 18 Nov 2014 17:54:18 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:96207 --=-=-= Content-Type: text/plain Hi Eli, Eli Zaretskii writes: >> From: Matthew Leach >> Date: Tue, 18 Nov 2014 10:55:45 +0000 >> >> emacs -Q >> >> C-x m >> C-c C-b >> some wrong spelllling. >> C- >> 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. > > This changes behavior, so I think we should have a defcustom that > could be used to get the old behavior back. (And the NEWS entry > should describe that.) Ah, yes sorry about that. The revised patch fixes that. > > > >> 2014-11-18 Matthew Leach >> >> * 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. > > ChangeLog entries should start with a capital letter (as any English > sentence). Ah, missed that one, sorry. Revised ChangeLogs below. Thanks, Matt lisp/ChangeLog: 2014-11-18 Matthew Leach * textmodes/ispell.el (ispell-message-check-marked-regions): New. (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 * NEWS: Mention ispell-message now skips marked message parts when `ispell-message-check-marked-regions' is nil. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=ispell-skip-maked-message-part.patch 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)) --=-=-=--