emacs-devel
[Top][All Lists]
Advanced

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

Re: find-file-hook, recenter, scroll-conservatively and save-place


From: Gergely Risko
Subject: Re: find-file-hook, recenter, scroll-conservatively and save-place
Date: Thu, 31 Jan 2019 23:45:49 +0100
User-agent: GNU Emacs with Gnus

On 2019-01-31 22:57 (Thursday), Juri Linkov <address@hidden> writes:
> Interesting question.  Maybe introduce two new buffer-local variables
> 'window-point' and 'window-start' that a hook could set and then
> display-buffer could read and call functions window-point and window-start?
> These buffer-local values should be used only once and should be reverted
> to nil after the first use.

I start to understand the approach proposed by you and Martin.  This
buffer-local variable approach feels natural and OK to me.

Martin also said this:

>> When 'display-buffer' finds a '(window-start . recenter) ALIST entry
>> it would call 'recenter' after assigning the window buffer.

Just one point to this: should we have '(window-start . (recenter 10))
also, where 10 is the ARG for the future recenter call?

> BTW, a related question: should save-place save window-start as well?
> It should be easy to implement after this problem is solved.

I think that would be nice and there is only one corner case I think
we have to take care of: recentf is a long term operation compared to
switch-to-buffer-preserve-window-point in the sense that when the user
comes back after days maybe he is sitting in front of a different
sized screen with differently configured frames and windows.
Therefore we have to give precedence to the point and take the
window-start recommendation of save-place with a grain of salt.  As
far as I can understand it now, fortunately this is done for us
already by redisplay for free.

Gergely




reply via email to

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