[Top][All Lists]

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

bug#34038: 26.1; set-window-start sometimes fails to set window start

From: Eli Zaretskii
Subject: bug#34038: 26.1; set-window-start sometimes fails to set window start
Date: Fri, 11 Jan 2019 15:36:13 +0200

> From: Markus Triska <address@hidden>
> Cc: address@hidden
> Date: Fri, 11 Jan 2019 13:20:33 +0100
> Eli Zaretskii <address@hidden> writes:
> > I think this happens because you call set-window-start with last
> > argument non-nil.  Doing that tells the display engine that the
> > window-start point is just a suggestion, not a hard requirement.
> In the documentation of set-window-start, the last argument is described
> as:
>     Optional third arg NOFORCE non-nil inhibits next redisplay from
>     overriding motion of point in order to display at this exact start.
> >From this text, this seems to be precisely what I need: I want to retain
> point at this exact place, and I only want to change the window start,
> not the point. In my use case, if I set this argument to "nil", then I
> get unexpected point motion.

If displaying the window at the start point you request means point
will be outside of the window (or in the window margins, if you set
them), then redisplay has no alternative but move point to bring it
back into view.  If you prevent that, redisplay will not move point,
but it will also not necessarily obey the window-start value.

IOW, if there's a contradiction between the requested window-start and
showing point, the latter always wins in Emacs.

> Is there a way to reliably set window point while at the same time
> preventing motion of point?

How can you expect Emacs to do something like that?  It cannot
possibly do something that will leave point not displayed, can it?

reply via email to

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