(fill-single-word-nobreak-p): Allow breaking before

last word, if it's not the end of the paragraph.
This commit is contained in:
Stefan Monnier 2006-09-06 16:35:18 +00:00
parent e959542d99
commit 4a3608f504
2 changed files with 6 additions and 1 deletions

View 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.

View 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)