From: Stefan Monnier Date: Thu, 24 May 2007 16:13:18 +0000 (+0000) Subject: (canonically-space-region): Make the second arg X-Git-Tag: emacs-pretest-23.0.90~12566 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dff1336c122f3605a9437ecdfd0c50c5381872f9;p=emacs.git (canonically-space-region): Make the second arg a marker if it's not already the case. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f7e254153c3..98adf1a4da4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-05-24 Stefan Monnier + + * textmodes/fill.el (canonically-space-region): Make the second arg + a marker if it's not already the case. + 2007-05-23 Eli Zaretskii * tar-mode.el (tar-header-block-summarize, tar-summarize-buffer) diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 85b16931ec8..4e45c164ae8 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -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)