Commit dde92ca6 authored by Richard M. Stallman's avatar Richard M. Stallman

(count-lines): Use save-match-data.

parent 125def1c
...@@ -321,6 +321,7 @@ that uses or sets the mark." ...@@ -321,6 +321,7 @@ that uses or sets the mark."
This is usually the number of newlines between them, This is usually the number of newlines between them,
but can be one more if START is not equal to END 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." and the greater of them is not at the start of a line."
(save-match-data
(save-excursion (save-excursion
(save-restriction (save-restriction
(narrow-to-region start end) (narrow-to-region start end)
...@@ -332,7 +333,7 @@ and the greater of them is not at the start of a line." ...@@ -332,7 +333,7 @@ and the greater of them is not at the start of a line."
(while (re-search-forward "[\n\C-m]" nil t 1) (while (re-search-forward "[\n\C-m]" nil t 1)
(setq done (+ 1 done))) (setq done (+ 1 done)))
done) done)
(- (buffer-size) (forward-line (buffer-size))))))) (- (buffer-size) (forward-line (buffer-size))))))))
(defun what-cursor-position () (defun what-cursor-position ()
"Print info on cursor position (on screen and within buffer)." "Print info on cursor position (on screen and within buffer)."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment