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: Calculating screen relative X when horizontal scrolling. Date: Sat, 20 Oct 2018 02:55:35 -0700 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 1540029223 30244 195.159.176.226 (20 Oct 2018 09:53:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 20 Oct 2018 09:53:43 +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 Oct 20 11:53:39 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 1gDnww-0007kV-GB for ged-emacs-devel@m.gmane.org; Sat, 20 Oct 2018 11:53:39 +0200 Original-Received: from localhost ([::1]:54417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDnz2-0007za-Ks for ged-emacs-devel@m.gmane.org; Sat, 20 Oct 2018 05:55:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDnyw-0007zF-GQ for emacs-devel@gnu.org; Sat, 20 Oct 2018 05:55:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDnyt-0002Xd-8y for emacs-devel@gnu.org; Sat, 20 Oct 2018 05:55:42 -0400 Original-Received: from gateway22.websitewelcome.com ([192.185.47.129]:42118) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gDnys-0002UM-RX for emacs-devel@gnu.org; Sat, 20 Oct 2018 05:55:39 -0400 Original-Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway22.websitewelcome.com (Postfix) with ESMTP id 48B2413B6E for ; Sat, 20 Oct 2018 04:55:37 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id DnyqgydoeFxNhDnyrgHNTO; Sat, 20 Oct 2018 04:55:37 -0500 X-Authority-Reason: nr=8 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=Jvxy7ly8bOgIOqTrgecM+iBQ7cfmwEC/eddJXZN2Pao=; b=R1HUiD3pBPPxBoyJBYmzavMiL/ +DP6H/u6VSe2S3yxgsRFO4THU1QWovvPHsg9tZXdSNBpMX6AHAgvg4Dvft4qjRw6SyivtoCuvE6h9 O5fC72gCcwAafaSdZWZr+2L8zWD/2Ve/2K10RiHToYTq9ujVZdVyBnwXUvrbSfUWfM5iOdUoualH8 dQzBCRU+YDtvddNAzjN10yN79cINgSXCUlxD2q0I6myuB3YXxrlqhvXyX0wT3BlqoogTIAfLb7RUa H/UvlN4NaW5DWw5FZ6mOg/NwAppfe2VDtbfFzk3XkUXSPbHpwS3NMoRJfAdlCTkaj06D7ljcs/16w eJBvXopw==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:52818 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from ) id 1gDnyq-002UjN-HO; Sat, 20 Oct 2018 04:55:36 -0500 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: 1gDnyq-002UjN-HO X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:52818 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.47.129 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:230520 Archived-At: When line numbers are _not_ displayed, it->current_x - it->first_visible_= x yields the correct relative_x when calling (scroll-left INTEGER). Part= ially displayed characters are supported at the far left of the screen in= that scenario. In the (scroll-left 11) situation (with the first visible text character = being a middle dot with a pixel width of 11), the first wide character '=E3= =81=AE' is already hidden off to the left of the screen. However, that h= idden wide character '=E3=81=AE' is apparently affecting the ability to o= btain the correct it->first-visible_x / it->current_x. In other words, t= he situation does not appear to be caused by virtue of the first _visible= _ text character to the immediate right of the line numbers. Is there a test you can think of for these situations such that I can ins= truct Emacs _when_ to use a _modified_ it->first-visible_x / it->current_= x for purposes of calculating the relative_x? Here are the printouts from my debugging stderr messages.... The line be= ginning with "POSITION ..." is generated when moving IT on the current li= ne and stopping at each new X. The line beginning with "Glyph# ..." is g= enerated by a modified version of dump_glyph_row, which lets us see the r= eal it->current_x when the glyph was actually drawn on the screen. (scroll-left 9) POSITION X Y HPOS VPOS HSCL MIN_H 1ST_X LNUMW TYPE N F W = C D 19 99 204 0 9 9 0 99 44 CHAR 1 24 18 1239= 8 =E3=81=AE Glyph# Rel.X Type Pos O W Code Face LR X Y HPOS VPOS C 0 0 C -1 0 11 0x000020 17 00 0 24 0 0 =20 1 11 C -1 0 11 0x000031 17 00 11 24 0 0 1 2 22 C -1 0 11 0x000030 17 00 22 24 0 0 0 3 33 C -1 0 11 0x000020 17 00 33 24 0 0 =20 4 44 C 19 B 18 0x00306e 24 00 143 204 4 9 =E3= =81=AE (scroll-left 10) POSITION X Y HPOS VPOS HSCL MIN_H 1ST_X LNUMW TYPE N F W = C D 19 99 204 0 9 10 0 110 44 CHAR 1 24 18 1239= 8 =E3=81=AE Glyph# Rel.X Type Pos O W Code Face LR X Y HPOS VPOS C 0 0 C -1 0 11 0x000020 17 00 0 24 0 0 =20 1 11 C -1 0 11 0x000031 17 00 11 24 0 0 1 2 22 C -1 0 11 0x000030 17 00 22 24 0 0 0 3 33 C -1 0 11 0x000020 17 00 33 24 0 0 =20 4 44 C 19 B 18 0x00306e 24 00 143 204 3 9 =E3= =81=AE (scroll-left 11) POSITION X Y HPOS VPOS HSCL MIN_H 1ST_X LNUMW TYPE N F W = C D 20 117 204 0 9 11 0 121 44 CHAR 1 19 11 18= 3 =C2=B7 Glyph# Rel.X Type Pos O W Code Face LR X Y HPOS VPOS C 0 0 C -1 0 11 0x000020 17 00 0 24 0 0 =20 1 11 C -1 0 11 0x000031 17 00 11 24 0 0 1 2 22 C -1 0 11 0x000030 17 00 22 24 0 0 0 3 33 C -1 0 11 0x000020 17 00 33 24 0 0 =20 4 44 C 20 B 11 0x0000b7 19 00 161 204 4 9 =C2= =B7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > Date: [10-20-2018 00:13:26] <20 Oct 2018 10:13:26 +0300> > From: Eli Zaretskii > To: Keith David Bershatsky > CC: emacs-devel@gnu.org > Subject: Re: Calculating screen relative X when horizontal scrolling. >=20 > > Date: Fri, 19 Oct 2018 12:58:56 -0700 > > From: Keith David Bershatsky > > Cc: emacs-devel@gnu.org > > > > For reference point of this particular analysis: > > > > it->lnum_pixel_width =3D=3D 44 >=20 > Are your problems limited to the situation where line numbers are > displayed? >=20 > > To help me see what is happening, I put in a few new entries just abo= ve 'glyph->charpos =3D ' in all six (6) locations within xdisp.c and assi= gned a new "gizmo" (for lack of knowing the proper name) like this 'glyph= ->x =3D it->current_x;' with the appropriate corresponding entry for glyp= h->x in dispextern.h. In the custom dump glyph row (discussed above), I = can see that glyph->x for the first '=E3=81=AE' character is actually 143= , not 99. >=20 > Since 143 =3D 99 + 44, and first_visible_x for scroll-left of 9 is 99 i= n > your case, I think everything is OK. You just need to account for > lnum_pixel_width, which is 44 in this case. >=20 > When you change scroll-left to 10, a wide character such as '=E3=81=AE'= will > not move off the display if line numbers are displayed, because we > don't know how to draw partial characters in that mode. This might be > considered a bug in the current display code. But I don't think this > should affect your code.