last word, if it's not the end of the paragraph.
2006-09-06 Stefan Monnier <monnier@iro.umontreal.ca>
+ * textmodes/fill.el (fill-single-word-nobreak-p): Allow breaking before
+ last word, if it's not the end of the paragraph.
+
* files.el (abbreviate-file-name): Don't mistakenly match newlines in
file name.
(defun fill-single-word-nobreak-p ()
"Don't break a line after the first or before the last word of a sentence."
- (or (looking-at (concat "[ \t]*\\sw+" "\\(?:" (sentence-end) "\\)"))
+ ;; Actually, allow breaking before the last word of a sentence, so long as
+ ;; it's not the last word of the paragraph.
+ (or (looking-at (concat "[ \t]*\\sw+" "\\(?:" (sentence-end) "\\)[ \t]*$"))
(save-excursion
(skip-chars-backward " \t")
(and (/= (skip-syntax-backward "w") 0)