#include <config.h>
-#define COMPOSITE_INLINE EXTERN_INLINE
-
#include "lisp.h"
#include "character.h"
#include "buffer.h"
auto-compositions. */
#define MAX_AUTO_COMPOSITION_LOOKBACK 3
-/* Temporary variable used in macros COMPOSITION_XXX. */
-Lisp_Object composition_temp;
-
-\f
/* Return COMPOSITION-ID of a composition at buffer position
CHARPOS/BYTEPOS and length NCHARS. The `composition' property of
the sequence is PROP. STRING, if non-nil, is a string that
valid too. */
if (from > BEGV
&& find_composition (from - 1, -1, &start, &end, &prop, Qnil)
- && !COMPOSITION_VALID_P (start, end, prop))
+ && !composition_valid_p (start, end, prop))
from = start;
if (to < ZV
&& find_composition (to, -1, &start, &end, &prop, Qnil)
- && !COMPOSITION_VALID_P (start, end, prop))
+ && !composition_valid_p (start, end, prop))
to = end;
if (!NILP (Ffboundp (func)))
call2 (func, make_number (from), make_number (to));
latter to the copy of it. */
if (from > BEGV
&& find_composition (from - 1, -1, &start, &end, &prop, Qnil)
- && COMPOSITION_VALID_P (start, end, prop))
+ && composition_valid_p (start, end, prop))
{
min_pos = start;
if (end > to)
}
else if (from < ZV
&& find_composition (from, -1, &start, &from, &prop, Qnil)
- && COMPOSITION_VALID_P (start, from, prop))
+ && composition_valid_p (start, from, prop))
{
if (from > to)
max_pos = from;
(to - 1). */
while (from < to - 1
&& find_composition (from, to, &start, &from, &prop, Qnil)
- && COMPOSITION_VALID_P (start, from, prop)
+ && composition_valid_p (start, from, prop)
&& from < to - 1)
run_composition_function (start, from, prop);
}
{
if (from < to
&& find_composition (to - 1, -1, &start, &end, &prop, Qnil)
- && COMPOSITION_VALID_P (start, end, prop))
+ && composition_valid_p (start, end, prop))
{
/* TO should be also at composition boundary. But,
insertion or deletion will make two compositions adjacent
}
else if (to < ZV
&& find_composition (to, -1, &start, &end, &prop, Qnil)
- && COMPOSITION_VALID_P (start, end, prop))
+ && composition_valid_p (start, end, prop))
{
run_composition_function (start, end, prop);
max_pos = end;
specbind (Qinhibit_point_motion_hooks, Qt);
Fremove_list_of_text_properties (make_number (min_pos),
make_number (max_pos),
- Fcons (Qauto_composed, Qnil), Qnil);
+ list1 (Qauto_composed), Qnil);
unbind_to (count, Qnil);
}
}
len = j;
}
- lint_assume (len <= TYPE_MAXIMUM (ptrdiff_t) - 2);
copy = Fmake_vector (make_number (len + 2), Qnil);
LGSTRING_SET_HEADER (copy, Fcopy_sequence (header));
for (i = 0; i < len; i++)
Lisp_Object string)
{
ptrdiff_t count = SPECPDL_INDEX ();
- FRAME_PTR f = XFRAME (win->frame);
+ struct frame *f = XFRAME (win->frame);
Lisp_Object pos = make_number (charpos);
ptrdiff_t to;
ptrdiff_t pt = PT, pt_byte = PT_BYTE;
if (charpos < endpos
&& find_composition (charpos, endpos, &start, &end, &prop, string)
&& start >= charpos
- && COMPOSITION_VALID_P (start, end, prop))
+ && composition_valid_p (start, end, prop))
{
cmp_it->stop_pos = endpos = start;
cmp_it->ch = -1;
/* Check if the character at CHARPOS (and BYTEPOS) is composed
(possibly with the following characters) on window W. ENDPOS limits
- characters to be composed. FACE, in non-NULL, is a base face of
+ characters to be composed. FACE, if non-NULL, is a base face of
the character. If STRING is not nil, it is a string containing the
character to check, and CHARPOS and BYTEPOS are indices in the
string. In that case, FACE must not be NULL.
/* At first check the static composition. */
if (get_property_and_range (new_pt, Qcomposition, &val, &beg, &end, Qnil)
- && COMPOSITION_VALID_P (beg, end, val))
+ && composition_valid_p (beg, end, val))
{
if (beg < new_pt /* && end > new_pt <- It's always the case. */
&& (last_pt <= beg || last_pt >= end))
&& (e <= XINT (pos) ? e > end : s < start))
return list3 (make_number (s), make_number (e), gstring);
}
- if (!COMPOSITION_VALID_P (start, end, prop))
- return Fcons (make_number (start), Fcons (make_number (end),
- Fcons (Qnil, Qnil)));
+ if (!composition_valid_p (start, end, prop))
+ return list3 (make_number (start), make_number (end), Qnil);
if (NILP (detail_p))
- return Fcons (make_number (start), Fcons (make_number (end),
- Fcons (Qt, Qnil)));
+ return list3 (make_number (start), make_number (end), Qt);
- if (COMPOSITION_REGISTERD_P (prop))
+ if (composition_registered_p (prop))
id = COMPOSITION_ID (prop);
else
{
if (id >= 0)
{
Lisp_Object components, relative_p, mod_func;
- enum composition_method method = COMPOSITION_METHOD (prop);
+ enum composition_method method = composition_method (prop);
int width = composition_table[id]->width;
components = Fcopy_sequence (COMPOSITION_COMPONENTS (prop));
relative_p = (method == COMPOSITION_WITH_RULE_ALTCHARS
? Qnil : Qt);
mod_func = COMPOSITION_MODIFICATION_FUNC (prop);
- tail = Fcons (components,
- Fcons (relative_p,
- Fcons (mod_func,
- Fcons (make_number (width), Qnil))));
+ tail = list4 (components, relative_p, mod_func, make_number (width));
}
else
tail = Qnil;