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.devel Subject: Re: Problems with move_it_in_display_line_to X when tabs exist. Date: Sun, 14 Jan 2018 21:48:12 -0800 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1515995220 9705 195.159.176.226 (15 Jan 2018 05:47:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 15 Jan 2018 05:47:00 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 15 06:46:56 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 1eaxba-0001fe-DB for ged-emacs-devel@m.gmane.org; Mon, 15 Jan 2018 06:46:47 +0100 Original-Received: from localhost ([::1]:38915 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eaxda-0006cp-1Q for ged-emacs-devel@m.gmane.org; Mon, 15 Jan 2018 00:48:50 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eaxdQ-0006cW-Di for emacs-devel@gnu.org; Mon, 15 Jan 2018 00:48:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eaxdN-0003ow-Ai for emacs-devel@gnu.org; Mon, 15 Jan 2018 00:48:40 -0500 Original-Received: from gateway30.websitewelcome.com ([192.185.152.11]:12940) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eaxdN-0003kx-3K for emacs-devel@gnu.org; Mon, 15 Jan 2018 00:48:37 -0500 Original-Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 15E3A6DDF for ; Sun, 14 Jan 2018 23:48:25 -0600 (CST) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id axdAeUqBMvkfxaxdAe1umM; Sun, 14 Jan 2018 23:48:25 -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=U2/ottWMHfRoi7AypVsiZma5DASfr3xoaobPGPp9FKQ=; b=dkrcC4TSQYNuoGSCy7hiS6hVY6 SsgMmGoxXpyDxxE2sVQ1LGR/noceF6kF2aKJRfjFpPjDqVxIaGhg9LXqmEdz1aKnlaOqgh3StyKhO wfMT84TNsmYAtKcEYsJXHx62GAFs3Dr2mceUmSDthgX+FfLgHZTTnrYSbRj8UlgVwv0NWQeMK+Ahg socoB4STjyqQQfn1IoffCjnZO1k42ZGEYhamE9+4/q6wxldT4gf5ktxfJcXB2IW+WEBcbQa8/5wbb JjQTTUJHgAZ7yK43RQBumyGZ5coU2aYPPna0/0cJX3+NCeXho02/KmiT7QKtyCejybW6EglOqftoO zhyEr9Fg==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:50707 helo=server.private) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.89) (envelope-from ) id 1eaxd8-002wAf-4x; Sun, 14 Jan 2018 23:48:23 -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 - 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: 1eaxd8-002wAf-4x 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]:50707 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-Received-From: 192.185.152.11 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:221963 Archived-At: I am still working on troubleshooting how the value of it->pixel_width is determined. In the current fact pattern, I am using the following settings: (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) I am placing a tab at flush-left and some text following the tab, such as: Hello-world. I am calling interactively (scroll-left 1) to temporarily scroll the text to the left 1 column at a time. I believe that x_produce_glyphs sets the it->pixel-width of the stretch tab incorrectly (while scrolling 2 or more columns to the left), which affects the ability to properly move by it.pixel_width when calling move_it_in_display_line_to. As far as I can tell, this problem _only_ happens when displaying native line numbers. The problem likely begins at line 28228 of xdisp.c where we have a comment: /* i.e. (it->char_to_display == '\t') */ I am trying to understand that section of code. QUESTION: Is this line of code: int next_tab_x = ((1 + x + tab_width - 1) / tab_width) * tab_width; the same thing as: int next_tab_x = x + tab_width; If we add 1 and then subtract 1, we did not do anything meaningful. If we divide something by tab_width and then multiply it by tab_width, then we are back again at where we started. EXAMPLE #1: (1 + 11 + 77 - 1) / 77) * 77 = 88 EXAMPLE #2: 11 + 77 = 88 Thanks, Keith