emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 6a2a371: (repos-count-screen-lines): Narrow without changing poin


From: Dmitry Gutov
Subject: master 6a2a371: (repos-count-screen-lines): Narrow without changing point-min
Date: Thu, 14 Nov 2019 16:44:13 -0500 (EST)

branch: master
commit 6a2a371c288a13060c44fa1af3ab73db611705a4
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    (repos-count-screen-lines): Narrow without changing point-min
    
    * 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.
---
 lisp/reposition.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/reposition.el b/lisp/reposition.el
index 22f9986..111bc08 100644
--- a/lisp/reposition.el
+++ b/lisp/reposition.el
@@ -170,12 +170,13 @@ first comment line visible (if point is in a comment)."
 
 ;;; 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]