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?= 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 13:53:04 +0200 Message-ID: <99a86a00-20d8-446f-336a-1f405e07d59f@gmail.com> References: <83zg15z0a8.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10595"; 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: 66216@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 29 13:54:23 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 1qmC4b-0002Pu-FB for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 29 Sep 2023 13:54:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qmC47-0005nr-NQ; Fri, 29 Sep 2023 07:53:51 -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 1qmC44-0005mk-Ez for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2023 07:53:49 -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 1qmC44-0005J3-6Y for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2023 07:53:48 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qmC4I-0003eZ-JS for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2023 07:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Herman@debbugs.gnu.org, =?UTF-8?Q?G=C3=A9za?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Sep 2023 11:54:02 +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.169598841614002 (code B ref 66216); Fri, 29 Sep 2023 11:54:02 +0000 Original-Received: (at 66216) by debbugs.gnu.org; 29 Sep 2023 11:53:36 +0000 Original-Received: from localhost ([127.0.0.1]:55454 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmC3o-0003df-BE for submit@debbugs.gnu.org; Fri, 29 Sep 2023 07:53:36 -0400 Original-Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:45144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmC3j-0003dN-C3 for 66216@debbugs.gnu.org; Fri, 29 Sep 2023 07:53:31 -0400 Original-Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-533d9925094so14225779a12.2 for <66216@debbugs.gnu.org>; Fri, 29 Sep 2023 04:53:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695988386; x=1696593186; 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=4hJk3LBFs6/j1n+1Bhj6QsuRuqvRKPB+bL1nGGI8WoM=; b=kwRGlDK5tgkXAJtLPj7OOkqSZkDOf8/T3v8iff6PNJuSZspkhZIfwf48A0ly6rgLkL dFt6bqOxpmhYK0vhO26ekAtiLIZLCPwD6PVkT2q0cJDU/AzmGv72/Osv5QFcbAAIpGRI s5jJxlle9wLssfDgGJU724ZHU7WxVxgqDgn+KW54McZKDGGLfPWwW5YbKlZj/kxkmRVY 4BlXWMd84VwLQ9ggQNFk7IgeP2ONMwK6RxrDsGvKjCMFpfFeAdpXWU7k9/bHkXK/+ZL6 5vVMsXcyasnQYQPvk087p9QgA11TF71Kffikd/492gdz+8Xah0hmvUNYa3c5r5JAFmmr JJdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695988386; x=1696593186; 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=4hJk3LBFs6/j1n+1Bhj6QsuRuqvRKPB+bL1nGGI8WoM=; b=rO4b9+FUoQcZpYQAcpcyorjiLWTyvrIPkuHujFR9VcJTw164GNJch416nrBhc8xuTZ Unywg+G6om5Ij90AzqSdHGQ9wt0L5UaE9gN1UREXVW9fj4oc9C9eC/BlXXTIgvH4Ck6p zm/dpm5Y8AIWXl6oYtAE7smt/veGKdHNrzHpx4DW/fkeLKvomnVWu3fOwRCdxY6Fi4Qx tZ1AYXCEJ06CIASBJ5kPLjICJwZzifLZxBtt5HApqL1CDh/sTxLPDgVYPMT+Bqpo+6JL ihZIklX7J6IYZswwXTGogCfDk5sGSOoj6qkC+Bm8DeXf73hxcwpSSfO8f38I1DRw4Nci gHmQ== X-Gm-Message-State: AOJu0YwHONos1GutHLRZ06ERk1cVIHHsswp0xgDx4CuceQ0vKyv7kjMh 2xMr3iDdh1kYwgIr8SV6aV8= X-Google-Smtp-Source: AGHT+IGG2h/P6RcrmCtQTBcED2djlRb0f3oltGi6k1FYRosju+ct2UwKeLIoOsHG2ceiTKsOOuMfAw== X-Received: by 2002:aa7:ca41:0:b0:534:78a6:36cb with SMTP id j1-20020aa7ca41000000b0053478a636cbmr2991841edt.39.1695988385763; Fri, 29 Sep 2023 04:53:05 -0700 (PDT) Original-Received: from [192.168.8.4] (netacc-gpn-104-239-178.pool.yettel.hu. [91.104.239.178]) by smtp.gmail.com with ESMTPSA id cm15-20020a0564020c8f00b0053537ad3936sm3501188edb.21.2023.09.29.04.53.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 Sep 2023 04:53:05 -0700 (PDT) Content-Language: sv-FI In-Reply-To: <83zg15z0a8.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" 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:271483 Archived-At: I have scroll-up/down-line mapped to a key. I'd like to see that if I press and hold these keys, Emacs can scroll continuously. It doesn't matter too much if at some position, it jumps 2 (or more) visible lines. Using prefix arguments is not a good solution for this case, because if I have a buffer with a lot of such overlays (like magit's blame buffer), it's very inconvenient that emacs stops very frequently, and then I have to nag it with a prefix argument to "please scroll further". But of course I can try to write some elisp function to work around this limitation. As scroll-down-line jumps over overlays, so it already scrolls 2 visible lines in the mentioned case, it would make sense that scroll-up-line behaves the same as well. The current behavior is not consistent. I'd expect that if scroll-down-line moves window start somewhere, then scroll-up-line will undo this. But in this case scroll-down-line will move 2 lines, then scroll-up-line doesn't do anything. On 9/29/23 13:28, Eli Zaretskii wrote: >> 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.