From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Josh Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <83wq813vyx.fsf@gnu.org> <83r3y84iuv.fsf@gnu.org> <831tq83xwq.fsf@gnu.org> Reply-To: josh+gnu@nispio.net NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1413473609 26965 80.91.229.3 (16 Oct 2014 15:33:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Oct 2014 15:33:29 +0000 (UTC) Cc: 18739@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 16 17:33:21 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Xen3J-00068p-E9 for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Oct 2014 17:33:21 +0200 Original-Received: from localhost ([::1]:50896 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xen3I-0000Kf-S8 for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Oct 2014 11:33:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xen38-0000D9-73 for bug-gnu-emacs@gnu.org; Thu, 16 Oct 2014 11:33:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xen30-0002ek-GY for bug-gnu-emacs@gnu.org; Thu, 16 Oct 2014 11:33:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54544) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xen30-0002eb-E4 for bug-gnu-emacs@gnu.org; Thu, 16 Oct 2014 11:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Xen2z-0001SK-JU for bug-gnu-emacs@gnu.org; Thu, 16 Oct 2014 11:33:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Josh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Oct 2014 15:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18739 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18739-submit@debbugs.gnu.org id=B18739.14134735625572 (code B ref 18739); Thu, 16 Oct 2014 15:33:01 +0000 Original-Received: (at 18739) by debbugs.gnu.org; 16 Oct 2014 15:32:42 +0000 Original-Received: from localhost ([127.0.0.1]:46108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xen2g-0001Rn-3J for submit@debbugs.gnu.org; Thu, 16 Oct 2014 11:32:42 -0400 Original-Received: from mail-lb0-f174.google.com ([209.85.217.174]:63529) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xen2c-0001RY-Qi for 18739@debbugs.gnu.org; Thu, 16 Oct 2014 11:32:39 -0400 Original-Received: by mail-lb0-f174.google.com with SMTP id p9so3050851lbv.33 for <18739@debbugs.gnu.org>; Thu, 16 Oct 2014 08:32:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:sender:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=Uchj/6vx6Wofvpbo83avLSZcXNZ5AsU1SxllTRIuMgo=; b=kXsmN/+yEOLP3oidsp6Zb/leOmVE2n99NZDkmV3+8U2VsuWa9nhhKhLSQl/yNlgiiN kv9UCLn1EABSGHf6XcOE+O9/xLuXnKy6RjoAM2hev49EsnNo4DbTekzZjW3ELRLO6svN oORkKlvnDnmVRoIkSpYJjOdq3/GazoqMB8kUBC8LnstFuR+CruD4g/RDTI2eGvipqdUd tiNsm2vii9z/B6jYtnofPJF9qa6as+O7U3AUrQFRI9LzXmF8q32+zdOpgz+2DWgaHQRM /eFKs4wwp0FXcbTT1YkYOUQaU1mqQ1vmASvfTrp0gbKsA5wX1ql9VD6PGE5ValRhcZoM fCaQ== X-Gm-Message-State: ALoCoQmV+wGwuTprPzsZOShlckGnDPQ4/nGoPgy1QRwR/OCgHPCIO8PzAd+qjhHKMSnGpMY4N9jf X-Received: by 10.112.221.226 with SMTP id qh2mr2462858lbc.5.1413473557560; Thu, 16 Oct 2014 08:32:37 -0700 (PDT) Original-Received: by 10.152.37.202 with HTTP; Thu, 16 Oct 2014 08:32:37 -0700 (PDT) X-Originating-IP: [98.225.99.138] In-Reply-To: X-Google-Sender-Auth: pJr1GwLPoLnQeWoCuDDeZ2-fsBw X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:94629 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 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