From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Display-relative coordinates Date: Fri, 29 Jul 2016 08:38:19 -0700 (PDT) Message-ID: <4b77cdb3-e46a-4a9f-95ff-cfdb537c5538@default> References: <<<831t2dsu3y.fsf@gnu.org>>> <> <<83d1lwr2at.fsf@gnu.org>> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1469807032 31642 80.91.229.3 (29 Jul 2016 15:43:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Jul 2016 15:43:52 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii , Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 29 17:43:39 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bT9wo-00052A-4H for ged-emacs-devel@m.gmane.org; Fri, 29 Jul 2016 17:43:38 +0200 Original-Received: from localhost ([::1]:60244 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bT9wi-0004ox-3r for ged-emacs-devel@m.gmane.org; Fri, 29 Jul 2016 11:43:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bT9rp-0001Vn-UO for emacs-devel@gnu.org; Fri, 29 Jul 2016 11:38:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bT9ro-00033E-R2 for emacs-devel@gnu.org; Fri, 29 Jul 2016 11:38:29 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:29651) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bT9rk-00031W-Rp; Fri, 29 Jul 2016 11:38:25 -0400 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u6TFcNoM029651 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Jul 2016 15:38:23 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u6TFcMqK005819 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 29 Jul 2016 15:38:23 GMT Original-Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u6TFcKHk015258; Fri, 29 Jul 2016 15:38:21 GMT In-Reply-To: <<83d1lwr2at.fsf@gnu.org>> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6744.5000 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:206223 Archived-At: > There is not enough information in the above, and also some surprising > data. First, you don't tell how you measure pixels from the screen > corner. =20 MB Ruler: http://www.markus-bader.de/MB-Ruler/index.php > You don't tell what location of the character cells you take > as its coordinates. I did say that I measured to the bottom of the cursor (block). And I did say that I got the char height as 12 pixels. > You also say that the height of a character is 12 pixels, but > the default height of a line in "emacs -Q" is 16, not 12. I believe I measured it. Measuring it again now: 12 pixels for a char. And in 1/10 pt, face `default' has height 102. (And no, char height does not include interline height.) FWIW, in my emacs -Q: (font . "-outline-Courier New-normal-normal-normal-mono-17-*-*-*-c-*-iso885= 9-1") I mentioned char height only to let you know that I measured to the bottom of the cursor (as I said). If you want to instead use the bottom of the cursor on the previous line (so as to include the interline height), and you want to use 16, then 420 - 16 =3D 404, instead of the 420 - 12 =3D 408 that I reported using char height. Still not the same as 354. Again, perhaps I'm missing something. > Maybe you could go line by line starting at the first line of the > window, show the pixel coordinates of the first (leftmost) character > on that line, and then tell which part(s) of the results don't look > correct to you. Sorry, I'm done with this. > FWIW, if I move a frame such that point is at one of the 4 corners of > the screen, and compute its pixel coordinates using posn-at-point and > frame-geometry, I get a very good approximation (within a couple of > pixels) of my screen dimensions, so I don't think there's a problem in > these functions. "Tout va tres bien, Madame La Marquise." If you're convinced that `posn-at-point' has no problem, fine by me. I think Martin answered the question of what to use, to get the screen-relative pixel coordinates of a buffer position: `window-absolute-pixel-position'. (But it is not available before Emacs 25.)