Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1574987
 поиск   регистрация   авторизация 
 
Группа :: Редакторы
Пакет: emacs21

 Главная   Изменения   Спек   Патчи   Загрузить   Bugs and FR 

Патч: emacs-21.3-alt4-uk.patch


lisp/loaddefs.el has to be regenerated after applying this patch.
Bsically, this patch adds KOI8-U support for Ukrainian.
Last modified by Ivan Zakharyaschev, 3 April 2003.
--- emacs-21.1/lisp/gnus/mm-util.el	Tue Sep 18 17:59:24 2001
+++ emacs-21.1-uk/lisp/gnus/mm-util.el	Thu Nov  8 21:18:17 2001
@@ -43,6 +43,7 @@
     ;; The fake mule-charset, gnus-koi8-r, tells Gnus that the default 
     ;; charset is koi8-r, not iso-8859-5.
     (koi8-r cyrillic-iso8859-5 gnus-koi8-r)
+    (koi8-u cyrillic-iso8859-5)
     (iso-8859-6 arabic-iso8859-6)
     (iso-8859-7 greek-iso8859-7)
     (iso-8859-8 hebrew-iso8859-8)
--- emacs-21.1/lisp/gnus/rfc2047.el	Sun Jul 15 20:42:53 2001
+++ emacs-21.1-uk/lisp/gnus/rfc2047.el	Thu Nov  8 21:18:40 2001
@@ -62,6 +62,7 @@
     (iso-8859-4 . Q)
     (iso-8859-5 . B)
     (koi8-r . B)
+    (koi8-u . B)
     (iso-8859-7 . B)
     (iso-8859-8 . B)
     (iso-8859-9 . Q)
--- emacs-21.1/lisp/international/codepage.el	Sun Jul 15 19:15:34 2001
+++ emacs-21.1-uk/lisp/international/codepage.el	Mon Nov 12 17:41:29 2001
@@ -390,6 +390,20 @@
 (setplist 'cp866-decode-table
 	  '(charset cyrillic-iso8859-5 language "Cyrillic-ISO" offset 160))
 
+;; Ukrainian (Yes, another one!  This one's supposed to be used
+;; on Windows as the Ukrainian OEM code page.)
+(defvar cp1125-decode-table
+  [
+   255 240 nil 242 244 nil 246 248 nil nil nil nil nil nil nil nil
+   128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
+   144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
+   160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
+   224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
+   252 241 nil 243 245 nil 247 249 nil nil nil nil nil nil nil nil]
+  "Table for converting ISO-8859-5 characters into codepage 1125 glyphs.")
+(setplist 'cp1125-decode-table
+	  '(charset cyrillic-iso8859-5 language "Cyrillic-ISO" offset 160))
+
 ;; Greek (yes, another one!)
 (defvar cp869-decode-table
   [
--- emacs-21.1/lisp/international/mule-diag.el	Thu Sep 27 12:22:39 2001
+++ emacs-21.1-uk/lisp/international/mule-diag.el	Thu Nov  8 21:32:19 2001
@@ -256,6 +256,10 @@
      (ascii cyrillic-iso8859-5)
      cyrillic-koi8-r-nonascii-translation-table
      ((32 255)))
+    (koi8-u
+     (ascii cyrillic-iso8859-5)
+     cyrillic-koi8-u-nonascii-translation-table
+     ((32 255)))
     (alternativnyj
      (ascii cyrillic-iso8859-5)
      cyrillic-alternativnyj-nonascii-translation-table
--- emacs-21.1/lisp/language/cyril-util.el	Sun Jul 15 22:53:53 2001
+++ emacs-21.1-uk/lisp/language/cyril-util.el	Thu Nov  8 21:58:24 2001
@@ -26,6 +26,12 @@
 ;;; Code:
 
 ;;;###autoload
+(defun cyrillic-encode-koi8-u-char (char)
+  "Return KOI8-U external character code of CHAR if appropriate."
+  (aref (char-table-extra-slot cyrillic-koi8-u-nonascii-translation-table 0)
+	char))
+
+;;;###autoload
 (defun cyrillic-encode-koi8-r-char (char)
   "Return KOI8-R external character code of CHAR if appropriate."
   (aref (char-table-extra-slot cyrillic-koi8-r-nonascii-translation-table 0)
--- emacs-21.1/lisp/language/cyrillic.el	Sun Jul 15 22:53:53 2001
+++ emacs-21.1-uk/lisp/language/cyrillic.el	Thu Nov  8 21:56:09 2001
@@ -56,6 +56,94 @@
 		  (documentation . "Support for Cyrillic ISO-8859-5."))
  '("Cyrillic"))
 
+;; KOI8-U staff
+
+(defvar cyrillic-koi8-u-decode-table
+  [
+   0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+   16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
+   32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
+   48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
+   64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
+   80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
+   96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
+   112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
+   128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
+   144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
+   32  32  32  ?,Lq(B  ?,Lt(B  32  ?,Lv(B  ?,Lw(B  32  32  32  32  32  ?,Ls(B  32  32
+   32  32  32  ?,L!(B  ?,L$(B  32  ?,L&(B  ?,L'(B  32  32  32  32  32  ?,L#(B  32  32
+   ?,Ln(B  ?,LP(B  ?,LQ(B  ?,Lf(B  ?,LT(B  ?,LU(B  ?,Ld(B  ?,LS(B  ?,Le(B  ?,LX(B  ?,LY(B  ?,LZ(B  ?,L[(B  ?,L\(B  ?,L](B  ?,L^(B 
+   ?,L_(B  ?,Lo(B  ?,L`(B  ?,La(B  ?,Lb(B  ?,Lc(B  ?,LV(B  ?,LR(B  ?,Ll(B  ?,Lk(B  ?,LW(B  ?,Lh(B  ?,Lm(B  ?,Li(B  ?,Lg(B  ?,Lj(B 
+   ?,LN(B  ?,L0(B  ?,L1(B  ?,LF(B  ?,L4(B  ?,L5(B  ?,LD(B  ?,L3(B  ?,LE(B  ?,L8(B  ?,L9(B  ?,L:(B  ?,L;(B  ?,L<(B  ?,L=(B  ?,L>(B 
+   ?,L?(B  ?,LO(B  ?,L@(B  ?,LA(B  ?,LB(B  ?,LC(B  ?,L6(B  ?,L2(B  ?,LL(B  ?,LK(B  ?,L7(B  ?,LH(B  ?,LM(B  ?,LI(B  ?,LG(B  ?,LJ(B ]
+  "Cyrillic KOI8-U decoding table.")
+
+(let ((table (make-translation-table-from-vector
+	      cyrillic-koi8-u-decode-table)))
+  (define-translation-table 'cyrillic-koi8-u-nonascii-translation-table table)
+  (define-translation-table 'cyrillic-koi8-u-encode-table
+    (char-table-extra-slot table 0)))
+
+(define-ccl-program ccl-decode-koi8-u
+  `(3
+    ((loop
+      (r0 = 0)
+      (read r1)
+      (if (r1 < 128)
+	  (write-repeat r1)
+	((translate-character cyrillic-koi8-u-nonascii-translation-table r0 r1)
+	 (write-multibyte-character r0 r1)
+	 (repeat))))))
+  "CCL program to decode KOI8-U.")
+
+(define-ccl-program ccl-encode-koi8-u
+  `(1
+    ((loop
+      (read-multibyte-character r0 r1)
+      (if (r0 == ,(charset-id 'cyrillic-iso8859-5))
+	  (translate-character cyrillic-koi8-u-encode-table r0 r1))
+      (write-repeat r1))))
+  "CCL program to encode KOI8-U.")
+
+(make-coding-system
+ 'cyrillic-koi8-u 4
+ ?R "KOI8-U 8-bit encoding for Cyrillic (MIME: KOI8-U)"
+ '(ccl-decode-koi8-u . ccl-encode-koi8-u)
+ `((safe-chars . ,(let ((table (make-char-table 'safe-chars))
+			(i 0))
+		    (while (< i 256)
+		      (aset table (aref cyrillic-koi8-u-decode-table i) t)
+		      (setq i (1+ i)))
+		    table))
+   (mime-charset . koi8-u)
+   (valid-codes (0 . 127) 163 164 166 167 173 179 182 183 189 (192 . 255))
+   (charset-origin-alist (cyrillic-iso8859-5 "KOI8-U"
+					     cyrillic-encode-koi8-u-char))))
+
+(define-coding-system-alias 'koi8-u 'cyrillic-koi8-u)
+
+(define-ccl-program ccl-encode-koi8-u-font
+  `(0
+    ((translate-character cyrillic-koi8-u-encode-table r0 r1)))
+  "CCL program to encode Cyrillic chars to KOI8-U font.")
+
+(setq font-ccl-encoder-alist
+      (cons '("koi8-u" . ccl-encode-koi8-u-font) font-ccl-encoder-alist))
+
+(set-language-info-alist
+ "Cyrillic-KOI8-U" `((charset cyrillic-iso8859-5)
+		   (nonascii-translation
+		    . ,(get 'cyrillic-koi8-u-nonascii-translation-table
+			    'translation-table))
+		   (coding-system cyrillic-koi8-u)
+		   (coding-priority cyrillic-koi8-u)
+		   (input-method . "cyrillic-ukrainian")
+		   (features cyril-util)
+		   (unibyte-display . cyrillic-koi8-u)
+		   (sample-text . "Ukrainian (,LCZ`Pw]alZP(B)	,L4^Q`^S^(B ,LT]o(B!")
+		   (documentation . "Support for Cyrillic KOI8-U."))
+ '("Cyrillic"))
+
 ;; KOI-8 staff
 
 (defvar cyrillic-koi8-r-decode-table
--- emacs-21.1/lisp/textmodes/ispell.el	Fri Sep  7 18:35:56 2001
+++ emacs-21.1-uk/lisp/textmodes/ispell.el	Thu Nov  8 21:34:42 2001
@@ -486,6 +486,7 @@
 		       (choice :tag "Character set"
 			       (const iso-8859-1)
 			       (const iso-8859-2)
+			       (const koi8-u)
 			       (const koi8-r))))
   :group 'ispell)
 
@@ -611,6 +612,10 @@
     "[\341\342\367\347\344\345\263\366\372\351\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\370\371\377\374\340\361\301\302\327\307\304\305\243\326\332\311\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\330\331\337\334\300\321]"
     "[^\341\342\367\347\344\345\263\366\372\351\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\370\371\377\374\340\361\301\302\327\307\304\305\243\326\332\311\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\330\331\337\334\300\321]"
     "" nil ("-d" "russian") nil koi8-r)
+   ("ukrainian"
+    "[\341\342\367\347\275\344\345\264\366\372\351\266\267\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\340\361\370\301\302\327\307\255\304\305\244\326\332\311\246\247\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\300\321\330]"
+    "[^\341\342\367\347\275\344\345\264\366\372\351\266\267\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\340\361\370\301\302\327\307\255\304\305\244\326\332\311\246\247\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\300\321\330]"
+    "[\']" nil ("-C" "-d" "ukrainian") nil koi8-u)
    ("svenska"				; Swedish mode
     "[A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]"
     "[^A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]"
 
design & coding: Vladimir Lettiev aka crux © 2004-2005