From: "Tobias C. Rittweiler" <tcr@freebits.de>
To: bug-gnu-emacs@gnu.org
Subject: bug#2499: 23.0.91; syntax-ppss / beginning-of-defun not saving match data
Date: Tue, 03 Mar 2009 21:50:45 +0100 [thread overview]
Message-ID: <87ljrms53u.fsf@freebits.de> (raw)
In-Reply-To: jwvvdquxljl.fsf-monnier+emacsbugreports@gnu.org
[-- Attachment #1: Type: text/plain, Size: 476 bytes --]
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> > > > (i) `beginning-of-defun' is allowed to not save match data. If so,
> > > > please document it.
> > >
> > > 99.9% of the functions are allowed to not save match data.
> >
> > Oh, I didn't know that! I thought the policy was the other way
> > around. (Perhaps 34.6, The Match Data, should make this policy more
> > explicit. If so, and you say so, I'll prepare a patch.)
>
> Patch welcome.
Attached.
-T.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: match-data-lispref.diff --]
[-- Type: text/x-diff, Size: 925 bytes --]
Index: doc/lispref/searching.texi
===================================================================
RCS file: /sources/emacs/emacs/doc/lispref/searching.texi,v
retrieving revision 1.11
diff -u -r1.11 searching.texi
--- doc/lispref/searching.texi 8 Jan 2009 05:29:01 -0000 1.11
+++ doc/lispref/searching.texi 3 Mar 2009 20:48:30 -0000
@@ -1204,6 +1204,12 @@
can't avoid another intervening search, you must save and restore the
match data around it, to prevent it from being overwritten.
+ Notice that all functions are allowed to overwrite the match data
+unless they're explicitly documented not to do so. A consequence is that
+functions that are run implictly in the background (@pxref{Timers}, and
+@ref{Idle Timers}) should likely save and restore the match data
+explicitly.
+
@menu
* Replacing Match:: Replacing a substring that was matched.
* Simple Match Data:: Accessing single items of match data,
next prev parent reply other threads:[~2009-03-03 20:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-27 15:42 bug#2499: 23.0.91; syntax-ppss / beginning-of-defun not saving match data tcr
2009-02-28 4:50 ` Stefan Monnier
2009-02-28 16:56 ` Tobias C. Rittweiler
2009-02-28 22:09 ` Stefan Monnier
2009-03-03 20:50 ` Tobias C. Rittweiler [this message]
2011-07-03 18:45 ` Lars Magne Ingebrigtsen
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=87ljrms53u.fsf@freebits.de \
--to=tcr@freebits.de \
--cc=2499@emacsbugs.donarmstrong.com \
--cc=bug-gnu-emacs@gnu.org \
/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.