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#19353: 25.0.50; Lazy Highlighting Date: Fri, 12 Dec 2014 02:18:10 +0200 Organization: LINKOV.NET Message-ID: <87k31x20id.fsf@mail.linkov.net> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1418344172 28170 80.91.229.3 (12 Dec 2014 00:29:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 12 Dec 2014 00:29:32 +0000 (UTC) Cc: 19353@debbugs.gnu.org To: Dani Moncayo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 12 01:29:24 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 1XzE6l-0006Gs-7b for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 Dec 2014 01:29:23 +0100 Original-Received: from localhost ([::1]:54815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzE6k-00014v-Pi for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Dec 2014 19:29:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzE6a-00013l-Ib for bug-gnu-emacs@gnu.org; Thu, 11 Dec 2014 19:29:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XzE6R-0007O8-27 for bug-gnu-emacs@gnu.org; Thu, 11 Dec 2014 19:29:12 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33965) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzE6Q-0007O2-Uk for bug-gnu-emacs@gnu.org; Thu, 11 Dec 2014 19:29:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XzE6Q-0003R5-Bz for bug-gnu-emacs@gnu.org; Thu, 11 Dec 2014 19:29:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 Dec 2014 00:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19353 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19353-submit@debbugs.gnu.org id=B19353.141834410113150 (code B ref 19353); Fri, 12 Dec 2014 00:29:02 +0000 Original-Received: (at 19353) by debbugs.gnu.org; 12 Dec 2014 00:28:21 +0000 Original-Received: from localhost ([127.0.0.1]:43331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XzE5l-0003Q1-1A for submit@debbugs.gnu.org; Thu, 11 Dec 2014 19:28:21 -0500 Original-Received: from ps18281.dreamhost.com ([69.163.222.226]:38587 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XzE5i-0003Ps-82 for 19353@debbugs.gnu.org; Thu, 11 Dec 2014 19:28:18 -0500 Original-Received: from localhost.linkov.net (ps18281.dreamhostps.com [69.163.222.226]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 6CFBA348328E73; Thu, 11 Dec 2014 16:28:15 -0800 (PST) In-Reply-To: (Dani Moncayo's message of "Thu, 11 Dec 2014 22:12:12 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.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: 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:97237 Archived-At: > Recipe: > 0. emacs -Q > 1. Create and empty buffer. > 2. Write there this text (without the hyphen lines): > -------------- > fat cat path > too book cool > -------------- > 3. Place point just after the "a" in "path". > 4. Type: C-s a t > 5. Place point just after the first "o" in "cool". > 6. Type: C-s o o Does this patch address all your test cases? It prolongs the boundary of the wrapped search by the length of the search string, and in the worst case it might lazy-highlight some matches twice. diff --git a/lisp/isearch.el b/lisp/isearch.el index c3e473a..5fb687b 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -3063,11 +3063,13 @@ (defun isearch-lazy-highlight-search () (bound (if isearch-lazy-highlight-forward (min (or isearch-lazy-highlight-end-limit (point-max)) (if isearch-lazy-highlight-wrapped - isearch-lazy-highlight-start + (+ isearch-lazy-highlight-start + (1- (length isearch-lazy-highlight-last-string))) (window-end))) (max (or isearch-lazy-highlight-start-limit (point-min)) (if isearch-lazy-highlight-wrapped - isearch-lazy-highlight-end + (- isearch-lazy-highlight-end + (1- (length isearch-lazy-highlight-last-string))) (window-start)))))) ;; Use a loop like in `isearch-search'. (while retry