[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#2499: 23.0.91; syntax-ppss / beginning-of-defun not saving match dat
From: |
Stefan Monnier |
Subject: |
bug#2499: 23.0.91; syntax-ppss / beginning-of-defun not saving match data |
Date: |
Sat, 28 Feb 2009 17:09:29 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) |
>> > (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.
>> We do not bother to document it. We should document the functions
>> that are not allowed to do it, OTOH.
> I think it's still worth to think about making `syntax-ppss' saving the
> match data as this function may easily be implicitly invoked by
> something deep down.
Basically any function that does a non-trivial amount of work should be
expected to affect the match-data. I.e. it's the responsability of the
match-data user to make sure she reads the match-data soon after the
regexp match took place, rather than responsability of all other
functions to preserve the match-data.
Stefan