changeset 72683:e37026af049b

(fill-single-word-nobreak-p): Allow breaking before last word, if it's not the end of the paragraph.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 06 Sep 2006 16:35:18 +0000
parents 06233cacfef2
children f65ec4fd2be1
files lisp/ChangeLog lisp/textmodes/fill.el
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Sep 06 16:32:18 2006 +0000
+++ b/lisp/ChangeLog	Wed Sep 06 16:35:18 2006 +0000
@@ -1,5 +1,8 @@
 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.
 
--- a/lisp/textmodes/fill.el	Wed Sep 06 16:32:18 2006 +0000
+++ b/lisp/textmodes/fill.el	Wed Sep 06 16:35:18 2006 +0000
@@ -292,7 +292,9 @@
 
 (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)