unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Géza <geza.herman@gmail.com>
Cc: 66216@debbugs.gnu.org
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	[thread overview]
Message-ID: <83zg15z0a8.fsf@gnu.org> (raw)
In-Reply-To: <ebee778c-7621-43d3-10ea-c62b8103cd00@gmail.com> (Herman@debbugs.gnu.org)

> Date: Tue, 26 Sep 2023 20:30:53 +0200
> From: Herman@debbugs.gnu.org, Géza <geza.herman@gmail.com>
> 
> 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.





  reply	other threads:[~2023-09-29 11:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26 18:30 bug#66216: 28.2; scroll-up-line doesn't work if there is a before-string overlay with newline Herman, Géza
2023-09-29 11:28 ` Eli Zaretskii [this message]
2023-09-29 11:53   ` Herman, Géza
2023-09-29 15:28     ` Eli Zaretskii
2023-09-30 17:09       ` Herman, Géza
2023-09-30 17:17         ` Eli Zaretskii
2023-09-30 17:29           ` Herman, Géza
2023-09-30 17:37             ` Eli Zaretskii
2023-09-30 19:15               ` Herman, Géza
2023-10-01  8:51                 ` Eli Zaretskii
2023-10-01 12:10                   ` Herman, Géza

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83zg15z0a8.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=66216@debbugs.gnu.org \
    --cc=geza.herman@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).