unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 58793-done@debbugs.gnu.org
Subject: bug#58793: 28.1.90; Emacs tries to recenter / rescroll when it hits hidden org emphasis
Date: Sat, 29 Oct 2022 02:42:13 +0000	[thread overview]
Message-ID: <87h6znl5a2.fsf@localhost> (raw)
In-Reply-To: <83tu3ojvb9.fsf@gnu.org>

Eli Zaretskii <eliz@gnu.org> writes:

> Btw, you wrote to the Org list that this issue has nothing to do with
> Org, but that is inaccurate.  The bug was triggered by the fact that a
> screen line started with invisible text, and point was inside that
> invisible text.  Emacs display code assumes in a lot of places that
> the position of point is somewhere between the positions of the first
> and the last glyph of a screen line which displays the cursor.
> Invisible text at the beginning or end of a screen line violates that
> assumption, if point is inside invisible text, because invisible text
> doesn't produce glyphs on the screen.  Violating that assumption
> delivers a fatal blow to many redisplay optimizations that reuse
> previous display (instead of redrawing everything anew); one of such
> optimizations is for the situation when nothing's changed on display
> except that point moved.  The display engine is still capable of
> dealing with such unusual situations, but it is likely to recenter the
> window in these cases, something that you find jarring.

Thanks for the explanation!
AFAIU, there is no way to avoid this and also use invisible text
somewhere not at bol/eol. The best we can do is minimizing the chance
to trigger this redisplay behaviour.

> So by using invisible text too much, Org does risk triggering such
> situations more frequently.  Since the result is not fatally wrong,
> just aesthetically annoying, I could say "wontfix", because fixing
> this is notoriously complicated, and risks introducing new exciting
> bugs (I hope I didn't introduce any this time).  In this case I was
> lucky to be able to find a reasonable solution, but I cannot guarantee
> that for any similar issue in the future.  After all, arguably Emacs
> just copes with the unusual situation by falling back on the only
> fail-safe redisplay mechanism we have.  So it is not a bug, strictly
> speaking, just unusual and unexpected behavior.

> Please keep this in mind as you introduce features into Org and
> elsewhere which use invisible text.

Noted. Though I feel that we really need to have A LOT of invisible text
to hit the issue frequently. (here, I was just digging through old bug
reports in Org mailing list; it is not something people often complain
about)

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>





      reply	other threads:[~2022-10-29  2:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26  7:59 bug#58793: 28.1.90; Emacs tries to recenter / rescroll when it hits hidden org emphasis Ihor Radchenko
2022-10-26 16:35 ` Eli Zaretskii
2022-10-27  4:24   ` Ihor Radchenko
2022-10-27  6:02     ` Eli Zaretskii
2022-10-27 13:13 ` Eli Zaretskii
2022-10-28  4:07   ` Ihor Radchenko
2022-10-28  6:36     ` Eli Zaretskii
2022-10-28  6:50     ` Eli Zaretskii
2022-10-29  2:42       ` Ihor Radchenko [this message]

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=87h6znl5a2.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=58793-done@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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).