From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 17 18:14:28 2014 Received: (at submit) by debbugs.gnu.org; 17 Sep 2014 22:14:28 +0000 Received: from localhost ([127.0.0.1]:43665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUNUa-0001fW-0G for submit@debbugs.gnu.org; Wed, 17 Sep 2014 18:14:28 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57370) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUNUX-0001fH-Uz for submit@debbugs.gnu.org; Wed, 17 Sep 2014 18:14:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUNUP-0005ke-Ps for submit@debbugs.gnu.org; Wed, 17 Sep 2014 18:14:25 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:54216) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUNUP-0005gQ-Ls for submit@debbugs.gnu.org; Wed, 17 Sep 2014 18:14:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUNKV-00075h-3V for bug-gnu-emacs@gnu.org; Wed, 17 Sep 2014 18:04:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUNKP-0001mq-4i for bug-gnu-emacs@gnu.org; Wed, 17 Sep 2014 18:04:03 -0400 Received: from mail-lb0-x22a.google.com ([2a00:1450:4010:c04::22a]:62516) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUNKO-0001mJ-U0 for bug-gnu-emacs@gnu.org; Wed, 17 Sep 2014 18:03:57 -0400 Received: by mail-lb0-f170.google.com with SMTP id c11so2808548lbj.29 for ; Wed, 17 Sep 2014 15:03:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version:content-type; bh=vTCNBeLGGUmflNIRNkkvVMsQG7XF7ywAY7hoOIr115s=; b=zRdiBf/rz4fbICvaEgEQh/KUes0iT7T5peOCEEnatbiE57deQjNb/YIqrDCfNZvrfY Zi2cC/pVetsehREN7nFcm9fBuwWqdFT5MISbUxS2RL/WXppbNo3EGx5h8z68Ic8nQHvy 2YpHOjjTZcyKazMOFSPYioNKfVkpafkehx3CjSCU+d6yEEIEtNFkHDUV+EN01VSmuNbD RP0edMVpQp3CgMmoRDUecdtdg26x1dcOVZD8TMruaOUyVh0bi/dWJ5jLl+6VKh1mE0ND NT2LRxCASjZG/nFpuHlcC/9TWKAcnCS9I5jglSKY+KmDqv6jM3cZwDRnSibme+BxFIMW VV0g== X-Received: by 10.152.37.169 with SMTP id z9mr566729laj.66.1410991430437; Wed, 17 Sep 2014 15:03:50 -0700 (PDT) Received: from axl ([178.252.98.87]) by mx.google.com with ESMTPSA id uj2sm6547124lbc.28.2014.09.17.15.03.48 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 17 Sep 2014 15:03:49 -0700 (PDT) From: Dmitry To: bug-gnu-emacs@gnu.org Subject: 24.3.93; posn-col-row should take text-scale-mode into account Date: Thu, 18 Sep 2014 02:03:46 +0400 Message-ID: <864mw529bx.fsf@yandex.ru> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) 1. M-x text-scale-increase (7 times) 2. Go to column 4. 3. (posn-col-row (posn-at-point)) => (15 . 24) Alternatively, please describe how to reliably recalculate the returned value in the presence of text-scale-mode. In GNU Emacs 24.3.93.3 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of 2014-09-05 on axl Repository revision: 117482 monnier@iro.umontreal.ca-20140904161426-2072ebabqpyhaadw Windowing system distributor `The X.Org Foundation', version 11.0.11501000 System Description: Ubuntu 14.04.1 LTS From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 17 18:53:09 2014 Received: (at 18493) by debbugs.gnu.org; 17 Sep 2014 22:53:09 +0000 Received: from localhost ([127.0.0.1]:43686 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUO61-0002fj-2a for submit@debbugs.gnu.org; Wed, 17 Sep 2014 18:53:09 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:21237) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUO5y-0002fa-Ip for 18493@debbugs.gnu.org; Wed, 17 Sep 2014 18:53:07 -0400 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s8HMr4Gq028720 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 17 Sep 2014 22:53:04 GMT Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s8HMr3pp007857 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 17 Sep 2014 22:53:03 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userz7022.oracle.com (8.14.5+Sun/8.14.4) with ESMTP id s8HMr2lc007835; Wed, 17 Sep 2014 22:53:03 GMT MIME-Version: 1.0 Message-ID: <38e6b538-3e76-472a-b371-2e74f9a14bf7@default> Date: Wed, 17 Sep 2014 15:53:01 -0700 (PDT) From: Drew Adams To: Dmitry , 18493@debbugs.gnu.org Subject: RE: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account References: <864mw529bx.fsf@yandex.ru> In-Reply-To: <864mw529bx.fsf@yandex.ru> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 18493 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.0 (---) > 1. M-x text-scale-increase (7 times) > 2. Go to column 4. > 3. (posn-col-row (posn-at-point)) > =3D> (15 . 24) >=20 > Alternatively, please describe how to reliably recalculate the > returned value in the presence of text-scale-mode. I don't even understand why the value should change with text scale. What part of the description of `pos-col-row' would lead one to think that this changes with text scale? From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 17 19:17:48 2014 Received: (at 18493) by debbugs.gnu.org; 17 Sep 2014 23:17:48 +0000 Received: from localhost ([127.0.0.1]:43705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUOTr-0003Im-7F for submit@debbugs.gnu.org; Wed, 17 Sep 2014 19:17:47 -0400 Received: from mail-lb0-f175.google.com ([209.85.217.175]:42892) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUOTo-0003Ic-J9 for 18493@debbugs.gnu.org; Wed, 17 Sep 2014 19:17:45 -0400 Received: by mail-lb0-f175.google.com with SMTP id n15so71857lbi.20 for <18493@debbugs.gnu.org>; Wed, 17 Sep 2014 16:17:43 -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:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=JucPMBOL5pwUatBjADuERPScZoszniK2xdkgn2u3Mwk=; b=U9IOs0NMQ04hgFPxDruWpU79cSMw/67lAJXntaC0vNm+Akecv7gMOe3XtQve6BNNf2 NCtcANeeJNC+iGP7Ua28v0iQXpPzvyL/gMbBzrazK+JTmm6R2hJlqV0LAWrpc4RPdMXE 4GyUJe8+c1UPQftQ4JJN5/324ymMr1FXAx17ntDLDhWjMVqecZ7ExOID6OeiwDfRtN7K IFjfTxHf6oN7VsXGTteQh4yrYJVaB7bX25AHKqiUiEDm8Z0AWDJdCEsdiiezl45dCjUk TcNpSx15ZSVEOY3Gh7TlJl53jXrr+a2DfMJBWf+G+52Y+4gl2sHzSvHkQHlg1M3KkE7s waKg== X-Received: by 10.112.78.38 with SMTP id y6mr417669lbw.94.1410995863365; Wed, 17 Sep 2014 16:17:43 -0700 (PDT) Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id c9sm6342472laa.23.2014.09.17.16.17.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Sep 2014 16:17:42 -0700 (PDT) Message-ID: <541A1693.4090009@yandex.ru> Date: Thu, 18 Sep 2014 03:17:39 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Drew Adams , 18493@debbugs.gnu.org Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account References: <864mw529bx.fsf@yandex.ru> <38e6b538-3e76-472a-b371-2e74f9a14bf7@default> In-Reply-To: <38e6b538-3e76-472a-b371-2e74f9a14bf7@default> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18493 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 09/18/2014 02:53 AM, Drew Adams wrote: > 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. > What part of the description of `pos-col-row' would lead one to think > that this changes with text scale? Probably none. Do you have code that calls `posn-col-row', though? Is it aware of `posn-col-row' not being affected by text scale? Does it have explicit support for text scaling? From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 17 21:56:17 2014 Received: (at 18493) by debbugs.gnu.org; 18 Sep 2014 01:56:17 +0000 Received: from localhost ([127.0.0.1]:43770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUQxF-0007Ei-53 for submit@debbugs.gnu.org; Wed, 17 Sep 2014 21:56:17 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:40038) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUQxC-0007Ea-Ji for 18493@debbugs.gnu.org; Wed, 17 Sep 2014 21:56:15 -0400 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s8I1uDdG019302 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 18 Sep 2014 01:56:13 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s8I1uC1C027725 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 18 Sep 2014 01:56:12 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s8I1uB8B027710; Thu, 18 Sep 2014 01:56:12 GMT MIME-Version: 1.0 Message-ID: <30fb9ae4-3781-4bc7-a1cf-45bf2a195929@default> Date: Wed, 17 Sep 2014 18:56:10 -0700 (PDT) From: Drew Adams To: Dmitry Gutov , 18493@debbugs.gnu.org Subject: RE: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account References: <864mw529bx.fsf@yandex.ru> <38e6b538-3e76-472a-b371-2e74f9a14bf7@default> <541A1693.4090009@yandex.ru> In-Reply-To: <541A1693.4090009@yandex.ru> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 18493 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.0 (---) > > I don't even understand why the value should change with text > > scale. >=20 > 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. 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. > > What part of the description of `pos-col-row' would lead one to > > think that this changes with text scale? >=20 > 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. > 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? That's the bug I see (though someone will no doubt explain why they think it is TRT). > 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... From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 18 05:32:55 2014 Received: (at 18493) by debbugs.gnu.org; 18 Sep 2014 09:32:55 +0000 Received: from localhost ([127.0.0.1]:43931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUY59-000220-36 for submit@debbugs.gnu.org; Thu, 18 Sep 2014 05:32:55 -0400 Received: from mout.gmx.net ([212.227.15.15]:55873) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUY57-00021s-6I for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 05:32:53 -0400 Received: from [188.22.105.144] ([188.22.105.144]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0M936L-1XcUiC1Gvd-00CQrn; Thu, 18 Sep 2014 11:32:49 +0200 Message-ID: <541AA6BB.90108@gmx.at> Date: Thu, 18 Sep 2014 11:32:43 +0200 From: martin rudalics MIME-Version: 1.0 To: Dmitry , 18493@debbugs.gnu.org Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account References: <864mw529bx.fsf@yandex.ru> In-Reply-To: <864mw529bx.fsf@yandex.ru> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:ZLMBAAarxp4ZTBGqBU4xDxyprm0bv4064iFGWLbcdd4IE+ZYf7b OsQlNs0gyw3hcV/AhULY0oGcP7ImInC3FtG//UmuEVGSQyB5CDzjumJPrgWr2MWSjtCWMTT rxgE1kavWi1bAzZdF/h94ewZIur+3+UAMvqKuwaiEz6bN391ocbuqWsgWq4JsYZFk2ZBgkf nrOXH7wov349bDAFOlt3w== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18493 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > Alternatively, please describe how to reliably recalculate the returned > value in the presence of text-scale-mode. `posn-actual-col-row'? martin From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 18 05:35:40 2014 Received: (at 18493) by debbugs.gnu.org; 18 Sep 2014 09:35:40 +0000 Received: from localhost ([127.0.0.1]:43947 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUY7n-00027W-M9 for submit@debbugs.gnu.org; Thu, 18 Sep 2014 05:35:40 -0400 Received: from mail-la0-f49.google.com ([209.85.215.49]:37357) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUY7k-00027N-E9 for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 05:35:37 -0400 Received: by mail-la0-f49.google.com with SMTP id pn19so760100lab.36 for <18493@debbugs.gnu.org>; Thu, 18 Sep 2014 02:35:35 -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:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=ZAIRk9pqIKx5xOlWgtkfdYRo7dLriYH4bjTk/MQrF7g=; b=qNTGIp/qpvz0K2kRz6zDTXbMMbxfF7Pj0kJ9wy3jAqazwfmnbAbUL56KAB+x8riewa iar83IMGO8QzP6fwOsrO1kAn8UEezzz0FHlKsGkfPZwlhTjZh7S0IT8IQTR5ZH40JBek M0QPYc6kJR6aQTFhmsJU7vK3MRqAZvI6webdXbDmYzho+hWU2Ll8T5k1Be2tN60beYXy vdYa9J5pjrR9A1Y+BUUNXDYniUag7lhsmjOGumcwo/OTXsbxg/PPd6hwCPLFVla+oDoe XsQoSpzELAxyUk67ZKTI9rqQ3SrEHoaDE0u2+sAReV+HuuYhunnj9d4Wctl69FgmE0Oy o6FQ== X-Received: by 10.112.200.134 with SMTP id js6mr3065023lbc.0.1411032935195; Thu, 18 Sep 2014 02:35:35 -0700 (PDT) Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id u8sm4631552lbb.25.2014.09.18.02.35.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Sep 2014 02:35:33 -0700 (PDT) Message-ID: <541AA762.10002@yandex.ru> Date: Thu, 18 Sep 2014 13:35:30 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: martin rudalics , 18493@debbugs.gnu.org Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account References: <864mw529bx.fsf@yandex.ru> <541AA6BB.90108@gmx.at> In-Reply-To: <541AA6BB.90108@gmx.at> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18493 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 09/18/2014 01:32 PM, martin rudalics wrote: > > Alternatively, please describe how to reliably recalculate the returned > > value in the presence of text-scale-mode. > > `posn-actual-col-row'? It works for row number, but it's not good enough for column number, because it doesn't take character widths into account (mostly a problem with tab characters). From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 18 05:46:32 2014 Received: (at 18493) by debbugs.gnu.org; 18 Sep 2014 09:46:32 +0000 Received: from localhost ([127.0.0.1]:43951 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUYIJ-0003eN-7Q for submit@debbugs.gnu.org; Thu, 18 Sep 2014 05:46:31 -0400 Received: from mail-lb0-f176.google.com ([209.85.217.176]:51760) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUYIH-0003eE-8j for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 05:46:29 -0400 Received: by mail-lb0-f176.google.com with SMTP id z11so759231lbi.7 for <18493@debbugs.gnu.org>; Thu, 18 Sep 2014 02:46:28 -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:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=YEkT4w6z6T1doy1N0CqgN1aOthTNS9yFlN0HvxSsQdI=; b=IA7GmG4lUqX0m2dxQMXDSYAYlVELF9UwSYyR8sVgsMWreMXx/6y4M7RvGqyCW3Yb5C 5BTLJpFBFITGIQdr8hjOERTLjbvK967LRuPCQQb8vkRqWyq37Yt+rSRw++Obz1mLYKMT 8n0RQUg7Cv8kuGjiKrPq6TCZF574LSAWYwUZ+bnkzu64kgndWgmsPguZm5fcliI/QH6Q /QKWzeWXQSUCubCOcK7ZN0MZc/Pt9APTS57CihgcjOwdiXgRibxLm7oG8rcHGhhvZFtc U+zORqTmbFMXR43Jkdb/7sWI712GtFeHMm0vhaKYfnR5suREVN/Ck8ULbzE0HCEtOTTu vxbw== X-Received: by 10.112.48.100 with SMTP id k4mr2116064lbn.95.1411033587941; Thu, 18 Sep 2014 02:46:27 -0700 (PDT) Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id nj4sm2027798lbc.8.2014.09.18.02.46.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Sep 2014 02:46:27 -0700 (PDT) Message-ID: <541AA9F0.2050409@yandex.ru> Date: Thu, 18 Sep 2014 13:46:24 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Drew Adams , 18493@debbugs.gnu.org Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account References: <864mw529bx.fsf@yandex.ru> <38e6b538-3e76-472a-b371-2e74f9a14bf7@default> <541A1693.4090009@yandex.ru> <30fb9ae4-3781-4bc7-a1cf-45bf2a195929@default> In-Reply-To: <30fb9ae4-3781-4bc7-a1cf-45bf2a195929@default> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18493 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 18 10:59:00 2014 Received: (at 18493) by debbugs.gnu.org; 18 Sep 2014 14:59:00 +0000 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 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 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) 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) Date: Thu, 18 Sep 2014 17:58:56 +0300 From: Eli Zaretskii Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account In-reply-to: <864mw529bx.fsf@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Message-id: <8338bp2cwf.fsf@gnu.org> References: <864mw529bx.fsf@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18493 Cc: 18493@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > 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". From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 18 10:59:59 2014 Received: (at 18493) by debbugs.gnu.org; 18 Sep 2014 15:00:00 +0000 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 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 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) 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) Date: Thu, 18 Sep 2014 17:59:57 +0300 From: Eli Zaretskii Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account In-reply-to: <30fb9ae4-3781-4bc7-a1cf-45bf2a195929@default> X-012-Sender: halo1@inter.net.il To: Drew Adams 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> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18493 Cc: 18493@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 18 11:37:27 2014 Received: (at 18493) by debbugs.gnu.org; 18 Sep 2014 15:37:28 +0000 Received: from localhost ([127.0.0.1]:44657 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUdlu-0005ll-VR for submit@debbugs.gnu.org; Thu, 18 Sep 2014 11:37:27 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:49489) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUdls-0005ld-Vm for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 11:37:25 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s8IFbMhF028595 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 18 Sep 2014 15:37:23 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s8IFbM2P022344 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Sep 2014 15:37:22 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s8IFbM3f004494; Thu, 18 Sep 2014 15:37:22 GMT MIME-Version: 1.0 Message-ID: <5f49d157-07b3-4d47-9866-3726f8c7ec0a@default> Date: Thu, 18 Sep 2014 08:37:21 -0700 (PDT) From: Drew Adams To: Dmitry Gutov , 18493@debbugs.gnu.org Subject: RE: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account References: <864mw529bx.fsf@yandex.ru> <38e6b538-3e76-472a-b371-2e74f9a14bf7@default> <541A1693.4090009@yandex.ru> <30fb9ae4-3781-4bc7-a1cf-45bf2a195929@default> <541AA9F0.2050409@yandex.ru> In-Reply-To: <541AA9F0.2050409@yandex.ru> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 18493 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.0 (---) > > 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. >=20 > 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. Yes, I guessed that. That sounds like the wrong behavior, to me. The frame char size is not useful here, I would think. What counts, for visual _columns_ is the visual char size, i.e., from text scaling. IOW, I don't see why scaling is not taken into account when calculating the position in column terms. But what do I know? I'm just asking what the rationale or use case is behind this behavior. > That was my point. Yes, I gathered that. Dunno whether we are saying the same thing or not. I'm questioning whether the frame char size or the text-scale char size should be used, to define what "columns" are here. I would think the latter. But I haven't tried to think this through carefully. Perhaps there are other considerations motivating this design, which have not occurred to me. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 18 11:37:34 2014 Received: (at 18493) by debbugs.gnu.org; 18 Sep 2014 15:37:34 +0000 Received: from localhost ([127.0.0.1]:44660 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUdm1-0005m6-05 for submit@debbugs.gnu.org; Thu, 18 Sep 2014 11:37:33 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:49546) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUdlz-0005lx-L3 for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 11:37:32 -0400 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s8IFbUFL028679 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 18 Sep 2014 15:37:30 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s8IFbTJW028884 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Sep 2014 15:37:29 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s8IFbT21022643; Thu, 18 Sep 2014 15:37:29 GMT MIME-Version: 1.0 Message-ID: Date: Thu, 18 Sep 2014 08:37:28 -0700 (PDT) From: Drew Adams To: Eli Zaretskii , Drew Adams Subject: RE: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account References: <<864mw529bx.fsf@yandex.ru>> <<38e6b538-3e76-472a-b371-2e74f9a14bf7@default>> <<541A1693.4090009@yandex.ru>> <<30fb9ae4-3781-4bc7-a1cf-45bf2a195929@default>> <<831tr92cuq.fsf@gnu.org>> In-Reply-To: <<831tr92cuq.fsf@gnu.org>> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 18493 Cc: 18493@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.0 (---) > > 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. >=20 > 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? I pass the column and row to `icicle-raise-Completions-frame', which calls (set-mouse-position (selected-frame) col row) > > > 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... >=20 > 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. =20 OK, I can understand that. > posn-col-row just converts that to the frame's canonical > character units, that's all. =20 That's precisely the question raised in this thread (at least by me, and I think maybe by Dmitry). Why? Why doesn't (shouldn't) it take text scaling into account? What's the value of using the frame char size for calculating visual columns in the presence of text scaling? > We have other functions which map that to buffer position or > to other objects if the click event is not on buffer text. OK. And I see that Martin pointed to `posn-actual-col-row'. So I guess I will need to use something like this: (if (fboundp 'posn-actual-col-row) (posn-actual-col-row ...) (posn-col-row ...)) That's not a problem for me. But why? Why wouldn't it be TRT to have `posn-col-row' return the visual column, i.e., compensate for text scaling? Is there an advantage in using frame char size for it instead? > The question is what you do with what posn-col-row returns. See above. I return the mouse pointer to the clicked position. I do some stuff, redisplay the (updated list of) candidates in=20 *Completions*, raise the frame showing *Completions*, optionally move that frame to the display edge (if one-window-p, and respecting a user option), and reposition the mouse pointer where it was when clicked. I do the last part because user actions on individual candidates can intentionally call `select-frame-set-input-focus', which can position the mouse pointer on a standalone minibuffer frame. (And that is very unhandy.) > 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. I guess the answer to that is the workaround code above. I have no problem with doing that. I still ask the question: Why? What is the advantage of disregarding text scaling here? =20 Why/when would anyone who wants the column and row not want the column and row wrt the apparent char size (e.g. due to text scaling)? Why/when would s?he instead want the column and row as determined by the frame default char size? Just asking. Maybe there is a good reason (e.g. a use case). So far, I don't see it. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 18 11:53:05 2014 Received: (at 18493) by debbugs.gnu.org; 18 Sep 2014 15:53:05 +0000 Received: from localhost ([127.0.0.1]:44681 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUe12-0006BC-Fl for submit@debbugs.gnu.org; Thu, 18 Sep 2014 11:53:05 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:32416) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUe0z-0006Am-DD for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 11:53:02 -0400 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s8IFqvhn008390 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 18 Sep 2014 15:52:58 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s8IFqufa025202 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Sep 2014 15:52:57 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s8IFquhA013934; Thu, 18 Sep 2014 15:52:56 GMT MIME-Version: 1.0 Message-ID: <955c9f56-902e-4e21-8cfe-e2b8d2a37ead@default> Date: Thu, 18 Sep 2014 08:52:55 -0700 (PDT) From: Drew Adams To: Eli Zaretskii , Dmitry Subject: RE: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account References: <<864mw529bx.fsf@yandex.ru>> <<8338bp2cwf.fsf@gnu.org>> In-Reply-To: <<8338bp2cwf.fsf@gnu.org>> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 18493 Cc: 18493@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.0 (---) > 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. Yes, but why? > There's no bug here. > 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. If there is no meaningful way to talk about columns and rows then a function that returns the column and row might as well run around the block and then take a nap. I understand your argument, I think. But there is a difference between saying (a) that we cannot know just what visual column/row is involved in the general case, in the presence of the many possible display considerations and saying (b) that we cannot do that in any cases. The case of text scaling seems to me to be a case where we can meaningfully return the visual column and row. No? So that general give-up argument disappears in this case. Granted, there is another possible question: Why not have both, as separate functions - IOW, what we apparently have now, with the=20 presence of function `posn-actual-col-row'. But why? Is there really a use case for obtaining what `posn-col-row' currently returns in a text-scaling context? And if `posn-actual-col-row' really does return the actual, visual column and row, then what does that say about your general can't-do argument above? And if it does not really do that, then why does it have that name "actual", and why does its doc give the impression that it does really do that? > So the answer to your question depends on what you intend to do with > the value. >=20 > > > 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. >=20 > Then perhaps you want posn-col-row-as-dgutov-likes-it, not posn-col- > row ;-) >=20 > 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. >=20 > IOW, please explain what is it that "you'd like". I agree that the whole question of this design depends on the answer to your question: what do you intend to do with the return values. So let me ask you that same question: what is the use case that the current design supports? What do you imagine might be a use for obtaining the frame-char column and row and not wanting the "actual" column and row? I am generally in favor of allowing for such differences, as users are pretty clever at coming up with uses for them. But here I don't (yet) see it. And presumably the designers had something in mind, when they chose to return the column & row based on frame char size even in the presence of scaling. IOW, why have two separate functions, `posn-col-row' and `posn-actual-col-row'? It's just a question. Knowing the design is as it is can help users put the various functions to best use. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 18 12:39:27 2014 Received: (at 18493) by debbugs.gnu.org; 18 Sep 2014 16:39:27 +0000 Received: from localhost ([127.0.0.1]:44702 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUeju-0007OQ-Cs for submit@debbugs.gnu.org; Thu, 18 Sep 2014 12:39:26 -0400 Received: from mtaout24.012.net.il ([80.179.55.180]:42055) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUejo-0007Nn-4B for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 12:39:22 -0400 Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NC300500UW6W400@mtaout24.012.net.il> for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 19:33:56 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NC300NH5VCK9K90@mtaout24.012.net.il>; Thu, 18 Sep 2014 19:33:56 +0300 (IDT) Date: Thu, 18 Sep 2014 19:39:20 +0300 From: Eli Zaretskii Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account In-reply-to: X-012-Sender: halo1@inter.net.il To: Drew Adams Message-id: <83sijo2893.fsf@gnu.org> References: <864mw529bx.fsf@yandex.ru> <38e6b538-3e76-472a-b371-2e74f9a14bf7@default> <541A1693.4090009@yandex.ru> <30fb9ae4-3781-4bc7-a1cf-45bf2a195929@default> <831tr92cuq.fsf@gnu.org> X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > Date: Thu, 18 Sep 2014 08:37:28 -0700 (PDT) > From: Drew Adams > Cc: dgutov@yandex.ru, 18493@debbugs.gnu.org > > > > 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? > > I pass the column and row to `icicle-raise-Completions-frame', > which calls (set-mouse-position (selected-frame) col row) [...] Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 1.5 COMPENSATION "Compensation" X-Debbugs-Envelope-To: 18493 Cc: 18493@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Thu, 18 Sep 2014 08:37:28 -0700 (PDT) > From: Drew Adams > Cc: dgutov@yandex.ru, 18493@debbugs.gnu.org > > > > 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? > > I pass the column and row to `icicle-raise-Completions-frame', > which calls (set-mouse-position (selected-frame) col row) Then you should be fine, because set-mouse-position expects _exactly_ the "column" and "row" that posn-col-row returns. (Its doc string could tell that more clearly, but I looked at the implementation.) > > posn-col-row just converts [pixels] to the frame's canonical > > character units, that's all. > > That's precisely the question raised in this thread (at least > by me, and I think maybe by Dmitry). Why? Why doesn't > (shouldn't) it take text scaling into account? What's the > value of using the frame char size for calculating visual > columns in the presence of text scaling? Because in many use cases this is exactly what you want to pass to other functions, which expect that. > So I guess I will need to use something like this: > > (if (fboundp 'posn-actual-col-row) > (posn-actual-col-row ...) > (posn-col-row ...)) Not necessarily: posn-actual-col-row has its own quirks, see its doc string and the discussions in bug #18384. > But why? Why wouldn't it be TRT to have `posn-col-row' return > the visual column, i.e., compensate for text scaling? Because in most cases you will not be able to do anything useful with such a "column" that you cannot do with the buffer position that is already available in the click event and in some other posn-* functions. > Is there an advantage in using frame char size for it instead? The advantage, as I see it, is that many Emacs APIs expect such units. Of course, this is just a guess: I didn't design that function and didn't write its first versions. But after hacking display-related code for some time, it makes perfect sense to me. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 18 12:50:08 2014 Received: (at 18493) by debbugs.gnu.org; 18 Sep 2014 16:50:08 +0000 Received: from localhost ([127.0.0.1]:44709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUeuF-0007gt-SG for submit@debbugs.gnu.org; Thu, 18 Sep 2014 12:50:08 -0400 Received: from mtaout25.012.net.il ([80.179.55.181]:49239) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUeuC-0007ga-DU for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 12:50:05 -0400 Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NC300300VKKEO00@mtaout25.012.net.il> for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 19:44:54 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NC3003RPVUTZ100@mtaout25.012.net.il>; Thu, 18 Sep 2014 19:44:54 +0300 (IDT) Date: Thu, 18 Sep 2014 19:50:05 +0300 From: Eli Zaretskii Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account In-reply-to: <5f49d157-07b3-4d47-9866-3726f8c7ec0a@default> X-012-Sender: halo1@inter.net.il To: Drew Adams Message-id: <83r3z827r6.fsf@gnu.org> References: <864mw529bx.fsf@yandex.ru> <38e6b538-3e76-472a-b371-2e74f9a14bf7@default> <541A1693.4090009@yandex.ru> <30fb9ae4-3781-4bc7-a1cf-45bf2a195929@default> <541AA9F0.2050409@yandex.ru> <5f49d157-07b3-4d47-9866-3726f8c7ec0a@default> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18493 Cc: 18493@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Thu, 18 Sep 2014 08:37:21 -0700 (PDT) > From: Drew Adams > > > > 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. > > Yes, I guessed that. That sounds like the wrong behavior, to me. > The frame char size is not useful here, I would think. What counts, > for visual _columns_ is the visual char size, i.e., from text scaling. Perhaps in the case of text scaling, it does (and even then there are reasons for the current behavior, see my other mail). But text scaling is just one particular feature that Emacs display supports; there are many more where it is meaningless to talk about "columns". E.g., how do you measure an inline image in columns? what would be the "column" of the first character displayed after such an image? What about stretches of whitespace created by the likes of ':align-to' display properties -- how do you measure them in "columns" in some useful and predictable manner? Either we want a general solution, or something for "simple" use cases. The former is not possible, as I hope you will agree; the only general solution is to use pixel coordinates. The "simple" solution we already have, it just doesn't go far enough to cover text scaling, and it will take some serious arguments and real-life use cases to convince me that we should go farther or introduce a new API for those use cases. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 18 13:00:33 2014 Received: (at 18493) by debbugs.gnu.org; 18 Sep 2014 17:00:33 +0000 Received: from localhost ([127.0.0.1]:44713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUf4K-0007y3-2s for submit@debbugs.gnu.org; Thu, 18 Sep 2014 13:00:33 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:60845) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUf4G-0007xr-Jl for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 13:00:29 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NC300200WFNHC00@a-mtaout20.012.net.il> for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 20:00:26 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NC3002J3WKQ7M60@a-mtaout20.012.net.il>; Thu, 18 Sep 2014 20:00:26 +0300 (IDT) Date: Thu, 18 Sep 2014 20:00:29 +0300 From: Eli Zaretskii Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account In-reply-to: <955c9f56-902e-4e21-8cfe-e2b8d2a37ead@default> X-012-Sender: halo1@inter.net.il To: Drew Adams Message-id: <83ppes279u.fsf@gnu.org> References: <955c9f56-902e-4e21-8cfe-e2b8d2a37ead@default> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18493 Cc: 18493@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Thu, 18 Sep 2014 08:52:55 -0700 (PDT) > From: Drew Adams > Cc: 18493@debbugs.gnu.org > > > 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. > > If there is no meaningful way to talk about columns and rows then > a function that returns the column and row might as well run around > the block and then take a nap. You are being carried away, and probably also influenced by the "usual" meaning of "column" and "row". What posn-col-row returns are not arbitrary random values it finds around the block. It returns precise coordinates in units of canonical character size. These values are useful because there are functions in Emacs that expect them. So, while it is meaningless to talk about "columns" and "rows" in their usual meanings, it is still meaningful to talk about coordinates measured in canonical character cell units. > The case of text scaling seems to me to be a case where we can > meaningfully return the visual column and row. In my other mail I wrote that the buffer position is all you need for that, and you already have it. So I see no general problem here, unless someone shows a particular use case where that is not enough for some reason. Then we can reason whether what's needed is "scalable" variant of posn-col-row or something else. > And if `posn-actual-col-row' really does return the actual, visual > column and row It doesn't. posn-actual-col-row is just an accessor function to some of the data in the click event. See the discussions I pointed to. > So let me ask you that same question: what is the use case that the > current design supports? Just grep the Lisp files for that function, there are several dozens of its uses throughout Emacs (and a few more in C). > IOW, why have two separate functions, `posn-col-row' and > `posn-actual-col-row'? They do 2 very different things. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 18 13:12:52 2014 Received: (at 18493) by debbugs.gnu.org; 18 Sep 2014 17:12:52 +0000 Received: from localhost ([127.0.0.1]:44718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUfGG-0008Hu-B5 for submit@debbugs.gnu.org; Thu, 18 Sep 2014 13:12:52 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:44232) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUfGD-0008Hl-I9 for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 13:12:50 -0400 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s8IHCmiQ011225 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 18 Sep 2014 17:12:48 GMT Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s8IHChDl021012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Sep 2014 17:12:45 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userz7022.oracle.com (8.14.5+Sun/8.14.4) with ESMTP id s8IHCg4Z020889; Thu, 18 Sep 2014 17:12:43 GMT MIME-Version: 1.0 Message-ID: <8f034192-1e1a-46d8-8ec9-63f2060a93a9@default> Date: Thu, 18 Sep 2014 10:12:40 -0700 (PDT) From: Drew Adams To: Eli Zaretskii , Drew Adams Subject: RE: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account References: <<864mw529bx.fsf@yandex.ru>> <<38e6b538-3e76-472a-b371-2e74f9a14bf7@default>> <<541A1693.4090009@yandex.ru>> <<30fb9ae4-3781-4bc7-a1cf-45bf2a195929@default>> <<831tr92cuq.fsf@gnu.org>> <> <<83sijo2893.fsf@gnu.org>> In-Reply-To: <<83sijo2893.fsf@gnu.org>> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 18493 Cc: 18493@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.0 (---) > > I pass the column and row to `icicle-raise-Completions-frame', > > which calls (set-mouse-position (selected-frame) col row) >=20 > Then you should be fine, because set-mouse-position expects > _exactly_ the "column" and "row" that posn-col-row returns. (Its doc > string could tell that more clearly, but I looked at the implementation.) Good to know. Yes, it would be good for the differences to be made clear in the doc - esp. wrt use cases. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 18 13:22:25 2014 Received: (at 18493) by debbugs.gnu.org; 18 Sep 2014 17:22:25 +0000 Received: from localhost ([127.0.0.1]:44722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUfPU-000068-GT for submit@debbugs.gnu.org; Thu, 18 Sep 2014 13:22:25 -0400 Received: from mtaout25.012.net.il ([80.179.55.181]:50441) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUfPR-00005v-QK for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 13:22:22 -0400 Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NC300800WU4VP00@mtaout25.012.net.il> for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 20:17:11 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NC30034JXCNZ170@mtaout25.012.net.il>; Thu, 18 Sep 2014 20:17:11 +0300 (IDT) Date: Thu, 18 Sep 2014 20:22:22 +0300 From: Eli Zaretskii Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account In-reply-to: <8f034192-1e1a-46d8-8ec9-63f2060a93a9@default> X-012-Sender: halo1@inter.net.il To: Drew Adams Message-id: <83oauc269d.fsf@gnu.org> References: <864mw529bx.fsf@yandex.ru> <38e6b538-3e76-472a-b371-2e74f9a14bf7@default> <541A1693.4090009@yandex.ru> <30fb9ae4-3781-4bc7-a1cf-45bf2a195929@default> <831tr92cuq.fsf@gnu.org> <83sijo2893.fsf@gnu.org> <8f034192-1e1a-46d8-8ec9-63f2060a93a9@default> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18493 Cc: 18493@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Thu, 18 Sep 2014 10:12:40 -0700 (PDT) > From: Drew Adams > Cc: dgutov@yandex.ru, 18493@debbugs.gnu.org > > > > I pass the column and row to `icicle-raise-Completions-frame', > > > which calls (set-mouse-position (selected-frame) col row) > > > > Then you should be fine, because set-mouse-position expects > > _exactly_ the "column" and "row" that posn-col-row returns. (Its doc > > string could tell that more clearly, but I looked at the implementation.) > > Good to know. Yes, it would be good for the differences to be made > clear in the doc - esp. wrt use cases. I fixed the doc string. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 18 16:55:14 2014 Received: (at 18493) by debbugs.gnu.org; 18 Sep 2014 20:55:14 +0000 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 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 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) 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) Message-ID: <541B46AA.2020904@yandex.ru> Date: Fri, 19 Sep 2014 00:55:06 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account References: <864mw529bx.fsf@yandex.ru> <8338bp2cwf.fsf@gnu.org> In-Reply-To: <8338bp2cwf.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18493 Cc: 18493@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 18 21:00:37 2014 Received: (at 18493) by debbugs.gnu.org; 19 Sep 2014 01:00:37 +0000 Received: from localhost ([127.0.0.1]:44939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUmYv-0007T4-8y for submit@debbugs.gnu.org; Thu, 18 Sep 2014 21:00:37 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:37631) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUmYr-0007OU-VN for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 21:00:34 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVNFpZEG/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCy0HEhQYDSSIBAjSGReOegcKhC4EqRmBaoNMIQ X-IPAS-Result: ArYGAIDvNVNFpZEG/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCy0HEhQYDSSIBAjSGReOegcKhC4EqRmBaoNMIQ X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="90242821" Received: from 69-165-145-6.dsl.teksavvy.com (HELO pastel.home) ([69.165.145.6]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Sep 2014 21:00:32 -0400 Received: by pastel.home (Postfix, from userid 20848) id F3F7467A07; Thu, 18 Sep 2014 21:00:31 -0400 (EDT) From: Stefan Monnier To: Drew Adams Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account Message-ID: References: <864mw529bx.fsf@yandex.ru>> <38e6b538-3e76-472a-b371-2e74f9a14bf7@default>> <541A1693.4090009@yandex.ru>> <30fb9ae4-3781-4bc7-a1cf-45bf2a195929@default>> <831tr92cuq.fsf@gnu.org>> Date: Thu, 18 Sep 2014 21:00:31 -0400 In-Reply-To: (Drew Adams's message of "Thu, 18 Sep 2014 08:37:28 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 18493 Cc: Eli Zaretskii , 18493@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > I pass the column and row to `icicle-raise-Completions-frame', > which calls (set-mouse-position (selected-frame) col row) Yikes! I hate it when an application moves my mouse. Stefan "Reminds me that I have to figure out why Emacs sometimes moves my mouse" From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 18 21:06:02 2014 Received: (at 18493) by debbugs.gnu.org; 19 Sep 2014 01:06:02 +0000 Received: from localhost ([127.0.0.1]:44946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUme9-0008Ij-2h for submit@debbugs.gnu.org; Thu, 18 Sep 2014 21:06:01 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:28430) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUme6-0008Ia-4w for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 21:05:58 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVNFpZEG/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCw4fBxIUGA0kiAQI0hkXjnoHCoQuBKkZgWqDTCE X-IPAS-Result: ArYGAIDvNVNFpZEG/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCw4fBxIUGA0kiAQI0hkXjnoHCoQuBKkZgWqDTCE X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="90243059" Received: from 69-165-145-6.dsl.teksavvy.com (HELO pastel.home) ([69.165.145.6]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Sep 2014 21:05:57 -0400 Received: by pastel.home (Postfix, from userid 20848) id 4B64E67A07; Thu, 18 Sep 2014 21:05:57 -0400 (EDT) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account Message-ID: References: <864mw529bx.fsf@yandex.ru> <8338bp2cwf.fsf@gnu.org> <541B46AA.2020904@yandex.ru> Date: Thu, 18 Sep 2014 21:05:57 -0400 In-Reply-To: <541B46AA.2020904@yandex.ru> (Dmitry Gutov's message of "Fri, 19 Sep 2014 00:55:06 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 18493 Cc: Eli Zaretskii , 18493@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Fair enough. Maybe define an alternative function, which does take text > zoom into account? To tell you the truth, I don't know what that means. "Text zoom" is just one particular case of the use of faces to change the size of text. So do you want the alternative function to only handle text-zoom (i.e. remapping of the `default' face, so the face applies to "everything"), or do you want it to handle the more general case where every glyph might have different size? If the former, than it'll just be another ad-hoc hack. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 18 21:07:51 2014 Received: (at 18493) by debbugs.gnu.org; 19 Sep 2014 01:07:51 +0000 Received: from localhost ([127.0.0.1]:44950 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUmfv-0008Lz-6h for submit@debbugs.gnu.org; Thu, 18 Sep 2014 21:07:51 -0400 Received: from mail-lb0-f171.google.com ([209.85.217.171]:60210) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUmfs-0008Lo-Ql for 18493@debbugs.gnu.org; Thu, 18 Sep 2014 21:07:49 -0400 Received: by mail-lb0-f171.google.com with SMTP id l4so2223840lbv.2 for <18493@debbugs.gnu.org>; Thu, 18 Sep 2014 18:07:47 -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=30SiQQHyf4qCc1BxHhUD5wRC2dymO3kWn2XnGGacb2w=; b=mNBnSHidndzS/AfsqsQSkh/bHrIACzI8E9Vp62zxPBZMKDIWW30XeBeczLwAZHR2yS 0t81zeHmpWVg+LRtct9NzK5GsY+WORWZGncWTyzDyjHJqvfKMto2LtarMXiAM+q2fbL/ m40NOf1q391kfbWA0gAp2tJIe/bCqq5vBcxBZ+HhNRmLGA7IXeylp8xM70sN3ot0vlZk Fee/XxqLTEVDawB3lDuy9Pasq8ftKl46srgWVxLVg6a2D/dSpuAZrSUf553HyACxKyKm fxQwiWgKlNSwhmn7i6ddQhLW8jRk4jD2na+HiPvwPHJ8wlA+40T+NqAJ7el1PHGS2DQ7 eYYA== X-Received: by 10.152.7.8 with SMTP id f8mr3113726laa.27.1411088867487; Thu, 18 Sep 2014 18:07:47 -0700 (PDT) Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id bc1sm97624lab.40.2014.09.18.18.07.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Sep 2014 18:07:46 -0700 (PDT) Message-ID: <541B81E0.1080901@yandex.ru> Date: Fri, 19 Sep 2014 05:07:44 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Stefan Monnier Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account References: <864mw529bx.fsf@yandex.ru> <8338bp2cwf.fsf@gnu.org> <541B46AA.2020904@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18493 Cc: Eli Zaretskii , 18493@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 09/19/2014 05:05 AM, Stefan Monnier wrote: > So do you want the alternative function to only handle text-zoom > (i.e. remapping of the `default' face, so the face applies to > "everything"), or do you want it to handle the more general case where > every glyph might have different size? > > If the former, than it'll just be another ad-hoc hack. Yes, the former. Maybe so. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 02:11:40 2014 Received: (at 18493) by debbugs.gnu.org; 19 Sep 2014 06:11:41 +0000 Received: from localhost ([127.0.0.1]:45076 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUrPw-00013p-5r for submit@debbugs.gnu.org; Fri, 19 Sep 2014 02:11:40 -0400 Received: from mtaout26.012.net.il ([80.179.55.182]:43023) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUrPt-00013f-3o for 18493@debbugs.gnu.org; Fri, 19 Sep 2014 02:11:38 -0400 Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0NC400800WTKC900@mtaout26.012.net.il> for 18493@debbugs.gnu.org; Fri, 19 Sep 2014 09:09:34 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NC4008VTX3YO200@mtaout26.012.net.il>; Fri, 19 Sep 2014 09:09:34 +0300 (IDT) Date: Fri, 19 Sep 2014 09:11:39 +0300 From: Eli Zaretskii Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account In-reply-to: <541B46AA.2020904@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <83iokk16n8.fsf@gnu.org> References: <864mw529bx.fsf@yandex.ru> <8338bp2cwf.fsf@gnu.org> <541B46AA.2020904@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18493 Cc: 18493@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Fri, 19 Sep 2014 00:55:06 +0400 > From: Dmitry Gutov > CC: 18493@debbugs.gnu.org > > 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? I'm not yet sure what that other function should do. See below. > 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. Is company-mode only for buffers whose major mode is some programming language? I thought it was more broad. But even if it is only for programming languages, does it mean that the API you wish existed should only cater to such modes? > 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 what you actually need is to find the correct X coordinate for the screen line _below_ (and maybe also above) the one where posn-col-row is called, is that right? If so, first question is why not do all this in pixels? From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 07:17:23 2014 Received: (at 18493) by debbugs.gnu.org; 19 Sep 2014 11:17:23 +0000 Received: from localhost ([127.0.0.1]:45226 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUwBm-0001Td-Nc for submit@debbugs.gnu.org; Fri, 19 Sep 2014 07:17:23 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:45935) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUwBj-0001TU-Vz for 18493@debbugs.gnu.org; Fri, 19 Sep 2014 07:17:20 -0400 Received: by mail-lb0-f173.google.com with SMTP id 10so1194101lbg.18 for <18493@debbugs.gnu.org>; Fri, 19 Sep 2014 04:17:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=hvPdmZW1f78sC6fYvTI9aeBPgOQuRcIRkPpJQ9i8rrA=; b=ZmpITNTMqnwlHjZzWTkJkO3VeE+VDK9dilhQU5xOIu2M/U6T2K1qq5yiLixNl5FaYi gIFw6seVxRcTKhE2gFiDOf6msnszQH79u3l2XJo/84luat93xGkO7pZlFcfl7M3rpl88 c1K/JQPn4jueIknI/zFb5Nes6ZIFOOh9LybXv/x10tuF5LHQGmDTnNUF7H/RoKb9J1I1 SIXUJ0tBBTUsDuKvRVdRjssJSJLMsHoO94HoktUi341VRNXwOvQ7nly2wyhFRSOw4WuC MoFCYL0FVXE4VLIIGjHcO07F8jjeXsPxxzrMmDOIfPKmLXOUdBPE/mjB6oaS8llxrior jYkg== X-Received: by 10.152.116.44 with SMTP id jt12mr4437945lab.7.1411125438982; Fri, 19 Sep 2014 04:17:18 -0700 (PDT) Received: from axl ([178.252.98.87]) by mx.google.com with ESMTPSA id z5sm199732lbu.21.2014.09.19.04.17.17 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 19 Sep 2014 04:17:17 -0700 (PDT) From: Dmitry Gutov To: Eli Zaretskii Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account References: <864mw529bx.fsf@yandex.ru> <8338bp2cwf.fsf@gnu.org> <541B46AA.2020904@yandex.ru> <83iokk16n8.fsf@gnu.org> Date: Fri, 19 Sep 2014 15:17:09 +0400 In-Reply-To: <83iokk16n8.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 19 Sep 2014 09:11:39 +0300") Message-ID: <867g0zsvuy.fsf@yandex.ru> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18493 Cc: 18493@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Eli Zaretskii writes: > Is company-mode only for buffers whose major mode is some programming > language? I'd say it's the first priority. > I thought it was more broad. But even if it is only for > programming languages, does it mean that the API you wish existed > should only cater to such modes? It's hard to say. Maybe? I'd like to reiterate here, that I'd be satisfied just with some instructions how to convert the current `posn-col-row' return value into value that respects text scale. > So what you actually need is to find the correct X coordinate for the > screen line _below_ (and maybe also above) the one where posn-col-row > is called, is that right? I don't understand the distinction. But from `posn-col-row' I actually take the screen column value (the row value returned from `posn-actual-col-row' is more useful). > If so, first question is why not do all this in pixels? Because we use the returned value when combining the display string for the overlay. So at some point the pixels have to get converted to character numbers, and we're back to the same problem. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 09:23:00 2014 Received: (at 18493) by debbugs.gnu.org; 19 Sep 2014 13:23:00 +0000 Received: from localhost ([127.0.0.1]:45258 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUy9M-0005mu-0H for submit@debbugs.gnu.org; Fri, 19 Sep 2014 09:23:00 -0400 Received: from mtaout29.012.net.il ([80.179.55.185]:60393) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUy9J-0005ml-4O for 18493@debbugs.gnu.org; Fri, 19 Sep 2014 09:22:58 -0400 Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0NC500500GX2WC00@mtaout29.012.net.il> for 18493@debbugs.gnu.org; Fri, 19 Sep 2014 16:22:33 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NC500656H5LMI00@mtaout29.012.net.il>; Fri, 19 Sep 2014 16:22:33 +0300 (IDT) Date: Fri, 19 Sep 2014 16:22:49 +0300 From: Eli Zaretskii Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account In-reply-to: <867g0zsvuy.fsf@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <838ulf2192.fsf@gnu.org> References: <864mw529bx.fsf@yandex.ru> <8338bp2cwf.fsf@gnu.org> <541B46AA.2020904@yandex.ru> <83iokk16n8.fsf@gnu.org> <867g0zsvuy.fsf@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18493 Cc: 18493@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Dmitry Gutov > Cc: 18493@debbugs.gnu.org > Date: Fri, 19 Sep 2014 15:17:09 +0400 > > Eli Zaretskii writes: > > > Is company-mode only for buffers whose major mode is some programming > > language? > > I'd say it's the first priority. For you. Then someone else will come and argue that Gnus or Org or whatever buffers are much more important. > I'd like to reiterate here, that I'd be satisfied just with some > instructions how to convert the current `posn-col-row' return value > into value that respects text scale. I still don't understand enough what that means to answer, sorry. See below. > > So what you actually need is to find the correct X coordinate for the > > screen line _below_ (and maybe also above) the one where posn-col-row > > is called, is that right? > > I don't understand the distinction. The distinction is this: do you need the column to access text in the same display line, or do you need it for other display lines, like for aligning text in the next or previous lines with the text of the line where you called posn-col-row? > But from `posn-col-row' I actually take the screen column value And do what with it? Please be specific, and please don't spare me the details. I don't have your knowledge of what company-mode does to answer these questions myself, and I have only a very vague idea of how you arrange the display of the completion candidates and how the "column" reported by posn-col-row enters that picture. > > If so, first question is why not do all this in pixels? > > Because we use the returned value when combining the display string for > the overlay. So at some point the pixels have to get converted to > character numbers, and we're back to the same problem. I still don't understand this well enough, please give the details. E.g., given arbitrary pixel coordinates, posn-at-x-y will give you the object at those coordinates and character position within that object. Is that what you need? From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 10:54:20 2014 Received: (at 18493) by debbugs.gnu.org; 19 Sep 2014 14:54:20 +0000 Received: from localhost ([127.0.0.1]:45957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUzZj-0008Do-Uv for submit@debbugs.gnu.org; Fri, 19 Sep 2014 10:54:20 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:6320) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUzZg-0008DR-BG for 18493@debbugs.gnu.org; Fri, 19 Sep 2014 10:54:17 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVNFpZEG/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCw4fBxIUGA0kiAQI0hkXjnoHCoQuBKkZgWqDTCE X-IPAS-Result: ArYGAIDvNVNFpZEG/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCw4fBxIUGA0kiAQI0hkXjnoHCoQuBKkZgWqDTCE X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="90289358" Received: from 69-165-145-6.dsl.teksavvy.com (HELO pastel.home) ([69.165.145.6]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 19 Sep 2014 10:54:15 -0400 Received: by pastel.home (Postfix, from userid 20848) id 6E4B2642C6; Fri, 19 Sep 2014 10:54:15 -0400 (EDT) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account Message-ID: References: <864mw529bx.fsf@yandex.ru> <8338bp2cwf.fsf@gnu.org> <541B46AA.2020904@yandex.ru> <83iokk16n8.fsf@gnu.org> <867g0zsvuy.fsf@yandex.ru> Date: Fri, 19 Sep 2014 10:54:15 -0400 In-Reply-To: <867g0zsvuy.fsf@yandex.ru> (Dmitry Gutov's message of "Fri, 19 Sep 2014 15:17:09 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 18493 Cc: Eli Zaretskii , 18493@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > It's hard to say. Maybe? I'd like to reiterate here, that I'd be > satisfied just with some instructions how to convert the current > `posn-col-row' return value into value that respects text scale. I think this is all a waste of time. We should focus on company popups based on GUI elements (most likely special kinds of frames) rather than based on overlay-hacks. That will work with any random crap you might have in the buffer (scaled text, proportional fonts, images, you name it). The current overlay approach can be kept for the tty case, where proportional fonts, images, and such things don't exist anyway. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 11:43:39 2014 Received: (at 18493) by debbugs.gnu.org; 19 Sep 2014 15:43:39 +0000 Received: from localhost ([127.0.0.1]:45961 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XV0LR-0000xT-UF for submit@debbugs.gnu.org; Fri, 19 Sep 2014 11:43:38 -0400 Received: from mtaout23.012.net.il ([80.179.55.175]:47770) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XV0LO-0000xI-5r for 18493@debbugs.gnu.org; Fri, 19 Sep 2014 11:43:35 -0400 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0NC500200NN0JM00@a-mtaout23.012.net.il> for 18493@debbugs.gnu.org; Fri, 19 Sep 2014 18:43:32 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NC50027LNOKGQ50@a-mtaout23.012.net.il>; Fri, 19 Sep 2014 18:43:32 +0300 (IDT) Date: Fri, 19 Sep 2014 18:43:23 +0300 From: Eli Zaretskii Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account In-reply-to: X-012-Sender: halo1@inter.net.il To: Stefan Monnier Message-id: <83y4tfzkdg.fsf@gnu.org> References: <864mw529bx.fsf@yandex.ru> <8338bp2cwf.fsf@gnu.org> <541B46AA.2020904@yandex.ru> <83iokk16n8.fsf@gnu.org> <867g0zsvuy.fsf@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18493 Cc: 18493@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Stefan Monnier > Cc: Eli Zaretskii , 18493@debbugs.gnu.org > Date: Fri, 19 Sep 2014 10:54:15 -0400 > > > It's hard to say. Maybe? I'd like to reiterate here, that I'd be > > satisfied just with some instructions how to convert the current > > `posn-col-row' return value into value that respects text scale. > > I think this is all a waste of time. We should focus on company popups > based on GUI elements (most likely special kinds of frames) rather than > based on overlay-hacks. Dmitry asked for help in solving a problem, and I'm trying to do that. We already agreed that posn-col-row works as advertised, so this is not about changing code. AFAIK, no one intends to work on what you suggest any time soon (and I agree that doing what you suggest is the right way forward). From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 13:38:13 2014 Received: (at 18493) by debbugs.gnu.org; 19 Sep 2014 17:38:13 +0000 Received: from localhost ([127.0.0.1]:46007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XV28K-0004u8-4v for submit@debbugs.gnu.org; Fri, 19 Sep 2014 13:38:12 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:36025) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XV28H-0004tz-9S for 18493@debbugs.gnu.org; Fri, 19 Sep 2014 13:38:10 -0400 Received: by mail-lb0-f169.google.com with SMTP id b12so3630106lbj.14 for <18493@debbugs.gnu.org>; Fri, 19 Sep 2014 10:38:08 -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=ZOaiZq97/hKkQcAJoBXUbBiRQHe3ACRrNLzO1bn+e68=; b=KS6mOAgm1fnsi45i6LVcPzdni55XzrmHgfS5HCDq7BnV242rHVVaGYpnrXG0Hydb11 9H9SLQcUypPXSro/KnN5eGxUOjxiW1GaKrpnfcB9StpkgQxs0oED+4rNH8PN5dJRhbTl J39JU0vKauH8aNhe40IsjmEp8VS+xzUAfpGOuXGLowWBdvFBYrBCyaSFLc9zcH7iaVid uzhz5kRVJKKw1ZUot/VCanMeN681oprdeFaYxvBymjdk77MPY5Ots4TqdYU0F9zvCYDm GXVdEzdM9h2j1uFN4ASHfgi4BTxnfW2lzacW91yNIhISQthZcCEP8yXQ6i/f4lnjbaEc KMdQ== X-Received: by 10.112.128.228 with SMTP id nr4mr7635606lbb.42.1411148288045; Fri, 19 Sep 2014 10:38:08 -0700 (PDT) Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id bc1sm833632lab.40.2014.09.19.10.38.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Sep 2014 10:38:07 -0700 (PDT) Message-ID: <541C69FB.8030200@yandex.ru> Date: Fri, 19 Sep 2014 21:38:03 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Eli Zaretskii , Stefan Monnier Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account References: <864mw529bx.fsf@yandex.ru> <8338bp2cwf.fsf@gnu.org> <541B46AA.2020904@yandex.ru> <83iokk16n8.fsf@gnu.org> <867g0zsvuy.fsf@yandex.ru> <83y4tfzkdg.fsf@gnu.org> In-Reply-To: <83y4tfzkdg.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18493 Cc: 18493@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 09/19/2014 07:43 PM, Eli Zaretskii wrote: >> I think this is all a waste of time. We should focus on company popups >> based on GUI elements (most likely special kinds of frames) rather than >> based on overlay-hacks. > > Dmitry asked for help in solving a problem, and I'm trying to do that. > We already agreed that posn-col-row works as advertised, so this is > not about changing code. AFAIK, no one intends to work on what you > suggest any time soon (and I agree that doing what you suggest is the > right way forward). Like explained earlier, since the GUI element-based popups are unlikely to work in Emacs 24.4 and older, and the next release is almost certainly 6-12 months away, I've been trying to add some polish for the users of current Emacs. But indeed, the text zoom issue is of no critical importance, so feel free to close this issue, of you like. (I do intend to start tinkering with the GUI-based popups relatively soon, by the way). From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 14:08:23 2014 Received: (at 18493) by debbugs.gnu.org; 19 Sep 2014 18:08:23 +0000 Received: from localhost ([127.0.0.1]:46021 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XV2bW-0005eS-Iy for submit@debbugs.gnu.org; Fri, 19 Sep 2014 14:08:22 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:43993) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XV2bT-0005eI-Oq for 18493@debbugs.gnu.org; Fri, 19 Sep 2014 14:08:20 -0400 Received: by mail-lb0-f174.google.com with SMTP id l4so3605810lbv.5 for <18493@debbugs.gnu.org>; Fri, 19 Sep 2014 11:08:18 -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=v3XZBf+o1xfgQK0/OHd5fV/q6c5vkYbBh6H6GdOUK1k=; b=whxX42caogMsnzJIwrR1trGbH+eJlyYOk+P+Wbkz/LnDtPePZfE7PWGELlFwafArfK R1CMlaBoN4GuipVxSlmtNZKv4K98OIzuMpVygSLV5q0ELCsPX8B27sr07pBSSCR47MWl z/TMfIh6bsheUzB09D55Im9EHfN0t0CaScbfYI2WeoELCWHTc/wYOTy0NI67ChG5BmrN 8tWENSrTbbAa/7gR6Nx2KgC13GK1JIX0jqblQRYMabt+yRJ4hBQ618BOkIr2IG8tbf6P R9P7C4yPzRDdA2QJHw54vH+gTOoF42tDJGPx7U37qdiXPBSGPfpDVonrcaWzcFkvapXB zUtw== X-Received: by 10.112.56.206 with SMTP id c14mr8032459lbq.27.1411150098800; Fri, 19 Sep 2014 11:08:18 -0700 (PDT) Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id n4sm871221lah.2.2014.09.19.11.08.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Sep 2014 11:08:17 -0700 (PDT) Message-ID: <541C710E.2060604@yandex.ru> Date: Fri, 19 Sep 2014 22:08:14 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account References: <864mw529bx.fsf@yandex.ru> <8338bp2cwf.fsf@gnu.org> <541B46AA.2020904@yandex.ru> <83iokk16n8.fsf@gnu.org> <867g0zsvuy.fsf@yandex.ru> <838ulf2192.fsf@gnu.org> In-Reply-To: <838ulf2192.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18493 Cc: 18493@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 09/19/2014 05:22 PM, Eli Zaretskii wrote: > For you. Then someone else will come and argue that Gnus or Org or > whatever buffers are much more important. They'd be welcome to justify that importance with prolific contributions of code. >> I'd like to reiterate here, that I'd be satisfied just with some >> instructions how to convert the current `posn-col-row' return value >> into value that respects text scale. > > I still don't understand enough what that means to answer, sorry. See > below. What I had in mind, is instead of dividing the pixel coordinates by `frame-char-width', first scale it according to the text scale level. > The distinction is this: do you need the column to access text in the > same display line, or do you need it for other display lines, like for > aligning text in the next or previous lines with the text of the line > where you called posn-col-row? I don't think it would help: before the column number is used, the contents of the next (or previous) lines get converted to "plain" text to the best of our ability: tabs are converted to spaces, for example. >> But from `posn-col-row' I actually take the screen column value > > And do what with it? Please be specific, and please don't spare me > the details. I don't have your knowledge of what company-mode does to > answer these questions myself, and I have only a very vague idea of > how you arrange the display of the completion candidates and how the > "column" reported by posn-col-row enters that picture. I think I've described it already in previous discussions. e.g. in http://debbugs.gnu.org/18195 For better description, you could just read the code, starting with `company-pseudo-tooltip-show'. I think it's pretty easy to follow, and I won't have to translate it line-by-line from Elisp to English. > E.g., given arbitrary pixel coordinates, posn-at-x-y will give you the > object at those coordinates and character position within that object. > Is that what you need? Not really: for example, if there's a tab character there, the value will be too imprecise (I need to know the exact column inside the tab). Or if there's an existing overlay there, I'd try my best to ignore it. "character position" within its display string won't help me in the least. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 15:46:34 2014 Received: (at 18493) by debbugs.gnu.org; 19 Sep 2014 19:46:34 +0000 Received: from localhost ([127.0.0.1]:46073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XV48X-00082u-6I for submit@debbugs.gnu.org; Fri, 19 Sep 2014 15:46:33 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:53813) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XV48T-00082l-R8 for 18493@debbugs.gnu.org; Fri, 19 Sep 2014 15:46:31 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NC500D00XYO7400@a-mtaout22.012.net.il> for 18493@debbugs.gnu.org; Fri, 19 Sep 2014 22:46:28 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NC500C8JYXFY950@a-mtaout22.012.net.il>; Fri, 19 Sep 2014 22:46:27 +0300 (IDT) Date: Fri, 19 Sep 2014 22:46:14 +0300 From: Eli Zaretskii Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account In-reply-to: <541C710E.2060604@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <83pperz94p.fsf@gnu.org> References: <864mw529bx.fsf@yandex.ru> <8338bp2cwf.fsf@gnu.org> <541B46AA.2020904@yandex.ru> <83iokk16n8.fsf@gnu.org> <867g0zsvuy.fsf@yandex.ru> <838ulf2192.fsf@gnu.org> <541C710E.2060604@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18493 Cc: 18493@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Fri, 19 Sep 2014 22:08:14 +0400 > From: Dmitry Gutov > CC: 18493@debbugs.gnu.org > > >> I'd like to reiterate here, that I'd be satisfied just with some > >> instructions how to convert the current `posn-col-row' return value > >> into value that respects text scale. > > > > I still don't understand enough what that means to answer, sorry. See > > below. > > What I had in mind, is instead of dividing the pixel coordinates by > `frame-char-width', first scale it according to the text scale level. You describe a means to get what you want, but don't explain why you need that. Why do you need to divide the pixel coordinates by something? What do you want to achieve by that division? What are you going to do with the 'scaled" column? > >> But from `posn-col-row' I actually take the screen column value > > > > And do what with it? Please be specific, and please don't spare me > > the details. I don't have your knowledge of what company-mode does to > > answer these questions myself, and I have only a very vague idea of > > how you arrange the display of the completion candidates and how the > > "column" reported by posn-col-row enters that picture. > > I think I've described it already in previous discussions. e.g. in > http://debbugs.gnu.org/18195 If that were enough, I wouldn't be asking for more details. > For better description, you could just read the code Sorry, I don't have time for that. I don't insist that you explain things to me, I'm trying to help you find the way of computing whatever it is that you need. Feel free to give up on me. > > E.g., given arbitrary pixel coordinates, posn-at-x-y will give you the > > object at those coordinates and character position within that object. > > Is that what you need? > > Not really: for example, if there's a tab character there, the value > will be too imprecise (I need to know the exact column inside the tab). That can be computed. > Or if there's an existing overlay there, I'd try my best to ignore it. > "character position" within its display string won't help me in the least. Not sure what you mean by "ignore", but the value tells you that you have a string there, so you can do whatever you want. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 21:17:54 2014 Received: (at 18493) by debbugs.gnu.org; 20 Sep 2014 01:17:54 +0000 Received: from localhost ([127.0.0.1]:46184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XV9JC-0007i1-5M for submit@debbugs.gnu.org; Fri, 19 Sep 2014 21:17:54 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:56055) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XV9JA-0007ht-2J for 18493@debbugs.gnu.org; Fri, 19 Sep 2014 21:17:52 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVNFpZEG/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCw4fBxIUGA0kLodWCNIZF456BwqELgSpGYFqg0wh X-IPAS-Result: ArYGAIDvNVNFpZEG/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCw4fBxIUGA0kLodWCNIZF456BwqELgSpGYFqg0wh X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="90336237" Received: from 69-165-145-6.dsl.teksavvy.com (HELO pastel.home) ([69.165.145.6]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 19 Sep 2014 21:17:51 -0400 Received: by pastel.home (Postfix, from userid 20848) id F0357642C6; Fri, 19 Sep 2014 21:17:49 -0400 (EDT) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account Message-ID: References: <864mw529bx.fsf@yandex.ru> <8338bp2cwf.fsf@gnu.org> <541B46AA.2020904@yandex.ru> <83iokk16n8.fsf@gnu.org> <867g0zsvuy.fsf@yandex.ru> <83y4tfzkdg.fsf@gnu.org> <541C69FB.8030200@yandex.ru> Date: Fri, 19 Sep 2014 21:17:49 -0400 In-Reply-To: <541C69FB.8030200@yandex.ru> (Dmitry Gutov's message of "Fri, 19 Sep 2014 21:38:03 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 18493 Cc: Eli Zaretskii , 18493@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Like explained earlier, since the GUI element-based popups are unlikely to > work in Emacs 24.4 and older, and the next release is almost certainly 6-12 > months away, I've been trying to add some polish for the users of > current Emacs. posn-col-row can't "take text-scale-mode into account". So the only way forward would be to provide another posn-something-col-row, and that is not an option for 24.4. So if you want it to work with 24.4 it'll have to be based on what's already present. I think you can make it work in Company by simply taking a copy of posn-col-row into company.el and changing it so that it multiplies frame-char-width and frame-char-height by the current text-scaling factor. It's very brittle, but it's not like there's a much better solution out there anyway (other than using a GUI-based popup, I mean, of course). Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 21 23:59:54 2014 Received: (at 18493) by debbugs.gnu.org; 22 Sep 2014 03:59:54 +0000 Received: from localhost ([127.0.0.1]:47860 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XVun3-00067R-Nk for submit@debbugs.gnu.org; Sun, 21 Sep 2014 23:59:53 -0400 Received: from mail-la0-f50.google.com ([209.85.215.50]:63912) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XVun0-00067I-VW for 18493@debbugs.gnu.org; Sun, 21 Sep 2014 23:59:52 -0400 Received: by mail-la0-f50.google.com with SMTP id ty20so5891526lab.23 for <18493@debbugs.gnu.org>; Sun, 21 Sep 2014 20:59:49 -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=U4ySmWK9vUiQGm8KRSXx1Lvl3ggzkQy74rVmzkz4nTg=; b=Nj/aA/OlICobK/E7+u8wqTkkbZhnZKXvLOOADlQnD/XNE5aV2fVwyvMnCb1kuLJl8H Sgrw5cDizg/v32qEsun1rJNYl67joAXnwQJBK3YrwJzpMEulNZQCIgcEaJQWR1i119Vx BdGlTC6vlSfXm7mYmZKxivEyip1sBNq8+R4vbsSkaFCSZBhe+rXKB6vQM3IGGSdcVbyC cxMPAADTkUM3l0ujCc2eisN9Y0EVMB+459n1z37JvW07HpektYIrE+9qxqccmWp23DK5 Q6FHc9fsH1LDQfhtexRX+NBTPtkIxArizRlTLfekgAmpXq80juej2HU20hDHjwiYPmhi 2CRw== X-Received: by 10.152.4.194 with SMTP id m2mr23021098lam.63.1411358389871; Sun, 21 Sep 2014 20:59:49 -0700 (PDT) Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id b1sm3290744lah.34.2014.09.21.20.59.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Sep 2014 20:59:49 -0700 (PDT) Message-ID: <541F9EB4.3020307@yandex.ru> Date: Mon, 22 Sep 2014 07:59:48 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Stefan Monnier Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account References: <864mw529bx.fsf@yandex.ru> <8338bp2cwf.fsf@gnu.org> <541B46AA.2020904@yandex.ru> <83iokk16n8.fsf@gnu.org> <867g0zsvuy.fsf@yandex.ru> <83y4tfzkdg.fsf@gnu.org> <541C69FB.8030200@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18493 Cc: Eli Zaretskii , 18493@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 09/20/2014 05:17 AM, Stefan Monnier wrote: > I think you can make it work in Company by simply taking a copy of > posn-col-row into company.el and changing it so that it multiplies > frame-char-width and frame-char-height by the current text-scaling factor. Thanks, I'll consider that. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 21 23:59:22 2014 Received: (at 18493-done) by debbugs.gnu.org; 22 Sep 2014 03:59:22 +0000 Received: from localhost ([127.0.0.1]:47857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XVumY-00066i-1N for submit@debbugs.gnu.org; Sun, 21 Sep 2014 23:59:22 -0400 Received: from mail-la0-f43.google.com ([209.85.215.43]:47524) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XVumV-00066Y-At for 18493-done@debbugs.gnu.org; Sun, 21 Sep 2014 23:59:20 -0400 Received: by mail-la0-f43.google.com with SMTP id gi9so5933788lab.2 for <18493-done@debbugs.gnu.org>; Sun, 21 Sep 2014 20:59:18 -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=pENTR1Wbc/Ag4wWNjf+lSSulO1uO5ymkxT940YwEa9c=; b=pMXK0L/DGqbHtYKVWZUEEY9ZgYiPl1eujndQ4LNYcJUoiryiLLo6g/8Vy6l3PzHzzW IIJaR4Y9t70weQZr7e6X1mU47F9zE/O8bxIBwY5Rf//XnSN8Xxmn47YdPD6MVa9R95Bl vw96hZ9r7IKTtz83EME+RIWDXQ6NhZaI+vPAfj6DnZ5GTctyFmMCVg0uKNCS88ogTLWx RUBqUIYkhB34QMxc+WqhkudQyWGO0aYeaNLZ4QGY1/iZjuKOuQx8pbwYO7HtB1HdcgLo rypG7JS5dZXLaalsVRooPRSzRQkVZ6TTMZ/PxQXT6EIGhqXRHmTpj14n2gPGxhc0PcWp IExg== X-Received: by 10.112.130.68 with SMTP id oc4mr21310869lbb.41.1411358357926; Sun, 21 Sep 2014 20:59:17 -0700 (PDT) Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id iq1sm3299680lac.9.2014.09.21.20.59.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Sep 2014 20:59:16 -0700 (PDT) Message-ID: <541F9E94.2020108@yandex.ru> Date: Mon, 22 Sep 2014 07:59:16 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18493: 24.3.93; posn-col-row should take text-scale-mode into account References: <864mw529bx.fsf@yandex.ru> <8338bp2cwf.fsf@gnu.org> <541B46AA.2020904@yandex.ru> <83iokk16n8.fsf@gnu.org> <867g0zsvuy.fsf@yandex.ru> <838ulf2192.fsf@gnu.org> <541C710E.2060604@yandex.ru> <83pperz94p.fsf@gnu.org> In-Reply-To: <83pperz94p.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18493-done Cc: 18493-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 09/19/2014 11:46 PM, Eli Zaretskii wrote: > You describe a means to get what you want, but don't explain why you > need that. Why do you need to divide the pixel coordinates by > something? What do you want to achieve by that division? Then I'll have the return value of `posn-col-row' dependent on the buffer contents, but hopefully independent of the text scale level. > I don't insist that you explain things to me, I'm trying to help you > find the way of computing whatever it is that you need. Feel free to > give up on me. Thank you, but you seem intent on helping me write the code in a considerably different way than it's written now. That would indeed be a waste of time, like Stefan said, because it mostly works well enough. Closing. From unknown Sun Jun 22 11:46:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 20 Oct 2014 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator