From: Keith David Bershatsky <esq@lawlist.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 31716@debbugs.gnu.org
Subject: bug#31716: move_it_in_display_line / horizontal scrolling / tab stretch
Date: Thu, 07 Jun 2018 22:12:34 -0700 [thread overview]
Message-ID: <m24lid6ev1.wl%esq@lawlist.com> (raw)
In-Reply-To: <m21sdmt6di.wl%esq@lawlist.com>
I have had an opportunity to further study your write-up regarding issue 31716, and I really appreciate the help you have given. Using the theory that the increase in current_x translates into a new display element and a corresponding increase in the HPOS once the first visible x is reached, I have come up with (what appears to be) a working method to reliably calculate RELATIVE_X and HPOS when tabs are present with horizontal scrolling. However, I am essentially incrementing font->space_width from the far left of the display elements to the end of the line in order to make all of the relevant determinations along the current line (where I am drawing multiple fake cursors to achieve the visible horizontal line for crosshairs). In a nutshell, the method I am using is somewhat akin to pgr
owx in .gdbinit (in that RELATIVE_X is determined based upon the preceding element/determination).
The method I am using to calculate RELATIVE_X and HPOS (when tabs are present with horizontal scrolling) is undoubtedly less efficient than using nifty general methods such as:
A. RELATIVE_X = it.current_x - it.first_visible_x.
B. RELATIVE_X = it.current_x - (window_hscroll_limited (w, f) * frame_char_width).
C. HPOS = it.hpos.
D. HPOS = t.hpos - window_hscroll_limited (w, f).
More efficient ways to calculate RELATIVE_X and HPOS (when tabs are present with horizontal scrolling) can be dealt with in the future on the Emacs devel mailing list since they are not directly related to the reason that #31716 was launched. Please feel free to close out #31716 at your convenience.
Thank you again for all your help.
Keith
next prev parent reply other threads:[~2018-06-08 5:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-05 0:38 bug#31716: move_it_in_display_line / horizontal scrolling / tab stretch Keith David Bershatsky
2018-06-05 14:56 ` Eli Zaretskii
2018-06-06 4:18 ` Keith David Bershatsky
2018-06-08 5:12 ` Keith David Bershatsky [this message]
2018-06-08 8:19 ` 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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m24lid6ev1.wl%esq@lawlist.com \
--to=esq@lawlist.com \
--cc=31716@debbugs.gnu.org \
--cc=eliz@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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).