diff --git a/src/composite.c b/src/composite.c index 2eddda00b5d..e36e1670d8d 100644 --- a/src/composite.c +++ b/src/composite.c @@ -1101,6 +1101,9 @@ composition_compute_stop_pos (struct composition_it *cmp_it, ptrdiff_t charpos, /* Look for automatic compositions. */ start = charpos; + /* For the case that they set it to something weird, like nil. */ + if (!CHAR_TABLE_P (Vcomposition_function_table)) + Vcomposition_function_table = Fmake_char_table (Qnil, Qnil); if (charpos < endpos) { /* Forward search. */ @@ -1324,6 +1327,9 @@ composition_reseat_it (struct composition_it *cmp_it, ptrdiff_t charpos, Lisp_Object lgstring = Qnil; Lisp_Object val, elt, direction = Qnil; + /* For the case that they set it to something weird, like nil. */ + if (!CHAR_TABLE_P (Vcomposition_function_table)) + Vcomposition_function_table = Fmake_char_table (Qnil, Qnil); val = CHAR_TABLE_REF (Vcomposition_function_table, cmp_it->ch); for (EMACS_INT i = 0; i < cmp_it->rule_idx; i++, val = XCDR (val)) continue;