* lisp/reposition.el (repos-count-screen-lines): Narrow without
changing point-min. It wasn't necessary for vertical-motion to
work, and it had some adverse effects on how font-lock rules were
applied
(https://lists.gnu.org/archive/html/emacs-devel/2019-11/msg00522.html).
This can also be an alternative fix for bug#38049.
;;; Auxiliary functions
+
;; Return number of screen lines between START and END.
(defun repos-count-screen-lines (start end)
(save-excursion
(save-restriction
- (narrow-to-region start end)
- (goto-char (point-min))
+ (narrow-to-region (point-min) end)
+ (goto-char start)
(vertical-motion (- (point-max) (point-min))))))
;; Return number of screen lines between START and END; returns a negative