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: Sat, 02 Dec 2017 14:28:31 -0800 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1512253737 10395 195.159.176.226 (2 Dec 2017 22:28:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 2 Dec 2017 22:28:57 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 02 23:28:49 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 1eLGHA-00022v-PF for ged-emacs-devel@m.gmane.org; Sat, 02 Dec 2017 23:28:49 +0100 Original-Received: from localhost ([::1]:37115 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLGHE-00005E-UH for ged-emacs-devel@m.gmane.org; Sat, 02 Dec 2017 17:28:52 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLGH2-000059-7v for emacs-devel@gnu.org; Sat, 02 Dec 2017 17:28:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eLGGz-0008LT-12 for emacs-devel@gnu.org; Sat, 02 Dec 2017 17:28:40 -0500 Original-Received: from gateway32.websitewelcome.com ([192.185.145.182]:30443) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eLGGy-0008KJ-Sl for emacs-devel@gnu.org; Sat, 02 Dec 2017 17:28:36 -0500 Original-Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 634C8D733A7 for ; Sat, 2 Dec 2017 16:28:33 -0600 (CST) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id LGGvet9DVmFImLGGvecDcJ; Sat, 02 Dec 2017 16:28:33 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Cc :To:From:Message-ID:Date:Sender:Reply-To: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=0biCf96VCp6sUr6qgCOKIXqNnYyYVgVsuTvl9LO7ero=; b=VX4UaFw4Xq0N2gAEeNquNrIQun FQCeZr+ZSS1Lj5420hcLHmfJl4iza2CQZQNdkJnncd20zQnj7Gwn+nacyDSxS2MIYQyYzxn2pJhLC ubsULU4UY7fLcmAO/FaVVZ6KFGJOTfFhy2U/ujjSm6YtIMgTOm7Px5nOx8xnPih/2lrKU0/wwW9B5 YC771MAxgf+wKbEouJffzNxl6DPdEiTz3Q0J0HiTu6o8Bn85vXFEv91LGQJBo1dgapblri27iVVJX IsX6FZsM1DtNWG2wHxKYvXXnmm7XKxnWDhNGwfZW5Yf4MDTSvjFmfoR7Jr8a9DkfjcBOldsvROI3V 0QlVZ3bQ==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:52358 helo=server.private) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.89) (envelope-from ) id 1eLGGu-001P2B-Hs; Sat, 02 Dec 2017 16:28:32 -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: 1eLGGu-001P2B-Hs 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]:52358 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.145.182 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:220634 Archived-At: Here are the four values. It looks like it.current_x is where I expected= it to be, but it.what is showing a character instead of a stretch. (gdb) print it.what $1 =3D IT_CHARACTER (gdb) print it.char_to_display $2 =3D 9 (gdb) print it.method $3 =3D GET_FROM_DISPLAY_VECTOR (gdb) print it.current_x $4 =3D 44 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DATE: [12-02-2017 13:14:33] <02 Dec 2017 23:14:33 +0200> FROM: Eli Zaretskii >=20 > > Date: Sat, 02 Dec 2017 11:52:33 -0800 > > From: Keith David Bershatsky > > Cc: emacs-devel@gnu.org > >=20 > > The test assumes: > >=20 > > * The variable word-wrap is non-nil. > >=20 > > * The variable tab-width is 2. > >=20 > > * The buffer-display table entry for a tab is: [(187 . 120) (9 . 121= )]. > >=20 > > * Native line numbers are _not_ enabled. > >=20 > > 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 ma= ke 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 tha= t it is 11 pixels wide. > >=20 > > I have hard-coded an emacs_abort () when it.c =3D=3D '\t', which mean= s that we have just moved passed character 187 (aka "=C2=BB") and we are = now on a STRETCH tab-width. >=20 > 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? >=20 > 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.