[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to obtain x/y/hpos/vpos at eol -- excluding overlay 'after-strin

From: Keith David Bershatsky
Subject: Re: How to obtain x/y/hpos/vpos at eol -- excluding overlay 'after-string.
Date: Mon, 04 Apr 2016 17:17:39 -0700

I forgot to cc the mailing list -- so here is a carbon copy.



--- Begin Message --- Subject: Re: How to obtain x/y/hpos/vpos at eol -- excluding overlay 'after-string. Date: Mon, 04 Apr 2016 14:06:08 -0700
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:


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



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.

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]