GNU bug report logs - #66216
28.2; scroll-up-line doesn't work if there is a before-string overlay with newline

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: Herman, Géza <geza.herman@HIDDEN>; dated Tue, 26 Sep 2023 18:32:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 66216) by debbugs.gnu.org; 29 Sep 2023 11:29:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 29 07:29:04 2023
Received: from localhost ([127.0.0.1]:55428 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qmBg7-0000Ds-Sb
	for submit <at> debbugs.gnu.org; Fri, 29 Sep 2023 07:29:04 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:59086)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qmBg1-0000DH-VH
 for 66216 <at> debbugs.gnu.org; Fri, 29 Sep 2023 07:29:01 -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 1qmBfg-00017S-Dy; Fri, 29 Sep 2023 07:28:36 -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=6z0wHo4y+aaIBQJ/TZgkcBSJc1u7/Q+Pr8DU4qR03IE=; b=E4jK07j7/Nw/INxBVHQn
 AJXLu8DKvWu184FY7iore8HeBeyxA6qv+mu1Cl6/fdJaPwosxB7WfwJ9XvE/FZspSJ5NOXg/m0/q/
 F7lp69w4N0LMiVwhCcWVvZ05ux6v4rNVr0U668tf8YAIxA9rfF+2466Vh2RDXM8L6i6TmNRfWBzs3
 bEC7C3PuYiVgGu13jYUu+8CRk4awgzrIzpiaKSXhcOrP30SbOpCE+jhZPac6AKB4XwXoJalf3wYwu
 RNZUsoABlg04n9J6NxtUD62bmeGtTXN2DqiE1TJ8lG7aN6aaA2jNLS/FmJEyyFbzbAZzsiKd/3DlR
 06jhZEZhiTWDhQ==;
Date: Fri, 29 Sep 2023 14:28:15 +0300
Message-Id: <83zg15z0a8.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?Q?G=C3=A9za?= <geza.herman@HIDDEN>
In-Reply-To: <ebee778c-7621-43d3-10ea-c62b8103cd00@HIDDEN>
 (Herman <at> debbugs.gnu.org)
Subject: Re: bug#66216: 28.2;
 scroll-up-line doesn't work if there is a before-string overlay with
 newline
References: <ebee778c-7621-43d3-10ea-c62b8103cd00@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: 66216
Cc: 66216 <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: Tue, 26 Sep 2023 20:30:53 +0200
> From: Herman <at> debbugs.gnu.org, Géza <geza.herman@HIDDEN>
> 
> This bug exists in 28.2, but on a not too old master as well.
> 
> Repro:
>   - emacs -Q
>   - M-: (overlay-put (make-overlay 72 72) 'before-string "Fake line\n")
>   - this will put a "Fake line" at the 2nd line of the scratch buffer, 
> (between the two default scratch buffer message lines)
>   - M-x scroll-up-line
>   - this will correctly scroll one line up
>   - M-x scroll-up-line
>   - this is the bug, no scroll happens
> 
> Also, if the overlay is added at the middle of some line (not at the 
> beginning like in my repro steps), then scroll-up-line will "scroll" 
> until the overlay only, making the overlay to visually move the left 
> side. Then further scroll-up-line commands won't have an effect.

What do you expect to happen in these cases?

The scroll commands work by telling Emacs which buffer position to use
as the window-start for the next redisplay; then redisplay kicks in
and redraws the window using that starting position.  But for boring
technical reasons, Emacs is unable to start displaying a buffer from a
position where we have a before-string overlay, without displaying
that before-string first.  Which is what you see.

We could scroll one more line in these cases, but then the other group
of users will come up complaining that we scroll over too much text
(no one said the before-string must have only one newline, it could
have several ones, in which case we will scroll across all of those
lines).  So we punt and let the user invoke the scrolling commands
with an appropriate prefix argument; for example, in this case, just
say "C-u 2 M-x scroll-up-line RET", and Bob's your uncle.

But if this is not good enough, please tell what you'd like to see
instead, given the above limitation of the current display engine, and
maybe we will find better solutions for this conundrum.

Thanks.




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

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


Received: (at submit) by debbugs.gnu.org; 26 Sep 2023 18:31:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 26 14:31:28 2023
Received: from localhost ([127.0.0.1]:49722 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qlCqG-0007Ki-5l
	for submit <at> debbugs.gnu.org; Tue, 26 Sep 2023 14:31:28 -0400
Received: from lists.gnu.org ([2001:470:142::17]:41206)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <geza.herman@HIDDEN>) id 1qlCqC-0007KR-E6
 for submit <at> debbugs.gnu.org; Tue, 26 Sep 2023 14:31:26 -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 1qlCpo-0002qW-KR
 for bug-gnu-emacs@HIDDEN; Tue, 26 Sep 2023 14:31:03 -0400
Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535])
 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 1qlCpm-0003o4-F6
 for bug-gnu-emacs@HIDDEN; Tue, 26 Sep 2023 14:30:59 -0400
Received: by mail-ed1-x535.google.com with SMTP id
 4fb4d7f45d1cf-534848725e8so499428a12.0
 for <bug-gnu-emacs@HIDDEN>; Tue, 26 Sep 2023 11:30:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1695753056; x=1696357856; 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=iW8HsLOGEtslt994pLXhE6SV6GSiIANpIqqaEEzl9VY=;
 b=CnAPqLIRUXcqOjiIRQe7r7cI3HBDxILdA2NwGzBcAJ0pEbIsVbhstSgrQISLPC+3OX
 BO3d65jaLdlfJwDhMVbc3OX+wLHt6sS1Ros0rmI3UgcNkRleIWr2Znmxj6vEajscq1IB
 BbU2ajZj3p+Pnvn1ckW/Cqn3Uf1NhktJSr6uXdK5lUFMOtcM8G0wOl+FCa/9+mqOkwxx
 RztYUVpBeAcuMUoErZEpA4FxAC3vQ+RdThqIQc6xMS584AIzZ1JEjRZF7UTP2bEjDO3l
 raZoNn4iXxv1wtIZzeOtd4XjnY49CF/jgRcY0hhfZ8ZOC4YksxU70I6wJIbXX3ilR0Ah
 Xhrw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1695753056; x=1696357856;
 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=iW8HsLOGEtslt994pLXhE6SV6GSiIANpIqqaEEzl9VY=;
 b=LP7j8JRKYRYxLJW5Rpf7eHpLxbZiVWG3b+rc8lhGlicsvUkJOOa6+fYDaRC28tcupM
 d96sH4B5LAKiDtade3Sy8RgDqvO2JUjPi0IAP6Q6/RrGxmUtec3zHZMUvcPkg+Afq5wc
 sQrJQFSoa8MfpDtfBcUL7mMr/rAvx47CmFXZAKMy6X0U9428a6HlUxgsb06W5NRIUqhD
 TcC8E+N6T2Swj9c5DR6101Hq8/NbteR0Nw56XRKUHCYPAhQWNPsi1U831STfVH6Vw/tE
 BxEcMihEDFNuc9RLY7JBT5G9UkP0MpPXLZzJMfEADNNWG48PPMc/Ccx7W6LnjP2so6gv
 1inA==
X-Gm-Message-State: AOJu0Yyoj/HN7DfmL3y2Mm7/MFuoPWr/WyzUb0WIZP457wocil5HLc0E
 +1smjus2Owsgx7s3ncKnB+zjDd21Yio=
X-Google-Smtp-Source: AGHT+IFHdoiaIzzODICdh14kTIvSvWblEv0Pj1OcNAYBNtqFUsYQEmlLZgYGvOKMaDAAzpdmsKZF7A==
X-Received: by 2002:a05:6402:a4b:b0:532:c92f:3e1a with SMTP id
 bt11-20020a0564020a4b00b00532c92f3e1amr9719632edb.28.1695753055594; 
 Tue, 26 Sep 2023 11:30:55 -0700 (PDT)
Received: from [192.168.8.4] (netacc-gpn-204-68-204.pool.yettel.hu.
 [5.204.68.204]) by smtp.gmail.com with ESMTPSA id
 u11-20020a056402064b00b0053120f313cbsm7085862edx.39.2023.09.26.11.30.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 26 Sep 2023 11:30:55 -0700 (PDT)
Message-ID: <ebee778c-7621-43d3-10ea-c62b8103cd00@HIDDEN>
Date: Tue, 26 Sep 2023 20:30:53 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.2.1
Content-Language: sv-FI
To: bug-gnu-emacs@HIDDEN
From: =?UTF-8?Q?Herman=2c_G=c3=a9za?= <geza.herman@HIDDEN>
Subject: 28.2; scroll-up-line doesn't work if there is a before-string overlay
 with newline
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2a00:1450:4864:20::535;
 envelope-from=geza.herman@HIDDEN; helo=mail-ed1-x535.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 (/)

This bug exists in 28.2, but on a not too old master as well.

Repro:
  - emacs -Q
  - M-: (overlay-put (make-overlay 72 72) 'before-string "Fake line\n")
  - this will put a "Fake line" at the 2nd line of the scratch buffer, 
(between the two default scratch buffer message lines)
  - M-x scroll-up-line
  - this will correctly scroll one line up
  - M-x scroll-up-line
  - this is the bug, no scroll happens

Also, if the overlay is added at the middle of some line (not at the 
beginning like in my repro steps), then scroll-up-line will "scroll" 
until the overlay only, making the overlay to visually move the left 
side. Then further scroll-up-line commands won't have an effect.





Acknowledgement sent to Herman, Géza <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#66216; 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, 29 Sep 2023 11:30:01 UTC

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