From d08189843f27927713b9949e46f500d0a6d9a492 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 19 Aug 2008 07:46:52 +0000 Subject: [PATCH] (Vfont_log_deferred): New variable. (font_add_log): Check Vfont_log_deferred. (font_deferred_log): New funciton. --- src/font.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/font.c b/src/font.c index 4258c99a52a..120d616db1d 100644 --- a/src/font.c +++ b/src/font.c @@ -4912,6 +4912,15 @@ build_style_table (entry, nelement) 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 @@ font_add_log (action, arg, result) } 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 @@ font_add_log (action, arg, result) 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 @@ syms_of_font () 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); -- 2.39.5