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#22589: 25.0.90; First match found by isearch-forward-symbol is not necessarily a symbol. Date: Wed, 10 Feb 2016 02:54:54 +0200 Organization: LINKOV.NET Message-ID: <87io1x5ptd.fsf@mail.linkov.net> References: <87zivc45j5.fsf@gmail.com> <87d1s8kmyo.fsf@mail.linkov.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1455067227 15757 80.91.229.3 (10 Feb 2016 01:20:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Feb 2016 01:20:27 +0000 (UTC) Cc: 22589@debbugs.gnu.org To: Bastian Beischer Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 10 02:20:16 2016 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 1aTJS4-0004Nc-Gz for geb-bug-gnu-emacs@m.gmane.org; Wed, 10 Feb 2016 02:20:16 +0100 Original-Received: from localhost ([::1]:34272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTJS0-0003lL-OH for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Feb 2016 20:20:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTJRw-0003iD-Bl for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2016 20:20:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTJRq-000073-7Q for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2016 20:20:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTJRq-00006v-4D for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2016 20:20:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aTJRq-0006KY-0v for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2016 20:20: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: Wed, 10 Feb 2016 01:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22589 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22589-submit@debbugs.gnu.org id=B22589.145506717624295 (code B ref 22589); Wed, 10 Feb 2016 01:20:01 +0000 Original-Received: (at 22589) by debbugs.gnu.org; 10 Feb 2016 01:19:36 +0000 Original-Received: from localhost ([127.0.0.1]:34064 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aTJRQ-0006Jm-ES for submit@debbugs.gnu.org; Tue, 09 Feb 2016 20:19:36 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:38008 helo=homiemail-a15.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aTJRO-0006JY-UV for 22589@debbugs.gnu.org; Tue, 09 Feb 2016 20:19:35 -0500 Original-Received: from homiemail-a15.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a15.g.dreamhost.com (Postfix) with ESMTP id 5DC8776C069; Tue, 9 Feb 2016 17:19:32 -0800 (PST) Original-Received: from localhost.linkov.net (85.253.171.40.cable.starman.ee [85.253.171.40]) (Authenticated sender: jurta@jurta.org) by homiemail-a15.g.dreamhost.com (Postfix) with ESMTPA id 86AE076C065; Tue, 9 Feb 2016 17:19:31 -0800 (PST) In-Reply-To: (Bastian Beischer's message of "Mon, 8 Feb 2016 12:34:01 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.90 (x86_64-pc-linux-gnu) 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:112838 Archived-At: > What you are saying makes sense, but the bug I outlined above is more > severe. > > For example: In this line: > > unsigned int i =3D 0; > > when searching for the symbol "i". Taking your comment into account I c= an > see why the first match would be "int", although that's actually not a > match for "\_", because if we would match "i" directly, then there > would be no way to go back to match "int" should the user enter more > characters. However, what happens is that the "i" in unsIgned is matche= d, > which is surely never going to be a symbol... Thank you for the detailed test case. The reason why =E2=80=9Ci=E2=80=9D= matches in the middle of the symbol by not adding an anchor =E2=80=9C\_<=E2=80=9D= is because we need to support the symbol search backwards as well. This means that the symbol search should add =E2=80=9C\_<=E2=80=9D for searching for= ward, and =E2=80=9C\_>=E2=80=9D for a backward search. The same applies to the= word search. We could do this by adding an optional argument =E2=80=98backward=E2=80=99= to both =E2=80=98word-search-regexp=E2=80=99 and =E2=80=98isearch-symbol-regexp=E2= =80=99. One complication is that this change is not backward-compatible. Instead of this, I propose to us= e different values of the existing arg =E2=80=98lax=E2=80=99, e.g. values =E2= =80=98nil=E2=80=99 for a forward search, and =E2=80=98backward=E2=80=99 otherwise. Then it will match at the beginning of the symbol for a forward search, and at the end for a backward search. Same for the word search.