Subject: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account

From: Dmitry Gutov <[email-masked]>
Date: Thu, 18 Sep 2014 13:46:24 +0400

On 09/18/2014 05:56 AM, Drew Adams wrote:

> I don't understand why the value changing helps, instead of hurts,
> in that context.  I would think that the column should not change
> just because the text is scaled.  But I'm probably missing something.

Take a look at the implementation. The function takes pixel coordinates 
and divides them by the frame-default character dimensions. 
text-scale-mode is buffer-local, so it doesn't change the latter.

> It doesn't matter whether I do or don't.  As a matter of fact, I do,
> but only a little bit - getting the column of a mouse click, using:
>
>   (car (posn-col-row (event-start event)))
>
> And I guess that code must be broken wrt text scaling.  I didn't
> realize that.

That was my point.

>> Is it aware of `posn-col-row' not being affected by text scale?
>
> I guess you mean *being* affected by it (?).  IIUC, the return
> value depends on the text scale.  Isn't that the bug you reported?

Indeed. By "not affected", I just meant that the implementation doesn't 
take it into account.