unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Keith David Bershatsky <esq@lawlist.com>
To: Emacs Devel <emacs-devel@gnu.org>
Subject: Is there an IT test for a tab-width spacer?
Date: Tue, 24 Oct 2017 17:59:47 -0700	[thread overview]
Message-ID: <m2o9owujng.wl%esq@lawlist.com> (raw)

I am working on implementing crosshairs (17684) and multiple fake cursors (22873).

it.c lets us know whether we are on the initial tab that has been assigned a character by the user with the buffer-display-table, e.g., 187/».

it.c also lets us know whether we have moved beyond that location to a tab without a character; i.e., 9, aka (char-to-string 9).

I am having trouble calculating the X and HPOS for each and every location between the initial tab and the next textual character.  A buffer-display-table for a tab that is assigned a leading 187 followed by a 9 has a minimum tab-width of 2.  Even though the buffer-local value for tab-width may be 2, that combination of 187/9 might be a total of 3 characters wide depending upon the circumstances.  And as the user increases the buffer-local tab-width value, it seemingly becomes more difficult to predict the X and HPOS.

Inching along with a test similar to line 22682 in xdisp.c seems insufficient for this particular project:  while (it.current_x + it.pixel_width <= target_x).

To analyze the width of the spacer and calculate the X and HPOS for each location within that space, is it necessary to go to the next character and then mathematically determine what the previous tab-width was?

Thanks,

Keith



             reply	other threads:[~2017-10-25  0:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-25  0:59 Keith David Bershatsky [this message]
2017-10-25 15:02 ` Is there an IT test for a tab-width spacer? Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2017-10-28 17:10 Keith David Bershatsky
2017-10-28 17:23 ` Eli Zaretskii
2017-10-28 18:06 Keith David Bershatsky

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=m2o9owujng.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 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).