# HG changeset patch # User Kenichi Handa # Date 1219132012 0 # Node ID ec399baa25dda0a1ea5d42482bdc2552365bb1a5 # Parent d88727c5f6c87b1af23375ff7df3fdf696fe8ce7 (Vfont_log_deferred): New variable. (font_add_log): Check Vfont_log_deferred. (font_deferred_log): New funciton. diff -r d88727c5f6c8 -r ec399baa25dd src/font.c --- a/src/font.c Tue Aug 19 07:46:14 2008 +0000 +++ b/src/font.c Tue Aug 19 07:46:52 2008 +0000 @@ -4912,6 +4912,15 @@ static Lisp_Object Vfont_log; static int font_log_env_checked; +/* The deferred font-log data of the form [ACTION ARG RESULT]. + If ACTION is not nil, that is added to the log when font_add_log is + called next time. At that time, ACTION is set back to nil. */ +static Lisp_Object Vfont_log_deferred; + +/* Prepend the font-related logging data in Vfont_log if it is not + `t'. ACTION describes a kind of font-related action (e.g. listing, + opening), ARG is the argument for the action, and RESULT is the + result of the action. */ void font_add_log (action, arg, result) char *action; @@ -4927,6 +4936,15 @@ } if (EQ (Vfont_log, Qt)) return; + if (STRINGP (AREF (Vfont_log_deferred, 0))) + { + char *str = SDATA (AREF (Vfont_log_deferred, 0)); + + ASET (Vfont_log_deferred, 0, Qnil); + font_add_log (str, AREF (Vfont_log_deferred, 1), + AREF (Vfont_log_deferred, 2)); + } + if (FONTP (arg)) { Lisp_Object tail, elt; @@ -4983,6 +5001,20 @@ Vfont_log = Fcons (list3 (intern (action), arg, result), Vfont_log); } +/* Record a font-related logging data to be added to Vfont_log when + font_add_log is called next time. ACTION, ARG, RESULT are the same + as font_add_log. */ + +void +font_deferred_log (action, arg, result) + char *action; + Lisp_Object arg, result; +{ + ASET (Vfont_log_deferred, 0, build_string (action)); + ASET (Vfont_log_deferred, 1, arg); + ASET (Vfont_log_deferred, 2, result); +} + extern void syms_of_ftfont P_ (()); extern void syms_of_xfont P_ (()); extern void syms_of_xftfont P_ (()); @@ -5045,6 +5077,9 @@ staticpro (&scratch_font_prefer); scratch_font_prefer = Ffont_spec (0, NULL); + staticpro (&Vfont_log_deferred); + Vfont_log_deferred = Fmake_vector (make_number (3), Qnil); + #if 0 #ifdef HAVE_LIBOTF staticpro (&otf_list);