GNU logs - #30226, boring messages


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#30226: Fixing it->pixel_width / it->current_x when tabs and line numbers.
Resent-From: Keith David Bershatsky <esq@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 23 Jan 2018 07:33:02 +0000
Resent-Message-ID: <handler.30226.B.151669276110579 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 30226
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 30226 <at> debbugs.gnu.org
X-Debbugs-Original-To: Emacs Bug Reports <bug-gnu-emacs@HIDDEN>
Received: via spool by submit <at> debbugs.gnu.org id=B.151669276110579
          (code B ref -1); Tue, 23 Jan 2018 07:33:02 +0000
Received: (at submit) by debbugs.gnu.org; 23 Jan 2018 07:32:41 +0000
Received: from localhost ([127.0.0.1]:38947 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1edt4S-0002kZ-UY
	for submit <at> debbugs.gnu.org; Tue, 23 Jan 2018 02:32:41 -0500
Received: from eggs.gnu.org ([208.118.235.92]:57611)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <esq@HIDDEN>) id 1edt4R-0002kM-BM
 for submit <at> debbugs.gnu.org; Tue, 23 Jan 2018 02:32:39 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <esq@HIDDEN>) id 1edt4K-000631-Vp
 for submit <at> debbugs.gnu.org; Tue, 23 Jan 2018 02:32:34 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:49977)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <esq@HIDDEN>) id 1edt4K-00062N-PE
 for submit <at> debbugs.gnu.org; Tue, 23 Jan 2018 02:32:32 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:48579)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <esq@HIDDEN>) id 1edt4J-0005Wx-Fw
 for bug-gnu-emacs@HIDDEN; Tue, 23 Jan 2018 02:32:32 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <esq@HIDDEN>) id 1edt4G-0005qQ-Ar
 for bug-gnu-emacs@HIDDEN; Tue, 23 Jan 2018 02:32:31 -0500
Received: from gateway20.websitewelcome.com ([192.185.4.169]:32910)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <esq@HIDDEN>) id 1edt4G-0005EL-08
 for bug-gnu-emacs@HIDDEN; Tue, 23 Jan 2018 02:32:28 -0500
Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4])
 by gateway20.websitewelcome.com (Postfix) with ESMTP id E5AFC400DB7DC
 for <bug-gnu-emacs@HIDDEN>; Tue, 23 Jan 2018 01:32:15 -0600 (CST)
Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP
 id dt43ea7vOcGlpdt43eeESz; Tue, 23 Jan 2018 01:32:15 -0600
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com
 ; s=default;
 h=Content-Type:MIME-Version:Subject:To:From:Message-ID:Date:
 Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description:
 Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
 In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=Ez8Drlniy+5+LBI3uzF+Z2oQjC/kEQQQfUT7QAlgS9o=; b=DgUZnK2mQ8LBXG6hxNBo2FWmiW
 fBEgoR157pJ+G2IdRvRjQMCrPbf2JrHxk6mJzxL4Y+Qo+2ZvAcmSep7xz+nVNZtKJC6C/FY+pxrmM
 4hB4oRa8UFaZq0nRK42wX4tFNYFG2N1BHJIZ98E9pTOmFPvr8Ovtga5OjJeohk0GQZoUZ8clM9+Vj
 kNguUmEjvGNScJKnECu1Zdi2vyFu/XUNtDJUx0eZNI1rfie676q9NnE6UgCKQFV5y216YhHdInWu2
 p+oPmVYP9fzVIU9PMkCOWO+IyD74/ipKp069hHCw+/mulm1E756JpsLS6QdNXBJdR2CuTXWuuX0Qc
 KSgaGfJQ==;
Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:54424
 helo=server.private)
 by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256)
 (Exim 4.89_1) (envelope-from <esq@HIDDEN>) id 1edt43-003KRd-0u
 for bug-gnu-emacs@HIDDEN; Tue, 23 Jan 2018 01:32:15 -0600
Date: Mon, 22 Jan 2018 23:32:14 -0800
Message-ID: <m2k1w9kp35.wl%esq@HIDDEN>
From: Keith David Bershatsky <esq@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="Multipart_Mon_Jan_22_23:32:14_2018-1"
X-AntiAbuse: This header was added to track abuse,
 please include it with any abuse report
X-AntiAbuse: Primary Hostname - gator3053.hostgator.com
X-AntiAbuse: Original Domain - gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - lawlist.com
X-BWhitelist: no
X-Source-IP: 45.48.239.195
X-Source-L: No
X-Exim-ID: 1edt43-003KRd-0u
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private)
 [45.48.239.195]:54424
X-Source-Auth: lawlist
X-Email-Count: 1
X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t
X-Local-Domain: yes
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

--Multipart_Mon_Jan_22_23:32:14_2018-1
Content-Type: text/plain; charset=US-ASCII

The following snippet contains the ingredients that can be used to ultimately fix the problem described on the emacs-devel mailing list beginning at:

https://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00466.html

In a nutshell, it->pixel_width and it->current_x are both incorrect in that situation.  Because the X is wrong, all subsequent references to it->current_x on the same line are also wrong.  In this snippet, we create a new gizmo in dispextern.h called my_pixel_width so as not to break anything while working on this issue.  Someone more knowledgeable than myself (e.g., Eli) will need to figure out what other adjustments in x_produce_glyphs are necessary so that it->pixel_width == it->my_pixel_width in this particular situation.  It is a little confusing, but here is what happens in this snippet:

it->pixel_width "should be" equal to it->my_pixel_width.  If we do that, however, then it->current_x will be wrong.

it->current_x "should be" equal to it->current_x less one (1) font->space_width.  Setting it->pixel_width to be one (1) font->space_width less than what it was fixes the value of it->current_x and does not break anything else in the process (as far as I can see).


dispextern.h:2590

  int my_pixel_width;


xdisp.c:28298

  if (it->char_to_display == '\t'
      && !NILP (Vdisplay_line_numbers)
      && it->w->hscroll > 0
      && it->current_x < it->lnum_pixel_width)
    {
      int my_tab_width = it->tab_width * font->space_width;
      int my_x = it->current_x + it->continuation_lines_width;
      int my_next_tab_x = ((1 + my_x + my_tab_width - 1) / my_tab_width)
                          * my_tab_width;
      if (my_next_tab_x - my_x < font->space_width)
        my_next_tab_x += my_tab_width;
      if (!NILP (Vdisplay_line_numbers))
        my_next_tab_x += it->lnum_pixel_width
                         - ((it->w->hscroll * font->space_width)
                            % my_tab_width);
      it->my_pixel_width = my_next_tab_x - it->lnum_pixel_width - font->space_width;
      it->pixel_width -= font->space_width;
    }
    else
      it->my_pixel_width = 0;


--Multipart_Mon_Jan_22_23:32:14_2018-1
Content-Type: application/diff; type=patch
Content-Disposition: attachment; filename="patch.diff"
Content-Transfer-Encoding: base64

ZGlmZiAtLWdpdCBhL3NyYy9kaXNwZXh0ZXJuLmggYi9zcmMvZGlzcGV4dGVybi5oCmluZGV4IDI1
YmQ2YjIuLjQ4ZTI2MDYgMTAwNjQ0Ci0tLSBhL3NyYy9kaXNwZXh0ZXJuLmgKKysrIGIvc3JjL2Rp
c3BleHRlcm4uaApAQCAtMjU4Nyw2ICsyNTg3LDE2IEBAIHN0cnVjdCBpdAogICAgICBwcm9kdWNl
X2dseXBocy4gICovCiAgIGludCBwaXhlbF93aWR0aDsKIAorCisvKiAqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KiogKi8KKy8qIERlYnVnIHRoZSBwaXhlbC13aWR0aCBvZiBhIHN0cmV0Y2ggdGFiLiAqLworCisg
IC8qIFdpZHRoIG9mIHRoZSBkaXNwbGF5IGVsZW1lbnQgaW4gcGl4ZWxzLiAgUmVzdWx0IG9mIHBy
b2R1Y2VfZ2x5cGhzLiAgKi8KKyAgaW50IG15X3BpeGVsX3dpZHRoOworCisvKiAqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKiogKi8KKworCiAgIC8qIEN1cnJlbnQsIG1heGltdW0gbG9naWNhbCwgYW5kIG1heGlt
dW0gcGh5c2ljYWwgbGluZSBoZWlnaHQKICAgICAgaW5mb3JtYXRpb24uICBSZXN1bHQgb2YgcHJv
ZHVjZV9nbHlwaHMuICAqLwogICBpbnQgYXNjZW50LCBkZXNjZW50LCBtYXhfYXNjZW50LCBtYXhf
ZGVzY2VudDsKZGlmZiAtLWdpdCBhL3NyYy94ZGlzcC5jIGIvc3JjL3hkaXNwLmMKaW5kZXggOTAz
ODE1Yy4uOWYzOTZjNCAxMDA2NDQKLS0tIGEvc3JjL3hkaXNwLmMKKysrIGIvc3JjL3hkaXNwLmMK
QEAgLTI4Mjk1LDYgKzI4Mjk1LDM0IEBAIHhfcHJvZHVjZV9nbHlwaHMgKHN0cnVjdCBpdCAqaXQp
CiAJICAgIH0KIAl9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBEZWJ1ZyB0aGUg
cGl4ZWwtd2lkdGggb2YgYSBzdHJldGNoIHRhYi4gKi8KKworICBpZiAoaXQtPmNoYXJfdG9fZGlz
cGxheSA9PSAnXHQnCisgICAgICAmJiAhTklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJzKQorICAg
ICAgJiYgaXQtPnctPmhzY3JvbGwgPiAwCisgICAgICAmJiBpdC0+Y3VycmVudF94IDwgaXQtPmxu
dW1fcGl4ZWxfd2lkdGgpCisgICAgeworICAgICAgaW50IG15X3RhYl93aWR0aCA9IGl0LT50YWJf
d2lkdGggKiBmb250LT5zcGFjZV93aWR0aDsKKyAgICAgIGludCBteV94ID0gaXQtPmN1cnJlbnRf
eCArIGl0LT5jb250aW51YXRpb25fbGluZXNfd2lkdGg7CisgICAgICBpbnQgbXlfbmV4dF90YWJf
eCA9ICgoMSArIG15X3ggKyBteV90YWJfd2lkdGggLSAxKSAvIG15X3RhYl93aWR0aCkKKyAgICAg
ICAgICAgICAgICAgICAgICAgICAgKiBteV90YWJfd2lkdGg7CisgICAgICBpZiAobXlfbmV4dF90
YWJfeCAtIG15X3ggPCBmb250LT5zcGFjZV93aWR0aCkKKyAgICAgICAgbXlfbmV4dF90YWJfeCAr
PSBteV90YWJfd2lkdGg7CisgICAgICBpZiAoIU5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykp
CisgICAgICAgIG15X25leHRfdGFiX3ggKz0gaXQtPmxudW1fcGl4ZWxfd2lkdGgKKyAgICAgICAg
ICAgICAgICAgICAgICAgICAtICgoaXQtPnctPmhzY3JvbGwgKiBmb250LT5zcGFjZV93aWR0aCkK
KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAlIG15X3RhYl93aWR0aCk7CisgICAgICBpdC0+
bXlfcGl4ZWxfd2lkdGggPSBteV9uZXh0X3RhYl94IC0gaXQtPmxudW1fcGl4ZWxfd2lkdGggLSBm
b250LT5zcGFjZV93aWR0aDsKKyAgICAgIGl0LT5waXhlbF93aWR0aCAtPSBmb250LT5zcGFjZV93
aWR0aDsKKyAgICB9CisgICAgZWxzZQorICAgICAgaXQtPm15X3BpeGVsX3dpZHRoID0gMDsKKwor
LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgaWYgKEZPTlRfVE9PX0hJR0ggKGZv
bnQpKQogCXsKIAkgIGludCBmb250X2FzY2VudCwgZm9udF9kZXNjZW50OwpAQCAtMjg2OTAsNiAr
Mjg3MTgsMTYgQEAgeF9wcm9kdWNlX2dseXBocyAoc3RydWN0IGl0ICppdCkKICAgaWYgKGl0LT5h
cmVhID09IFRFWFRfQVJFQSkKICAgICBpdC0+Y3VycmVudF94ICs9IGl0LT5waXhlbF93aWR0aDsK
IAorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qIERlYnVnIHRoZSBwaXhlbC13aWR0aCBv
ZiBhIHN0cmV0Y2ggdGFiLiAqLworCisgIGlmIChpdC0+bXlfcGl4ZWxfd2lkdGggPiAwKQorICAg
IGl0LT5jdXJyZW50X3ggKz0gaXQtPm15X3BpeGVsX3dpZHRoOworCisvKiAqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKiogKi8KKworCiAgIGlmIChleHRyYV9saW5lX3NwYWNpbmcgPiAwKQogICAgIHsKICAgICAg
IGl0LT5kZXNjZW50ICs9IGV4dHJhX2xpbmVfc3BhY2luZzsKQEAgLTMyMjUxLDkgKzMyMjg5LDE3
NiBAQCB4X2ludGVyc2VjdF9yZWN0YW5nbGVzIChYUmVjdGFuZ2xlICpyMSwgWFJlY3RhbmdsZSAq
cjIsIFhSZWN0YW5nbGUgKnJlc3VsdCkKIAkJCSAgICBJbml0aWFsaXphdGlvbgogICoqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqLwogCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogRGVidWcgdGhlIHBpeGVs
LXdpZHRoIG9mIGEgc3RyZXRjaCB0YWIuICovCisKK0RFRlVOICgiZGVidWctdGFiLXBpeGVsLXdp
ZHRoIiwgRmRlYnVnX3RhYl9waXhlbF93aWR0aCwgU2RlYnVnX3RhYl9waXhlbF93aWR0aCwgMCwg
MCwgMCwKKyAgICAgICBkb2M6IC8qIERlYnVnIHRoZSBwaXhlbC13aWR0aCBvZiBhIHN0cmV0Y2gg
dGFiLiAqLykKKyAgKHZvaWQpCit7CisgIEZzY3JvbGxfbGVmdCAobWFrZV9udW1iZXIgKDEpLCBR
bmlsKTsKKyAgc3RydWN0IHdpbmRvdyAqdyA9IGRlY29kZV9saXZlX3dpbmRvdyAoc2VsZWN0ZWRf
d2luZG93KTsKKyAgc3RydWN0IGZyYW1lICpmID0gWEZSQU1FICh3LT5mcmFtZSk7CisgIExpc3Bf
T2JqZWN0IGJ1ZiA9IHctPmNvbnRlbnRzOworICBDSEVDS19CVUZGRVIgKGJ1Zik7CisgIHN0cnVj
dCBidWZmZXIgKmIgPSBYQlVGRkVSIChidWYpOworICBzdHJ1Y3QgaXQgaXQ7CisgIHZvaWQgKml0
ZGF0YSA9IGJpZGlfc2hlbHZlX2NhY2hlICgpOworICBzdHJ1Y3QgaXQgc2F2ZWRfaXRfZm9yX3dp
bmRvd19zdGFydDsKKyAgdm9pZCAqc2F2ZWRfaXRkYXRhX2Zvcl93aW5kb3dfc3RhcnQgPSBOVUxM
OworICBlbnVtIG1vdmVfaXRfcmVzdWx0IHJjID0gTU9WRV9YX1JFQUNIRUQ7CisgIHN0cnVjdCB0
ZXh0X3BvcyBzdGFydF90ZXh0X3Bvc2l0aW9uOworICBwdHJkaWZmX3QgaXRfc3RhcnQ7CisgIGlu
dCBmaXJzdF94LCBsYXN0X3g7CisgIGludCBsbnVtX3dpZHRoID0gMDsKKyAgaW50IGxudW1fcGl4
ZWxfd2lkdGggPSAwOworICBpbnQgZnJhbWVfY2hhcl93aWR0aCA9IEZSQU1FX0NPTFVNTl9XSURU
SCAoZik7CisgIGJvb2wgaHNjbCA9ICghdy0+c3VzcGVuZF9hdXRvX2hzY3JvbGwKKyAgICAgICAg
ICAgICAgICYmIEVRIChGYnVmZmVyX2xvY2FsX3ZhbHVlIChRYXV0b19oc2Nyb2xsX21vZGUsIGJ1
ZiksIFFjdXJyZW50X2xpbmUpCisgICAgICAgICAgICAgICAmJiB3LT5oc2Nyb2xsID4gMCk7Cisg
IGludCB3X2hzY3JvbGwgPSB3LT5oc2Nyb2xsOworICBpbnQgaHNjbF9maXJzdF9ocG9zID0gd2lu
ZG93X2hzY3JvbGxfbGltaXRlZCAodywgZik7CisgIGludCBoc2NsX2ZpcnN0X3ggPSBoc2NsX2Zp
cnN0X2hwb3MgKiBmcmFtZV9jaGFyX3dpZHRoOworICBpbnQgdGV4dF9hcmVhX3dpZHRoID0gd2lu
ZG93X2JveF93aWR0aCAodywgVEVYVF9BUkVBKTsKKyAgaW50IGhlYWRlcl9saW5lX2hlaWdodCA9
IFdJTkRPV19IRUFERVJfTElORV9IRUlHSFQgKHcpOworICBpbnQgcmVsYXRpdmVfeCwgaHBvcywg
dnBvczsKKyAgaW50IG9wb2ludF94ID0gdy0+b3V0cHV0X2N1cnNvci54OworICBpbnQgb3BvaW50
X3kgPSB3LT5vdXRwdXRfY3Vyc29yLnk7CisgIGludCBvcG9pbnRfaHBvcyA9IHctPm91dHB1dF9j
dXJzb3IuaHBvczsKKyAgaW50IG9wb2ludF92cG9zID0gdy0+b3V0cHV0X2N1cnNvci52cG9zOwor
ICBpbnQgY291bnQgPSAxOworICBpbnQgbXlfc2F2ZWRfcGl4ZWxfd2lkdGggPSAwOworLyogKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgU1RBUlQgRElTUExBWSBB
TkQgUFJJTUUgSVQKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICAvKiBCZWdpbiB0aGUgam91
cm5leSBhdCB3LT5zdGFydC4gKi8KKyAgU0VUX1RFWFRfUE9TX0ZST01fTUFSS0VSIChzdGFydF90
ZXh0X3Bvc2l0aW9uLCB3LT5zdGFydCk7CisgIHN0YXJ0X2Rpc3BsYXkgKCZpdCwgdywgc3RhcnRf
dGV4dF9wb3NpdGlvbik7CisgIGZpcnN0X3ggPSBpdC5maXJzdF92aXNpYmxlX3g7CisgIGxhc3Rf
eCA9IGl0Lmxhc3RfdmlzaWJsZV94OworICBpdF9zdGFydCA9IElUX0NIQVJQT1MgKGl0KTsKKyAg
U0FWRV9JVCAoc2F2ZWRfaXRfZm9yX3dpbmRvd19zdGFydCwgaXQsIHNhdmVkX2l0ZGF0YV9mb3Jf
d2luZG93X3N0YXJ0KTsKKyAgLyogRmluaXNoIHByaW1pbmcgdGhlIElUIGZvciBwb3RlbnRpYWwg
bGluZSBudW1iZXJzLiAqLworICBpZiAoIU5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykKKyAg
ICAgICYmICFFUSAoVmRpc3BsYXlfbGluZV9udW1iZXJzLCBRdmlzdWFsKSkKKyAgICB7CisgICAg
ICBpdC5maXJzdF92aXNpYmxlX3ggPSAwOworICAgICAgbW92ZV9pdF9ieV9saW5lcyAoJml0LCAx
KTsKKyAgICAgIGxudW1fd2lkdGggPSBpdC5sbnVtX3dpZHRoOworICAgICAgbG51bV9waXhlbF93
aWR0aCA9IGl0LmxudW1fcGl4ZWxfd2lkdGg7CisgICAgICBSRVNUT1JFX0lUICgmaXQsICZzYXZl
ZF9pdF9mb3Jfd2luZG93X3N0YXJ0LCBzYXZlZF9pdGRhdGFfZm9yX3dpbmRvd19zdGFydCk7Cisg
ICAgICBpdC5maXJzdF92aXNpYmxlX3ggPSBmaXJzdF94OworICAgICAgaXQubGFzdF92aXNpYmxl
X3ggPSBsYXN0X3g7CisgICAgICBpdC5sbnVtX3dpZHRoID0gbG51bV93aWR0aDsKKyAgICAgIGl0
LmxudW1fcGl4ZWxfd2lkdGggPSBsbnVtX3BpeGVsX3dpZHRoOworICAgICAgU0FWRV9JVCAoc2F2
ZWRfaXRfZm9yX3dpbmRvd19zdGFydCwgaXQsIHNhdmVkX2l0ZGF0YV9mb3Jfd2luZG93X3N0YXJ0
KTsKKyAgICB9CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAg
ICAgICAgICBHT1RPIExJTkUgQkVHSU4KKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworICAvKiBQ
bGFjZSB0aGUgSVQgb24gdGhlIGN1cnJlbnQgbGluZSBjb250YWluaW5nIFBULiAqLworICBpbnQg
dm9mZnNldCA9IChoZWFkZXJfbGluZV9oZWlnaHQgPiAwCisgICAgICAgICAgICAgICAgICYmIG9w
b2ludF92cG9zID4gMCkKKyAgICAgICAgICAgICAgICAgID8gb3BvaW50X3Zwb3MgLSAxCisgICAg
ICAgICAgICAgICAgICA6IG9wb2ludF92cG9zOworICBpZiAodm9mZnNldCA+IDApCisgICAgbW92
ZV9pdF9ieV9saW5lcyAoJml0LCB2b2Zmc2V0KTsKKy8qICoqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgor
ICAgICAgICAgICAgICAgICAgICAgICAgRklSU1QgWCA9PiBQRU5VTFRJTUFURSBFT0wKKyoqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKiAqLworICB3aGlsZSAodHJ1ZSkKKyAgICB7CisgICAgICBpZiAoaHNj
bCkKKyAgICAgICAgeworICAgICAgICAgIHJlbGF0aXZlX3ggPSBpdC5jdXJyZW50X3ggLSAoaHNj
bF9maXJzdF9ocG9zICogZnJhbWVfY2hhcl93aWR0aCk7CisgICAgICAgICAgaHBvcyA9IGl0Lmhw
b3MgLSBoc2NsX2ZpcnN0X2hwb3M7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICAg
IHsKKyAgICAgICAgICAgIHJlbGF0aXZlX3ggPSBpdC5jdXJyZW50X3ggLSBmaXJzdF94OworICAg
ICAgICAgICAgaHBvcyA9IGl0Lmhwb3M7CisgICAgICAgICAgfQorICAgICAgaWYgKGhlYWRlcl9s
aW5lX2hlaWdodCA+IDApCisgICAgICAgIHZwb3MgPSBpdC52cG9zICsgMTsKKyAgICAgICAgZWxz
ZQorICAgICAgICAgIHZwb3MgPSBpdC52cG9zOworICAgICAgYm9vbCBmaW5hbF9sb29wX3AgPSAo
SVRFUkFUT1JfQVRfRU5EX09GX0xJTkVfUCAoJml0KQorICAgICAgICAgICAgICAgICAgICAgICAg
ICAgfHwgRkVUQ0hfQllURSAoSVRfQllURVBPUyAoaXQpKSA9PSAnXG4nCisgICAgICAgICAgICAg
ICAgICAgICAgICAgICB8fCByYyA9PSBNT1ZFX1BPU19NQVRDSF9PUl9aVik7CisgICAgICBpZiAo
ZmluYWxfbG9vcF9wKQorICAgICAgICBicmVhazsKKyAgICAgIGJvb2wgbm90aGluZ19wID0gKGl0
LmMgPT0gMCk7CisgICAgICBib29sIHRhYl92aXNpYmxlX3AgPSAoaXQuYyA9PSAxODcpOworICAg
ICAgYm9vbCB0YWJfaW52aXNpYmxlX3AgPSAoaXQuYyA9PSAnXHQnKTsKKyAgICAgIGlmICh3LT5o
c2Nyb2xsID4gMCkKKyAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiXG4lZC4gICVzXG5cCisgICAg
aXQuYyAoJWQpXG5cCisgICAgdy0+aHNjcm9sbCAoJWQpXG5cCisgICAgaXQuY3VycmVudF94ICgl
ZClcblwKKyAgICBpdC5waXhlbF93aWR0aCAoJWQpXG5cCisgICAgaXQubXlfcGl4ZWxfd2lkdGgg
KCVkKVxuXAorICAgICVzICglZClcbiIsCisgICAgICAgICAgICAgICAgIGNvdW50LAorICAgICAg
ICAgICAgICAgICAobm90aGluZ19wCisgICAgICAgICAgICAgICAgICAgPyAiTk9USElORyIKKyAg
ICAgICAgICAgICAgICAgICA6IHRhYl92aXNpYmxlX3AKKyAgICAgICAgICAgICAgICAgICAgID8g
IlRBQiBDSEFSQUNURVIiCisgICAgICAgICAgICAgICAgICAgOiB0YWJfaW52aXNpYmxlX3AKKyAg
ICAgICAgICAgICAgICAgICAgID8gIlRBQiBTVFJFVENIIgorICAgICAgICAgICAgICAgICAgIDog
IlRFWFQiKSwKKyAgICAgICAgICAgICAgICAgaXQuYywKKyAgICAgICAgICAgICAgICAgd19oc2Ny
b2xsLAorICAgICAgICAgICAgICAgICBpdC5jdXJyZW50X3gsCisgICAgICAgICAgICAgICAgIGl0
LnBpeGVsX3dpZHRoLAorICAgICAgICAgICAgICAgICBpdC5teV9waXhlbF93aWR0aCwKKyAgICAg
ICAgICAgICAgICAgKCghbm90aGluZ19wCisgICAgICAgICAgICAgICAgICAgJiYgIXRhYl92aXNp
YmxlX3AKKyAgICAgICAgICAgICAgICAgICAmJiAhdGFiX2ludmlzaWJsZV9wKQorICAgICAgICAg
ICAgICAgICAgPyAiZmlyc3RfeCArIGxudW1fcGl4ZWxfd2lkdGggKyBteV9zYXZlZF9waXhlbF93
aWR0aCIKKyAgICAgICAgICAgICAgICAgIDogIk4vQSIpLAorICAgICAgICAgICAgICAgICAoKCFu
b3RoaW5nX3AKKyAgICAgICAgICAgICAgICAgICAmJiAhdGFiX3Zpc2libGVfcAorICAgICAgICAg
ICAgICAgICAgICYmICF0YWJfaW52aXNpYmxlX3ApCisgICAgICAgICAgICAgICAgICA/IGZpcnN0
X3ggKyBsbnVtX3BpeGVsX3dpZHRoICsgbXlfc2F2ZWRfcGl4ZWxfd2lkdGgKKyAgICAgICAgICAg
ICAgICAgIDogMCkpOworICAgICAgcmMgPSBtb3ZlX2l0X2luX2Rpc3BsYXlfbGluZV90byAoJml0
LCBaViwgaXQuY3VycmVudF94ICsgaXQucGl4ZWxfd2lkdGgsCisgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICBNT1ZFX1RPX1BPUyB8IE1PVkVfVE9fWCk7CisgICAgICBjb3Vu
dCA9IGNvdW50ICsgMTsKKyAgICAgIGlmIChpdC5teV9waXhlbF93aWR0aCA+IDApCisgICAgICAg
IG15X3NhdmVkX3BpeGVsX3dpZHRoID0gaXQubXlfcGl4ZWxfd2lkdGg7CisgICAgICBpZiAocmMg
PT0gTU9WRV9MSU5FX0NPTlRJTlVFRCkKKyAgICAgICAgYnJlYWs7CisgICAgICByZWxhdGl2ZV94
ID0gKGhzY2wpCisgICAgICAgICAgICAgICAgICAgPyBpdC5jdXJyZW50X3ggLSAoaHNjbF9maXJz
dF9ocG9zICogZnJhbWVfY2hhcl93aWR0aCkKKyAgICAgICAgICAgICAgICAgICA6IGl0LmN1cnJl
bnRfeCAtIGZpcnN0X3g7CisgICAgICBpZiAocmVsYXRpdmVfeCArIGZyYW1lX2NoYXJfd2lkdGgg
Pj0gdGV4dF9hcmVhX3dpZHRoKQorICAgICAgICBicmVhazsKKyAgICB9CisgIHJlZGlzcGxheV9p
bnRlcm5hbCAoKTsKKyAgZnByaW50ZiAoc3RkZXJyLCAiXG4iKTsKKyAgc3RydWN0IGdseXBoX3Jv
dyAqZ2x5cGhfcm93ID0gTUFUUklYX1JPVyAody0+Y3VycmVudF9tYXRyaXgsIGl0LnZwb3MpOwor
ICBkdW1wX2dseXBoX3JvdyAoZ2x5cGhfcm93LCBpdC52cG9zLCAyKTsKKyAgYmlkaV91bnNoZWx2
ZV9jYWNoZSAoaXRkYXRhLCBmYWxzZSk7CisgIHJldHVybiBRbmlsOworfQorCisvKiAqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKiogKi8KKworCiB2b2lkCiBzeW1zX29mX3hkaXNwICh2b2lkKQogeworCisKKy8q
ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKiAqLworLyogRGVidWcgdGhlIHBpeGVsLXdpZHRoIG9mIGEgc3Ry
ZXRjaCB0YWIuICovCisKKyAgZGVmc3ViciAoJlNkZWJ1Z190YWJfcGl4ZWxfd2lkdGgpOworCisv
KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKiogKi8KKworCiAgIFZ3aXRoX2VjaG9fYXJlYV9zYXZlX3ZlY3Rv
ciA9IFFuaWw7CiAgIHN0YXRpY3BybyAoJlZ3aXRoX2VjaG9fYXJlYV9zYXZlX3ZlY3Rvcik7CiAK
--Multipart_Mon_Jan_22_23:32:14_2018-1--




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Keith David Bershatsky <esq@HIDDEN>
Subject: bug#30226: Acknowledgement (Fixing it->pixel_width /
 it->current_x when tabs and line numbers.)
Message-ID: <handler.30226.B.151669276110579.ack <at> debbugs.gnu.org>
References: <m2k1w9kp35.wl%esq@HIDDEN>
X-Gnu-PR-Message: ack 30226
X-Gnu-PR-Package: emacs
Reply-To: 30226 <at> debbugs.gnu.org
Date: Tue, 23 Jan 2018 07:33:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs@HIDDEN

If you wish to submit further information on this problem, please
send it to 30226 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
30226: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D30226
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#30226: Fixing it->pixel_width / it->current_x when tabs and line numbers.
References: <m2k1w9kp35.wl%esq@HIDDEN>
In-Reply-To: <m2k1w9kp35.wl%esq@HIDDEN>
Resent-From: Keith David Bershatsky <esq@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 23 Jan 2018 07:53:02 +0000
Resent-Message-ID: <handler.30226.B30226.151669394412375 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 30226
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 30226 <at> debbugs.gnu.org
Received: via spool by 30226-submit <at> debbugs.gnu.org id=B30226.151669394412375
          (code B ref 30226); Tue, 23 Jan 2018 07:53:02 +0000
Received: (at 30226) by debbugs.gnu.org; 23 Jan 2018 07:52:24 +0000
Received: from localhost ([127.0.0.1]:38954 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1edtNX-0003DW-O0
	for submit <at> debbugs.gnu.org; Tue, 23 Jan 2018 02:52:23 -0500
Received: from gateway32.websitewelcome.com ([192.185.145.115]:38080)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <esq@HIDDEN>) id 1edtNW-0003DP-Kh
 for 30226 <at> debbugs.gnu.org; Tue, 23 Jan 2018 02:52:22 -0500
Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19])
 by gateway32.websitewelcome.com (Postfix) with ESMTP id D92F475AC9
 for <30226 <at> debbugs.gnu.org>; Tue, 23 Jan 2018 01:52:21 -0600 (CST)
Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP
 id dtNVe7DbNODN4dtNVe3x8n; Tue, 23 Jan 2018 01:52:21 -0600
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com
 ; s=default;
 h=Content-Type:MIME-Version:Subject:To:From:Message-ID:Date:
 Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description:
 Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
 In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=EwSR7/NKwuvFHnc6PONRv1CV1jBaa4I7h0iBBrgUXsk=; b=SgM1HQ0GrsnIqZQzwZ1W0+dPm5
 YLMcgbNUUfoNWVrX94r9h3chSyBN4Jn7/TfjCO0j2Ycwzn67aRWistoyJ9ZId01kKR43cJgpNBWN+
 14XjR2UOlTbcxUp6VJQqKyP8iMfQxnm9i7GJHjDx2fiS1Uoea/xswz4kvCAa1NBihNNVPAb8SSQed
 x82mFVsp9ycyv5ZVrr16N5dy7xRPkED7ow6MW0a4LBHlphmcCeZEflqJXjC8M8awmug4M4MNGFE65
 wREIlquFltCLp90fchl3gf6ZtnMbjuaFGFJbSDj+POY2EdEAsFV29Xre7p/gAOU4LYI6l3B2YdVpt
 xxV5K6sQ==;
Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:54574
 helo=server.private)
 by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256)
 (Exim 4.89_1) (envelope-from <esq@HIDDEN>) id 1edtNU-003ZHn-WF
 for 30226 <at> debbugs.gnu.org; Tue, 23 Jan 2018 01:52:21 -0600
Date: Mon, 22 Jan 2018 23:52:20 -0800
Message-ID: <m2607tqaff.wl%esq@HIDDEN>
From: Keith David Bershatsky <esq@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="Multipart_Mon_Jan_22_23:52:20_2018-1"
X-AntiAbuse: This header was added to track abuse,
 please include it with any abuse report
X-AntiAbuse: Primary Hostname - gator3053.hostgator.com
X-AntiAbuse: Original Domain - debbugs.gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - lawlist.com
X-BWhitelist: no
X-Source-IP: 45.48.239.195
X-Source-L: No
X-Exim-ID: 1edtNU-003ZHn-WF
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private)
 [45.48.239.195]:54574
X-Source-Auth: lawlist
X-Email-Count: 4
X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t
X-Local-Domain: yes
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

--Multipart_Mon_Jan_22_23:52:20_2018-1
Content-Type: text/plain; charset=US-ASCII

Here is a revised patch that removes an erroneous section that was experimental.


--Multipart_Mon_Jan_22_23:52:20_2018-1
Content-Type: application/diff; type=patch
Content-Disposition: attachment; filename="patch.diff"
Content-Transfer-Encoding: base64

ZGlmZiAtLWdpdCBhL3NyYy9kaXNwZXh0ZXJuLmggYi9zcmMvZGlzcGV4dGVybi5oCmluZGV4IDI1
YmQ2YjIuLjQ4ZTI2MDYgMTAwNjQ0Ci0tLSBhL3NyYy9kaXNwZXh0ZXJuLmgKKysrIGIvc3JjL2Rp
c3BleHRlcm4uaApAQCAtMjU4Nyw2ICsyNTg3LDE2IEBAIHN0cnVjdCBpdAogICAgICBwcm9kdWNl
X2dseXBocy4gICovCiAgIGludCBwaXhlbF93aWR0aDsKIAorCisvKiAqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KiogKi8KKy8qIERlYnVnIHRoZSBwaXhlbC13aWR0aCBvZiBhIHN0cmV0Y2ggdGFiLiAqLworCisg
IC8qIFdpZHRoIG9mIHRoZSBkaXNwbGF5IGVsZW1lbnQgaW4gcGl4ZWxzLiAgUmVzdWx0IG9mIHBy
b2R1Y2VfZ2x5cGhzLiAgKi8KKyAgaW50IG15X3BpeGVsX3dpZHRoOworCisvKiAqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKiogKi8KKworCiAgIC8qIEN1cnJlbnQsIG1heGltdW0gbG9naWNhbCwgYW5kIG1heGlt
dW0gcGh5c2ljYWwgbGluZSBoZWlnaHQKICAgICAgaW5mb3JtYXRpb24uICBSZXN1bHQgb2YgcHJv
ZHVjZV9nbHlwaHMuICAqLwogICBpbnQgYXNjZW50LCBkZXNjZW50LCBtYXhfYXNjZW50LCBtYXhf
ZGVzY2VudDsKZGlmZiAtLWdpdCBhL3NyYy94ZGlzcC5jIGIvc3JjL3hkaXNwLmMKaW5kZXggOTAz
ODE1Yy4uOWY0Y2YxZCAxMDA2NDQKLS0tIGEvc3JjL3hkaXNwLmMKKysrIGIvc3JjL3hkaXNwLmMK
QEAgLTI4Mjk1LDYgKzI4Mjk1LDM0IEBAIHhfcHJvZHVjZV9nbHlwaHMgKHN0cnVjdCBpdCAqaXQp
CiAJICAgIH0KIAl9CiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBEZWJ1ZyB0aGUg
cGl4ZWwtd2lkdGggb2YgYSBzdHJldGNoIHRhYi4gKi8KKworICBpZiAoaXQtPmNoYXJfdG9fZGlz
cGxheSA9PSAnXHQnCisgICAgICAmJiAhTklMUCAoVmRpc3BsYXlfbGluZV9udW1iZXJzKQorICAg
ICAgJiYgaXQtPnctPmhzY3JvbGwgPiAwCisgICAgICAmJiBpdC0+Y3VycmVudF94IDwgaXQtPmxu
dW1fcGl4ZWxfd2lkdGgpCisgICAgeworICAgICAgaW50IG15X3RhYl93aWR0aCA9IGl0LT50YWJf
d2lkdGggKiBmb250LT5zcGFjZV93aWR0aDsKKyAgICAgIGludCBteV94ID0gaXQtPmN1cnJlbnRf
eCArIGl0LT5jb250aW51YXRpb25fbGluZXNfd2lkdGg7CisgICAgICBpbnQgbXlfbmV4dF90YWJf
eCA9ICgoMSArIG15X3ggKyBteV90YWJfd2lkdGggLSAxKSAvIG15X3RhYl93aWR0aCkKKyAgICAg
ICAgICAgICAgICAgICAgICAgICAgKiBteV90YWJfd2lkdGg7CisgICAgICBpZiAobXlfbmV4dF90
YWJfeCAtIG15X3ggPCBmb250LT5zcGFjZV93aWR0aCkKKyAgICAgICAgbXlfbmV4dF90YWJfeCAr
PSBteV90YWJfd2lkdGg7CisgICAgICBpZiAoIU5JTFAgKFZkaXNwbGF5X2xpbmVfbnVtYmVycykp
CisgICAgICAgIG15X25leHRfdGFiX3ggKz0gaXQtPmxudW1fcGl4ZWxfd2lkdGgKKyAgICAgICAg
ICAgICAgICAgICAgICAgICAtICgoaXQtPnctPmhzY3JvbGwgKiBmb250LT5zcGFjZV93aWR0aCkK
KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAlIG15X3RhYl93aWR0aCk7CisgICAgICBpdC0+
bXlfcGl4ZWxfd2lkdGggPSBteV9uZXh0X3RhYl94IC0gaXQtPmxudW1fcGl4ZWxfd2lkdGggLSBm
b250LT5zcGFjZV93aWR0aDsKKyAgICAgIGl0LT5waXhlbF93aWR0aCAtPSBmb250LT5zcGFjZV93
aWR0aDsKKyAgICB9CisgICAgZWxzZQorICAgICAgaXQtPm15X3BpeGVsX3dpZHRoID0gMDsKKwor
LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqICovCisKKwogICAgICAgaWYgKEZPTlRfVE9PX0hJR0ggKGZv
bnQpKQogCXsKIAkgIGludCBmb250X2FzY2VudCwgZm9udF9kZXNjZW50OwpAQCAtMzIyNTEsOSAr
MzIyNzksMTc2IEBAIHhfaW50ZXJzZWN0X3JlY3RhbmdsZXMgKFhSZWN0YW5nbGUgKnIxLCBYUmVj
dGFuZ2xlICpyMiwgWFJlY3RhbmdsZSAqcmVzdWx0KQogCQkJICAgIEluaXRpYWxpemF0aW9uCiAg
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKiovCiAKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBEZWJ1ZyB0
aGUgcGl4ZWwtd2lkdGggb2YgYSBzdHJldGNoIHRhYi4gKi8KKworREVGVU4gKCJkZWJ1Zy10YWIt
cGl4ZWwtd2lkdGgiLCBGZGVidWdfdGFiX3BpeGVsX3dpZHRoLCBTZGVidWdfdGFiX3BpeGVsX3dp
ZHRoLCAwLCAwLCAwLAorICAgICAgIGRvYzogLyogRGVidWcgdGhlIHBpeGVsLXdpZHRoIG9mIGEg
c3RyZXRjaCB0YWIuICovKQorICAodm9pZCkKK3sKKyAgRnNjcm9sbF9sZWZ0IChtYWtlX251bWJl
ciAoMSksIFFuaWwpOworICBzdHJ1Y3Qgd2luZG93ICp3ID0gZGVjb2RlX2xpdmVfd2luZG93IChz
ZWxlY3RlZF93aW5kb3cpOworICBzdHJ1Y3QgZnJhbWUgKmYgPSBYRlJBTUUgKHctPmZyYW1lKTsK
KyAgTGlzcF9PYmplY3QgYnVmID0gdy0+Y29udGVudHM7CisgIENIRUNLX0JVRkZFUiAoYnVmKTsK
KyAgc3RydWN0IGJ1ZmZlciAqYiA9IFhCVUZGRVIgKGJ1Zik7CisgIHN0cnVjdCBpdCBpdDsKKyAg
dm9pZCAqaXRkYXRhID0gYmlkaV9zaGVsdmVfY2FjaGUgKCk7CisgIHN0cnVjdCBpdCBzYXZlZF9p
dF9mb3Jfd2luZG93X3N0YXJ0OworICB2b2lkICpzYXZlZF9pdGRhdGFfZm9yX3dpbmRvd19zdGFy
dCA9IE5VTEw7CisgIGVudW0gbW92ZV9pdF9yZXN1bHQgcmMgPSBNT1ZFX1hfUkVBQ0hFRDsKKyAg
c3RydWN0IHRleHRfcG9zIHN0YXJ0X3RleHRfcG9zaXRpb247CisgIHB0cmRpZmZfdCBpdF9zdGFy
dDsKKyAgaW50IGZpcnN0X3gsIGxhc3RfeDsKKyAgaW50IGxudW1fd2lkdGggPSAwOworICBpbnQg
bG51bV9waXhlbF93aWR0aCA9IDA7CisgIGludCBmcmFtZV9jaGFyX3dpZHRoID0gRlJBTUVfQ09M
VU1OX1dJRFRIIChmKTsKKyAgYm9vbCBoc2NsID0gKCF3LT5zdXNwZW5kX2F1dG9faHNjcm9sbAor
ICAgICAgICAgICAgICAgJiYgRVEgKEZidWZmZXJfbG9jYWxfdmFsdWUgKFFhdXRvX2hzY3JvbGxf
bW9kZSwgYnVmKSwgUWN1cnJlbnRfbGluZSkKKyAgICAgICAgICAgICAgICYmIHctPmhzY3JvbGwg
PiAwKTsKKyAgaW50IHdfaHNjcm9sbCA9IHctPmhzY3JvbGw7CisgIGludCBoc2NsX2ZpcnN0X2hw
b3MgPSB3aW5kb3dfaHNjcm9sbF9saW1pdGVkICh3LCBmKTsKKyAgaW50IGhzY2xfZmlyc3RfeCA9
IGhzY2xfZmlyc3RfaHBvcyAqIGZyYW1lX2NoYXJfd2lkdGg7CisgIGludCB0ZXh0X2FyZWFfd2lk
dGggPSB3aW5kb3dfYm94X3dpZHRoICh3LCBURVhUX0FSRUEpOworICBpbnQgaGVhZGVyX2xpbmVf
aGVpZ2h0ID0gV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodyk7CisgIGludCByZWxhdGl2ZV94
LCBocG9zLCB2cG9zOworICBpbnQgb3BvaW50X3ggPSB3LT5vdXRwdXRfY3Vyc29yLng7CisgIGlu
dCBvcG9pbnRfeSA9IHctPm91dHB1dF9jdXJzb3IueTsKKyAgaW50IG9wb2ludF9ocG9zID0gdy0+
b3V0cHV0X2N1cnNvci5ocG9zOworICBpbnQgb3BvaW50X3Zwb3MgPSB3LT5vdXRwdXRfY3Vyc29y
LnZwb3M7CisgIGludCBjb3VudCA9IDE7CisgIGludCBteV9zYXZlZF9waXhlbF93aWR0aCA9IDA7
CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICBTVEFSVCBE
SVNQTEFZIEFORCBQUklNRSBJVAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIC8qIEJlZ2lu
IHRoZSBqb3VybmV5IGF0IHctPnN0YXJ0LiAqLworICBTRVRfVEVYVF9QT1NfRlJPTV9NQVJLRVIg
KHN0YXJ0X3RleHRfcG9zaXRpb24sIHctPnN0YXJ0KTsKKyAgc3RhcnRfZGlzcGxheSAoJml0LCB3
LCBzdGFydF90ZXh0X3Bvc2l0aW9uKTsKKyAgZmlyc3RfeCA9IGl0LmZpcnN0X3Zpc2libGVfeDsK
KyAgbGFzdF94ID0gaXQubGFzdF92aXNpYmxlX3g7CisgIGl0X3N0YXJ0ID0gSVRfQ0hBUlBPUyAo
aXQpOworICBTQVZFX0lUIChzYXZlZF9pdF9mb3Jfd2luZG93X3N0YXJ0LCBpdCwgc2F2ZWRfaXRk
YXRhX2Zvcl93aW5kb3dfc3RhcnQpOworICAvKiBGaW5pc2ggcHJpbWluZyB0aGUgSVQgZm9yIHBv
dGVudGlhbCBsaW5lIG51bWJlcnMuICovCisgIGlmICghTklMUCAoVmRpc3BsYXlfbGluZV9udW1i
ZXJzKQorICAgICAgJiYgIUVRIChWZGlzcGxheV9saW5lX251bWJlcnMsIFF2aXN1YWwpKQorICAg
IHsKKyAgICAgIGl0LmZpcnN0X3Zpc2libGVfeCA9IDA7CisgICAgICBtb3ZlX2l0X2J5X2xpbmVz
ICgmaXQsIDEpOworICAgICAgbG51bV93aWR0aCA9IGl0LmxudW1fd2lkdGg7CisgICAgICBsbnVt
X3BpeGVsX3dpZHRoID0gaXQubG51bV9waXhlbF93aWR0aDsKKyAgICAgIFJFU1RPUkVfSVQgKCZp
dCwgJnNhdmVkX2l0X2Zvcl93aW5kb3dfc3RhcnQsIHNhdmVkX2l0ZGF0YV9mb3Jfd2luZG93X3N0
YXJ0KTsKKyAgICAgIGl0LmZpcnN0X3Zpc2libGVfeCA9IGZpcnN0X3g7CisgICAgICBpdC5sYXN0
X3Zpc2libGVfeCA9IGxhc3RfeDsKKyAgICAgIGl0LmxudW1fd2lkdGggPSBsbnVtX3dpZHRoOwor
ICAgICAgaXQubG51bV9waXhlbF93aWR0aCA9IGxudW1fcGl4ZWxfd2lkdGg7CisgICAgICBTQVZF
X0lUIChzYXZlZF9pdF9mb3Jfd2luZG93X3N0YXJ0LCBpdCwgc2F2ZWRfaXRkYXRhX2Zvcl93aW5k
b3dfc3RhcnQpOworICAgIH0KKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIEdPVE8gTElORSBCRUdJTgorKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICov
CisgIC8qIFBsYWNlIHRoZSBJVCBvbiB0aGUgY3VycmVudCBsaW5lIGNvbnRhaW5pbmcgUFQuICov
CisgIGludCB2b2Zmc2V0ID0gKGhlYWRlcl9saW5lX2hlaWdodCA+IDAKKyAgICAgICAgICAgICAg
ICAgJiYgb3BvaW50X3Zwb3MgPiAwKQorICAgICAgICAgICAgICAgICAgPyBvcG9pbnRfdnBvcyAt
IDEKKyAgICAgICAgICAgICAgICAgIDogb3BvaW50X3Zwb3M7CisgIGlmICh2b2Zmc2V0ID4gMCkK
KyAgICBtb3ZlX2l0X2J5X2xpbmVzICgmaXQsIHZvZmZzZXQpOworLyogKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqCisgICAgICAgICAgICAgICAgICAgICAgICBGSVJTVCBYID0+IFBFTlVMVElNQVRFIEVP
TAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqICovCisgIHdoaWxlICh0cnVlKQorICAgIHsKKyAgICAg
IGlmIChoc2NsKQorICAgICAgICB7CisgICAgICAgICAgcmVsYXRpdmVfeCA9IGl0LmN1cnJlbnRf
eCAtIChoc2NsX2ZpcnN0X2hwb3MgKiBmcmFtZV9jaGFyX3dpZHRoKTsKKyAgICAgICAgICBocG9z
ID0gaXQuaHBvcyAtIGhzY2xfZmlyc3RfaHBvczsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisg
ICAgICAgICAgeworICAgICAgICAgICAgcmVsYXRpdmVfeCA9IGl0LmN1cnJlbnRfeCAtIGZpcnN0
X3g7CisgICAgICAgICAgICBocG9zID0gaXQuaHBvczsKKyAgICAgICAgICB9CisgICAgICBpZiAo
aGVhZGVyX2xpbmVfaGVpZ2h0ID4gMCkKKyAgICAgICAgdnBvcyA9IGl0LnZwb3MgKyAxOworICAg
ICAgICBlbHNlCisgICAgICAgICAgdnBvcyA9IGl0LnZwb3M7CisgICAgICBib29sIGZpbmFsX2xv
b3BfcCA9IChJVEVSQVRPUl9BVF9FTkRfT0ZfTElORV9QICgmaXQpCisgICAgICAgICAgICAgICAg
ICAgICAgICAgICB8fCBGRVRDSF9CWVRFIChJVF9CWVRFUE9TIChpdCkpID09ICdcbicKKyAgICAg
ICAgICAgICAgICAgICAgICAgICAgIHx8IHJjID09IE1PVkVfUE9TX01BVENIX09SX1pWKTsKKyAg
ICAgIGlmIChmaW5hbF9sb29wX3ApCisgICAgICAgIGJyZWFrOworICAgICAgYm9vbCBub3RoaW5n
X3AgPSAoaXQuYyA9PSAwKTsKKyAgICAgIGJvb2wgdGFiX3Zpc2libGVfcCA9IChpdC5jID09IDE4
Nyk7CisgICAgICBib29sIHRhYl9pbnZpc2libGVfcCA9IChpdC5jID09ICdcdCcpOworICAgICAg
aWYgKHctPmhzY3JvbGwgPiAwKQorICAgICAgICBmcHJpbnRmIChzdGRlcnIsICJcbiVkLiAgJXNc
blwKKyAgICBpdC5jICglZClcblwKKyAgICB3LT5oc2Nyb2xsICglZClcblwKKyAgICBpdC5jdXJy
ZW50X3ggKCVkKVxuXAorICAgIGl0LnBpeGVsX3dpZHRoICglZClcblwKKyAgICBpdC5teV9waXhl
bF93aWR0aCAoJWQpXG5cCisgICAgJXMgKCVkKVxuIiwKKyAgICAgICAgICAgICAgICAgY291bnQs
CisgICAgICAgICAgICAgICAgIChub3RoaW5nX3AKKyAgICAgICAgICAgICAgICAgICA/ICJOT1RI
SU5HIgorICAgICAgICAgICAgICAgICAgIDogdGFiX3Zpc2libGVfcAorICAgICAgICAgICAgICAg
ICAgICAgPyAiVEFCIENIQVJBQ1RFUiIKKyAgICAgICAgICAgICAgICAgICA6IHRhYl9pbnZpc2li
bGVfcAorICAgICAgICAgICAgICAgICAgICAgPyAiVEFCIFNUUkVUQ0giCisgICAgICAgICAgICAg
ICAgICAgOiAiVEVYVCIpLAorICAgICAgICAgICAgICAgICBpdC5jLAorICAgICAgICAgICAgICAg
ICB3X2hzY3JvbGwsCisgICAgICAgICAgICAgICAgIGl0LmN1cnJlbnRfeCwKKyAgICAgICAgICAg
ICAgICAgaXQucGl4ZWxfd2lkdGgsCisgICAgICAgICAgICAgICAgIGl0Lm15X3BpeGVsX3dpZHRo
LAorICAgICAgICAgICAgICAgICAoKCFub3RoaW5nX3AKKyAgICAgICAgICAgICAgICAgICAmJiAh
dGFiX3Zpc2libGVfcAorICAgICAgICAgICAgICAgICAgICYmICF0YWJfaW52aXNpYmxlX3ApCisg
ICAgICAgICAgICAgICAgICA/ICJmaXJzdF94ICsgbG51bV9waXhlbF93aWR0aCArIG15X3NhdmVk
X3BpeGVsX3dpZHRoIgorICAgICAgICAgICAgICAgICAgOiAiTi9BIiksCisgICAgICAgICAgICAg
ICAgICgoIW5vdGhpbmdfcAorICAgICAgICAgICAgICAgICAgICYmICF0YWJfdmlzaWJsZV9wCisg
ICAgICAgICAgICAgICAgICAgJiYgIXRhYl9pbnZpc2libGVfcCkKKyAgICAgICAgICAgICAgICAg
ID8gZmlyc3RfeCArIGxudW1fcGl4ZWxfd2lkdGggKyBteV9zYXZlZF9waXhlbF93aWR0aAorICAg
ICAgICAgICAgICAgICAgOiAwKSk7CisgICAgICByYyA9IG1vdmVfaXRfaW5fZGlzcGxheV9saW5l
X3RvICgmaXQsIFpWLCBpdC5jdXJyZW50X3ggKyBpdC5waXhlbF93aWR0aCwKKyAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1PVkVfVE9fUE9TIHwgTU9WRV9UT19YKTsKKyAg
ICAgIGNvdW50ID0gY291bnQgKyAxOworICAgICAgaWYgKGl0Lm15X3BpeGVsX3dpZHRoID4gMCkK
KyAgICAgICAgbXlfc2F2ZWRfcGl4ZWxfd2lkdGggPSBpdC5teV9waXhlbF93aWR0aDsKKyAgICAg
IGlmIChyYyA9PSBNT1ZFX0xJTkVfQ09OVElOVUVEKQorICAgICAgICBicmVhazsKKyAgICAgIHJl
bGF0aXZlX3ggPSAoaHNjbCkKKyAgICAgICAgICAgICAgICAgICA/IGl0LmN1cnJlbnRfeCAtICho
c2NsX2ZpcnN0X2hwb3MgKiBmcmFtZV9jaGFyX3dpZHRoKQorICAgICAgICAgICAgICAgICAgIDog
aXQuY3VycmVudF94IC0gZmlyc3RfeDsKKyAgICAgIGlmIChyZWxhdGl2ZV94ICsgZnJhbWVfY2hh
cl93aWR0aCA+PSB0ZXh0X2FyZWFfd2lkdGgpCisgICAgICAgIGJyZWFrOworICAgIH0KKyAgcmVk
aXNwbGF5X2ludGVybmFsICgpOworICBmcHJpbnRmIChzdGRlcnIsICJcbiIpOworICBzdHJ1Y3Qg
Z2x5cGhfcm93ICpnbHlwaF9yb3cgPSBNQVRSSVhfUk9XICh3LT5jdXJyZW50X21hdHJpeCwgaXQu
dnBvcyk7CisgIGR1bXBfZ2x5cGhfcm93IChnbHlwaF9yb3csIGl0LnZwb3MsIDIpOworICBiaWRp
X3Vuc2hlbHZlX2NhY2hlIChpdGRhdGEsIGZhbHNlKTsKKyAgcmV0dXJuIFFuaWw7Cit9CisKKy8q
ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKiAqLworCisKIHZvaWQKIHN5bXNfb2ZfeGRpc3AgKHZvaWQpCiB7
CisKKworLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisvKiBEZWJ1ZyB0aGUgcGl4ZWwtd2lkdGgg
b2YgYSBzdHJldGNoIHRhYi4gKi8KKworICBkZWZzdWJyICgmU2RlYnVnX3RhYl9waXhlbF93aWR0
aCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgVndpdGhfZWNob19hcmVhX3Nh
dmVfdmVjdG9yID0gUW5pbDsKICAgc3RhdGljcHJvICgmVndpdGhfZWNob19hcmVhX3NhdmVfdmVj
dG9yKTsKIAo=
--Multipart_Mon_Jan_22_23:52:20_2018-1--




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#30226: Fixing it->pixel_width / it->current_x when tabs and line numbers.
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 27 Jan 2018 14:57:02 +0000
Resent-Message-ID: <handler.30226.B30226.151706497717865 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 30226
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Keith David Bershatsky <esq@HIDDEN>
Cc: 30226 <at> debbugs.gnu.org
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Received: via spool by 30226-submit <at> debbugs.gnu.org id=B30226.151706497717865
          (code B ref 30226); Sat, 27 Jan 2018 14:57:02 +0000
Received: (at 30226) by debbugs.gnu.org; 27 Jan 2018 14:56:17 +0000
Received: from localhost ([127.0.0.1]:45317 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1efRtw-0004e5-P3
	for submit <at> debbugs.gnu.org; Sat, 27 Jan 2018 09:56:17 -0500
Received: from eggs.gnu.org ([208.118.235.92]:41765)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1efRtu-0004ds-R3
 for 30226 <at> debbugs.gnu.org; Sat, 27 Jan 2018 09:56:15 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1efRtl-0002wr-JS
 for 30226 <at> debbugs.gnu.org; Sat, 27 Jan 2018 09:56:09 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54366)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1efRtl-0002wj-Fd; Sat, 27 Jan 2018 09:56:05 -0500
Received: from [176.228.60.248] (port=3394 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1efRtk-0003bl-3Q; Sat, 27 Jan 2018 09:56:04 -0500
Date: Sat, 27 Jan 2018 16:56:05 +0200
Message-Id: <83bmhfjqpm.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-reply-to: <m2607tqaff.wl%esq@HIDDEN> (message from Keith David
 Bershatsky on Mon, 22 Jan 2018 23:52:20 -0800)
References: <m2k1w9kp35.wl%esq@HIDDEN> <m2607tqaff.wl%esq@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> Date: Mon, 22 Jan 2018 23:52:20 -0800
> From: Keith David Bershatsky <esq@HIDDEN>
> 
> Here is a revised patch that removes an erroneous section that was experimental.

Thanks, but I'm unable to reproduce the original problem, so I cannot
yet discuss the reasons, let alone the solution.

Here's what I did in Emacs built from the current emacs-26 branch:

 1) Inserted the following snippet into *scratch*:

    (setq display-line-numbers t)
    (setq buffer-display-table (make-display-table))
    (aset buffer-display-table
	  ?\t
	  (vector (make-glyph-code ?\u00BB 'font-lock-warning-face)
		  (make-glyph-code ?\t 'highlight)))
    (setq tab-width 8)

 2) Evaluated it ("M-x eval-region RET").

 3) Went to the end of the buffer, inserted a few empty lines, then
    went up 2 lines from EOB, and typed "C-q TAB Hello-world"

 4) Typed "M-x dump-glyph-row RET"

The result is this data shown on stderr:

  Row     Start       End Used oE><\CTZFesm     X    Y    W    H    V    A    P
  ==============================================================================
   11       409       422   18 010000100000     0  176  192   16   16   12   12
	     -1        -1     0
	     -1        -1
	     -1        -1
   Glyph#  Type       Pos   O   W     Code      C Face LR
	0     C        -1   0   8 0x000020          20 00
	1     C        -1   0   8 0x000031      1   20 00
	2     C        -1   0   8 0x000032      2   20 00
	3     C        -1   0   8 0x000020          20 00
	4     C       409   B   8 0x0000bb      .   23 00
	5     S       409   B  56 0x000000          22 00  <<<<<<<<<<<<<<<<<<
	6     C       410   B   8 0x000048      H    0 00
	7     C       411   B   8 0x000065      e    0 00
	8     C       412   B   8 0x00006c      l    0 00
	9     C       413   B   8 0x00006c      l    0 00
       10     C       414   B   8 0x00006f      o    0 00
       11     C       415   B   8 0x00002d      -    0 00
       12     C       416   B   8 0x000077      w    0 00
       13     C       417   B   8 0x00006f      o    0 00
       14     C       418   B   8 0x000072      r    0 00
       15     C       419   B   8 0x00006c      l    0 00
       16     C       420   B   8 0x000064      d    0 00
       17     C         0   0   8 0x000020           0 00

This is as expected: the width of the default font is 8, and the size
of the stretch glyph #5 is 8x8 = 56, as expected.

Next, I typed "M-: (scroll-left 1) RET" and again invoked
dump-glyph-row.  The result:

  Row     Start       End Used oE><\CTZFesm     X    Y    W    H    V    A    P
  ==============================================================================
   11       409       422   17 011000100000     0  176  176   16   16   12   12
	     -1        -1     0
	     -1        -1
	     -1        -1
   Glyph#  Type       Pos   O   W     Code      C Face LR
	0     C        -1   0   8 0x000020          20 00
	1     C        -1   0   8 0x000031      1   20 00
	2     C        -1   0   8 0x000032      2   20 00
	3     C        -1   0   8 0x000020          20 00
	4     S       409   B  48 0x000000          22 00  <<<<<<<<<<<<<<
	5     C       410   B   8 0x000048      H    0 00
	6     C       411   B   8 0x000065      e    0 00
	7     C       412   B   8 0x00006c      l    0 00
	8     C       413   B   8 0x00006c      l    0 00
	9     C       414   B   8 0x00006f      o    0 00
       10     C       415   B   8 0x00002d      -    0 00
       11     C       416   B   8 0x000077      w    0 00
       12     C       417   B   8 0x00006f      o    0 00
       13     C       418   B   8 0x000072      r    0 00
       14     C       419   B   8 0x00006c      l    0 00
       15     C       420   B   8 0x000064      d    0 00
       16     C         0   0   8 0x000020           0 00

Note that the glyph corresponding to the u+00BB character now
disappeared from display, and therefore the stretch glyph is #4, its
width is 48 -- again, as expected.

I then typed "M-: (scroll-left 1) RET" once more, followed by
dump-glyph-row, and the results are:

  Row     Start       End Used oE><\CTZFesm     X    Y    W    H    V    A    P
  ==============================================================================
   11       409       422   17 011000100000     0  176  168   16   16   12   12
	     -1        -1     0
	     -1        -1
	     -1        -1
   Glyph#  Type       Pos   O   W     Code      C Face LR
	0     C        -1   0   8 0x000020          20 00
	1     C        -1   0   8 0x000031      1   20 00
	2     C        -1   0   8 0x000032      2   20 00
	3     C        -1   0   8 0x000020          20 00
	4     S       409   B  40 0x000000          22 00  <<<<<<<<<<<<<
	5     C       410   B   8 0x000048      H    0 00
	6     C       411   B   8 0x000065      e    0 00
	7     C       412   B   8 0x00006c      l    0 00
	8     C       413   B   8 0x00006c      l    0 00
	9     C       414   B   8 0x00006f      o    0 00
       10     C       415   B   8 0x00002d      -    0 00
       11     C       416   B   8 0x000077      w    0 00
       12     C       417   B   8 0x00006f      o    0 00
       13     C       418   B   8 0x000072      r    0 00
       14     C       419   B   8 0x00006c      l    0 00
       15     C       420   B   8 0x000064      d    0 00
       16     C         0   0   8 0x000020           0 00

Now the stretch glyph's width is 40 pixels, again as expected.

So the width of the stretch glyph is computed correctly.  And your
screenshots also show similar results, where the width of the stretch
glyph is decremented for each call to scroll-left.

Your problem description talks about it->pixel_width, not about
glyph->pixel_width, but the latter should be equal to the former,
because x_produce_glyphs does this when it finishes computing the
width of the stretch glyph:

	      if (it->glyph_row)
		{
		  append_stretch_glyph (it, it->object, it->pixel_width,
					it->ascent + it->descent, it->ascent);

and the function append_stretch_glyph then assigns the value of its
3rd argument to glyph->pixel_width:

  static void
  append_stretch_glyph (struct it *it, Lisp_Object object,
			int width, int height, int ascent)
  {
    ...
	glyph->pixel_width = clip_to_bounds (-1, width, SHRT_MAX);

So I'm not sure why you are saying there's a bug in the display code
regarding it->pixel_width of the stretch glyphs that represent TAB
characters.

You say:

> In a nutshell, it->pixel_width and it->current_x are both incorrect in that situation.  Because the X is wrong, all subsequent references to it->current_x on the same line are also wrong.

I don't understand why you are saying that it->current_x is wrong.
What is that assertion based on?  Maybe there's some misunderstanding
of what current_x is and relative to what position does it measure the
X coordinate.  Can you tell what you expected current_x to be in some
specific situation (i.e., specific horizontal scroll of the display
in the above scenario), and what you really found?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#30226: Fixing it->pixel_width / it->current_x when tabs and line numbers.
References: <m2k1w9kp35.wl%esq@HIDDEN>
In-Reply-To: <m2k1w9kp35.wl%esq@HIDDEN>
Resent-From: Keith David Bershatsky <esq@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 27 Jan 2018 21:21:02 +0000
Resent-Message-ID: <handler.30226.B30226.15170880601862 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 30226
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: 30226 <at> debbugs.gnu.org
Received: via spool by 30226-submit <at> debbugs.gnu.org id=B30226.15170880601862
          (code B ref 30226); Sat, 27 Jan 2018 21:21:02 +0000
Received: (at 30226) by debbugs.gnu.org; 27 Jan 2018 21:21:00 +0000
Received: from localhost ([127.0.0.1]:45547 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1efXuG-0000Ty-9C
	for submit <at> debbugs.gnu.org; Sat, 27 Jan 2018 16:21:00 -0500
Received: from gateway21.websitewelcome.com ([192.185.45.36]:24870)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <esq@HIDDEN>) id 1efXuD-0000Tp-Px
 for 30226 <at> debbugs.gnu.org; Sat, 27 Jan 2018 16:20:58 -0500
Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4])
 by gateway21.websitewelcome.com (Postfix) with ESMTP id 50D7E400C93BD
 for <30226 <at> debbugs.gnu.org>; Sat, 27 Jan 2018 15:20:57 -0600 (CST)
Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP
 id fXuCeCac4cGlpfXuDeFXQm; Sat, 27 Jan 2018 15:20:57 -0600
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com
 ; s=default;
 h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date:
 Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:
 Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
 In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=YFR6IXXbESNqj6OjpHhAyocgUA98XFujzgE6ra5Vuxo=; b=H+fZU+QfQVm84+3PG2YiYrRill
 XsIwwe6U/U9A3sS4WEbo4NmYY5/Wt/N+5FehY/2XjdqsvBcRSAryjOuAEkTt48LCpCc+ZifRq9ujq
 SJdI9MDhLiXQbFDygB12wTy4tXffjy11zj3+gj9mP1Iu5tLVi/vzxXuB59oTnUXCRZ6AA5SoeS92G
 EwXTmzywtggFRg9YNaFzXY/pLDMyVTjvaDYN3A0JHANO9vPnuzZa0xy/5wOQeNZxam8zKHVnR/u4T
 etMtfzdOhUkJ5cnCoxVWs/y7uXV8mYZHBhcXnaSCX1ySe1/glNjDerDCSVciDticyhtsYJ+LkNVhP
 za+jPTbA==;
Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:51885
 helo=server.private)
 by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256)
 (Exim 4.89_1) (envelope-from <esq@HIDDEN>)
 id 1efXuC-000KQJ-Bx; Sat, 27 Jan 2018 15:20:56 -0600
Date: Sat, 27 Jan 2018 13:20:55 -0800
Message-ID: <m2wp03m214.wl%esq@HIDDEN>
From: Keith David Bershatsky <esq@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
X-AntiAbuse: This header was added to track abuse,
 please include it with any abuse report
X-AntiAbuse: Primary Hostname - gator3053.hostgator.com
X-AntiAbuse: Original Domain - debbugs.gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - lawlist.com
X-BWhitelist: no
X-Source-IP: 45.48.239.195
X-Source-L: No
X-Exim-ID: 1efXuC-000KQJ-Bx
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private)
 [45.48.239.195]:51885
X-Source-Auth: lawlist
X-Email-Count: 1
X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t
X-Local-Domain: yes
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Thank you, Eli, for looking into #30226.

> Your problem description talks about it->pixel_width, not about
> glyph->pixel_width, but the latter should be equal to the former . . .,
> 
* * *
> 
> I don't understand why you are saying that it->current_x is wrong.
> What is that assertion based on?  Maybe there's some misunderstanding
> of what current_x is and relative to what position does it measure the
> X coordinate.  Can you tell what you expected current_x to be in some
> specific situation (i.e., specific horizontal scroll of the display
> in the above scenario), and what you really found?

dump-glyph-row is _correct_, assuming that a redisplay has occurred prior to calling that function.

Feature request 17684 (i.e., crosshairs) uses move_it_in_display_line_to -- by increments of it.pixel_width -- to dump various values for each character in the current line.  I reproduce issue #30226 by placing IT at the beginning of the current line (i.e., it.current_x == 0) and iterating over each character in that line:

  move_it_in_display_line_to (&it, ZV, it.current_x + it.pixel_width,
                              MOVE_TO_POS | MOVE_TO_X);

Your outline of the steps needed to reproduce this issue requires a few additional steps:

Step 0.5) Build a new Emacs 26 with the reduced/simplified function named bug-30226 (written below); and, add `defsubr (&Sbug_30226);` to syms_of_xdisp.

Step 1) No changes.

Step 2) No changes.

Step 3) No changes.

Step 4) Instead of typing "M-: (scroll-left 1) RET", type "M-: (bug-30226) RET".  w->hscroll should now equal 1.  In step 4, there is a _hiccup_ with the initial value of it->pixel_width being wrong as to the tab STRETCH, and the subsequent value of it->pixel_width is correct as to the tab STRETCH.

1.  NOTHING
    it.c (0)
    w->hscroll (1)
    it.current_x (0)
    it.pixel_width (0)

2.  TAB CHARACTER
    it.c (187)
    w->hscroll (1)
    it.current_x (0)
    it.pixel_width (7)

3.  TAB STRETCH
    it.c (9)
    w->hscroll (1)
    it.current_x (7)
    it.pixel_width (49)

4.  TAB STRETCH
    it.c (9)
    w->hscroll (1)
    it.current_x (35)
    it.pixel_width (42)

5.  TEXT
    it.c (72)
    w->hscroll (1)
    it.current_x (77)
    it.pixel_width (7)

* * *

Row     Start       End Used oE><\CTZFesm     X    Y    W    H    V    A    P
==============================================================================
 12       455       467   17 111000110000     0  192  154   16   16   12   12
           -1        -1	    0
           -1        -1
           -1        -1
 Glyph#  Type       Pos   O   W     Code      C Face LR
      0     C        -1   0   7 0x000020          29 00
      1     C        -1   0   7 0x000031      1   29 00
      2     C        -1   0   7 0x000033      3   29 00
      3     C        -1   0   7 0x000020          29 00
      4     S       455   B  42 0x000000          31 00
      5     C       456   B   7 0x000048      H    0 00
      6     C       457   B   7 0x000065      e    0 00
      7     C       458   B   7 0x00006c      l    0 00
      8     C       459   B   7 0x00006c      l    0 00
      9     C       460   B   7 0x00006f      o    0 00
     10     C       461   B   7 0x00002d      -    0 00
     11     C       462   B   7 0x000077      w    0 00
     12     C       463   B   7 0x00006f      o    0 00
     13     C       464   B   7 0x000072      r    0 00
     14     C       465   B   7 0x00006c      l    0 00
     15     C       466   B   7 0x000064      d    0 00
     16     C         0   0   7 0x000020           0 00


Step 5) Type "M-: (bug-30226) RET".  w->hscroll should now equal 2.  In step 5, the value for it->pixel_width is wrong as to the tab STRETCH and it->current_x is wrong as to the characters that follow the tab STRETCH -- probably because it->pixel_width of the tab STRETCH was wrong.

1.  NOTHING
    it.c (0)
    w->hscroll (2)
    it.current_x (0)
    it.pixel_width (0)

2.  TAB CHARACTER
    it.c (187)
    w->hscroll (2)
    it.current_x (0)
    it.pixel_width (7)

3.  TAB STRETCH
    it.c (9)
    w->hscroll (2)
    it.current_x (7)
    it.pixel_width (49)

4.  TEXT
    it.c (72)
    w->hscroll (2)
    it.current_x (84)
    it.pixel_width (7)

* * *

Row     Start       End Used oE><\CTZFesm     X    Y    W    H    V    A    P
==============================================================================
 12       455       467   17 111000110000     0  192  147   16   16   12   12
           -1        -1	    0
           -1        -1
           -1        -1
 Glyph#  Type       Pos   O   W     Code      C Face LR
      0     C        -1   0   7 0x000020          29 00
      1     C        -1   0   7 0x000031      1   29 00
      2     C        -1   0   7 0x000033      3   29 00
      3     C        -1   0   7 0x000020          29 00
      4     S       455   B  35 0x000000          31 00
      5     C       456   B   7 0x000048      H    0 00
      6     C       457   B   7 0x000065      e    0 00
      7     C       458   B   7 0x00006c      l    0 00
      8     C       459   B   7 0x00006c      l    0 00
      9     C       460   B   7 0x00006f      o    0 00
     10     C       461   B   7 0x00002d      -    0 00
     11     C       462   B   7 0x000077      w    0 00
     12     C       463   B   7 0x00006f      o    0 00
     13     C       464   B   7 0x000072      r    0 00
     14     C       465   B   7 0x00006c      l    0 00
     15     C       466   B   7 0x000064      d    0 00
     16     C         0   0   7 0x000020           0 00


I have further reduced/simplified our test function (below) that uses move_it_in_display_line_to to iterate over each character in the current line, and print the relevant values to STDERR as the iteration is occurring.  At the very end of the test function, dump_glyph_row is called (following a forced redisplay) to help us compare its values to the previous values returned subsequent to each call of move_it_in_display_line_to.

DEFUN ("bug-30226", Fbug_30226, Sbug_30226, 0, 0, 0,
       doc: /* Debug the pixel-width of a stretch tab. */)
  (void)
{
  Fscroll_left (make_number (1), Qnil);
  struct window *w = decode_live_window (selected_window);
  struct frame *f = XFRAME (w->frame);
  struct it it;
  void *itdata = bidi_shelve_cache ();
  enum move_it_result rc = MOVE_X_REACHED;
  struct text_pos start_text_position;
  int count = 1;
/* ******************************************************************************
                      START DISPLAY -- w->start
****************************************************************************** */
  /* Begin the journey at w->start. */
  SET_TEXT_POS_FROM_MARKER (start_text_position, w->start);
  start_display (&it, w, start_text_position);
  struct face *face = FACE_FROM_ID (it.f, it.face_id);
  struct font *font = face->font;
/* ******************************************************************************
                GO TO THE BEGINNING OF THE CURRENT LINE.
****************************************************************************** */
  /* Place the IT on the current line containing PT. */
  int voffset = (WINDOW_HEADER_LINE_HEIGHT (w) > 0
                 && w->output_cursor.vpos > 0)
                  ? w->output_cursor.vpos - 1
                  : w->output_cursor.vpos;
  if (voffset > 0)
    move_it_by_lines (&it, voffset);
/* ******************************************************************************
             MOVE IT OVER EACH CHARACTER ON THE CURRENT LINE.
****************************************************************************** */
  while (true)
    {
      if (ITERATOR_AT_END_OF_LINE_P (&it)
          || FETCH_BYTE (IT_BYTEPOS (it)) == '\n'
          || rc == MOVE_POS_MATCH_OR_ZV)
        break;
/* ******************************************************************************
                       DUMP RELEVANT GLYPH INFORMATION
****************************************************************************** */
      if (w->hscroll > 0)
        {
          int w_hscroll = w->hscroll;
          fprintf (stderr, "\n%d.  %s\n\
    it.c (%d)\n\
    w->hscroll (%d)\n\
    it.current_x (%d)\n\
    it.pixel_width (%d)\n",
                 count,
                 (it.c == 0
                   ? "NOTHING"
                   : it.c == 187
                     ? "TAB CHARACTER"
                   : it.c == '\t'
                     ? "TAB STRETCH"
                   : "TEXT"),
                 it.c,
                 w_hscroll,
                 it.current_x,
                 it.pixel_width);
        }
/* ******************************************************************************
                       MOVE IT -- INCREMENT == IT.PIXEL_WIDTH 
****************************************************************************** */
      rc = move_it_in_display_line_to (&it, ZV, it.current_x + it.pixel_width,
                                       MOVE_TO_POS | MOVE_TO_X);
      count = count + 1;
      if (rc == MOVE_LINE_CONTINUED)
        break;
      if (it.current_x - it.first_visible_x + font->space_width >=
          window_box_width (w, TEXT_AREA))
        break;
    }
/* ******************************************************************************
                         REDISPLAY AND DUMP_GLPYH_ROW
****************************************************************************** */
  redisplay_internal ();
  fprintf (stderr, "\n");
  struct glyph_row *glyph_row = MATRIX_ROW (w->current_matrix, it.vpos);
  dump_glyph_row (glyph_row, it.vpos, 2);
  bidi_unshelve_cache (itdata, false);
  return Qnil;
}




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#30226: Fixing it->pixel_width / it->current_x when tabs and line numbers.
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 28 Jan 2018 18:16:01 +0000
Resent-Message-ID: <handler.30226.B30226.151716334424980 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 30226
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Keith David Bershatsky <esq@HIDDEN>
Cc: 30226 <at> debbugs.gnu.org
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Received: via spool by 30226-submit <at> debbugs.gnu.org id=B30226.151716334424980
          (code B ref 30226); Sun, 28 Jan 2018 18:16:01 +0000
Received: (at 30226) by debbugs.gnu.org; 28 Jan 2018 18:15:44 +0000
Received: from localhost ([127.0.0.1]:46452 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1efrUV-0006Uq-Iq
	for submit <at> debbugs.gnu.org; Sun, 28 Jan 2018 13:15:43 -0500
Received: from eggs.gnu.org ([208.118.235.92]:46365)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1efrUU-0006Ue-04
 for 30226 <at> debbugs.gnu.org; Sun, 28 Jan 2018 13:15:42 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1efrUL-0007ct-Np
 for 30226 <at> debbugs.gnu.org; Sun, 28 Jan 2018 13:15:36 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43094)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1efrUL-0007cm-J2; Sun, 28 Jan 2018 13:15:33 -0500
Received: from [176.228.60.248] (port=4797 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1efrUL-0006T4-2i; Sun, 28 Jan 2018 13:15:33 -0500
Date: Sun, 28 Jan 2018 20:15:37 +0200
Message-Id: <83po5tj1di.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-reply-to: <m2wp03m214.wl%esq@HIDDEN> (message from Keith David
 Bershatsky on Sat, 27 Jan 2018 13:20:55 -0800)
References: <m2wp03m214.wl%esq@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> Date:  Sat, 27 Jan 2018 13:20:55 -0800
> From:  Keith David Bershatsky <esq@HIDDEN>
> Cc:  30226 <at> debbugs.gnu.org
> 
> dump-glyph-row is _correct_, assuming that a redisplay has occurred prior to calling that function.

Glyph matrices are produced by redisplay, so of course one needs
redisplay to happen before the glyph-rows can be meaningfully dumped.

> Feature request 17684 (i.e., crosshairs) uses move_it_in_display_line_to -- by increments of it.pixel_width -- to dump various values for each character in the current line.  I reproduce issue #30226 by placing IT at the beginning of the current line (i.e., it.current_x == 0) and iterating over each character in that line:
> 
>   move_it_in_display_line_to (&it, ZV, it.current_x + it.pixel_width,
>                               MOVE_TO_POS | MOVE_TO_X);
> 
> Your outline of the steps needed to reproduce this issue requires a few additional steps:
> 
> Step 0.5) Build a new Emacs 26 with the reduced/simplified function named bug-30226 (written below); and, add `defsubr (&Sbug_30226);` to syms_of_xdisp.
> 
> Step 1) No changes.
> 
> Step 2) No changes.
> 
> Step 3) No changes.
> 
> Step 4) Instead of typing "M-: (scroll-left 1) RET", type "M-: (bug-30226) RET".  w->hscroll should now equal 1.  In step 4, there is a _hiccup_ with the initial value of it->pixel_width being wrong as to the tab STRETCH, and the subsequent value of it->pixel_width is correct as to the tab STRETCH.
> 
> 1.  NOTHING
>     it.c (0)
>     w->hscroll (1)
>     it.current_x (0)
>     it.pixel_width (0)
> 
> 2.  TAB CHARACTER
>     it.c (187)
>     w->hscroll (1)
>     it.current_x (0)
>     it.pixel_width (7)
> 
> 3.  TAB STRETCH
>     it.c (9)
>     w->hscroll (1)
>     it.current_x (7)
>     it.pixel_width (49)
> 
> 4.  TAB STRETCH
>     it.c (9)
>     w->hscroll (1)
>     it.current_x (35)
>     it.pixel_width (42)

I don't see any such "hiccups" on my system.  But that's an aside.

> Step 5) Type "M-: (bug-30226) RET".  w->hscroll should now equal 2.  In step 5, the value for it->pixel_width is wrong as to the tab STRETCH and it->current_x is wrong as to the characters that follow the tab STRETCH -- probably because it->pixel_width of the tab STRETCH was wrong.

Well, I looked into the relevant code, and I don't find any bugs
there, only subtle (mis)features.

The main problems in your design are twofold:

  . move_it_in_display_line_to is "tricky" when called with MOVE_TO_X
    flag in its last argument.  It is tricky because when it returns
    with it->current_x set to some X, it actually already processed
    the glyph following that coordinate.  In your case, that glyph is
    the stretch glyph used to display the TAB.  In effect,
    move_it_in_display_line_to processes the stretch glyph, and then
    backs up, but it leaves the value of it->pixel_width as it was
    computed during that (abandoned) processing.  The value of
    pixel_width is indeed not adjusted in this case, but since it
    "belongs" to the "next" glyph, it shouldn't be expected to be
    accurate.
  . the value of it->pixel_width was never intended to be used by code
    which calls move_it_* functions, it is a temporary store used by
    the display engine for its internal purposes.  The above "tricky"
    aspect of move_it_in_display_line_to is just one manifestation of
    that general fact.  In a nutshell, it->pixel_width is not
    guaranteed to describe accurately the glyph at the location where
    these functions return: it can be a glyph before or after that
    place, and as you see in your example, it can be inaccurately
    calculated.

Bottom line: to get accurate values of pixel width, you need to
subtract it->current_x value at some position from current_x at the
next glyph position.  This is the only reliable way to obtain accurate
pixel width values when using the move_it_* functions.

As an aside, the value of it->pixel_width you see in the scenario
described in this thread cannot even be accused of inaccuracy: it
describes accurately the pixel width of the stretch glyph, except that
part of that glyph is not visible because it precedes
it->first_visible_x, and so is outside of the window "viewport".  This
happens even when line numbers are not displayed (your debug code
prints the same "incorrect" width values for me in that case, contrary
to what you told originally).  When line numbers is displayed, they
muddy the waters even more, because the part of the stretch glyph that
is left invisible is followed by the glyphs produced to show the line
number, and "the rest" of the stretch glyph follows that.  Which is
probably why you expected the width of the stretch glyph, as reflected
in it->pixel_width, to change with the hscroll, but in fact it doesn't
change at all, the hscroll just makes part of the stretch invisible.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#30226: Fixing it->pixel_width / it->current_x when tabs and line numbers.
References: <m2k1w9kp35.wl%esq@HIDDEN>
In-Reply-To: <m2k1w9kp35.wl%esq@HIDDEN>
Resent-From: Keith David Bershatsky <esq@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 28 Jan 2018 19:53:02 +0000
Resent-Message-ID: <handler.30226.B30226.15171691741584 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 30226
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: 30226 <at> debbugs.gnu.org
Received: via spool by 30226-submit <at> debbugs.gnu.org id=B30226.15171691741584
          (code B ref 30226); Sun, 28 Jan 2018 19:53:02 +0000
Received: (at 30226) by debbugs.gnu.org; 28 Jan 2018 19:52:54 +0000
Received: from localhost ([127.0.0.1]:46579 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eft0X-0000PT-M0
	for submit <at> debbugs.gnu.org; Sun, 28 Jan 2018 14:52:54 -0500
Received: from gateway22.websitewelcome.com ([192.185.47.206]:31846)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <esq@HIDDEN>) id 1eft0V-0000PL-4h
 for 30226 <at> debbugs.gnu.org; Sun, 28 Jan 2018 14:52:51 -0500
Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8])
 by gateway22.websitewelcome.com (Postfix) with ESMTP id 8402D29973
 for <30226 <at> debbugs.gnu.org>; Sun, 28 Jan 2018 13:52:50 -0600 (CST)
Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP
 id ft0UepafgzzFjft0UeUm1f; Sun, 28 Jan 2018 13:52:50 -0600
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com
 ; s=default;
 h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date:
 Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:
 Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
 In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=bxsDmaozAd2HYNPVQT2mAW99rB20SLM6PmZiUZr92ds=; b=VgbbFdxZotRCaMdPdJIdKJ2Xk9
 jxUIHL58tFjgiLncTGZg4W3pTCSvRSVV/N43vVv8ZWzzNtvNo/+7MJit/Grh4Pq+N/ku4eIZhcmBM
 /YECdTuQVkywOP5jxF3mqz8tPLSBOJ+xGJ6rawvZuRA1J1bmTDj/9t71kbieUjfPzNf/hh9A5c6nJ
 rYxLqNiBspD/je/1+a4cJjT+Ai6bqUWR/eMcSHaj7J/L0KETPlYaXXJ/LUqhrE0UHDHQvAKVMxYGT
 hi2BEgunt2kbuG+Ig6OHEtVqpMiHjP1QG6UAvN4xdPY+K2pykx9BjKePxn+nPtT+9Lk8ayDw8SfBd
 89MhDR+w==;
Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:50905
 helo=server.private)
 by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256)
 (Exim 4.89_1) (envelope-from <esq@HIDDEN>)
 id 1eft0T-0011vu-FD; Sun, 28 Jan 2018 13:52:49 -0600
Date: Sun, 28 Jan 2018 11:52:48 -0800
Message-ID: <m28tch4v73.wl%esq@HIDDEN>
From: Keith David Bershatsky <esq@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
X-AntiAbuse: This header was added to track abuse,
 please include it with any abuse report
X-AntiAbuse: Primary Hostname - gator3053.hostgator.com
X-AntiAbuse: Original Domain - debbugs.gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - lawlist.com
X-BWhitelist: no
X-Source-IP: 45.48.239.195
X-Source-L: No
X-Exim-ID: 1eft0T-0011vu-FD
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private)
 [45.48.239.195]:50905
X-Source-Auth: lawlist
X-Email-Count: 1
X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t
X-Local-Domain: yes
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

> Bottom line: to get accurate values of pixel width, you need to
> subtract it->current_x value at some position from current_x at the
> next glyph position.  This is the only reliable way to obtain accurate
> pixel width values when using the move_it_* functions.

Thank you, Eli, for the detailed explanation regarding what is happening underneath the Emacs hood.  The "bottom line" method does not seem to be working in this example to calculate the tab STRETCH because it.current_x of the character that _follows_ the tab STRETCH is wrong when w->hscroll >= 2.  In the revised bug-30226 function below:  When w->hscroll >= 2, we take the it.current_x of the letter "H" in "Hello-world" (which is ostensibly 84); and, we subtract (it.first_visible_x + it.lnum_pixel_width).  This gives us a purported tab STRETCH of 42; however, it should really be 35.

A.  This is the first (1st) time we call the revised bug-30226 [w->hscroll == 1]:

1.  NOTHING
    it.c (0)
    w->hscroll (1)
    it.current_x (0)
    it.pixel_width (0)

2.  TAB CHARACTER
    it.c (187)
    w->hscroll (1)
    it.current_x (0)
    it.pixel_width (7)

3.  TAB STRETCH
    it.c (9)
    w->hscroll (1)
    it.current_x (7)
    it.pixel_width (49)

"Bottom Line" method -- pixel-width of tab STRETCH:  0

4.  TAB STRETCH
    it.c (9)
    w->hscroll (1)
    it.current_x (35)
    it.pixel_width (42)

"Bottom Line" method -- pixel-width of tab STRETCH:  42

5.  TEXT
    it.c (72)
    w->hscroll (1)
    it.current_x (77)
    it.pixel_width (7)

* * *

Row     Start       End Used oE><\CTZFesm     X    Y    W    H    V    A    P
==============================================================================
 12       455       467   17 111000110000     0  192  154   16   16   12   12
           -1        -1	    0
           -1        -1
           -1        -1
 Glyph#  Type       Pos   O   W     Code      C Face LR
      0     C        -1   0   7 0x000020          29 00
      1     C        -1   0   7 0x000031      1   29 00
      2     C        -1   0   7 0x000033      3   29 00
      3     C        -1   0   7 0x000020          29 00
      4     S       455   B  42 0x000000          31 00
      5     C       456   B   7 0x000048      H    0 00
      6     C       457   B   7 0x000065      e    0 00
      7     C       458   B   7 0x00006c      l    0 00
      8     C       459   B   7 0x00006c      l    0 00
      9     C       460   B   7 0x00006f      o    0 00
     10     C       461   B   7 0x00002d      -    0 00
     11     C       462   B   7 0x000077      w    0 00
     12     C       463   B   7 0x00006f      o    0 00
     13     C       464   B   7 0x000072      r    0 00
     14     C       465   B   7 0x00006c      l    0 00
     15     C       466   B   7 0x000064      d    0 00
     16     C         0   0   7 0x000020           0 00


B.  This is the second (2nd) time we call the revised bug-30226 [w->hscroll == 2]:

1.  NOTHING
    it.c (0)
    w->hscroll (2)
    it.current_x (0)
    it.pixel_width (0)

2.  TAB CHARACTER
    it.c (187)
    w->hscroll (2)
    it.current_x (0)
    it.pixel_width (7)

3.  TAB STRETCH
    it.c (9)
    w->hscroll (2)
    it.current_x (7)
    it.pixel_width (49)

"Bottom Line" method -- pixel-width of tab STRETCH:  42

4.  TEXT
    it.c (72)
    w->hscroll (2)
    it.current_x (84)
    it.pixel_width (7)

* * * 

Row     Start       End Used oE><\CTZFesm     X    Y    W    H    V    A    P
==============================================================================
 12       455       467   17 111000110000     0  192  147   16   16   12   12
           -1        -1	    0
           -1        -1
           -1        -1
 Glyph#  Type       Pos   O   W     Code      C Face LR
      0     C        -1   0   7 0x000020          29 00
      1     C        -1   0   7 0x000031      1   29 00
      2     C        -1   0   7 0x000033      3   29 00
      3     C        -1   0   7 0x000020          29 00
      4     S       455   B  35 0x000000          31 00
      5     C       456   B   7 0x000048      H    0 00
      6     C       457   B   7 0x000065      e    0 00
      7     C       458   B   7 0x00006c      l    0 00
      8     C       459   B   7 0x00006c      l    0 00
      9     C       460   B   7 0x00006f      o    0 00
     10     C       461   B   7 0x00002d      -    0 00
     11     C       462   B   7 0x000077      w    0 00
     12     C       463   B   7 0x00006f      o    0 00
     13     C       464   B   7 0x000072      r    0 00
     14     C       465   B   7 0x00006c      l    0 00
     15     C       466   B   7 0x000064      d    0 00
     16     C         0   0   7 0x000020           0 00


DEFUN ("bug-30226", Fbug_30226, Sbug_30226, 0, 0, 0,
       doc: /* Debug the pixel-width of a stretch tab. */)
  (void)
{
  Fscroll_left (make_number (1), Qnil);
  struct window *w = decode_live_window (selected_window);
  struct frame *f = XFRAME (w->frame);
  struct it it;
  void *itdata = bidi_shelve_cache ();
  enum move_it_result rc = MOVE_X_REACHED;
  struct text_pos start_text_position;
  int count = 1;
  int previous_character = 0;
/* ******************************************************************************
                      START DISPLAY -- w->start
****************************************************************************** */
  /* Begin the journey at w->start. */
  SET_TEXT_POS_FROM_MARKER (start_text_position, w->start);
  start_display (&it, w, start_text_position);
  struct face *face = FACE_FROM_ID (it.f, it.face_id);
  struct font *font = face->font;
/* ******************************************************************************
                GO TO THE BEGINNING OF THE CURRENT LINE.
****************************************************************************** */
  /* Place the IT on the current line containing PT. */
  int voffset = (WINDOW_HEADER_LINE_HEIGHT (w) > 0
                 && w->output_cursor.vpos > 0)
                  ? w->output_cursor.vpos - 1
                  : w->output_cursor.vpos;
  if (voffset > 0)
    move_it_by_lines (&it, voffset);
/* ******************************************************************************
             MOVE IT OVER EACH CHARACTER ON THE CURRENT LINE.
****************************************************************************** */
  while (true)
    {
      if (ITERATOR_AT_END_OF_LINE_P (&it)
          || FETCH_BYTE (IT_BYTEPOS (it)) == '\n'
          || rc == MOVE_POS_MATCH_OR_ZV)
        break;
/* ******************************************************************************
                     HYPOTHETICAL CALCULATION OF PIXEL-WIDTH
****************************************************************************** */
      if (w->hscroll > 0
          && previous_character == '\t')
       fprintf (stderr, "\n\"Bottom Line\" method -- pixel-width of tab STRETCH:  %d\n",
                it.current_x - (it.first_visible_x + it.lnum_pixel_width));
/* ******************************************************************************
                       DUMP RELEVANT GLYPH INFORMATION
****************************************************************************** */
      if (w->hscroll > 0)
        {
          int w_hscroll = w->hscroll;
          fprintf (stderr, "\n%d.  %s\n\
    it.c (%d)\n\
    w->hscroll (%d)\n\
    it.current_x (%d)\n\
    it.pixel_width (%d)\n",
                 count,
                 (it.c == 0
                   ? "NOTHING"
                   : it.c == 187
                     ? "TAB CHARACTER"
                   : it.c == '\t'
                     ? "TAB STRETCH"
                   : "TEXT"),
                 it.c,
                 w_hscroll,
                 it.current_x,
                 it.pixel_width);
        }
/* ******************************************************************************
                       MOVE IT -- INCREMENT == IT.PIXEL_WIDTH 
****************************************************************************** */
      previous_character = it.c;
      rc = move_it_in_display_line_to (&it, ZV, it.current_x + it.pixel_width,
                                       MOVE_TO_POS | MOVE_TO_X);
      count = count + 1;
      if (rc == MOVE_LINE_CONTINUED)
        break;
      if (it.current_x - it.first_visible_x + font->space_width >=
          window_box_width (w, TEXT_AREA))
        break;
    }
/* ******************************************************************************
                         REDISPLAY AND DUMP_GLPYH_ROW
****************************************************************************** */
  redisplay_internal ();
  fprintf (stderr, "\n");
  struct glyph_row *glyph_row = MATRIX_ROW (w->current_matrix, it.vpos);
  dump_glyph_row (glyph_row, it.vpos, 2);
  bidi_unshelve_cache (itdata, false);
  return Qnil;
}




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#30226: Fixing it->pixel_width / it->current_x when tabs and line numbers.
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 29 Jan 2018 16:15:01 +0000
Resent-Message-ID: <handler.30226.B30226.151724246926285 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 30226
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Keith David Bershatsky <esq@HIDDEN>
Cc: 30226 <at> debbugs.gnu.org
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Received: via spool by 30226-submit <at> debbugs.gnu.org id=B30226.151724246926285
          (code B ref 30226); Mon, 29 Jan 2018 16:15:01 +0000
Received: (at 30226) by debbugs.gnu.org; 29 Jan 2018 16:14:29 +0000
Received: from localhost ([127.0.0.1]:48054 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1egC4i-0006pt-Mr
	for submit <at> debbugs.gnu.org; Mon, 29 Jan 2018 11:14:28 -0500
Received: from eggs.gnu.org ([208.118.235.92]:52572)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1egC4h-0006ph-5b
 for 30226 <at> debbugs.gnu.org; Mon, 29 Jan 2018 11:14:27 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1egC4X-0002do-Qj
 for 30226 <at> debbugs.gnu.org; Mon, 29 Jan 2018 11:14:21 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60192)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1egC4X-0002db-MP; Mon, 29 Jan 2018 11:14:17 -0500
Received: from [176.228.60.248] (port=1777 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1egC4X-0006t8-2t; Mon, 29 Jan 2018 11:14:17 -0500
Date: Mon, 29 Jan 2018 18:14:24 +0200
Message-Id: <83bmhciqvz.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-reply-to: <m28tch4v73.wl%esq@HIDDEN> (message from Keith David
 Bershatsky on Sun, 28 Jan 2018 11:52:48 -0800)
References: <m28tch4v73.wl%esq@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> Date:  Sun, 28 Jan 2018 11:52:48 -0800
> From:  Keith David Bershatsky <esq@HIDDEN>
> Cc:  30226 <at> debbugs.gnu.org
> 
> > Bottom line: to get accurate values of pixel width, you need to
> > subtract it->current_x value at some position from current_x at the
> > next glyph position.  This is the only reliable way to obtain accurate
> > pixel width values when using the move_it_* functions.
> 
> Thank you, Eli, for the detailed explanation regarding what is happening underneath the Emacs hood.  The "bottom line" method does not seem to be working in this example to calculate the tab STRETCH because it.current_x of the character that _follows_ the tab STRETCH is wrong when w->hscroll >= 2.  In the revised bug-30226 function below:  When w->hscroll >= 2, we take the it.current_x of the letter "H" in "Hello-world" (which is ostensibly 84); and, we subtract (it.first_visible_x + it.lnum_pixel_width).  This gives us a purported tab STRETCH of 42; however, it should really be 35.

No, the method does work, you just used the results of the call to
move_it_in_display_line_to not as I intended.

> 
> A.  This is the first (1st) time we call the revised bug-30226 [w->hscroll == 1]:
> 
> 1.  NOTHING
>     it.c (0)
>     w->hscroll (1)
>     it.current_x (0)
>     it.pixel_width (0)
> 
> 2.  TAB CHARACTER
>     it.c (187)
>     w->hscroll (1)
>     it.current_x (0)
>     it.pixel_width (7)
> 
> 3.  TAB STRETCH
>     it.c (9)
>     w->hscroll (1)
>     it.current_x (7)
>     it.pixel_width (49)
> 
> "Bottom Line" method -- pixel-width of tab STRETCH:  0
> 
> 4.  TAB STRETCH
>     it.c (9)
>     w->hscroll (1)
>     it.current_x (35)
>     it.pixel_width (42)
> 
> "Bottom Line" method -- pixel-width of tab STRETCH:  42
> 
> 5.  TEXT
>     it.c (72)
>     w->hscroll (1)
>     it.current_x (77)
>     it.pixel_width (7)

Observer how here, 77 - 35 (the previous value of current_x) gives you
42, which is what you want.

> B.  This is the second (2nd) time we call the revised bug-30226 [w->hscroll == 2]:
> 
> 1.  NOTHING
>     it.c (0)
>     w->hscroll (2)
>     it.current_x (0)
>     it.pixel_width (0)
> 
> 2.  TAB CHARACTER
>     it.c (187)
>     w->hscroll (2)
>     it.current_x (0)
>     it.pixel_width (7)
> 
> 3.  TAB STRETCH
>     it.c (9)
>     w->hscroll (2)
>     it.current_x (7)
>     it.pixel_width (49)
> 
> "Bottom Line" method -- pixel-width of tab STRETCH:  42
> 
> 4.  TEXT
>     it.c (72)
>     w->hscroll (2)
>     it.current_x (84)
>     it.pixel_width (7)

And here, 84 - 7 gives you 77.  But since 84 is greater than
first_visible_x + lnum_pixel_width = 14 + 28 = 42, you must subtract
42 from the result, which gives 77 - 42 = 35, as you want.  All the
following results for w->hscroll > 2 will work the same as this one.

>        fprintf (stderr, "\n\"Bottom Line\" method -- pixel-width of tab STRETCH:  %d\n",
>                 it.current_x - (it.first_visible_x + it.lnum_pixel_width));

This is not how I meant for you to calculate the width.  You need to
subtract consecutive values of current_x, and then correct the result
as explained above.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#30226: Fixing it->pixel_width / it->current_x when tabs and line numbers.
References: <m2k1w9kp35.wl%esq@HIDDEN>
In-Reply-To: <m2k1w9kp35.wl%esq@HIDDEN>
Resent-From: Keith David Bershatsky <esq@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 31 Jan 2018 08:04:02 +0000
Resent-Message-ID: <handler.30226.B30226.151738579413781 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 30226
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: 30226 <at> debbugs.gnu.org
Received: via spool by 30226-submit <at> debbugs.gnu.org id=B30226.151738579413781
          (code B ref 30226); Wed, 31 Jan 2018 08:04:02 +0000
Received: (at 30226) by debbugs.gnu.org; 31 Jan 2018 08:03:14 +0000
Received: from localhost ([127.0.0.1]:50237 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1egnMP-0003aC-EO
	for submit <at> debbugs.gnu.org; Wed, 31 Jan 2018 03:03:13 -0500
Received: from gateway24.websitewelcome.com ([192.185.50.252]:18647)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <esq@HIDDEN>) id 1egnMN-0003a3-PO
 for 30226 <at> debbugs.gnu.org; Wed, 31 Jan 2018 03:03:12 -0500
Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6])
 by gateway24.websitewelcome.com (Postfix) with ESMTP id 21F7430B09
 for <30226 <at> debbugs.gnu.org>; Wed, 31 Jan 2018 02:03:11 -0600 (CST)
Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP
 id gnMMec4K2BUMKgnMMegU5G; Wed, 31 Jan 2018 02:03:11 -0600
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com
 ; s=default;
 h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date:
 Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:
 Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
 In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=34G8YXaU+kDT2FKrzLAOcAdxUIWp4OBhOfuHOy6or7c=; b=ZuXPU+P1mZQYxn/YE0ajZdKLTr
 GSvJwrSiaoIH44CLED1+fLOM670uThPPfY2dOC5GQHOeSI00I5dNpi7O6H4SzhBVBb1fEAdA/072B
 LNwiJWBurRUd4FT/DZ2XZedPIoWeH35AzmIpoVX/8rrfLnyGGhogCPjAbfzLHc7ehaml8/W17n2vt
 lNyAmgUjNtBWAMGCJQnCJWOQ3kSZ3ZMwBxLnW8twCrhWX9LRAbMor6Qf4b+9WT2bkEQJZmY6/D3mT
 r+FI37VoQAGtqv2WkXKQkXXFlN/eLDxpFdLttBHjqRujgHgDYO9NGnecUmQf1+hWAIv+5JBoiuGco
 s8SPINng==;
Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:54278
 helo=server.private)
 by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256)
 (Exim 4.89_1) (envelope-from <esq@HIDDEN>)
 id 1egnMM-002jNk-0Y; Wed, 31 Jan 2018 02:03:10 -0600
Date: Wed, 31 Jan 2018 00:03:09 -0800
Message-ID: <m21si64fr6.wl%esq@HIDDEN>
From: Keith David Bershatsky <esq@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
X-AntiAbuse: This header was added to track abuse,
 please include it with any abuse report
X-AntiAbuse: Primary Hostname - gator3053.hostgator.com
X-AntiAbuse: Original Domain - debbugs.gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - lawlist.com
X-BWhitelist: no
X-Source-IP: 45.48.239.195
X-Source-L: No
X-Exim-ID: 1egnMM-002jNk-0Y
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private)
 [45.48.239.195]:54278
X-Source-Auth: lawlist
X-Email-Count: 1
X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t
X-Local-Domain: yes
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Thank you, Eli, for teaching me how to mathematically calculate the pixel-width of the tab STRETCH in this example ["C-q TAB Hello-world" and w->hscroll >= 2].  Greatly appreciated!  :)

A couple of additional questions whenever you have the time . . . .


I.  In the context of this particular example ["C-q TAB Hello-world" and w->hscroll >= 2], we cannot calculate the _relative_ X by subtracting it.first_visible_x from it.current_x (as would generally be the case).  Is there a better way to calculate the _relative_ X instead of keeping track of _every_ visual pixel-width to the left of the current _relative_ X that we are seeking?

(For example, pgrowx and dump_glyph_row both just keep track of the prior _relative_ X and they add the prior pixel-width to derive the current _relative_ X.)


II.  In a slightly different fact pattern with two (2) consecutive tabs ["C-q TAB C-q TAB Hello-world" and w->hscroll >= 2], the tab STRETCH of the second tab _visually_ disappears and dump_glyph_row reports that its width is -1.  Is there a way to programmatically know whether the tab STRETCH is -1 when we are using move_it_in_display_line_to?

The following are the results of two calls to the revised function bug-30226 using this new hypothetical with two (2) consecutive tabs.  And, I added a printout of pgrowx when w->hscroll == 2.


A.  This is the first (1st) time we call the revised bug-30226 [w->hscroll == 1]:

1.  NOTHING
    it.c (0)
    w->hscroll (1)
    it.hpos (0) 
    it.current_x (0)
    it.pixel_width (0)

2.  TAB CHARACTER
    it.c (187)
    w->hscroll (1)
    it.hpos (0) 
    it.current_x (0)
    it.pixel_width (7)

3.  TAB STRETCH
    it.c (9)
    w->hscroll (1)
    it.hpos (0) 
    it.current_x (7)
    it.pixel_width (49)

4.  TAB STRETCH
    it.c (9)
    w->hscroll (1)
    it.hpos (4) 
    it.current_x (35)
    it.pixel_width (42)

5.  TAB CHARACTER
    it.c (187)
    w->hscroll (1)
    it.hpos (5) 
    it.current_x (77)
    it.pixel_width (7)

6.  TAB STRETCH
    it.c (9)
    w->hscroll (1)
    it.hpos (6) 
    it.current_x (84)
    it.pixel_width (49)

7.  TEXT
    it.c (72)
    w->hscroll (1)
    it.hpos (7) 
    it.current_x (133)
    it.pixel_width (7)

* * *

Row     Start       End Used oE><\CTZFesm     X    Y    W    H    V    A    P
==============================================================================
 12       455       468   19 111000110000     0  192  210   16   16   12   12
           -1        -1	    0
           -1        -1
           -1        -1
 Glyph#  Type       Pos   O   W     Code      C Face LR
      0     C        -1   0   7 0x000020          29 00
      1     C        -1   0   7 0x000031      1   29 00
      2     C        -1   0   7 0x000033      3   29 00
      3     C        -1   0   7 0x000020          29 00
      4     S       455   B  42 0x000000          31 00
      5     C       456   B   7 0x0000bb      .   32 00
      6     S       456   B  49 0x000000          31 00
      7     C       457   B   7 0x000048      H    0 00
      8     C       458   B   7 0x000065      e    0 00
      9     C       459   B   7 0x00006c      l    0 00
     10     C       460   B   7 0x00006c      l    0 00
     11     C       461   B   7 0x00006f      o    0 00
     12     C       462   B   7 0x00002d      -    0 00
     13     C       463   B   7 0x000077      w    0 00
     14     C       464   B   7 0x00006f      o    0 00
     15     C       465   B   7 0x000072      r    0 00
     16     C       466   B   7 0x00006c      l    0 00
     17     C       467   B   7 0x000064      d    0 00
     18     C         0   0   7 0x000020           0 00


B.  This is the second (2nd) time we call the revised bug-30226 [w->hscroll == 2]:

1.  NOTHING
    it.c (0)
    w->hscroll (2)
    it.hpos (0) 
    it.current_x (0)
    it.pixel_width (0)

2.  TAB CHARACTER
    it.c (187)
    w->hscroll (2)
    it.hpos (0) 
    it.current_x (0)
    it.pixel_width (7)

3.  TAB STRETCH
    it.c (9)
    w->hscroll (2)
    it.hpos (0) 
    it.current_x (7)
    it.pixel_width (49)

4.  TAB CHARACTER
    it.c (187)
    w->hscroll (2)
    it.hpos (5) 
    it.current_x (84)
    it.pixel_width (7)

5.  TAB STRETCH
    it.c (9)
    w->hscroll (2)
    it.hpos (6) 
    it.current_x (91)
    it.pixel_width (35)

6.  TEXT
    it.c (72)
    w->hscroll (2)
    it.hpos (7) 
    it.current_x (126)
    it.pixel_width (7)

* * *

Row     Start       End Used oE><\CTZFesm     X    Y    W    H    V    A    P
==============================================================================
 12       455       468   19 111000110000     0  192  153   16   16   12   12
           -1        -1	    0
           -1        -1
           -1        -1
 Glyph#  Type       Pos   O   W     Code      C Face LR
      0     C        -1   0   7 0x000020          29 00
      1     C        -1   0   7 0x000031      1   29 00
      2     C        -1   0   7 0x000033      3   29 00
      3     C        -1   0   7 0x000020          29 00
      4     S       455   B  35 0x000000          31 00
      5     C       456   B   7 0x0000bb      .   32 00
      6     S       456   B  -1 0x000000          31 00
      7     C       457   B   7 0x000048      H    0 00
      8     C       458   B   7 0x000065      e    0 00
      9     C       459   B   7 0x00006c      l    0 00
     10     C       460   B   7 0x00006c      l    0 00
     11     C       461   B   7 0x00006f      o    0 00
     12     C       462   B   7 0x00002d      -    0 00
     13     C       463   B   7 0x000077      w    0 00
     14     C       464   B   7 0x00006f      o    0 00
     15     C       465   B   7 0x000072      r    0 00
     16     C       466   B   7 0x00006c      l    0 00
     17     C       467   B   7 0x000064      d    0 00
     18     C         0   0   7 0x000020           0 00


PGROWX:  pgrowx glyph_row

TEXT: 19 glyphs
  0    0: CHAR[ ] pos=-1 blev=2,btyp=EN w=7 a+d=12+4 face=31 MB AVOID
  1    7: CHAR[1] pos=-1 blev=2,btyp=EN w=7 a+d=12+4 face=31 MB AVOID
  2   14: CHAR[4] pos=-1 blev=2,btyp=EN w=7 a+d=12+4 face=31 MB AVOID
  3   21: CHAR[ ] pos=-1 blev=2,btyp=EN w=7 a+d=12+4 face=31 MB AVOID
  4   28: STRETCH[16+12] pos=456 w=35 a+d=12+4 face=33 MB
  5   63: CHAR[0xbb] pos=457 blev=0,btyp=L w=7 a+d=12+4 face=34 MB
  6   70: STRETCH[16+12] pos=457 w=-1 a+d=12+4 face=33 MB
  7   69: CHAR[H] pos=458 blev=0,btyp=L w=7 a+d=12+4 MB
  8   76: CHAR[e] pos=459 blev=0,btyp=L w=7 a+d=12+4 MB
  9   83: CHAR[l] pos=460 blev=0,btyp=L w=7 a+d=12+4 MB
 10   90: CHAR[l] pos=461 blev=0,btyp=L w=7 a+d=12+4 MB
 11   97: CHAR[o] pos=462 blev=0,btyp=L w=7 a+d=12+4 MB
 12  104: CHAR[-] pos=463 blev=0,btyp=L w=7 a+d=12+4 MB
 13  111: CHAR[w] pos=464 blev=0,btyp=L w=7 a+d=12+4 MB
 14  118: CHAR[o] pos=465 blev=0,btyp=L w=7 a+d=12+4 MB
 15  125: CHAR[r] pos=466 blev=0,btyp=L w=7 a+d=12+4 MB
 16  132: CHAR[l] pos=467 blev=0,btyp=L w=7 a+d=12+4 MB
 17  139: CHAR[d] pos=468 blev=0,btyp=L w=7 a+d=12+4 MB
 18  146: CHAR[ ] pos=0 blev=0,btyp=B w=7 a+d=12+4 MB


DEFUN ("bug-30226", Fbug_30226, Sbug_30226, 0, 0, 0,
       doc: /* Debug the pixel-width of a stretch tab. */)
  (void)
{
  Fscroll_left (make_number (1), Qnil);
  struct window *w = decode_live_window (selected_window);
  struct frame *f = XFRAME (w->frame);
  struct it it;
  void *itdata = bidi_shelve_cache ();
  enum move_it_result rc = MOVE_X_REACHED;
  struct text_pos start_text_position;
  int count = 1;
  int previous_char = 0;
  int previous_x = 0;
/* ******************************************************************************
                      START DISPLAY -- w->start
****************************************************************************** */
  /* Begin the journey at w->start. */
  SET_TEXT_POS_FROM_MARKER (start_text_position, w->start);
  start_display (&it, w, start_text_position);
  struct face *face = FACE_FROM_ID (it.f, it.face_id);
  struct font *font = face->font;
/* ******************************************************************************
                GO TO THE BEGINNING OF THE CURRENT LINE.
****************************************************************************** */
  /* Place the IT on the current line containing PT. */
  int voffset = (WINDOW_HEADER_LINE_HEIGHT (w) > 0
                 && w->output_cursor.vpos > 0)
                  ? w->output_cursor.vpos - 1
                  : w->output_cursor.vpos;
  if (voffset > 0)
    move_it_by_lines (&it, voffset);
  struct glyph_row *glyph_row = MATRIX_ROW (w->current_matrix, it.vpos);
/* ******************************************************************************
             MOVE IT OVER EACH CHARACTER ON THE CURRENT LINE.
****************************************************************************** */
  while (true)
    {
      if (ITERATOR_AT_END_OF_LINE_P (&it)
          || FETCH_BYTE (IT_BYTEPOS (it)) == '\n'
          || rc == MOVE_POS_MATCH_OR_ZV)
        break;
/* ******************************************************************************
                       DUMP RELEVANT GLYPH INFORMATION
****************************************************************************** */
      if (w->hscroll > 0)
        {
          int w_hscroll = w->hscroll;
          fprintf (stderr, "\n%d.  %s\n\
    it.c (%d)\n\
    w->hscroll (%d)\n\
    it.hpos (%d) \n\
    it.current_x (%d)\n\
    it.pixel_width (%d)\n",
                 count,
                 (it.c == 0
                   ? "NOTHING"
                   : it.c == 187
                     ? "TAB CHARACTER"
                   : it.c == '\t'
                     ? "TAB STRETCH"
                   : "TEXT"),
                 it.c,
                 w_hscroll,
                 it.hpos,
                 it.current_x,
                 it.pixel_width);
        }
/* ******************************************************************************
                       MOVE IT -- INCREMENT == IT.PIXEL_WIDTH 
****************************************************************************** */
      previous_char = it.c;
      previous_x = it.current_x;
      rc = move_it_in_display_line_to (&it, ZV, it.current_x + it.pixel_width,
                                       MOVE_TO_POS | MOVE_TO_X);
      count = count + 1;
      if (rc == MOVE_LINE_CONTINUED)
        break;
      if (it.current_x - it.first_visible_x + font->space_width >=
          window_box_width (w, TEXT_AREA))
        break;
    }
/* ******************************************************************************
                         REDISPLAY AND DUMP_GLPYH_ROW
****************************************************************************** */
  redisplay_internal ();
  fprintf (stderr, "\n");
  dump_glyph_row (glyph_row, it.vpos, 2);
  bidi_unshelve_cache (itdata, false);
  return Qnil;
}




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#30226: Fixing it->pixel_width / it->current_x when tabs and line numbers.
References: <m2k1w9kp35.wl%esq@HIDDEN>
In-Reply-To: <m2k1w9kp35.wl%esq@HIDDEN>
Resent-From: Keith David Bershatsky <esq@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 04 Feb 2018 19:22:01 +0000
Resent-Message-ID: <handler.30226.B30226.151777210530120 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 30226
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: 30226 <at> debbugs.gnu.org
Received: via spool by 30226-submit <at> debbugs.gnu.org id=B30226.151777210530120
          (code B ref 30226); Sun, 04 Feb 2018 19:22:01 +0000
Received: (at 30226) by debbugs.gnu.org; 4 Feb 2018 19:21:45 +0000
Received: from localhost ([127.0.0.1]:57346 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eiPrE-0007pk-Po
	for submit <at> debbugs.gnu.org; Sun, 04 Feb 2018 14:21:44 -0500
Received: from gateway21.websitewelcome.com ([192.185.45.31]:29698)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <esq@HIDDEN>) id 1eiPrC-0007pa-QL
 for 30226 <at> debbugs.gnu.org; Sun, 04 Feb 2018 14:21:43 -0500
Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4])
 by gateway21.websitewelcome.com (Postfix) with ESMTP id 71E86400CC64C
 for <30226 <at> debbugs.gnu.org>; Sun,  4 Feb 2018 13:21:40 -0600 (CST)
Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP
 id iPr9ew3ebcGlpiPrAewynD; Sun, 04 Feb 2018 13:21:40 -0600
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com
 ; s=default;
 h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date:
 Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:
 Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
 In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=FA3djdUIiVu+SzaDqEHOtOwI54UOekfFLvuw+OclFJE=; b=VHTaFsijdhCU+Kr1LPn1NhoC2t
 8geyJRbCqgH8Vag8vJqqcjku2EYzlfcqX/RN3JCuBCJBOnI2EdCj2O9PKyepbY97H0UnPI9d/LNRH
 SZfkZX5uCkgrMpVbco8Uj3vg+3juQhsc9bIT3WuHghJGkmYuJJ4Zzywa9qslCz2NgZROCOFKsqYxf
 iGbOg50pMUAlr8fZCb3bIlGKiTcgjs1kG8asabz/NRTFaPWlAVAwF/SxQfnULnZA/vMu6qhBcxneD
 eSExDfCxWgQUaCZpMR3kXKPa4Tql8DEJLOXufSQR39l3XzPvIAfM9NbCWACB8AlKbyUjxqeFgNEMa
 +9xI/0Hw==;
Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:51105
 helo=server.private)
 by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256)
 (Exim 4.89_1) (envelope-from <esq@HIDDEN>)
 id 1eiPr9-001b0L-E0; Sun, 04 Feb 2018 13:21:39 -0600
Date: Sun, 04 Feb 2018 11:21:38 -0800
Message-ID: <m27ersmugt.wl%esq@HIDDEN>
From: Keith David Bershatsky <esq@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
X-AntiAbuse: This header was added to track abuse,
 please include it with any abuse report
X-AntiAbuse: Primary Hostname - gator3053.hostgator.com
X-AntiAbuse: Original Domain - debbugs.gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - lawlist.com
X-BWhitelist: no
X-Source-IP: 45.48.239.195
X-Source-L: No
X-Exim-ID: 1eiPr9-001b0L-E0
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private)
 [45.48.239.195]:51105
X-Source-Auth: lawlist
X-Email-Count: 1
X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t
X-Local-Domain: yes
X-Spam-Score: 2.2 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: I was able to locate the section of code responsible (at
 least
 in part) for the width of a tab STRETCH taking on a negative value and
 visually
 disappearing as stated in paragraph II of the preceding email; i.e., thread
 message #26: [...] 
 Content analysis details:   (2.2 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked.
 See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
 for more information. [URIs: gnu.org]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/, no
 trust [192.185.45.31 listed in list.dnswl.org]
 2.2 RCVD_IN_MSPIKE_L3      RBL: Low reputation (-3)
 [192.185.45.31 listed in bl.mailspike.net]
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 T_DKIM_INVALID         DKIM-Signature header exists but is not valid
 0.0 RCVD_IN_MSPIKE_BL      Mailspike blacklisted
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 2.2 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  I was able to locate the section of code responsible (at least
    in part) for the width of a tab STRETCH taking on a negative value and visually
    disappearing as stated in paragraph II of the preceding email; i.e., thread
    message #26: [...] 
 
 Content analysis details:   (2.2 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 URIBL_BLOCKED          ADMINISTRATOR NOTICE: The query to URIBL was blocked.
                             See
                             http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
                              for more information.
                             [URIs: gnu.org]
  2.2 RCVD_IN_MSPIKE_L3      RBL: Low reputation (-3)
                             [192.185.45.31 listed in bl.mailspike.net]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/, no
                             trust
                             [192.185.45.31 listed in list.dnswl.org]
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 T_DKIM_INVALID         DKIM-Signature header exists but is not valid
  0.0 RCVD_IN_MSPIKE_BL      Mailspike blacklisted

I was able to locate the section of code responsible (at least in part) for the width of a tab STRETCH taking on a negative value and visually disappearing as stated in paragraph II of the preceding email; i.e., thread message #26:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30226#26

xdisp:28250 to xdisp:28252

	      /* Adjust for line numbers, if needed.   */
	      if (!NILP (Vdisplay_line_numbers) && x0 >= it->lnum_pixel_width)
		x -= it->lnum_pixel_width;

In that section of code (lines 28250 to 28252), x is adjusted for line numbers; however, x0 is _not_ adjusted.  This leads to the second (and other subsequent) tab STRETCH visually disappearing and take on a negative width value when w->hscroll >= 2.  Here is a link to a screenshot of what this looks like:

https://www.lawlist.com/images/30226_a.png

I have not yet been able to figure out why the values for it->current_x are different when glyphs are actually produced, versus when we only use move_it_in_display_line_to without producing glyphs.  The difference in behavior in the value for X and all values derived therefrom (e.g., pixel_width) can be seen by setting up a few stderr messages in x_produce_glyphs and also move_it_in_display_line_to.  When append_stretch_glyph is called (because glyphs are actually being produced), the value for it->pixel_width is completely different than when we only call move_it_in_display_line_to without producing glyphs.

In the event that I am able to make any additional headway, I'll post a follow-up to #30226.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#30226: Fixing it->pixel_width / it->current_x when tabs and line numbers.
References: <m2k1w9kp35.wl%esq@HIDDEN>
In-Reply-To: <m2k1w9kp35.wl%esq@HIDDEN>
Resent-From: Keith David Bershatsky <esq@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 19 Feb 2018 02:18:02 +0000
Resent-Message-ID: <handler.30226.B30226.151900665221521 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 30226
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: 30226 <at> debbugs.gnu.org
Received: via spool by 30226-submit <at> debbugs.gnu.org id=B30226.151900665221521
          (code B ref 30226); Mon, 19 Feb 2018 02:18:02 +0000
Received: (at 30226) by debbugs.gnu.org; 19 Feb 2018 02:17:32 +0000
Received: from localhost ([127.0.0.1]:50359 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1enb1I-0005b3-AP
	for submit <at> debbugs.gnu.org; Sun, 18 Feb 2018 21:17:32 -0500
Received: from gateway20.websitewelcome.com ([192.185.60.19]:38795)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <esq@HIDDEN>) id 1enb1G-0005au-3b
 for 30226 <at> debbugs.gnu.org; Sun, 18 Feb 2018 21:17:30 -0500
Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9])
 by gateway20.websitewelcome.com (Postfix) with ESMTP id 87EBC400D0A9D
 for <30226 <at> debbugs.gnu.org>; Sun, 18 Feb 2018 20:17:29 -0600 (CST)
Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP
 id nb1EeCum0mzEznb1FeDWnu; Sun, 18 Feb 2018 20:17:29 -0600
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com
 ; s=default;
 h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date:
 Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:
 Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
 In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=E7Jg57nGjGHI5cN+7OaQtgCQvGx5TeiIfktf50u/MxE=; b=MCqYYCCkm7KOwahnok+m6z67rb
 k8uos3/ibff1HekxgRF4/loUatFyp0x+4lXLskxriSBSA1/c4cfMqv1KiswGsJEzxoLDsinlKY0BM
 ACsCipw3O0aggIr1aT1Oaq10umueRFP7p5d1PFLNSQknEKmUGIjTjuxcgeI4feqO/ZIn9WlarxvWZ
 h76MshCBIx6JhqMnpWKMTVngDOste69sgzjYJE/iVDoTgU5Mt+dgcsMqr99BP6LIOWxMu5ZDF4MXA
 sQF1G8kbxZN1rMBG+YCVYQam2DCKN93Hi5GRA17YFQlIxKRwFnXk9jTJDPkPYjCCpyxZU7hbBa9aV
 DvftSKcw==;
Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:51045
 helo=server.private)
 by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256)
 (Exim 4.89_1) (envelope-from <esq@HIDDEN>)
 id 1enb1E-000ZQJ-Ez; Sun, 18 Feb 2018 20:17:28 -0600
Date: Sun, 18 Feb 2018 18:17:26 -0800
Message-ID: <m2zi45g1u1.wl%esq@HIDDEN>
From: Keith David Bershatsky <esq@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
X-AntiAbuse: This header was added to track abuse,
 please include it with any abuse report
X-AntiAbuse: Primary Hostname - gator3053.hostgator.com
X-AntiAbuse: Original Domain - debbugs.gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - lawlist.com
X-BWhitelist: no
X-Source-IP: 45.48.239.195
X-Source-L: No
X-Exim-ID: 1enb1E-000ZQJ-Ez
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private)
 [45.48.239.195]:51045
X-Source-Auth: lawlist
X-Email-Count: 1
X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t
X-Local-Domain: yes
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

A major break-through in the tracing of bug 30226 ....  it->current_x differs between the real thing (when display_line calls PRODUCE_GLYPHS), versus the simulation (when move_it_in_display_line_to calls PRODUCE_GLYPHS), _because_ maybe_produce_line_number advances it->current_x in the former but _not_ the latter.

In the revised fact pattern described in Message #26 of this thread (i.e., TAB TAB Hello-world, and w->hscroll >= 2):

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30226#26

it->current_x stops at 7 when w->hscroll == 2.

In the simulation (move_it_in_display_line_to that does _not_ produce glyphs), it is impossible to reach an X of 35 because that would be in the middle of the STRETCH.  maybe_produce_line_number does _not_ advance it->current_x in the simulation.

In the real thing (display_line actually produces glyphs), maybe_produce_line_number advances it->current_x from 7 to 35.

SOLUTION (suggested):  Revise move_it_in_display_line_to advance X by simulating a call to maybe_produce_line_number and permitting that function to advance X.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#30226: Fixing it->pixel_width / it->current_x when tabs and line numbers.
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 19 Feb 2018 16:29:02 +0000
Resent-Message-ID: <handler.30226.B30226.151905772113781 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 30226
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Keith David Bershatsky <esq@HIDDEN>
Cc: 30226 <at> debbugs.gnu.org
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Received: via spool by 30226-submit <at> debbugs.gnu.org id=B30226.151905772113781
          (code B ref 30226); Mon, 19 Feb 2018 16:29:02 +0000
Received: (at 30226) by debbugs.gnu.org; 19 Feb 2018 16:28:41 +0000
Received: from localhost ([127.0.0.1]:51497 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1enoIy-0003aD-UX
	for submit <at> debbugs.gnu.org; Mon, 19 Feb 2018 11:28:41 -0500
Received: from eggs.gnu.org ([208.118.235.92]:50811)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1enoIw-0003a0-TI
 for 30226 <at> debbugs.gnu.org; Mon, 19 Feb 2018 11:28:39 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1enoIp-00028E-35
 for 30226 <at> debbugs.gnu.org; Mon, 19 Feb 2018 11:28:33 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34023)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1enoIp-00027x-0U; Mon, 19 Feb 2018 11:28:31 -0500
Received: from [176.228.60.248] (port=2515 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1enoIo-0000p4-FZ; Mon, 19 Feb 2018 11:28:30 -0500
Date: Mon, 19 Feb 2018 18:28:38 +0200
Message-Id: <83woz97xl5.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-reply-to: <m2zi45g1u1.wl%esq@HIDDEN> (message from Keith David
 Bershatsky on Sun, 18 Feb 2018 18:17:26 -0800)
References: <m2zi45g1u1.wl%esq@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> Date:  Sun, 18 Feb 2018 18:17:26 -0800
> From:  Keith David Bershatsky <esq@HIDDEN>
> Cc:  30226 <at> debbugs.gnu.org
> 
> A major break-through in the tracing of bug 30226 ....  it->current_x differs between the real thing (when display_line calls PRODUCE_GLYPHS), versus the simulation (when move_it_in_display_line_to calls PRODUCE_GLYPHS), _because_ maybe_produce_line_number advances it->current_x in the former but _not_ the latter.

How do you see that maybe_produce_line_number doesn't advance
current_x?  AFAICS, it does that unconditionally:

  for ( ; g < e; g++)
    {
      it->current_x += g->pixel_width;  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      /* The following is important when this function is called
	 from move_it_in_display_line_to: HPOS is incremented only
	 when we are in the visible portion of the glyph row.  */
      if (it->current_x > it->first_visible_x)
	it->hpos++;
      if (p)
	{
	  *p++ = *g;
	  (*u)++;
	}
    }

Did you mean hpos instead?  Or did you mean that
maybe_produce_line_number is not called from
move_it_in_display_line_to in some case, whereas it is called from
display_line?  Or something else?

> SOLUTION (suggested):  Revise move_it_in_display_line_to advance X by simulating a call to maybe_produce_line_number and permitting that function to advance X.

But this is already done...




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#30226: Fixing it->pixel_width / it->current_x when tabs and line numbers.
References: <m2k1w9kp35.wl%esq@HIDDEN>
In-Reply-To: <m2k1w9kp35.wl%esq@HIDDEN>
Resent-From: Keith David Bershatsky <esq@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 19 Feb 2018 18:54:01 +0000
Resent-Message-ID: <handler.30226.B30226.151906640628354 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 30226
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: 30226 <at> debbugs.gnu.org
Received: via spool by 30226-submit <at> debbugs.gnu.org id=B30226.151906640628354
          (code B ref 30226); Mon, 19 Feb 2018 18:54:01 +0000
Received: (at 30226) by debbugs.gnu.org; 19 Feb 2018 18:53:26 +0000
Received: from localhost ([127.0.0.1]:51636 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1enqZ4-0007NG-CA
	for submit <at> debbugs.gnu.org; Mon, 19 Feb 2018 13:53:26 -0500
Received: from gateway21.websitewelcome.com ([192.185.45.31]:43785)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <esq@HIDDEN>) id 1enqZ2-0007N8-HA
 for 30226 <at> debbugs.gnu.org; Mon, 19 Feb 2018 13:53:25 -0500
Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9])
 by gateway21.websitewelcome.com (Postfix) with ESMTP id 1578B402BC3C3
 for <30226 <at> debbugs.gnu.org>; Mon, 19 Feb 2018 12:52:31 -0600 (CST)
Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP
 id nqYAeSny1mzEznqYAeTIgT; Mon, 19 Feb 2018 12:52:31 -0600
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com
 ; s=default;
 h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date:
 Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:
 Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
 In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=0Ooj+kMhP3pTxGT1upX+T6yJkOt5ombXRDuJqEM7PJE=; b=TiWfprVj3OCgVxA9oWTUSTKHEx
 saYzUIeD+ym0l9LnCedNPDGBCp6q8c5OW3jRuupPZZMgQCUufJ+EMYa6NS+jr8o4hm1zaB3fDCwAP
 sDMj76pmSdynuIDndjc1hX62f5tHoazVX5R4giGQKbOBqHwOqiEmyJNJbQC15yCFySpPCIzo3+RyL
 BLGKdnDrE5m3YQ3UQWBPXnN6LOlGj1KL2Mpw6g9n6ax8pKWGKMo7RWa/4F7PJrzvk6Gl+WeN97ahu
 JnTg4mmvHdLc/PCV+ryytb4vkBIYPY7Nlws4+3z4536/9pPV/rt0EnWtwIvyq8OkqZYwMObVCgJVC
 jNlH5MnQ==;
Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:50558
 helo=server.private)
 by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256)
 (Exim 4.89_1) (envelope-from <esq@HIDDEN>)
 id 1enqYA-0019zH-1D; Mon, 19 Feb 2018 12:52:30 -0600
Date: Mon, 19 Feb 2018 10:52:28 -0800
Message-ID: <m2zi44errn.wl%esq@HIDDEN>
From: Keith David Bershatsky <esq@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="Multipart_Mon_Feb_19_10:52:27_2018-1"
X-AntiAbuse: This header was added to track abuse,
 please include it with any abuse report
X-AntiAbuse: Primary Hostname - gator3053.hostgator.com
X-AntiAbuse: Original Domain - debbugs.gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - lawlist.com
X-BWhitelist: no
X-Source-IP: 45.48.239.195
X-Source-L: No
X-Exim-ID: 1enqYA-0019zH-1D
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.private)
 [45.48.239.195]:50558
X-Source-Auth: lawlist
X-Email-Count: 1
X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t
X-Local-Domain: yes
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

--Multipart_Mon_Feb_19_10:52:27_2018-1
Content-Type: text/plain; charset=US-ASCII

Both the current_x _and_ the hpos do not advance in the simulation immediately prior to generating the tab STRETCH; whereas, the opposite true when it is the real deal with display_line.  It may very well be the case that maybe_produce_line_number is not called from move_it_in_display_line_to in some case, whereas it is called from display_line.

I set up a couple of STDERR messages in display_line to observe the values for current_x and hpos immediately prior to calling PRODUCE_GLYPHS -- with one STDERR message before calling maybe_produce_line_number, and another STDERR message immediately after calling maybe_produce_line_number.

I set up a STDERR message in x_produce_glyphs to observe the values for current_x and hpos immediately prior to the calculations for the tab STRETCH.

When we iterate over the line containing "[TAB][TAB]Hello-world" when w->hscroll == 2, moving by increments of it.pixel_width using move_it_in_display_line_to, we observe the following behavior:

* Prior to calling PRODUCE_GLYPHS for the _first_ TAB:

** it.current_x == 7.

** it.hpos == 0.

When we observe the STDERR messages produced from display_line, we observe the following behavior:

* Prior to calling PRODUCE_GLYPHS for the _first_ TAB:

** it.current_x == 35.

** it.hpos == 3.

The difference between the simulation and the real deal is directly related to a call in display_line to maybe_produce_line_number.  I have not yet figured out exactly where in the simulation we need to advance it.current_x and it.hpos so that they are in sync with the real deal (display_line).  All of the calculations beginning at xdisp.c:28247 that relate to the tab STRETCH are dependent upon it.current_x -- when that value is wrong, everything to the right also gets skewed when iterating over that current line using move_it_in_display_line_to.

	      int tab_width = it->tab_width * font->space_width;
	      int x = it->current_x + it->continuation_lines_width;
	      int x0 = x;
	      /* Adjust for line numbers, if needed.   */
	      if (!NILP (Vdisplay_line_numbers) && x0 >= it->lnum_pixel_width)
		x -= it->lnum_pixel_width;
	      int next_tab_x = ((1 + x + tab_width - 1) / tab_width) * tab_width;

	      /* If the distance from the current position to the next tab
		 stop is less than a space character width, use the
		 tab stop after that.  */
	      if (next_tab_x - x < font->space_width)
		next_tab_x += tab_width;
	      if (!NILP (Vdisplay_line_numbers) && x0 >= it->lnum_pixel_width)
		next_tab_x += (it->lnum_pixel_width
			       - ((it->w->hscroll * font->space_width)
				  % tab_width));

	      it->pixel_width = next_tab_x - x0;

Here is an excerpt of the STDERR printout using the function bug_30226 (when w->hscroll == 2) on the line containing "[TAB][TAB]Hello-world" with the following Elisp and the attached patch.diff:

    (setq display-line-numbers t)
    (setq buffer-display-table (make-display-table))
    (aset buffer-display-table
          ?\t
          (vector (make-glyph-code ?\u00BB 'font-lock-warning-face)
                  (make-glyph-code ?\t 'highlight)))
    (setq tab-width 8)
    (global-set-key [f5] (lambda () (interactive) (bug-30226)))
    (insert "\n\n\t\tHello-world")

1.  NOTHING
    it.c (0)
    w->hscroll (2)
    it.hpos (0) 
    it.current_x (0)
    it.pixel_width (0)

2.  TAB CHARACTER
    it.c (187)
    w->hscroll (2)
    it.hpos (0) 
    it.current_x (0)
    it.pixel_width (7)

x_produce_glyphs:
    it->c (9)
    hscroll (2)
    it->first_visible_x (14)
    it->current_x (7)
    it->hpos (0)
    it->lnum_pixel_width (28)

3.  TAB STRETCH
    it.c (9)
    w->hscroll (2)
    it.hpos (0) 
    it.current_x (7)
    it.pixel_width (49)

x_produce_glyphs:
    it->c (9)
    hscroll (2)
    it->first_visible_x (14)
    it->current_x (7)
    it->hpos (0)
    it->lnum_pixel_width (28)

4.  TAB CHARACTER
    it.c (187)
    w->hscroll (2)
    it.hpos (5) 
    it.current_x (84)
    it.pixel_width (7)

x_produce_glyphs:
    it->c (9)
    hscroll (2)
    it->first_visible_x (14)
    it->current_x (91)
    it->hpos (6)
    it->lnum_pixel_width (28)

5.  TAB STRETCH
    it.c (9)
    w->hscroll (2)
    it.hpos (6) 
    it.current_x (91)
    it.pixel_width (35)

x_produce_glyphs:
    it->c (9)
    hscroll (2)
    it->first_visible_x (14)
    it->current_x (91)
    it->hpos (6)
    it->lnum_pixel_width (28)

6.  TEXT
    it.c (72)
    w->hscroll (2)
    it.hpos (7) 
    it.current_x (126)
    it.pixel_width (7)

* * *

15.  TEXT
    it.c (108)
    w->hscroll (2)
    it.hpos (16) 
    it.current_x (189)
    it.pixel_width (7)

16.  TEXT
    it.c (100)
    w->hscroll (2)
    it.hpos (17) 
    it.current_x (196)
    it.pixel_width (7)

x_produce_glyphs:
    it->c (9)
    hscroll (2)
    it->first_visible_x (14)
    it->current_x (7)
    it->hpos (0)
    it->lnum_pixel_width (28)

display_line -- BEFORE maybe_produce_line_number:
    it->current_x (7)
    it->hpos (0)
    it->c (9)

display_line -- AFTER maybe_produce_line_number:
    it->current_x (35)
    it->hpos (3)
    it->c (9)

x_produce_glyphs:
    it->c (9)
    hscroll (2)
    it->first_visible_x (14)
    it->current_x (35)
    it->hpos (3)
    it->lnum_pixel_width (28)

x_produce_glyphs:
    it->c (9)
    hscroll (2)
    it->first_visible_x (14)
    it->current_x (77)
    it->hpos (5)
    it->lnum_pixel_width (28)

x_produce_glyphs:
    it->c (9)
    hscroll (2)
    it->first_visible_x (14)
    it->current_x (7)
    it->hpos (0)
    it->lnum_pixel_width (28)

x_produce_glyphs:
    it->c (9)
    hscroll (2)
    it->first_visible_x (14)
    it->current_x (91)
    it->hpos (6)
    it->lnum_pixel_width (28)

Row     Start       End Used oE><\CTZFesm     X    Y    W    H    V    A    P
==============================================================================
 13       486       499   19 111000110000     0  208  153   16   16   12   12
           -1        -1	    0
           -1        -1
           -1        -1
 Glyph#  Type       Pos   O   W     Code      C Face LR
      0     C        -1   0   7 0x000020          27 00
      1     C        -1   0   7 0x000031      1   27 00
      2     C        -1   0   7 0x000034      4   27 00
      3     C        -1   0   7 0x000020          27 00
      4     S       486   B  35 0x000000          29 00
      5     C       487   B   7 0x0000bb      .   30 00
      6     S       487   B  -1 0x000000          29 00
      7     C       488   B   7 0x000048      H    0 00
      8     C       489   B   7 0x000065      e    0 00
      9     C       490   B   7 0x00006c      l    0 00
     10     C       491   B   7 0x00006c      l    0 00
     11     C       492   B   7 0x00006f      o    0 00
     12     C       493   B   7 0x00002d      -    0 00
     13     C       494   B   7 0x000077      w    0 00
     14     C       495   B   7 0x00006f      o    0 00
     15     C       496   B   7 0x000072      r    0 00
     16     C       497   B   7 0x00006c      l    0 00
     17     C       498   B   7 0x000064      d    0 00
     18     C         0   0   7 0x000020           0 00

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

DATE:  [02-19-2018 08:28:38] <19 Feb 2018 18:28:38 +0200>
FROM:  Eli Zaretskii <eliz@HIDDEN>
> 
> > Date:  Sun, 18 Feb 2018 18:17:26 -0800
> > From:  Keith David Bershatsky <esq@HIDDEN>
> > Cc:  30226 <at> debbugs.gnu.org
> > 
> > A major break-through in the tracing of bug 30226 ....  it->current_x differs between the real thing (when display_line calls PRODUCE_GLYPHS), versus the simulation (when move_it_in_display_line_to calls PRODUCE_GLYPHS), _because_ maybe_produce_line_number advances it->current_x in the former but _not_ the latter.
> 
> How do you see that maybe_produce_line_number doesn't advance
> current_x?  AFAICS, it does that unconditionally:
> 
>   for ( ; g < e; g++)
>     {
>       it->current_x += g->pixel_width;  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>       /* The following is important when this function is called
>   from move_it_in_display_line_to: HPOS is incremented only
>   when we are in the visible portion of the glyph row.  */
>       if (it->current_x > it->first_visible_x)
>  it->hpos++;
>       if (p)
>  {
>    *p++ = *g;
>    (*u)++;
>  }
>     }
> 
> Did you mean hpos instead?  Or did you mean that
> maybe_produce_line_number is not called from
> move_it_in_display_line_to in some case, whereas it is called from
> display_line?  Or something else?
> 
> > SOLUTION (suggested):  Revise move_it_in_display_line_to advance X by simulating a call to maybe_produce_line_number and permitting that function to advance X.
> 
> But this is already done...


--Multipart_Mon_Feb_19_10:52:27_2018-1
Content-Type: application/diff; type=patch
Content-Disposition: attachment; filename="patch.diff"
Content-Transfer-Encoding: base64

ZGlmZiAtLWdpdCBhL3NyYy94ZGlzcC5jIGIvc3JjL3hkaXNwLmMKaW5kZXggZGE5YzMxMy4uODYw
NDk0ZSAxMDA2NDQKLS0tIGEvc3JjL3hkaXNwLmMKKysrIGIvc3JjL3hkaXNwLmMKQEAgLTIxMzM1
LDkgKzIxMzM1LDQ0IEBAIGRpc3BsYXlfbGluZSAoc3RydWN0IGl0ICppdCwgaW50IGN1cnNvcl92
cG9zKQogICAgICAgbWluX3BvcyA9IENIQVJQT1MgKHRoaXNfbGluZV9taW5fcG9zKTsKICAgICAg
IG1pbl9icG9zID0gQllURVBPUyAodGhpc19saW5lX21pbl9wb3MpOwogCisKKy8qICoqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKiAqLworLyogIzMwMjI2ICovCisKK2lmIChpdC0+YyA9PSA5CisgICAgJiYgaXQt
PnctPm91dHB1dF9jdXJzb3IudnBvcyA9PSBpdC0+dnBvcykKKyAgZnByaW50ZiAoc3RkZXJyLCAi
XG5kaXNwbGF5X2xpbmUgLS0gQkVGT1JFIG1heWJlX3Byb2R1Y2VfbGluZV9udW1iZXI6XG5cCisg
ICAgaXQtPmN1cnJlbnRfeCAoJWQpXG5cCisgICAgaXQtPmhwb3MgKCVkKVxuXAorICAgIGl0LT5j
ICglZClcbiIsCisgICAgICBpdC0+Y3VycmVudF94LAorICAgICAgaXQtPmhwb3MsCisgICAgICBp
dC0+Yyk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICAgIC8qIFByb2R1Y2Ug
bGluZSBudW1iZXIsIGlmIG5lZWRlZC4gICovCiAgICAgICBpZiAobGluZV9udW1iZXJfbmVlZGVk
KQogCW1heWJlX3Byb2R1Y2VfbGluZV9udW1iZXIgKGl0KTsKKworCisvKiAqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKiogKi8KKy8qICMzMDIyNiAqLworCitpZiAoaXQtPmMgPT0gOQorICAgICYmIGl0LT53LT5v
dXRwdXRfY3Vyc29yLnZwb3MgPT0gaXQtPnZwb3MpCisgIGZwcmludGYgKHN0ZGVyciwgIlxuZGlz
cGxheV9saW5lIC0tIEFGVEVSIG1heWJlX3Byb2R1Y2VfbGluZV9udW1iZXI6XG5cCisgICAgaXQt
PmN1cnJlbnRfeCAoJWQpXG5cCisgICAgaXQtPmhwb3MgKCVkKVxuXAorICAgIGl0LT5jICglZClc
biIsCisgICAgICBpdC0+Y3VycmVudF94LAorICAgICAgaXQtPmhwb3MsCisgICAgICBpdC0+Yyk7
CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKICAgICB9CiAgIGVsc2UgaWYgKGl0LT5h
cmVhID09IFRFWFRfQVJFQSkKICAgICB7CkBAIC0yODI0NCw2ICsyODI3OSwyOSBAQCB4X3Byb2R1
Y2VfZ2x5cGhzIChzdHJ1Y3QgaXQgKml0KQogCXsKIAkgIGlmIChmb250LT5zcGFjZV93aWR0aCA+
IDApCiAJICAgIHsKKworCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKy8qICMzMDIyNiAqLwor
CitpbnQgaHNjcm9sbCA9IGl0LT53LT5oc2Nyb2xsOworZnByaW50ZiAoc3RkZXJyLCAiXG54X3By
b2R1Y2VfZ2x5cGhzOlxuXAorICAgIGl0LT5jICglZClcblwKKyAgICBoc2Nyb2xsICglZClcblwK
KyAgICBpdC0+Zmlyc3RfdmlzaWJsZV94ICglZClcblwKKyAgICBpdC0+Y3VycmVudF94ICglZClc
blwKKyAgICBpdC0+aHBvcyAoJWQpXG5cCisgICAgaXQtPmxudW1fcGl4ZWxfd2lkdGggKCVkKVxu
IiwKKyAgICAgIGl0LT5jLAorICAgICAgaHNjcm9sbCwKKyAgICAgIGl0LT5maXJzdF92aXNpYmxl
X3gsCisgICAgICBpdC0+Y3VycmVudF94LAorICAgICAgaXQtPmhwb3MsCisgICAgICBpdC0+bG51
bV9waXhlbF93aWR0aCk7CisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworCisKIAkgICAgICBp
bnQgdGFiX3dpZHRoID0gaXQtPnRhYl93aWR0aCAqIGZvbnQtPnNwYWNlX3dpZHRoOwogCSAgICAg
IGludCB4ID0gaXQtPmN1cnJlbnRfeCArIGl0LT5jb250aW51YXRpb25fbGluZXNfd2lkdGg7CiAJ
ICAgICAgaW50IHgwID0geDsKQEAgLTMyMjY2LDkgKzMyMzI0LDExOCBAQCB4X2ludGVyc2VjdF9y
ZWN0YW5nbGVzIChYUmVjdGFuZ2xlICpyMSwgWFJlY3RhbmdsZSAqcjIsIFhSZWN0YW5nbGUgKnJl
c3VsdCkKIAkJCSAgICBJbml0aWFsaXphdGlvbgogICoqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCisKKy8qICoq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKiAqLworLyogIzMwMjI2ICovCisKK0RFRlVOICgiYnVnLTMwMjI2Iiwg
RmJ1Z18zMDIyNiwgU2J1Z18zMDIyNiwgMCwgMCwgMCwKKyAgICAgICBkb2M6IC8qIERlYnVnIHRo
ZSBwaXhlbC13aWR0aCBvZiBhIHN0cmV0Y2ggdGFiLiAqLykKKyAgKHZvaWQpCit7CisgIEZzY3Jv
bGxfbGVmdCAobWFrZV9udW1iZXIgKDEpLCBRbmlsKTsKKyAgc3RydWN0IHdpbmRvdyAqdyA9IGRl
Y29kZV9saXZlX3dpbmRvdyAoc2VsZWN0ZWRfd2luZG93KTsKKyAgc3RydWN0IGZyYW1lICpmID0g
WEZSQU1FICh3LT5mcmFtZSk7CisgIHN0cnVjdCBpdCBpdDsKKyAgdm9pZCAqaXRkYXRhID0gYmlk
aV9zaGVsdmVfY2FjaGUgKCk7CisgIGVudW0gbW92ZV9pdF9yZXN1bHQgcmMgPSBNT1ZFX1hfUkVB
Q0hFRDsKKyAgc3RydWN0IHRleHRfcG9zIHN0YXJ0X3RleHRfcG9zaXRpb247CisgIGludCBjb3Vu
dCA9IDE7CisgIGludCBwcmV2aW91c19jaGFyID0gMDsKKyAgaW50IHByZXZpb3VzX3ggPSAwOwor
LyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqCisgICAgICAgICAgICAgICAgICAgICAgU1RBUlQgRElT
UExBWSAtLSB3LT5zdGFydAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgIC8qIEJlZ2luIHRo
ZSBqb3VybmV5IGF0IHctPnN0YXJ0LiAqLworICBTRVRfVEVYVF9QT1NfRlJPTV9NQVJLRVIgKHN0
YXJ0X3RleHRfcG9zaXRpb24sIHctPnN0YXJ0KTsKKyAgc3RhcnRfZGlzcGxheSAoJml0LCB3LCBz
dGFydF90ZXh0X3Bvc2l0aW9uKTsKKyAgc3RydWN0IGZhY2UgKmZhY2UgPSBGQUNFX0ZST01fSUQg
KGl0LmYsIGl0LmZhY2VfaWQpOworICBzdHJ1Y3QgZm9udCAqZm9udCA9IGZhY2UtPmZvbnQ7Cisv
KiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICBHTyBUTyBUSEUgQkVHSU5O
SU5HIE9GIFRIRSBDVVJSRU5UIExJTkUuCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgLyog
UGxhY2UgdGhlIElUIG9uIHRoZSBjdXJyZW50IGxpbmUgY29udGFpbmluZyBQVC4gKi8KKyAgaW50
IHZvZmZzZXQgPSAoV0lORE9XX0hFQURFUl9MSU5FX0hFSUdIVCAodykgPiAwCisgICAgICAgICAg
ICAgICAgICYmIHctPm91dHB1dF9jdXJzb3IudnBvcyA+IDApCisgICAgICAgICAgICAgICAgICA/
IHctPm91dHB1dF9jdXJzb3IudnBvcyAtIDEKKyAgICAgICAgICAgICAgICAgIDogdy0+b3V0cHV0
X2N1cnNvci52cG9zOworICBpZiAodm9mZnNldCA+IDApCisgICAgbW92ZV9pdF9ieV9saW5lcyAo
Jml0LCB2b2Zmc2V0KTsKKyAgc3RydWN0IGdseXBoX3JvdyAqZ2x5cGhfcm93ID0gTUFUUklYX1JP
VyAody0+Y3VycmVudF9tYXRyaXgsIGl0LnZwb3MpOworLyogKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
CisgICAgICAgICAgICAgTU9WRSBJVCBPVkVSIEVBQ0ggQ0hBUkFDVEVSIE9OIFRIRSBDVVJSRU5U
IExJTkUuCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgd2hpbGUgKHRydWUpCisgICAgewor
ICAgICAgaWYgKElURVJBVE9SX0FUX0VORF9PRl9MSU5FX1AgKCZpdCkKKyAgICAgICAgICB8fCBG
RVRDSF9CWVRFIChJVF9CWVRFUE9TIChpdCkpID09ICdcbicKKyAgICAgICAgICB8fCByYyA9PSBN
T1ZFX1BPU19NQVRDSF9PUl9aVikKKyAgICAgICAgYnJlYWs7CisvKiAqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioKKyAgICAgICAgICAgICAgICAgICAgICAgRFVNUCBSRUxFVkFOVCBHTFlQSCBJTkZPUk1B
VElPTgorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqICovCisgICAgICBpZiAody0+aHNjcm9sbCA+IDAp
CisgICAgICAgIHsKKyAgICAgICAgICBpbnQgd19oc2Nyb2xsID0gdy0+aHNjcm9sbDsKKyAgICAg
ICAgICBmcHJpbnRmIChzdGRlcnIsICJcbiVkLiAgJXNcblwKKyAgICBpdC5jICglZClcblwKKyAg
ICB3LT5oc2Nyb2xsICglZClcblwKKyAgICBpdC5ocG9zICglZCkgXG5cCisgICAgaXQuY3VycmVu
dF94ICglZClcblwKKyAgICBpdC5waXhlbF93aWR0aCAoJWQpXG4iLAorICAgICAgICAgICAgICAg
ICBjb3VudCwKKyAgICAgICAgICAgICAgICAgKGl0LmMgPT0gMAorICAgICAgICAgICAgICAgICAg
ID8gIk5PVEhJTkciCisgICAgICAgICAgICAgICAgICAgOiBpdC5jID09IDE4NworICAgICAgICAg
ICAgICAgICAgICAgPyAiVEFCIENIQVJBQ1RFUiIKKyAgICAgICAgICAgICAgICAgICA6IGl0LmMg
PT0gJ1x0JworICAgICAgICAgICAgICAgICAgICAgPyAiVEFCIFNUUkVUQ0giCisgICAgICAgICAg
ICAgICAgICAgOiAiVEVYVCIpLAorICAgICAgICAgICAgICAgICBpdC5jLAorICAgICAgICAgICAg
ICAgICB3X2hzY3JvbGwsCisgICAgICAgICAgICAgICAgIGl0Lmhwb3MsCisgICAgICAgICAgICAg
ICAgIGl0LmN1cnJlbnRfeCwKKyAgICAgICAgICAgICAgICAgaXQucGl4ZWxfd2lkdGgpOworICAg
ICAgICB9CisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAgICAgICAgICAgICAgICAgICAgICAg
TU9WRSBJVCAtLSBJTkNSRU1FTlQgPT0gSVQuUElYRUxfV0lEVEggCisqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKiogKi8KKyAgICAgIHByZXZpb3VzX2NoYXIgPSBpdC5jOworICAgICAgcHJldmlvdXNfeCA9
IGl0LmN1cnJlbnRfeDsKKyAgICAgIHJjID0gbW92ZV9pdF9pbl9kaXNwbGF5X2xpbmVfdG8gKCZp
dCwgWlYsIGl0LmN1cnJlbnRfeCArIGl0LnBpeGVsX3dpZHRoLAorICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgTU9WRV9UT19QT1MgfCBNT1ZFX1RPX1gpOworICAgICAgY291
bnQgPSBjb3VudCArIDE7CisgICAgICBpZiAocmMgPT0gTU9WRV9MSU5FX0NPTlRJTlVFRCkKKyAg
ICAgICAgYnJlYWs7CisgICAgICBpZiAoaXQuY3VycmVudF94IC0gaXQuZmlyc3RfdmlzaWJsZV94
ICsgZm9udC0+c3BhY2Vfd2lkdGggPj0KKyAgICAgICAgICB3aW5kb3dfYm94X3dpZHRoICh3LCBU
RVhUX0FSRUEpKQorICAgICAgICBicmVhazsKKyAgICB9CisvKiAqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioKKyAgICAgICAgICAgICAgICAgICAgICAgICBSRURJU1BMQVkgQU5EIERVTVBfR0xQWUhfUk9X
CisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKiogKi8KKyAgcmVkaXNwbGF5X2ludGVybmFsICgpOworICBm
cHJpbnRmIChzdGRlcnIsICJcbiIpOworICBkdW1wX2dseXBoX3JvdyAoZ2x5cGhfcm93LCBpdC52
cG9zLCAyKTsKKyAgYmlkaV91bnNoZWx2ZV9jYWNoZSAoaXRkYXRhLCBmYWxzZSk7CisgIHJldHVy
biBRbmlsOworfQorCisvKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogKi8KKworCiB2b2lkCiBzeW1zX29m
X3hkaXNwICh2b2lkKQogeworCisKKy8qICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLworLyogIzMwMjI2
ICovCisKKyAgZGVmc3ViciAoJlNidWdfMzAyMjYpOworCisvKiAqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiog
Ki8KKworCiAgIFZ3aXRoX2VjaG9fYXJlYV9zYXZlX3ZlY3RvciA9IFFuaWw7CiAgIHN0YXRpY3By
byAoJlZ3aXRoX2VjaG9fYXJlYV9zYXZlX3ZlY3Rvcik7CiAK
--Multipart_Mon_Feb_19_10:52:27_2018-1--





Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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