From: Eli Zaretskii <eliz@gnu.org>
To: joakim@verona.se
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] xwidget updated (1d8b8a2 -> 5f46725)
Date: Mon, 29 Dec 2014 18:03:36 +0200 [thread overview]
Message-ID: <83k31ajvdz.fsf@gnu.org> (raw)
In-Reply-To: <m3y4pqss6n.fsf@exodia.verona.se>
> From: joakim@verona.se
> Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
> Date: Mon, 29 Dec 2014 10:48:00 +0100
>
> I'm extatic that you found time to review it! Thanks Eli!
That's the least we could do to help you finish the job.
> > 5) xdisp.c:produce_xwidget_glyph needs to account for bidirectional
> > display in the same way produce_image_glyph does: swao the left and
> > right box edges, and populate the bidi members of struct glyph.
> I havent thought about bidi at all.
Just look at what produce_image_glyph does, it should tell you enough.
> Do you have a simple test case [for bidi]?
Type a few Arabic or Hebrew characters, then insert a widget, then
type some more Arabic or Hebrew. Try this both in a buffer that has
bidi-paragraph-direction set to nil and in a buffer that has it set to
left-to-right or right-to-left.
> > 6) Did you test what happens with xwidgets when the lines are
> > truncated, and only part of the xwidget fits on the line? Are the
> > results reasonable? I see that produce_xwidget_glyph does attempt
> > to crop the xwidget to fit in the line, but then display_line
> > should handle xwidget glyphs the same as it does with image glyphs,
> > when it decides how to go about truncation/continuation.
>
> Truncation works same as for an image, which I think is reasonable. Or
> did you mean something else?
No, this is what I meant.
> I dont understand your comment about display_line.
My comment has to deal with truncation marks, when the lines are
truncated and the widget gets truncated as result. Around line 20690
in xdisp.c (this is from master; the number could be different on your
branch), you will see this code fragment:
/* If we truncate lines, we are done when the last displayed
glyphs reach past the right margin of the window. */
if (it->line_wrap == TRUNCATE
&& ((FRAME_WINDOW_P (it->f)
/* Images are preprocessed in produce_image_glyph such
that they are cropped at the right edge of the
window, so an image glyph will always end exactly at
last_visible_x, even if there's no right fringe. */
&& ((row->reversed_p
? WINDOW_LEFT_FRINGE_WIDTH (it->w)
: WINDOW_RIGHT_FRINGE_WIDTH (it->w))
|| it->what == IT_IMAGE))
? (it->current_x >= it->last_visible_x)
: (it->current_x > it->last_visible_x)))
{
/* Maybe add truncation glyphs. */
It currently treats specially only image glyphs, for the reasons
explained in the comment. Based on your response and on what I saw in
the code, the xwidget glyphs should be handled in the same manner
there.
To see this code in action, turn on truncate-lines, disable the
fringes, and see if you get the truncation glyph when the line ends in
an xwidget (you shouldn't).
> Eli, how difficult do you suppose it would be to get a GTK3 emacs
> running on Windows?
I don't know. A Windows port of GTK3 does exist (see
http://www.gtk.org/download/win32_tutorial.php), but the GTK related
code in Emacs was never tried on Windows, so Someone(TM) will have to
get their hands dirty before it will work. I'm guessing that the
event loop will give that Someone the most grief, unless the GTK folks
already solved that.
Alternatively, Someone Else(TM) could port your xwidget code to the
corresponding Windows features, but it will take a Windows GUI expert
to do that, and I don't think we have such a person on board.
> And thanks again for the review!
You are welcome.
next prev parent reply other threads:[~2014-12-29 16:03 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20141226164113.11620.38682@vcs.savannah.gnu.org>
2014-12-27 15:22 ` [Emacs-diffs] xwidget updated (1d8b8a2 -> 5f46725) Stefan Monnier
2014-12-27 15:48 ` joakim
2014-12-28 16:08 ` Eli Zaretskii
2014-12-29 9:48 ` joakim
2014-12-29 13:46 ` Ulrich Mueller
2014-12-29 16:10 ` Eli Zaretskii
2015-01-09 20:17 ` joakim
2014-12-29 16:03 ` Eli Zaretskii [this message]
2015-01-09 20:12 ` joakim
2015-01-09 20:35 ` Eli Zaretskii
2015-01-16 20:50 ` joakim
2015-01-16 20:59 ` Eli Zaretskii
2015-01-16 21:16 ` joakim
2015-01-17 10:19 ` Eli Zaretskii
2015-01-17 15:21 ` joakim
2015-01-17 17:40 ` joakim
2015-01-17 18:04 ` Eli Zaretskii
2015-01-17 18:13 ` joakim
2015-01-17 18:39 ` Eli Zaretskii
2015-01-17 23:08 ` joakim
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83k31ajvdz.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=joakim@verona.se \
--cc=monnier@iro.umontreal.ca \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.