Subject: bug#45319: 28.0.50; Redisplay: `forward-char' moves backwards into invisible text

From: Michael Heerdegen <[email-masked]>
Date: Sun, 20 Dec 2020 03:15:46 +0100

Eli Zaretskii <[email-masked]> writes:

> I don't think I understand the problem well enough yet to answer that
> question, especially since you say that your simplified recipe behaves
> differently.
>
> What exactly is the problem in the magit case? does it use the value
> of point in some way, and if so, how?  IOW, what is "section
> highlighting" in magit?

Let me ask a question first, for my better understanding, I'm curious:
what's your opinion about the (in my eyes) wrong value of point present
when `post-command-hook' is run?  Is it (1) expected and totally makes
sense, should be like that, or more like (2) not relevant, should not be
relied on, or (3) makes not much sense and is not so good but hard to
get to grips?

> A stab in the dark: there's disable-point-adjustment, which could be
> set temporarily, perhaps that could help?

Would that help to fix the behavior of `hl-line-mode' marking the wrong
line?

The Magit case is not much different.  Here a "section" is simply not a
line but a set of consecutive lines denoting a commit (headline + diff,
for example).  As with hl-line-mode, the wrong section is highlighted
when moving.  But since some commands depend on the currently
highlighted section, the consequence is that these commands then operate
on the wrong section.

Regards,

Michael.