emacs-devel
[Top][All Lists]
Advanced

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

Re: filling bug in text-mode


From: Juri Linkov
Subject: Re: filling bug in text-mode
Date: Sat, 08 Oct 2005 00:52:52 +0300
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

> Consider the following text in text-mode:
> ----
> It's not necessary to buy a new computer just for a DVD
> drive...  Today, the most important part of a computer is the amount
> of RAM -- the more, the better.  It's far more important than a fast
> CPU.
> ----
> Now set the column width to 70 chars and execute `fill-paragraph' --
> the string `drive...' should be moved to the first line, since the
> last period is followed by two spaces, but nothing happens.  Why?
> This looks like a bug to me.

I looked into this bug.  It is caused by `sentence-end' not matching
the sentence ending with three periods.  The second rule in `fill-nobreak-p':

     ;; Another approach to the same problem.
     (save-excursion
       (skip-chars-backward ". ")
       (and (looking-at "\\.")
            (not (looking-at (sentence-end)))))

tries to match the end of the sentence, but fails.

One solution is to fix the regexp in `sentence-end' to match three
periods.  However, this might have an undesirable effect in other places.
A more localized fix is to change the rule above to skip only one period
backward before trying to match the sentence end.

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

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