diff options
| author | Kenichi Handa | 2009-02-04 01:58:13 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2009-02-04 01:58:13 +0000 |
| commit | 4cb75c4b12afcc18c7ee5384e668e0be0ab656b4 (patch) | |
| tree | bacd3f9874a7eda280b9ac40386b7e3cac466e27 /src | |
| parent | cde42f0ff538180c366f0d7632c8ccd953294863 (diff) | |
| download | emacs-4cb75c4b12afcc18c7ee5384e668e0be0ab656b4.tar.gz emacs-4cb75c4b12afcc18c7ee5384e668e0be0ab656b4.zip | |
(Fchar_charset): New optional arg restriction.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 24 | ||||
| -rw-r--r-- | src/charset.c | 36 |
2 files changed, 55 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 6ccef6df766..1b59fe49771 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,27 @@ | |||
| 1 | 2009-02-04 Kenichi Handa <handa@m17n.org> | ||
| 2 | |||
| 3 | * Makefile.in (composite.o): Depends on frame.h and termhooks.h. | ||
| 4 | |||
| 5 | * charset.c (Fchar_charset): New optional arg restriction. | ||
| 6 | |||
| 7 | * coding.h (coding_system_charset_list): Extern it. | ||
| 8 | |||
| 9 | * coding.c (coding_system_charset_list): New function. | ||
| 10 | |||
| 11 | * composite.c: Include coding.h and termhooks.h. | ||
| 12 | (composition_gstring_p): Fix for the terminal case. | ||
| 13 | (composition_gstring_width): Likewise. | ||
| 14 | (fill_gstring_body): Likewise. | ||
| 15 | (autocmp_chars): For terminal, call Fcomposition_get_gstring with | ||
| 16 | the frame. | ||
| 17 | (composition_compute_stop_pos): Adjust cmp_it->stop_pos if point | ||
| 18 | is within a composition. | ||
| 19 | (Fcomposition_get_gstring): Fix the the terminal case. | ||
| 20 | |||
| 21 | * term.c (encode_terminal_code): Fix handling of composition. | ||
| 22 | (produce_composite_glyph): For static composition, get pixel_width | ||
| 23 | from struct composition. | ||
| 24 | |||
| 1 | 2009-02-02 Andreas Schwab <schwab@suse.de> | 25 | 2009-02-02 Andreas Schwab <schwab@suse.de> |
| 2 | 26 | ||
| 3 | * unexelf.c (unexec): Handle unaligned bss offset. | 27 | * 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. */) | |||
| 2098 | } | 2098 | } |
| 2099 | 2099 | ||
| 2100 | 2100 | ||
| 2101 | DEFUN ("char-charset", Fchar_charset, Schar_charset, 1, 1, 0, | 2101 | DEFUN ("char-charset", Fchar_charset, Schar_charset, 1, 2, 0, |
| 2102 | doc: /* Return the charset of highest priority that contains CH. */) | 2102 | doc: /* Return the charset of highest priority that contains CH. |
| 2103 | (ch) | 2103 | If optional 2nd arg RESTRICTION is non-nil, it is a list of charsets |
| 2104 | Lisp_Object ch; | 2104 | from which to find the charset. It may also be a coding system. In |
| 2105 | that case, find the charset from what supported by that coding system. */) | ||
| 2106 | (ch, restriction) | ||
| 2107 | Lisp_Object ch, restriction; | ||
| 2105 | { | 2108 | { |
| 2106 | struct charset *charset; | 2109 | struct charset *charset; |
| 2107 | 2110 | ||
| 2108 | CHECK_CHARACTER (ch); | 2111 | CHECK_CHARACTER (ch); |
| 2109 | charset = CHAR_CHARSET (XINT (ch)); | 2112 | if (NILP (restriction)) |
| 2113 | charset = CHAR_CHARSET (XINT (ch)); | ||
| 2114 | else | ||
| 2115 | { | ||
| 2116 | Lisp_Object charset_list; | ||
| 2117 | |||
| 2118 | if (CONSP (restriction)) | ||
| 2119 | { | ||
| 2120 | for (charset_list = Qnil; CONSP (restriction); | ||
| 2121 | restriction = XCDR (restriction)) | ||
| 2122 | { | ||
| 2123 | int id; | ||
| 2124 | |||
| 2125 | CHECK_CHARSET_GET_ID (XCAR (restriction), id); | ||
| 2126 | charset_list = Fcons (make_number (id), charset_list); | ||
| 2127 | } | ||
| 2128 | charset_list = Fnreverse (charset_list); | ||
| 2129 | } | ||
| 2130 | else | ||
| 2131 | charset_list = coding_system_charset_list (restriction); | ||
| 2132 | charset = char_charset (XINT (ch), charset_list, NULL); | ||
| 2133 | if (! charset) | ||
| 2134 | return Qnil; | ||
| 2135 | } | ||
| 2110 | return (CHARSET_NAME (charset)); | 2136 | return (CHARSET_NAME (charset)); |
| 2111 | } | 2137 | } |
| 2112 | 2138 | ||