On 2009-03-14 18:17 +0100, Noah Slater wrote:

> On Tue, Feb 03, 2009 at 09:50:46PM +0100, Sven Joachim wrote:
>> Does fill-region still work in these situations?  It might be possible
>> that some broken package sets fill-paragraph-function to an unsuitable
>> value (see the docstring for fill-paragraph-function).
>
> Nope, fill-region still exhibits the same behaviour.
>
> Here is a block of text that will reproduce this strange behaviour:
>
> aaaaaa aaaa aaa aaaaaaaaaa aa aaaaa aaaaaa a aaaaa aaaa aaaaaaaa aa
> bbbbbbbbb. aaaaaaa aa aaaaaa aa aaaaaa aaaaa aaaaaaaaaaaaaaa, a aaa aa aaaa 
> aaa
> aaa aaa aaaa aaaa aaaa aaaaa aaa a aaaa aaaa aaaaaa aaaa aaa aaa aaaaaaaa. 
> aaa a
> aaaa aaaa aaa.
>
> If you do fill-paragraph on that text, the word bbbbbbbbb is not moved to the
> first line like it should be.

This is actually correct, because if it were moved to the first line it
would change the semantics of the text: the sentence would end with the
"bbbbbbbbb.", while it does not in the original.  That's because by
default a dot only ends a sentence if followed by a newline or _two_
spaces, see the user option sentence-end-double-space:

,----
| sentence-end-double-space is a variable defined in `paragraphs.el'.
| Its value is t
| 
|   This variable is safe as a file local variable if its value
|   satisfies the predicate `booleanp'.
| 
| Documentation:
| Non-nil means a single space does not end a sentence.
| This is relevant for filling.  See also `sentence-end-without-period'
| and `colon-double-space'.
`----

If you set sentence-end-double-space to nil, then the "bbbbbbbbb." is
moved to the first line, since the sentence ends after it in the
original text.

> If you remove the line break before this word so that you have a long
> line, you will get:
>
> aaaaaa aaaa aaa aaaaaaaaaa aa aaaaa aaaaaa a aaaaa aaaa aaaaaaaa aa 
> bbbbbbbbb. aaaaaaa aa aaaaaa aa aaaaaa aaaaa aaaaaaaaaaaaaaa, a aaa aa aaaa 
> aaa
> aaa aaa aaaa aaaa aaaa aaaaa aaa a aaaa aaaa aaaaaa aaaa aaa aaa aaaaaaaa. 
> aaa a
> aaaa aaaa aaa.
>
> If you do fill-paragraph on this block of text, it will return it to the
> original example, which is in error. Yet, and this is most peculiar, if you 
> add
> the line break after the word bbbbbbbbb, and then do fill paragraph, it will
> correctly leave it alone.

Yes, because by adding the line break you are telling Emacs that the
sentence ends here.

Sven



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to