From: Eli Zaretskii <eliz@gnu.org>
To: Lennart Borgman <lennart.borgman@gmail.com>
Cc: 6388-done@debbugs.gnu.org
Subject: bug#6388: Should not match data be set on misses?
Date: Wed, 09 Jun 2010 22:03:08 -0400 [thread overview]
Message-ID: <E1OMX6q-0004aE-VV@fencepost.gnu.org> (raw)
In-Reply-To: <AANLkTimTLmeKO8-7W_BOv7HK4Y1laQbMZeJnddaYPMlJ@mail.gmail.com> (message from Lennart Borgman on Thu, 10 Jun 2010 02:42:59 +0200)
> From: Lennart Borgman <lennart.borgman@gmail.com>
> Date: Thu, 10 Jun 2010 02:42:59 +0200
> Cc:
>
> (let ((ret (re-search-forward "some weird thing" (point-at-eol) t)))
> (message "ret=%s, mb0=%s, 1" ret (match-beginning 0) (match-beginning 1)))
>
> gives me messages like
>
> ret=nil, mb0=517, 1
>
> I expected
>
> ret=nil, mb0=nil, nil
I'm closing this bug report because the ELisp manual explicitly
documents the current behavior:
Every successful search sets the match data. Therefore, you should
query the match data immediately after searching, before calling any
other function that might perform another search. Alternatively, you
may save and restore the match data (*note Saving Match Data::) around
the call to functions that could perform another search.
A search which fails may or may not alter the match data. In the
past, a failing search did not do this, but we may change it in the
future. So don't try to rely on the value of the match data after a
failing search.
Patches welcome to "change this in the future" (unless Stefan or
Yidong object to such a change).
next prev parent reply other threads:[~2010-06-10 2:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-10 0:42 bug#6388: Should not match data be set on misses? Lennart Borgman
2010-06-10 2:03 ` Eli Zaretskii [this message]
2010-06-10 13:04 ` Stefan Monnier
2010-06-10 13:35 ` Lennart Borgman
2010-06-10 18:57 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1OMX6q-0004aE-VV@fencepost.gnu.org \
--to=eliz@gnu.org \
--cc=6388-done@debbugs.gnu.org \
--cc=lennart.borgman@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.