]> git.eshelyaron.com Git - emacs.git/commitdiff
(fill-single-word-nobreak-p): Allow breaking before
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 6 Sep 2006 16:35:18 +0000 (16:35 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 6 Sep 2006 16:35:18 +0000 (16:35 +0000)
last word, if it's not the end of the paragraph.

lisp/ChangeLog
lisp/textmodes/fill.el

index 55fa2cf011bb5f4d80b510ea0faa8e1b1ae0dfbe..1c75e6ec6024c3e26f773dd595885be5b5c9d943 100644 (file)
@@ -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.
 
index 95f73b569521c5b0313457eb5bda07ce24b65403..af97ca83e6e1b089172eb4b8b2b4c1e9c5e981af 100644 (file)
@@ -292,7 +292,9 @@ act as a paragraph-separator."
 
 (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)