# HG changeset patch # User Kenichi Handa # Date 1138952229 0 # Node ID 72d8a45f6c9fa5320523680df027a472403164d5 # Parent 7432ca837c8de9bf085bc25b08e5eddefe554aec (Fdefine_coding_system_internal): Avoid a duplicated element in Vcoding_system_alist. (Fdefine_coding_system_alias): Likewise. diff -r 7432ca837c8d -r 72d8a45f6c9f src/coding.c --- a/src/coding.c Wed Feb 01 10:07:17 2006 +0000 +++ b/src/coding.c Fri Feb 03 07:37:09 2006 +0000 @@ -8933,8 +8933,11 @@ ASET (this_spec, 2, this_eol_type); Fputhash (this_name, this_spec, Vcoding_system_hash_table); Vcoding_system_list = Fcons (this_name, Vcoding_system_list); - Vcoding_system_alist = Fcons (Fcons (Fsymbol_name (this_name), Qnil), - Vcoding_system_alist); + val = Fassoc (Fsymbol_name (this_name), Vcoding_system_alist); + if (NILP (val)) + Vcoding_system_alist + = Fcons (Fcons (Fsymbol_name (this_name), Qnil), + Vcoding_system_alist); } } @@ -8944,8 +8947,10 @@ Fputhash (name, spec_vec, Vcoding_system_hash_table); Vcoding_system_list = Fcons (name, Vcoding_system_list); - Vcoding_system_alist = Fcons (Fcons (Fsymbol_name (name), Qnil), - Vcoding_system_alist); + val = Fassoc (Fsymbol_name (name), Vcoding_system_alist); + if (NILP (val)) + Vcoding_system_alist = Fcons (Fcons (Fsymbol_name (name), Qnil), + Vcoding_system_alist); { int id = coding_categories[category].id; @@ -9026,7 +9031,7 @@ (alias, coding_system) Lisp_Object alias, coding_system; { - Lisp_Object spec, aliases, eol_type; + Lisp_Object spec, aliases, eol_type, val; CHECK_SYMBOL (alias); CHECK_CODING_SYSTEM_GET_SPEC (coding_system, spec); @@ -9052,8 +9057,10 @@ Fputhash (alias, spec, Vcoding_system_hash_table); Vcoding_system_list = Fcons (alias, Vcoding_system_list); - Vcoding_system_alist = Fcons (Fcons (Fsymbol_name (alias), Qnil), - Vcoding_system_alist); + val = Fassoc (Fsymbol_name (alias), Vcoding_system_alist); + if (NILP (val)) + Vcoding_system_alist = Fcons (Fcons (Fsymbol_name (alias), Qnil), + Vcoding_system_alist); return Qnil; }