unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Gergely Risko <gergely@risko.hu>
To: emacs-devel@gnu.org
Subject: Re: find-file-hook, recenter, scroll-conservatively and save-place
Date: Thu, 31 Jan 2019 23:45:49 +0100	[thread overview]
Message-ID: <87r2cstpia.fsf@errge.nilcons.com> (raw)
In-Reply-To: 878sz0o9nd.fsf@mail.linkov.net

On 2019-01-31 22:57 (Thursday), Juri Linkov <juri@jurta.org> 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	other threads:[~2019-01-31 22:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-31  9:46 find-file-hook, recenter, scroll-conservatively and save-place Gergely Risko
2019-01-31 13:46 ` Gergely Risko
2019-01-31 14:43   ` Eli Zaretskii
2019-01-31 15:31     ` Gergely Risko
2019-01-31 13:49 ` martin rudalics
2019-01-31 14:32   ` Eli Zaretskii
2019-01-31 18:44     ` martin rudalics
2019-01-31 23:47       ` Gergely Risko
2019-02-01  9:05         ` martin rudalics
2019-01-31 20:57   ` Juri Linkov
2019-01-31 22:45     ` Gergely Risko [this message]
2019-02-01  9:05       ` martin rudalics
2019-02-02 21:03       ` Juri Linkov
2019-02-03 20:18         ` Juri Linkov
2019-02-01  9:04     ` martin rudalics
2019-02-01 11:18       ` Gergely Risko
2019-02-02  9:30         ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r2cstpia.fsf@errge.nilcons.com \
    --to=gergely@risko.hu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).