[Top][All Lists]

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

Re: line adjustment at the end of a sentence

From: Tom Kramer
Subject: Re: line adjustment at the end of a sentence
Date: Wed, 26 Sep 2012 08:00:33 -0400
User-agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120713 Thunderbird/14.0

Hello Terry -

Thank you very much. I have put (setq sentence-end-double-space nil) into my .emacs file and restarted emacs. The problem is solved as best I can tell. The sample paragraph I submitted now gets set exactly the way I prefer. The double spaces between sentences have also always annoyed me, so setting sentence-end-double-space to nil gets two birds with one stone.

Tom Kramer

On 09/26/2012 06:56 AM, T.F. Torrey wrote:
Hello Tom,

This same behavior caused me confusion a while back, and it took me a
bit to track it down and get my head around it.  The behavior comes from
Emacs's idea about what ends a sentence.

By default, Emacs expects two spaces after a punctuation mark ending a
sentence.  This comes from the variable sentence-end-double-space, which
has a default value of t, meaning two spaces will appear after the end
of a sentence.  If you set it to nil, you will probably get behavior
closer to what you expect.

In more detail, if I understand it correctly, by default, Emacs expects
punctuation ending sentences to be followed by two spaces or a carriage
return.  When this is the case, using a single space after an
abbreviation such as "Dr. Watson" is significant, because it isn't the
end of a sentence.  It would be wrong to fill the paragraph such that
two spaces appear between "Dr." and "Watson", so the single space must
be preserved.  The line can not be broken between "Dr." and "Watson",
because that would lose the information that it was originally a single
space, and adding text and re-filling the paragraph might put both on
the same line erroneously as two sentences as "Dr.  Watson".  So, in
your example, and in my own experience, Emacs treats the space as
unbreakable, even if the line extends beyond what looks reasonable.  It
may be a bug that it does not break the line before the "Dr." (in this
example), but it could just as easily be a deliberate design.

If you change sentence-end-double-space to nil, then the single space
between "Dr." and "Watson" is no longer significant, and Emacs will
break the line between them just fine, because reconnecting them with a
single space between would never be wrong.

As others have noted, using two spaces after periods will also work
well, and has other benefits.  Once you understand what's going on,
though, it's kind of cool.

Best regards,

reply via email to

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