aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/src/coding.c b/src/coding.c
index a1494ad38aa..8dcc4013c1d 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -6864,11 +6864,9 @@ get_translation_table (Lisp_Object attrs, bool encodep, int *max_lookup)
6864 if (CHAR_TABLE_P (standard)) 6864 if (CHAR_TABLE_P (standard))
6865 { 6865 {
6866 if (CONSP (translation_table)) 6866 if (CONSP (translation_table))
6867 translation_table = nconc2 (translation_table, 6867 translation_table = nconc2 (translation_table, list1 (standard));
6868 Fcons (standard, Qnil));
6869 else 6868 else
6870 translation_table = Fcons (translation_table, 6869 translation_table = list2 (translation_table, standard);
6871 Fcons (standard, Qnil));
6872 } 6870 }
6873 } 6871 }
6874 6872
@@ -8667,20 +8665,20 @@ detect_coding_system (const unsigned char *src,
8667 { 8665 {
8668 detect_info.found = CATEGORY_MASK_RAW_TEXT; 8666 detect_info.found = CATEGORY_MASK_RAW_TEXT;
8669 id = CODING_SYSTEM_ID (Qno_conversion); 8667 id = CODING_SYSTEM_ID (Qno_conversion);
8670 val = Fcons (make_number (id), Qnil); 8668 val = list1 (make_number (id));
8671 } 8669 }
8672 else if (! detect_info.rejected && ! detect_info.found) 8670 else if (! detect_info.rejected && ! detect_info.found)
8673 { 8671 {
8674 detect_info.found = CATEGORY_MASK_ANY; 8672 detect_info.found = CATEGORY_MASK_ANY;
8675 id = coding_categories[coding_category_undecided].id; 8673 id = coding_categories[coding_category_undecided].id;
8676 val = Fcons (make_number (id), Qnil); 8674 val = list1 (make_number (id));
8677 } 8675 }
8678 else if (highest) 8676 else if (highest)
8679 { 8677 {
8680 if (detect_info.found) 8678 if (detect_info.found)
8681 { 8679 {
8682 detect_info.found = 1 << category; 8680 detect_info.found = 1 << category;
8683 val = Fcons (make_number (this->id), Qnil); 8681 val = list1 (make_number (this->id));
8684 } 8682 }
8685 else 8683 else
8686 for (i = 0; i < coding_category_raw_text; i++) 8684 for (i = 0; i < coding_category_raw_text; i++)
@@ -8688,7 +8686,7 @@ detect_coding_system (const unsigned char *src,
8688 { 8686 {
8689 detect_info.found = 1 << coding_priorities[i]; 8687 detect_info.found = 1 << coding_priorities[i];
8690 id = coding_categories[coding_priorities[i]].id; 8688 id = coding_categories[coding_priorities[i]].id;
8691 val = Fcons (make_number (id), Qnil); 8689 val = list1 (make_number (id));
8692 break; 8690 break;
8693 } 8691 }
8694 } 8692 }
@@ -8705,7 +8703,7 @@ detect_coding_system (const unsigned char *src,
8705 found |= 1 << category; 8703 found |= 1 << category;
8706 id = coding_categories[category].id; 8704 id = coding_categories[category].id;
8707 if (id >= 0) 8705 if (id >= 0)
8708 val = Fcons (make_number (id), val); 8706 val = list1 (make_number (id));
8709 } 8707 }
8710 } 8708 }
8711 for (i = coding_category_raw_text - 1; i >= 0; i--) 8709 for (i = coding_category_raw_text - 1; i >= 0; i--)
@@ -8730,7 +8728,7 @@ detect_coding_system (const unsigned char *src,
8730 this = coding_categories + coding_category_utf_8_sig; 8728 this = coding_categories + coding_category_utf_8_sig;
8731 else 8729 else
8732 this = coding_categories + coding_category_utf_8_nosig; 8730 this = coding_categories + coding_category_utf_8_nosig;
8733 val = Fcons (make_number (this->id), Qnil); 8731 val = list1 (make_number (this->id));
8734 } 8732 }
8735 } 8733 }
8736 else if (base_category == coding_category_utf_16_auto) 8734 else if (base_category == coding_category_utf_16_auto)
@@ -8747,13 +8745,13 @@ detect_coding_system (const unsigned char *src,
8747 this = coding_categories + coding_category_utf_16_be_nosig; 8745 this = coding_categories + coding_category_utf_16_be_nosig;
8748 else 8746 else
8749 this = coding_categories + coding_category_utf_16_le_nosig; 8747 this = coding_categories + coding_category_utf_16_le_nosig;
8750 val = Fcons (make_number (this->id), Qnil); 8748 val = list1 (make_number (this->id));
8751 } 8749 }
8752 } 8750 }
8753 else 8751 else
8754 { 8752 {
8755 detect_info.found = 1 << XINT (CODING_ATTR_CATEGORY (attrs)); 8753 detect_info.found = 1 << XINT (CODING_ATTR_CATEGORY (attrs));
8756 val = Fcons (make_number (coding.id), Qnil); 8754 val = list1 (make_number (coding.id));
8757 } 8755 }
8758 8756
8759 /* Then, detect eol-format if necessary. */ 8757 /* Then, detect eol-format if necessary. */
@@ -9224,7 +9222,7 @@ is nil. */)
9224 attrs = AREF (CODING_SYSTEM_SPEC (elt), 0); 9222 attrs = AREF (CODING_SYSTEM_SPEC (elt), 0);
9225 ASET (attrs, coding_attr_trans_tbl, 9223 ASET (attrs, coding_attr_trans_tbl,
9226 get_translation_table (attrs, 1, NULL)); 9224 get_translation_table (attrs, 1, NULL));
9227 list = Fcons (Fcons (elt, Fcons (attrs, Qnil)), list); 9225 list = Fcons (list2 (elt, attrs), list);
9228 } 9226 }
9229 9227
9230 if (STRINGP (start)) 9228 if (STRINGP (start))
@@ -9635,7 +9633,7 @@ DEFUN ("set-terminal-coding-system-internal", Fset_terminal_coding_system_intern
9635 tset_charset_list 9633 tset_charset_list
9636 (term, (terminal_coding->common_flags & CODING_REQUIRE_ENCODING_MASK 9634 (term, (terminal_coding->common_flags & CODING_REQUIRE_ENCODING_MASK
9637 ? coding_charset_list (terminal_coding) 9635 ? coding_charset_list (terminal_coding)
9638 : Fcons (make_number (charset_ascii), Qnil))); 9636 : list1 (make_number (charset_ascii))));
9639 return Qnil; 9637 return Qnil;
9640} 9638}
9641 9639
@@ -10080,9 +10078,9 @@ usage: (define-coding-system-internal ...) */)
10080 { 10078 {
10081 dim2 = CHARSET_DIMENSION (CHARSET_FROM_ID (XFASTINT (tmp))); 10079 dim2 = CHARSET_DIMENSION (CHARSET_FROM_ID (XFASTINT (tmp)));
10082 if (dim < dim2) 10080 if (dim < dim2)
10083 tmp = Fcons (XCAR (tail), Fcons (tmp, Qnil)); 10081 tmp = list2 (XCAR (tail), tmp);
10084 else 10082 else
10085 tmp = Fcons (tmp, Fcons (XCAR (tail), Qnil)); 10083 tmp = list2 (tmp, XCAR (tail));
10086 } 10084 }
10087 else 10085 else
10088 { 10086 {
@@ -10093,7 +10091,7 @@ usage: (define-coding-system-internal ...) */)
10093 break; 10091 break;
10094 } 10092 }
10095 if (NILP (tmp2)) 10093 if (NILP (tmp2))
10096 tmp = nconc2 (tmp, Fcons (XCAR (tail), Qnil)); 10094 tmp = nconc2 (tmp, list1 (XCAR (tail)));
10097 else 10095 else
10098 { 10096 {
10099 XSETCDR (tmp2, Fcons (XCAR (tmp2), XCDR (tmp2))); 10097 XSETCDR (tmp2, Fcons (XCAR (tmp2), XCDR (tmp2)));
@@ -10411,7 +10409,7 @@ usage: (define-coding-system-internal ...) */)
10411 && ! EQ (eol_type, Qmac)) 10409 && ! EQ (eol_type, Qmac))
10412 error ("Invalid eol-type"); 10410 error ("Invalid eol-type");
10413 10411
10414 aliases = Fcons (name, Qnil); 10412 aliases = list1 (name);
10415 10413
10416 if (NILP (eol_type)) 10414 if (NILP (eol_type))
10417 { 10415 {
@@ -10421,7 +10419,7 @@ usage: (define-coding-system-internal ...) */)
10421 Lisp_Object this_spec, this_name, this_aliases, this_eol_type; 10419 Lisp_Object this_spec, this_name, this_aliases, this_eol_type;
10422 10420
10423 this_name = AREF (eol_type, i); 10421 this_name = AREF (eol_type, i);
10424 this_aliases = Fcons (this_name, Qnil); 10422 this_aliases = list1 (this_name);
10425 this_eol_type = (i == 0 ? Qunix : i == 1 ? Qdos : Qmac); 10423 this_eol_type = (i == 0 ? Qunix : i == 1 ? Qdos : Qmac);
10426 this_spec = make_uninit_vector (3); 10424 this_spec = make_uninit_vector (3);
10427 ASET (this_spec, 0, attrs); 10425 ASET (this_spec, 0, attrs);
@@ -10536,7 +10534,7 @@ DEFUN ("define-coding-system-alias", Fdefine_coding_system_alias,
10536 list. */ 10534 list. */
10537 while (!NILP (XCDR (aliases))) 10535 while (!NILP (XCDR (aliases)))
10538 aliases = XCDR (aliases); 10536 aliases = XCDR (aliases);
10539 XSETCDR (aliases, Fcons (alias, Qnil)); 10537 XSETCDR (aliases, list1 (alias));
10540 10538
10541 eol_type = AREF (spec, 2); 10539 eol_type = AREF (spec, 2);
10542 if (VECTORP (eol_type)) 10540 if (VECTORP (eol_type))