From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account Date: Fri, 19 Sep 2014 00:55:06 +0400 Message-ID: <541B46AA.2020904@yandex.ru> References: <864mw529bx.fsf@yandex.ru> <8338bp2cwf.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1411073799 16000 80.91.229.3 (18 Sep 2014 20:56:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Sep 2014 20:56:39 +0000 (UTC) Cc: 18493@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 18 22:56:31 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 1XUikb-0006L8-Tq for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Sep 2014 22:56:26 +0200 Original-Received: from localhost ([::1]:53632 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUikb-0004mu-IQ for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Sep 2014 16:56:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUikR-0004kI-AE for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2014 16:56:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUikJ-0004pn-L4 for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2014 16:56:15 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53269) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUikJ-0004pK-IW for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2014 16:56:07 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XUikE-0006p0-4T for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2014 16:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Sep 2014 20:56: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.141107371426162 (code B ref 18493); Thu, 18 Sep 2014 20:56:02 +0000 Original-Received: (at 18493) by debbugs.gnu.org; 18 Sep 2014 20:55:14 +0000 Original-Received: from localhost ([127.0.0.1]:44833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUijR-0006nt-OS for submit@debbugs.gnu.org; Thu, 18 Sep 2014 16:55:14 -0400 Original-Received: from mail-lb0-f172.google.com ([209.85.217.172]:53318) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUijP-0006nk-FN for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 16:55:12 -0400 Original-Received: by mail-lb0-f172.google.com with SMTP id p9so1363253lbv.3 for <18493@debbugs.gnu.org>; Thu, 18 Sep 2014 13:55:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=2p6lzIC/X06TK3ok4HfUv6h1fLnBLQwlWWDMp/OhSUE=; b=LPKAT2G0Pqzd7u2BtjZfNJ/nhVgjsDCOtRIxP0Xaj/ROhZRRKtVtDlC1rd7lFJNNDd 0hvAXyAOYCPVvBhtXqFu6qPCtAdErlmY24j30sExHib0A/5KhjXJP21Yy9uO+njTscG/ rXlkxnzTTZgs2iz4H8u39I+LSXD1AQFeJtevCjN3SyUdw12mQ9XnK2wyK9no4PDwXllv GlVkHE6Lb7SioCo6f6R8Q7KjzCSEYjJiDFOTNlX25cdm5AKP/VObS7ffgcTAHKuQzD1I /KnNIvWFcu668dP4M/D/uPREFM/RF/AJh0yvY+pIWO01KHa2kKGDoTHstMs/hlGuanqs Bxnw== X-Received: by 10.112.199.232 with SMTP id jn8mr2308760lbc.30.1411073709550; Thu, 18 Sep 2014 13:55:09 -0700 (PDT) Original-Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id a9sm7217858laa.3.2014.09.18.13.55.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Sep 2014 13:55:08 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 In-Reply-To: <8338bp2cwf.fsf@gnu.org> 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:93485 Archived-At: On 09/18/2014 06:58 PM, Eli Zaretskii wrote: > 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. Fair enough. Maybe define an alternative function, which does take text zoom into account? Or otherwise, I'd be fine with precise algorithm how to convert one into the other, if it's relatively simple and unlikely to change. > 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. Text zoom is different from all the other features you enumerate here, though. In programming language buffers, I usually have no images or proportional fonts, but zooming the text is something that happens once in a while. > So the answer to your question depends on what you intend to do with > the value. All the recent display engine issues I've been creating are for the same package and feature: company-mode and its overlay-based popup, which I'd like to polish up a bit before trying other methods of popup rendering, because they won't be available to users of Emacs 24.4 and older versions, and it'll likely be quite some time until the next release. > IOW, please explain what is it that "you'd like". The "current column" obtained from the return value of this function, is used to position each line of the popup in the display string of the overlay that spans the next few lines. So naturally, the return value should not depend on the zoom level. And I'm using `posn-col-row' for this because it became the consensus in the several discussions I've had with you recently on this subject.