From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Herman@debbugs.gnu.org, =?UTF-8?Q?G=C3=A9za?= <geza.herman@gmail.com>
Newsgroups: gmane.emacs.bugs
Subject: bug#66764: 29.1;
 Emacs scrolls for "(goto-char (point-max))" instead of jumping
Date: Thu, 26 Oct 2023 21:12:55 +0200
Message-ID: <807a1bd5-6477-cc36-088f-efcb782ccb99@gmail.com>
References: <ddf1fc8b-2e31-4b2e-8da6-845031ac4171@gmail.com>
 <83jzr9fdh0.fsf@gnu.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="35261"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.2.1
Cc: 66764@debbugs.gnu.org
To: Eli Zaretskii <eliz@gnu.org>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 26 21:13:51 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 1qw5nj-00092w-5n
	for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Oct 2023 21:13:51 +0200
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 1qw5nT-00084N-Ti; Thu, 26 Oct 2023 15:13:35 -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 1qw5nR-00083e-DR
 for bug-gnu-emacs@gnu.org; Thu, 26 Oct 2023 15:13:33 -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 1qw5nP-000538-WA
 for bug-gnu-emacs@gnu.org; Thu, 26 Oct 2023 15:13:33 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1qw5nu-0000fw-FW
 for bug-gnu-emacs@gnu.org; Thu, 26 Oct 2023 15:14:02 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Herman@debbugs.gnu.org,
 =?UTF-8?Q?G=C3=A9za?= <geza.herman@gmail.com>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Thu, 26 Oct 2023 19:14:02 +0000
Resent-Message-ID: <handler.66764.B66764.16983476202560@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.16983476202560
 (code B ref 66764); Thu, 26 Oct 2023 19:14:02 +0000
Original-Received: (at 66764) by debbugs.gnu.org; 26 Oct 2023 19:13:40 +0000
Original-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@debbugs.gnu.org>)
 id 1qw5nX-0000fE-N5
 for submit@debbugs.gnu.org; Thu, 26 Oct 2023 15:13:40 -0400
Original-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@gmail.com>) id 1qw5nU-0000ew-4M
 for 66764@debbugs.gnu.org; Thu, 26 Oct 2023 15:13:38 -0400
Original-Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-53d9f001b35so1986975a12.2
 for <66764@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)
Original-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)
Content-Language: sv-FI
In-Reply-To: <83jzr9fdh0.fsf@gnu.org>
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:273317
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/273317>



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.