From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account Date: Thu, 18 Sep 2014 17:59:57 +0300 Message-ID: <831tr92cuq.fsf@gnu.org> References: <864mw529bx.fsf@yandex.ru> <38e6b538-3e76-472a-b371-2e74f9a14bf7@default> <541A1693.4090009@yandex.ru> <30fb9ae4-3781-4bc7-a1cf-45bf2a195929@default> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1411053707 6163 80.91.229.3 (18 Sep 2014 15:21:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Sep 2014 15:21:47 +0000 (UTC) Cc: 18493@debbugs.gnu.org, dgutov@yandex.ru To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 18 17:21:40 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XUdWd-0002Fz-S5 for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Sep 2014 17:21:39 +0200 Original-Received: from localhost ([::1]:51750 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUdWd-0005tY-Ej for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Sep 2014 11:21:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45696) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUdWG-0005Ri-Vy for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2014 11:21:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUdW8-0007J3-6s for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2014 11:21:16 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUdW8-0007Hg-4b for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2014 11:21:08 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XUdBk-0004kM-06 for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2014 11:00:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Sep 2014 15:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18493 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18493-submit@debbugs.gnu.org id=B18493.141105240018211 (code B ref 18493); Thu, 18 Sep 2014 15:00:03 +0000 Original-Received: (at 18493) by debbugs.gnu.org; 18 Sep 2014 15:00:00 +0000 Original-Received: from localhost ([127.0.0.1]:44639 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUdBf-0004je-3I for submit@debbugs.gnu.org; Thu, 18 Sep 2014 10:59:59 -0400 Original-Received: from mtaout28.012.net.il ([80.179.55.184]:47801) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUdBc-0004jU-Hf for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 10:59:57 -0400 Original-Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0NC300000QUETL00@mtaout28.012.net.il> for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 17:58:55 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NC300I43QY7AK80@mtaout28.012.net.il>; Thu, 18 Sep 2014 17:58:55 +0300 (IDT) In-reply-to: <30fb9ae4-3781-4bc7-a1cf-45bf2a195929@default> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:93469 Archived-At: > Date: Wed, 17 Sep 2014 18:56:10 -0700 (PDT) > From: Drew Adams > > > Probably none. Do you have code that calls `posn-col-row', though? > > 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. As I wrote elsewhere, whether it is broken depends on what you do with the results. E.g., if you deal with mouse clicks, the natural value to use is the underlying buffer position, not column/row. What do you need the column for? > > Does it have explicit support for text scaling? > > No, my code does not. From what I understand now, I guess it > needs to worry about that now. Seems nuts that it should have to, > but my understanding is limited... Welcome to the brave new world of variable-size characters and other Emacs display features that break the "normal" interpretation of "columns" and "rows". The only reliable way of expressing screen coordinates in the general case is with pixel values. posn-col-row just converts that to the frame's canonical character units, that's all. We have other functions which map that to buffer position or to other objects if the click event is not on buffer text. The question is what you do with what posn-col-row returns. Given the answer, it should be possible to tell you how to get at the information even when such advanced display features are in use, or maybe identify some missing Emacs functionality.