GNU bug report logs - #66764
29.1; Emacs scrolls for "(goto-char (point-max))" instead of jumping

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Geza Herman <geza.herman@HIDDEN>; dated Thu, 26 Oct 2023 17:06:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 66764 <at> debbugs.gnu.org:


Received: (at 66764) by debbugs.gnu.org; 27 Oct 2023 09:44:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 27 05:44:10 2023
Received: from localhost ([127.0.0.1]:35091 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qwJNx-0000vr-RJ
	for submit <at> debbugs.gnu.org; Fri, 27 Oct 2023 05:44:10 -0400
Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]:52408)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <geza.herman@HIDDEN>) id 1qwJNv-0000vc-9x
 for 66764 <at> debbugs.gnu.org; Fri, 27 Oct 2023 05:44:08 -0400
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-9bdf5829000so300213566b.0
 for <66764 <at> debbugs.gnu.org>; Fri, 27 Oct 2023 02:43:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1698399810; x=1699004610; darn=debbugs.gnu.org;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :from:to:cc:subject:date:message-id:reply-to;
 bh=9bRN2Nz5NdrfaeguNEhHj59H5k8VhU0Jnh1y0yVdi3A=;
 b=QoVvjYtPNL1iTE5sT9Ikh+ayw+quwOMLmnRrqLwIIq01TuaJqMYsDVwR0tGrNzT0tQ
 oZwCX8BexjxqGDP9j8HuY9OVLn2RfRoJMr9rsH3gU6QfM60cPrPTJ6ghvKUw7FVN9NP5
 1XTmWZPZ5Nt5ILO8VKrhCKqugyQZpnIADcNgaTJZ43okSDnRdQeCUzi973UgAb/LTlQm
 ulFnrq4ef0re17NPhNwj/+rQycfO57NHGE7sW58bM+lbUK+yO5BJO086V637KlAoYiJ5
 5kar58222CGi08yuc90pZFRizYA4Orsj2xiEUQzyLWetOSCbv8YFVmsSxkzjlft8oGzP
 lHMA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1698399810; x=1699004610;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=9bRN2Nz5NdrfaeguNEhHj59H5k8VhU0Jnh1y0yVdi3A=;
 b=UoC1u9mC2uXRSLpSEVE8h/ddt6+2aWzfD6nS0eUOqrLPV3SkO23IkYCrlJD/3doBTK
 SRxJJOTHtH46rPm4IiuU74+mKZfL6uE5FAY2k7VjG0g8WJBOhzu48S+no30o91fY6UJa
 Fou0n+NSdhdFelDRmjzetFO1nRlBRUq5rcJFbQ/OBIICdgBzwxJpq2NxScbyswpjrh2Y
 eDsRJDI28WFrpoDt5vv8ihlt8haY30H7BcOIJ0PdmEntsfNqIfoJiHOFcs2C62Qg3og4
 0IbCOfmMq26Vqm1LN4ybjlVYGiZNXx/skAyO8Q7ShnqTROyWsl8/7skuCwMn0bSXnv8K
 46Lg==
X-Gm-Message-State: AOJu0YxqiughH6qR9f77leAnX48nkWtpROTXlfaYGrq0vqQoWMfHWxdb
 1aNd2xEdZtVlSzlXQSIptQhUf9SVjF4=
X-Google-Smtp-Source: AGHT+IGvj3RyLReUTdRX4uVpD/C9IMp0FZQvgFjGCwDzMUeYc85+gXoz0kPXR5Xlu6YgX0WtqWdWWg==
X-Received: by 2002:a17:906:daca:b0:9ae:3d17:d5d0 with SMTP id
 xi10-20020a170906daca00b009ae3d17d5d0mr1648106ejb.31.1698399809971; 
 Fri, 27 Oct 2023 02:43:29 -0700 (PDT)
Received: from [192.168.8.4] (netacc-gpn-4-226-97.pool.yettel.hu.
 [84.224.226.97]) by smtp.gmail.com with ESMTPSA id
 n11-20020a170906b30b00b00989828a42e8sm905253ejz.154.2023.10.27.02.43.28
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 27 Oct 2023 02:43:29 -0700 (PDT)
Message-ID: <289aa452-b1f1-f0fb-dcfe-496af2110a78@HIDDEN>
Date: Fri, 27 Oct 2023 11:43:28 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.2.1
Subject: Re: bug#66764: 29.1; Emacs scrolls for "(goto-char (point-max))"
 instead of jumping
Content-Language: sv-FI
To: Eli Zaretskii <eliz@HIDDEN>
References: <ddf1fc8b-2e31-4b2e-8da6-845031ac4171@HIDDEN>
 <83jzr9fdh0.fsf@HIDDEN> <807a1bd5-6477-cc36-088f-efcb782ccb99@HIDDEN>
 <83a5s4fwih.fsf@HIDDEN> <831qdgftja.fsf@HIDDEN>
From: =?UTF-8?Q?Herman=2c_G=c3=a9za?= <geza.herman@HIDDEN>
In-Reply-To: <831qdgftja.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -1.5 (-)
X-Debbugs-Envelope-To: 66764
Cc: Gregory Heytings <gregory@HIDDEN>, 66764 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.5 (--)



On 10/27/23 08:50, Eli Zaretskii wrote:
> 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.
As far as I understand, if the buffer is fully font-locked, then this 
function won't be called again, unless the buffer is modified. So this 
shouldn't be a problem. But even if this is not true, I've been using 
this setting for a long time, I didn't notice any performance problems 
with it.

> 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)
This setting comes from a package named hl-todo. I believe it is done 
this way so it only highlights TODO items which are in comments/strings. 
Maybe there is a better way to achieve this, I don't know.


> so I think you should
> modify your font-lock settings to avoid this problem in that case.
I turned off long-line optimizations instead, because it causes other 
problems as well (mentioned in my previous email).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66764; Package emacs. Full text available.

Message received at 66764 <at> debbugs.gnu.org:


Received: (at 66764) by debbugs.gnu.org; 27 Oct 2023 09:23:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 27 05:23:08 2023
Received: from localhost ([127.0.0.1]:35072 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qwJ3c-0000NM-1S
	for submit <at> debbugs.gnu.org; Fri, 27 Oct 2023 05:23:08 -0400
Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]:52301)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <geza.herman@HIDDEN>) id 1qwJ3W-0000Mo-OX
 for 66764 <at> debbugs.gnu.org; Fri, 27 Oct 2023 05:23:07 -0400
Received: by mail-ej1-x630.google.com with SMTP id
 a640c23a62f3a-9bdf5829000so296803366b.0
 for <66764 <at> debbugs.gnu.org>; Fri, 27 Oct 2023 02:22:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1698398545; x=1699003345; darn=debbugs.gnu.org;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :from:to:cc:subject:date:message-id:reply-to;
 bh=8hrG750Gl7hz/0UJIj+UYwYOLW77bHS/vbAuArCReSY=;
 b=lFnQFcXVS6OPPlbI6AUvNDvw/He7bN9NPQxVVEHbJMc2reddIgkueYP4TJ+U8hdlxP
 SfYxVBXfg1Wr9YsUggaJB1KHS8zsg7dIWXQ/akpPHha5ihRpzITsB98FvW3FFqnzcGRG
 XKRPDgucPFH130gt6a4xSYugkS0Dv6TG2kNurAI94j96F3b58eubwl1yqJZ/2JZOb7O8
 Awxp4rwjDK883ntwskOoPXXFW4wSg9Q6vd0X2Q0xzsDvWW/g9gZ0NTz0JRZIRF4xSeFo
 yk94l9SRUnt5gqB27O4w76uAP1TVhafP9GSEjCszN8MamqKLyebrS6Yi+MLY3sSVXNfk
 Zftg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1698398545; x=1699003345;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=8hrG750Gl7hz/0UJIj+UYwYOLW77bHS/vbAuArCReSY=;
 b=v7r3XWtaCgONGXO0TlP4/lE6n5JcemlGIRuPFB/EvqA2S01fxc0TfT/C/8fGY2P0UI
 A1u49vK0xobbXozO827LQjPrwPyfqqAd7QrHDv0Nk1klt8kX899hnyw8jADm5PGHL4yS
 RjtLMCNfE36JjlCIswonqoWmqxnVEz6824wuPvw/P2v6hbzPIKZhHdZPm3QyjxG5nzt1
 QPxgAw9T3YpLd7lc4nmf+/cfoxq8yd/uGHN368XpBrGm0pT1Mk23ctcxtG4+ImwYP4rz
 baJFa7SesHKkVZnHAxsuRNWw9Hb4mqMj3fk7jTV27XT6YQnl5vQY27fN3dvY4s9LhrzX
 /j8Q==
X-Gm-Message-State: AOJu0YwS1NffTd6LtJSnK8gmd+TBA8C6ubsi5CPRrlunRh6y20/pTDy1
 WuQsr2DaUN+3olLv+VC6o0c=
X-Google-Smtp-Source: AGHT+IElJnqgR/I+ej2tQqJjBm6tI1vhZlcP2mmTzaFTAdJJA7g4lLeJFgjXrVULJCc9NlbuDMTIhQ==
X-Received: by 2002:a17:907:2d29:b0:9be:7dd3:40ab with SMTP id
 gs41-20020a1709072d2900b009be7dd340abmr1841150ejc.2.1698398544730; 
 Fri, 27 Oct 2023 02:22:24 -0700 (PDT)
Received: from [192.168.8.4] (netacc-gpn-4-226-97.pool.yettel.hu.
 [84.224.226.97]) by smtp.gmail.com with ESMTPSA id
 l22-20020a1709061c5600b009b27d4153cfsm901691ejg.176.2023.10.27.02.22.23
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 27 Oct 2023 02:22:24 -0700 (PDT)
Message-ID: <8d387535-064b-ff2f-83fb-eb3d4b13f591@HIDDEN>
Date: Fri, 27 Oct 2023 11:22:22 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.2.1
Subject: Re: bug#66764: 29.1; Emacs scrolls for "(goto-char (point-max))"
 instead of jumping
Content-Language: sv-FI
To: Eli Zaretskii <eliz@HIDDEN>
References: <ddf1fc8b-2e31-4b2e-8da6-845031ac4171@HIDDEN>
 <83jzr9fdh0.fsf@HIDDEN> <807a1bd5-6477-cc36-088f-efcb782ccb99@HIDDEN>
 <83a5s4fwih.fsf@HIDDEN>
From: =?UTF-8?Q?Herman=2c_G=c3=a9za?= <geza.herman@HIDDEN>
In-Reply-To: <83a5s4fwih.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -1.5 (-)
X-Debbugs-Envelope-To: 66764
Cc: 66764 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.5 (--)



On 10/27/23 07:46, Eli Zaretskii wrote:


> You are saying that Emacs stops and doesn't go further towards EOB
> afterwards?
Yes. I press my "goto-EOB" key, then it does this weird scrolling, and 
Emacs stops in the middle of the buffer. Then I need to press "goto-EOB" 
again to actually reach EOB.

I haven't tried to make a minimal reproducible example yet.






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66764; Package emacs. Full text available.

Message received at 66764 <at> debbugs.gnu.org:


Received: (at 66764) by debbugs.gnu.org; 27 Oct 2023 06:51:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 27 02:51:03 2023
Received: from localhost ([127.0.0.1]:34975 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qwGgR-0004he-JH
	for submit <at> debbugs.gnu.org; Fri, 27 Oct 2023 02:51:03 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:58970)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qwGgO-0004h4-0x
 for 66764 <at> debbugs.gnu.org; Fri, 27 Oct 2023 02:51:02 -0400
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@HIDDEN>)
 id 1qwGfn-0007le-3M; Fri, 27 Oct 2023 02:50:23 -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=WOZOTrwFGWhfXTb1H+6/ukEjiOdRHS6sNUu2ElQvj3k=; b=Us04dfUhy6Es
 AsvWahYb0bgGCviToiZSvMiVlgWR32cCnuZUC2VNEkqA80u96CnV4zilBTGXNkOdgdVT5PHoYfKRA
 upVoSf5TU+Jrlg8N7STyVvIsf6rpl+lx7E3PrYKFulU6sckPtIPwyDZbIxVZ4QPvgyqAw+LqFotly
 GkV9HNX7x1H6Hp17in2AYUL/tznnZL7MFjWXSO9oPeaE5R2KB9oRBxx/2AS7gR4LV4Gqtj24cvVWm
 Q2DKi/S15cPrLdv+YH2AvV416Y+y5GgKkYF0oBO2IEDJC6VFPiQmkJfhtg3Ub8jVTdbLXsX1fmaYi
 SxhsRh7q3FWvNt+B3QRoQw==;
Date: Fri, 27 Oct 2023 09:50:33 +0300
Message-Id: <831qdgftja.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: geza.herman@HIDDEN
In-Reply-To: <83a5s4fwih.fsf@HIDDEN> (message from Eli Zaretskii on Fri, 27
 Oct 2023 08:46:14 +0300)
Subject: Re: bug#66764: 29.1;
 Emacs scrolls for "(goto-char (point-max))" instead of jumping
References: <ddf1fc8b-2e31-4b2e-8da6-845031ac4171@HIDDEN>
 <83jzr9fdh0.fsf@HIDDEN> <807a1bd5-6477-cc36-088f-efcb782ccb99@HIDDEN>
 <83a5s4fwih.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 66764
Cc: Gregory Heytings <gregory@HIDDEN>, 66764 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66764; Package emacs. Full text available.

Message received at 66764 <at> debbugs.gnu.org:


Received: (at 66764) by debbugs.gnu.org; 27 Oct 2023 05:46:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 27 01:46:43 2023
Received: from localhost ([127.0.0.1]:34929 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qwFgB-0002t5-30
	for submit <at> debbugs.gnu.org; Fri, 27 Oct 2023 01:46:43 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43760)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qwFg7-0002sn-9J
 for 66764 <at> debbugs.gnu.org; Fri, 27 Oct 2023 01:46:41 -0400
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@HIDDEN>)
 id 1qwFfW-00030v-M1; Fri, 27 Oct 2023 01:46:02 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=LA1BKQHqMyn3sBkxCb6R1lgjjpghUkeI18b6iHgOQZk=; b=PxaRRSc6BUShNhrnZFpg
 g7THvJOq0Io9GW6N8YambVtp17sPbGPLdIUoLYIh2BhXYOwZw0y4ay1UvN4+wFSU/KXdWDGtEc/cY
 Tlx0Ep7sA7X2xxChdwXyH6XGF/8PoodwKzhYCbOKKYpTLct+Dz9rck/uC6JS8j/CfqzKSV2OzwSqe
 Hu+zfW68mcHqK7isdk63BUOE71hQVjujz8n/4jm+MM8BPYXiigMGYjYdBmiFvD4tCXm8b5sapftXM
 gmJpjnGOayQIFIwAAGnvLtLobZOh7WylMR/Xh20bODyh5PJonDUo6eRP8aDpb54dwK0jGE56iZocX
 Yk7x8nSZHxHa6A==;
Date: Fri, 27 Oct 2023 08:46:14 +0300
Message-Id: <83a5s4fwih.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?Q?Herman_G=C3=A9za?= <geza.herman@HIDDEN>
In-Reply-To: <807a1bd5-6477-cc36-088f-efcb782ccb99@HIDDEN> (message from
 Herman, =?utf-8?Q?G=C3=A9za?= on Thu, 26 Oct 2023 21:12:55 +0200)
Subject: Re: bug#66764: 29.1; Emacs scrolls for "(goto-char (point-max))"
 instead of jumping
References: <ddf1fc8b-2e31-4b2e-8da6-845031ac4171@HIDDEN>
 <83jzr9fdh0.fsf@HIDDEN> <807a1bd5-6477-cc36-088f-efcb782ccb99@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 66764
Cc: 66764 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Thu, 26 Oct 2023 21:12:55 +0200
> Cc: 66764 <at> debbugs.gnu.org
> From: Herman, Géza <geza.herman@HIDDEN>
> 
> On 10/26/23 20:25, Eli Zaretskii wrote:
> > I didn't yet try to reproduce this, but just reading the description:
> > why do you consider this behavior a problem, let alone a bug?
> I think that pressing the "go to the end of the buffer" key should go to 
> the end of the buffer without any weird-looking scrolling, and it should 
> do it immediately, not in ~0.5 seconds.

I'm not sure what you mean by "should go to the end of the buffer
without any weird-looking scrolling".  The Lisp program you posted
moves point to the end of the buffer, but how to reflect that best on
display is the decision made by the display engine, and it can
legitimately be by scrolling the window (IIUC what you mean by
"weird-looking scrolling").  As for ~0.5 seconds, I don't think I see
this mentioned in your original report, so I'm guessing there are some
aspects of this behavior that you haven't described in full yet, or
maybe I didn't understand your description.  Maybe when I generate the
file with your program, I will understand it better.

> I've just disabled this optimization, not just because of this. It's 
> also not ideal that if I run beginning-of-visual-line at the end of a 
> long line, the point only moves ~1000 characters to the left, instead of 
> moving to the beginning. I didn't report this problem, because I assume 
> it is known (I suppose it's by design how the optimization works?), so I 
> just give this as a feedback on the long-line-optimization feature here.

Yes, this is by design.

> >> In my real case, a much smaller file produces this problem. Also, Emacs
> >> doesn't go to the end of the file, but stops somewhere in the middle (I
> >> was unable to reproduce this issue with a simple configuration).
> > This can legitimately happen if the last line has tall characters or
> > you use line-spacing or something similar.  Again, why is it a
> > problem, as long as EOB is visible after that?
> 
> The buffer is a simple ASCII file, all characters between 32-127 and 
> newline. There are no tall characters. My line-spacing is nil. The 
> problem is that EOB is not visible. Emacs stops at line 19232, but the 
> file has 48263 lines.

You are saying that Emacs stops and doesn't go further towards EOB
afterwards?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66764; Package emacs. Full text available.

Message received at 66764 <at> debbugs.gnu.org:


Received: (at 66764) by debbugs.gnu.org; 26 Oct 2023 19:13:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 26 15:13:40 2023
Received: from localhost ([127.0.0.1]:34547 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qw5nX-0000fE-N5
	for submit <at> debbugs.gnu.org; Thu, 26 Oct 2023 15:13:40 -0400
Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:45211)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <geza.herman@HIDDEN>) id 1qw5nU-0000ew-4M
 for 66764 <at> debbugs.gnu.org; Thu, 26 Oct 2023 15:13:38 -0400
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-53d9f001b35so1986975a12.2
 for <66764 <at> debbugs.gnu.org>; Thu, 26 Oct 2023 12:13:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1698347578; x=1698952378; darn=debbugs.gnu.org;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :from:to:cc:subject:date:message-id:reply-to;
 bh=9QjN3UXt+D5+EUb3fDnaOXbHxQcrJUCOt2k1MOs3yD8=;
 b=LOJ4AiYezZmclJB3bogRxNzERNibPX3hgj3VMRWIntEUx2Zw/gi7tltGIKjR47ZNTF
 n5C05o7hXhaZXlb+4cbjXUUe5yJZsve+wTy4fxuiVPwpUJ9A31tW2Yqv4xIdR6n8M0s4
 0C5oHFUVCFxBalh7FqVDdFJWGGPrDbUfiTC5i2597uI4qr54JaZxjs/LMnaQJtyKVzq6
 Q2sRgXXgwIAQcDyPkmhUbFX4VwQQ0pVu+bcj6DcKoaT6rs6Gta9ldtyQuwxbFGr9t1Ow
 QugnLBX3PHXNfRtW9HZnU05oWNasshbIGJxgHUT0J5Lan9crFrChEqVrSGuukT/IMaxm
 rT8Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1698347578; x=1698952378;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=9QjN3UXt+D5+EUb3fDnaOXbHxQcrJUCOt2k1MOs3yD8=;
 b=F1jnKNYt5moEMZ6OhZfIWmx/5itZDSNicXYsAUXJ9u62ciJNLv8qts2aeKF7Ufoach
 7PuHQPulEutqCMJUOV5Y7y4AbS+GpMxFg/ZUyqKvYkaP3lPsyTTklQG4PcFT/ZELw3hP
 vHiI7K6KX+2Nqmhw/dr2J2K0NzFmuJ5FhOAnr68FT/pReUBApSTXZy1SjbPDPt6UfJDT
 AJ3qi/e9PJHzatan8FR++C9gQa0gI5VZtWoVK6U1uLpTPFWU8xJOpGvf2Gmzomt1LJFx
 RwjbfDj08zYHVFOWKATES8eSfnrtToC4qlmW9pmSHiaomeSGweeL5iFgAcM2QCbncxOe
 swBQ==
X-Gm-Message-State: AOJu0YwNfn20OhjIdlXCxx7WBEydx4kjYyhobdPIw9YvZxmH5/c7QH6u
 U/g62oMsfhzGJ+e9I7mr2s8=
X-Google-Smtp-Source: AGHT+IHuxYIcq4QaVSgnE3NbeOwSCyEmFV/7N9BOhR/nX4lcR2o9joxoukWVHlrh2uwMWPeFzvIHXw==
X-Received: by 2002:aa7:d7d0:0:b0:53e:1f7d:10f2 with SMTP id
 e16-20020aa7d7d0000000b0053e1f7d10f2mr727836eds.10.1698347577710; 
 Thu, 26 Oct 2023 12:12:57 -0700 (PDT)
Received: from [192.168.8.4] (netacc-gpn-4-226-97.pool.yettel.hu.
 [84.224.226.97]) by smtp.gmail.com with ESMTPSA id
 fd10-20020a056402388a00b0053e5a1bf77dsm39678edb.88.2023.10.26.12.12.55
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 26 Oct 2023 12:12:56 -0700 (PDT)
Message-ID: <807a1bd5-6477-cc36-088f-efcb782ccb99@HIDDEN>
Date: Thu, 26 Oct 2023 21:12:55 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.2.1
Subject: Re: bug#66764: 29.1; Emacs scrolls for "(goto-char (point-max))"
 instead of jumping
Content-Language: sv-FI
To: Eli Zaretskii <eliz@HIDDEN>
References: <ddf1fc8b-2e31-4b2e-8da6-845031ac4171@HIDDEN>
 <83jzr9fdh0.fsf@HIDDEN>
From: =?UTF-8?Q?Herman=2c_G=c3=a9za?= <geza.herman@HIDDEN>
In-Reply-To: <83jzr9fdh0.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -1.5 (-)
X-Debbugs-Envelope-To: 66764
Cc: 66764 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.5 (--)



On 10/26/23 20:25, Eli Zaretskii wrote:
> I didn't yet try to reproduce this, but just reading the description:
> why do you consider this behavior a problem, let alone a bug?
I think that pressing the "go to the end of the buffer" key should go to 
the end of the buffer without any weird-looking scrolling, and it should 
do it immediately, not in ~0.5 seconds. Without the 
long-line-optimization, it does that. In this case, the optimization is 
not an optimization, but makes things worse.

I've just disabled this optimization, not just because of this. It's 
also not ideal that if I run beginning-of-visual-line at the end of a 
long line, the point only moves ~1000 characters to the left, instead of 
moving to the beginning. I didn't report this problem, because I assume 
it is known (I suppose it's by design how the optimization works?), so I 
just give this as a feedback on the long-line-optimization feature here.


>> In my real case, a much smaller file produces this problem. Also, Emacs
>> doesn't go to the end of the file, but stops somewhere in the middle (I
>> was unable to reproduce this issue with a simple configuration).
> This can legitimately happen if the last line has tall characters or
> you use line-spacing or something similar.  Again, why is it a
> problem, as long as EOB is visible after that?

The buffer is a simple ASCII file, all characters between 32-127 and 
newline. There are no tall characters. My line-spacing is nil. The 
problem is that EOB is not visible. Emacs stops at line 19232, but the 
file has 48263 lines. I didn't analyze this problem too deeply, because 
I thought that the fact that emacs scrolls in this case is already a bad 
thing. And it's likely the cause of the scrolling is similar to the 
stopping, because both problem go away with long-line-threshold set to nil.


>> So to go to the end of the file I have to run "(goto-char
>> (point-max))" multiple times. Interestingly, "M->" works fine. But
>> if I remove the recenter call at the end of "end-of-buffer", it also
>> has this odd behavior.
> Which isn't surprising, since with the 'recenter' call removed,
> end-of-buffer is just (goto-char (point-max)).
Yes, but it is still weird how can a final recenter call cause a 
difference. The point movement happened earlier, and it is fixed by a 
later recenter call. But yeah, I suppose the scrolling happens later, 
during redisplay, or similar. I just reported this fact because it may 
help identifying the issue.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66764; Package emacs. Full text available.

Message received at 66764 <at> debbugs.gnu.org:


Received: (at 66764) by debbugs.gnu.org; 26 Oct 2023 18:26:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 26 14:26:01 2023
Received: from localhost ([127.0.0.1]:34453 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qw53Q-0007oI-SM
	for submit <at> debbugs.gnu.org; Thu, 26 Oct 2023 14:26:01 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:45700)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qw53N-0007o1-1F
 for 66764 <at> debbugs.gnu.org; Thu, 26 Oct 2023 14:25:59 -0400
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@HIDDEN>)
 id 1qw52m-0001cU-Nu; Thu, 26 Oct 2023 14:25:20 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=upXkQJ/7XxviK9UXz1axAz8X8EenfhfSH/RYpcEn07w=; b=IBkWwaXAgrtZrCPZiR6+
 XU8eQGfeCFA5bbpvxS22e1Xlh2PpmdbeRXojr0Ukb47aEfFXLOTtYjs4cck6ACv+zz99O3+xMbUcv
 lbNBwaWuXhK3p/mjHD//w39BuUvjomaAzLvKn/CGlfV6rsbzzmNjLAFqpZytH7SYyRljlo5IogM6v
 z+LtjDmRcU3NkPNloa0vADvEYJOao9lD4mj12wOUVyRh0fFjy1GDG1q5cAt6v6FqBXy+H0BlFvG+6
 JmmDxKD5v8OBl6ez0af6e7VcJYRWvjj5dH+eYraZ2YtZNUUXaTqPxhsCWiFCwCA9rQTv3fFRFek7s
 BsypoyBRl7KyCw==;
Date: Thu, 26 Oct 2023 21:25:16 +0300
Message-Id: <83jzr9fdh0.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Geza Herman <geza.herman@HIDDEN>
In-Reply-To: <ddf1fc8b-2e31-4b2e-8da6-845031ac4171@HIDDEN> (message from
 Geza Herman on Thu, 26 Oct 2023 19:04:42 +0200)
Subject: Re: bug#66764: 29.1;
 Emacs scrolls for "(goto-char (point-max))" instead of jumping
References: <ddf1fc8b-2e31-4b2e-8da6-845031ac4171@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 66764
Cc: 66764 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Thu, 26 Oct 2023 19:04:42 +0200
> From: Geza Herman <geza.herman@HIDDEN>
> 
> The bug is, that in certain circumstances, emacs moves the point by 
> using some kind of scrolling for "(goto-char (point-max))", instead of 
> just jumping.
> 
> Repro:
> 
> - create a file using the little C program at the end (it produces a 
> large text to stdout, you'll need to redirect it to some file)
> 
> - open the file with "emacs -Q generated.txt"
> 
> - with M-:, execute this:
> 
>     (progn
>       (setq scroll-conservatively 101)
>       (font-lock-add-keywords nil '(((lambda (bound)) (1 'error prepend 
> t))) t)
>       (goto-char (point-max)))
> 
> Notice that emacs doesn't jump to the end immediately as usual, but it 
> does some kind of very fast scrolling.

I didn't yet try to reproduce this, but just reading the description:
why do you consider this behavior a problem, let alone a bug?

> In my real case, a much smaller file produces this problem. Also, Emacs 
> doesn't go to the end of the file, but stops somewhere in the middle (I 
> was unable to reproduce this issue with a simple configuration).

This can legitimately happen if the last line has tall characters or
you use line-spacing or something similar.  Again, why is it a
problem, as long as EOB is visible after that?

> So to go to the end of the file I have to run "(goto-char
> (point-max))" multiple times. Interestingly, "M->" works fine. But
> if I remove the recenter call at the end of "end-of-buffer", it also
> has this odd behavior.

Which isn't surprising, since with the 'recenter' call removed,
end-of-buffer is just (goto-char (point-max)).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66764; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 26 Oct 2023 17:05:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 26 13:05:32 2023
Received: from localhost ([127.0.0.1]:34420 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qw3nY-0005it-5c
	for submit <at> debbugs.gnu.org; Thu, 26 Oct 2023 13:05:32 -0400
Received: from lists.gnu.org ([2001:470:142::17]:37610)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <geza.herman@HIDDEN>) id 1qw3nU-0005iY-Qr
 for submit <at> debbugs.gnu.org; Thu, 26 Oct 2023 13:05:30 -0400
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 <geza.herman@HIDDEN>)
 id 1qw3mt-0000Kb-2r
 for bug-gnu-emacs@HIDDEN; Thu, 26 Oct 2023 13:04:51 -0400
Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <geza.herman@HIDDEN>)
 id 1qw3mq-0004cP-Cr
 for bug-gnu-emacs@HIDDEN; Thu, 26 Oct 2023 13:04:50 -0400
Received: by mail-wr1-x429.google.com with SMTP id
 ffacd0b85a97d-32da4ffd7e5so712616f8f.0
 for <bug-gnu-emacs@HIDDEN>; Thu, 26 Oct 2023 10:04:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1698339884; x=1698944684; darn=gnu.org;
 h=content-transfer-encoding:subject:from:to:content-language
 :user-agent:mime-version:date:message-id:from:to:cc:subject:date
 :message-id:reply-to;
 bh=XFQoGIfxz+KEEFnGskiz4FkpB+ZfFlnTF0ko7LYseAg=;
 b=RhN/oUj7Gt3R80FmEooRuQnYB21e4M0GUh78Vp1XiwA9liU+rx81xrNPuLFaMmmWNT
 XbQUA2oabb0lix7Vv5iRDExOTKEuAC6xlo5krkH8fNggp9taiyaJyUDF2FNYgXEP8r1U
 3llRtmXD6ov7UPSk8t9LDpqO4jhURVSJhSh2z3BFkOlDM8/UbasUFg/q1m8SGfalpuyD
 TueM5uK1AOPUcgV/66BDeYeRATse0mQ0qBGGSAiMoCnmcJmMSt3Ktr6ZKyluAHVfm0fC
 +T4EI53ziasi1Iql5VPb4mrvk2Svs7FqwTspJdaYMvsNP8AGq38q9I3iYYND6zUMo7Q7
 1xOg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1698339884; x=1698944684;
 h=content-transfer-encoding:subject:from:to:content-language
 :user-agent:mime-version:date:message-id:x-gm-message-state:from:to
 :cc:subject:date:message-id:reply-to;
 bh=XFQoGIfxz+KEEFnGskiz4FkpB+ZfFlnTF0ko7LYseAg=;
 b=fyYFofdmJhX8bEaD3JBQQdjzSqcYBP2jRsB1tYh8ZLWOggjISZSJgWJqkokNCQaO9y
 bMhEjoXhr9TNPlHFPmgMx6DYCJ5b31d4rvOFkbUdABAoJjE8EvIw4bVc8lZkWXh6p7W4
 POpc/YNN0Q3EbIBS7CJIi+gCUtcTlgzwp21LSjBi2N+FbshxaTkrph6VioERwlEF2ZEO
 FfGAEw9ctnDo/NTfbcT12dZw/AD7w8m+NKlOBvJ/nSXEJqSAjqz60eUbIFNwryESF3du
 8lYfLw6HduZy1M4brr6WBFwZhUnJjrKWYrUtGc1acx7rP93WtEvU4LDeuwskF1ZDsVe4
 xE6A==
X-Gm-Message-State: AOJu0YwWCA3tkTMstSKxQ0wb0uAQ5Ecbyd6v/4nNu+xDzZP+r/FYpNJg
 UkNSru2x8JdHMmcEzMX/Hok664FiU8s=
X-Google-Smtp-Source: AGHT+IHfZ+g4F3zFrVdLNdjA9nynxHVBWUrgAhKu4zgxhbFDYrV1z7p/+EoxWTEL3CTca/vT7OjBJg==
X-Received: by 2002:a5d:59a4:0:b0:32d:c5fd:159b with SMTP id
 p4-20020a5d59a4000000b0032dc5fd159bmr4435636wrr.4.1698339884335; 
 Thu, 26 Oct 2023 10:04:44 -0700 (PDT)
Received: from [10.9.10.156] (62-77-231-86.static.invitel.hu. [62.77.231.86])
 by smtp.gmail.com with ESMTPSA id
 g21-20020a05600c311500b0040651505684sm3142994wmo.29.2023.10.26.10.04.43
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 26 Oct 2023 10:04:43 -0700 (PDT)
Message-ID: <ddf1fc8b-2e31-4b2e-8da6-845031ac4171@HIDDEN>
Date: Thu, 26 Oct 2023 19:04:42 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: bug-gnu-emacs@HIDDEN
From: Geza Herman <geza.herman@HIDDEN>
Subject: 29.1; Emacs scrolls for "(goto-char (point-max))" instead of jumping
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2a00:1450:4864:20::429;
 envelope-from=geza.herman@HIDDEN; helo=mail-wr1-x429.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,
 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-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

The bug is, that in certain circumstances, emacs moves the point by 
using some kind of scrolling for "(goto-char (point-max))", instead of 
just jumping.

Repro:

- create a file using the little C program at the end (it produces a 
large text to stdout, you'll need to redirect it to some file)

- open the file with "emacs -Q generated.txt"

- with M-:, execute this:

    (progn
      (setq scroll-conservatively 101)
      (font-lock-add-keywords nil '(((lambda (bound)) (1 'error prepend 
t))) t)
      (goto-char (point-max)))

Notice that emacs doesn't jump to the end immediately as usual, but it 
does some kind of very fast scrolling.

(With long-line-threshold set to nil, the issue doesn't happen)

In my real case, a much smaller file produces this problem. Also, Emacs 
doesn't go to the end of the file, but stops somewhere in the middle (I 
was unable to reproduce this issue with a simple configuration). So to 
go to the end of the file I have to run "(goto-char (point-max))" 
multiple times. Interestingly, "M->" works fine. But if I remove the 
recenter call at the end of "end-of-buffer", it also has this odd behavior.


Here is the C program:

#include <stdio.h>
#include <stdlib.h>

int main() {
     for (int i=0; i<200000; i++) {
         int len = 100 + (rand()&0x7f);
         if (i==5000) len = 60000;
         for (int j=0; j<len; j++) {
             printf("x");
         }
         printf("\n");
     }
}


In GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38,
  cairo version 1.16.0) of 2023-08-30, modified by Debian built on
  x86-csail-01
Windowing system distributor 'The X.Org Foundation', version 11.0.12101008
System Description: Debian GNU/Linux trixie/sid

Configured using:
  'configure --build x86_64-linux-gnu --prefix=/usr
  --sharedstatedir=/var/lib --libexecdir=/usr/libexec
  --localstatedir=/var/lib --infodir=/usr/share/info
  --mandir=/usr/share/man --with-libsystemd --with-pop=yes
  --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/29.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/29.1/site-lisp:/usr/share/emacs/site-lisp
  --with-sound=alsa --without-gconf --with-mailutils
  --with-native-compilation --build x86_64-linux-gnu --prefix=/usr
  --sharedstatedir=/var/lib --libexecdir=/usr/libexec
  --localstatedir=/var/lib --infodir=/usr/share/info
  --mandir=/usr/share/man --with-libsystemd --with-pop=yes
  --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/29.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/29.1/site-lisp:/usr/share/emacs/site-lisp
  --with-sound=alsa --without-gconf --with-mailutils
  --with-native-compilation --with-cairo --with-x=yes
  --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2
  -ffile-prefix-map=/build/reproducible-path/emacs-29.1+1=. 
-fstack-protector-strong
  -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
  -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3
THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2
XPM GTK3 ZLIB

Important settings:
   value of $LC_ALL: C.UTF-8
   value of $LANG: en_US.UTF-8
   value of $XMODIFIERS: @im=ibus
   locale-coding-system: utf-8-unix

Major mode: Text

Minor modes in effect:
   tooltip-mode: t
   global-eldoc-mode: t
   show-paren-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   tool-bar-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   line-number-mode: t
   indent-tabs-mode: t
   transient-mark-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils comp comp-cstr
warnings icons subr-x rx cl-seq cl-macs gv cl-extra help-mode
cl-loaddefs cl-lib bytecomp byte-compile rmc iso-transl tooltip cconv
eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 100665 12371)
  (symbols 48 7141 0)
  (strings 32 26857 2252)
  (string-bytes 1 845777)
  (vectors 16 20215)
  (vector-slots 8 367701 18494)
  (floats 8 50 17)
  (intervals 56 2211 0)
  (buffers 984 12))





Acknowledgement sent to Geza Herman <geza.herman@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#66764; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 27 Oct 2023 10:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.