changeset 81060:911e49c71332

(canonically-space-region): Make the second arg a marker if it's not already the case.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 24 May 2007 16:13:18 +0000
parents 255e52f43455
children a0c6ca9f4685
files lisp/ChangeLog lisp/textmodes/fill.el
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Thu May 24 06:25:50 2007 +0000
+++ b/lisp/ChangeLog	Thu May 24 16:13:18 2007 +0000
@@ -1,3 +1,8 @@
+2007-05-24  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* textmodes/fill.el (canonically-space-region): Make the second arg
+	a marker if it's not already the case.
+
 2007-05-23  Eli Zaretskii  <eliz@gnu.org>
 
 	* tar-mode.el (tar-header-block-summarize, tar-summarize-buffer)
--- a/lisp/textmodes/fill.el	Thu May 24 06:25:50 2007 +0000
+++ b/lisp/textmodes/fill.el	Thu May 24 16:13:18 2007 +0000
@@ -159,6 +159,11 @@
 and `sentence-end-without-period').
 Remove indentation from each line."
   (interactive "*r")
+  ;; Ideally, we'd want to scan the text from the end, so that changes to
+  ;; text don't affect the boundary, but the regexp we match against does
+  ;; not match as eagerly when matching backward, so we instead use
+  ;; a marker.
+  (unless (markerp end) (setq end (copy-marker end t)))
   (let ((end-spc-re (concat "\\(" (sentence-end) "\\) *\\|  +")))
     (save-excursion
       (goto-char beg)