From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#29321: Isearch hit count Date: Tue, 30 Oct 2018 16:35:42 -0700 (PDT) Message-ID: <8629624d-6118-4b6b-b626-77801112326a@default> References: <87o9bfqfc3.fsf@mail.linkov.net> <988284b2-58af-428d-9c6f-da56db0c6565@default> <874ld5elxb.fsf@mail.linkov.net> <3e52e081-ad81-41a6-a0d6-295790db82d4@default> <877ei049f6.fsf@mail.linkov.net> <2231d642-cb4a-4114-9896-be995e4c6460@default> <87r2g7kp8u.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1540942446 2675 195.159.176.226 (30 Oct 2018 23:34:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 30 Oct 2018 23:34:06 +0000 (UTC) Cc: charles@aurox.ch, 29321@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 31 00:34:02 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gHdWL-0000Z1-Lz for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 Oct 2018 00:34:01 +0100 Original-Received: from localhost ([::1]:56064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHdYS-0008SY-29 for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Oct 2018 19:36:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHdYL-0008SH-IC for bug-gnu-emacs@gnu.org; Tue, 30 Oct 2018 19:36:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHdYI-0003z4-Cz for bug-gnu-emacs@gnu.org; Tue, 30 Oct 2018 19:36:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51763) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHdYI-0003yD-1W for bug-gnu-emacs@gnu.org; Tue, 30 Oct 2018 19:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gHdYH-0005aP-T2 for bug-gnu-emacs@gnu.org; Tue, 30 Oct 2018 19:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Oct 2018 23:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29321 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29321-submit@debbugs.gnu.org id=B29321.154094255521462 (code B ref 29321); Tue, 30 Oct 2018 23:36:01 +0000 Original-Received: (at 29321) by debbugs.gnu.org; 30 Oct 2018 23:35:55 +0000 Original-Received: from localhost ([127.0.0.1]:56021 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gHdYB-0005a5-Bs for submit@debbugs.gnu.org; Tue, 30 Oct 2018 19:35:55 -0400 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:57550) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gHdY9-0005Zs-Lx for 29321@debbugs.gnu.org; Tue, 30 Oct 2018 19:35:54 -0400 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w9UNTXJ8017703; Tue, 30 Oct 2018 23:35:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=R7wp/JQLQ0fvcAINt8U6114RobnIT0rU2LeaD79+w7U=; b=SrJsTH4asDEAAlJnV4nogYvG2QhhNvGk+GbM7UgpU1wqMHVemZ4tRiAKOt7qvWBzfIpP ANCQK6pPObHRRAgQ18DcIg1YjHJI4QoGJAAXHjmV4VFsa50LHxukcGllWTpByv3MKX6l KxOxI+qnqui9YmW9g/2kjjm9tIQk2kNdFnNu48bGjG9oj/cmjZmCQVU9sa24nwnMLrTG E135hgTeMUYk63bvKxWs5NjP4bKG3cMxTvIaVo6BjhH1eSqg+hXbmf8T69X9mRneS/fY ekKOPDR9m38dk8BxNZF2SjKQX85TTaSwwggQGLeAIp8dSwTQPJdoMBzkIj/xjZFa1hPW nA== Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2ncfypykdp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Oct 2018 23:35:45 +0000 Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w9UNZiD5001351 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Oct 2018 23:35:44 GMT Original-Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w9UNZgAT005025; Tue, 30 Oct 2018 23:35:43 GMT In-Reply-To: <87r2g7kp8u.fsf@mail.linkov.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4756.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9062 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810300195 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" Xref: news.gmane.org gmane.emacs.bugs:151852 Archived-At: > > I still do see the problem (did I mention this one?) > > that if I reverse direction so that the prompt changes > > to, say, Overwrapped..., there is no count shown. But > > later sometimes it comes back. > > > > Does this make sense? Why would the prompt sometimes > > disappear? That must mean that, for some reason, > > `isearch-lazy-count-current' is nil, right? > > > > Do you see this? It might help to repeat-search > > quickly; dunno. I'm still searching just with the > > regexp "se\(.*\)r", FWIW. >=20 > Congratulations, you stumbled upon long-standing backward regexp > search controversy. >=20 > Reversing direction invalidates the number of matches > because it will find another number. Did you notice > that the total number of matches is different after > switching direction e.g. for "se\(.*\)r"? I didn't notice it, but sure, I understand that matching backward is not the same as forward. Dunno why that would produce the symptoms I described, however. > Here is a minimal test case: >=20 > 0. emacs -Q > 1. Paste this text to the end of *scratch*: > Does this make sense? Why would the prompt sometimes disappear? > 2. For convenience, put this regexp to the regexp search history: > C-M-s se\(.*\)r RET > 3. Go to the beginning of *scratch* > 4. Type C-M-s C-s >=20 > See the following text is matched and highlighted: > sense? Why would the prompt sometimes disappear? > 5. Type C-r > See another part of this text is matched and highlighted: > se? Why would the prompt sometimes disappear? > 6. Type C-s > See the second text is matched and highlighted: > se? Why would the prompt sometimes disappear? >=20 > not the initial text: > sense? Why would the prompt sometimes disappear? >=20 > This is why no count is shown. Lazy-count searches > from the top of the buffer. However, C-s C-r C-s > finds a shorter match after switching direction. That all makes sense. But I don't think that explains the part of the behavior where the prompt does not appear without changing direction, just by repeating search (e.g. always forward) very quickly. Or if it does explain it somehow, I don't quite get it yet. > The problem occurs only with different values of > isearch-other-end that corresponds to match-beginning, > not with match-end that coincides with point. >=20 > Initially I planned to use point, not isearch-other-end. > But since there is no special isearch variable for point, > and the value of point is changed by the lazy updating, > I was too lazy to add a corresponding variable for point. >=20 > Now a new version attached below just let-binds the > initial value of point. You can compare it with the > previous version to see the change. The fix is very small. I'll give it a try. Thx - Drew