From: Kenichi Handa Date: Wed, 4 Feb 2009 01:58:13 +0000 (+0000) Subject: (Fchar_charset): New optional arg restriction. X-Git-Tag: emacs-pretest-23.0.91~432 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4cb75c4b12afcc18c7ee5384e668e0be0ab656b4;p=emacs.git (Fchar_charset): New optional arg restriction. --- diff --git a/src/ChangeLog b/src/ChangeLog index 6ccef6df766..1b59fe49771 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,27 @@ +2009-02-04 Kenichi Handa + + * Makefile.in (composite.o): Depends on frame.h and termhooks.h. + + * charset.c (Fchar_charset): New optional arg restriction. + + * coding.h (coding_system_charset_list): Extern it. + + * coding.c (coding_system_charset_list): New function. + + * composite.c: Include coding.h and termhooks.h. + (composition_gstring_p): Fix for the terminal case. + (composition_gstring_width): Likewise. + (fill_gstring_body): Likewise. + (autocmp_chars): For terminal, call Fcomposition_get_gstring with + the frame. + (composition_compute_stop_pos): Adjust cmp_it->stop_pos if point + is within a composition. + (Fcomposition_get_gstring): Fix the the terminal case. + + * term.c (encode_terminal_code): Fix handling of composition. + (produce_composite_glyph): For static composition, get pixel_width + from struct composition. + 2009-02-02 Andreas Schwab * unexelf.c (unexec): Handle unaligned bss offset. diff --git a/src/charset.c b/src/charset.c index b2b52870986..052f3186831 100644 --- a/src/charset.c +++ b/src/charset.c @@ -2098,15 +2098,41 @@ CH in the charset. */) } -DEFUN ("char-charset", Fchar_charset, Schar_charset, 1, 1, 0, - doc: /* Return the charset of highest priority that contains CH. */) - (ch) - Lisp_Object ch; +DEFUN ("char-charset", Fchar_charset, Schar_charset, 1, 2, 0, + doc: /* Return the charset of highest priority that contains CH. +If optional 2nd arg RESTRICTION is non-nil, it is a list of charsets +from which to find the charset. It may also be a coding system. In +that case, find the charset from what supported by that coding system. */) + (ch, restriction) + Lisp_Object ch, restriction; { struct charset *charset; CHECK_CHARACTER (ch); - charset = CHAR_CHARSET (XINT (ch)); + if (NILP (restriction)) + charset = CHAR_CHARSET (XINT (ch)); + else + { + Lisp_Object charset_list; + + if (CONSP (restriction)) + { + for (charset_list = Qnil; CONSP (restriction); + restriction = XCDR (restriction)) + { + int id; + + CHECK_CHARSET_GET_ID (XCAR (restriction), id); + charset_list = Fcons (make_number (id), charset_list); + } + charset_list = Fnreverse (charset_list); + } + else + charset_list = coding_system_charset_list (restriction); + charset = char_charset (XINT (ch), charset_list, NULL); + if (! charset) + return Qnil; + } return (CHARSET_NAME (charset)); }