From: Keith David Bershatsky <esq@lawlist.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Obtain X / HPOS with move_it_to at eol when buffer-display-table line-feed
Date: Thu, 31 Aug 2017 09:07:46 -0700 [thread overview]
Message-ID: <m23787wwj1.wl%esq@lawlist.com> (raw)
Thank you, Eli, for the suggestion to stop IT before it gets to the new line (which is displayed using the display-table entry).
The argument of it.last_visible_x is important for the very last line of the visible window, or else IT will not continue looking for POS until it reaches the window-end.
I am assuming by your comments that we are looking for EOL_POSITION minus 1 point, and from there I should examine the character at that location to obtain its width and then add that width to it.current_x in order to get the X of the pilcrow beginning ....
This is a work in progress and I'll keep plugging away as time permits.
Keith
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
DATE: [08-30-2017 12:03:52] <30 Aug 2017 22:03:52 +0300>
FROM: Eli Zaretskii <eliz@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.
next reply other threads:[~2017-08-31 16:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-31 16:07 Keith David Bershatsky [this message]
2017-08-31 16:17 ` Obtain X / HPOS with move_it_to at eol when buffer-display-table line-feed Eli Zaretskii
-- strict thread matches above, loose matches on Subject: below --
2017-08-30 18:35 Keith David Bershatsky
2017-08-30 19:03 ` Eli Zaretskii
2017-08-29 18:51 Keith David Bershatsky
2017-08-30 16:51 ` Eli Zaretskii
2017-08-29 7:01 Keith David Bershatsky
2017-08-29 14:59 ` 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=m23787wwj1.wl%esq@lawlist.com \
--to=esq@lawlist.com \
--cc=eliz@gnu.org \
--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.