From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#70386: 30.0.50; (recenter 0 t) does not put point on top of the window Date: Sat, 27 Apr 2024 11:29:25 +0300 Message-ID: <86plubw6my.fsf@gnu.org> References: <87v84jrjir.fsf@localhost> <864jc3n510.fsf@gnu.org> <87plurrb2z.fsf@localhost> <86wmoyk3m4.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6099"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yantar92@posteo.net, 70386@debbugs.gnu.org To: luangruo@yahoo.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 27 10:31:16 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1s0dSm-0001QD-MH for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 Apr 2024 10:31:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s0dSX-00077s-RT; Sat, 27 Apr 2024 04:31:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s0dSS-00077H-R2 for bug-gnu-emacs@gnu.org; Sat, 27 Apr 2024 04:30:59 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s0dSS-00029L-I4 for bug-gnu-emacs@gnu.org; Sat, 27 Apr 2024 04:30:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s0dSk-0007M9-IB for bug-gnu-emacs@gnu.org; Sat, 27 Apr 2024 04:31:14 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Apr 2024 08:31:12 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70386 X-GNU-PR-Package: emacs Original-Received: via spool by 70386-submit@debbugs.gnu.org id=B70386.171420661427705 (code B ref 70386); Sat, 27 Apr 2024 08:31:12 +0000 Original-Received: (at 70386) by debbugs.gnu.org; 27 Apr 2024 08:30:14 +0000 Original-Received: from localhost ([127.0.0.1]:38882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s0dRe-0007Ba-0I for submit@debbugs.gnu.org; Sat, 27 Apr 2024 04:30:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40496) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s0dRR-00077n-7x for 70386@debbugs.gnu.org; Sat, 27 Apr 2024 04:30:00 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s0dR1-0001lr-Hp; Sat, 27 Apr 2024 04:29:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=TuEt8BxhweBQrGd5w8+pXXlWkRqc5gwX5b2rjgh07V8=; b=j9p+MgmMsbZt FmF+9xYc4OFYcWTOrxk7eVRB3fOPtIU5QMuChAcx52tlks/P70IMw2/ZtIKgugszZiOTW1DYWmtiY GraVrFamr+/49XRI23ixkxfGRwi4GeXh5kc79N0Dr4vdOiqPTUeVFwaeti3d4Vc0p/k5ftv07k8wv cqx2QYvJSTH7tfaRXvbQ7q+aNlYOdYUlDhrVKlB/601nqHFZy8/vBGVZxudHh2zzdFQb3nSmijD43 mo4JE3CEoT0z8B0VVdr99zdaJky45rTiVnHyJIiqGt88rICi1WadJ77LOxVHNaq/i3KAHOAZWPTtP ZF0Jb1p0KZTMU8q1JsA3+A==; In-Reply-To: <86wmoyk3m4.fsf@gnu.org> (message from Eli Zaretskii on Mon, 15 Apr 2024 19:11:31 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:284020 Archived-At: Ping! Po Lu, could you please look into this issue? > Cc: 70386@debbugs.gnu.org > Date: Mon, 15 Apr 2024 19:11:31 +0300 > From: Eli Zaretskii > > > From: Ihor Radchenko > > Cc: 70386@debbugs.gnu.org > > Date: Sun, 14 Apr 2024 19:36:04 +0000 > > > > Eli Zaretskii writes: > > > > >> 1. emacs -Q > > >> 2. Insert the following into scratch buffer and put point at "recenter" > > > > > > Which "recenter": the one in the comment or the one in (recenter 0 t) ? > > > > The "(recenter 0 t))" line. > > > > >> (progn > > >> (require 'pixel-scroll) > > >> (pixel-scroll-precision-interpolate > > >> (* -1 (line-pixel-height) > > >> (max 0 (- (count-screen-lines (window-start) (point)) 2))) > > >> nil 1) > > >> ;; Call original recenter for final adjustment. > > >> (recenter 0 t)) > > >> > > >> 3. M-x eval-buffer > > >> 4. Observe that scroll is not set to line 0, despite calling `recenter' > > > > > > I don't think I understand what you mean by "scroll is not set to line > > > 0". Please explain in more detail what you expected to happen (and > > > why), and what did happen. > > > > Expected is as per docstring: > > > > With a numeric prefix argument ARG, recenter putting point on screen line ARG > > relative to the selected window. > > > > So, I expect that (recenter 0 t) will put the line at point on top of > > the window and that (recenter 1 t) will put the line at point at the > > second top line. > > > > My expectation is met when I simply do emacs -Q M-: (recenter 0 t) or > > emacs -Q M-: (recenter 1 t) on master. > > > > Observed: > > > > 1. Line at point slowly scrolls up until it reaches top of the window > > (`pixel-scroll-precision-interpolate' call) > > > > 2. Line at point is reset back to its initial scroll position > > (`recenter' call) > > What is the "initial scroll position" in this case? > > > Sometimes, I also observe line at point moving beyond the screen. > > It's inconsistent in my testing: sometimes works as I'd expect, and > sometimes ends up with window's vscroll that is very small: about 1 > screen line. > > Po Lu, could you please look into this? Something in > pixel-scroll-precision-interpolate is randomly misbehaving, at least > on my system. Since all of this stuff is extremely fragile, it's > possible that one of the recent changes in xdisp.c broke it somehow. > But the behavior is not consistent, so I wonder what could cause that. > > > >