From: Keith David Bershatsky <esq@lawlist.com>
To: emacs-devel@gnu.org
Subject: Re: How to obtain x/y/hpos/vpos at eol -- excluding overlay 'after-string.
Date: Mon, 04 Apr 2016 17:17:39 -0700 [thread overview]
Message-ID: <m2k2kcc3j0.wl%esq@lawlist.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 134 bytes --]
I forgot to cc the mailing list -- so here is a carbon copy.
Keith
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[-- Attachment #2: Type: message/rfc822, Size: 2765 bytes --]
From: Keith David Bershatsky <esq@lawlist.com>
To: Eli Zaretskii <eliz@gnu.org>
Subject: Re: How to obtain x/y/hpos/vpos at eol -- excluding overlay 'after-string.
Date: Mon, 04 Apr 2016 14:06:08 -0700
Message-ID: <m2oa9paxtr.wl%esq@lawlist.com>
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.
next reply other threads:[~2016-04-05 0:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-05 0:17 Keith David Bershatsky [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-04-07 6:45 How to obtain x/y/hpos/vpos at eol -- excluding overlay 'after-string Keith David Bershatsky
2016-04-05 17:37 Keith David Bershatsky
2016-04-06 17:40 ` Eli Zaretskii
[not found] <m2oa9paxtr.wl%esq@lawlist.com>
2016-04-05 15:08 ` Eli Zaretskii
2016-04-04 19:39 Keith David Bershatsky
2016-04-04 20:30 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2k2kcc3j0.wl%esq@lawlist.com \
--to=esq@lawlist.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.