Subject: bug#7390: 24.0.50; pos-col-row gives incorrect row

From: "Drew Adams" <[email-masked]>
Date: Sat, 13 Nov 2010 13:38:01 -0800

Thanks to you both for fixing this so quickly.

> The underlying situation is currently somewhat unsatisfactory---the
> pixel position of a mouse-event in the text area counts X 
> from the start of the text area (excluding margins and fringes),
> and Y from the top of the window (including the header line).

Yes, that's an inconsistency.

But what do we want "pixel" position to mean? Both (1) a position within the
text area and (2) a position overall (including things like scroll bars and
header lines can be useful.

We should not sacrifice one for the other. What you need in terms of a position
depends on what you are trying to do.  It seems we need either two different
functions (for each such positioning function) or an argument that determines
the behavior.

> This arises from some internal redisplay engine semantics, and is not
> really intuitive.  Rightfully, the header-line should be excluded from
> the pixel Y coordinates.

No, I don't think there is any such "rightfully".  Both behaviors are important
and useful (position within text area and position within total frame/window
including non-text decorations).  We should not decide that one of them is
"right".

But each of them needs to be consistent.

> It's not feasible to change this for Emacs 23,
> since existing code might depend on the current behavior.  But we can
> contemplate changing this in Emacs 24.
> 
> (Such a change will not affect the picture-mouse-set-point fix.)

Let's contemplate coming up with functions that give both kinds of position, not
just one.