aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorStefan Monnier2001-06-25 19:20:15 +0000
committerStefan Monnier2001-06-25 19:20:15 +0000
commitda197e75714dbaf12fc008adfab59644600359e6 (patch)
tree6aa8d5b11f6f61437711b5ea0cedd737563019f7 /lisp/textmodes
parent80de57df35a9319c21526203f9410dccab354b91 (diff)
downloademacs-da197e75714dbaf12fc008adfab59644600359e6.tar.gz
emacs-da197e75714dbaf12fc008adfab59644600359e6.zip
(fill-region-as-paragraph): Don't look further back than LINEBEG.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/fill.el19
1 files changed, 10 insertions, 9 deletions
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 984c945525a..033435f97bd 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -527,15 +527,16 @@ space does not end a sentence, so don't break a line there."
527 ;; further fills will assume it ends a sentence. 527 ;; further fills will assume it ends a sentence.
528 ;; If we now know it does not end a sentence, 528 ;; If we now know it does not end a sentence,
529 ;; avoid putting it at the end of the line. 529 ;; avoid putting it at the end of the line.
530 (while (or (and sentence-end-double-space 530 (while (and (> (point) linebeg)
531 (> (point) (+ linebeg 2)) 531 (or (and sentence-end-double-space
532 (eq (preceding-char) ?\ ) 532 (> (point) (+ linebeg 2))
533 (not (eq (following-char) ?\ )) 533 (eq (preceding-char) ?\ )
534 (eq (char-after (- (point) 2)) ?\.) 534 (not (eq (following-char) ?\ ))
535 (progn (forward-char -2) t)) 535 (eq (char-after (- (point) 2)) ?\.)
536 (and fill-nobreak-predicate 536 (progn (forward-char -2) t))
537 (funcall fill-nobreak-predicate) 537 (and fill-nobreak-predicate
538 (skip-chars-backward " \t"))) 538 (funcall fill-nobreak-predicate)
539 (skip-chars-backward " \t"))))
539 (if (re-search-backward " \\|\\c|.\\|.\\c|" linebeg 0) 540 (if (re-search-backward " \\|\\c|.\\|.\\c|" linebeg 0)
540 (forward-char 1))) 541 (forward-char 1)))
541 ;; If the left margin and fill prefix by themselves 542 ;; If the left margin and fill prefix by themselves