From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#19092: 25.0.50; [PATCH] ispell-message spell checks marked parts of messages Date: Tue, 23 Feb 2016 22:57:11 +1100 Message-ID: <87r3g3prl4.fsf@gnus.org> References: <87oas4bwwe.fsf@loki.home> <83r3x0a4id.fsf@gnu.org> <8761ecjne8.fsf@loki.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1456228707 8700 80.91.229.3 (23 Feb 2016 11:58:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 23 Feb 2016 11:58:27 +0000 (UTC) Cc: 19092@debbugs.gnu.org To: Matthew Leach Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 23 12:58:16 2016 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 1aYBbY-0006Qs-8X for geb-bug-gnu-emacs@m.gmane.org; Tue, 23 Feb 2016 12:58:12 +0100 Original-Received: from localhost ([::1]:56418 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYBbX-0000Ee-Iu for geb-bug-gnu-emacs@m.gmane.org; Tue, 23 Feb 2016 06:58:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYBbT-0000EM-G1 for bug-gnu-emacs@gnu.org; Tue, 23 Feb 2016 06:58:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYBbO-0002XB-GN for bug-gnu-emacs@gnu.org; Tue, 23 Feb 2016 06:58:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42246) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYBbO-0002X3-CN for bug-gnu-emacs@gnu.org; Tue, 23 Feb 2016 06:58:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aYBbO-0007Z0-1t for bug-gnu-emacs@gnu.org; Tue, 23 Feb 2016 06:58:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Feb 2016 11:58:02 +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.145622866329021 (code B ref 19092); Tue, 23 Feb 2016 11:58:02 +0000 Original-Received: (at 19092) by debbugs.gnu.org; 23 Feb 2016 11:57:43 +0000 Original-Received: from localhost ([127.0.0.1]:39373 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aYBb5-0007Y0-4f for submit@debbugs.gnu.org; Tue, 23 Feb 2016 06:57:43 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:55526) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aYBb2-0007Xq-TA for 19092@debbugs.gnu.org; Tue, 23 Feb 2016 06:57:41 -0500 Original-Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aYBag-0005qy-3B; Tue, 23 Feb 2016 12:57:18 +0100 In-Reply-To: <8761ecjne8.fsf@loki.home> (Matthew Leach's message of "Tue, 18 Nov 2014 19:53:51 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-MailScanner-ID: 1aYBag-0005qy-3B MailScanner-NULL-Check: 1456833438.91478@7/7n+tnWwoJleteOeiZDqQ X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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:113574 Archived-At: Matthew Leach writes: >> 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. The patch no longer applies, so I've tried to fit it in. However, the patch is using variables defined in message.el. Does it make sense to have ispell.el require 'message? That seems rather odd... So I'm not sure this should go into Emacs in its present form... diff --git a/etc/NEWS b/etc/NEWS index 04c1ee8..2bbe246 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1637,6 +1637,11 @@ that happen, `unhandled-file-name-directory' now defaults to calling * Lisp Changes in Emacs 25.1 +--- +*** 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', `app'. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index db03a32..fdbab5d 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -400,6 +400,16 @@ ispell-message-fcc-skip :type '(choice integer (const :tag "off" nil)) :group 'ispell) +(defcustom ispell-message-check-marked-regions nil + "When nil ispell-message will skip marked regions. +These are 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 @@ -4167,11 +4177,18 @@ ispell-message (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 (ispell--make-filename-or-URL-re)) - (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))) + ,(cons (list (ispell--make-filename-or-URL-re)) + (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)) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no