Subject: Re: bug#52092: 28.0.60; hs-toggle-hiding does not toggle once folded

From: Eli Zaretskii <[email-masked]>
Date: Sat, 24 Sep 2022 09:17:53 +0300

> From: Stefan Monnier <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  Mohammed Sadiq <[email-masked]>,
>   [email-masked]
> Date: Fri, 23 Sep 2022 18:01:05 -0400
> 
> I had no idea that (posn-point (posn-at-point POS)) doesn't return POS
> if POS is within an invisible chunk of text and instead returns the next
> visible position.

posn-at-point uses display routines, so it cannot report on invisible
POS, because the display code skips invisible text.  The doc string
kinda hints on that:

  Return nil if POS is not visible in WINDOW.  Otherwise,
  the return value is similar to that returned by ‘event-start’ for
  a mouse click at the upper left corner of the glyph corresponding
  to POS:

You cannot click a mouse on a glyph corresponding to invisible text,
can you?

We could make this more clear in the documentation.  I think this
usually isn't a problem because this function is not called for POS
calculated in some way, as opposed to positions actually displayed, or
nil.