From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tim Cross Newsgroups: gmane.emacs.devel Subject: Re: defadvice bug or something else? Date: Thu, 29 Apr 2021 14:22:45 +1000 Message-ID: References: <87fsz9swcf.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000008ef98d05c114d9e7" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20031"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs developers To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 29 06:23:52 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lbyDQ-000587-KX for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Apr 2021 06:23:52 +0200 Original-Received: from localhost ([::1]:50366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lbyDP-0005rq-OX for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Apr 2021 00:23:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbyCZ-0005Qz-Vx for emacs-devel@gnu.org; Thu, 29 Apr 2021 00:23:00 -0400 Original-Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]:34628) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lbyCY-0006ZQ-FA for emacs-devel@gnu.org; Thu, 29 Apr 2021 00:22:59 -0400 Original-Received: by mail-oi1-x22a.google.com with SMTP id r3so11907353oic.1 for ; Wed, 28 Apr 2021 21:22:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TH/yAkOBU+4oowtSEx5CR1MyNA6cxL5or90P2vULnfk=; b=PUfNjeThfesYbIr/xQzZCMXbCb0EI6MQORUCgb8MBSzFQGbEb87GzMnr2Ff+MtWSZq vnWWegqjh66BU8Jfa7GQa5qg43OuuRcLji4AxxumMrZxF84Fn7EX/KH0MhBrQSBbx9kT s/FJyxM9MPZZHt3WVCrx2VAmvZbxEgTK33xJl74Hnkod5q7CBEj0nyJq3xHn05/rqlfb BmcKVLiPBULEiwX6U/cHx1G9KgkgwXMD4zSc665cDYS8AcHQ6rwQsrs2Ikmm/DhVLg7M 1+DqdBqe2rWHUeJQfYs3UHF+f6nQD5tR10pqrHllQez+fo2XSM93wCfxm8YKgFEFL0iN efWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TH/yAkOBU+4oowtSEx5CR1MyNA6cxL5or90P2vULnfk=; b=N1iwbL+e8w6sPr2XGt+ykTcSdxIZ/WF7hnESPeLE3aFtswmjRW/WYVbeTurCHZ4XgP hu4w9PTJvMXcybXSDEk3qteh/fu94Xk/XpAtZBhLI86cbMe1wvAw2m5g7QBlpgjqrjRe FmU+XdQBho1SnFsfD0ABaJqg4hgVlpt4M5OYO0vn2300OnkWQxVPrRZBApphF2ms+ONU mBjJWb8cp66YRN716jElYz2+wa3KknQeJN/RbeGmYGGcnxwAbHzTPJQYqzIi/rqTwWYy cYiwJ1qM0+Gd14SOY2iyqgl2NMyzKX0KViKc8OHFwQmitD0H4gulY/G5DZx1pi4VyeW7 mFQQ== X-Gm-Message-State: AOAM533F24hXDAqkBNezJxsdnJ8vCxnr7QENi9Lla7m6tFyxa3T9RIwc vqF9FQGhoQwLFgCUHsUlzICz0cwg/tAGJIg8SHQ= X-Google-Smtp-Source: ABdhPJxAACIg0MH+UB2pfC1TBCC5cZ37vXwffl/GBcuv7S/DXqk78NnD2PJrCSOIyUpCXWhsFOphxfP6vht92gBLxnk= X-Received: by 2002:aca:e141:: with SMTP id y62mr13909428oig.146.1619670177084; Wed, 28 Apr 2021 21:22:57 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::22a; envelope-from=theophilusx@gmail.com; helo=mail-oi1-x22a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:268599 Archived-At: --0000000000008ef98d05c114d9e7 Content-Type: text/plain; charset="UTF-8" On Thu, 29 Apr 2021 at 12:07, Stefan Monnier wrote: > > `(defadvice ,f (after emacspeak pre act comp) > > (message "scroll advice: start = %d end = %d diff = %d" > > (window-start) > > (window-end) > > (- (window-end) (window-start)))))) > > I think this may return outdated values for `window-end` because it is > run before the window end position has been recomputed by redisplay. > If that's not what you want, then you need to pass non-nil value for the > `update` argument. > > Thanks Stefan, you nailed it. That was exactly the problem. I should have spotted it when I checked the docs for window-end. regards, Tim -- Tim Cross --0000000000008ef98d05c114d9e7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Thu, 29 Apr 2021 at 12:07, Stefan = Monnier <monnier@iro.umontre= al.ca> wrote:
>=C2=A0 =C2=A0`(defadvice ,f (after emacspeak pre act comp)
>=C2=A0 =C2=A0 =C2=A0 (message "scroll advice: start =3D %d end =3D= %d diff =3D %d"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(window-start) >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(window-end)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(- (window-end) = (window-start))))))

I think this may return outdated values for `window-end` because it is
run before the window end position has been recomputed by redisplay.
If that's not what you want, then you need to pass non-nil value for th= e
`update` argument.


Thanks Stefan, you nailed it. Th= at was exactly the problem. I should have spotted it when I checked the doc= s for window-end.=C2=A0

regards,

Tim

--
Tim Cross

--0000000000008ef98d05c114d9e7--