changeset 25606:7ab723e4a21a

(fill-region-as-paragraph, canonically-space-region): Respect colon-double-space at end of line.
author Richard M. Stallman <rms@gnu.org>
date Wed, 08 Sep 1999 07:50:19 +0000
parents d1251e911451
children e1f5592218c1
files lisp/textmodes/fill.el
diffstat 1 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/fill.el	Wed Sep 08 07:41:52 1999 +0000
+++ b/lisp/textmodes/fill.el	Wed Sep 08 07:50:19 1999 +0000
@@ -175,12 +175,15 @@
     ;; Make sure sentences ending at end of line get an extra space.
     ;; loses on split abbrevs ("Mr.\nSmith")
     (goto-char beg)
-    (while (and (< (point) end)
-		(re-search-forward "[.?!][])}\"']*$" end t))
+    (let ((eol-double-space-re (if colon-double-space
+                                   "[.?!:][])}\"']*$"
+                                 "[.?!][])}\"']*$")))
+      (while (and (< (point) end)
+                (re-search-forward eol-double-space-re end t))
       ;; We insert before markers in case a caller such as
       ;; do-auto-fill has done a save-excursion with point at the end
       ;; of the line and wants it to stay at the end of the line.
-      (insert-before-markers-and-inherit ? ))))
+      (insert-before-markers-and-inherit ? )))))
 
 (defun fill-context-prefix (from to &optional first-line-regexp)
   "Compute a fill prefix from the text between FROM and TO.
@@ -422,8 +425,11 @@
 
 	  ;; Make sure sentences ending at end of line get an extra space.
 	  ;; loses on split abbrevs ("Mr.\nSmith")
-	  (while (re-search-forward "[.?!][])}\"']*$" nil t)
-	    (or (eobp) (insert-and-inherit ?\ )))
+          (let ((eol-double-space-re (if colon-double-space
+                                         "[.?!:][])}\"']*$"
+                                       "[.?!][])}\"']*$")))
+            (while (re-search-forward eol-double-space-re nil t)
+              (or (eobp) (insert-and-inherit ?\ ))))
 
 	  (goto-char from)	  
 	  (if enable-multibyte-characters