diff lisp/simple.el @ 2421:eb9815e0a71d

(count-lines): Use save-match-data.
author Richard M. Stallman <rms@gnu.org>
date Mon, 29 Mar 1993 19:09:05 +0000
parents cd01176e9dc5
children 11ca45403cf5
line wrap: on
line diff
--- a/lisp/simple.el	Mon Mar 29 15:48:02 1993 +0000
+++ b/lisp/simple.el	Mon Mar 29 19:09:05 1993 +0000
@@ -321,18 +321,19 @@
 This is usually the number of newlines between them,
 but can be one more if START is not equal to END
 and the greater of them is not at the start of a line."
-  (save-excursion
-    (save-restriction
-      (narrow-to-region start end)
-      (goto-char (point-min))
-      (if (eq selective-display t)
-	  (let ((done 0))
-	    (while (re-search-forward "[\n\C-m]" nil t 40)
-	      (setq done (+ 40 done)))
-	    (while (re-search-forward "[\n\C-m]" nil t 1)
-	      (setq done (+ 1 done)))
-	    done)
-	(- (buffer-size) (forward-line (buffer-size)))))))
+  (save-match-data
+    (save-excursion
+      (save-restriction
+	(narrow-to-region start end)
+	(goto-char (point-min))
+	(if (eq selective-display t)
+	    (let ((done 0))
+	      (while (re-search-forward "[\n\C-m]" nil t 40)
+		(setq done (+ 40 done)))
+	      (while (re-search-forward "[\n\C-m]" nil t 1)
+		(setq done (+ 1 done)))
+	      done)
+	  (- (buffer-size) (forward-line (buffer-size))))))))
 
 (defun what-cursor-position ()
   "Print info on cursor position (on screen and within buffer)."