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

From: Chong Yidong <[email-masked]>
Date: Sat, 13 Nov 2010 16:13:14 -0500

Eli Zaretskii <[email-masked]> writes:

> As a matter of fact, this problem is present in Emacs 23.2 as well,
> and in the current pretest of Emacs 23.3.
>
> An easier way to reproduce is this:
>
>   emacs -Q
>   C-x b foo RET
>   M-: (setq header-line-format "foo") RET
>   M-x picture-mode RET
>
> Now type 2 lines of text, and click the mouse on the first line.

I've checked a fix for picture-mouse-set-point into the emacs-23 branch.

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).

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.  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.)