From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: posn-at-point get strange info when flycheck enable and (setq truncate-lines t) Date: Wed, 17 Jan 2018 18:02:33 +0200 Message-ID: <83efmowk12.fsf@gnu.org> References: <3d6f0768.2449.16101dff948.Coremail.tumashu@163.com> <87efmowz84.fsf@linux-m68k.org> <873734buz3.fsf@163.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1516205693 31070 195.159.176.226 (17 Jan 2018 16:14:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 17 Jan 2018 16:14:53 +0000 (UTC) Cc: schwab@linux-m68k.org, emacs-devel@gnu.org To: "Feng Shu" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 17 17:14:49 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebqMJ-0007LZ-Ox for ged-emacs-devel@m.gmane.org; Wed, 17 Jan 2018 17:14:39 +0100 Original-Received: from localhost ([::1]:45271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebqOH-0006e5-60 for ged-emacs-devel@m.gmane.org; Wed, 17 Jan 2018 11:16:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33642) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebqAm-0002Tg-RO for emacs-devel@gnu.org; Wed, 17 Jan 2018 11:02:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebqAi-0006CN-9X for emacs-devel@gnu.org; Wed, 17 Jan 2018 11:02:44 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36665) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebqAi-0006C8-59; Wed, 17 Jan 2018 11:02:40 -0500 Original-Received: from [176.228.60.248] (port=2441 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ebqAh-0007KW-L7; Wed, 17 Jan 2018 11:02:40 -0500 In-reply-to: <873734buz3.fsf@163.com> (tumashu@163.com) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:222049 Archived-At: > From: "Feng Shu" > Date: Wed, 17 Jan 2018 19:11:44 +0800 > Cc: "emacs-devel@gnu.org" > > The problem I faced is that when I use posn-at-point to > get buffer POS's pixel position. it will get the picture's pixel position. > > The two (X .Y) position is not equal, for example > > (# 31 (65 . 111) 0 (! . 0) 31 (5 . 3) nil (0 . 24) (13 . 29)) > (# 31 (65 . 87) 0 nil 31 (5 . 3) nil (0 . 0) (13 . 29)) > > Is it possible force get buffer POS's pixel position? Is the character at buffer position 32 visible in the window? Or is it "covered" by an overlay or display property? If it's visible, this could be a bug. Can you prepare a short Lisp fragment that would generate the same kind of overlay as flycheck does, and which exhibits the same problem with posn-at-point? Then I could look into fixing that if necessary. Btw, note that if you subtract the DX/DY pair from the X/Y coordinates in the first position data, you get the X/Y coordinates of the second data. Maybe that's all you need.