emacs-devel
[Top][All Lists]
Advanced

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

Re: regression: filling comments in C++ code (today's CVS)


From: Stefan Monnier
Subject: Re: regression: filling comments in C++ code (today's CVS)
Date: Fri, 28 Feb 2003 13:40:48 -0500

> > > I mean the following near the start of fill-region-as-paragraph:
> > > 
> > >   ;; Ignore blank lines at beginning of region.
> > >   (skip-chars-forward " \t\n")
> > > 
> > > To me it seems more natural if this function compacted all whitespace
> > > the same way, even that at the start.
> > 
> > Since the function should basically never be called on any empty line
> > at all /.../
> 
> That provision isn't obvious to me.

The above "should" was not meant as a recommendation but as a comment
on the typical way the function is used.

> The doc says "it removes any
> paragraph breaks in the region/.../". I interpret "paragraph breaks"
> to include empty lines in the region, at the start as much as anywhere
> else.

Agreed.

> > Could you describe in which context you bumped into it ?
> 
> I only bumped into it because I took a quick look at the function, and
> it looked like something that could surprise programmers that embed
> fill-region-as-paragraph and thus cause their code to misbehave in
> some odd situation down the road. According to the principle of least
> surprising behavior one should ask for specific reasons to have a
> special case rather than reasons for not having it.
> 
> The only reason I can see to have this particular one is that it's
> already there and has been for some time. Perhaps that's a good enough
> cause to keep it.

Just like you I don't understand why those lines are there.
Maybe it's related to the fact that backward-paragraph will skip
the the empty line before the paragraph (if there is such an empty
line), but in that case, the blank-line-skip should probably
happen in fill-paragraph rather than in fill-region-as-paragraph.


        Stefan





reply via email to

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