From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.devel Subject: Re: How to obtain x/y/hpos/vpos at eol -- excluding overlay 'after-string. Date: Mon, 04 Apr 2016 17:17:39 -0700 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by - "") Content-Type: multipart/mixed; boundary="Multipart_Mon_Apr__4_17:17:37_2016-1" X-Trace: ger.gmane.org 1459815501 5565 80.91.229.3 (5 Apr 2016 00:18:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Apr 2016 00:18:21 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 05 02:18:10 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 1anEh3-0004O4-Or for ged-emacs-devel@m.gmane.org; Tue, 05 Apr 2016 02:18:05 +0200 Original-Received: from localhost ([::1]:33571 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anEh2-0006rS-QQ for ged-emacs-devel@m.gmane.org; Mon, 04 Apr 2016 20:18:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46290) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anEgo-0006qw-7P for emacs-devel@gnu.org; Mon, 04 Apr 2016 20:17:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1anEgg-0000px-I8 for emacs-devel@gnu.org; Mon, 04 Apr 2016 20:17:45 -0400 Original-Received: from cobb.liquidweb.com ([50.28.13.150]:42128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anEgg-0000pt-A8 for emacs-devel@gnu.org; Mon, 04 Apr 2016 20:17:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com; s=default; h=Content-Type:MIME-Version:Subject:To:From:Message-ID:Date; bh=TRxgGHYC3RZfrQ0qjRsCZbKMOmNx2MyrRsHSYfHSkD8=; b=npHLlzR5eDXm640ALI6PfD+E5DZqDB9EUz1SB2MJ3+RakeoNRjywRFIrEKccw8c+6JvAXO11995/8quhKPBVfpmcsKRyyvjO40Y4T/vnFYy146+3j+EcIGQIxIzimYhB; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:53783 helo=server.private.localhost) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from ) id 1anEge-0002qM-Eh for emacs-devel@gnu.org; Mon, 04 Apr 2016 20:17:40 -0400 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cobb.liquidweb.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-Get-Message-Sender-Via: cobb.liquidweb.com: acl_c_relayhosts_text_entry: lawlist|lawlist.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 50.28.13.150 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:202725 Archived-At: --Multipart_Mon_Apr__4_17:17:37_2016-1 Content-Type: text/plain; charset=US-ASCII I forgot to cc the mailing list -- so here is a carbon copy. Keith ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; --Multipart_Mon_Apr__4_17:17:37_2016-1 Content-Type: message/rfc822 Date: Mon, 04 Apr 2016 14:06:08 -0700 Message-ID: From: Keith David Bershatsky To: Eli Zaretskii Subject: Re: How to obtain x/y/hpos/vpos at eol -- excluding overlay 'after-string. MIME-Version: 1.0 (generated by - "") Content-Type: text/plain; charset=US-ASCII Thank you, Eli, for taking a look at this particular thread. There are a couple of applications where this would be useful. The first application is a common function available interactively called `posn-at-point` which cannot return the desired `x` and `hpos` when an 'after-string is present at point. For example, line-move-visual in simple.el has never worked correctly when I have overlay 'after-string at the end of the line. So, I have been using a workaround with `vertical-motion` to calculate the desired `temporary-goal-column`. Here is the link to a thread on emacs.stackexchange.com from about a year ago relating to this issue: http://emacs.stackexchange.com/questions/7957/calculating-cursor-position-excluding-the-overlay-after-string The second application is related to feature request 22873 (multiple fake cursors) and a dormant (yet related) feature request 17684 (drawing a vertical line the length of the window). I have not been able to accurately predict programmatically where the fake cursors are located subsequent to the screen scrolling when overlay 'after-string are present. [I spent a day writing up a function to calculate the differential of `y` and `vpos` based on previous and current window-start/end, only to discover that the Little Rascals (fake cursors) were still somewhere else when scrolling.] The function `erase_phys_cursor` redraws the character (where the cursor was) based upon (in part) the values of x/y/hpos/vpos. Until I can figure out how to accurately predict where those Little Rascals (fake cursors) have gone to when scrolling occurs, the easiest thing to do is erase/redraw everything along the `x` axis. `erase_phys_cursor` should not be used, however, when there is no TEXT along the `x` axis - because that yields strange looking glyphs along the right side of the screen. Before calling `erase_phys_cursor` (or my custom function `mc_erase`), I want to check to see where the end of the visual line is -- i.e., x/y/hpos/vpos at the end of each visual line -- and only erase/redraw characters when the `x` axis is less than the end of the visual line Keith ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; At Mon, 04 Apr 2016 23:30:04 +0300, Eli Zaretskii wrote: > > * * * > > Please tell what problem you are trying to solve, and why. Obtaining > coordinates is a means, but I don't yet see the end, so please help us > understand that. --Multipart_Mon_Apr__4_17:17:37_2016-1--