From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Problems with move_it_in_display_line_to X when tabs exist. Date: Tue, 16 Jan 2018 19:00:43 +0200 Message-ID: <83po69yc04.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1516122113 4303 195.159.176.226 (16 Jan 2018 17:01:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 16 Jan 2018 17:01:53 +0000 (UTC) Cc: emacs-devel@gnu.org To: Keith David Bershatsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 16 18:01:49 2018 Return-path: Envelope-to: ged-emacs-devel@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 1ebUcD-0008VX-8b for ged-emacs-devel@m.gmane.org; Tue, 16 Jan 2018 18:01:37 +0100 Original-Received: from localhost ([::1]:49200 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebUeA-0005XO-Nt for ged-emacs-devel@m.gmane.org; Tue, 16 Jan 2018 12:03:38 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebUbZ-0003WV-2t for emacs-devel@gnu.org; Tue, 16 Jan 2018 12:00:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebUbV-0001Ab-5b for emacs-devel@gnu.org; Tue, 16 Jan 2018 12:00:57 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43767) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebUbV-0001AS-36; Tue, 16 Jan 2018 12:00:53 -0500 Original-Received: from [176.228.60.248] (port=1401 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ebUbU-0008Rs-Ea; Tue, 16 Jan 2018 12:00:52 -0500 In-reply-to: (message from Keith David Bershatsky on Mon, 15 Jan 2018 20:41:52 -0800) 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-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:222013 Archived-At: > Date: Mon, 15 Jan 2018 20:41:52 -0800 > From: Keith David Bershatsky > Cc: emacs-devel@gnu.org > > The following screenshots with stderr results were obtained by calling the function debug-tab-pixel-width, which is contained in the attached patch.diff. I saw that x_produce_glyphs is able to achieve the correct it->pixel_width for the STRETCH tab when x0 >= it->lnum_pixel_width; however, it is run subsequent in time to when we call move_it_in_display_line_to. > > > 0. Opening screenshot -- just setting up the test buffer. > > https://www.lawlist.com/images/tab_width_bug_00.png > > > 1. Place the cursor on the line that begins with a tab, and press the f5 key once. > > https://www.lawlist.com/images/tab_width_bug_01.png > > OBSERVATIONS (w->hscroll == 1): The expected result is that the STRETCH tab will have an it.pixel_width of 42. The third (3rd) iteration/loop has the wrong value; i.e., 49. The fourth (4th) iteration/loop has the correct value; i.e., 42. x_produce_glyphs runs subsequent in time and contains the desired value of 42 when x0 >= it->lnum_pixel_width. What do you mean by "x_produce_glyphs runs subsequent in time"? The value of it->pixel_width is updated by x_produce_glyphs, so before it was called, that value is outdated (belongs to the previous glyph). If that is what you observe, then it's the expected behavior, and not a bug.