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: Obtain X / HPOS with move_it_to at eol when buffer-display-table line-feed Date: Wed, 30 Aug 2017 22:03:52 +0300 Message-ID: <831sns3mjr.fsf@gnu.org> References: <4lsorjiu.wl%esq@lawlist.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1504119895 16002 195.159.176.226 (30 Aug 2017 19:04:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 30 Aug 2017 19:04:55 +0000 (UTC) Cc: emacs-devel@gnu.org To: Keith David Bershatsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 30 21:04:49 2017 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 1dn8Hy-0002zv-2N for ged-emacs-devel@m.gmane.org; Wed, 30 Aug 2017 21:04:34 +0200 Original-Received: from localhost ([::1]:52252 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dn8I3-0001nd-DL for ged-emacs-devel@m.gmane.org; Wed, 30 Aug 2017 15:04:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dn8Hu-0001mD-DE for emacs-devel@gnu.org; Wed, 30 Aug 2017 15:04:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dn8Hr-0004GG-PO for emacs-devel@gnu.org; Wed, 30 Aug 2017 15:04:30 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43804) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dn8Hr-0004GA-Lt; Wed, 30 Aug 2017 15:04:27 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2497 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dn8Ho-0000S5-MS; Wed, 30 Aug 2017 15:04:27 -0400 In-reply-to: <4lsorjiu.wl%esq@lawlist.com> (message from Keith David Bershatsky on Wed, 30 Aug 2017 11:35:21 -0700) 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:217891 Archived-At: > Date: Wed, 30 Aug 2017 11:35:21 -0700 > From: Keith David Bershatsky > Cc: emacs-devel@gnu.org > > With respect to eol pilcrows, move_it_to gives X and HPOS coordinates for an invisible \n to the right of the pilcrow. We essentially have ¶\n, and IT cannot see the pilcrow. The X and HPOS returned by move_it_to gives us ¶|\n instead of |¶\n. Stated another way, X and HPOS are reported as being on the end of the pilcrow, instead of the beginning of the pilcrow. But this is because you told move_it_to to move to the end of the screen line, by specifying it.last_visible_x - 1 as the X coordinate. What happens if you tell it to stop at the buffer position of the newline instead? > Perhaps there is some way to help move_it_to see the pilcrow, or at least pretend that it exists? move_it_to always stops when it delivers characters from the buffer, so if there are display or overlay strings, or glyphs come from a display table, it will go on until those are exhausted, and it is back at the next character from buffer text. So you should try stopping it before it gets to the newline, which is displayed using the display-table entry.