all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu>
Cc: Stefan Monnier <monnier+gnu/emacs@rum.cs.yale.edu>
Subject: Re: regression: filling comments in C++ code (today's CVS)
Date: Fri, 28 Feb 2003 13:40:48 -0500	[thread overview]
Message-ID: <200302281840.h1SIem121718@rum.cs.yale.edu> (raw)
In-Reply-To: 5bu1eoqxj5.fsf@lister.roxen.com

> > > 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	other threads:[~2003-02-28 18:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-17  0:06 regression: filling comments in C++ code (today's CVS) Robert Anderson
2003-01-17 17:19 ` Stefan Monnier
2003-01-19  1:36   ` Richard Stallman
2003-01-19 19:42   ` Martin Stjernholm
2003-01-20 16:54     ` Stefan Monnier
2003-01-24  2:45       ` Martin Stjernholm
2003-01-25 19:22         ` Richard Stallman
2003-01-26  1:48         ` Stefan Monnier
2003-02-09  1:31           ` Martin Stjernholm
2003-02-10 15:36             ` Stefan Monnier
2003-02-24  1:52               ` Martin Stjernholm
2003-02-24 14:26                 ` Stefan Monnier
2003-02-28 14:39                   ` Martin Stjernholm
2003-02-28 18:40                     ` Stefan Monnier [this message]
2003-01-19  0:25 ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2003-01-19  0:41 Robert Anderson
2003-01-19  0:34 Robert Anderson
2003-01-16 20:50 Robert Anderson
2003-01-16 23:46 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200302281840.h1SIem121718@rum.cs.yale.edu \
    --to=monnier+gnu/emacs@rum.cs.yale.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.