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: Wed, 24 Oct 2018 13:40:40 -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 1540413790 27801 195.159.176.226 (24 Oct 2018 20:43:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 24 Oct 2018 20:43:10 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 24 22:43:05 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 1gFPzc-00074R-D6 for ged-emacs-devel@m.gmane.org; Wed, 24 Oct 2018 22:43:05 +0200 Original-Received: from localhost ([::1]:50277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFQ1i-0004pI-Go for ged-emacs-devel@m.gmane.org; Wed, 24 Oct 2018 16:45:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gFQ0P-0003lc-Dd for emacs-devel@gnu.org; Wed, 24 Oct 2018 16:43:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gFPxm-0005ww-K5 for emacs-devel@gnu.org; Wed, 24 Oct 2018 16:41:14 -0400 Original-Received: from gateway23.websitewelcome.com ([192.185.49.60]:47583) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gFPxm-0005jQ-3x for emacs-devel@gnu.org; Wed, 24 Oct 2018 16:41:10 -0400 Original-Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 35F9BF224 for ; Wed, 24 Oct 2018 15:40:57 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id FPxJgrMApiTy5FPxSgNfLl; Wed, 24 Oct 2018 15:40:57 -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=TohNl3KnHAxon6Yr5NXmF4T9jxoM2sluan8AZ8OTCDw=; b=nhnpobQ+i+OXm6sAt2GvksmyAN DJM7iUYmFu/VcINE0f4YQX2bM7fx+hopuqHsD17RXOcU1nGmJPPEbhQBnU0mM2LSNo7L3OqJwd0Di PfuTIuvbkcxySLytZyuO5LPYCTx0UOAVIRJY+ZzvsOPUIS8p3kslqrAe3Bw9/dzm9xSEE24P9IyWI EduyT4gItVfxh3qBlswyY6qdGa54S86v0xfRUuPPkhg/sExTWHTO2r9C10YjxUYtZFnc/wi3pq3t2 fKOZcVMgx6dt5d1BWlVxgDdIyXPSMA2Ql1wx0yKLELSLuhUQqaawTmLH+xTOQAXcWHvoyn+T1H4sQ 89U7ClLA==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:52039 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from ) id 1gFPxJ-001q3P-1G; Wed, 24 Oct 2018 15:40:41 -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: 1gFPxJ-001q3P-1G 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]:52039 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.49.60 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:230645 Archived-At: I may have located the source of the bug inside move_it_in_display_line_t= o, which is where the wrong it->first-visible_x / it->current_x arise. I= would imagine that it->hpos is also wrong. I have no idea how to fix it= , but have nevertheless put in some messages demonstrating the numbers de= sired. The problem appears to be isolated to simulating what the screen looks li= ke using move_it_in_display_line_to. it->current_x is correct when IT ge= ts to the second character after the line numbers, but is wrong for the f= irst character to the immediate right of the line numbers. As far as I c= an tell, it->first_visible_x and it->hpos never straighten themselves out= in this situation. Just a recap, since the thread has grown a bit in size and the initial th= read is already somewhat old. I am using a frame-char-width of 11 for st= andard English letters, and am limiting my testing to (scroll-left 8, 9, = 10 and 11), with the following test line of miscellaneous characters of v= arying widths: ("Google =E3=81=AE click-tracking =E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E3= =83=AA=E3=83=B3=E3=82=AF=E3=81=AE url =E3=81=8B=E3=82=89=E5=8F=96=E3=82=8A= =E9=99=A4=E3=81=8D=E3=81=BE=E3=81=99") ("Google =E6=A4=9C=E7=B4=A2=E7=B5=90= =E6=9E=9C=E3=81=AE=E3=83=86=E3=83=BC=E3=83=96=E3=83=AB=E3=82=92=E7=B8=A6=E6= =96=B9=E5=90=91=E3=81=A7=E6=8F=83=E3=81=88=E3=81=A6=E5=B9=85=E3=82=92=E7=8B= =AD=E3=82=81=E3=81=BE=E3=81=99") ("=E3=81=99=E3=81=B9=E3=81=A6=E3=81=AE=E3= =83=9A=E3=83=BC=E3=82=B8=E3=81=AB w3m =E3=81=8C=E6=89=B1=E3=81=88=E3=82=8B= name =E3=82=A2=E3=83=B3=E3=82=AB=E3=83=BC=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81= =97=E3=81=BE=E3=81=99") ("http://*.hp.infoseek.co.jp/* =E3=81=A7=E5=BA=83= =E5=91=8A=E3=82=92=E5=8F=96=E3=82=8A=E9=99=A4=E3=81=8D=E3=81=BE=E3=81=99"= ) ("http://linux.ascii24.com/linux/* =E3=81=A7=E5=BA=83=E5=91=8A=E3=82=92= =E5=8F=96=E3=82=8A=E9=99=A4=E3=81=8D=E3=81=BE=E3=81=99") ("=E3=83=9F=E3=82= =AF=E3=82=B7=E3=82=A3=E7=94=A8=E3=83=95=E3=82=A3=E3=83=AB=E3=82=BF") ("=E6= =9C=9D=E6=97=A5=E6=96=B0=E8=81=9E=E7=94=A8=E3=83=95=E3=82=A3=E3=83=AB=E3=82= =BF") ("=E3=81=99=E3=81=B9=E3=81=A6=E3=81=AE=E3=83=9A=E3=83=BC=E3=82=B8=E3= =81=A7=E3=82=A4=E3=83=B3=E3=83=A9=E3=82=A4=E3=83=B3=E3=83=95=E3=83=AC=E3=83= =BC=E3=83=A0=E3=82=92=E5=8F=96=E3=82=8A=E9=99=A4=E3=81=8D=E3=81=BE=E3=81=99= ") /* **********************************************************************= ***** */ /* MULTIPLE CURSORS */ if (new_x > it->first_visible_x) { /* If we have reached the visible portion of the screen line, produce the line number if needed. */ if (line_number_pending) { int saved_x =3D it->current_x; Lisp_Object character =3D Fchar_to_string (make_number (it->c))= ; line_number_pending =3D false; it->current_x =3D it->first_visible_x; maybe_produce_line_number (it); if (saved_x + it->lnum_pixel_width =3D=3D it->current_x + new_x - it->first_visible_x) fprintf (stderr, "\nfirst_x (%d) | current_x (%d) of (%s)\n", saved_x - it->pixel_width, saved_x - it->pixel_width + it->lnum_pixel_w= idth, ((!NILP (character) && it->c =3D=3D 9) ? "\\t" : (!NILP (character) && it->c =3D=3D 10) ? "\\n" : (!NILP (character) && it->c !=3D 9 && it->c !=3D 10) ? SSDATA (character) : "?")); it->current_x +=3D new_x - it->first_visible_x; } /* Glyph is visible. Increment number of glyphs that would be displayed. */ ++it->hpos; } /* **********************************************************************= ***** */