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: Sun, 06 Dec 2015 01:04:15 +0200 Organization: LINKOV.NET Message-ID: <87fuzgebv4.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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1449357445 16809 80.91.229.3 (5 Dec 2015 23:17:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Dec 2015 23:17:25 +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 Sun Dec 06 00:17:13 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 1a5M4m-0007d7-Hx for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Dec 2015 00:17:12 +0100 Original-Received: from localhost ([::1]:48044 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5M4l-0001dw-Nk for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Dec 2015 18:17:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5M4i-0001bS-6P for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2015 18:17:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a5M4d-0002LS-JN for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2015 18:17:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50451) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5M4d-0002LO-Go for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2015 18:17:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a5M4d-0000aN-59 for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2015 18:17:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Dec 2015 23:17:03 +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.14493573922186 (code B ref 22097); Sat, 05 Dec 2015 23:17:03 +0000 Original-Received: (at 22097) by debbugs.gnu.org; 5 Dec 2015 23:16:32 +0000 Original-Received: from localhost ([127.0.0.1]:40156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a5M47-0000ZB-Om for submit@debbugs.gnu.org; Sat, 05 Dec 2015 18:16:32 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:36612 helo=homiemail-a39.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a5M3n-0000Yc-11 for 22097@debbugs.gnu.org; Sat, 05 Dec 2015 18:16:29 -0500 Original-Received: from homiemail-a39.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a39.g.dreamhost.com (Postfix) with ESMTP id 0A2E615006D; Sat, 5 Dec 2015 15:16:10 -0800 (PST) Original-Received: from localhost.linkov.net (m91-129-116-187.cust.tele2.ee [91.129.116.187]) (Authenticated sender: jurta@jurta.org) by homiemail-a39.g.dreamhost.com (Postfix) with ESMTPA id E1768150069; Sat, 5 Dec 2015 15:16:08 -0800 (PST) In-Reply-To: <20151205160429.GC2698@acm.fritz.box> (Alan Mackenzie's message of "Sat, 5 Dec 2015 16:04:29 +0000") 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:109676 Archived-At: > \( \| \| \) > --+ _+ \( \| \)\( \| \)*\( \)+ > /\w \( \) \w [-_] [.:/@]+\( \| \)+ > \( \| \)+[.:@] \w [-_~=?&] > \w [-_] This is a nice ASCII-art in itself :-), but the problem is in another place - in ispell-highlight-spelling-error-overlay you can see word boundaries "\\b" that were added for every search string to not highlight parts of words, such as when the current check is for e.g. "init", we don't want to highlight "init" in the words "initialize", "initially", etc. The drawback of this approach is that it depends on the word syntax in a particular mode. Another limitation is limiting lazy-highlighting by reg-start/reg-end instead of a wider area of window-start/window-end. Finally, we need now here this fix: diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index fe27f0f..aa51446 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -2809,6 +2809,7 @@ ispell-highlight-spelling-error-overlay (regexp-quote (buffer-substring-no-properties start end)) "\\b")) (isearch-regexp t) + (isearch-regexp-function nil) (isearch-case-fold-search nil) (isearch-forward t) (isearch-other-end start)