comparison src/coding.c @ 18002:a14261786239

(encode_invocation_designation): Use macro CODING_SPEC_ISO_NO_REQUESTED_DESIGNATION. (encode_designation_at_bol, setup_coding_system): Likewise. Fset_terminal_coding_system_internal): Renamed from Fset_terminal_coding_system. Make it non-interactive. Do not call Fredraw_display (). (Fset_keyboard_coding_system_internal): Renamed from Fset_keyboard_coding_system. Make it non-interactive.
author Kenichi Handa <handa@m17n.org>
date Wed, 28 May 1997 04:36:27 +0000
parents f36ffb6f1208
children 5f4c4da24e75
comparison
equal deleted inserted replaced
18001:9846609c4fd5 18002:a14261786239
1216 if (reg >= 4) 1216 if (reg >= 4)
1217 { 1217 {
1218 /* CHARSET is not yet designated to any graphic registers. */ 1218 /* CHARSET is not yet designated to any graphic registers. */
1219 /* At first check the requested designation. */ 1219 /* At first check the requested designation. */
1220 reg = CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset); 1220 reg = CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset);
1221 if (reg < 0) 1221 if (reg == CODING_SPEC_ISO_NO_REQUESTED_DESIGNATION)
1222 /* Since CHARSET requests no special designation, designate to 1222 /* Since CHARSET requests no special designation, designate it
1223 graphic register 0. */ 1223 to graphic register 0. */
1224 reg = 0; 1224 reg = 0;
1225 1225
1226 ENCODE_DESIGNATION (charset, reg, coding); 1226 ENCODE_DESIGNATION (charset, reg, coding);
1227 } 1227 }
1228 1228
1327 if ((c_alt = unify_char (table, -1, charset, c1, c2)) >= 0) 1327 if ((c_alt = unify_char (table, -1, charset, c1, c2)) >= 0)
1328 charset = CHAR_CHARSET (c_alt); 1328 charset = CHAR_CHARSET (c_alt);
1329 } 1329 }
1330 1330
1331 reg = CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset); 1331 reg = CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset);
1332 if (r[reg] < 0) 1332 if (r[reg] == CODING_SPEC_ISO_NO_REQUESTED_DESIGNATION)
1333 { 1333 {
1334 found++; 1334 found++;
1335 r[reg] = charset; 1335 r[reg] = charset;
1336 } 1336 }
1337 1337
2191 element (if integer) to REG initially, the remaining 2191 element (if integer) to REG initially, the remaining
2192 elements (if integer) is designated to REG on request, 2192 elements (if integer) is designated to REG on request,
2193 if an element is t, REG can be used by any charset, 2193 if an element is t, REG can be used by any charset,
2194 nil: REG is never used. */ 2194 nil: REG is never used. */
2195 for (charset = 0; charset <= MAX_CHARSET; charset++) 2195 for (charset = 0; charset <= MAX_CHARSET; charset++)
2196 CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset) = -1; 2196 CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset)
2197 = CODING_SPEC_ISO_NO_REQUESTED_DESIGNATION;
2197 for (i = 0; i < 4; i++) 2198 for (i = 0; i < 4; i++)
2198 { 2199 {
2199 if (INTEGERP (flags[i]) 2200 if (INTEGERP (flags[i])
2200 && (charset = XINT (flags[i]), CHARSET_VALID_P (charset)) 2201 && (charset = XINT (flags[i]), CHARSET_VALID_P (charset))
2201 || (charset = get_charset_id (flags[i])) >= 0) 2202 || (charset = get_charset_id (flags[i])) >= 0)
2253 default_reg_bits &= 3; 2254 default_reg_bits &= 3;
2254 } 2255 }
2255 2256
2256 for (charset = 0; charset <= MAX_CHARSET; charset++) 2257 for (charset = 0; charset <= MAX_CHARSET; charset++)
2257 if (CHARSET_VALID_P (charset) 2258 if (CHARSET_VALID_P (charset)
2258 && CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset) < 0) 2259 && (CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset)
2260 == CODING_SPEC_ISO_NO_REQUESTED_DESIGNATION))
2259 { 2261 {
2260 /* We have not yet decided where to designate CHARSET. */ 2262 /* We have not yet decided where to designate CHARSET. */
2261 int reg_bits = default_reg_bits; 2263 int reg_bits = default_reg_bits;
2262 2264
2263 if (CHARSET_CHARS (charset) == 96) 2265 if (CHARSET_CHARS (charset) == 96)
3332 else 3334 else
3333 XSETFASTINT (val, 0); 3335 XSETFASTINT (val, 0);
3334 return val; 3336 return val;
3335 } 3337 }
3336 3338
3337 DEFUN ("set-terminal-coding-system", 3339 DEFUN ("set-terminal-coding-system-internal",
3338 Fset_terminal_coding_system, Sset_terminal_coding_system, 1, 1, 3340 Fset_terminal_coding_system_internal,
3339 "zCoding-system for terminal display: ", 3341 Sset_terminal_coding_system_internal, 1, 1, 0, "")
3340 "Set coding-system of your terminal to CODING-SYSTEM.\n\
3341 All outputs to terminal are encoded to this coding-system.")
3342 (coding_system) 3342 (coding_system)
3343 Lisp_Object coding_system; 3343 Lisp_Object coding_system;
3344 { 3344 {
3345 CHECK_SYMBOL (coding_system, 0); 3345 CHECK_SYMBOL (coding_system, 0);
3346 setup_coding_system (Fcheck_coding_system (coding_system), &terminal_coding); 3346 setup_coding_system (Fcheck_coding_system (coding_system), &terminal_coding);
3347 update_mode_lines++;
3348 if (!NILP (Finteractive_p ()))
3349 Fredraw_display ();
3350 return Qnil; 3347 return Qnil;
3351 } 3348 }
3352 3349
3353 DEFUN ("terminal-coding-system", 3350 DEFUN ("terminal-coding-system",
3354 Fterminal_coding_system, Sterminal_coding_system, 0, 0, 0, 3351 Fterminal_coding_system, Sterminal_coding_system, 0, 0, 0,
3356 () 3353 ()
3357 { 3354 {
3358 return terminal_coding.symbol; 3355 return terminal_coding.symbol;
3359 } 3356 }
3360 3357
3361 DEFUN ("set-keyboard-coding-system", 3358 DEFUN ("set-keyboard-coding-system-internal",
3362 Fset_keyboard_coding_system, Sset_keyboard_coding_system, 1, 1, 0, 3359 Fset_keyboard_coding_system_internal,
3363 "Set coding-system of codes sent from terminal keyboard to CODING-SYSTEM.\n\ 3360 Sset_keyboard_coding_system_internal, 1, 1, 0, "")
3364 In Encoded-kbd minor mode, user inputs are decoded\n\
3365 accoding to CODING-SYSTEM.\n\
3366 Do not call this function directly, but use the command\n\
3367 encoded-kbd-set-coding-system to activate Encoded-kbd mode\n\
3368 with a specific coding system.")
3369 (coding_system) 3361 (coding_system)
3370 Lisp_Object coding_system; 3362 Lisp_Object coding_system;
3371 { 3363 {
3372 CHECK_SYMBOL (coding_system, 0); 3364 CHECK_SYMBOL (coding_system, 0);
3373 setup_coding_system (Fcheck_coding_system (coding_system), &keyboard_coding); 3365 setup_coding_system (Fcheck_coding_system (coding_system), &keyboard_coding);
3592 defsubr (&Sencode_coding_string); 3584 defsubr (&Sencode_coding_string);
3593 defsubr (&Sdecode_sjis_char); 3585 defsubr (&Sdecode_sjis_char);
3594 defsubr (&Sencode_sjis_char); 3586 defsubr (&Sencode_sjis_char);
3595 defsubr (&Sdecode_big5_char); 3587 defsubr (&Sdecode_big5_char);
3596 defsubr (&Sencode_big5_char); 3588 defsubr (&Sencode_big5_char);
3597 defsubr (&Sset_terminal_coding_system); 3589 defsubr (&Sset_terminal_coding_system_internal);
3598 defsubr (&Sterminal_coding_system); 3590 defsubr (&Sterminal_coding_system);
3599 defsubr (&Sset_keyboard_coding_system); 3591 defsubr (&Sset_keyboard_coding_system_internal);
3600 defsubr (&Skeyboard_coding_system); 3592 defsubr (&Skeyboard_coding_system);
3601 defsubr (&Sfind_coding_system); 3593 defsubr (&Sfind_coding_system);
3602 3594
3603 DEFVAR_LISP ("coding-category-list", &Vcoding_category_list, 3595 DEFVAR_LISP ("coding-category-list", &Vcoding_category_list,
3604 "List of coding-categories (symbols) ordered by priority."); 3596 "List of coding-categories (symbols) ordered by priority.");