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:58:56 +0300 Message-ID: <8338bp2cwf.fsf@gnu.org> References: <864mw529bx.fsf@yandex.ru> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1411053700 6100 80.91.229.3 (18 Sep 2014 15:21:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Sep 2014 15:21:40 +0000 (UTC) Cc: 18493@debbugs.gnu.org To: Dmitry Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 18 17:21:32 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 1XUdWS-0002B3-LH for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Sep 2014 17:21:28 +0200 Original-Received: from localhost ([::1]:51745 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUdWS-0005do-5R for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Sep 2014 11:21:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUdWH-0005UD-PV 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-0007J9-Cl for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2014 11:21:17 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUdW8-0007Hd-AQ 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 1XUdAk-0004hv-9r for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2014 10:59:02 -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 14:59:02 +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.141105234018087 (code B ref 18493); Thu, 18 Sep 2014 14:59:02 +0000 Original-Received: (at 18493) by debbugs.gnu.org; 18 Sep 2014 14:59:00 +0000 Original-Received: from localhost ([127.0.0.1]:44635 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUdAh-0004hf-0n for submit@debbugs.gnu.org; Thu, 18 Sep 2014 10:58:59 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:52807) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUdAd-0004hS-Ut for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 10:58:57 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NC300K00QQNZQ00@a-mtaout22.012.net.il> for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 17:58:54 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NC300KT1QY6Z710@a-mtaout22.012.net.il>; Thu, 18 Sep 2014 17:58:54 +0300 (IDT) In-reply-to: <864mw529bx.fsf@yandex.ru> 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:93467 Archived-At: > From: Dmitry > Date: Thu, 18 Sep 2014 02:03:46 +0400 > > 1. M-x text-scale-increase (7 times) > 2. Go to column 4. > 3. (posn-col-row (posn-at-point)) > => (15 . 24) That's the intended behavior: posn-col-row is documented to return the coordinates of its argument in canonical character units. And that is what it does here. There's no bug here. > Alternatively, please describe how to reliably recalculate the returned > value in the presence of text-scale-mode. Calculate what, exactly? The results of this function _are_ reliable. You just cannot in general use them as the logical (a.k.a. "physical") column and row number, i.e. the ordinal number of a character from the line beginning and its line number relative to window-start. You can only use them as the real column and row if your text uses the default face. But once variable-size fonts, stretch glyphs, images, and other display atrocities come into play, there's no meaningful way of talking about "columns" and "rows" that can be used as indices into the text. So the answer to your question depends on what you intend to do with the value. > > I don't even understand why the value should change with text scale. > > It would solve the problem of text-scale-mode being enabled in > buffers, where I'm getting inaccurate results from `posn-col-row' > because of that. And by "inaccurate", I mean different from the ones > I'd like. Then perhaps you want posn-col-row-as-dgutov-likes-it, not posn-col-row ;-) Seriously, though: it all depends on what you do with the results returned by this function. And you didn't explain what that is, so it is hard to tell whether there is a problem, and if so, where. IOW, please explain what is it that "you'd like".