changeset 38715:06ad87abb7a4

(forward-sentence): Avoid building a regexp from sentence-end. From Kenichi Handa <handa@etl.go.jp>.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 07 Aug 2001 09:57:07 +0000
parents d0fff85bebaa
children 950c1c407830
files lisp/textmodes/paragraphs.el
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/paragraphs.el	Tue Aug 07 09:47:06 2001 +0000
+++ b/lisp/textmodes/paragraphs.el	Tue Aug 07 09:57:07 2001 +0000
@@ -369,10 +369,12 @@
   (or arg (setq arg 1))
   (let ((opoint (point)))
     (while (< arg 0)
-      (let ((par-beg (save-excursion (start-of-paragraph-text) (point))))
-       (if (re-search-backward (concat "\\(" sentence-end "\\)[^ \t\n]")
-			       par-beg t)
-	   (goto-char (1- (match-end 0)))
+      (let ((pos (point))
+	    (par-beg (save-excursion (start-of-paragraph-text) (point))))
+       (if (and (re-search-backward sentence-end par-beg t)
+		(or (< (match-end 0) pos)
+		    (re-search-backward sentence-end par-beg t)))
+	   (goto-char (match-end 0))
 	 (goto-char par-beg)))
       (setq arg (1+ arg)))
     (while (> arg 0)