Not the maintain but just another hacker.

> This is a test case where fmt fails by inserting spaces it shouldn't:

Actually, look closely at where it is inserting spaces.  It is
inserting them at the end of a sentence.  The question at hand is what
is the end of the sentence and what is an abbreviation.

The fmt program is using the traditional computer formating method that
abbreviations have one space after the period and therefore are not
sentence breaks while sentence breaks have two spaces.

> ---cut 9 lines---
> Then I had problems getting enough wood for the Ark, because of the ban
> on native logging on the West Coast. They tried to get me to use Fijian
> Jara but I couldn't get the necessary dispensation from Customs &
> Excise to import timber from a Pacific Island nation that wasn't party
> to the international working party on the life cycle of native timbers.

Period occurs at the end of the line.  This is a sentence break as
documented.

> I finally convinced DoC that I needed the wood to indirectly save the
> kakapo from extinction which seemed to get a bit of a reaction,
> however, the Royal Forest and Bird Society objected and won't let me
> catch any kakapo. No kakapo. No wood.

Periods occur with only one space afterward.  None of those are
recognized as the end of a sentence.  This way you can say, this,
that, etc. and not have the punctuation mark after the abbreviate mark
the end of the sentence.  Otherwise, how can you tell?

> output:
> ---cut---
> Then I had problems getting enough wood for the Ark, because of the
> ban on native logging on the West Coast. They tried to get me to
> use Fijian Jara but I couldn't get the necessary dispensation from
> Customs & Excise to import timber from a Pacific Island nation that
> wasn't party to the international working party on the life cycle of
> native timbers.  I finally convinced DoC that I needed the wood to
> indirectly save the kakapo from extinction which seemed to get a bit
> of a reaction, however, the Royal Forest and Bird Society objected
> and won't let me catch any kakapo. No kakapo. No wood.
> ---cut---

The fmt documentation in the online info pages say:

  A "sentence break" is defined as either the end of a paragraph or a
  word ending in any of `.?!', followed by two spaces or end of line,
  ignoring any intervening parentheses or quotes.

I have no idea if there is any way to tell fmt to only use one space
after a sentence.  I could not find one.  I could see that as being a
reasonable extension.  I personally like the default and it
corresponds to what I expect when typing in prose.

However, as in any typesetting forum, I am sure there can be endless
debate on how things look.  Being a human everyone is an expert on
human communication.  (Dealing with programming languages are easier.)

Looking at this paragraph you will see that I stick to the convention
and use two spaces after sentences.  Many programs expect this, emacs
and vi among them and those editors use that convention to move by
sentences forward and backward.  There is a long history of this style
and fmt is an old program which matches that convention.

Hope that helps
Bob

Reply via email to