From c1083e2b4200d5643ae782a6ca4c93831fdccb03 Mon Sep 17 00:00:00 2001 From: tomo Date: Thu, 12 Feb 2004 06:25:26 +0000 Subject: [PATCH] (simplify_char_spec): Try to convert builtin chars to defined chars. --- src/fns.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/fns.c b/src/fns.c index b513f4c..156beeb 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3817,13 +3817,25 @@ Lisp_Object simplify_char_spec (Lisp_Object char_spec) { if (CHARP (char_spec)) - return char_spec; + { + Lisp_Object ccs; + int code_point = ENCODE_CHAR (XCHAR (char_spec), ccs); + + if (code_point >= 0) + { + int cid = decode_defined_char (ccs, code_point, Qnil); + + if (cid >= 0) + return make_char (cid); + } + return char_spec; + } else if (INTP (char_spec)) return Fdecode_char (Qmap_ucs, char_spec, Qnil, Qnil); else { Lisp_Object ret = Ffind_char (char_spec); - + if (CHARP (ret)) return ret; else -- 1.7.10.4