Mercurial > emacs
comparison src/coding.c @ 89571:242f2cc0134b
(Fdefine_coding_system_alias): Update Vcoding_system_list.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Mon, 06 Oct 2003 11:21:31 +0000 |
parents | 12fbcfebb9ad |
children | 59d10ebd2a0b |
comparison
equal
deleted
inserted
replaced
89570:c92884b9ca4a | 89571:242f2cc0134b |
---|---|
8484 return Fsignal (Qwrong_number_of_arguments, | 8484 return Fsignal (Qwrong_number_of_arguments, |
8485 Fcons (intern ("define-coding-system-internal"), | 8485 Fcons (intern ("define-coding-system-internal"), |
8486 make_number (nargs))); | 8486 make_number (nargs))); |
8487 } | 8487 } |
8488 | 8488 |
8489 /* Fixme: should this record the alias relationships for | 8489 |
8490 diagnostics? Should it update coding-system-list? */ | |
8491 DEFUN ("define-coding-system-alias", Fdefine_coding_system_alias, | 8490 DEFUN ("define-coding-system-alias", Fdefine_coding_system_alias, |
8492 Sdefine_coding_system_alias, 2, 2, 0, | 8491 Sdefine_coding_system_alias, 2, 2, 0, |
8493 doc: /* Define ALIAS as an alias for CODING-SYSTEM. */) | 8492 doc: /* Define ALIAS as an alias for CODING-SYSTEM. */) |
8494 (alias, coding_system) | 8493 (alias, coding_system) |
8495 Lisp_Object alias, coding_system; | 8494 Lisp_Object alias, coding_system; |
8497 Lisp_Object spec, aliases, eol_type; | 8496 Lisp_Object spec, aliases, eol_type; |
8498 | 8497 |
8499 CHECK_SYMBOL (alias); | 8498 CHECK_SYMBOL (alias); |
8500 CHECK_CODING_SYSTEM_GET_SPEC (coding_system, spec); | 8499 CHECK_CODING_SYSTEM_GET_SPEC (coding_system, spec); |
8501 aliases = AREF (spec, 1); | 8500 aliases = AREF (spec, 1); |
8501 /* ALISES should be a list of length more than zero, and the first | |
8502 element is a base coding system. Append ALIAS at the tail of the | |
8503 list. */ | |
8502 while (!NILP (XCDR (aliases))) | 8504 while (!NILP (XCDR (aliases))) |
8503 aliases = XCDR (aliases); | 8505 aliases = XCDR (aliases); |
8504 XSETCDR (aliases, Fcons (alias, Qnil)); | 8506 XSETCDR (aliases, Fcons (alias, Qnil)); |
8505 | 8507 |
8506 eol_type = AREF (spec, 2); | 8508 eol_type = AREF (spec, 2); |
8511 | 8513 |
8512 subsidiaries = make_subsidiaries (alias); | 8514 subsidiaries = make_subsidiaries (alias); |
8513 for (i = 0; i < 3; i++) | 8515 for (i = 0; i < 3; i++) |
8514 Fdefine_coding_system_alias (AREF (subsidiaries, i), | 8516 Fdefine_coding_system_alias (AREF (subsidiaries, i), |
8515 AREF (eol_type, i)); | 8517 AREF (eol_type, i)); |
8516 | |
8517 ASET (spec, 2, subsidiaries); | |
8518 } | 8518 } |
8519 | 8519 |
8520 Fputhash (alias, spec, Vcoding_system_hash_table); | 8520 Fputhash (alias, spec, Vcoding_system_hash_table); |
8521 Vcoding_system_list = Fcons (alias, Vcoding_system_list); | |
8521 Vcoding_system_alist = Fcons (Fcons (Fsymbol_name (alias), Qnil), | 8522 Vcoding_system_alist = Fcons (Fcons (Fsymbol_name (alias), Qnil), |
8522 Vcoding_system_alist); | 8523 Vcoding_system_alist); |
8523 | 8524 |
8524 return Qnil; | 8525 return Qnil; |
8525 } | 8526 } |