From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.bugs Subject: bug#30226: Fixing it->pixel_width / it->current_x when tabs and line numbers. Date: Sun, 18 Feb 2018 18:17:26 -0800 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1519006587 2369 195.159.176.226 (19 Feb 2018 02:16:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 19 Feb 2018 02:16:27 +0000 (UTC) Cc: 30226@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 19 03:16:23 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1enazu-0007fA-OG for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Feb 2018 03:16:07 +0100 Original-Received: from localhost ([::1]:47196 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enb1w-00037Y-O6 for geb-bug-gnu-emacs@m.gmane.org; Sun, 18 Feb 2018 21:18:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enb1q-00037I-3z for bug-gnu-emacs@gnu.org; Sun, 18 Feb 2018 21:18:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enb1m-0007Ow-Un for bug-gnu-emacs@gnu.org; Sun, 18 Feb 2018 21:18:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42462) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1enb1m-0007Oo-Qz for bug-gnu-emacs@gnu.org; Sun, 18 Feb 2018 21:18:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1enb1m-0005bn-I1 for bug-gnu-emacs@gnu.org; Sun, 18 Feb 2018 21:18:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Keith David Bershatsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Feb 2018 02:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30226 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30226-submit@debbugs.gnu.org id=B30226.151900665221521 (code B ref 30226); Mon, 19 Feb 2018 02:18:02 +0000 Original-Received: (at 30226) by debbugs.gnu.org; 19 Feb 2018 02:17:32 +0000 Original-Received: from localhost ([127.0.0.1]:50359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1enb1I-0005b3-AP for submit@debbugs.gnu.org; Sun, 18 Feb 2018 21:17:32 -0500 Original-Received: from gateway20.websitewelcome.com ([192.185.60.19]:38795) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1enb1G-0005au-3b for 30226@debbugs.gnu.org; Sun, 18 Feb 2018 21:17:30 -0500 Original-Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 87EBC400D0A9D for <30226@debbugs.gnu.org>; Sun, 18 Feb 2018 20:17:29 -0600 (CST) Original-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==; Original-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 ) id 1enb1E-000ZQJ-Ez; Sun, 18 Feb 2018 20:17:28 -0600 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:143447 Archived-At: 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.