emacs-diffs
[Top][All Lists]
Advanced

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

master f740bec: Correct patch from 2021-11-12 on src/fileio.c


From: Alan Mackenzie
Subject: master f740bec: Correct patch from 2021-11-12 on src/fileio.c
Date: Sat, 13 Nov 2021 08:02:13 -0500 (EST)

branch: master
commit f740becf8ad1fdd992fb509edb10ff041f163c8f
Author: Alan Mackenzie <acm@muc.de>
Commit: Alan Mackenzie <acm@muc.de>

    Correct patch from 2021-11-12 on src/fileio.c
    
    * src/fileio.c (restore_window_points): Reverse commit
    974192413f8a81171b8fd28dfd5c081ce06d3dec and instead replace a < by a <=.
    This ensures that if w->mpoint is at the top of the middle region being
    replaced, it gets adjusted and stays at the top after the reinsertion.
---
 src/fileio.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/fileio.c b/src/fileio.c
index a7b1649..4015448 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3827,20 +3827,17 @@ restore_window_points (Lisp_Object window_markers, 
ptrdiff_t inserted,
        Lisp_Object car = XCAR (window_markers);
        Lisp_Object marker = XCAR (car);
        Lisp_Object oldpos = XCDR (car);
-       ptrdiff_t newpos;
        if (MARKERP (marker) && FIXNUMP (oldpos)
            && XFIXNUM (oldpos) > same_at_start
-           && XFIXNUM (oldpos) < same_at_end)
+           && XFIXNUM (oldpos) <= same_at_end)
          {
            ptrdiff_t oldsize = same_at_end - same_at_start;
            ptrdiff_t newsize = inserted;
            double growth = newsize / (double)oldsize;
-           newpos = same_at_start
-             + growth * (XFIXNUM (oldpos) - same_at_start);
+           ptrdiff_t newpos
+             = same_at_start + growth * (XFIXNUM (oldpos) - same_at_start);
+           Fset_marker (marker, make_fixnum (newpos), Qnil);
          }
-       else
-         newpos = XFIXNUM (oldpos);
-       Fset_marker (marker, make_fixnum (newpos), Qnil);
       }
 }
 



reply via email to

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