summaryrefslogtreecommitdiff
path: root/lisp/textmodes/fill.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@jurta.org>2005-12-30 05:59:16 +0000
committerJuri Linkov <juri@jurta.org>2005-12-30 05:59:16 +0000
commit74f36ff05e066416c196b01e253f5652594879dd (patch)
treee4aaa49ee544cbd70f7e8e9b79b1e00dbf6ec156 /lisp/textmodes/fill.el
parent2122c750912845e57de82470dd72627dd66744d9 (diff)
downloademacs-74f36ff05e066416c196b01e253f5652594879dd.tar.gz
emacs-74f36ff05e066416c196b01e253f5652594879dd.tar.bz2
emacs-74f36ff05e066416c196b01e253f5652594879dd.zip
(fill-single-word-nobreak-p): Use `sentence-end'.
Diffstat (limited to 'lisp/textmodes/fill.el')
-rw-r--r--lisp/textmodes/fill.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index ce95c6f026f..48defb7d786 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -291,12 +291,13 @@ 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 "[ \t]*\\sw+[ \t]*[.?!:][ \t]*$")
+ (or (looking-at (concat "[ \t]*\\sw+" "\\(?:" (sentence-end) "\\)"))
(save-excursion
(skip-chars-backward " \t")
(and (/= (skip-syntax-backward "w") 0)
(/= (skip-chars-backward " \t") 0)
- (/= (skip-chars-backward ".?!:") 0)))))
+ (/= (skip-chars-backward ".?!:") 0)
+ (looking-at (sentence-end))))))
(defun fill-french-nobreak-p ()
"Return nil if French style allows breaking the line at point.