all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#27818: 26.0.50; *occur* buffer misses one match
@ 2017-07-25  8:45 Dani Moncayo
  2017-07-25  9:21 ` Andreas Schwab
  0 siblings, 1 reply; 5+ messages in thread
From: Dani Moncayo @ 2017-07-25  8:45 UTC (permalink / raw)
  To: 27818

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:
---begin-of-buffer---------
1 match for "[^[:alnum:]]\(w2\|w3\)[^[:alnum:]]" in buffer: foo
      1:w1    # word 1
       :w2    # word 2
---end-of-buffer---------

I'm using a build made from a recent version of the master branch:

In GNU Emacs 26.0.50 (build 1, x86_64-unknown-cygwin)
 of 2017-07-24 built on ZVDES404
Repository revision: 6dc5d45c542a6f9cfbcf3e37d597c9e0efb3070d
Windowing system distributor 'Microsoft Corp.', version 6.3.9600

Configured using:
 'configure --with-mailutils --with-w32'

Configured features:
SOUND ACL GNUTLS ZLIB TOOLKIT_SCROLL_BARS

Important settings:
  value of $LANG: C.ISO-8859-1
  locale-coding-system: iso-latin-1-unix

-- 
Dani Moncayo





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#27818: 26.0.50; *occur* buffer misses one match
  2017-07-25  8:45 bug#27818: 26.0.50; *occur* buffer misses one match Dani Moncayo
@ 2017-07-25  9:21 ` Andreas Schwab
  2017-07-25 10:23   ` Dani Moncayo
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2017-07-25  9:21 UTC (permalink / raw)
  To: Dani Moncayo; +Cc: 27818

On Jul 25 2017, Dani Moncayo <dmoncayo@gmail.com> 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."





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#27818: 26.0.50; *occur* buffer misses one match
  2017-07-25  9:21 ` Andreas Schwab
@ 2017-07-25 10:23   ` Dani Moncayo
  2017-07-25 10:57     ` Dani Moncayo
  0 siblings, 1 reply; 5+ messages in thread
From: Dani Moncayo @ 2017-07-25 10:23 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 27818

> The occur engine only considers non-overlapping matches and extends each
> match to complete lines.

Ok, thank you.

Shouldn't this be documented in the manual (node "Other Repeating Search")?

Barring that, I'm ok with closing this ticket.

Thanks again.

-- 
Dani Moncayo





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#27818: 26.0.50; *occur* buffer misses one match
  2017-07-25 10:23   ` Dani Moncayo
@ 2017-07-25 10:57     ` Dani Moncayo
  2017-07-29  8:26       ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Dani Moncayo @ 2017-07-25 10:57 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 27818

On Tue, Jul 25, 2017 at 12:23 PM, Dani Moncayo <dmoncayo@gmail.com> wrote:
>> The occur engine only considers non-overlapping matches and extends each
>> match to complete lines.
>
> Ok, thank you.
>
> Shouldn't this be documented in the manual (node "Other Repeating Search")?

...and/or the docstring of the "occur" command?

-- 
Dani Moncayo





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#27818: 26.0.50; *occur* buffer misses one match
  2017-07-25 10:57     ` Dani Moncayo
@ 2017-07-29  8:26       ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2017-07-29  8:26 UTC (permalink / raw)
  To: Dani Moncayo; +Cc: schwab, 27818-done

> From: Dani Moncayo <dmoncayo@gmail.com>
> Date: Tue, 25 Jul 2017 12:57:32 +0200
> Cc: 27818@debbugs.gnu.org
> 
> On Tue, Jul 25, 2017 at 12:23 PM, Dani Moncayo <dmoncayo@gmail.com> wrote:
> >> The occur engine only considers non-overlapping matches and extends each
> >> match to complete lines.
> >
> > Ok, thank you.
> >
> > Shouldn't this be documented in the manual (node "Other Repeating Search")?
> 
> ...and/or the docstring of the "occur" command?

Done.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-07-29  8:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-25  8:45 bug#27818: 26.0.50; *occur* buffer misses one match Dani Moncayo
2017-07-25  9:21 ` Andreas Schwab
2017-07-25 10:23   ` Dani Moncayo
2017-07-25 10:57     ` Dani Moncayo
2017-07-29  8:26       ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.