GNU bug report logs - #31716
move_it_in_display_line / horizontal scrolling / tab stretch

Previous Next

Package: emacs;

Reported by: Keith David Bershatsky <esq <at> lawlist.com>

Date: Tue, 5 Jun 2018 00:39:02 UTC

Severity: normal

Tags: notabug

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #16 received at 31716 <at> debbugs.gnu.org (full text, mbox):

From: Keith David Bershatsky <esq <at> lawlist.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 31716 <at> debbugs.gnu.org
Subject: Re: bug#31716: move_it_in_display_line / horizontal scrolling /
 tab	stretch
Date: Thu, 07 Jun 2018 22:12:34 -0700
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 pgrowx 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




This bug report was last modified 6 years and 353 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.