unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* it->nglyphs for automatic compositions
@ 2011-08-22 17:07 Eli Zaretskii
  2011-08-23  0:35 ` Kenichi Handa
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2011-08-22 17:07 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: emacs-devel

Currently, x_produce_glyphs does not set the it->nglyphs member to
anything, so it stays at zero.  This causes pos-visible-in-window-p to
return incorrect pixel coordinates when invoked on a character that is
at column zero and is a composed character.  Note that
produce_composite_glyph, which is called only on terminal frames, does
set that field.  So I propose the following patch.  Any objections?

=== modified file 'src/xdisp.c'
--- src/xdisp.c	2011-08-22 17:00:40 +0000
+++ src/xdisp.c	2011-08-22 17:05:00 +0000
@@ -24064,6 +24064,8 @@ x_produce_glyphs (struct it *it)
       Lisp_Object gstring;
       struct font_metrics metrics;
 
+      it->nglyphs = 1;
+
       gstring = composition_gstring_from_id (it->cmp_it.id);
       it->pixel_width
 	= composition_gstring_width (gstring, it->cmp_it.from, it->cmp_it.to,




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: it->nglyphs for automatic compositions
  2011-08-22 17:07 it->nglyphs for automatic compositions Eli Zaretskii
@ 2011-08-23  0:35 ` Kenichi Handa
  2011-08-23  7:07   ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Kenichi Handa @ 2011-08-23  0:35 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

In article <83k4a5idcu.fsf@gnu.org>, Eli Zaretskii <eliz@gnu.org> writes:

> Currently, x_produce_glyphs does not set the it->nglyphs member to
> anything, so it stays at zero.  This causes pos-visible-in-window-p to
> return incorrect pixel coordinates when invoked on a character that is
> at column zero and is a composed character.  Note that
> produce_composite_glyph, which is called only on terminal frames, does
> set that field.  So I propose the following patch.

I agree with that patch.  Perhaps I just forgot to set
it->nglyphs when I added this part of the code:

  else if (it->what == IT_COMPOSITION)
    {
      /* A dynamic (automatic) composition.  */
[...]
    }

---
Kenichi Handa
handa@m17n.org



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: it->nglyphs for automatic compositions
  2011-08-23  0:35 ` Kenichi Handa
@ 2011-08-23  7:07   ` Eli Zaretskii
  0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2011-08-23  7:07 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: emacs-devel

> From: Kenichi Handa <handa@m17n.org>
> Cc: emacs-devel@gnu.org
> Date: Tue, 23 Aug 2011 09:35:59 +0900
> 
> In article <83k4a5idcu.fsf@gnu.org>, Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Currently, x_produce_glyphs does not set the it->nglyphs member to
> > anything, so it stays at zero.  This causes pos-visible-in-window-p to
> > return incorrect pixel coordinates when invoked on a character that is
> > at column zero and is a composed character.  Note that
> > produce_composite_glyph, which is called only on terminal frames, does
> > set that field.  So I propose the following patch.
> 
> I agree with that patch.  Perhaps I just forgot to set
> it->nglyphs when I added this part of the code:
> 
>   else if (it->what == IT_COMPOSITION)
>     {
>       /* A dynamic (automatic) composition.  */
> [...]
>     }

Thanks, committed.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-08-23  7:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-22 17:07 it->nglyphs for automatic compositions Eli Zaretskii
2011-08-23  0:35 ` Kenichi Handa
2011-08-23  7:07   ` Eli Zaretskii

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).