diff options
| author | Dave Love | 2003-09-04 16:59:00 +0000 |
|---|---|---|
| committer | Dave Love | 2003-09-04 16:59:00 +0000 |
| commit | cbdea07b9ddba2c2c31391814bf5b687ceba5aec (patch) | |
| tree | 740a40ef5cedec378b46b0cb9f4ffc2ecbc6f11c | |
| parent | 0a1a08dde387c22ef9f96a0c20b9cbc578f378fb (diff) | |
| download | emacs-cbdea07b9ddba2c2c31391814bf5b687ceba5aec.tar.gz emacs-cbdea07b9ddba2c2c31391814bf5b687ceba5aec.zip | |
(cp-make-translation-table)
(cp-valid-codes): Made defsubsts.
(cp-fix-safe-chars): Deleted.
(mule-diag): Don't require.
(windows-1251, windows-1252): Removed to cyrillic.el/european.el.
(top-level): Check for defined coding system when defining
cp... aliases. Change w32-add-charset-info test to avoid warning.
(non-iso-charset-alist): Defvar when compiling.
(cp-make-coding-system): Doc fix.
| -rw-r--r-- | lisp/international/code-pages.el | 307 |
1 files changed, 21 insertions, 286 deletions
diff --git a/lisp/international/code-pages.el b/lisp/international/code-pages.el index 43ac5891a0f..c8917e45d7d 100644 --- a/lisp/international/code-pages.el +++ b/lisp/international/code-pages.el | |||
| @@ -33,13 +33,12 @@ | |||
| 33 | 33 | ||
| 34 | ;; Those covered are: cp437, cp737, cp720, cp775, cp850, cp851, cp852, | 34 | ;; Those covered are: cp437, cp737, cp720, cp775, cp850, cp851, cp852, |
| 35 | ;; cp855, cp857, cp860, cp861, cp862, cp863, cp864, cp865, cp866, | 35 | ;; cp855, cp857, cp860, cp861, cp862, cp863, cp864, cp865, cp866, |
| 36 | ;; cp869, cp874, cp1125, windows-1250, windows-1251, windows-1252, | 36 | ;; cp869, cp874, cp1125, windows-1250, windows-1253, windows-1254, |
| 37 | ;; windows-1253, windows-1254, windows-1255, windows-1256, | 37 | ;; windows-1255, windows-1256, windows-1257, windows-1258, next, |
| 38 | ;; windows-1257, windows-1258, next, koi8-u, iso-8859-6, | 38 | ;; iso-8859-6, iso-8859-10, iso-8859-11, iso-8859-16, koi8-t, |
| 39 | ;; iso-8859-10, iso-8859-11, iso-8859-16, koi8-t, georgian-ps. This | 39 | ;; georgian-ps. This is meant to include all the single-byte ones |
| 40 | ;; is meant to include all the single-byte ones relevant to GNU (used | 40 | ;; relevant to GNU (used in glibc-defined locales); we don't yet get |
| 41 | ;; in glibc-defined locales); we don't yet get all the multibyte ones | 41 | ;; all the multibyte ones in base Emacs. |
| 42 | ;; in base Emacs. | ||
| 43 | 42 | ||
| 44 | ;; Note that various of these can clash with definitions in | 43 | ;; Note that various of these can clash with definitions in |
| 45 | ;; codepage.el; we try to avoid damage from that. A few CPs from | 44 | ;; codepage.el; we try to avoid damage from that. A few CPs from |
| @@ -54,7 +53,11 @@ | |||
| 54 | 53 | ||
| 55 | ;;; Code: | 54 | ;;; Code: |
| 56 | 55 | ||
| 57 | (defun cp-make-translation-table (v) | 56 | ;; The defsubsts here are just so that language files can use |
| 57 | ;; `cp-make-coding-system' and not require functions from this file | ||
| 58 | ;; at runtime. | ||
| 59 | |||
| 60 | (defsubst cp-make-translation-table (v) | ||
| 58 | "Return a translation table made from 128-long vector V. | 61 | "Return a translation table made from 128-long vector V. |
| 59 | V comprises characters encodable by mule-utf-8." | 62 | V comprises characters encodable by mule-utf-8." |
| 60 | (let ((encoding-vector (make-vector 256 0))) | 63 | (let ((encoding-vector (make-vector 256 0))) |
| @@ -75,7 +78,7 @@ V comprises characters encodable by mule-utf-8." | |||
| 75 | ucs-mule-to-mule-unicode) | 78 | ucs-mule-to-mule-unicode) |
| 76 | tab))) | 79 | tab))) |
| 77 | 80 | ||
| 78 | (defun cp-valid-codes (v) | 81 | (defsubst cp-valid-codes (v) |
| 79 | "Derive a valid-codes list for translation vector V. | 82 | "Derive a valid-codes list for translation vector V. |
| 80 | See `make-coding-system'." | 83 | See `make-coding-system'." |
| 81 | (let (pairs | 84 | (let (pairs |
| @@ -94,13 +97,6 @@ See `make-coding-system'." | |||
| 94 | (if start (push (cons start end) pairs)) | 97 | (if start (push (cons start end) pairs)) |
| 95 | (nreverse pairs))) | 98 | (nreverse pairs))) |
| 96 | 99 | ||
| 97 | (defun cp-fix-safe-chars (cs) | ||
| 98 | "This is an obsolete function. | ||
| 99 | It exists just for backward compatibility, and it does nothing.") | ||
| 100 | (make-obsolete 'cp-fix-safe-chars | ||
| 101 | "Unnecessary function. Calling it has no effect." | ||
| 102 | "21.3") | ||
| 103 | |||
| 104 | ;; Fix things that have been, or might be, done by codepage.el. | 100 | ;; Fix things that have been, or might be, done by codepage.el. |
| 105 | (eval-after-load "codepage" | 101 | (eval-after-load "codepage" |
| 106 | '(progn | 102 | '(progn |
| @@ -145,9 +141,10 @@ read/written by MS-DOS software, or for display on the MS-DOS terminal." | |||
| 145 | (defmacro cp-make-coding-system (name v &optional doc-string mnemonic) | 141 | (defmacro cp-make-coding-system (name v &optional doc-string mnemonic) |
| 146 | "Make coding system NAME for and 8-bit, extended-ASCII character set. | 142 | "Make coding system NAME for and 8-bit, extended-ASCII character set. |
| 147 | V is a 128-long vector of characters to translate the upper half of | 143 | V is a 128-long vector of characters to translate the upper half of |
| 148 | the charactert set. DOC-STRING and MNEMONIC are used as the | 144 | the character set. DOC-STRING and MNEMONIC are used as the |
| 149 | corresponding args of `make-coding-system'. If MNEMONIC isn't given, | 145 | corresponding args of `make-coding-system'. If MNEMONIC isn't given, |
| 150 | ?* is used." | 146 | ?* is used. |
| 147 | Return an updated `non-iso-charset-alist'." | ||
| 151 | (let* ((encoder (intern (format "encode-%s" name))) | 148 | (let* ((encoder (intern (format "encode-%s" name))) |
| 152 | (decoder (intern (format "decode-%s" name))) | 149 | (decoder (intern (format "decode-%s" name))) |
| 153 | (ccl-decoder | 150 | (ccl-decoder |
| @@ -203,6 +200,7 @@ corresponding args of `make-coding-system'. If MNEMONIC isn't given, | |||
| 203 | (list l))) | 200 | (list l))) |
| 204 | non-iso-charset-alist)))) | 201 | non-iso-charset-alist)))) |
| 205 | 202 | ||
| 203 | (eval-when-compile (defvar non-iso-charset-alist)) | ||
| 206 | 204 | ||
| 207 | ;; These tables were mostly derived by running somthing like | 205 | ;; These tables were mostly derived by running somthing like |
| 208 | ;; `recode -f cpxxx/..utf-8' on a binary file filled by | 206 | ;; `recode -f cpxxx/..utf-8' on a binary file filled by |
| @@ -2573,270 +2571,6 @@ corresponding args of `make-coding-system'. If MNEMONIC isn't given, | |||
| 2573 | ?\ţ | 2571 | ?\ţ |
| 2574 | ?\˙]) | 2572 | ?\˙]) |
| 2575 | 2573 | ||
| 2576 | ;; be_BY, bg_BG | ||
| 2577 | (cp-make-coding-system | ||
| 2578 | windows-1251 | ||
| 2579 | [?\Ђ | ||
| 2580 | ?\Ѓ | ||
| 2581 | ?\‚ | ||
| 2582 | ?\ѓ | ||
| 2583 | ?\„ | ||
| 2584 | ?\… | ||
| 2585 | ?\† | ||
| 2586 | ?\‡ | ||
| 2587 | ?\€ | ||
| 2588 | ?\‰ | ||
| 2589 | ?\Љ | ||
| 2590 | ?\‹ | ||
| 2591 | ?\Њ | ||
| 2592 | ?\Ќ | ||
| 2593 | ?\Ћ | ||
| 2594 | ?\Џ | ||
| 2595 | ?\ђ | ||
| 2596 | ?\‘ | ||
| 2597 | ?\’ | ||
| 2598 | ?\“ | ||
| 2599 | ?\” | ||
| 2600 | ?\• | ||
| 2601 | ?\– | ||
| 2602 | ?\— | ||
| 2603 | nil | ||
| 2604 | ?\™ | ||
| 2605 | ?\љ | ||
| 2606 | ?\› | ||
| 2607 | ?\њ | ||
| 2608 | ?\ќ | ||
| 2609 | ?\ћ | ||
| 2610 | ?\џ | ||
| 2611 | ?\ | ||
| 2612 | ?\Ў | ||
| 2613 | ?\ў | ||
| 2614 | ?\Ј | ||
| 2615 | ?\¤ | ||
| 2616 | ?\Ґ | ||
| 2617 | ?\¦ | ||
| 2618 | ?\§ | ||
| 2619 | ?\Ё | ||
| 2620 | ?\© | ||
| 2621 | ?\Є | ||
| 2622 | ?\« | ||
| 2623 | ?\¬ | ||
| 2624 | ?\ | ||
| 2625 | ?\® | ||
| 2626 | ?\Ї | ||
| 2627 | ?\° | ||
| 2628 | ?\± | ||
| 2629 | ?\І | ||
| 2630 | ?\і | ||
| 2631 | ?\ґ | ||
| 2632 | ?\µ | ||
| 2633 | ?\¶ | ||
| 2634 | ?\· | ||
| 2635 | ?\ё | ||
| 2636 | ?\№ | ||
| 2637 | ?\є | ||
| 2638 | ?\» | ||
| 2639 | ?\ј | ||
| 2640 | ?\Ѕ | ||
| 2641 | ?\ѕ | ||
| 2642 | ?\ї | ||
| 2643 | ?\А | ||
| 2644 | ?\Б | ||
| 2645 | ?\В | ||
| 2646 | ?\Г | ||
| 2647 | ?\Д | ||
| 2648 | ?\Е | ||
| 2649 | ?\Ж | ||
| 2650 | ?\З | ||
| 2651 | ?\И | ||
| 2652 | ?\Й | ||
| 2653 | ?\К | ||
| 2654 | ?\Л | ||
| 2655 | ?\М | ||
| 2656 | ?\Н | ||
| 2657 | ?\О | ||
| 2658 | ?\П | ||
| 2659 | ?\Р | ||
| 2660 | ?\С | ||
| 2661 | ?\Т | ||
| 2662 | ?\У | ||
| 2663 | ?\Ф | ||
| 2664 | ?\Х | ||
| 2665 | ?\Ц | ||
| 2666 | ?\Ч | ||
| 2667 | ?\Ш | ||
| 2668 | ?\Щ | ||
| 2669 | ?\Ъ | ||
| 2670 | ?\Ы | ||
| 2671 | ?\Ь | ||
| 2672 | ?\Э | ||
| 2673 | ?\Ю | ||
| 2674 | ?\Я | ||
| 2675 | ?\а | ||
| 2676 | ?\б | ||
| 2677 | ?\в | ||
| 2678 | ?\г | ||
| 2679 | ?\д | ||
| 2680 | ?\е | ||
| 2681 | ?\ж | ||
| 2682 | ?\з | ||
| 2683 | ?\и | ||
| 2684 | ?\й | ||
| 2685 | ?\к | ||
| 2686 | ?\л | ||
| 2687 | ?\м | ||
| 2688 | ?\н | ||
| 2689 | ?\о | ||
| 2690 | ?\п | ||
| 2691 | ?\р | ||
| 2692 | ?\с | ||
| 2693 | ?\т | ||
| 2694 | ?\у | ||
| 2695 | ?\ф | ||
| 2696 | ?\х | ||
| 2697 | ?\ц | ||
| 2698 | ?\ч | ||
| 2699 | ?\ш | ||
| 2700 | ?\щ | ||
| 2701 | ?\ъ | ||
| 2702 | ?\ы | ||
| 2703 | ?\ь | ||
| 2704 | ?\э | ||
| 2705 | ?\ю | ||
| 2706 | ?\я] | ||
| 2707 | nil ?b) | ||
| 2708 | |||
| 2709 | (cp-make-coding-system | ||
| 2710 | windows-1252 | ||
| 2711 | [?\€ | ||
| 2712 | nil | ||
| 2713 | ?\‚ | ||
| 2714 | ?\ƒ | ||
| 2715 | ?\„ | ||
| 2716 | ?\… | ||
| 2717 | ?\† | ||
| 2718 | ?\‡ | ||
| 2719 | ?\ˆ | ||
| 2720 | ?\‰ | ||
| 2721 | ?\Š | ||
| 2722 | ?\‹ | ||
| 2723 | ?\Œ | ||
| 2724 | nil | ||
| 2725 | ?\Ž | ||
| 2726 | ?\ž | ||
| 2727 | nil | ||
| 2728 | ?\‘ | ||
| 2729 | ?\’ | ||
| 2730 | ?\“ | ||
| 2731 | ?\” | ||
| 2732 | ?\• | ||
| 2733 | ?\– | ||
| 2734 | ?\— | ||
| 2735 | ?\˜ | ||
| 2736 | ?\™ | ||
| 2737 | ?\š | ||
| 2738 | ?\› | ||
| 2739 | ?\œ | ||
| 2740 | nil | ||
| 2741 | nil | ||
| 2742 | ?\Ÿ | ||
| 2743 | ?\ | ||
| 2744 | ?\¡ | ||
| 2745 | ?\¢ | ||
| 2746 | ?\£ | ||
| 2747 | ?\¤ | ||
| 2748 | ?\¥ | ||
| 2749 | ?\¦ | ||
| 2750 | ?\§ | ||
| 2751 | ?\¨ | ||
| 2752 | ?\© | ||
| 2753 | ?\ª | ||
| 2754 | ?\« | ||
| 2755 | ?\¬ | ||
| 2756 | ?\ | ||
| 2757 | ?\® | ||
| 2758 | ?\¯ | ||
| 2759 | ?\° | ||
| 2760 | ?\± | ||
| 2761 | ?\² | ||
| 2762 | ?\³ | ||
| 2763 | ?\´ | ||
| 2764 | ?\µ | ||
| 2765 | ?\¶ | ||
| 2766 | ?\· | ||
| 2767 | ?\¸ | ||
| 2768 | ?\¹ | ||
| 2769 | ?\º | ||
| 2770 | ?\» | ||
| 2771 | ?\¼ | ||
| 2772 | ?\½ | ||
| 2773 | ?\¾ | ||
| 2774 | ?\¿ | ||
| 2775 | ?\À | ||
| 2776 | ?\Á | ||
| 2777 | ?\Â | ||
| 2778 | ?\Ã | ||
| 2779 | ?\Ä | ||
| 2780 | ?\Å | ||
| 2781 | ?\Æ | ||
| 2782 | ?\Ç | ||
| 2783 | ?\È | ||
| 2784 | ?\É | ||
| 2785 | ?\Ê | ||
| 2786 | ?\Ë | ||
| 2787 | ?\Ì | ||
| 2788 | ?\Í | ||
| 2789 | ?\Î | ||
| 2790 | ?\Ï | ||
| 2791 | ?\Ð | ||
| 2792 | ?\Ñ | ||
| 2793 | ?\Ò | ||
| 2794 | ?\Ó | ||
| 2795 | ?\Ô | ||
| 2796 | ?\Õ | ||
| 2797 | ?\Ö | ||
| 2798 | ?\× | ||
| 2799 | ?\Ø | ||
| 2800 | ?\Ù | ||
| 2801 | ?\Ú | ||
| 2802 | ?\Û | ||
| 2803 | ?\Ü | ||
| 2804 | ?\Ý | ||
| 2805 | ?\Þ | ||
| 2806 | ?\ß | ||
| 2807 | ?\à | ||
| 2808 | ?\á | ||
| 2809 | ?\â | ||
| 2810 | ?\ã | ||
| 2811 | ?\ä | ||
| 2812 | ?\å | ||
| 2813 | ?\æ | ||
| 2814 | ?\ç | ||
| 2815 | ?\è | ||
| 2816 | ?\é | ||
| 2817 | ?\ê | ||
| 2818 | ?\ë | ||
| 2819 | ?\ì | ||
| 2820 | ?\í | ||
| 2821 | ?\î | ||
| 2822 | ?\ï | ||
| 2823 | ?\ð | ||
| 2824 | ?\ñ | ||
| 2825 | ?\ò | ||
| 2826 | ?\ó | ||
| 2827 | ?\ô | ||
| 2828 | ?\õ | ||
| 2829 | ?\ö | ||
| 2830 | ?\÷ | ||
| 2831 | ?\ø | ||
| 2832 | ?\ù | ||
| 2833 | ?\ú | ||
| 2834 | ?\û | ||
| 2835 | ?\ü | ||
| 2836 | ?\ý | ||
| 2837 | ?\þ | ||
| 2838 | ?\ÿ]) | ||
| 2839 | |||
| 2840 | (cp-make-coding-system | 2574 | (cp-make-coding-system |
| 2841 | windows-1253 | 2575 | windows-1253 |
| 2842 | [?\€ | 2576 | [?\€ |
| @@ -4749,15 +4483,16 @@ corresponding args of `make-coding-system'. If MNEMONIC isn't given, | |||
| 4749 | (dotimes (i 8) | 4483 | (dotimes (i 8) |
| 4750 | (let ((w (intern (format "windows-125%d" i))) | 4484 | (let ((w (intern (format "windows-125%d" i))) |
| 4751 | (c (intern (format "cp125%d" i)))) | 4485 | (c (intern (format "cp125%d" i)))) |
| 4752 | (define-coding-system-alias c w) | 4486 | (if (coding-system-p c) ; 1251 is in cyrillic.el |
| 4487 | (define-coding-system-alias c w)) | ||
| 4753 | ;; Compatibility with codepage.el, though cp... are not the | 4488 | ;; Compatibility with codepage.el, though cp... are not the |
| 4754 | ;; canonical names. | 4489 | ;; canonical names. |
| 4755 | (push (assoc w non-iso-charset-alist) non-iso-charset-alist))) | 4490 | (push (assoc w non-iso-charset-alist) non-iso-charset-alist))) |
| 4756 | 4491 | ||
| 4757 | ;; Use Unicode font under Windows. Jason Rumney fecit. | 4492 | ;; Use Unicode font under Windows. Jason Rumney fecit. |
| 4758 | (if (and (fboundp 'w32-add-charset-info) | 4493 | (if (fboundp 'w32-add-charset-info) |
| 4759 | (not (boundp 'w32-unicode-charset-defined))) | 4494 | (unless (boundp 'w32-unicode-charset-defined) |
| 4760 | (w32-add-charset-info "iso10646-1" 'w32-charset-ansi t)) | 4495 | (w32-add-charset-info "iso10646-1" 'w32-charset-ansi t))) |
| 4761 | 4496 | ||
| 4762 | (provide 'code-pages) | 4497 | (provide 'code-pages) |
| 4763 | 4498 | ||