From: Keith David Bershatsky <esq@lawlist.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Problems with move_it_in_display_line_to X when tabs exist.
Date: Mon, 04 Dec 2017 00:03:10 -0800 [thread overview]
Message-ID: <m2y3migbsx.wl%esq@lawlist.com> (raw)
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 Windows. 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 window edge, followed by a continued line with three (3) xxx, followed by a tab, followed by hello-world. I evaluated the following code (using setq instead 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 »), and I typed M-x right-char.
On both platforms, IT is on the second "x" from the far left of the window 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 ».
Thanks,
Keith
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
DATE: [12-03-2017 06:29:57] <03 Dec 2017 16:29:57 +0200>
FROM: Eli Zaretskii <eliz@gnu.org>
>
> * * *
>
> The above snippet leaves a lot undefined, so I simulated that as
> follows:
>
> (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)
>
> Then I inserted a long line as you described, arranging for its second
> screen line to start with "xxx" followed by a TAB.
>
> 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:
>
> else if (it.current_x != target_x)
> move_it_in_display_line_to (&it, ZV, target_x, MOVE_TO_POS | MOVE_TO_X);
>
> 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.
>
> 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.
next reply other threads:[~2017-12-04 8:03 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-04 8:03 Keith David Bershatsky [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-01-23 7:38 Problems with move_it_in_display_line_to X when tabs exist Keith David Bershatsky
2018-01-21 20:32 Keith David Bershatsky
2018-01-16 17:53 Keith David Bershatsky
2018-01-16 4:41 Keith David Bershatsky
2018-01-16 17:00 ` Eli Zaretskii
2018-01-15 5:48 Keith David Bershatsky
2018-01-15 12:06 ` Eli Zaretskii
2017-12-06 16:24 Keith David Bershatsky
2017-12-04 3:01 Keith David Bershatsky
2017-12-04 16:26 ` Eli Zaretskii
2017-12-03 20:56 Keith David Bershatsky
2017-12-04 15:48 ` Eli Zaretskii
2017-12-03 3:38 Keith David Bershatsky
2017-12-03 14:29 ` Eli Zaretskii
2017-12-02 22:28 Keith David Bershatsky
2017-12-03 3:32 ` Eli Zaretskii
2017-12-02 19:52 Keith David Bershatsky
2017-12-02 21:14 ` Eli Zaretskii
2017-11-30 4:29 Keith David Bershatsky
2017-11-29 6:12 Keith David Bershatsky
2017-11-29 18:04 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2y3migbsx.wl%esq@lawlist.com \
--to=esq@lawlist.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).