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: Sat, 02 Dec 2017 23:14:33 +0200 Message-ID: <83wp24zvba.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1512249316 23350 195.159.176.226 (2 Dec 2017 21:15:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 2 Dec 2017 21:15:16 +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 Sat Dec 02 22:15:12 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 1eLF7v-0005mG-Eo for ged-emacs-devel@m.gmane.org; Sat, 02 Dec 2017 22:15:11 +0100 Original-Received: from localhost ([::1]:36963 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLF82-0002q6-Ja for ged-emacs-devel@m.gmane.org; Sat, 02 Dec 2017 16:15:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLF7o-0002kZ-3h for emacs-devel@gnu.org; Sat, 02 Dec 2017 16:15:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eLF7j-0006F5-DG for emacs-devel@gnu.org; Sat, 02 Dec 2017 16:15:04 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54208) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLF7j-0006Er-BE; Sat, 02 Dec 2017 16:14:59 -0500 Original-Received: from [176.228.60.248] (port=2562 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eLF7h-0002yF-H7; Sat, 02 Dec 2017 16:14:59 -0500 In-reply-to: (message from Keith David Bershatsky on Sat, 02 Dec 2017 11:52:33 -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:220632 Archived-At: > Date: Sat, 02 Dec 2017 11:52:33 -0800 > From: Keith David Bershatsky > Cc: emacs-devel@gnu.org > > The test assumes: > > * The variable word-wrap is non-nil. > > * The variable tab-width is 2. > > * The buffer-display table entry for a tab is: [(187 . 120) (9 . 121)]. > > * Native line numbers are _not_ enabled. > > I have a long line that wraps at the window edge and I put a space to simulate a new word that should be wrapped to the following line. To make it easier to read, I am using the backslash symbol (below) to signify a word-wrap with a space at the window edge. The next line has three "x" followed by a tab and then the word "hello-world". The STRETCH glyph is 22 pixels wide; however, it.pixel_width is erroneously (?) reporting that it is 11 pixels wide. > > I have hard-coded an emacs_abort () when it.c == '\t', which means that we have just moved passed character 187 (aka "ยป") and we are now on a STRETCH tab-width. What is the value of it.what and of it.char_to_display? And what is the value of it.method and it.current_x? My crystal ball says that, since your display table shows a TAB as 2 characters, the first of which is a u+00bb, and is displayed as an 11-pixel glyph, that is the display element whose metrics you are seeing. The stretch glyph produced by the TAB from the display table is after that.