[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why doesn't forward-paragraph save-match-data?
From: |
Stefan Monnier |
Subject: |
Re: Why doesn't forward-paragraph save-match-data? |
Date: |
28 Jul 2003 16:23:41 -0400 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
> (save-excursion
> (forward-paragraph -1)
> (< (point) (match-beginning 0)))
> It seems to me that that comparison ALWAYS evaluates to nil.
> I feel that either forward-paragraph should have a save-match-data round
> it, or its doc string should mention that the caller might have to use
> save-match-data.
If anything, what is missing a some more documentation in `match-beginning'
explaining that the match data is "ephemeral" and can be changed by most
functions other than very basic ones that obviously don't use regexps (like
`car'). It's generally a lot easier to fix the very few places where
this ephemerality is a problem than to add `save-match-data'
around everything.
Stefan