GNU bug report logs - #7390
24.0.50; pos-col-row gives incorrect row

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Sat, 13 Nov 2010 17:52:02 UTC

Severity: normal

Found in version 24.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Chong Yidong'" <cyd <at> stupidchicken.com>, "'Eli Zaretskii'" <eliz <at> gnu.org>
Cc: 7390 <at> debbugs.gnu.org
Subject: bug#7390: 24.0.50; pos-col-row gives incorrect row
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.





This bug report was last modified 14 years and 166 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.