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#7468: 24.0.50; Isearch highlighting Date: Tue, 23 Nov 2010 01:34:29 +0000 Organization: JURTA Message-ID: <87pqtw4yc0.fsf@mail.jurta.org> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1290476698 20628 80.91.229.12 (23 Nov 2010 01:44:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 23 Nov 2010 01:44:58 +0000 (UTC) Cc: 7468@debbugs.gnu.org To: Dani Moncayo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 23 02:44:53 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PKhwA-0007Vh-Lc for geb-bug-gnu-emacs@m.gmane.org; Tue, 23 Nov 2010 02:44:50 +0100 Original-Received: from localhost ([127.0.0.1]:33200 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PKhwA-0005H2-7i for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Nov 2010 20:44:50 -0500 Original-Received: from [140.186.70.92] (port=33136 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PKhw1-0005GU-Ln for bug-gnu-emacs@gnu.org; Mon, 22 Nov 2010 20:44:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PKhvu-00034R-J7 for bug-gnu-emacs@gnu.org; Mon, 22 Nov 2010 20:44:41 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PKhvu-00034F-HV for bug-gnu-emacs@gnu.org; Mon, 22 Nov 2010 20:44:34 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PKhkk-0002f5-47; Mon, 22 Nov 2010 20:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Nov 2010 01:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7468 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7468-submit@debbugs.gnu.org id=B7468.129047597010225 (code B ref 7468); Tue, 23 Nov 2010 01:33:02 +0000 Original-Received: (at 7468) by debbugs.gnu.org; 23 Nov 2010 01:32:50 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PKhkX-0002es-0J for submit@debbugs.gnu.org; Mon, 22 Nov 2010 20:32:49 -0500 Original-Received: from smarty.dreamhost.com ([208.113.175.8]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PKhkU-0002en-M6 for 7468@debbugs.gnu.org; Mon, 22 Nov 2010 20:32:47 -0500 Original-Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id 785486E8069; Mon, 22 Nov 2010 17:38:02 -0800 (PST) Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 82FD0451C139; Mon, 22 Nov 2010 17:38:00 -0800 (PST) In-Reply-To: (Dani Moncayo's message of "Mon, 22 Nov 2010 21:57:52 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 22 Nov 2010 20:33:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:41832 Archived-At: > I've also tried to copy that section of the manual into a brand new > buffer, but there I can't reproduce the problem. The difference between this recipe in a normal buffer and an Info buffer is in the line (when (not isearch-error) in `isearch-lazy-highlight-new-loop'. A normal Isearch starts a new lazy highlighting loop even if there are no matches, so it has a chance to set `isearch-lazy-highlight-last-string'. But an Isearch in Info has the text "Initial node" in `isearch-error', so `isearch-lazy-highlight-new-loop' doesn't set the last search string to `isearch-lazy-highlight-last-string'. This bug is not specific to an Isearch in Info. You can get the same bug for a regexp Isearch in a normal buffer as: 1) Search for the regexp "foot[" (C-M-s foot[) 2) Remove the last "[" () There is no lazy highlighting too. I think this patch is a general fix for all these bug cases: === modified file 'lisp/isearch.el' --- lisp/isearch.el 2010-10-02 22:37:21 +0000 +++ lisp/isearch.el 2010-11-23 01:30:44 +0000 @@ -2628,6 +2628,7 @@ (defvar isearch-lazy-highlight-case-fold (defvar isearch-lazy-highlight-regexp nil) (defvar isearch-lazy-highlight-space-regexp nil) (defvar isearch-lazy-highlight-forward nil) +(defvar isearch-lazy-highlight-error nil) (defun lazy-highlight-cleanup (&optional force) "Stop lazy highlighting and remove extra highlighting from current buffer. @@ -2669,9 +2670,12 @@ (defun isearch-lazy-highlight-new-loop ( (not (= (window-end) ; Window may have been split/joined. isearch-lazy-highlight-window-end)) (not (eq isearch-forward - isearch-lazy-highlight-forward)))) + isearch-lazy-highlight-forward)) + (not (eq isearch-error + isearch-lazy-highlight-error)))) ;; something important did indeed change (lazy-highlight-cleanup t) ;kill old loop & remove overlays + (setq isearch-lazy-highlight-error isearch-error) (when (not isearch-error) (setq isearch-lazy-highlight-start-limit beg isearch-lazy-highlight-end-limit end)