all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: Why doesn't forward-paragraph save-match-data?
       [not found]   ` <0ngpfb.5e.ln@acm.acm>
@ 2003-07-28 20:23     ` Stefan Monnier
  0 siblings, 0 replies; only message in thread
From: Stefan Monnier @ 2003-07-28 20:23 UTC (permalink / raw)


> (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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-07-28 20:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <6i3pfb.s5.ln@acm.acm>
     [not found] ` <cGWTa.380$0z4.297@news.level3.com>
     [not found]   ` <0ngpfb.5e.ln@acm.acm>
2003-07-28 20:23     ` Why doesn't forward-paragraph save-match-data? Stefan Monnier

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.