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#66216: 28.2; scroll-up-line doesn't work if there is a before-string overlay with newline Date: Fri, 29 Sep 2023 14:28:15 +0300 Message-ID: <83zg15z0a8.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34819"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66216@debbugs.gnu.org To: =?UTF-8?Q?G=C3=A9za?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 29 13:30:34 2023 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 1qmBhZ-0008nA-CL for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 29 Sep 2023 13:30:33 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qmBgy-0001U8-EB; Fri, 29 Sep 2023 07:29:56 -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 1qmBgw-0001Tv-F7 for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2023 07:29:54 -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 1qmBgv-0001Fu-4P for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2023 07:29:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qmBh3-0000Fn-TW for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2023 07:30:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Sep 2023 11:30:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66216 X-GNU-PR-Package: emacs Original-Received: via spool by 66216-submit@debbugs.gnu.org id=B66216.1695986944865 (code B ref 66216); Fri, 29 Sep 2023 11:30:01 +0000 Original-Received: (at 66216) by debbugs.gnu.org; 29 Sep 2023 11:29:04 +0000 Original-Received: from localhost ([127.0.0.1]:55428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmBg7-0000Ds-Sb for submit@debbugs.gnu.org; Fri, 29 Sep 2023 07:29:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmBg1-0000DH-VH for 66216@debbugs.gnu.org; Fri, 29 Sep 2023 07:29:01 -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 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==; In-Reply-To: (Herman@debbugs.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" 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:271481 Archived-At: > Date: Tue, 26 Sep 2023 20:30:53 +0200 > From: Herman@debbugs.gnu.org, Géza > > 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.