(fill-single-word-nobreak-p): Allow breaking before
last word, if it's not the end of the paragraph.
This commit is contained in:
parent
e959542d99
commit
4a3608f504
2 changed files with 6 additions and 1 deletions
|
@ -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.
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue