7

I'm having trouble getting Emacs to properly fill a section of text when the last word of a suitable line ends with a period. Emacs seems to think that words separated by a period (and space) are joined.

For example, if I set the fill-column to 10 and enable auto-fill-mode, and I enter this text:

Look up. See the sky?

I'd expect that emacs would break the line and it would end up...

Look up.
See the sky?

Instead, Emacs always breaks the line before the word that ends with a period.

Look
up. See
the sky?

Any ideas how to fix this? I appreciate the help!

2 Answers 2

5

You have sentence-end-double-space set to its default value, which is t. The relevant part of the docstring:

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.

That variable needs to be set to nil to get the wrapping you expect. So:

(setq sentence-end-double-space nil)

See the manual node on Sentences for more information.

1
  • That makes sense! Thank you, this worked.
    – AlysCole
    Commented Nov 29, 2016 at 12:27
2

I'm referring to Emacs Wiki to answer your question.

Paragraph Boundaries

By default, text-mode assumes that empty lines separate paragraphs. The boundaries of paragraphs are determined by two variables.

So the premise of your question seems to conflict with the definition of paragraph.

There is an example in the same page where they try to add *, +, - as members of bullet list and which should be treated as different paragraphs whenever the fill-paragraph command is called.

(setq paragraph-start "\f\\|[ \t]*$\\|[ \t]*[-+*] ")

Try if you could add your . (full-stop followed by two spaces) to qualify as line break at the end of the line - which will allow fill paragraph to honor . as line break.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.