help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why doesn't forward-paragraph save-match-data?


From: Alan Mackenzie
Subject: Re: Why doesn't forward-paragraph save-match-data?
Date: Thu, 24 Jul 2003 20:48:32 +0000
User-agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686))

Barry Margolin <barry.margolin@level3.com> wrote on Thu, 24 Jul 2003
19:44:08 GMT:
> In article <6i3pfb.s5.ln@acm.acm>, Alan Mackenzie
> <none@example.invalid> wrote:
>>Given that there is no intrinsic reason why forward-paragraph has to
>>use a regular expression search, this seems to be a non-intuitive thing
>>to do.

> How would you expect variables like paragraph-start and
> paragraph-separate to work?

Er, um, well, can we sort of assume I didn't really write that last
sentence?  ;-)

Is it ever useful or necessary to capture paragraph-start in the
match-data?  I mean, point is right there at (match-beginning 0).  Surely
a paragraph begins at a distinct point, not at a string of non-zero
length.  The standard value for paragraph start is "a formfeed or an
empty line".

The reason I'm asking this is that the code I'm having difficulty with
contains this:

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

> Barry Margolin, barry.margolin@level3.com

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").



reply via email to

[Prev in Thread] Current Thread [Next in Thread]