diff options
Diffstat (limited to 'lisp/textmodes/fill.el')
-rw-r--r-- | lisp/textmodes/fill.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 95f73b56952..514350119fe 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -89,7 +89,8 @@ reinserts the fill prefix in each resulting line." (defcustom adaptive-fill-regexp ;; Added `!' for doxygen comments starting with `//!' or `/*!'. ;; Added `%' for TeX comments. - (purecopy "[ \t]*\\([-!|#%;>*,A7$,1s"s#sC$,2"F(B]+[ \t]*\\|(?[0-9]+[.)][ \t]*\\)*") + ;; RMS: deleted the code to match `1.' and `(1)'. + "[ \t]*\\([-!|#%;>*,A7$,1s"s#sC$,2"F(B]+[ \t]*\\)*" "*Regexp to match text at start of line that constitutes indentation. If Adaptive Fill mode is enabled, a prefix matching this pattern on the first and second lines of a paragraph is used as the @@ -292,7 +293,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) |