From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#22097: Ispell: lazy highlighting doesn't work properly. Date: Tue, 08 Dec 2015 02:47:32 +0200 Organization: LINKOV.NET Message-ID: <87oae1sr4r.fsf@mail.linkov.net> References: <20151205114230.GA2698@acm.fritz.box> <83egf1f2qp.fsf@gnu.org> <20151205140609.GB2698@acm.fritz.box> <83d1ulf03t.fsf@gnu.org> <20151205160429.GC2698@acm.fritz.box> <87fuzgebv4.fsf@mail.linkov.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1449535956 5871 80.91.229.3 (8 Dec 2015 00:52:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Dec 2015 00:52:36 +0000 (UTC) Cc: 22097@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 08 01:52:16 2015 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 1a66Vr-0006QD-5I for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Dec 2015 01:52:15 +0100 Original-Received: from localhost ([::1]:57248 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a66Vq-0006Kj-6q for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Dec 2015 19:52:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a66Vk-0006HK-1J for bug-gnu-emacs@gnu.org; Mon, 07 Dec 2015 19:52:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a66Vh-0007Am-RH for bug-gnu-emacs@gnu.org; Mon, 07 Dec 2015 19:52:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52474) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a66Vh-0007Ai-Ox for bug-gnu-emacs@gnu.org; Mon, 07 Dec 2015 19:52:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a66Vh-000526-HQ for bug-gnu-emacs@gnu.org; Mon, 07 Dec 2015 19:52:05 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Dec 2015 00:52:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22097 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22097-submit@debbugs.gnu.org id=B22097.144953590519297 (code B ref 22097); Tue, 08 Dec 2015 00:52:05 +0000 Original-Received: (at 22097) by debbugs.gnu.org; 8 Dec 2015 00:51:45 +0000 Original-Received: from localhost ([127.0.0.1]:42180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a66VM-00051A-2p for submit@debbugs.gnu.org; Mon, 07 Dec 2015 19:51:44 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:55734 helo=homiemail-a19.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a66Uw-00050D-HA for 22097@debbugs.gnu.org; Mon, 07 Dec 2015 19:51:38 -0500 Original-Received: from homiemail-a19.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a19.g.dreamhost.com (Postfix) with ESMTP id 8BC10604078; Mon, 7 Dec 2015 16:51:17 -0800 (PST) Original-Received: from localhost.linkov.net (m83-180-31-224.cust.tele2.ee [83.180.31.224]) (Authenticated sender: jurta@jurta.org) by homiemail-a19.g.dreamhost.com (Postfix) with ESMTPA id 882C3604076; Mon, 7 Dec 2015 16:51:16 -0800 (PST) In-Reply-To: <87fuzgebv4.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 06 Dec 2015 01:04:15 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (x86_64-pc-linux-gnu) 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: 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:109741 Archived-At: > Another limitation is limiting lazy-highlighting by reg-start/reg-end > instead of a wider area of window-start/window-end. This patch addresses this limitation: it limits the highlighting area either to the region boundaries, or to the window boundaries. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index aa51446..82c589d 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -2786,6 +2786,8 @@ ispell-highlight-spelling-error-xemacs ;;(sit-for 0) ) +(defvar ispell-reg-start nil) +(defvar ispell-reg-end nil) (defun ispell-highlight-spelling-error-overlay (start end &optional highlight) "Highlight the word from START to END using overlays. @@ -2815,8 +2817,8 @@ ispell-highlight-spelling-error-overlay (isearch-other-end start) (isearch-error nil)) (isearch-lazy-highlight-new-loop - (if (boundp 'reg-start) reg-start) - (if (boundp 'reg-end) reg-end))) + (if (not (eq ispell-reg-start (point-min))) ispell-reg-start (window-start)) + (if (not (eq ispell-reg-end (point-max))) ispell-reg-end (window-end)))) (lazy-highlight-cleanup lazy-highlight-cleanup) (setq isearch-lazy-highlight-last-string nil)))) @@ -3211,6 +3213,7 @@ ispell-region amount for last line processed." (interactive "r") ; Don't flag errors on read-only bufs. (ispell-set-spellchecker-params) ; Initialize variables and dicts alists + (setq ispell-reg-start reg-start ispell-reg-end reg-end) (if (not recheckp) (ispell-accept-buffer-local-defs)) ; set up dictionary, local words, etc. (let ((skip-region-start (make-marker))