all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Josh <josh+gnu@nispio.net>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 18739@debbugs.gnu.org
Subject: bug#18739: 24.3; Request for a hook to be provided when scrolling will move the cursor
Date: Thu, 16 Oct 2014 09:32:37 -0600	[thread overview]
Message-ID: <CADe+TVmgT4TiKNZ0E20Q+750NvbHYxBbGPJoOTJPph5GpfVyAA@mail.gmail.com> (raw)
In-Reply-To: <jwv8ukgrrbu.fsf-monnier+emacsbugs@gnu.org>

On Thu, Oct 16, 2014 at 9:00 AM, Eli Zaretskii wrote:
>> There are so many ways that this can happen that it is not possible to
>> advise every function that might do it.  It is possible that
>> window-scroll-functions will give me everything I need, but I haven't
>> had time to try it yet.  We can resume this conversation at such a
>> time, unless there is someone else who already knows that
>> window-scroll-functions will not work.
>
> Sorry, I thought you only wanted this with a few specific commands.
> AFAIR, you never mentioned anything but the mouse-wheel scroll.

Sorry if I was not clear.  The request in the original bug-report was actually:

> I want to be notified when an update to the display will force the location of
> `point' to change in the current buffer.

On Thu, Oct 16, 2014 at 9:13 AM, Stefan Monnier wrote:
> So, w.r.t the original question in the bug-report, we still don't have
> an answer.  Do you happen to know where is the C code that changes point
> (in response to scrolling) in the redisplay?

I think you may be confusing the bug-report with my question on
StackOverflow. :)

On Thu, Oct 16, 2014 at 9:13 AM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>>> Does that include the case where window-start is changed
>>> so as to follow point or is it only the cases where window-start was
>>> changed explicitly by a scrolling command?
>> Both.
>
> So, could we say that this hook is supposed to be run if and only if
> the window-start marker is changed?
>
> E.g. it is not called if the only change is that text has been inserted
> before window-start (hence the numeric value of window-start would be
> changed, but the marker still points to the same place).
>
> Of course, like most such hooks, it's OK if there are occasional false
> positives (i.e. the hook is run even unnecessarily).
>
> And as for "when" it is run: any time after the marker's modification
> and before updating the glyph matrices?  Is it run before or after
> computing the new mode-line (i.e. if the hook changes something that
> affects the mode-line, will that be reflected right away, or will it be
> delayed until the next redisplay)?
>
>>> - how could a window-scroll-function distinguish the 3 cases:
>>> "set-window-buffer", "used a scroll command", "moved point out of viewport".
>> I have no idea (but this is not exactly a question about the doc
>> string).
>
> So, w.r.t the original question in the bug-report, we still don't have
> an answer.  Do you happen to know where is the C code that changes point
> (in response to scrolling) in the redisplay?
>
>> Did the above clarifications help you?
>
> Yes, thanks.  I still don't really understand how/why follow-mode and
> em-smart.el work, tho.
>
>
>         Stefan





  reply	other threads:[~2014-10-16 15:32 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 [this message]
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
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=CADe+TVmgT4TiKNZ0E20Q+750NvbHYxBbGPJoOTJPph5GpfVyAA@mail.gmail.com \
    --to=josh+gnu@nispio.net \
    --cc=18739@debbugs.gnu.org \
    --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.