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: Wed, 29 Nov 2017 20:04:14 +0200 Message-ID: <838tep3qsh.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1511978737 7493 195.159.176.226 (29 Nov 2017 18:05:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 29 Nov 2017 18:05:37 +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 Wed Nov 29 19:05:33 2017 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 1eK6ji-0001Yg-J9 for ged-emacs-devel@m.gmane.org; Wed, 29 Nov 2017 19:05:30 +0100 Original-Received: from localhost ([::1]:44522 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eK6jp-0007kA-SU for ged-emacs-devel@m.gmane.org; Wed, 29 Nov 2017 13:05:37 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37770) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eK6il-0007iI-Sm for emacs-devel@gnu.org; Wed, 29 Nov 2017 13:04:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eK6ih-0006L4-PF for emacs-devel@gnu.org; Wed, 29 Nov 2017 13:04:30 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eK6ih-0006Kq-M4; Wed, 29 Nov 2017 13:04:27 -0500 Original-Received: from [176.228.60.248] (port=4007 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eK6ig-0004CZ-03; Wed, 29 Nov 2017 13:04:27 -0500 In-reply-to: (message from Keith David Bershatsky on Tue, 28 Nov 2017 22:12:35 -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:220521 Archived-At: > Date: Tue, 28 Nov 2017 22:12:35 -0800 > From: Keith David Bershatsky > > I can see that X and/or HPOS are wrong when tabs are present on the current line because I get superimposed letters and double of the same word slightly off to the left and/or the right of where the word should be. > > HYPOTHESIS: I would venture to say that what is displayed on screen does _not_ coincide with what IT reports when running move_it_in_display_line_to. Does this happen only when line numbers are displayed? In any case, your description provides a lot of details that are hard to reason about, because most of the code is not shown. OTOH, if indeed there's a bug in move_it_in_display_line_to, then presenting evidence for it is very simple: show a line of text and its line number, and then show the X and HPOS values for each tab in that line as calculated by move_it_in_display_line_to vs the same values in a displayed line. (For the latter, you can use the pgrowx command defined in src/.gdbinit, or manually display the values using the debugger.) If you do that, any mismatches between displaying a line and moving through it with move_it_in_display_line_to will be immediately apparent, and it should be easy to fix them.