From 29fb730696760dc6d4daf6c3373cede85c9033f2 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 12 Sep 2008 05:38:37 +0000 Subject: [PATCH] (composition_reseat_it): If the current buffer is not associated with a window, ignore the automatic composition. (find_automatic_composition): Likewise. --- src/composite.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/composite.c b/src/composite.c index 92e7a1e44cb..b017721de67 100644 --- a/src/composite.c +++ b/src/composite.c @@ -1093,7 +1093,7 @@ composition_reseat_it (cmp_it, charpos, bytepos, endpos, w, face, string) cmp_it->nchars = end - start; cmp_it->nglyphs = composition_table[cmp_it->id]->glyph_len; } - else + else if (w) { Lisp_Object val, elt; int i; @@ -1119,6 +1119,8 @@ composition_reseat_it (cmp_it, charpos, bytepos, endpos, w, face, string) break; cmp_it->nglyphs = i; } + else + goto no_composition; cmp_it->from = 0; return 1; @@ -1255,8 +1257,14 @@ find_automatic_composition (pos, limit, start, end, gstring, string) Lisp_Object check_val, val, elt; int check_lookback; int c; + Lisp_Object window; struct window *w; + window = Fget_buffer_create (Fcurrent_buffer ()); + if (NILP (window)) + return 0; + w = XWINDOW (window); + orig.pos = pos; if (NILP (string)) { @@ -1279,7 +1287,6 @@ find_automatic_composition (pos, limit, start, end, gstring, string) { tail = min (tail, limit + 3); } - w = XWINDOW (selected_window); cur = orig; retry: -- 2.39.5