From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Newsgroups: gmane.emacs.bugs Subject: bug#9681: Broken behaviour of re-search-backward (.+ matching only a single character) Date: Thu, 06 Oct 2011 20:48:51 +0200 Message-ID: <87ty7mymzw.fsf@gmail.com> References: <8762k21o09.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1317927304 30529 80.91.229.12 (6 Oct 2011 18:55:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 6 Oct 2011 18:55:04 +0000 (UTC) Cc: 9681@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 06 20:54:59 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RBt5u-0006fF-1B for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Oct 2011 20:54:58 +0200 Original-Received: from localhost ([::1]:52824 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBt5t-0005qm-Jc for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Oct 2011 14:54:57 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:60385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBt5q-0005qg-54 for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2011 14:54:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBt5p-0000Tb-2E for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2011 14:54:54 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35509) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBt5o-0000TX-T2 for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2011 14:54:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RBt5y-0000Qe-6i for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2011 14:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Oct 2011 18:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9681 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9681-submit@debbugs.gnu.org id=B9681.13179272791620 (code B ref 9681); Thu, 06 Oct 2011 18:55:02 +0000 Original-Received: (at 9681) by debbugs.gnu.org; 6 Oct 2011 18:54:39 +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 1RBt5a-0000Q4-OA for submit@debbugs.gnu.org; Thu, 06 Oct 2011 14:54:39 -0400 Original-Received: from mail-bw0-f44.google.com ([209.85.214.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RBt5X-0000Pp-VI for 9681@debbugs.gnu.org; Thu, 06 Oct 2011 14:54:36 -0400 Original-Received: by bkaq10 with SMTP id q10so3488038bka.3 for <9681@debbugs.gnu.org>; Thu, 06 Oct 2011 11:54:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type:content-transfer-encoding; bh=oQz1NFIxT1Ys0D+ZnBivNEiyiGG2ajCKFCZScrO9azk=; b=EgygNoY2fh4nS9r1xcOeUUPyX0sLuna3Ku1PvxnB8gHW0ZiXuW7sZwEgbdeZIljx+W ZxaNob1Znqz5gYSFBxif0dD5bnRZ4JdjEfFeLD3UgyNRVng2XAXRCKbaGp2uWW3ytjXO RgGRq0erJ5ti8jCiUFS8phCVybLlRpGGg3XL4= Original-Received: by 10.204.137.208 with SMTP id x16mr786034bkt.373.1317927259989; Thu, 06 Oct 2011 11:54:19 -0700 (PDT) Original-Received: from localhost (176.119.broadband10.iol.cz. [90.177.119.176]) by mx.google.com with ESMTPS id t13sm14026825fae.0.2011.10.06.11.54.18 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Oct 2011 11:54:18 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Thu, 06 Oct 2011 08:57:09 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 06 Oct 2011 14:55:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) 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:52304 Archived-At: [Stefan: sorry for two replies, I forgot to cc the bug list in my first reply, also, I've changed my mind on some of the points since then, see below.] On Thu, Oct 06, 2011 at 08:57:09AM -0400, Stefan Monnier wrote: > > If this curious inconsistency of `re-search-backward' with > > `re-search-forward' is intentional (which I hope it is not), it should > > be documented, but I couldn't find anything in the manuals or > > docstrings. > > re-search-* stops at the first character position that has a match. > And then it chooses the longest match at that position. Thanks, but I'm not sure I understand what you mean here. Naturally, the longest match for `re-search-backward' should be backward, not forward, i.e. using your wording above, when searching _backward_ for \w+ in "foobar|" where "|" is point, the "first character position that has a match" might be "r", but it's hardly the longest match. If I'm the only one who considers this behaviour broken (by design?[1]), which I very much doubt, it definitely needs to at least be documented, as I'm certainly not the only one who is very surprised by this behaviour. In my opinion it should be fixed, though. [1] Cf. e.g. ?\w\+ in Vim, which does the right thing. -- =C5=A0t=C4=9Bp=C3=A1n