From b18fad6db4efeda274dcb36706a4146650570e6b Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 1 Nov 2010 13:09:26 +0900 Subject: Handle glyphless characters on tty. --- src/coding.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/coding.c') diff --git a/src/coding.c b/src/coding.c index 7a3bc40b9c7..59deb22a3d7 100644 --- a/src/coding.c +++ b/src/coding.c @@ -9297,7 +9297,8 @@ DEFUN ("set-terminal-coding-system-internal", Fset_terminal_coding_system_intern doc: /* Internal use only. */) (Lisp_Object coding_system, Lisp_Object terminal) { - struct coding_system *terminal_coding = TERMINAL_TERMINAL_CODING (get_terminal (terminal, 1)); + struct terminal *term = get_terminal (terminal, 1); + struct coding_system *terminal_coding = TERMINAL_TERMINAL_CODING (term); CHECK_SYMBOL (coding_system); setup_coding_system (Fcheck_coding_system (coding_system), terminal_coding); /* We had better not send unsafe characters to terminal. */ @@ -9306,6 +9307,10 @@ DEFUN ("set-terminal-coding-system-internal", Fset_terminal_coding_system_intern terminal_coding->common_flags &= ~CODING_ANNOTATE_COMPOSITION_MASK; terminal_coding->src_multibyte = 1; terminal_coding->dst_multibyte = 0; + if (terminal_coding->common_flags & CODING_REQUIRE_ENCODING_MASK) + term->charset_list = coding_charset_list (terminal_coding); + else + term->charset_list = Fcons (Qascii, Qnil); return Qnil; } -- cgit v1.3 From 448e17d69a4a8e4c16a560a04c940003eaad51f9 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Thu, 4 Nov 2010 23:37:06 +0100 Subject: Refer to set-coding-system-priority instead of the obsolete set-coding-priority in the doc string. --- src/ChangeLog | 5 +++++ src/coding.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/coding.c') diff --git a/src/ChangeLog b/src/ChangeLog index 97258cbd850..dbb95385252 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-11-04 Lars Magne Ingebrigtsen + + * Refer to set-coding-system-priority instead of the obsolete + set-coding-priority in the doc string. + 2010-11-04 Adrian Robert Ismail Donmez (tiny change) diff --git a/src/coding.c b/src/coding.c index 59deb22a3d7..b88ac1b576a 100644 --- a/src/coding.c +++ b/src/coding.c @@ -10559,7 +10559,7 @@ associated with each coding-category one by one in this order. When one algorithm agrees with a byte sequence of source text, the coding system bound to the corresponding coding-category is selected. -Don't modify this variable directly, but use `set-coding-priority'. */); +Don't modify this variable directly, but use `set-coding-system-priority'. */); { int i; -- cgit v1.3 From 6b4bb7039fa9078206e35cf071ad098a706a0988 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 17 Nov 2010 14:51:09 +0900 Subject: coding.c (Fset_terminal_coding_system_internal): Fix previous change (set charset-ID list instead of charset-symbol list). --- src/ChangeLog | 5 +++++ src/coding.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/coding.c') diff --git a/src/ChangeLog b/src/ChangeLog index 401a93bbfb3..0e76750901a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-11-17 Kenichi Handa + + * coding.c (Fset_terminal_coding_system_internal): Fix previous + change (set charset-ID list instead of charset-symbol list). + 2010-11-16 Chong Yidong * keyboard.c (make_lispy_position): For text area clicks, record Y diff --git a/src/coding.c b/src/coding.c index b88ac1b576a..c834f76a65e 100644 --- a/src/coding.c +++ b/src/coding.c @@ -9310,7 +9310,7 @@ DEFUN ("set-terminal-coding-system-internal", Fset_terminal_coding_system_intern if (terminal_coding->common_flags & CODING_REQUIRE_ENCODING_MASK) term->charset_list = coding_charset_list (terminal_coding); else - term->charset_list = Fcons (Qascii, Qnil); + term->charset_list = Fcons (make_number (charset_ascii), Qnil); return Qnil; } -- cgit v1.3 From b84ae584330c940010bc543fd925eddeb13fd9e2 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 25 Nov 2010 12:55:14 +0900 Subject: Fix decoding of emacs-mule coding system. --- src/ChangeLog | 16 ++++++++++++++++ src/charset.c | 6 +++--- src/charset.h | 4 +--- src/coding.c | 20 ++++++++++---------- src/lread.c | 8 ++++---- 5 files changed, 34 insertions(+), 20 deletions(-) (limited to 'src/coding.c') diff --git a/src/ChangeLog b/src/ChangeLog index d33f9dd4f0b..7daa09c703f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,19 @@ +2010-11-25 Kenichi Handa + + * charset.c (emacs_mule_charset): Make it an array of charset ID; + i.e. integer. + (Fdefine_charset_internal): Adjusted for the above change. + (init_charset_once): Likewise. + + * charset.h (emacs_mule_charset): Adjust the prototype. Delete + duplicated extern. + + * coding.c (emacs_mule_char): Adjust for the change of + emacs_mule_charset. + + * lread.c (read_emacs_mule_char): Adjust for the change of + emacs_mule_charset. + 2010-10-18 Ken Brown * s/cygwin.h (SIGNALS_VIA_CHARACTERS): New define (bug#7225). diff --git a/src/charset.c b/src/charset.c index 3b45dc348ed..60203d6a532 100644 --- a/src/charset.c +++ b/src/charset.c @@ -115,7 +115,7 @@ Lisp_Object Viso_2022_charset_list; /* List of emacs-mule charsets. */ Lisp_Object Vemacs_mule_charset_list; -struct charset *emacs_mule_charset[256]; +int emacs_mule_charset[256]; /* Mapping table from ISO2022's charset (specified by DIMENSION, CHARS, and FINAL-CHAR) to Emacs' charset. */ @@ -1248,7 +1248,7 @@ usage: (define-charset-internal ...) */) if (charset.emacs_mule_id >= 0) { - emacs_mule_charset[charset.emacs_mule_id] = CHARSET_FROM_ID (id); + emacs_mule_charset[charset.emacs_mule_id] = id; if (charset.emacs_mule_id < 0xA0) emacs_mule_bytes[charset.emacs_mule_id] = charset.dimension + 1; else @@ -2405,7 +2405,7 @@ init_charset_once () iso_charset_table[i][j][k] = -1; for (i = 0; i < 256; i++) - emacs_mule_charset[i] = NULL; + emacs_mule_charset[i] = -1; charset_jisx0201_roman = -1; charset_jisx0208_1978 = -1; diff --git a/src/charset.h b/src/charset.h index 718859929df..7afe6546908 100644 --- a/src/charset.h +++ b/src/charset.h @@ -255,7 +255,7 @@ extern Lisp_Object Vcharset_list; extern Lisp_Object Viso_2022_charset_list; extern Lisp_Object Vemacs_mule_charset_list; -extern struct charset *emacs_mule_charset[256]; +extern int emacs_mule_charset[256]; extern Lisp_Object Vcurrent_iso639_language; @@ -517,8 +517,6 @@ extern int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL]; #define EMACS_MULE_LEADING_CODE_PRIVATE_21 0x9C /* 2/2 */ #define EMACS_MULE_LEADING_CODE_PRIVATE_22 0x9D /* 2/2 */ -extern struct charset *emacs_mule_charset[256]; - extern Lisp_Object Qcharsetp; diff --git a/src/coding.c b/src/coding.c index 137e72a0ba4..9c989e1c39e 100644 --- a/src/coding.c +++ b/src/coding.c @@ -2078,7 +2078,7 @@ emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status) const unsigned char *src_end = coding->source + coding->src_bytes; const unsigned char *src_base = src; int multibytep = coding->src_multibyte; - struct charset *charset; + int charset_id; unsigned code; int c; int consumed_chars = 0; @@ -2088,7 +2088,7 @@ emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status) if (c < 0) { c = -c; - charset = emacs_mule_charset[0]; + charset_id = emacs_mule_charset[0]; } else { @@ -2124,7 +2124,7 @@ emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status) switch (emacs_mule_bytes[c]) { case 2: - if (! (charset = emacs_mule_charset[c])) + if ((charset_id = emacs_mule_charset[c]) < 0) goto invalid_code; ONE_MORE_BYTE (c); if (c < 0xA0) @@ -2137,7 +2137,7 @@ emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status) || c == EMACS_MULE_LEADING_CODE_PRIVATE_12) { ONE_MORE_BYTE (c); - if (c < 0xA0 || ! (charset = emacs_mule_charset[c])) + if (c < 0xA0 || (charset_id = emacs_mule_charset[c]) < 0) goto invalid_code; ONE_MORE_BYTE (c); if (c < 0xA0) @@ -2146,7 +2146,7 @@ emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status) } else { - if (! (charset = emacs_mule_charset[c])) + if ((charset_id = emacs_mule_charset[c]) < 0) goto invalid_code; ONE_MORE_BYTE (c); if (c < 0xA0) @@ -2161,7 +2161,7 @@ emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status) case 4: ONE_MORE_BYTE (c); - if (c < 0 || ! (charset = emacs_mule_charset[c])) + if (c < 0 || (charset_id = emacs_mule_charset[c]) < 0) goto invalid_code; ONE_MORE_BYTE (c); if (c < 0xA0) @@ -2175,21 +2175,21 @@ emacs_mule_char (coding, src, nbytes, nchars, id, cmp_status) case 1: code = c; - charset = CHARSET_FROM_ID (ASCII_BYTE_P (code) - ? charset_ascii : charset_eight_bit); + charset_id = ASCII_BYTE_P (code) ? charset_ascii : charset_eight_bit; break; default: abort (); } - CODING_DECODE_CHAR (coding, src, src_base, src_end, charset, code, c); + CODING_DECODE_CHAR (coding, src, src_base, src_end, + CHARSET_FROM_ID (charset_id), code, c); if (c < 0) goto invalid_code; } *nbytes = src - src_base; *nchars = consumed_chars; if (id) - *id = charset->id; + *id = charset_id; return (mseq_found ? -c : c); no_more_source: diff --git a/src/lread.c b/src/lread.c index c96e391a2d3..13de4d01317 100644 --- a/src/lread.c +++ b/src/lread.c @@ -616,7 +616,7 @@ read_emacs_mule_char (c, readbyte, readcharfun) if (len == 2) { - charset = emacs_mule_charset[buf[0]]; + charset = CHARSET_FROM_ID (emacs_mule_charset[buf[0]]); code = buf[1] & 0x7F; } else if (len == 3) @@ -624,18 +624,18 @@ read_emacs_mule_char (c, readbyte, readcharfun) if (buf[0] == EMACS_MULE_LEADING_CODE_PRIVATE_11 || buf[0] == EMACS_MULE_LEADING_CODE_PRIVATE_12) { - charset = emacs_mule_charset[buf[1]]; + charset = CHARSET_FROM_ID (emacs_mule_charset[buf[1]]); code = buf[2] & 0x7F; } else { - charset = emacs_mule_charset[buf[0]]; + charset = CHARSET_FROM_ID (emacs_mule_charset[buf[0]]); code = ((buf[1] << 8) | buf[2]) & 0x7F7F; } } else { - charset = emacs_mule_charset[buf[1]]; + charset = CHARSET_FROM_ID (emacs_mule_charset[buf[1]]); code = ((buf[2] << 8) | buf[3]) & 0x7F7F; } c = DECODE_CHAR (charset, code); -- cgit v1.3