diff options
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/coding.c b/src/coding.c index 7fc2a007ad7..c9f5837e191 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -7763,7 +7763,8 @@ usage: (find-operation-coding-system OPERATION ARGUMENTS ...) */) | |||
| 7763 | DEFUN ("set-coding-system-priority", Fset_coding_system_priority, | 7763 | DEFUN ("set-coding-system-priority", Fset_coding_system_priority, |
| 7764 | Sset_coding_system_priority, 0, MANY, 0, | 7764 | Sset_coding_system_priority, 0, MANY, 0, |
| 7765 | doc: /* Assign higher priority to the coding systems given as arguments. | 7765 | doc: /* Assign higher priority to the coding systems given as arguments. |
| 7766 | usage: (set-coding-system-priority CODING-SYSTEM ...) */) | 7766 | If multiple coding systems belongs to the same category, |
| 7767 | all but the first one are ignored. */) | ||
| 7767 | (nargs, args) | 7768 | (nargs, args) |
| 7768 | int nargs; | 7769 | int nargs; |
| 7769 | Lisp_Object *args; | 7770 | Lisp_Object *args; |
| @@ -7791,6 +7792,7 @@ usage: (set-coding-system-priority CODING-SYSTEM ...) */) | |||
| 7791 | if (coding_categories[category].id >= 0 | 7792 | if (coding_categories[category].id >= 0 |
| 7792 | && ! EQ (args[i], CODING_ID_NAME (coding_categories[category].id))) | 7793 | && ! EQ (args[i], CODING_ID_NAME (coding_categories[category].id))) |
| 7793 | setup_coding_system (args[i], &coding_categories[category]); | 7794 | setup_coding_system (args[i], &coding_categories[category]); |
| 7795 | Fset (AREF (Vcoding_category_table, category), args[i]); | ||
| 7794 | } | 7796 | } |
| 7795 | 7797 | ||
| 7796 | /* Now we have decided top J priorities. Reflect the order of the | 7798 | /* Now we have decided top J priorities. Reflect the order of the |
| @@ -7807,6 +7809,14 @@ usage: (set-coding-system-priority CODING-SYSTEM ...) */) | |||
| 7807 | } | 7809 | } |
| 7808 | 7810 | ||
| 7809 | bcopy (priorities, coding_priorities, sizeof priorities); | 7811 | bcopy (priorities, coding_priorities, sizeof priorities); |
| 7812 | |||
| 7813 | /* Update `coding-category-list'. */ | ||
| 7814 | Vcoding_category_list = Qnil; | ||
| 7815 | for (i = coding_category_max - 1; i >= 0; i--) | ||
| 7816 | Vcoding_category_list | ||
| 7817 | = Fcons (AREF (Vcoding_category_table, priorities[i]), | ||
| 7818 | Vcoding_category_list); | ||
| 7819 | |||
| 7810 | return Qnil; | 7820 | return Qnil; |
| 7811 | } | 7821 | } |
| 7812 | 7822 | ||
| @@ -8633,6 +8643,8 @@ syms_of_coding () | |||
| 8633 | intern ("coding-category-utf-8")); | 8643 | intern ("coding-category-utf-8")); |
| 8634 | ASET (Vcoding_category_table, coding_category_utf_16_be, | 8644 | ASET (Vcoding_category_table, coding_category_utf_16_be, |
| 8635 | intern ("coding-category-utf-16-be")); | 8645 | intern ("coding-category-utf-16-be")); |
| 8646 | ASET (Vcoding_category_table, coding_category_utf_16_auto, | ||
| 8647 | intern ("coding-category-utf-16-auto")); | ||
| 8636 | ASET (Vcoding_category_table, coding_category_utf_16_le, | 8648 | ASET (Vcoding_category_table, coding_category_utf_16_le, |
| 8637 | intern ("coding-category-utf-16-le")); | 8649 | intern ("coding-category-utf-16-le")); |
| 8638 | ASET (Vcoding_category_table, coding_category_utf_16_be_nosig, | 8650 | ASET (Vcoding_category_table, coding_category_utf_16_be_nosig, |
| @@ -8954,6 +8966,13 @@ character."); | |||
| 8954 | setup_coding_system (Qno_conversion, &keyboard_coding); | 8966 | setup_coding_system (Qno_conversion, &keyboard_coding); |
| 8955 | setup_coding_system (Qno_conversion, &terminal_coding); | 8967 | setup_coding_system (Qno_conversion, &terminal_coding); |
| 8956 | setup_coding_system (Qno_conversion, &safe_terminal_coding); | 8968 | setup_coding_system (Qno_conversion, &safe_terminal_coding); |
| 8969 | |||
| 8970 | { | ||
| 8971 | int i; | ||
| 8972 | |||
| 8973 | for (i = 0; i < coding_category_max; i++) | ||
| 8974 | Fset (AREF (Vcoding_category_table, i), Qno_conversion); | ||
| 8975 | } | ||
| 8957 | } | 8976 | } |
| 8958 | 8977 | ||
| 8959 | char * | 8978 | char * |