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: Mon, 04 Dec 2017 00:03:10 -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 1512374617 22018 195.159.176.226 (4 Dec 2017 08:03:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 4 Dec 2017 08:03:37 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 04 09:03:29 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 1eLlik-000517-TB for ged-emacs-devel@m.gmane.org; Mon, 04 Dec 2017 09:03:23 +0100 Original-Received: from localhost ([::1]:41637 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLlis-0002Hx-8B for ged-emacs-devel@m.gmane.org; Mon, 04 Dec 2017 03:03:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLlii-0002HU-7u for emacs-devel@gnu.org; Mon, 04 Dec 2017 03:03:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eLlie-0006RL-83 for emacs-devel@gnu.org; Mon, 04 Dec 2017 03:03:20 -0500 Original-Received: from gateway33.websitewelcome.com ([192.185.146.68]:12143) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eLlid-0006QN-V2 for emacs-devel@gnu.org; Mon, 04 Dec 2017 03:03:16 -0500 Original-Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 796B33550EC for ; Mon, 4 Dec 2017 02:03:12 -0600 (CST) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id LliaeO5aEBUMKLliaecK13; Mon, 04 Dec 2017 02:03:12 -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=d5ynqAHP9tb+dIFD/IlH+PfmjdrH1wjbzOF4Dgekrbw=; b=A2/U22NqAe0ukg7ePqsyWk7i3h H/qcROsdqCLzhu60zgCE8oSy0c+oVmsE4XJ6NBMpOrCeB7sGDuc2Qd2B9ZHZ8BXWxYQN///0u+uZN MdX+Zw6gokmeih7+TWOmPsVZ2nQcL7HFyu2cmYXiK+5mfOgbNOLi7HTSZ5nnfM1L9nTHXaTH7Ai/G CTeWxMts5s+pK++fMlHNMIoT160XgapCGpq+7tnPkVeaohtIiJ8xYYN/zEl3yFd2BRhx4RgJuhIQh Zvx3O9dosBxjR6xp2NiYSSnoH1FFB0eJdqRGYOhMxMEkvbo3q/NWcbMyYkP7t5tHhxCWhbc/7UlWH P+H8N4xA==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:56760 helo=server.private) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.89) (envelope-from ) id 1eLliZ-000hNF-Ja; Mon, 04 Dec 2017 02:03:11 -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: 1eLliZ-000hNF-Ja 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]:56760 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.146.68 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:220681 Archived-At: I could use a little help, please, to perform the same test that you did.= I built Emacs 26 tonight _without_ any modifications for both OSX and W= indows. I launched Emacs 26 on both platforms with no user configuration= using gdb. From gdb, I set a breakpoint as follows: break xdisp.c:22746 I created a long word-wrapped line with a single space at the right windo= w edge, followed by a continued line with three (3) xxx, followed by a ta= b, followed by hello-world. I evaluated the following code (using setq i= nstead of set for the tab-width): (setq buffer-display-table (make-display-table)) (aset buffer-display-table ?\t (vector (make-glyph-code ?\u00BB 'font-lock-warning-face) (make-glyph-code ?\t 'fringe))) (setq word-wrap t) (setq tab-width 2) (setq visual-order-cursor-movement t) I placed by my cursor on the 00BB character (aka =C2=BB), and I typed M-x= right-char. On both platforms, IT is on the second "x" from the far left of the windo= w edge. In other words, I appear to be moving in the wrong direction and= when I go to print the it.*** info in gdb, I am clearly on the second "x= " -- i.e., I am one character to the _left_ of =C2=BB. Thanks, Keith ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DATE: [12-03-2017 06:29:57] <03 Dec 2017 16:29:57 +0200> FROM: Eli Zaretskii >=20 > * * * >=20 > The above snippet leaves a lot undefined, so I simulated that as > follows: >=20 > (setq buffer-display-table (make-display-table)) > (aset buffer-display-table > ?\t > (vector (make-glyph-code ?\u00BB 'font-lock-warning-face) > (make-glyph-code ?\t 'fringe))) > (setq word-wrap t) > (set tab-width 2) >=20 > Then I inserted a long line as you described, arranging for its second > screen line to start with "xxx" followed by a TAB. >=20 > Then I emulated your calls to move_it_in_display_line_to by setting > visual-order-cursor-movement to t, putting the cursor on the 0xBB > character which depicts the TAB, and typing "M-x right-char RET". > If I set a breakpoint in xdisp.c:22746, which is here: >=20 > else if (it.current_x !=3D target_x) > move_it_in_display_line_to (&it, ZV, target_x, MOVE_TO_POS | MOVE_TO_X= ); >=20 > I see that this call returns with it.current on the stretch glyph > following the 0xBB character, and with it.pixel_width set correctly to > the width of the stretch glyph. >=20 > So I think either you call move_it_in_display_line_to in some way that > is different from the above, or there's something else you didn't tell > in your recipe.