]> git.eshelyaron.com Git - emacs.git/commitdiff
(canonically-space-region): Make the second arg
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 25 May 2007 15:00:22 +0000 (15:00 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 25 May 2007 15:00:22 +0000 (15:00 +0000)
a marker if it's not already the case.

lisp/textmodes/fill.el

index 85b16931ec800e141e76db03117c5d0aa589e3ac..4e45c164ae832de26634ab32d5fb01db3215277e 100644 (file)
@@ -159,6 +159,11 @@ Leave one space between words, two at end of sentences or after colons
 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)