unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Alan Mackenzie <acm@muc.de>
Cc: 32874@debbugs.gnu.org
Subject: bug#32874: Unwanted scrolling in edebug `f' command when follow-mode is active
Date: Sun, 30 Sep 2018 10:35:50 +0300	[thread overview]
Message-ID: <837ej35tex.fsf@gnu.org> (raw)
In-Reply-To: <20180929204113.GF5008@ACM> (message from Alan Mackenzie on Sat,  29 Sep 2018 20:41:13 +0000)

> Date: Sat, 29 Sep 2018 20:41:13 +0000
> Cc: 32874@debbugs.gnu.org
> From: Alan Mackenzie <acm@muc.de>
> 
> > I'd actually urge you to have a good look at window-scroll-functions
> > as well.  (Follow mode already uses it, but I think it could use it
> > for quite a lot more.)  This hook is called when Emacs concludes that
> > a window may need to be scrolled to bring point into view.  This is
> > exactly where Follow mode wants to be able to affect the decision of
> > the display engine, right?  I think by making a few simple
> > changes/extensions where this hook is called, we could make the work
> > of Follow mode quite a lot easier, by letting it rely on the display
> > engine instead of trying to maneuver the display engine to do what it
> > wants.
> 
> I've had a look at window-scroll-functions, but I can't see what you
> must be seeing.  Currently, the documentation warns against trying to
> influence the scrolling, saying "it probably won't work anyway".

But you don't want to scroll yourself, you just want to switch the
selected window and move point so that Emacs won't need to scroll.

AFAIU, follow-mode wants to kick in when point goes off the selected
window.  And the call to window-scroll-functions is exactly the place
where the display engine decides it needs to scroll the window, but
didn't actually scroll it yet.  So that looks like a good place to
have follow-mode do its thing.  We might need to add some simple
facility for follow-mode to use, so that it could signal the display
engine not to scroll the window.  Other than that, I think this
possibility is worth exploring.

The advantage of using window-scroll-functions is that
pre-redisplay-function is called much more frequently, in most cases
follow-mode will need to do nothing at all.  You probably already have
a logic for detecting when it should do something, but if you are
invoked from window-scroll-functions, most if not all of that logic
will be redundant.

> Maybe it would be relatively simple to introduce new functionality.
> Something like "scroll window so that window-end gets the given value".

I'm not sure I understand how this could help follow-mode.  Please
elaborate.





  reply	other threads:[~2018-09-30  7:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-29 14:09 bug#32874: Unwanted scrolling in edebug `f' command when follow-mode is active Alan Mackenzie
2018-09-29 14:35 ` Eli Zaretskii
2018-09-29 15:37   ` Alan Mackenzie
2018-09-29 16:09     ` Eli Zaretskii
2018-09-29 20:41       ` Alan Mackenzie
2018-09-30  7:35         ` Eli Zaretskii [this message]
2018-09-30 15:36           ` Alan Mackenzie
2018-09-30 17:17             ` Eli Zaretskii
2018-10-01 12:59               ` Alan Mackenzie
2018-10-01 13:52                 ` Eli Zaretskii
2018-09-30 14:45   ` Alan Mackenzie
2018-10-03 10:54     ` Alan Mackenzie

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=837ej35tex.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=32874@debbugs.gnu.org \
    --cc=acm@muc.de \
    /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).