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: Juri Linkov
Subject: Re: find-file-hook, recenter, scroll-conservatively and save-place
Date: Sun, 03 Feb 2019 22:18:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

>>> 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?
>
> Using one-off buffer-local variables will allow standard hooks
> like adding window-start-hook.

Alternatively, we could use a solution like in windmove-display-in-direction
that sets display-buffer-overriding-action with a lambda (in this case,
with some recentering) until the end of the current command.



reply via email to

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