* Occur buglet
@ 2004-03-05 19:50 Morten Welinder
2004-03-09 23:16 ` Andreas Schwab
2004-03-10 8:27 ` era
0 siblings, 2 replies; 3+ messages in thread
From: Morten Welinder @ 2004-03-05 19:50 UTC (permalink / raw)
On fencepost.gnu.org (Emacs 21.2.1) with a buffer containing
--------------------------------------------
+++
+
hi
xxx
--------------------------------------------
I do the command `M-x occur RET ^[+][^+] RET' and get
--------------------------------------------
1 line matching "^[+][^+]" in buffer *scratch*.
2:+
: hi
--------------------------------------------
It is debatable whether there should be a match -- grep would not have
found it -- but the listed thing is not one line, but two.
Morten
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Occur buglet
2004-03-05 19:50 Occur buglet Morten Welinder
@ 2004-03-09 23:16 ` Andreas Schwab
2004-03-10 8:27 ` era
1 sibling, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2004-03-09 23:16 UTC (permalink / raw)
Cc: bug-gnu-emacs
Morten Welinder <terra@gnu.org> writes:
> On fencepost.gnu.org (Emacs 21.2.1) with a buffer containing
>
> --------------------------------------------
> +++
> +
> hi
> xxx
> --------------------------------------------
>
> I do the command `M-x occur RET ^[+][^+] RET' and get
>
> --------------------------------------------
> 1 line matching "^[+][^+]" in buffer *scratch*.
> 2:+
> : hi
> --------------------------------------------
>
> It is debatable whether there should be a match -- grep would not have
> found it -- but the listed thing is not one line, but two.
Not a bug. [^+] matches newline in Emacs, but not in grep. The second
line is actually part of the first match.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Occur buglet
2004-03-05 19:50 Occur buglet Morten Welinder
2004-03-09 23:16 ` Andreas Schwab
@ 2004-03-10 8:27 ` era
1 sibling, 0 replies; 3+ messages in thread
From: era @ 2004-03-10 8:27 UTC (permalink / raw)
On Fri, 05 Mar 2004 14:50:50 -0500, Morten Welinder <terra@gnu.org>
posted to bug-gnu-emacs:
> 1 line matching "^[+][^+]" in buffer *scratch*.
> 2:+
> : hi
> It is debatable whether there should be a match -- grep would not have
> found it -- but the listed thing is not one line, but two.
The string which matches [^+] is the newline of line 2. Emacs regex
negated classes will include newline unless you explicitly exclude it.
The regex [^+\n] matches what you'd express as [^+] in grep. Since
grep is line-oriented, but Emacs is buffer-oriented, this distinction
makes sense.
Furthermore, there is nowhere any assertion that occur and grep should
match exactly the same things -- there are numerous other differences,
all of which are hopefully adequately documented.
/* era */
--
The email address era the contact information Just for kicks, imagine
at iki dot fi is heavily link on my home page at what it's like to get
spam filtered. If you <http://www.iki.fi/era/> 500 pieces of spam for
want to reach me, see instead. each wanted message.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-03-10 8:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-05 19:50 Occur buglet Morten Welinder
2004-03-09 23:16 ` Andreas Schwab
2004-03-10 8:27 ` era
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.