* Strange code in find-composition-internal
@ 2010-04-24 16:13 Eli Zaretskii
2010-04-26 12:09 ` Kenichi Handa
0 siblings, 1 reply; 2+ messages in thread
From: Eli Zaretskii @ 2010-04-24 16:13 UTC (permalink / raw)
To: Kenichi Handa; +Cc: emacs-devel
This is a fragment from find-composition-internal that attempts to
find a composition, either static (i.e. defined by a `composition'
text property) or automatic, near the position POS:
if (!find_composition (from, to, &start, &end, &prop, string))
{
if (!NILP (current_buffer->enable_multibyte_characters)
&& ! NILP (Vauto_composition_mode)
&& find_automatic_composition (from, to, &start, &end, &gstring,
string))
return list3 (make_number (start), make_number (end), gstring);
return Qnil;
}
if ((end <= XINT (pos) || start > XINT (pos)))
{
EMACS_INT s, e;
if (find_automatic_composition (from, to, &s, &e, &gstring, string)
&& (e <= XINT (pos) ? e > end : s < start))
return list3 (make_number (start), make_number (end), gstring);
}
The doc string of find-composition says, among other things:
When Automatic Compostion mode is on, this function also finds a
chunk of text that is automatically composed. If such a chunk is
found closer to POS than the position that has `composition'
property, the value is a list of FROM, TO, and a glyph gstring
the specify how the chunk is composed.
But the code fragment above seems to return `start' and `end' from the
static composition even if find_automatic_composition finds an
automatic composition that is closer to POS, which is contrary to the
doc.
Shouldn't the last line be
return list3 (make_number (s), make_number (e), gstring);
? Or am I missing something?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Strange code in find-composition-internal
2010-04-24 16:13 Strange code in find-composition-internal Eli Zaretskii
@ 2010-04-26 12:09 ` Kenichi Handa
0 siblings, 0 replies; 2+ messages in thread
From: Kenichi Handa @ 2010-04-26 12:09 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
In article <838w8c25hz.fsf@gnu.org>, Eli Zaretskii <eliz@gnu.org> writes:
> This is a fragment from find-composition-internal that attempts to
> find a composition, either static (i.e. defined by a `composition'
> text property) or automatic, near the position POS:
> if (!find_composition (from, to, &start, &end, &prop, string))
> {
> if (!NILP (current_buffer->enable_multibyte_characters)
> && ! NILP (Vauto_composition_mode)
> && find_automatic_composition (from, to, &start, &end, &gstring,
> string))
> return list3 (make_number (start), make_number (end), gstring);
> return Qnil;
> }
> if ((end <= XINT (pos) || start > XINT (pos)))
> {
> EMACS_INT s, e;
> if (find_automatic_composition (from, to, &s, &e, &gstring, string)
> && (e <= XINT (pos) ? e > end : s < start))
> return list3 (make_number (start), make_number (end), gstring);
> }
[...]
> Shouldn't the last line be
> return list3 (make_number (s), make_number (e), gstring);
You are right. I've just committed a fix for the trunk.
---
Kenichi Handa
handa@m17n.org
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-04-26 12:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-24 16:13 Strange code in find-composition-internal Eli Zaretskii
2010-04-26 12:09 ` Kenichi Handa
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.