changeset 77808:c97a9221b6b8

(canonically-space-region): Make the second arg a marker if it's not already the case.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 25 May 2007 15:00:22 +0000
parents fc440b23bfa3
children 20f40276359e
files lisp/textmodes/fill.el
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/fill.el	Fri May 25 07:18:28 2007 +0000
+++ b/lisp/textmodes/fill.el	Fri May 25 15:00:22 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)