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.bugs Subject: bug#31716: move_it_in_display_line / horizontal scrolling / tab stretch Date: Thu, 07 Jun 2018 22:12:34 -0700 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1528434667 17155 195.159.176.226 (8 Jun 2018 05:11:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 8 Jun 2018 05:11:07 +0000 (UTC) Cc: 31716@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 08 07:11:03 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1fR9fy-0004LE-FW for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Jun 2018 07:11:03 +0200 Original-Received: from localhost ([::1]:33123 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fR9i5-0004WK-G8 for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Jun 2018 01:13:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fR9hy-0004W2-Od for bug-gnu-emacs@gnu.org; Fri, 08 Jun 2018 01:13:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fR9hu-0004DY-N2 for bug-gnu-emacs@gnu.org; Fri, 08 Jun 2018 01:13:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58940) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fR9hu-0004DC-KF for bug-gnu-emacs@gnu.org; Fri, 08 Jun 2018 01:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fR9hu-0002iV-9I for bug-gnu-emacs@gnu.org; Fri, 08 Jun 2018 01:13:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Keith David Bershatsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Jun 2018 05:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31716 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 31716-submit@debbugs.gnu.org id=B31716.152843475910412 (code B ref 31716); Fri, 08 Jun 2018 05:13:02 +0000 Original-Received: (at 31716) by debbugs.gnu.org; 8 Jun 2018 05:12:39 +0000 Original-Received: from localhost ([127.0.0.1]:38604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fR9hW-0002hs-My for submit@debbugs.gnu.org; Fri, 08 Jun 2018 01:12:38 -0400 Original-Received: from gateway33.websitewelcome.com ([192.185.146.80]:36662) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fR9hU-0002hh-65 for 31716@debbugs.gnu.org; Fri, 08 Jun 2018 01:12:36 -0400 Original-Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 91899E914 for <31716@debbugs.gnu.org>; Fri, 8 Jun 2018 00:12:35 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id R9hTfucCsBcCXR9hTfkzGu; Fri, 08 Jun 2018 00:12:35 -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-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding: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=lC9mucugpSUltnsxqj0eMXi7/a+wYMv1koilB2AvjnY=; b=DbDfgID/5ie3xrYcsD4K9t6SYQ LDebde79yzOKCZMHetQTBnr5GKILNV4zE3ihQhjoJGkQG0Bk/lqfjABv7M2kQvFyaZ6M+jGbMzRRH O4Gj9gQUZaRddDTHEGysPnlX9NXnSKKNyzfO64PTbsnPtzKEWApct7GsWSZssKIYXQWwYYpO5nby9 dTj1InJbXtmjOGaPqY9/1FTW5i8GbMfVA7HRg4lFtIZAROmehTF9cePxTuJfN+bFDn9qVa4mPF/pP CUw9gR/U0D4z18D1hf1nyhs2pfVeLOSF08kUIDyg+k9GVT7RJhdxDO3/G3FeEZaRHGiHl54dfSH3s 5N5d8HcQ==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:52601 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from ) id 1fR9hS-004NyA-Ps; Fri, 08 Jun 2018 00:12:34 -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 - debbugs.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: 1fR9hS-004NyA-Ps 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]:52601 X-Source-Auth: lawlist X-Email-Count: 1 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:147160 Archived-At: I have had an opportunity to further study your write-up regarding issue 31716, and I really appreciate the help you have given. Using the theory that the increase in current_x translates into a new display element and a corresponding increase in the HPOS once the first visible x is reached, I have come up with (what appears to be) a working method to reliably calculate RELATIVE_X and HPOS when tabs are present with horizontal scrolling. However, I am essentially incrementing font->space_width from the far left of the display elements to the end of the line in order to make all of the relevant determinations along the current line (where I am drawing multiple fake cursors to achieve the visible horizontal line for crosshairs). In a nutshell, the method I am using is somewhat akin to pgr owx in .gdbinit (in that RELATIVE_X is determined based upon the preceding element/determination). The method I am using to calculate RELATIVE_X and HPOS (when tabs are present with horizontal scrolling) is undoubtedly less efficient than using nifty general methods such as: A. RELATIVE_X = it.current_x - it.first_visible_x. B. RELATIVE_X = it.current_x - (window_hscroll_limited (w, f) * frame_char_width). C. HPOS = it.hpos. D. HPOS = t.hpos - window_hscroll_limited (w, f). More efficient ways to calculate RELATIVE_X and HPOS (when tabs are present with horizontal scrolling) can be dealt with in the future on the Emacs devel mailing list since they are not directly related to the reason that #31716 was launched. Please feel free to close out #31716 at your convenience. Thank you again for all your help. Keith