From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.bugs Subject: bug#27818: 26.0.50; *occur* buffer misses one match Date: Tue, 25 Jul 2017 11:21:00 +0200 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1500974543 25224 195.159.176.226 (25 Jul 2017 09:22:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 25 Jul 2017 09:22:23 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: 27818@debbugs.gnu.org To: Dani Moncayo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 25 11:22:19 2017 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 1dZw2h-00066I-PN for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Jul 2017 11:22:15 +0200 Original-Received: from localhost ([::1]:59364 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZw2k-0004Le-42 for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Jul 2017 05:22:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38480) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZw2X-0004Jw-Ly for bug-gnu-emacs@gnu.org; Tue, 25 Jul 2017 05:22:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dZw2U-0002At-FB for bug-gnu-emacs@gnu.org; Tue, 25 Jul 2017 05:22:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52402) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dZw2U-0002Ai-BI for bug-gnu-emacs@gnu.org; Tue, 25 Jul 2017 05:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dZw2U-0003gO-2U for bug-gnu-emacs@gnu.org; Tue, 25 Jul 2017 05:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andreas Schwab Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Jul 2017 09:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27818 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27818-submit@debbugs.gnu.org id=B27818.150097446414093 (code B ref 27818); Tue, 25 Jul 2017 09:22:02 +0000 Original-Received: (at 27818) by debbugs.gnu.org; 25 Jul 2017 09:21:04 +0000 Original-Received: from localhost ([127.0.0.1]:55079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dZw1Y-0003fF-60 for submit@debbugs.gnu.org; Tue, 25 Jul 2017 05:21:04 -0400 Original-Received: from mx2.suse.de ([195.135.220.15]:33185 helo=mx1.suse.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dZw1W-0003eT-2V for 27818@debbugs.gnu.org; Tue, 25 Jul 2017 05:21:02 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Original-Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D802DAABA; Tue, 25 Jul 2017 09:21:00 +0000 (UTC) X-Yow: C'MON, everybody!! I've flown in LESLIE GORE and two dozen KOSHER BUTCHERS! They'll be doing intricate MILITARY MANEUVERS to the soundtrack from "OKLAHOMA"!! In-Reply-To: (Dani Moncayo's message of "Tue, 25 Jul 2017 10:45:13 +0200") 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:134959 Archived-At: On Jul 25 2017, Dani Moncayo wrote: > Recipe from "emacs -Q": > > 1. Create a new buffer and put there these four lines: > ---begin-of-buffer--------- > w1 # word 1 > w2 # word 2 > w3 # word 3 > w4 # word 4 > ---end-of-buffer--------- > > 2. Search for the following regexp: > "[^[:alnum:]]\(w2\|w3\)[^[:alnum:]]" (without the quotes) > > 3. End the search and type "C-M-s M-p RET M-s o" to launch an *occur* buffer. > > The search actually has 2 matches but the *occur* buffer shows only one of them: The occur engine only considers non-overlapping matches and extends each match to complete lines. > ---begin-of-buffer--------- > 1 match for "[^[:alnum:]]\(w2\|w3\)[^[:alnum:]]" in buffer: foo > 1:w1 # word 1 > :w2 # word 2 > ---end-of-buffer--------- Note how the first [^[:alnum:]] matches the newline preceding w2, thus the match includes also line 1. The next match would start at the newline in line 2, but that would overlap with the first match. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."