From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Feng Shu" Newsgroups: gmane.emacs.devel Subject: Re: posn-at-point get strange info when flycheck enable and (setq truncate-lines t) Date: Thu, 18 Jan 2018 07:04:23 +0800 Message-ID: <87o9ls84ug.fsf@163.com> References: <3d6f0768.2449.16101dff948.Coremail.tumashu@163.com> <87efmowz84.fsf@linux-m68k.org> <873734buz3.fsf@163.com> <83efmowk12.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1516230161 12422 195.159.176.226 (17 Jan 2018 23:02:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 17 Jan 2018 23:02:41 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (gnu/linux) Cc: schwab@linux-m68k.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 18 00:02:36 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 1ebwj5-0002uu-RC for ged-emacs-devel@m.gmane.org; Thu, 18 Jan 2018 00:02:36 +0100 Original-Received: from localhost ([::1]:41355 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebwl5-0003xd-NU for ged-emacs-devel@m.gmane.org; Wed, 17 Jan 2018 18:04:39 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56797) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebwky-0003xT-QE for emacs-devel@gnu.org; Wed, 17 Jan 2018 18:04:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebwkv-0007tJ-G4 for emacs-devel@gnu.org; Wed, 17 Jan 2018 18:04:32 -0500 Original-Received: from m12-11.163.com ([220.181.12.11]:37217) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebwku-0007sB-MM; Wed, 17 Jan 2018 18:04:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-ID:MIME-Version; bh=4pZib tl1p1dlKwyod/OGMg8MgcMiCZfG6MMTx2dvCZ8=; b=SmuXxDzYDEVe0aKgbcxtO lFCE3tYtTWrRtPv1yICR7rXAHhzSlaI/PvXi5c3TjVCHDGJGKqmHVYt7kbs5xXAV ZcG+/5yMFYV2v8ZVXZ5fx7wXpvCsOO8YslArgA7koJxiY86gY7UTD971l7ao7iMl bR8HylE47SoQPLBpG56O9w= Original-Received: from tumashu (unknown [36.149.169.31]) by smtp7 (Coremail) with SMTP id C8CowAAHbId41l9asErFDA--.19921S2; Thu, 18 Jan 2018 07:04:24 +0800 (CST) In-Reply-To: <83efmowk12.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 17 Jan 2018 18:02:33 +0200") X-CM-TRANSID: C8CowAAHbId41l9asErFDA--.19921S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7WrWrAFy7tFW5CryUGr17KFg_yoW8AFW3pF y2qa429rn8GFyfJw1kta1Ik3Wj93W8XF47Grs5Cr97tr9Yqrn2qFW5Kry5Way7Cws8W3y3 tw45KF97G3WUAa7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UNjjkUUUUU= X-Originating-IP: [36.149.169.31] X-CM-SenderInfo: 5wxpt2lkx6il2tof0z/1tbiERnQ1FWBd2Iq4gAAsF X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 220.181.12.11 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:222063 Archived-At: Eli Zaretskii writes: >> 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. #+BEGIN_EXAMPLE test test ;; Eval the below code, and move point to (point)=5, then run command: `mytest' ;; you will get like: (# 5 (48 . 23) 0 (! . 0) 5 (4 . 0) nil (0 . 23) (12 . 28)) ;; (remove-overlays 5 10) ;; move point to (point)=5, run `mytest' ;; you will get like: (# 5 (48 . 0) 0 nil 5 (4 . 0) nil (0 . 0) (12 . 28)) (progn (require 'flycheck) (setq truncate-lines t) (setq overlay (make-overlay 5 10)) (setf (overlay-get overlay 'before-string) (flycheck-error-level-make-fringe-icon 'error flycheck-indication-mode)) (defun mytest () (interactive) (princ (posn-at-point)))) #+END_EXAMPLE > > 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. Yes, Thanks :-) --