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: Fri, 19 Oct 2018 12:58:56 -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 1539979116 24393 195.159.176.226 (19 Oct 2018 19:58:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 19 Oct 2018 19:58:36 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 19 21:58:31 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 1gDauk-0006G2-Qq for ged-emacs-devel@m.gmane.org; Fri, 19 Oct 2018 21:58:31 +0200 Original-Received: from localhost ([::1]:52450 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDawr-0007Lm-8b for ged-emacs-devel@m.gmane.org; Fri, 19 Oct 2018 16:00:41 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDavm-0007GJ-R5 for emacs-devel@gnu.org; Fri, 19 Oct 2018 15:59:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDava-00069Z-CU for emacs-devel@gnu.org; Fri, 19 Oct 2018 15:59:29 -0400 Original-Received: from gateway36.websitewelcome.com ([192.185.200.11]:19787) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gDavV-0005gI-4S for emacs-devel@gnu.org; Fri, 19 Oct 2018 15:59:18 -0400 Original-Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway36.websitewelcome.com (Postfix) with ESMTP id B7330400CB70E for ; Fri, 19 Oct 2018 14:06:15 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id DavBg4ueYaSeyDavFgP3Ir; Fri, 19 Oct 2018 14:59:03 -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=RcwT63ULuJiKFyocFPZ1oFn2Uh4dSH2QXFhNeLp5W1c=; b=IFCN+wGwFgdHYI7Z+z1FOyQj9v 2y9IUoaqVvCUcBdqnswE25imgMvuYVqpynI5to/0KsmKyWuvVSzesRsRDH2Xnfof+D+LTTJailxET iC467qJzZS3+hTGBSdK8Mz97Vy1jXRxC6CoiozKiu6OKi7EfhGJZiJ/ghbP3fMcL5kE0BVaun3TR6 Js4YZ81EePLz+wMMtEve9jaaVBKqwoILnxatPtPy0lnf71ToeB9AAbZTfX32CLSMvBc/bti31D1gx XeVqdDUyCXaRVstaToZ9s6xTPOscQQFc8SfVYWr5L7hmwKtC+/TclG9qvOPbvZAz7rYRLRcgGAb06 D044HxBQ==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:51830 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from ) id 1gDavA-000LDH-V9; Fri, 19 Oct 2018 14:58:57 -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: 1gDavA-000LDH-V9 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]:51830 X-Source-Auth: lawlist X-Email-Count: 4 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.200.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:230510 Archived-At: Thank you, Eli, for continuing to try and help with this particular issue= -- greatly appreciated! For reference point of this particular analysis: it->lnum_pixel_width =3D=3D 44 Evaluating (scroll-left 10) gives a temporary: it->w->hscroll =3D=3D 10 The first character '=E3=81=AE' which was at a relative_x of 55 in a (scr= oll-left 9) situation, is still at a relative_x of 55 in a (scroll-left 1= 0) situation. That character doesn't move move off the screen yet -- pro= bably because it has a pixel width of 18; whereas, the frame_char_width i= s 11 for regular English characters. it->current_x =3D=3D 99 for the first character '=E3=81=AE'. it->first_visible-x =3D=3D 110. Which is at odds with the previous state= ment. My guess is that the first character '=E3=81=AE' is really at an it->curr= ent_x of 143; and, the it->first_visible_x would have to be 99. I created my own custom dump glyph row which calculates the relative_x ju= st like pgrowx in .gdbinit; i.e., add up all of the previous glyph->pixel= _width up to the current location go get the relative_x at issue. To help me see what is happening, I put in a few new entries just above '= glyph->charpos =3D ' in all six (6) locations within xdisp.c and assigned= a new "gizmo" (for lack of knowing the proper name) like this 'glyph->x = =3D it->current_x;' with the appropriate corresponding entry for glyph->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, no= t 99. [I can certainly remove the above modifications to xdisp.c, but I don't t= hink they hurt and they seem to be helpful to debug this particular issue= .] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > Date: [10-19-2018 12:23:34] <19 Oct 2018 22:23:34 +0300> > From: Eli Zaretskii > To: Keith David Bershatsky > CC: emacs-devel@gnu.org > Subject: Re: Calculating screen relative X when horizontal scrolling. >=20 > > Date: Wed, 17 Oct 2018 13:43:49 -0700 > > From: Keith David Bershatsky > > Cc: emacs-devel@gnu.org > > > > relative_x =3D it->current_x - ((window_hscroll_limited (it->w, it->f= ) * FRAME_COLUMN_WIDTH (it->f)) >=20 > Can you tell why you don't use the simple approach: >=20 > relative_x =3D it->current_x - it->first_visible_x;