all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: josh+gnu@nispio.net, 18739@debbugs.gnu.org
Subject: bug#18739: 24.3; Request for a hook to be provided when scrolling will move the cursor
Date: Fri, 17 Oct 2014 16:16:05 +0300	[thread overview]
Message-ID: <83y4se25wq.fsf@gnu.org> (raw)
In-Reply-To: <jwvppdqkg7c.fsf-monnier+emacsbugs@gnu.org>

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: josh+gnu@nispio.net,  18739@debbugs.gnu.org
> Date: Fri, 17 Oct 2014 09:04:05 -0400
> 
> > I'm not sure I get your point.  But if you mean to say something that
> > is already said in the doc string, i.e.
> 
> >   List of functions to call before redisplaying a window with scrolling.
> >   [...] Note that these functions are also called by `set-window-buffer'.
> 
> > then I'm okay with that.
> 
> No, I'm trying to find a definition that justifies *why*
> set-window-buffer runs the hook.  `set-window-buffer' changes the
> window-start marker to point into another buffer (except when
> set-window-buffer is basically a no-op)

But set-window-buffer is not a no-op when the buffer doesn't change.
Moreover, saying that window-scroll-functions will be called when the
window-start marker changes will miss those calls when it didn't, and
yet set-window-buffer still called the hook.

Maybe we should refrain from calling window-scroll-functions when the
buffer doesn't change.

> saying "the hook is run whenever the window-start marker is
> modified" does explain why set-window-buffer should run the hook.
> It also explains why split-window should run the hook.

If you mean the fact that a new marker is created for the new window,
then yes; but that's a technicality that will not be obvious to
semi-naive readers of the documentation, and will probably be
unexpected by at least some of them.

So either we say that explicitly in the doc string, or we should
change split-window-internal not to call the hook.  (Can you explain
why calling it in split-window-internal might be useful?)

> > I don't like this "conclusion", because it can be interpreted as
> > meaning that moving the window-start marker _causes_
> > window-scroll-functions to be called.
> 
> No, it just means that moving the marker creates the need for Emacs to run
> the hook.

That's not what "iff" usually means.  Moreover, we could modify the
code to do one, but not the other in some cases.  They are unrelated.

> > If the window's force_start flag is set when redisplay is entered,
> > then my reading of the code is that window-scroll-functions will be
> > called even if point doesn't have to move.
> 
> I'm not talking about calling window-scroll-functions, I'm talking about
> moving point (a bit further down in the redisplay_window function).

Well, of course point will be moved only if necessary.  But this
discussion is about the hook and when it is called, not about
adjusting point.

> > Maybe so, but (a) I again don't understand why the frequency matters,
> 
> It doesn't.  I was just pointing out that this is not the main place
> where scrolling moves point.

The issue we were discussing was the conditions under which the hook
is called, wasn't it?

> >> I'm not sure I understand.  If I want to catch all (i.e. exhaustively)
> >> cases where scrolling moves point, do you think that catching the
> >> redisplay_window case plus the window_scroll_pixel/line_based cases is
> >> all that's needed?
> > Yes, I think so.
> 
> OK, thanks,

So what, if anything, needs to be clarified in the docs?





  reply	other threads:[~2014-10-17 13:16 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-15 18:51 bug#18739: 24.3; Request for a hook to be provided when scrolling will move the cursor Josh
2014-10-15 20:43 ` Eli Zaretskii
2014-10-15 21:01   ` Josh
2014-10-15 21:08     ` Eli Zaretskii
2014-10-15 21:12       ` Josh Hunsaker
2014-10-15 21:27         ` Ivan Shmakov
2014-10-16  6:36         ` Eli Zaretskii
2014-10-16  7:15           ` Andreas Schwab
2014-10-16  7:33             ` Eli Zaretskii
2014-10-16  7:38               ` Andreas Schwab
2014-10-16  7:50                 ` Eli Zaretskii
2014-10-15 22:48   ` Stefan Monnier
2014-10-16  6:41     ` Eli Zaretskii
2014-10-16 13:44       ` Stefan Monnier
2014-10-16 13:53         ` Josh
2014-10-16 14:25           ` Eli Zaretskii
2014-10-16 14:35             ` Josh
2014-10-16 14:46               ` Eli Zaretskii
2014-10-16 14:58                 ` Josh
2014-10-16 15:00                   ` Eli Zaretskii
2022-04-27 18:45                   ` Lars Ingebrigtsen
2014-10-16 14:13         ` Eli Zaretskii
2014-10-16 15:13           ` Stefan Monnier
2014-10-16 15:32             ` Josh
2014-10-16 15:54             ` Eli Zaretskii
2014-10-16 19:28               ` Stefan Monnier
2014-10-16 20:28                 ` Eli Zaretskii
2014-10-16 21:24                   ` Stefan Monnier
2014-10-17  6:38                     ` Eli Zaretskii
2014-10-17 13:04                       ` Stefan Monnier
2014-10-17 13:16                         ` Eli Zaretskii [this message]
2014-10-17 17:02                           ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=83y4se25wq.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=18739@debbugs.gnu.org \
    --cc=josh+gnu@nispio.net \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.