From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Eli Zaretskii <eliz@gnu.org>
Newsgroups: gmane.emacs.bugs
Subject: bug#66764: 29.1;
 Emacs scrolls for "(goto-char (point-max))" instead of jumping
Date: Sat, 04 Nov 2023 10:29:49 +0200
Message-ID: <83cywp6hvm.fsf@gnu.org>
References: <ddf1fc8b-2e31-4b2e-8da6-845031ac4171@gmail.com>
 <83jzr9fdh0.fsf@gnu.org> <807a1bd5-6477-cc36-088f-efcb782ccb99@gmail.com>
 <83a5s4fwih.fsf@gnu.org> <831qdgftja.fsf@gnu.org>
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="29275"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: 66764@debbugs.gnu.org, geza.herman@gmail.com
To: gregory@heytings.org
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 04 09:30:39 2023
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
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 <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1qzC3D-0007Rg-1P
	for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Nov 2023 09:30:39 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1qzC31-00061A-Fj; Sat, 04 Nov 2023 04:30:27 -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 <Debian-debbugs@debbugs.gnu.org>)
 id 1qzC2z-00060t-SQ
 for bug-gnu-emacs@gnu.org; Sat, 04 Nov 2023 04:30:25 -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 <Debian-debbugs@debbugs.gnu.org>)
 id 1qzC2z-0005Ru-KA
 for bug-gnu-emacs@gnu.org; Sat, 04 Nov 2023 04:30:25 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1qzC3Z-0007jA-J3
 for bug-gnu-emacs@gnu.org; Sat, 04 Nov 2023 04:31:01 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Eli Zaretskii <eliz@gnu.org>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Sat, 04 Nov 2023 08:31:01 +0000
Resent-Message-ID: <handler.66764.B66764.169908663429659@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 66764
X-GNU-PR-Package: emacs
Original-Received: via spool by 66764-submit@debbugs.gnu.org id=B66764.169908663429659
 (code B ref 66764); Sat, 04 Nov 2023 08:31:01 +0000
Original-Received: (at 66764) by debbugs.gnu.org; 4 Nov 2023 08:30:34 +0000
Original-Received: from localhost ([127.0.0.1]:60507 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1qzC37-0007iJ-SP
 for submit@debbugs.gnu.org; Sat, 04 Nov 2023 04:30:34 -0400
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56360)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@gnu.org>) id 1qzC36-0007i7-Jp
 for 66764@debbugs.gnu.org; Sat, 04 Nov 2023 04:30:32 -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 <eliz@gnu.org>)
 id 1qzC2R-00055L-7n; Sat, 04 Nov 2023 04:29:51 -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=Oayva0HF1d4CYcekUc1KbCXSbksg4mz3d67lvG5vIOc=; b=YKwB3QGHEeHU
 Tec25Yvah0zgQpQXY9EEB/4LoI6M4lofgLDro9psbLtp7QMZR2I0GOIKODBbvMdhetC/rLdyIF3eB
 UUEPfqzLVfkr1swBqbpD152wFcRR6siXrjh6GtxKnvvGMyKM+YhpPebnzq44RYworRW5H0zdUkmkB
 wM7RMm7lM9NtPqRioDBqwWmjQKpZGeOJwgvJNWW28ZvOIyEGIkkCruAtgHlu0dpBDf4EpVVz1EBSk
 na48J8Jesx97t+24UxsICHmgh1+OQjigZzrb9RNkf6rgh5qNRf+chtsR7jLM+Kf/mhFFVGBekhjnH
 uGA03piSAvgOIVi2Dce0dA==;
In-Reply-To: <831qdgftja.fsf@gnu.org> (message from Eli Zaretskii on Fri, 27
 Oct 2023 09:50:33 +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" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=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:273755
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/273755>

Ping!  Gregory, could you please look into this?

> Cc: Gregory Heytings <gregory@heytings.org>, 66764@debbugs.gnu.org
> Date: Fri, 27 Oct 2023 09:50:33 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> 
> OK, I think I see the root cause of the problem: it's your
> font-lock-keywords setting, viz.:
> 
>  (font-lock-add-keywords nil '(((lambda (bound)) (1 'error prepend t))) t)
> 
> Without this setting, everything works as expected, and goto-char goes
> to the EOB almost instantaneously, even when scroll-conservatively is
> set to a large value.
> 
> AFAIU, the font-lock-keywords setting above causes the display engine
> to call this function every time it moves across some chunk of text,
> which slows down redisplay.  This shows with scroll-conservatively set
> to a large value because Emacs then attempts to find the minimum
> amount of scrolling the screen in order to bring point into the view.
> 
> It is a known fact that modes which use advanced font-lock settings
> should adapt to the long-line situation (when the function
> long-line-optimizations-p returns non-nil), so I think you should
> modify your font-lock settings to avoid this problem in that case.
> 
> CC'ing Gregory in case I missed something in this scenario.
> 
> 
> 
>